From 41b85d50a865cfe4aa0f06a62f5209358422eaec Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Thu, 22 Jun 2023 13:01:58 +0200 Subject: [PATCH] fix(components): prefix `@headlessui/vue` components Resolves #315 --- src/runtime/app.config.ts | 10 ++++ src/runtime/components/elements/Dropdown.vue | 33 +++++++------ src/runtime/components/forms/SelectMenu.vue | 46 +++++++++++-------- src/runtime/components/forms/Toggle.vue | 9 ++-- .../components/navigation/CommandPalette.vue | 18 ++++---- .../navigation/CommandPaletteGroup.vue | 8 ++-- .../components/overlays/ContextMenu.vue | 4 +- src/runtime/components/overlays/Modal.vue | 15 +++--- .../components/overlays/Notification.vue | 4 +- src/runtime/components/overlays/Popover.vue | 24 +++++----- src/runtime/components/overlays/Slideover.vue | 15 +++--- src/runtime/components/overlays/Tooltip.vue | 6 +-- 12 files changed, 104 insertions(+), 88 deletions(-) diff --git a/src/runtime/app.config.ts b/src/runtime/app.config.ts index 17dabd65..7cf2dbff 100644 --- a/src/runtime/app.config.ts +++ b/src/runtime/app.config.ts @@ -243,6 +243,7 @@ const dropdown = { }, shortcuts: 'hidden md:inline-flex flex-shrink-0 gap-0.5 ml-auto' }, + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { enterActiveClass: 'transition duration-100 ease-out', enterFromClass: 'transform scale-95 opacity-0', @@ -458,6 +459,7 @@ const selectMenu = { base: 'flex-shrink-0 w-2 h-2 mx-1 rounded-full' } }, + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { leaveActiveClass: 'transition ease-in duration-100', leaveFromClass: 'opacity-100', @@ -730,6 +732,7 @@ const modal = { overlay: { base: 'fixed inset-0 transition-opacity', background: 'bg-gray-200/75 dark:bg-gray-800/75', + // Syntax for `` component https://headlessui.com/vue/transition#basic-example transition: { enter: 'ease-out duration-300', enterFrom: 'opacity-0', @@ -745,6 +748,7 @@ const modal = { shadow: 'shadow-xl', width: 'sm:max-w-lg', height: '', + // Syntax for `` component https://headlessui.com/vue/transition#basic-example transition: { enter: 'ease-out duration-300', enterFrom: 'opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95', @@ -760,6 +764,7 @@ const slideover = { overlay: { base: 'fixed inset-0 transition-opacity', background: 'bg-gray-200/75 dark:bg-gray-800/75', + // Syntax for `` component https://headlessui.com/vue/transition#basic-example transition: { enter: 'ease-in-out duration-500', enterFrom: 'opacity-0', @@ -776,6 +781,7 @@ const slideover = { padding: '', shadow: 'shadow-xl', width: 'w-screen max-w-md', + // Syntax for `` component https://headlessui.com/vue/transition#basic-example transition: { enter: 'transform transition ease-in-out duration-300', leave: 'transform transition ease-in-out duration-200' @@ -793,6 +799,7 @@ const tooltip = { ring: 'ring-1 ring-gray-200 dark:ring-gray-800', base: 'invisible lg:visible h-6 px-2 py-1 text-xs font-normal truncate', shortcuts: 'hidden md:inline-flex flex-shrink-0 gap-0.5', + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { enterActiveClass: 'transition ease-out duration-200', enterFromClass: 'opacity-0 translate-y-1', @@ -815,6 +822,7 @@ const popover = { rounded: 'rounded-md', ring: 'ring-1 ring-gray-200 dark:ring-gray-800', base: 'overflow-hidden focus:outline-none', + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { enterActiveClass: 'transition ease-out duration-200', enterFromClass: 'opacity-0 translate-y-1', @@ -837,6 +845,7 @@ const contextMenu = { rounded: 'rounded-md', ring: 'ring-1 ring-gray-200 dark:ring-gray-800', base: 'overflow-hidden focus:outline-none', + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { enterActiveClass: 'transition ease-out duration-200', enterFromClass: 'opacity-0 translate-y-1', @@ -873,6 +882,7 @@ const notification = { base: 'absolute bottom-0 left-0 right-0 h-1', background: 'bg-{color}-500 dark:bg-{color}-400' }, + // Syntax for `` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions transition: { enterActiveClass: 'transform ease-out duration-300 transition', enterFromClass: 'translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2', diff --git a/src/runtime/components/elements/Dropdown.vue b/src/runtime/components/elements/Dropdown.vue index 9f1eab97..c99b4bbc 100644 --- a/src/runtime/components/elements/Dropdown.vue +++ b/src/runtime/components/elements/Dropdown.vue @@ -1,6 +1,6 @@