@nuxt/ui 3.0.0-alpha.2 → 3.0.0-alpha.3

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/dist/module.d.mts CHANGED
@@ -7,17 +7,17 @@ interface ModuleOptions {
7
7
  * @defaultValue U
8
8
  */
9
9
  prefix?: string;
10
- /**
11
- * Colors to generate classes for (based on TailwindCSS colors)
12
- * @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
13
- */
14
- colors?: string[];
15
10
  /**
16
11
  * Enable or disable `@nuxt/fonts` module
17
12
  * @defaultValue true
18
13
  */
19
14
  fonts?: boolean;
20
15
  theme?: {
16
+ /**
17
+ * Colors to generate classes for (defaults to TailwindCSS colors)
18
+ * @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
19
+ */
20
+ colors?: string[];
21
21
  /**
22
22
  * Enable or disable transitions on components
23
23
  * @defaultValue true
package/dist/module.d.ts CHANGED
@@ -7,17 +7,17 @@ interface ModuleOptions {
7
7
  * @defaultValue U
8
8
  */
9
9
  prefix?: string;
10
- /**
11
- * Colors to generate classes for (based on TailwindCSS colors)
12
- * @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
13
- */
14
- colors?: string[];
15
10
  /**
16
11
  * Enable or disable `@nuxt/fonts` module
17
12
  * @defaultValue true
18
13
  */
19
14
  fonts?: boolean;
20
15
  theme?: {
16
+ /**
17
+ * Colors to generate classes for (defaults to TailwindCSS colors)
18
+ * @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
19
+ */
20
+ colors?: string[];
21
21
  /**
22
22
  * Enable or disable transitions on components
23
23
  * @defaultValue true
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.13.1"
6
6
  },
7
- "version": "3.0.0-alpha.2",
7
+ "version": "3.0.0-alpha.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -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?.transitions && "transition-colors"]
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?.transitions && "transition-colors"],
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: {
@@ -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?.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"],
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?.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"]
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: {
@@ -788,8 +788,8 @@ const dropdownMenu = (options) => ({
788
788
  itemLeadingIcon: "text-gray-700 dark:text-gray-200"
789
789
  },
790
790
  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?.transitions && "transition-colors before:transition-colors"],
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?.transitions && "transition-colors"]
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.transitions && "transition-colors before:transition-colors"],
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.transitions && "transition-colors"]
793
793
  }
794
794
  },
795
795
  size: {
@@ -883,7 +883,7 @@ const formField = {
883
883
  const input = (options) => ({
884
884
  slots: {
885
885
  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?.transitions && "transition-colors"],
886
+ base: ["w-full rounded-md border-0 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
887
887
  leading: "absolute inset-y-0 start-0 flex items-center",
888
888
  leadingIcon: "shrink-0 text-gray-400 dark:text-gray-500",
889
889
  leadingAvatar: "shrink-0",
@@ -937,7 +937,7 @@ const input = (options) => ({
937
937
  none: "text-gray-900 dark:text-white"
938
938
  },
939
939
  color: {
940
- ...Object.fromEntries(options.colors.map((color) => [color, ""])),
940
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
941
941
  gray: ""
942
942
  },
943
943
  leading: {
@@ -956,11 +956,11 @@ const input = (options) => ({
956
956
  file: "file:mr-1.5 file:font-medium file:text-gray-500 dark:file:text-gray-400 file:outline-none"
957
957
  }
958
958
  },
959
- compoundVariants: [...options.colors.map((color) => ({
959
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
960
960
  color,
961
961
  variant: ["outline", "subtle"],
962
962
  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) => ({
963
+ })), ...(options.theme.colors || []).map((color) => ({
964
964
  color,
965
965
  highlight: true,
966
966
  class: `ring ring-inset ring-${color}-500 dark:ring-${color}-400`
@@ -1036,7 +1036,7 @@ const input = (options) => ({
1036
1036
  const inputMenu = (options) => {
1037
1037
  return defuFn({
1038
1038
  slots: {
1039
- base: () => ["rounded-md", options.theme?.transitions && "transition-colors"],
1039
+ base: () => ["rounded-md", options.theme.transitions && "transition-colors"],
1040
1040
  trailing: "absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
1041
1041
  arrow: "fill-gray-200 dark:fill-gray-800",
1042
1042
  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]",
@@ -1045,8 +1045,8 @@ const inputMenu = (options) => {
1045
1045
  empty: "py-2 text-center text-sm text-gray-500 dark:text-gray-400",
1046
1046
  label: "font-semibold text-gray-900 dark:text-white",
1047
1047
  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?.transitions && "transition-colors before:transition-colors"],
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?.transitions && "transition-colors"],
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.transitions && "transition-colors before:transition-colors"],
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.transitions && "transition-colors"],
1050
1050
  itemLeadingAvatar: "shrink-0",
1051
1051
  itemLeadingAvatarSize: "",
1052
1052
  itemLeadingChip: "shrink-0",
@@ -1056,7 +1056,7 @@ const inputMenu = (options) => {
1056
1056
  itemLabel: "truncate",
1057
1057
  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
1058
  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?.transitions && "transition-colors"],
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.transitions && "transition-colors"],
1060
1060
  tagsItemDeleteIcon: "",
1061
1061
  tagsInput: "border-0 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1062
1062
  },
@@ -1128,7 +1128,7 @@ const inputMenu = (options) => {
1128
1128
  }
1129
1129
  }
1130
1130
  },
1131
- compoundVariants: [...options.colors.map((color) => ({
1131
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
1132
1132
  color,
1133
1133
  multiple: true,
1134
1134
  variant: ["outline", "subtle"],
@@ -1167,7 +1167,7 @@ const link = (options) => ({
1167
1167
  variants: {
1168
1168
  active: {
1169
1169
  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?.transitions && "transition-colors"]
1170
+ false: ["text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200", options.theme.transitions && "transition-colors"]
1171
1171
  },
1172
1172
  disabled: {
1173
1173
  true: "cursor-not-allowed opacity-75"
@@ -1237,7 +1237,7 @@ const navigationMenu = (options) => ({
1237
1237
  },
1238
1238
  variants: {
1239
1239
  color: {
1240
- ...Object.fromEntries(options.colors.map((color) => [color, {
1240
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1241
1241
  link: `focus-visible:before:ring-${color}-500 dark:focus-visible:before:ring-${color}-400`,
1242
1242
  childLink: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
1243
1243
  }])),
@@ -1247,7 +1247,7 @@ const navigationMenu = (options) => ({
1247
1247
  }
1248
1248
  },
1249
1249
  highlightColor: {
1250
- ...Object.fromEntries(options.colors.map((color) => [color, ""])),
1250
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1251
1251
  gray: ""
1252
1252
  },
1253
1253
  variant: {
@@ -1274,8 +1274,8 @@ const navigationMenu = (options) => ({
1274
1274
  false: {
1275
1275
  link: "text-gray-500 dark:text-gray-400",
1276
1276
  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?.transitions && "transition-colors"],
1278
- childLinkIcon: ["text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200", options.theme?.transitions && "transition-colors"]
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.transitions && "transition-colors"],
1278
+ 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
1279
  }
1280
1280
  },
1281
1281
  disabled: {
@@ -1306,10 +1306,10 @@ const navigationMenu = (options) => ({
1306
1306
  active: false,
1307
1307
  variant: "pill",
1308
1308
  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?.transitions && "transition-colors before:transition-colors"],
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?.transitions && "transition-colors"]
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.transitions && "transition-colors before:transition-colors"],
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.transitions && "transition-colors"]
1311
1311
  }
1312
- }, ...options.colors.map((color) => ({
1312
+ }, ...(options.theme.colors || []).map((color) => ({
1313
1313
  color,
1314
1314
  variant: "pill",
1315
1315
  active: true,
@@ -1337,17 +1337,17 @@ const navigationMenu = (options) => ({
1337
1337
  active: true,
1338
1338
  highlight: true,
1339
1339
  class: {
1340
- link: ["hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50", options.theme?.transitions && "before:transition-colors"]
1340
+ link: ["hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50", options.theme.transitions && "before:transition-colors"]
1341
1341
  }
1342
1342
  }, {
1343
1343
  disabled: false,
1344
1344
  active: false,
1345
1345
  variant: "link",
1346
1346
  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?.transitions && "transition-colors"],
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?.transitions && "transition-colors"]
1347
+ 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"],
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.transitions && "transition-colors"]
1349
1349
  }
1350
- }, ...options.colors.map((color) => ({
1350
+ }, ...(options.theme.colors || []).map((color) => ({
1351
1351
  color,
1352
1352
  variant: "link",
1353
1353
  active: true,
@@ -1363,7 +1363,7 @@ const navigationMenu = (options) => ({
1363
1363
  link: "text-gray-900 dark:text-white",
1364
1364
  linkLeadingIcon: "text-gray-900 dark:text-white"
1365
1365
  }
1366
- }, ...options.colors.map((highlightColor) => ({
1366
+ }, ...(options.theme.colors || []).map((highlightColor) => ({
1367
1367
  highlightColor,
1368
1368
  highlight: true,
1369
1369
  active: true,
@@ -1418,7 +1418,7 @@ const progress = (options) => ({
1418
1418
  "elastic": ""
1419
1419
  },
1420
1420
  color: {
1421
- ...Object.fromEntries(options.colors.map((color) => [color, {
1421
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1422
1422
  indicator: `bg-${color}-500 dark:bg-${color}-400`,
1423
1423
  steps: `text-${color}-500 dark:text-${color}-400`
1424
1424
  }])),
@@ -1630,7 +1630,7 @@ const radioGroup = (options) => ({
1630
1630
  },
1631
1631
  variants: {
1632
1632
  color: {
1633
- ...Object.fromEntries(options.colors.map((color) => [color, {
1633
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1634
1634
  base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
1635
1635
  indicator: `bg-${color}-500 dark:bg-${color}-400`
1636
1636
  }])),
@@ -1712,7 +1712,7 @@ const select = (options) => {
1712
1712
  return defuFn({
1713
1713
  slots: {
1714
1714
  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?.transitions && "transition-colors"],
1715
+ 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
1716
  value: "truncate group-data-placeholder:text-current/50",
1717
1717
  arrow: "fill-gray-200 dark:fill-gray-800",
1718
1718
  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 +1721,8 @@ const select = (options) => {
1721
1721
  empty: "py-2 text-center text-sm text-gray-500 dark:text-gray-400",
1722
1722
  label: "font-semibold text-gray-900 dark:text-white",
1723
1723
  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?.transitions && "transition-colors before:transition-colors"],
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?.transitions && "transition-colors"],
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.transitions && "transition-colors before:transition-colors"],
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.transitions && "transition-colors"],
1726
1726
  itemLeadingAvatar: "shrink-0",
1727
1727
  itemLeadingAvatarSize: "",
1728
1728
  itemLeadingChip: "shrink-0",
@@ -1825,7 +1825,7 @@ const separator = (options) => ({
1825
1825
  },
1826
1826
  variants: {
1827
1827
  color: {
1828
- ...Object.fromEntries(options.colors.map((color) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
1828
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
1829
1829
  gray: { border: "border-gray-200 dark:border-gray-800" }
1830
1830
  },
1831
1831
  orientation: {
@@ -1979,7 +1979,7 @@ const slider = (options) => ({
1979
1979
  },
1980
1980
  variants: {
1981
1981
  color: {
1982
- ...Object.fromEntries(options.colors.map((color) => [color, {
1982
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1983
1983
  range: `bg-${color}-500 dark:bg-${color}-400`,
1984
1984
  thumb: `ring-${color}-500 dark:ring-${color}-400 focus-visible:outline-${color}-500/50 dark:focus-visible:outline-${color}-400/50`
1985
1985
  }])),
@@ -2091,17 +2091,17 @@ const slider = (options) => ({
2091
2091
  const _switch = (options) => ({
2092
2092
  slots: {
2093
2093
  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?.transitions && "transition-colors duration-200"],
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.transitions && "transition-colors duration-200"],
2095
2095
  container: "flex items-center",
2096
2096
  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?.transitions && "transition-[color,opacity] duration-200"],
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.transitions && "transition-[color,opacity] duration-200"],
2098
2098
  wrapper: "ms-2",
2099
2099
  label: "block font-medium text-gray-700 dark:text-gray-200",
2100
2100
  description: "text-gray-500 dark:text-gray-400"
2101
2101
  },
2102
2102
  variants: {
2103
2103
  color: {
2104
- ...Object.fromEntries(options.colors.map((color) => [color, {
2104
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2105
2105
  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
2106
  icon: `group-data-[state=checked]:text-${color}-500 dark:group-data-[state=checked]:text-${color}-400`
2107
2107
  }])),
@@ -2181,7 +2181,7 @@ const tabs = (options) => ({
2181
2181
  root: "flex items-center gap-2",
2182
2182
  list: "relative flex p-1 group",
2183
2183
  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?.transitions && "transition-colors"],
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.transitions && "transition-colors"],
2185
2185
  content: "focus:outline-none w-full",
2186
2186
  leadingIcon: "shrink-0",
2187
2187
  leadingAvatar: "shrink-0",
@@ -2190,7 +2190,7 @@ const tabs = (options) => ({
2190
2190
  },
2191
2191
  variants: {
2192
2192
  color: {
2193
- ...Object.fromEntries(options.colors.map((color) => [color, ""])),
2193
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2194
2194
  gray: ""
2195
2195
  },
2196
2196
  variant: {
@@ -2271,7 +2271,7 @@ const tabs = (options) => ({
2271
2271
  list: "border-l",
2272
2272
  indicator: "-left-px w-px"
2273
2273
  }
2274
- }, ...options.colors.map((color) => ({
2274
+ }, ...(options.theme.colors || []).map((color) => ({
2275
2275
  color,
2276
2276
  variant: "pill",
2277
2277
  class: {
@@ -2285,7 +2285,7 @@ const tabs = (options) => ({
2285
2285
  indicator: "bg-gray-900 dark:bg-white",
2286
2286
  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
2287
  }
2288
- }, ...options.colors.map((color) => ({
2288
+ }, ...(options.theme.colors || []).map((color) => ({
2289
2289
  color,
2290
2290
  variant: "link",
2291
2291
  class: {
@@ -2326,7 +2326,7 @@ const toast = (options) => ({
2326
2326
  },
2327
2327
  variants: {
2328
2328
  color: {
2329
- ...Object.fromEntries(options.colors.map((color) => [color, {
2329
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2330
2330
  icon: `text-${color}-500 dark:text-${color}-400`,
2331
2331
  progress: `bg-${color}-500 dark:bg-${color}-400`
2332
2332
  }])),
@@ -2550,15 +2550,16 @@ const module = defineNuxtModule({
2550
2550
  },
2551
2551
  defaults: {
2552
2552
  prefix: "U",
2553
- colors: void 0,
2554
2553
  fonts: true,
2555
2554
  theme: {
2555
+ colors: void 0,
2556
2556
  transitions: true
2557
2557
  }
2558
2558
  },
2559
2559
  async setup(options, nuxt) {
2560
2560
  const { resolve } = createResolver(import.meta.url);
2561
- options.colors = options.colors?.length ? [.../* @__PURE__ */ new Set(["primary", "error", ...options.colors])] : ["primary", "error", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
2561
+ options.theme = options.theme || {};
2562
+ 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
2563
  nuxt.options.ui = options;
2563
2564
  nuxt.options.alias["#ui"] = resolve("./runtime");
2564
2565
  nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
3
  "description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
4
- "version": "3.0.0-alpha.2",
4
+ "version": "3.0.0-alpha.3",
5
5
  "packageManager": "pnpm@9.10.0",
6
6
  "repository": {
7
7
  "type": "git",