@nuxt/ui 3.2.0 → 3.3.1

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.
Files changed (185) hide show
  1. package/.nuxt/ui/button.ts +42 -42
  2. package/.nuxt/ui/command-palette.ts +2 -1
  3. package/.nuxt/ui/drawer.ts +1 -1
  4. package/.nuxt/ui/file-upload.ts +290 -0
  5. package/.nuxt/ui/index.ts +1 -0
  6. package/.nuxt/ui/input.ts +1 -1
  7. package/.nuxt/ui/kbd.ts +167 -3
  8. package/.nuxt/ui/select.ts +7 -7
  9. package/.nuxt/ui/table.ts +8 -0
  10. package/.nuxt/ui/tabs.ts +4 -2
  11. package/.nuxt/ui/textarea.ts +1 -1
  12. package/.nuxt/ui/toast.ts +8 -15
  13. package/.nuxt/ui/tooltip.ts +1 -1
  14. package/cli/templates.mjs +8 -3
  15. package/dist/module.d.mts +15 -1
  16. package/dist/module.json +2 -2
  17. package/dist/module.mjs +3 -3
  18. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  19. package/dist/runtime/components/Alert.vue.d.ts +2 -2
  20. package/dist/runtime/components/App.vue.d.ts +1 -1
  21. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  22. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  23. package/dist/runtime/components/Badge.vue.d.ts +1 -1
  24. package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
  25. package/dist/runtime/components/Button.vue +6 -6
  26. package/dist/runtime/components/Button.vue.d.ts +1 -5
  27. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  28. package/dist/runtime/components/Calendar.vue.d.ts +1 -1
  29. package/dist/runtime/components/Card.vue.d.ts +1 -1
  30. package/dist/runtime/components/Carousel.vue +18 -14
  31. package/dist/runtime/components/Carousel.vue.d.ts +1 -1
  32. package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
  33. package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
  34. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  35. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  36. package/dist/runtime/components/ColorPicker.vue +1 -2
  37. package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
  38. package/dist/runtime/components/CommandPalette.vue +4 -0
  39. package/dist/runtime/components/CommandPalette.vue.d.ts +6 -1
  40. package/dist/runtime/components/Container.vue.d.ts +1 -1
  41. package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
  42. package/dist/runtime/components/ContextMenuContent.vue +5 -3
  43. package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
  44. package/dist/runtime/components/Drawer.vue +4 -4
  45. package/dist/runtime/components/Drawer.vue.d.ts +6 -1
  46. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  47. package/dist/runtime/components/DropdownMenuContent.vue +5 -3
  48. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
  49. package/dist/runtime/components/FileUpload.vue +248 -0
  50. package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
  51. package/dist/runtime/components/Form.vue +3 -3
  52. package/dist/runtime/components/Form.vue.d.ts +6 -5
  53. package/dist/runtime/components/FormField.vue +2 -2
  54. package/dist/runtime/components/FormField.vue.d.ts +4 -4
  55. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  56. package/dist/runtime/components/Input.vue +10 -7
  57. package/dist/runtime/components/Input.vue.d.ts +9 -9
  58. package/dist/runtime/components/InputMenu.vue +25 -13
  59. package/dist/runtime/components/InputMenu.vue.d.ts +16 -221
  60. package/dist/runtime/components/InputNumber.vue +3 -2
  61. package/dist/runtime/components/InputNumber.vue.d.ts +7 -81
  62. package/dist/runtime/components/InputTags.vue +2 -0
  63. package/dist/runtime/components/InputTags.vue.d.ts +7 -5
  64. package/dist/runtime/components/Kbd.vue +2 -1
  65. package/dist/runtime/components/Kbd.vue.d.ts +5 -1
  66. package/dist/runtime/components/Link.vue +6 -5
  67. package/dist/runtime/components/Link.vue.d.ts +1 -3
  68. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  69. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  70. package/dist/runtime/components/NavigationMenu.vue +3 -2
  71. package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
  72. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  73. package/dist/runtime/components/Pagination.vue.d.ts +1 -1
  74. package/dist/runtime/components/PinInput.vue +3 -1
  75. package/dist/runtime/components/PinInput.vue.d.ts +5 -5
  76. package/dist/runtime/components/Popover.vue +2 -1
  77. package/dist/runtime/components/Popover.vue.d.ts +8 -2
  78. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  79. package/dist/runtime/components/RadioGroup.vue +1 -1
  80. package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
  81. package/dist/runtime/components/Select.vue +16 -6
  82. package/dist/runtime/components/Select.vue.d.ts +3 -3
  83. package/dist/runtime/components/SelectMenu.vue +18 -10
  84. package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
  85. package/dist/runtime/components/Separator.vue.d.ts +1 -1
  86. package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
  87. package/dist/runtime/components/Slideover.vue.d.ts +2 -2
  88. package/dist/runtime/components/Slider.vue.d.ts +5 -5
  89. package/dist/runtime/components/Stepper.vue.d.ts +1 -1
  90. package/dist/runtime/components/Switch.vue.d.ts +1 -1
  91. package/dist/runtime/components/Table.vue +83 -8
  92. package/dist/runtime/components/Table.vue.d.ts +20 -4
  93. package/dist/runtime/components/Tabs.vue +12 -2
  94. package/dist/runtime/components/Tabs.vue.d.ts +8 -3
  95. package/dist/runtime/components/Textarea.vue +10 -7
  96. package/dist/runtime/components/Textarea.vue.d.ts +10 -9
  97. package/dist/runtime/components/Timeline.vue.d.ts +1 -1
  98. package/dist/runtime/components/Toast.vue +12 -4
  99. package/dist/runtime/components/Toast.vue.d.ts +14 -13
  100. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  101. package/dist/runtime/components/Tooltip.vue +4 -3
  102. package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
  103. package/dist/runtime/components/Tree.vue +31 -28
  104. package/dist/runtime/components/Tree.vue.d.ts +2 -1
  105. package/dist/runtime/composables/defineShortcuts.js +5 -3
  106. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  107. package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
  108. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  109. package/dist/runtime/composables/useFileUpload.js +69 -0
  110. package/dist/runtime/composables/useFormField.d.ts +3 -6
  111. package/dist/runtime/composables/useFormField.js +5 -2
  112. package/dist/runtime/composables/useKbd.d.ts +1 -1
  113. package/dist/runtime/composables/useLocale.js +2 -2
  114. package/dist/runtime/composables/useOverlay.d.ts +29 -2
  115. package/dist/runtime/composables/useOverlay.js +8 -7
  116. package/dist/runtime/composables/usePortal.d.ts +1 -1
  117. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  118. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  119. package/dist/runtime/inertia/stubs.d.ts +1 -0
  120. package/dist/runtime/inertia/stubs.js +4 -2
  121. package/dist/runtime/locale/ar.js +5 -1
  122. package/dist/runtime/locale/az.js +4 -0
  123. package/dist/runtime/locale/bg.js +4 -0
  124. package/dist/runtime/locale/bn.js +4 -0
  125. package/dist/runtime/locale/ca.js +4 -0
  126. package/dist/runtime/locale/ckb.js +5 -1
  127. package/dist/runtime/locale/cs.js +4 -0
  128. package/dist/runtime/locale/da.js +4 -0
  129. package/dist/runtime/locale/de.js +4 -0
  130. package/dist/runtime/locale/el.js +4 -0
  131. package/dist/runtime/locale/en.js +4 -0
  132. package/dist/runtime/locale/es.js +4 -0
  133. package/dist/runtime/locale/et.js +4 -0
  134. package/dist/runtime/locale/fa_ir.js +4 -0
  135. package/dist/runtime/locale/fi.js +4 -0
  136. package/dist/runtime/locale/fr.js +4 -0
  137. package/dist/runtime/locale/he.js +4 -0
  138. package/dist/runtime/locale/hi.js +5 -1
  139. package/dist/runtime/locale/hu.js +4 -0
  140. package/dist/runtime/locale/hy.js +4 -0
  141. package/dist/runtime/locale/id.js +4 -0
  142. package/dist/runtime/locale/it.js +4 -0
  143. package/dist/runtime/locale/ja.js +4 -0
  144. package/dist/runtime/locale/kk.js +4 -0
  145. package/dist/runtime/locale/km.js +5 -1
  146. package/dist/runtime/locale/ko.js +4 -0
  147. package/dist/runtime/locale/ky.js +4 -0
  148. package/dist/runtime/locale/lb.js +4 -0
  149. package/dist/runtime/locale/lt.js +4 -0
  150. package/dist/runtime/locale/mn.js +4 -0
  151. package/dist/runtime/locale/ms.js +4 -0
  152. package/dist/runtime/locale/nb_no.js +4 -0
  153. package/dist/runtime/locale/nl.js +4 -0
  154. package/dist/runtime/locale/pl.js +4 -0
  155. package/dist/runtime/locale/pt.js +4 -0
  156. package/dist/runtime/locale/pt_br.js +4 -0
  157. package/dist/runtime/locale/ro.js +4 -0
  158. package/dist/runtime/locale/ru.js +4 -0
  159. package/dist/runtime/locale/sk.js +4 -0
  160. package/dist/runtime/locale/sl.js +4 -0
  161. package/dist/runtime/locale/sv.js +4 -0
  162. package/dist/runtime/locale/th.js +4 -0
  163. package/dist/runtime/locale/tj.js +4 -0
  164. package/dist/runtime/locale/tr.js +4 -0
  165. package/dist/runtime/locale/ug_cn.js +4 -0
  166. package/dist/runtime/locale/uk.js +4 -0
  167. package/dist/runtime/locale/ur.js +4 -0
  168. package/dist/runtime/locale/uz.js +4 -0
  169. package/dist/runtime/locale/vi.js +4 -0
  170. package/dist/runtime/locale/zh_cn.js +4 -0
  171. package/dist/runtime/locale/zh_tw.js +4 -0
  172. package/dist/runtime/types/index.d.ts +1 -0
  173. package/dist/runtime/types/index.js +1 -0
  174. package/dist/runtime/types/locale.d.ts +4 -0
  175. package/dist/runtime/utils/index.d.ts +6 -0
  176. package/dist/runtime/utils/index.js +27 -0
  177. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  178. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  179. package/dist/runtime/vue/stubs.d.ts +1 -0
  180. package/dist/runtime/vue/stubs.js +3 -1
  181. package/dist/shared/{ui.BPVxSPGY.mjs → ui.BTUFJHYJ.mjs} +299 -36
  182. package/dist/unplugin.d.mts +2 -0
  183. package/dist/unplugin.mjs +6 -3
  184. package/dist/vite.mjs +1 -1
  185. package/package.json +31 -27
