@nuxt/ui 3.0.0-alpha.2 → 3.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -51
- package/cli/commands/init.mjs +1 -1
- package/cli/templates.mjs +1 -1
- package/dist/module.d.mts +5 -5
- package/dist/module.d.ts +5 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +117 -89
- package/dist/runtime/components/Accordion.vue +2 -0
- package/dist/runtime/components/Alert.vue +2 -2
- package/dist/runtime/components/Breadcrumb.vue +2 -0
- package/dist/runtime/components/CommandPalette.vue +12 -2
- package/dist/runtime/components/ContextMenu.vue +2 -0
- package/dist/runtime/components/Drawer.vue +15 -7
- package/dist/runtime/components/DropdownMenu.vue +2 -0
- package/dist/runtime/components/InputMenu.vue +3 -1
- package/dist/runtime/components/NavigationMenu.vue +2 -0
- package/dist/runtime/components/Pagination.vue +10 -5
- package/dist/runtime/components/Progress.vue +2 -0
- package/dist/runtime/components/SelectMenu.vue +14 -7
- package/dist/runtime/components/Tabs.vue +2 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useFormField.d.ts +3 -3
- package/dist/runtime/composables/useModal.d.ts +2 -2
- package/dist/runtime/composables/useSlideover.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +1 -1
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +42 -42
- package/dist/runtime/utils/form.d.ts +1 -1
- package/dist/runtime/utils/link.d.ts +3 -1
- package/dist/runtime/utils/link.js +1 -1
- package/package.json +7 -7
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defuFn, defu } from 'defu';
|
|
2
2
|
import { addTemplate, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, hasNuxtModule, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
|
|
3
|
-
import
|
|
3
|
+
import 'node:url';
|
|
4
4
|
import { kebabCase } from 'scule';
|
|
5
5
|
|
|
6
6
|
const accordion = {
|
|
@@ -8,7 +8,7 @@ const accordion = {
|
|
|
8
8
|
root: "w-full",
|
|
9
9
|
item: "border-b border-gray-200 dark:border-gray-800 last:border-b-0",
|
|
10
10
|
header: "flex",
|
|
11
|
-
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-primary-500 dark:focus-visible:outline-primary-400",
|
|
11
|
+
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-primary-500 dark:focus-visible:outline-primary-400 min-w-0",
|
|
12
12
|
content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
|
|
13
13
|
body: "text-sm pb-3.5",
|
|
14
14
|
leadingIcon: "shrink-0 size-5",
|
|
@@ -38,7 +38,7 @@ const alert = (options) => ({
|
|
|
38
38
|
},
|
|
39
39
|
variants: {
|
|
40
40
|
color: {
|
|
41
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
41
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
42
42
|
gray: ""
|
|
43
43
|
},
|
|
44
44
|
variant: {
|
|
@@ -58,25 +58,25 @@ const alert = (options) => ({
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
61
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
62
62
|
color,
|
|
63
63
|
variant: "solid",
|
|
64
64
|
class: {
|
|
65
65
|
root: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
|
66
66
|
}
|
|
67
|
-
})), ...options.colors.map((color) => ({
|
|
67
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
68
68
|
color,
|
|
69
69
|
variant: "outline",
|
|
70
70
|
class: {
|
|
71
71
|
root: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
|
72
72
|
}
|
|
73
|
-
})), ...options.colors.map((color) => ({
|
|
73
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
74
74
|
color,
|
|
75
75
|
variant: "soft",
|
|
76
76
|
class: {
|
|
77
77
|
root: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
|
78
78
|
}
|
|
79
|
-
})), ...options.colors.map((color) => ({
|
|
79
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
80
80
|
color,
|
|
81
81
|
variant: "subtle",
|
|
82
82
|
class: {
|
|
@@ -201,7 +201,7 @@ const badge = (options) => ({
|
|
|
201
201
|
base: "rounded-md font-medium inline-flex items-center",
|
|
202
202
|
variants: {
|
|
203
203
|
color: {
|
|
204
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
204
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
205
205
|
gray: ""
|
|
206
206
|
},
|
|
207
207
|
variant: {
|
|
@@ -216,19 +216,19 @@ const badge = (options) => ({
|
|
|
216
216
|
lg: "text-sm px-2 py-1"
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
219
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
220
220
|
color,
|
|
221
221
|
variant: "solid",
|
|
222
222
|
class: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
|
223
|
-
})), ...options.colors.map((color) => ({
|
|
223
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
224
224
|
color,
|
|
225
225
|
variant: "outline",
|
|
226
226
|
class: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/50 dark:ring-${color}-400/50`
|
|
227
|
-
})), ...options.colors.map((color) => ({
|
|
227
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
228
228
|
color,
|
|
229
229
|
variant: "soft",
|
|
230
230
|
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
|
231
|
-
})), ...options.colors.map((color) => ({
|
|
231
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
232
232
|
color,
|
|
233
233
|
variant: "subtle",
|
|
234
234
|
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
|
@@ -292,7 +292,7 @@ const breadcrumb = (options) => ({
|
|
|
292
292
|
active: false,
|
|
293
293
|
to: true,
|
|
294
294
|
class: {
|
|
295
|
-
link: ["hover:text-gray-700 dark:hover:text-gray-200", options.theme
|
|
295
|
+
link: ["hover:text-gray-700 dark:hover:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
296
296
|
}
|
|
297
297
|
}]
|
|
298
298
|
});
|
|
@@ -334,7 +334,7 @@ const buttonGroup = {
|
|
|
334
334
|
|
|
335
335
|
const button = (options) => ({
|
|
336
336
|
slots: {
|
|
337
|
-
base: ["rounded-md font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme
|
|
337
|
+
base: ["rounded-md font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
338
338
|
label: "truncate",
|
|
339
339
|
leadingIcon: "shrink-0",
|
|
340
340
|
leadingAvatar: "shrink-0",
|
|
@@ -343,7 +343,7 @@ const button = (options) => ({
|
|
|
343
343
|
variants: {
|
|
344
344
|
...buttonGroupVariant,
|
|
345
345
|
color: {
|
|
346
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
346
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
347
347
|
gray: ""
|
|
348
348
|
},
|
|
349
349
|
variant: {
|
|
@@ -400,27 +400,27 @@ const button = (options) => ({
|
|
|
400
400
|
true: ""
|
|
401
401
|
}
|
|
402
402
|
},
|
|
403
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
403
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
404
404
|
color,
|
|
405
405
|
variant: "solid",
|
|
406
406
|
class: `text-white dark:text-gray-900 bg-${color}-500 hover:bg-${color}-600 disabled:bg-${color}-500 aria-disabled:bg-${color}-500 dark:bg-${color}-400 dark:hover:bg-${color}-500 dark:disabled:bg-${color}-400 dark:aria-disabled:bg-${color}-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
|
407
|
-
})), ...options.colors.map((color) => ({
|
|
407
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
408
408
|
color,
|
|
409
409
|
variant: "outline",
|
|
410
410
|
class: `ring ring-inset ring-${color}-500/50 dark:ring-${color}-400/50 text-${color}-500 dark:text-${color}-400 hover:bg-${color}-500/10 disabled:bg-transparent aria-disabled:bg-transparent dark:hover:bg-${color}-400/10 dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
|
411
|
-
})), ...options.colors.map((color) => ({
|
|
411
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
412
412
|
color,
|
|
413
413
|
variant: "soft",
|
|
414
414
|
class: `text-${color}-500 dark:text-${color}-400 bg-${color}-500/10 hover:bg-${color}-500/15 focus-visible:bg-${color}-500/15 disabled:bg-${color}-500/10 aria-disabled:bg-${color}-500/10 dark:bg-${color}-400/10 dark:hover:bg-${color}-400/15 dark:focus-visible:bg-${color}-400/15 dark:disabled:bg-${color}-400/10 dark:aria-disabled:bg-${color}-400/10`
|
|
415
|
-
})), ...options.colors.map((color) => ({
|
|
415
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
416
416
|
color,
|
|
417
417
|
variant: "subtle",
|
|
418
418
|
class: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25 bg-${color}-500/10 hover:bg-${color}-500/15 disabled:bg-${color}-500/10 aria-disabled:bg-${color}-500/10 dark:bg-${color}-400/10 dark:hover:bg-${color}-400/15 dark:disabled:bg-${color}-400/10 dark:aria-disabled:bg-${color}-400/10 focus-visible:ring-2 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
|
419
|
-
})), ...options.colors.map((color) => ({
|
|
419
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
420
420
|
color,
|
|
421
421
|
variant: "ghost",
|
|
422
422
|
class: `text-${color}-500 dark:text-${color}-400 hover:bg-${color}-500/10 focus-visible:bg-${color}-500/10 disabled:bg-transparent aria-disabled:bg-transparent dark:hover:bg-${color}-400/10 dark:focus-visible:bg-${color}-400/10 dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
|
|
423
|
-
})), ...options.colors.map((color) => ({
|
|
423
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
424
424
|
color,
|
|
425
425
|
variant: "link",
|
|
426
426
|
class: `text-${color}-500 hover:text-${color}-600 disabled:text-${color}-500 aria-disabled:text-${color}-500 dark:text-${color}-400 dark:hover:text-${color}-500 dark:disabled:text-${color}-400 dark:aria-disabled:text-${color}-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
|
@@ -510,7 +510,7 @@ const checkbox = (options) => ({
|
|
|
510
510
|
},
|
|
511
511
|
variants: {
|
|
512
512
|
color: {
|
|
513
|
-
...Object.fromEntries(options.colors.map((color) => [color, `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`])),
|
|
513
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`])),
|
|
514
514
|
gray: "focus-visible:outline-gray-900 dark:focus-visible:outline-white"
|
|
515
515
|
},
|
|
516
516
|
size: {
|
|
@@ -556,7 +556,7 @@ const checkbox = (options) => ({
|
|
|
556
556
|
true: ""
|
|
557
557
|
}
|
|
558
558
|
},
|
|
559
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
559
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
560
560
|
color,
|
|
561
561
|
checked: true,
|
|
562
562
|
class: `ring-2 ring-${color}-500 dark:ring-${color}-400 bg-${color}-500 dark:bg-${color}-400`
|
|
@@ -578,7 +578,7 @@ const chip = (options) => ({
|
|
|
578
578
|
},
|
|
579
579
|
variants: {
|
|
580
580
|
color: {
|
|
581
|
-
...Object.fromEntries(options.colors.map((color) => [color, `bg-${color}-500 dark:bg-${color}-400`])),
|
|
581
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-${color}-500 dark:bg-${color}-400`])),
|
|
582
582
|
gray: "bg-gray-500 dark:bg-gray-400"
|
|
583
583
|
},
|
|
584
584
|
size: {
|
|
@@ -638,7 +638,7 @@ const collapsible = {
|
|
|
638
638
|
|
|
639
639
|
const commandPalette = (options) => ({
|
|
640
640
|
slots: {
|
|
641
|
-
root: "flex flex-col min-h-0 divide-y divide-gray-200 dark:divide-gray-800",
|
|
641
|
+
root: "flex flex-col min-h-0 min-w-0 divide-y divide-gray-200 dark:divide-gray-800",
|
|
642
642
|
input: "[&>input]:h-12",
|
|
643
643
|
close: "",
|
|
644
644
|
content: "relative overflow-hidden",
|
|
@@ -646,8 +646,8 @@ const commandPalette = (options) => ({
|
|
|
646
646
|
group: "p-1 isolate",
|
|
647
647
|
empty: "py-6 text-center text-sm",
|
|
648
648
|
label: "px-2 py-1.5 text-xs font-semibold text-gray-900 dark:text-white",
|
|
649
|
-
item: ["group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme
|
|
650
|
-
itemLeadingIcon: ["shrink-0 size-5 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme
|
|
649
|
+
item: ["group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
650
|
+
itemLeadingIcon: ["shrink-0 size-5 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme.transitions && "transition-colors"],
|
|
651
651
|
itemLeadingAvatar: "shrink-0",
|
|
652
652
|
itemLeadingAvatarSize: "2xs",
|
|
653
653
|
itemLeadingChip: "shrink-0 size-5",
|
|
@@ -692,8 +692,8 @@ const contextMenu = (options) => ({
|
|
|
692
692
|
itemLeadingIcon: "text-gray-700 dark:text-gray-200"
|
|
693
693
|
},
|
|
694
694
|
false: {
|
|
695
|
-
item: ["text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme
|
|
696
|
-
itemLeadingIcon: ["text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme
|
|
695
|
+
item: ["text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
696
|
+
itemLeadingIcon: ["text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
697
697
|
}
|
|
698
698
|
},
|
|
699
699
|
size: {
|
|
@@ -752,15 +752,48 @@ const contextMenu = (options) => ({
|
|
|
752
752
|
const drawer = {
|
|
753
753
|
slots: {
|
|
754
754
|
overlay: "fixed inset-0 z-50 bg-gray-200/75 dark:bg-gray-800/75",
|
|
755
|
-
content: "fixed
|
|
756
|
-
handle: "
|
|
757
|
-
container: "
|
|
755
|
+
content: "fixed z-50 bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 flex focus:outline-none",
|
|
756
|
+
handle: "shrink-0 rounded-full bg-gray-200 dark:bg-gray-700",
|
|
757
|
+
container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
|
|
758
758
|
header: "",
|
|
759
759
|
title: "text-gray-900 dark:text-white font-semibold",
|
|
760
760
|
description: "mt-1 text-gray-500 dark:text-gray-400 text-sm",
|
|
761
761
|
body: "flex-1",
|
|
762
762
|
footer: "flex flex-col gap-1.5"
|
|
763
|
-
}
|
|
763
|
+
},
|
|
764
|
+
variants: {
|
|
765
|
+
direction: {
|
|
766
|
+
top: {
|
|
767
|
+
content: "top-0 mb-24 flex-col-reverse rounded-b-lg",
|
|
768
|
+
handle: "mb-4"
|
|
769
|
+
},
|
|
770
|
+
right: {
|
|
771
|
+
content: "right-4 flex-row",
|
|
772
|
+
handle: "ml-4"
|
|
773
|
+
},
|
|
774
|
+
bottom: {
|
|
775
|
+
content: "bottom-0 mt-24 flex-col rounded-t-lg",
|
|
776
|
+
handle: "mt-4"
|
|
777
|
+
},
|
|
778
|
+
left: {
|
|
779
|
+
content: "left-4 flex-row-reverse",
|
|
780
|
+
handle: "mr-4"
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
compoundVariants: [{
|
|
785
|
+
direction: ["top", "bottom"],
|
|
786
|
+
class: {
|
|
787
|
+
content: "inset-x-0 h-auto max-h-[96%]",
|
|
788
|
+
handle: "w-12 h-1.5 mx-auto"
|
|
789
|
+
}
|
|
790
|
+
}, {
|
|
791
|
+
direction: ["right", "left"],
|
|
792
|
+
class: {
|
|
793
|
+
content: "inset-y-4 w-auto max-w-[calc(100%-2rem)] rounded-lg after:hidden",
|
|
794
|
+
handle: "h-12 w-1.5 mt-auto mb-auto"
|
|
795
|
+
}
|
|
796
|
+
}]
|
|
764
797
|
};
|
|
765
798
|
|
|
766
799
|
const dropdownMenu = (options) => ({
|
|
@@ -788,8 +821,8 @@ const dropdownMenu = (options) => ({
|
|
|
788
821
|
itemLeadingIcon: "text-gray-700 dark:text-gray-200"
|
|
789
822
|
},
|
|
790
823
|
false: {
|
|
791
|
-
item: ["text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme
|
|
792
|
-
itemLeadingIcon: ["text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme
|
|
824
|
+
item: ["text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
825
|
+
itemLeadingIcon: ["text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
793
826
|
}
|
|
794
827
|
},
|
|
795
828
|
size: {
|
|
@@ -883,7 +916,7 @@ const formField = {
|
|
|
883
916
|
const input = (options) => ({
|
|
884
917
|
slots: {
|
|
885
918
|
root: "relative inline-flex items-center",
|
|
886
|
-
base: ["w-full rounded-md border-0 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme
|
|
919
|
+
base: ["w-full rounded-md border-0 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
887
920
|
leading: "absolute inset-y-0 start-0 flex items-center",
|
|
888
921
|
leadingIcon: "shrink-0 text-gray-400 dark:text-gray-500",
|
|
889
922
|
leadingAvatar: "shrink-0",
|
|
@@ -937,7 +970,7 @@ const input = (options) => ({
|
|
|
937
970
|
none: "text-gray-900 dark:text-white"
|
|
938
971
|
},
|
|
939
972
|
color: {
|
|
940
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
973
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
941
974
|
gray: ""
|
|
942
975
|
},
|
|
943
976
|
leading: {
|
|
@@ -956,11 +989,11 @@ const input = (options) => ({
|
|
|
956
989
|
file: "file:mr-1.5 file:font-medium file:text-gray-500 dark:file:text-gray-400 file:outline-none"
|
|
957
990
|
}
|
|
958
991
|
},
|
|
959
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
992
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
960
993
|
color,
|
|
961
994
|
variant: ["outline", "subtle"],
|
|
962
995
|
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
|
963
|
-
})), ...options.colors.map((color) => ({
|
|
996
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
964
997
|
color,
|
|
965
998
|
highlight: true,
|
|
966
999
|
class: `ring ring-inset ring-${color}-500 dark:ring-${color}-400`
|
|
@@ -1036,8 +1069,8 @@ const input = (options) => ({
|
|
|
1036
1069
|
const inputMenu = (options) => {
|
|
1037
1070
|
return defuFn({
|
|
1038
1071
|
slots: {
|
|
1039
|
-
base: () => ["rounded-md", options.theme
|
|
1040
|
-
trailing: "absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
|
|
1072
|
+
base: () => ["rounded-md", options.theme.transitions && "transition-colors"],
|
|
1073
|
+
trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
|
|
1041
1074
|
arrow: "fill-gray-200 dark:fill-gray-800",
|
|
1042
1075
|
content: "max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1043
1076
|
viewport: "divide-y divide-gray-200 dark:divide-gray-800 scroll-py-1",
|
|
@@ -1045,8 +1078,8 @@ const inputMenu = (options) => {
|
|
|
1045
1078
|
empty: "py-2 text-center text-sm text-gray-500 dark:text-gray-400",
|
|
1046
1079
|
label: "font-semibold text-gray-900 dark:text-white",
|
|
1047
1080
|
separator: "-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800",
|
|
1048
|
-
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme
|
|
1049
|
-
itemLeadingIcon: ["shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme
|
|
1081
|
+
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1082
|
+
itemLeadingIcon: ["shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme.transitions && "transition-colors"],
|
|
1050
1083
|
itemLeadingAvatar: "shrink-0",
|
|
1051
1084
|
itemLeadingAvatarSize: "",
|
|
1052
1085
|
itemLeadingChip: "shrink-0",
|
|
@@ -1056,7 +1089,7 @@ const inputMenu = (options) => {
|
|
|
1056
1089
|
itemLabel: "truncate",
|
|
1057
1090
|
tagsItem: "px-1.5 py-0.5 rounded font-medium inline-flex items-center gap-0.5 ring ring-inset ring-gray-300 dark:ring-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
1058
1091
|
tagsItemText: "truncate",
|
|
1059
|
-
tagsItemDelete: ["inline-flex items-center rounded-sm text-gray-400 dark:text-gray-500 hover:text-gray-700 hover:bg-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-700/50 disabled:pointer-events-none", options.theme
|
|
1092
|
+
tagsItemDelete: ["inline-flex items-center rounded-sm text-gray-400 dark:text-gray-500 hover:text-gray-700 hover:bg-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-700/50 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
|
|
1060
1093
|
tagsItemDeleteIcon: "",
|
|
1061
1094
|
tagsInput: "border-0 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1062
1095
|
},
|
|
@@ -1128,7 +1161,7 @@ const inputMenu = (options) => {
|
|
|
1128
1161
|
}
|
|
1129
1162
|
}
|
|
1130
1163
|
},
|
|
1131
|
-
compoundVariants: [...options.colors.map((color) => ({
|
|
1164
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1132
1165
|
color,
|
|
1133
1166
|
multiple: true,
|
|
1134
1167
|
variant: ["outline", "subtle"],
|
|
@@ -1167,7 +1200,7 @@ const link = (options) => ({
|
|
|
1167
1200
|
variants: {
|
|
1168
1201
|
active: {
|
|
1169
1202
|
true: "text-primary-500 dark:text-primary-400",
|
|
1170
|
-
false: ["text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200", options.theme
|
|
1203
|
+
false: ["text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
1171
1204
|
},
|
|
1172
1205
|
disabled: {
|
|
1173
1206
|
true: "cursor-not-allowed opacity-75"
|
|
@@ -1237,7 +1270,7 @@ const navigationMenu = (options) => ({
|
|
|
1237
1270
|
},
|
|
1238
1271
|
variants: {
|
|
1239
1272
|
color: {
|
|
1240
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
1273
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1241
1274
|
link: `focus-visible:before:ring-${color}-500 dark:focus-visible:before:ring-${color}-400`,
|
|
1242
1275
|
childLink: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
|
1243
1276
|
}])),
|
|
@@ -1247,7 +1280,7 @@ const navigationMenu = (options) => ({
|
|
|
1247
1280
|
}
|
|
1248
1281
|
},
|
|
1249
1282
|
highlightColor: {
|
|
1250
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
1283
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
1251
1284
|
gray: ""
|
|
1252
1285
|
},
|
|
1253
1286
|
variant: {
|
|
@@ -1274,8 +1307,8 @@ const navigationMenu = (options) => ({
|
|
|
1274
1307
|
false: {
|
|
1275
1308
|
link: "text-gray-500 dark:text-gray-400",
|
|
1276
1309
|
linkLeadingIcon: "text-gray-400 dark:text-gray-500",
|
|
1277
|
-
childLink: ["hover:bg-gray-50 dark:hover:bg-gray-800/50 text-gray-700 dark:text-gray-200 hover:text-gray-900 dark:hover:text-white", options.theme
|
|
1278
|
-
childLinkIcon: ["text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200", options.theme
|
|
1310
|
+
childLink: ["hover:bg-gray-50 dark:hover:bg-gray-800/50 text-gray-700 dark:text-gray-200 hover:text-gray-900 dark:hover:text-white", options.theme.transitions && "transition-colors"],
|
|
1311
|
+
childLinkIcon: ["text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
1279
1312
|
}
|
|
1280
1313
|
},
|
|
1281
1314
|
disabled: {
|
|
@@ -1306,10 +1339,10 @@ const navigationMenu = (options) => ({
|
|
|
1306
1339
|
active: false,
|
|
1307
1340
|
variant: "pill",
|
|
1308
1341
|
class: {
|
|
1309
|
-
link: ["hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50 data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme
|
|
1310
|
-
linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme
|
|
1342
|
+
link: ["hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50 data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1343
|
+
linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
1311
1344
|
}
|
|
1312
|
-
}, ...options.colors.map((color) => ({
|
|
1345
|
+
}, ...(options.theme.colors || []).map((color) => ({
|
|
1313
1346
|
color,
|
|
1314
1347
|
variant: "pill",
|
|
1315
1348
|
active: true,
|
|
@@ -1337,17 +1370,17 @@ const navigationMenu = (options) => ({
|
|
|
1337
1370
|
active: true,
|
|
1338
1371
|
highlight: true,
|
|
1339
1372
|
class: {
|
|
1340
|
-
link: ["hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50", options.theme
|
|
1373
|
+
link: ["hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50", options.theme.transitions && "before:transition-colors"]
|
|
1341
1374
|
}
|
|
1342
1375
|
}, {
|
|
1343
1376
|
disabled: false,
|
|
1344
1377
|
active: false,
|
|
1345
1378
|
variant: "link",
|
|
1346
1379
|
class: {
|
|
1347
|
-
link: ["hover:text-gray-900 dark:hover:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white", options.theme
|
|
1348
|
-
linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme
|
|
1380
|
+
link: ["hover:text-gray-900 dark:hover:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white", options.theme.transitions && "transition-colors"],
|
|
1381
|
+
linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200", options.theme.transitions && "transition-colors"]
|
|
1349
1382
|
}
|
|
1350
|
-
}, ...options.colors.map((color) => ({
|
|
1383
|
+
}, ...(options.theme.colors || []).map((color) => ({
|
|
1351
1384
|
color,
|
|
1352
1385
|
variant: "link",
|
|
1353
1386
|
active: true,
|
|
@@ -1363,7 +1396,7 @@ const navigationMenu = (options) => ({
|
|
|
1363
1396
|
link: "text-gray-900 dark:text-white",
|
|
1364
1397
|
linkLeadingIcon: "text-gray-900 dark:text-white"
|
|
1365
1398
|
}
|
|
1366
|
-
}, ...options.colors.map((highlightColor) => ({
|
|
1399
|
+
}, ...(options.theme.colors || []).map((highlightColor) => ({
|
|
1367
1400
|
highlightColor,
|
|
1368
1401
|
highlight: true,
|
|
1369
1402
|
active: true,
|
|
@@ -1418,7 +1451,7 @@ const progress = (options) => ({
|
|
|
1418
1451
|
"elastic": ""
|
|
1419
1452
|
},
|
|
1420
1453
|
color: {
|
|
1421
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
1454
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1422
1455
|
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
|
1423
1456
|
steps: `text-${color}-500 dark:text-${color}-400`
|
|
1424
1457
|
}])),
|
|
@@ -1630,7 +1663,7 @@ const radioGroup = (options) => ({
|
|
|
1630
1663
|
},
|
|
1631
1664
|
variants: {
|
|
1632
1665
|
color: {
|
|
1633
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
1666
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1634
1667
|
base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
|
|
1635
1668
|
indicator: `bg-${color}-500 dark:bg-${color}-400`
|
|
1636
1669
|
}])),
|
|
@@ -1712,7 +1745,7 @@ const select = (options) => {
|
|
|
1712
1745
|
return defuFn({
|
|
1713
1746
|
slots: {
|
|
1714
1747
|
root: () => void 0,
|
|
1715
|
-
base: () => ["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme
|
|
1748
|
+
base: () => ["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1716
1749
|
value: "truncate group-data-placeholder:text-current/50",
|
|
1717
1750
|
arrow: "fill-gray-200 dark:fill-gray-800",
|
|
1718
1751
|
content: "max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
@@ -1721,8 +1754,8 @@ const select = (options) => {
|
|
|
1721
1754
|
empty: "py-2 text-center text-sm text-gray-500 dark:text-gray-400",
|
|
1722
1755
|
label: "font-semibold text-gray-900 dark:text-white",
|
|
1723
1756
|
separator: "-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800",
|
|
1724
|
-
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme
|
|
1725
|
-
itemLeadingIcon: ["shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme
|
|
1757
|
+
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1758
|
+
itemLeadingIcon: ["shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200", options.theme.transitions && "transition-colors"],
|
|
1726
1759
|
itemLeadingAvatar: "shrink-0",
|
|
1727
1760
|
itemLeadingAvatarSize: "",
|
|
1728
1761
|
itemLeadingChip: "shrink-0",
|
|
@@ -1825,7 +1858,7 @@ const separator = (options) => ({
|
|
|
1825
1858
|
},
|
|
1826
1859
|
variants: {
|
|
1827
1860
|
color: {
|
|
1828
|
-
...Object.fromEntries(options.colors.map((color) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
|
|
1861
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
|
|
1829
1862
|
gray: { border: "border-gray-200 dark:border-gray-800" }
|
|
1830
1863
|
},
|
|
1831
1864
|
orientation: {
|
|
@@ -1979,7 +2012,7 @@ const slider = (options) => ({
|
|
|
1979
2012
|
},
|
|
1980
2013
|
variants: {
|
|
1981
2014
|
color: {
|
|
1982
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
2015
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1983
2016
|
range: `bg-${color}-500 dark:bg-${color}-400`,
|
|
1984
2017
|
thumb: `ring-${color}-500 dark:ring-${color}-400 focus-visible:outline-${color}-500/50 dark:focus-visible:outline-${color}-400/50`
|
|
1985
2018
|
}])),
|
|
@@ -2091,17 +2124,17 @@ const slider = (options) => ({
|
|
|
2091
2124
|
const _switch = (options) => ({
|
|
2092
2125
|
slots: {
|
|
2093
2126
|
root: "relative flex items-start",
|
|
2094
|
-
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 data-[state=unchecked]:bg-gray-200 dark:data-[state=unchecked]:bg-gray-700", options.theme
|
|
2127
|
+
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 data-[state=unchecked]:bg-gray-200 dark:data-[state=unchecked]:bg-gray-700", options.theme.transitions && "transition-colors duration-200"],
|
|
2095
2128
|
container: "flex items-center",
|
|
2096
2129
|
thumb: "group pointer-events-none block rounded-full bg-white dark:bg-gray-900 shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 flex items-center justify-center",
|
|
2097
|
-
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-gray-400 dark:group-data-[state=unchecked]:text-gray-500 opacity-0 size-10/12", options.theme
|
|
2130
|
+
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-gray-400 dark:group-data-[state=unchecked]:text-gray-500 opacity-0 size-10/12", options.theme.transitions && "transition-[color,opacity] duration-200"],
|
|
2098
2131
|
wrapper: "ms-2",
|
|
2099
2132
|
label: "block font-medium text-gray-700 dark:text-gray-200",
|
|
2100
2133
|
description: "text-gray-500 dark:text-gray-400"
|
|
2101
2134
|
},
|
|
2102
2135
|
variants: {
|
|
2103
2136
|
color: {
|
|
2104
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
2137
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2105
2138
|
base: `data-[state=checked]:bg-${color}-500 dark:data-[state=checked]:bg-${color}-400 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`,
|
|
2106
2139
|
icon: `group-data-[state=checked]:text-${color}-500 dark:group-data-[state=checked]:text-${color}-400`
|
|
2107
2140
|
}])),
|
|
@@ -2181,7 +2214,7 @@ const tabs = (options) => ({
|
|
|
2181
2214
|
root: "flex items-center gap-2",
|
|
2182
2215
|
list: "relative flex p-1 group",
|
|
2183
2216
|
indicator: "absolute transition-[translate,width] duration-200",
|
|
2184
|
-
trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-gray-500 dark:data-[state=inactive]:text-gray-400 hover:data-[state=inactive]:text-gray-700 dark:hover:data-[state=inactive]:text-gray-200 font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", options.theme
|
|
2217
|
+
trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-gray-500 dark:data-[state=inactive]:text-gray-400 hover:data-[state=inactive]:text-gray-700 dark:hover:data-[state=inactive]:text-gray-200 font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", options.theme.transitions && "transition-colors"],
|
|
2185
2218
|
content: "focus:outline-none w-full",
|
|
2186
2219
|
leadingIcon: "shrink-0",
|
|
2187
2220
|
leadingAvatar: "shrink-0",
|
|
@@ -2190,7 +2223,7 @@ const tabs = (options) => ({
|
|
|
2190
2223
|
},
|
|
2191
2224
|
variants: {
|
|
2192
2225
|
color: {
|
|
2193
|
-
...Object.fromEntries(options.colors.map((color) => [color, ""])),
|
|
2226
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
2194
2227
|
gray: ""
|
|
2195
2228
|
},
|
|
2196
2229
|
variant: {
|
|
@@ -2271,7 +2304,7 @@ const tabs = (options) => ({
|
|
|
2271
2304
|
list: "border-l",
|
|
2272
2305
|
indicator: "-left-px w-px"
|
|
2273
2306
|
}
|
|
2274
|
-
}, ...options.colors.map((color) => ({
|
|
2307
|
+
}, ...(options.theme.colors || []).map((color) => ({
|
|
2275
2308
|
color,
|
|
2276
2309
|
variant: "pill",
|
|
2277
2310
|
class: {
|
|
@@ -2285,7 +2318,7 @@ const tabs = (options) => ({
|
|
|
2285
2318
|
indicator: "bg-gray-900 dark:bg-white",
|
|
2286
2319
|
trigger: "data-[state=active]:text-white dark:data-[state=active]:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900 dark:focus-visible:outline-white"
|
|
2287
2320
|
}
|
|
2288
|
-
}, ...options.colors.map((color) => ({
|
|
2321
|
+
}, ...(options.theme.colors || []).map((color) => ({
|
|
2289
2322
|
color,
|
|
2290
2323
|
variant: "link",
|
|
2291
2324
|
class: {
|
|
@@ -2313,7 +2346,7 @@ const textarea = (options) => {
|
|
|
2313
2346
|
|
|
2314
2347
|
const toast = (options) => ({
|
|
2315
2348
|
slots: {
|
|
2316
|
-
root: "relative overflow-hidden bg-white dark:bg-gray-900 shadow-lg rounded-lg ring ring-gray-200 dark:ring-gray-800 p-4 flex gap-2.5",
|
|
2349
|
+
root: "relative group overflow-hidden bg-white dark:bg-gray-900 shadow-lg rounded-lg ring ring-gray-200 dark:ring-gray-800 p-4 flex gap-2.5 focus:outline-none",
|
|
2317
2350
|
wrapper: "w-0 flex-1 flex flex-col gap-1",
|
|
2318
2351
|
title: "text-sm font-medium text-gray-900 dark:text-white",
|
|
2319
2352
|
description: "text-sm text-gray-500 dark:text-gray-400",
|
|
@@ -2326,11 +2359,13 @@ const toast = (options) => ({
|
|
|
2326
2359
|
},
|
|
2327
2360
|
variants: {
|
|
2328
2361
|
color: {
|
|
2329
|
-
...Object.fromEntries(options.colors.map((color) => [color, {
|
|
2362
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2363
|
+
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`,
|
|
2330
2364
|
icon: `text-${color}-500 dark:text-${color}-400`,
|
|
2331
2365
|
progress: `bg-${color}-500 dark:bg-${color}-400`
|
|
2332
2366
|
}])),
|
|
2333
2367
|
gray: {
|
|
2368
|
+
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-900 dark:focus-visible:ring-white",
|
|
2334
2369
|
icon: "text-gray-900 dark:text-white",
|
|
2335
2370
|
progress: "bg-gray-900 dark:bg-white"
|
|
2336
2371
|
}
|
|
@@ -2353,7 +2388,7 @@ const toast = (options) => ({
|
|
|
2353
2388
|
|
|
2354
2389
|
const toaster = {
|
|
2355
2390
|
slots: {
|
|
2356
|
-
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[--height]",
|
|
2391
|
+
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[--height] focus:outline-none",
|
|
2357
2392
|
base: "absolute inset-x-0 z-[--index] transform-[--transform] data-[expanded=false]:data-[front=false]:h-[--front-height] data-[expanded=false]:data-[front=false]:*:invisible data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"
|
|
2358
2393
|
},
|
|
2359
2394
|
variants: {
|
|
@@ -2480,14 +2515,6 @@ function addTemplates(options, nuxt) {
|
|
|
2480
2515
|
return `${before}${replaced}${after}`;
|
|
2481
2516
|
});
|
|
2482
2517
|
}
|
|
2483
|
-
if (process.env.DEV) {
|
|
2484
|
-
return [
|
|
2485
|
-
`import template from ${JSON.stringify(fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url)))}`,
|
|
2486
|
-
`const result = typeof template === 'function' ? template(${JSON.stringify(options)}) : template`,
|
|
2487
|
-
`const json = ${json}`,
|
|
2488
|
-
`export default result as typeof json`
|
|
2489
|
-
].join("\n");
|
|
2490
|
-
}
|
|
2491
2518
|
return `export default ${json}`;
|
|
2492
2519
|
}
|
|
2493
2520
|
});
|
|
@@ -2502,13 +2529,13 @@ function addTemplates(options, nuxt) {
|
|
|
2502
2529
|
getContents: () => `import * as ui from '#build/ui'
|
|
2503
2530
|
import type { DeepPartial } from '#ui/types/utils'
|
|
2504
2531
|
|
|
2505
|
-
const colors = ${JSON.stringify(options.colors)} as const;
|
|
2532
|
+
const colors = ${JSON.stringify(options.theme?.colors || [])} as const;
|
|
2506
2533
|
const icons = ${JSON.stringify(nuxt.options.appConfig.ui.icons)};
|
|
2507
2534
|
|
|
2508
2535
|
type AppConfigUI = {
|
|
2509
2536
|
colors?: {
|
|
2510
|
-
primary?: Exclude<typeof colors[number], 'error'>
|
|
2511
|
-
error?: Exclude<typeof colors[number], 'primary'>
|
|
2537
|
+
primary?: Exclude<typeof colors[number], 'error' | 'primary'>
|
|
2538
|
+
error?: Exclude<typeof colors[number], 'primary' | 'error'>
|
|
2512
2539
|
gray?: 'slate' | 'cool' | 'zinc' | 'neutral' | 'stone'
|
|
2513
2540
|
}
|
|
2514
2541
|
icons?: Partial<typeof icons>
|
|
@@ -2550,22 +2577,23 @@ const module = defineNuxtModule({
|
|
|
2550
2577
|
},
|
|
2551
2578
|
defaults: {
|
|
2552
2579
|
prefix: "U",
|
|
2553
|
-
colors: void 0,
|
|
2554
2580
|
fonts: true,
|
|
2555
2581
|
theme: {
|
|
2582
|
+
colors: void 0,
|
|
2556
2583
|
transitions: true
|
|
2557
2584
|
}
|
|
2558
2585
|
},
|
|
2559
2586
|
async setup(options, nuxt) {
|
|
2560
2587
|
const { resolve } = createResolver(import.meta.url);
|
|
2561
|
-
options.
|
|
2588
|
+
options.theme = options.theme || {};
|
|
2589
|
+
options.theme.colors = options.theme.colors?.length ? [.../* @__PURE__ */ new Set(["primary", "error", ...options.theme.colors])] : ["primary", "error", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
|
|
2562
2590
|
nuxt.options.ui = options;
|
|
2563
2591
|
nuxt.options.alias["#ui"] = resolve("./runtime");
|
|
2564
2592
|
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
|
|
2565
2593
|
colors: {
|
|
2566
2594
|
primary: "green",
|
|
2567
2595
|
error: "red",
|
|
2568
|
-
gray: "
|
|
2596
|
+
gray: "slate"
|
|
2569
2597
|
},
|
|
2570
2598
|
icons
|
|
2571
2599
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv } from 'tailwind-variants'
|
|
3
4
|
import type { AccordionRootProps, AccordionRootEmits, AccordionItemProps } from 'radix-vue'
|
|
@@ -47,6 +48,7 @@ export type AccordionSlots<T extends { slot?: string }> = {
|
|
|
47
48
|
content: SlotProps<T>
|
|
48
49
|
body: SlotProps<T>
|
|
49
50
|
} & DynamicSlots<T, SlotProps<T>>
|
|
51
|
+
|
|
50
52
|
</script>
|
|
51
53
|
|
|
52
54
|
<script setup lang="ts" generic="T extends AccordionItem">
|