@@ -19,12 +19,14 @@ const icons = {
19
19
  close: "i-lucide-x",
20
20
  ellipsis: "i-lucide-ellipsis",
21
21
  external: "i-lucide-arrow-up-right",
22
+ file: "i-lucide-file",
22
23
  folder: "i-lucide-folder",
23
24
  folderOpen: "i-lucide-folder-open",
24
25
  loading: "i-lucide-loader-circle",
25
26
  minus: "i-lucide-minus",
26
27
  plus: "i-lucide-plus",
27
- search: "i-lucide-search"
28
+ search: "i-lucide-search",
29
+ upload: "i-lucide-upload"
28
30
  };
29
31
 
30
32
  const getDefaultUiConfig = (colors) => ({
@@ -529,51 +531,51 @@ const button = (options) => ({
529
531
  compoundVariants: [...(options.theme.colors || []).map((color) => ({
530
532
  color,
531
533
  variant: "solid",
532
- class: `text-inverted bg-${color} hover:bg-${color}/75 disabled:bg-${color} aria-disabled:bg-${color} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}`
534
+ class: `text-inverted bg-${color} hover:bg-${color}/75 active:bg-${color}/75 disabled:bg-${color} aria-disabled:bg-${color} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}`
533
535
  })), ...(options.theme.colors || []).map((color) => ({
534
536
  color,
535
537
  variant: "outline",
536
- class: `ring ring-inset ring-${color}/50 text-${color} hover:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}`
538
+ class: `ring ring-inset ring-${color}/50 text-${color} hover:bg-${color}/10 active:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}`
537
539
  })), ...(options.theme.colors || []).map((color) => ({
538
540
  color,
539
541
  variant: "soft",
540
- class: `text-${color} bg-${color}/10 hover:bg-${color}/15 focus:outline-none focus-visible:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10`
542
+ class: `text-${color} bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 focus:outline-none focus-visible:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10`
541
543
  })), ...(options.theme.colors || []).map((color) => ({
542
544
  color,
543
545
  variant: "subtle",
544
- class: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10 hover:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}`
546
+ class: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}`
545
547
  })), ...(options.theme.colors || []).map((color) => ({
546
548
  color,
547
549
  variant: "ghost",
548
- class: `text-${color} hover:bg-${color}/10 focus:outline-none focus-visible:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
550
+ class: `text-${color} hover:bg-${color}/10 active:bg-${color}/10 focus:outline-none focus-visible:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
549
551
  })), ...(options.theme.colors || []).map((color) => ({
550
552
  color,
551
553
  variant: "link",
552
- class: `text-${color} hover:text-${color}/75 disabled:text-${color} aria-disabled:text-${color} focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`
554
+ class: `text-${color} hover:text-${color}/75 active:text-${color}/75 disabled:text-${color} aria-disabled:text-${color} focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`
553
555
  })), {
554
556
  color: "neutral",
555
557
  variant: "solid",
556
- class: "text-inverted bg-inverted hover:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"
558
+ class: "text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"
557
559
  }, {
558
560
  color: "neutral",
559
561
  variant: "outline",
560
- class: "ring ring-inset ring-accented text-default bg-default hover:bg-elevated disabled:bg-default aria-disabled:bg-default focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
562
+ class: "ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
561
563
  }, {
562
564
  color: "neutral",
563
565
  variant: "soft",
564
- class: "text-default bg-elevated hover:bg-accented/75 focus:outline-none focus-visible:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated"
566
+ class: "text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 focus:outline-none focus-visible:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated"
565
567
  }, {
566
568
  color: "neutral",
567
569
  variant: "subtle",
568
- class: "ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
570
+ class: "ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
569
571
  }, {
570
572
  color: "neutral",
571
573
  variant: "ghost",
572
- class: "text-default hover:bg-elevated focus:outline-none focus-visible:bg-elevated hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
574
+ class: "text-default hover:bg-elevated active:bg-elevated focus:outline-none focus-visible:bg-elevated hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
573
575
  }, {
574
576
  color: "neutral",
575
577
  variant: "link",
576
- class: "text-muted hover:text-default disabled:text-muted aria-disabled:text-muted focus:outline-none focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-inverted"
578
+ class: "text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted focus:outline-none focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-inverted"
577
579
  }, {
578
580
  size: "xs",
579
581
  square: true,
@@ -1083,6 +1085,7 @@ const commandPalette = (options) => ({
1083
1085
  close: "",
1084
1086
  back: "p-0",
1085
1087
  content: "relative overflow-hidden flex flex-col",
1088
+ footer: "p-1",
1086
1089
  viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1 focus:outline-none",
1087
1090
  group: "p-1 isolate",
1088
1091
  empty: "py-6 text-center text-sm text-muted",
@@ -1098,7 +1101,7 @@ const commandPalette = (options) => ({
1098
1101
  itemTrailingHighlightedIcon: "shrink-0 size-5 text-dimmed hidden group-data-highlighted:inline-flex",
1099
1102
  itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
1100
1103
  itemTrailingKbdsSize: "md",
1101
- itemLabel: "truncate space-x-1 rtl:space-x-reverse text-dimmed",
1104
+ itemLabel: "truncate space-x-1 text-dimmed",
1102
1105
  itemLabelBase: "text-highlighted [&>mark]:text-inverted [&>mark]:bg-primary",
1103
1106
  itemLabelPrefix: "text-default",
1104
1107
  itemLabelSuffix: "text-dimmed [&>mark]:text-inverted [&>mark]:bg-primary"
@@ -1265,7 +1268,7 @@ const drawer = (options) => ({
1265
1268
  },
1266
1269
  inset: {
1267
1270
  true: {
1268
- content: "rounded-lg after:hidden overflow-hidden"
1271
+ content: "rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"
1269
1272
  }
1270
1273
  }
1271
1274
  },
@@ -1439,6 +1442,198 @@ const dropdownMenu = (options) => ({
1439
1442
  }
1440
1443
  });
1441
1444
 
1445
+ const fileUpload = (options) => ({
1446
+ slots: {
1447
+ root: "relative flex flex-col",
1448
+ base: ["w-full flex-1 bg-default border border-default flex flex-col gap-2 items-stretch justify-center rounded-lg focus-visible:outline-2", options.theme.transitions && "transition-[background]"],
1449
+ wrapper: "flex flex-col items-center justify-center text-center",
1450
+ icon: "shrink-0",
1451
+ avatar: "shrink-0",
1452
+ label: "font-medium text-default mt-2",
1453
+ description: "text-muted mt-1",
1454
+ actions: "flex flex-wrap gap-1.5 shrink-0 mt-4",
1455
+ files: "",
1456
+ file: "relative",
1457
+ fileLeadingAvatar: "shrink-0",
1458
+ fileWrapper: "flex flex-col min-w-0",
1459
+ fileName: "text-default truncate",
1460
+ fileSize: "text-muted truncate",
1461
+ fileTrailingButton: ""
1462
+ },
1463
+ variants: {
1464
+ color: {
1465
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1466
+ neutral: ""
1467
+ },
1468
+ variant: {
1469
+ area: {
1470
+ wrapper: "px-4 py-3",
1471
+ base: "p-4"
1472
+ },
1473
+ button: {}
1474
+ },
1475
+ size: {
1476
+ xs: {
1477
+ base: "text-xs",
1478
+ icon: "size-4",
1479
+ file: "text-xs px-2 py-1 gap-1",
1480
+ fileWrapper: "flex-row gap-1"
1481
+ },
1482
+ sm: {
1483
+ base: "text-xs",
1484
+ icon: "size-4",
1485
+ file: "text-xs px-2.5 py-1.5 gap-1.5",
1486
+ fileWrapper: "flex-row gap-1"
1487
+ },
1488
+ md: {
1489
+ base: "text-sm",
1490
+ icon: "size-5",
1491
+ file: "text-xs px-2.5 py-1.5 gap-1.5"
1492
+ },
1493
+ lg: {
1494
+ base: "text-sm",
1495
+ icon: "size-5",
1496
+ file: "text-sm px-3 py-2 gap-2",
1497
+ fileSize: "text-xs"
1498
+ },
1499
+ xl: {
1500
+ base: "text-base",
1501
+ icon: "size-6",
1502
+ file: "text-sm px-3 py-2 gap-2"
1503
+ }
1504
+ },
1505
+ layout: {
1506
+ list: {
1507
+ root: "gap-2 items-start",
1508
+ files: "flex flex-col w-full gap-2",
1509
+ file: "min-w-0 flex items-center border border-default rounded-md w-full",
1510
+ fileTrailingButton: "ms-auto"
1511
+ },
1512
+ grid: {
1513
+ fileWrapper: "hidden",
1514
+ fileLeadingAvatar: "size-full rounded-lg",
1515
+ fileTrailingButton: "absolute -top-1.5 -end-1.5 p-0 rounded-full border-2 border-bg"
1516
+ }
1517
+ },
1518
+ position: {
1519
+ inside: "",
1520
+ outside: ""
1521
+ },
1522
+ dropzone: {
1523
+ true: "border-dashed data-[dragging=true]:bg-elevated/25"
1524
+ },
1525
+ interactive: {
1526
+ true: ""
1527
+ },
1528
+ highlight: {
1529
+ true: ""
1530
+ },
1531
+ multiple: {
1532
+ true: ""
1533
+ },
1534
+ disabled: {
1535
+ true: "cursor-not-allowed opacity-75"
1536
+ }
1537
+ },
1538
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
1539
+ color,
1540
+ class: `focus-visible:outline-${color}`
1541
+ })), ...(options.theme.colors || []).map((color) => ({
1542
+ color,
1543
+ highlight: true,
1544
+ class: `border-${color}`
1545
+ })), {
1546
+ color: "neutral",
1547
+ class: "focus-visible:outline-inverted"
1548
+ }, {
1549
+ color: "neutral",
1550
+ highlight: true,
1551
+ class: "border-inverted"
1552
+ }, {
1553
+ size: "xs",
1554
+ layout: "list",
1555
+ class: {
1556
+ fileTrailingButton: "-me-1"
1557
+ }
1558
+ }, {
1559
+ size: "sm",
1560
+ layout: "list",
1561
+ class: {
1562
+ fileTrailingButton: "-me-1.5"
1563
+ }
1564
+ }, {
1565
+ size: "md",
1566
+ layout: "list",
1567
+ class: {
1568
+ fileTrailingButton: "-me-1.5"
1569
+ }
1570
+ }, {
1571
+ size: "lg",
1572
+ layout: "list",
1573
+ class: {
1574
+ fileTrailingButton: "-me-2"
1575
+ }
1576
+ }, {
1577
+ size: "xl",
1578
+ layout: "list",
1579
+ class: {
1580
+ fileTrailingButton: "-me-2"
1581
+ }
1582
+ }, {
1583
+ variant: "button",
1584
+ size: "xs",
1585
+ class: {
1586
+ base: "p-1"
1587
+ }
1588
+ }, {
1589
+ variant: "button",
1590
+ size: "sm",
1591
+ class: {
1592
+ base: "p-1.5"
1593
+ }
1594
+ }, {
1595
+ variant: "button",
1596
+ size: "md",
1597
+ class: {
1598
+ base: "p-1.5"
1599
+ }
1600
+ }, {
1601
+ variant: "button",
1602
+ size: "lg",
1603
+ class: {
1604
+ base: "p-2"
1605
+ }
1606
+ }, {
1607
+ variant: "button",
1608
+ size: "xl",
1609
+ class: {
1610
+ base: "p-2"
1611
+ }
1612
+ }, {
1613
+ layout: "grid",
1614
+ multiple: true,
1615
+ class: {
1616
+ files: "grid grid-cols-2 md:grid-cols-3 gap-4 w-full",
1617
+ file: "p-0 aspect-square"
1618
+ }
1619
+ }, {
1620
+ layout: "grid",
1621
+ multiple: false,
1622
+ class: {
1623
+ file: "absolute inset-0 p-0"
1624
+ }
1625
+ }, {
1626
+ interactive: true,
1627
+ disabled: false,
1628
+ class: "hover:bg-elevated/25"
1629
+ }],
1630
+ defaultVariants: {
1631
+ color: "primary",
1632
+ variant: "area",
1633
+ size: "md"
1634
+ }
1635
+ });
1636
+
1442
1637
  const form = {
1443
1638
  base: ""
1444
1639
  };
@@ -1477,7 +1672,7 @@ const formField = {
1477
1672
  const input = (options) => ({
1478
1673
  slots: {
1479
1674
  root: "relative inline-flex items-center",
1480
- base: ["w-full rounded-md border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
1675
+ base: ["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
1481
1676
  leading: "absolute inset-y-0 start-0 flex items-center",
1482
1677
  leadingIcon: "shrink-0 text-dimmed",
1483
1678
  leadingAvatar: "shrink-0",
@@ -1900,26 +2095,31 @@ const inputTags = (options) => {
1900
2095
  }
1901
2096
  },
1902
2097
  variant: (prev) => Object.fromEntries(
1903
- Object.entries(prev).map(([key, value]) => [key, replaceFocus(value)])
2098
+ Object.entries(prev).map(([key, value]) => [key, replaceFocus$2(value)])
1904
2099
  )
1905
2100
  },
1906
2101
  compoundVariants: (prev) => prev.map((item) => ({
1907
2102
  ...item,
1908
- class: typeof item.class === "string" ? replaceFocus(item.class) : item.class
2103
+ class: typeof item.class === "string" ? replaceFocus$2(item.class) : item.class
1909
2104
  }))
1910
2105
  }, input(options));
1911
2106
  };
1912
- function replaceFocus(str) {
2107
+ function replaceFocus$2(str) {
1913
2108
  return str.replace(/focus:/g, "has-focus:").replace(/focus-visible:/g, "has-focus-visible:");
1914
2109
  }
1915
2110
 
1916
- const kbd = {
2111
+ const kbd = (options) => ({
1917
2112
  base: "inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans",
1918
2113
  variants: {
2114
+ color: {
2115
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2116
+ neutral: ""
2117
+ },
1919
2118
  variant: {
1920
- solid: "bg-inverted text-inverted",
1921
- outline: "bg-default text-highlighted ring ring-inset ring-accented",
1922
- subtle: "bg-elevated text-default ring ring-inset ring-accented"
2119
+ solid: "",
2120
+ outline: "",
2121
+ soft: "",
2122
+ subtle: ""
1923
2123
  },
1924
2124
  size: {
1925
2125
  sm: "h-4 min-w-[16px] text-[10px]",
@@ -1927,11 +2127,45 @@ const kbd = {
1927
2127
  lg: "h-6 min-w-[24px] text-[12px]"
1928
2128
  }
1929
2129
  },
2130
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
2131
+ color,
2132
+ variant: "solid",
2133
+ class: `text-inverted bg-${color}`
2134
+ })), ...(options.theme.colors || []).map((color) => ({
2135
+ color,
2136
+ variant: "outline",
2137
+ class: `ring ring-inset ring-${color}/50 text-${color}`
2138
+ })), ...(options.theme.colors || []).map((color) => ({
2139
+ color,
2140
+ variant: "soft",
2141
+ class: `text-${color} bg-${color}/10`
2142
+ })), ...(options.theme.colors || []).map((color) => ({
2143
+ color,
2144
+ variant: "subtle",
2145
+ class: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10`
2146
+ })), {
2147
+ color: "neutral",
2148
+ variant: "solid",
2149
+ class: "text-inverted bg-inverted"
2150
+ }, {
2151
+ color: "neutral",
2152
+ variant: "outline",
2153
+ class: "ring ring-inset ring-accented text-default bg-default"
2154
+ }, {
2155
+ color: "neutral",
2156
+ variant: "soft",
2157
+ class: "text-default bg-elevated"
2158
+ }, {
2159
+ color: "neutral",
2160
+ variant: "subtle",
2161
+ class: "ring ring-inset ring-accented text-default bg-elevated"
2162
+ }],
1930
2163
  defaultVariants: {
1931
2164
  variant: "outline",
2165
+ color: "neutral",
1932
2166
  size: "md"
1933
2167
  }
1934
- };
2168
+ });
1935
2169
 
1936
2170
  const link = (options) => ({
1937
2171
  base: "focus-visible:outline-primary",
@@ -2802,9 +3036,16 @@ const select = (options) => {
2802
3036
  empty: "p-2 text-base"
2803
3037
  }
2804
3038
  }
2805
- }
3039
+ },
3040
+ compoundVariants: (prev) => prev.map((item) => ({
3041
+ ...item,
3042
+ class: typeof item.class === "string" ? replaceFocus$1(item.class) : item.class
3043
+ }))
2806
3044
  }, input(options));
2807
3045
  };
3046
+ function replaceFocus$1(str) {
3047
+ return str.replace(/focus-visible:/g, "focus:");
3048
+ }
2808
3049
 
2809
3050
  const selectMenu = (options) => {
2810
3051
  return defuFn({
@@ -2812,9 +3053,16 @@ const selectMenu = (options) => {
2812
3053
  input: "border-b border-default",
2813
3054
  focusScope: "flex flex-col min-h-0",
2814
3055
  content: (content) => [content, "origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)"]
2815
- }
3056
+ },
3057
+ compoundVariants: (prev) => prev.map((item) => ({
3058
+ ...item,
3059
+ class: typeof item.class === "string" ? replaceFocus(item.class) : item.class
3060
+ }))
2816
3061
  }, select(options));
2817
3062
  };
3063
+ function replaceFocus(str) {
3064
+ return str.replace(/focus:/g, "focus-visible:");
3065
+ }
2818
3066
 
2819
3067
  const separator = (options) => ({
2820
3068
  slots: {
@@ -3311,6 +3559,7 @@ const table = (options) => ({
3311
3559
  caption: "sr-only",
3312
3560
  thead: "relative",
3313
3561
  tbody: "divide-y divide-default [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:focus-visible:outline-primary",
3562
+ tfoot: "relative",
3314
3563
  tr: "data-[selected=true]:bg-elevated/50",
3315
3564
  th: "px-4 py-3.5 text-sm text-highlighted text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
3316
3565
  td: "p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",
@@ -3327,7 +3576,14 @@ const table = (options) => ({
3327
3576
  },
3328
3577
  sticky: {
3329
3578
  true: {
3579
+ thead: "sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur",
3580
+ tfoot: "sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
3581
+ },
3582
+ header: {
3330
3583
  thead: "sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
3584
+ },
3585
+ footer: {
3586
+ tfoot: "sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
3331
3587
  }
3332
3588
  },
3333
3589
  loading: {
@@ -3395,11 +3651,13 @@ const tabs = (options) => ({
3395
3651
  list: "relative flex p-1 group",
3396
3652
  indicator: "absolute transition-[translate,width] duration-200",
3397
3653
  trigger: ["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
3398
- content: "focus:outline-none w-full",
3399
3654
  leadingIcon: "shrink-0",
3400
3655
  leadingAvatar: "shrink-0",
3401
3656
  leadingAvatarSize: "",
3402
- label: "truncate"
3657
+ label: "truncate",
3658
+ trailingBadge: "shrink-0",
3659
+ trailingBadgeSize: "sm",
3660
+ content: "focus:outline-none w-full"
3403
3661
  },
3404
3662
  variants: {
3405
3663
  color: {
@@ -3756,20 +4014,18 @@ const toast = (options) => ({
3756
4014
  avatar: "shrink-0",
3757
4015
  avatarSize: "2xl",
3758
4016
  actions: "flex gap-1.5 shrink-0",
3759
- progress: "absolute inset-x-0 bottom-0 h-1 z-[-1]",
4017
+ progress: "absolute inset-x-0 bottom-0",
3760
4018
  close: "p-0"
3761
4019
  },
3762
4020
  variants: {
3763
4021
  color: {
3764
4022
  ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
3765
4023
  root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`,
3766
- icon: `text-${color}`,
3767
- progress: `bg-${color}`
4024
+ icon: `text-${color}`
3768
4025
  }])),
3769
4026
  neutral: {
3770
4027
  root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted",
3771
- icon: "text-highlighted",
3772
- progress: "bg-inverted"
4028
+ icon: "text-highlighted"
3773
4029
  }
3774
4030
  },
3775
4031
  orientation: {
@@ -3855,7 +4111,7 @@ const tooltip = {
3855
4111
  content: "flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",
3856
4112
  arrow: "fill-default",
3857
4113
  text: "truncate",
3858
- kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:me-0.5`,
4114
+ kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['\xB7'] not-first-of-type:before:me-0.5`,
3859
4115
  kbdsSize: "sm"
3860
4116
  }
3861
4117
  };
@@ -3964,6 +4220,7 @@ const theme = {
3964
4220
  contextMenu: contextMenu,
3965
4221
  drawer: drawer,
3966
4222
  dropdownMenu: dropdownMenu,
4223
+ fileUpload: fileUpload,
3967
4224
  form: form,
3968
4225
  formField: formField,
3969
4226
  input: input,
@@ -4006,6 +4263,12 @@ function getTemplates(options, uiConfig) {
4006
4263
  getContents: async () => {
4007
4264
  const template = theme[component];
4008
4265
  const result = typeof template === "function" ? template(options) : template;
4266
+ if (result?.defaultVariants?.color && options.theme?.defaultVariants?.color) {
4267
+ result.defaultVariants.color = options.theme.defaultVariants.color;
4268
+ }
4269
+ if (result?.defaultVariants?.size && options.theme?.defaultVariants?.size) {
4270
+ result.defaultVariants.size = options.theme.defaultVariants.size;
4271
+ }
4009
4272
  const variants = Object.entries(result.variants || {}).filter(([_, values]) => {
4010
4273
  const keys = Object.keys(values);
4011
4274
  return keys.some((key) => key !== "true" && key !== "false");
@@ -4115,13 +4378,13 @@ import colors from 'tailwindcss/colors'
4115
4378
 
4116
4379
  const icons = ${JSON.stringify(uiConfig.icons)};
4117
4380
 
4118
- type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone' | (string & {})
4381
+ type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
4119
4382
  type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor> | (string & {})
4120
4383
 
4121
4384
  type AppConfigUI = {
4122
4385
  colors?: {
4123
4386
  ${options.theme?.colors?.map((color) => `'${color}'?: Color`).join("\n ")}
4124
- neutral?: NeutralColor
4387
+ neutral?: NeutralColor | (string & {})
4125
4388
  }
4126
4389
  icons?: Partial<typeof icons>
4127
4390
  tv?: typeof defaultConfig
@@ -21,12 +21,14 @@ declare const _default: {
21
21
  close: string;
22
22
  ellipsis: string;
23
23
  external: string;
24
+ file: string;
24
25
  folder: string;
25
26
  folderOpen: string;
26
27
  loading: string;
27
28
  minus: string;
28
29
  plus: string;
29
30
  search: string;
31
+ upload: string;
30
32
  };
31
33
 
32
34
  type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone';
package/dist/unplugin.mjs CHANGED
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import { defu } from 'defu';
5
5
  import tailwind from '@tailwindcss/vite';
6
- import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.BPVxSPGY.mjs';
6
+ import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.BTUFJHYJ.mjs';
7
7
  import { globSync } from 'tinyglobby';
8
8
  import { genSafeVariableName } from 'knitwork';
9
9
  import MagicString from 'magic-string';
@@ -152,10 +152,13 @@ function ComponentImportPlugin(options, meta) {
152
152
  name: "nuxt:ui:components",
153
153
  enforce: "pre",
154
154
  resolveId(id, importer) {
155
- if (!importer || !normalize(importer).includes(runtimeDir)) {
155
+ if (!importer) {
156
156
  return;
157
157
  }
158
- if (!RELATIVE_IMPORT_RE.test(id)) {
158
+ if (!normalize(importer).includes(runtimeDir) && (!options.extraRuntimeDir || !normalize(importer).includes(options.extraRuntimeDir))) {
159
+ return;
160
+ }
161
+ if (!RELATIVE_IMPORT_RE.test(id) && !id.startsWith("@nuxt/ui/components/")) {
159
162
  return;
160
163
  }
161
164
  const filename = id.match(/([^/]+)\.vue$/)?.[1];
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/ui.BPVxSPGY.mjs';
7
+ import './shared/ui.BTUFJHYJ.mjs';
8
8
  import '../dist/runtime/utils/index.js';
9
9
  import 'scule';
10
10
  import '@nuxt/kit';