@nuxt/ui 3.0.0-alpha.7 → 3.0.0-alpha.8

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 (243) hide show
  1. package/.nuxt/ui/accordion.ts +20 -0
  2. package/.nuxt/ui/alert.ts +242 -0
  3. package/.nuxt/ui/avatar-group.ts +40 -0
  4. package/.nuxt/ui/avatar.ts +42 -0
  5. package/.nuxt/ui/badge.ts +194 -0
  6. package/.nuxt/ui/breadcrumb.ts +45 -0
  7. package/.nuxt/ui/button-group.ts +16 -0
  8. package/.nuxt/ui/button.ts +344 -0
  9. package/.nuxt/ui/card.ts +8 -0
  10. package/.nuxt/ui/carousel.ts +41 -0
  11. package/.nuxt/ui/checkbox.ts +105 -0
  12. package/.nuxt/ui/chip.ts +67 -0
  13. package/.nuxt/ui/collapsible.ts +6 -0
  14. package/.nuxt/ui/command-palette.ts +40 -0
  15. package/.nuxt/ui/container.ts +3 -0
  16. package/.nuxt/ui/context-menu.ts +198 -0
  17. package/.nuxt/ui/drawer.ts +55 -0
  18. package/.nuxt/ui/dropdown-menu.ts +199 -0
  19. package/.nuxt/ui/form-field.ts +40 -0
  20. package/.nuxt/ui/form.ts +3 -0
  21. package/.nuxt/ui/index.ts +43 -0
  22. package/.nuxt/ui/input-menu.ts +411 -0
  23. package/.nuxt/ui/input.ts +263 -0
  24. package/.nuxt/ui/kbd.ts +19 -0
  25. package/.nuxt/ui/link.ts +15 -0
  26. package/.nuxt/ui/modal.ts +28 -0
  27. package/.nuxt/ui/navigation-menu.ts +390 -0
  28. package/.nuxt/ui/pagination.ts +8 -0
  29. package/.nuxt/ui/popover.ts +6 -0
  30. package/.nuxt/ui/progress.ts +258 -0
  31. package/.nuxt/ui/radio-group.ts +112 -0
  32. package/.nuxt/ui/select-menu.ts +321 -0
  33. package/.nuxt/ui/select.ts +314 -0
  34. package/.nuxt/ui/separator.ts +143 -0
  35. package/.nuxt/ui/skeleton.ts +3 -0
  36. package/.nuxt/ui/slideover.ts +63 -0
  37. package/.nuxt/ui/slider.ts +148 -0
  38. package/.nuxt/ui/switch.ts +113 -0
  39. package/.nuxt/ui/table.ts +128 -0
  40. package/.nuxt/ui/tabs.ts +227 -0
  41. package/.nuxt/ui/textarea.ts +263 -0
  42. package/.nuxt/ui/toast.ts +66 -0
  43. package/.nuxt/ui/toaster.ts +75 -0
  44. package/.nuxt/ui/tooltip.ts +9 -0
  45. package/cli/templates.mjs +1 -1
  46. package/dist/chunks/component-meta.cjs +73264 -0
  47. package/dist/chunks/component-meta.mjs +73262 -0
  48. package/dist/client/devtools/200.html +1 -0
  49. package/dist/client/devtools/404.html +1 -0
  50. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
  51. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
  52. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
  53. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
  54. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
  55. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
  56. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
  57. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
  58. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
  59. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
  60. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
  61. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
  62. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
  63. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
  64. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
  65. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
  66. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
  67. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
  68. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
  69. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
  70. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
  71. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
  72. package/dist/client/devtools/_nuxt/Bj9hdafK.js +1 -0
  73. package/dist/client/devtools/_nuxt/DM3_wAgz.js +62 -0
  74. package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
  75. package/dist/client/devtools/_nuxt/builds/meta/e6b425f7-b919-4014-915b-0ea07c316790.json +1 -0
  76. package/dist/client/devtools/_nuxt/entry.DaJP-ZMB.css +24 -0
  77. package/dist/client/devtools/_nuxt/error-404.B0Nmv3fV.css +1 -0
  78. package/dist/client/devtools/_nuxt/error-500.C8fgTxVz.css +1 -0
  79. package/dist/client/devtools/_nuxt/hKiujHsR.js +1 -0
  80. package/dist/client/devtools/favicon.svg +1 -0
  81. package/dist/client/devtools/index.html +1 -0
  82. package/dist/devtools/runtime/DevtoolsRenderer.vue +53 -0
  83. package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
  84. package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
  85. package/dist/devtools/runtime/examples/CardExample.vue +13 -0
  86. package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
  87. package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
  88. package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
  89. package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
  90. package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
  91. package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
  92. package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
  93. package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
  94. package/dist/devtools/runtime/examples/FormExample.vue +30 -0
  95. package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
  96. package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
  97. package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
  98. package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
  99. package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
  100. package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
  101. package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
  102. package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
  103. package/dist/module.cjs +222 -4
  104. package/dist/module.d.cts +54 -0
  105. package/dist/module.d.mts +10 -0
  106. package/dist/module.d.ts +10 -0
  107. package/dist/module.json +1 -1
  108. package/dist/module.mjs +157 -2763
  109. package/dist/runtime/components/Accordion.vue +32 -1
  110. package/dist/runtime/components/Alert.vue +4 -0
  111. package/dist/runtime/components/App.vue +8 -0
  112. package/dist/runtime/components/Avatar.vue +23 -5
  113. package/dist/runtime/components/AvatarGroup.vue +3 -0
  114. package/dist/runtime/components/Badge.vue +33 -3
  115. package/dist/runtime/components/Breadcrumb.vue +25 -1
  116. package/dist/runtime/components/Button.vue +6 -1
  117. package/dist/runtime/components/ButtonGroup.vue +4 -1
  118. package/dist/runtime/components/Card.vue +3 -0
  119. package/dist/runtime/components/Carousel.vue +7 -2
  120. package/dist/runtime/components/Checkbox.vue +4 -0
  121. package/dist/runtime/components/Chip.vue +9 -2
  122. package/dist/runtime/components/Collapsible.vue +3 -0
  123. package/dist/runtime/components/CommandPalette.vue +3 -1
  124. package/dist/runtime/components/Container.vue +3 -0
  125. package/dist/runtime/components/ContextMenu.vue +64 -3
  126. package/dist/runtime/components/ContextMenuContent.vue +8 -8
  127. package/dist/runtime/components/Drawer.vue +3 -0
  128. package/dist/runtime/components/DropdownMenu.vue +52 -3
  129. package/dist/runtime/components/DropdownMenuContent.vue +8 -8
  130. package/dist/runtime/components/Form.vue +3 -0
  131. package/dist/runtime/components/FormField.vue +3 -0
  132. package/dist/runtime/components/Input.vue +1 -0
  133. package/dist/runtime/components/InputMenu.vue +23 -12
  134. package/dist/runtime/components/Kbd.vue +2 -0
  135. package/dist/runtime/components/Link.vue +50 -1
  136. package/dist/runtime/components/Modal.vue +3 -0
  137. package/dist/runtime/components/NavigationMenu.vue +91 -44
  138. package/dist/runtime/components/Pagination.vue +5 -1
  139. package/dist/runtime/components/Popover.vue +3 -0
  140. package/dist/runtime/components/Progress.vue +1 -1
  141. package/dist/runtime/components/RadioGroup.vue +4 -1
  142. package/dist/runtime/components/Select.vue +24 -13
  143. package/dist/runtime/components/SelectMenu.vue +29 -17
  144. package/dist/runtime/components/Separator.vue +1 -1
  145. package/dist/runtime/components/Skeleton.vue +3 -0
  146. package/dist/runtime/components/Slideover.vue +3 -0
  147. package/dist/runtime/components/Slider.vue +1 -1
  148. package/dist/runtime/components/Switch.vue +5 -1
  149. package/dist/runtime/components/Table.vue +16 -7
  150. package/dist/runtime/components/Tabs.vue +20 -1
  151. package/dist/runtime/components/Toast.vue +4 -0
  152. package/dist/runtime/components/Toaster.vue +7 -0
  153. package/dist/runtime/components/Tooltip.vue +3 -0
  154. package/dist/runtime/composables/defineShortcuts.js +0 -6
  155. package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
  156. package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
  157. package/dist/runtime/composables/useKbd.d.ts +10 -3
  158. package/dist/runtime/composables/useKbd.js +14 -8
  159. package/dist/runtime/types/utils.d.ts +7 -0
  160. package/dist/runtime/utils/index.js +1 -1
  161. package/dist/runtime/utils/link.d.ts +1 -1
  162. package/dist/runtime/vue/components/Icon.vue +15 -0
  163. package/dist/runtime/vue/components/Link.vue +195 -0
  164. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  165. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  166. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  167. package/dist/runtime/vue/plugins/head.js +6 -0
  168. package/dist/runtime/vue/stubs.d.ts +15 -0
  169. package/dist/runtime/vue/stubs.js +27 -0
  170. package/dist/shared/ui.BU7wzH0D.cjs +2872 -0
  171. package/dist/shared/ui.BufKhDiD.mjs +2865 -0
  172. package/dist/unplugin.cjs +192 -0
  173. package/dist/unplugin.d.cts +47 -0
  174. package/dist/unplugin.d.mts +47 -0
  175. package/dist/unplugin.d.ts +47 -0
  176. package/dist/unplugin.mjs +181 -0
  177. package/dist/vite.cjs +22 -0
  178. package/dist/vite.d.cts +13 -0
  179. package/dist/vite.d.mts +13 -0
  180. package/dist/vite.d.ts +13 -0
  181. package/dist/vite.mjs +20 -0
  182. package/package.json +68 -30
  183. package/vue-plugin.d.ts +5 -0
  184. package/cli/node_modules/.ignored/citty/LICENSE +0 -36
  185. package/cli/node_modules/.ignored/citty/README.md +0 -134
  186. package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
  187. package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
  188. package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
  189. package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
  190. package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
  191. package/cli/node_modules/.ignored/citty/package.json +0 -49
  192. package/cli/node_modules/.ignored/consola/LICENSE +0 -47
  193. package/cli/node_modules/.ignored/consola/README.md +0 -318
  194. package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
  195. package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
  196. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
  197. package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
  198. package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
  199. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
  200. package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
  201. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
  202. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
  203. package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
  204. package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
  205. package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
  206. package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
  207. package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
  208. package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
  209. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
  210. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
  211. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
  212. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
  213. package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
  214. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
  215. package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
  216. package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
  217. package/cli/node_modules/.ignored/consola/package.json +0 -101
  218. package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
  219. package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
  220. package/cli/node_modules/.ignored/pathe/README.md +0 -69
  221. package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
  222. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
  223. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
  224. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
  225. package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
  226. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
  227. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
  228. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
  229. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
  230. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
  231. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
  232. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
  233. package/cli/node_modules/.ignored/pathe/package.json +0 -48
  234. package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
  235. package/cli/node_modules/.ignored/scule/LICENSE +0 -21
  236. package/cli/node_modules/.ignored/scule/README.md +0 -149
  237. package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
  238. package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
  239. package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
  240. package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
  241. package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
  242. package/cli/node_modules/.ignored/scule/package.json +0 -43
  243. package/cli/node_modules/.package-lock.json +0 -33
@@ -0,0 +1,2872 @@
1
+ 'use strict';
2
+
3
+ const index_js = require('../../dist/runtime/utils/index.js');
4
+ require('node:url');
5
+ const scule = require('scule');
6
+ const kit = require('@nuxt/kit');
7
+ const defu = require('defu');
8
+
9
+ const icons = {
10
+ chevronDoubleLeft: "i-lucide-chevrons-left",
11
+ chevronDoubleRight: "i-lucide-chevrons-right",
12
+ chevronDown: "i-lucide-chevron-down",
13
+ chevronLeft: "i-lucide-chevron-left",
14
+ chevronRight: "i-lucide-chevron-right",
15
+ arrowLeft: "i-lucide-arrow-left",
16
+ arrowRight: "i-lucide-arrow-right",
17
+ check: "i-lucide-check",
18
+ close: "i-lucide-x",
19
+ ellipsis: "i-lucide-ellipsis",
20
+ external: "i-lucide-arrow-up-right",
21
+ loading: "i-lucide-refresh-ccw",
22
+ minus: "i-lucide-minus",
23
+ search: "i-lucide-search"
24
+ };
25
+
26
+ const getDefaultUiConfig = (colors) => ({
27
+ colors: index_js.pick({
28
+ primary: "green",
29
+ secondary: "blue",
30
+ success: "green",
31
+ info: "blue",
32
+ warning: "yellow",
33
+ error: "red",
34
+ neutral: "slate"
35
+ }, [...colors || [], "neutral"]),
36
+ icons
37
+ });
38
+ const defaultOptions = {
39
+ prefix: "U",
40
+ fonts: true,
41
+ colorMode: true,
42
+ theme: {
43
+ colors: void 0,
44
+ transitions: true
45
+ },
46
+ devtools: {
47
+ enabled: true
48
+ }
49
+ };
50
+ const resolveColors = (colors) => {
51
+ return colors?.length ? [.../* @__PURE__ */ new Set(["primary", ...colors])] : ["primary", "secondary", "success", "info", "warning", "error"];
52
+ };
53
+
54
+ const accordion = {
55
+ slots: {
56
+ root: "w-full",
57
+ item: "border-b border-[var(--ui-border)] last:border-b-0",
58
+ header: "flex",
59
+ trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-[var(--ui-primary)] min-w-0",
60
+ content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
61
+ body: "text-sm pb-3.5",
62
+ leadingIcon: "shrink-0 size-5",
63
+ trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
64
+ label: "text-start break-words"
65
+ },
66
+ variants: {
67
+ disabled: {
68
+ true: {
69
+ trigger: "cursor-not-allowed opacity-75"
70
+ }
71
+ }
72
+ }
73
+ };
74
+
75
+ const alert = (options) => ({
76
+ slots: {
77
+ root: "relative overflow-hidden w-full rounded-[calc(var(--ui-radius)*2)] p-4 flex gap-2.5",
78
+ wrapper: "min-w-0 flex-1 flex flex-col gap-1",
79
+ title: "text-sm font-medium",
80
+ description: "text-sm opacity-90",
81
+ icon: "shrink-0 size-5",
82
+ avatar: "shrink-0",
83
+ avatarSize: "2xl",
84
+ actions: "flex gap-1.5 shrink-0",
85
+ close: "p-0.5"
86
+ },
87
+ variants: {
88
+ color: {
89
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
90
+ neutral: ""
91
+ },
92
+ variant: {
93
+ solid: "",
94
+ outline: "",
95
+ soft: "",
96
+ subtle: ""
97
+ },
98
+ multiline: {
99
+ true: {
100
+ root: "items-start",
101
+ actions: "items-start mt-1"
102
+ },
103
+ false: {
104
+ root: "items-center",
105
+ actions: "items-center"
106
+ }
107
+ }
108
+ },
109
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
110
+ color,
111
+ variant: "solid",
112
+ class: {
113
+ root: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
114
+ }
115
+ })), ...(options.theme.colors || []).map((color) => ({
116
+ color,
117
+ variant: "outline",
118
+ class: {
119
+ root: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
120
+ }
121
+ })), ...(options.theme.colors || []).map((color) => ({
122
+ color,
123
+ variant: "soft",
124
+ class: {
125
+ root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
126
+ }
127
+ })), ...(options.theme.colors || []).map((color) => ({
128
+ color,
129
+ variant: "subtle",
130
+ class: {
131
+ root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
132
+ }
133
+ })), {
134
+ color: "neutral",
135
+ variant: "solid",
136
+ class: {
137
+ root: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]"
138
+ }
139
+ }, {
140
+ color: "neutral",
141
+ variant: "outline",
142
+ class: {
143
+ root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border)]"
144
+ }
145
+ }, {
146
+ color: "neutral",
147
+ variant: "soft",
148
+ class: {
149
+ root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50"
150
+ }
151
+ }, {
152
+ color: "neutral",
153
+ variant: "subtle",
154
+ class: {
155
+ root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50 ring ring-inset ring-[var(--ui-border-accented)]"
156
+ }
157
+ }],
158
+ defaultVariants: {
159
+ color: "primary",
160
+ variant: "solid"
161
+ }
162
+ });
163
+
164
+ const avatar = {
165
+ slots: {
166
+ root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[var(--ui-bg-elevated)]",
167
+ image: "h-full w-full rounded-[inherit] object-cover",
168
+ fallback: "font-medium leading-none text-[var(--ui-text-muted)] truncate",
169
+ icon: "text-[var(--ui-text-muted)] shrink-0"
170
+ },
171
+ variants: {
172
+ size: {
173
+ "3xs": {
174
+ root: "size-4 text-[8px]"
175
+ },
176
+ "2xs": {
177
+ root: "size-5 text-[10px]"
178
+ },
179
+ "xs": {
180
+ root: "size-6 text-xs"
181
+ },
182
+ "sm": {
183
+ root: "size-7 text-sm"
184
+ },
185
+ "md": {
186
+ root: "size-8 text-base"
187
+ },
188
+ "lg": {
189
+ root: "size-9 text-lg"
190
+ },
191
+ "xl": {
192
+ root: "size-10 text-xl"
193
+ },
194
+ "2xl": {
195
+ root: "size-11 text-[22px]"
196
+ },
197
+ "3xl": {
198
+ root: "size-12 text-2xl"
199
+ }
200
+ }
201
+ },
202
+ defaultVariants: {
203
+ size: "md"
204
+ }
205
+ };
206
+
207
+ const avatarGroup = {
208
+ slots: {
209
+ root: "inline-flex flex-row-reverse justify-end",
210
+ base: "relative rounded-full ring-[var(--ui-bg)] first:me-0"
211
+ },
212
+ variants: {
213
+ size: {
214
+ "3xs": {
215
+ base: "ring -me-0.5"
216
+ },
217
+ "2xs": {
218
+ base: "ring -me-0.5"
219
+ },
220
+ "xs": {
221
+ base: "ring -me-0.5"
222
+ },
223
+ "sm": {
224
+ base: "ring-2 -me-1.5"
225
+ },
226
+ "md": {
227
+ base: "ring-2 -me-1.5"
228
+ },
229
+ "lg": {
230
+ base: "ring-2 -me-1.5"
231
+ },
232
+ "xl": {
233
+ base: "ring-3 -me-2"
234
+ },
235
+ "2xl": {
236
+ base: "ring-3 -me-2"
237
+ },
238
+ "3xl": {
239
+ base: "ring-3 -me-2"
240
+ }
241
+ }
242
+ },
243
+ defaultVariants: {
244
+ size: "md"
245
+ }
246
+ };
247
+
248
+ const badge = (options) => ({
249
+ slots: {
250
+ base: "rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center",
251
+ label: "truncate",
252
+ leadingIcon: "shrink-0",
253
+ leadingAvatar: "shrink-0",
254
+ leadingAvatarSize: "",
255
+ trailingIcon: "shrink-0"
256
+ },
257
+ variants: {
258
+ color: {
259
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
260
+ neutral: ""
261
+ },
262
+ variant: {
263
+ solid: "",
264
+ outline: "",
265
+ soft: "",
266
+ subtle: ""
267
+ },
268
+ size: {
269
+ sm: {
270
+ base: "text-xs px-1.5 py-0.5 gap-1",
271
+ leadingIcon: "size-4",
272
+ leadingAvatarSize: "3xs",
273
+ trailingIcon: "size-4"
274
+ },
275
+ md: {
276
+ base: "text-xs px-2 py-1 gap-1",
277
+ leadingIcon: "size-4",
278
+ leadingAvatarSize: "3xs",
279
+ trailingIcon: "size-4"
280
+ },
281
+ lg: {
282
+ base: "text-sm px-2 py-1 gap-1.5",
283
+ leadingIcon: "size-5",
284
+ leadingAvatarSize: "2xs",
285
+ trailingIcon: "size-5"
286
+ }
287
+ }
288
+ },
289
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
290
+ color,
291
+ variant: "solid",
292
+ class: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
293
+ })), ...(options.theme.colors || []).map((color) => ({
294
+ color,
295
+ variant: "outline",
296
+ class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/50`
297
+ })), ...(options.theme.colors || []).map((color) => ({
298
+ color,
299
+ variant: "soft",
300
+ class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
301
+ })), ...(options.theme.colors || []).map((color) => ({
302
+ color,
303
+ variant: "subtle",
304
+ class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
305
+ })), {
306
+ color: "neutral",
307
+ variant: "solid",
308
+ class: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]"
309
+ }, {
310
+ color: "neutral",
311
+ variant: "outline",
312
+ class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)]"
313
+ }, {
314
+ color: "neutral",
315
+ variant: "soft",
316
+ class: "text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]"
317
+ }, {
318
+ color: "neutral",
319
+ variant: "subtle",
320
+ class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]"
321
+ }],
322
+ defaultVariants: {
323
+ color: "primary",
324
+ variant: "solid",
325
+ size: "md"
326
+ }
327
+ });
328
+
329
+ const breadcrumb = (options) => ({
330
+ slots: {
331
+ root: "relative min-w-0",
332
+ list: "flex items-center gap-1.5",
333
+ item: "flex min-w-0",
334
+ link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-[var(--ui-primary)]",
335
+ linkLeadingIcon: "shrink-0 size-5",
336
+ linkLeadingAvatar: "shrink-0",
337
+ linkLeadingAvatarSize: "2xs",
338
+ linkLabel: "truncate",
339
+ separator: "flex",
340
+ separatorIcon: "shrink-0 size-5 text-[var(--ui-text-muted)]"
341
+ },
342
+ variants: {
343
+ active: {
344
+ true: {
345
+ link: "text-[var(--ui-primary)] font-semibold"
346
+ },
347
+ false: {
348
+ link: "text-[var(--ui-text-muted)] font-medium"
349
+ }
350
+ },
351
+ disabled: {
352
+ true: {
353
+ link: "cursor-not-allowed opacity-75"
354
+ }
355
+ },
356
+ to: {
357
+ true: ""
358
+ }
359
+ },
360
+ compoundVariants: [{
361
+ disabled: false,
362
+ active: false,
363
+ to: true,
364
+ class: {
365
+ link: ["hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
366
+ }
367
+ }]
368
+ });
369
+
370
+ const buttonGroupVariant = {
371
+ buttonGroup: {
372
+ horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
373
+ vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
374
+ }
375
+ };
376
+ const buttonGroupVariantWithRoot = {
377
+ buttonGroup: {
378
+ horizontal: {
379
+ root: "group",
380
+ base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
381
+ },
382
+ vertical: {
383
+ root: "group",
384
+ base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
385
+ }
386
+ }
387
+ };
388
+ const buttonGroup = {
389
+ base: "relative",
390
+ variants: {
391
+ size: {
392
+ xs: "",
393
+ sm: "",
394
+ md: "",
395
+ lg: "",
396
+ xl: ""
397
+ },
398
+ orientation: {
399
+ horizontal: "inline-flex -space-x-px",
400
+ vertical: "flex flex-col -space-y-px"
401
+ }
402
+ }
403
+ };
404
+
405
+ const button = (options) => ({
406
+ slots: {
407
+ base: ["rounded-[calc(var(--ui-radius)*1.5)] 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"],
408
+ label: "truncate",
409
+ leadingIcon: "shrink-0",
410
+ leadingAvatar: "shrink-0",
411
+ leadingAvatarSize: "",
412
+ trailingIcon: "shrink-0"
413
+ },
414
+ variants: {
415
+ ...buttonGroupVariant,
416
+ color: {
417
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
418
+ neutral: ""
419
+ },
420
+ variant: {
421
+ solid: "",
422
+ outline: "",
423
+ soft: "",
424
+ subtle: "",
425
+ ghost: "",
426
+ link: ""
427
+ },
428
+ size: {
429
+ xs: {
430
+ base: "px-2 py-1 text-xs gap-1",
431
+ leadingIcon: "size-4",
432
+ leadingAvatarSize: "3xs",
433
+ trailingIcon: "size-4"
434
+ },
435
+ sm: {
436
+ base: "px-2.5 py-1.5 text-xs gap-1.5",
437
+ leadingIcon: "size-4",
438
+ leadingAvatarSize: "3xs",
439
+ trailingIcon: "size-4"
440
+ },
441
+ md: {
442
+ base: "px-2.5 py-1.5 text-sm gap-1.5",
443
+ leadingIcon: "size-5",
444
+ leadingAvatarSize: "2xs",
445
+ trailingIcon: "size-5"
446
+ },
447
+ lg: {
448
+ base: "px-3 py-2 text-sm gap-2",
449
+ leadingIcon: "size-5",
450
+ leadingAvatarSize: "2xs",
451
+ trailingIcon: "size-5"
452
+ },
453
+ xl: {
454
+ base: "px-3 py-2 text-base gap-2",
455
+ leadingIcon: "size-6",
456
+ leadingAvatarSize: "xs",
457
+ trailingIcon: "size-6"
458
+ }
459
+ },
460
+ block: {
461
+ true: {
462
+ base: "w-full justify-center",
463
+ leadingAvatarSize: "xs",
464
+ trailingIcon: "ms-auto"
465
+ }
466
+ },
467
+ square: {
468
+ true: ""
469
+ },
470
+ leading: {
471
+ true: ""
472
+ },
473
+ trailing: {
474
+ true: ""
475
+ },
476
+ loading: {
477
+ true: ""
478
+ }
479
+ },
480
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
481
+ color,
482
+ variant: "solid",
483
+ class: `text-[var(--ui-bg)] bg-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/75 disabled:bg-[var(--ui-${color})] aria-disabled:bg-[var(--ui-${color})] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-${color})]`
484
+ })), ...(options.theme.colors || []).map((color) => ({
485
+ color,
486
+ variant: "outline",
487
+ class: `ring ring-inset ring-[var(--ui-${color})]/50 text-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-[var(--ui-${color})]`
488
+ })), ...(options.theme.colors || []).map((color) => ({
489
+ color,
490
+ variant: "soft",
491
+ class: `text-[var(--ui-${color})] bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 focus-visible:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10`
492
+ })), ...(options.theme.colors || []).map((color) => ({
493
+ color,
494
+ variant: "subtle",
495
+ class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25 bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10 focus-visible:ring-2 focus-visible:ring-[var(--ui-${color})]`
496
+ })), ...(options.theme.colors || []).map((color) => ({
497
+ color,
498
+ variant: "ghost",
499
+ class: `text-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/10 focus-visible:bg-[var(--ui-${color})]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
500
+ })), ...(options.theme.colors || []).map((color) => ({
501
+ color,
502
+ variant: "link",
503
+ class: `text-[var(--ui-${color})] hover:text-[var(--ui-${color})]/75 disabled:text-[var(--ui-${color})] aria-disabled:text-[var(--ui-${color})] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
504
+ })), {
505
+ color: "neutral",
506
+ variant: "solid",
507
+ class: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)] hover:bg-[var(--ui-bg-inverted)]/80 disabled:bg-[var(--ui-bg-inverted)] aria-disabled:bg-[var(--ui-bg-inverted)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-border-inverted)]"
508
+ }, {
509
+ color: "neutral",
510
+ variant: "outline",
511
+ class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)] hover:bg-[var(--ui-bg-elevated)] disabled:bg-[var(--ui-bg)] aria-disabled:bg-[var(--ui-bg)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
512
+ }, {
513
+ color: "neutral",
514
+ variant: "soft",
515
+ class: "text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 focus-visible:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)]"
516
+ }, {
517
+ color: "neutral",
518
+ variant: "subtle",
519
+ class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
520
+ }, {
521
+ color: "neutral",
522
+ variant: "ghost",
523
+ class: "text-[var(--ui-text)] hover:bg-[var(--ui-bg-elevated)] focus-visible:bg-[var(--ui-bg-elevated)] hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
524
+ }, {
525
+ color: "neutral",
526
+ variant: "link",
527
+ class: "text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] disabled:text-[var(--ui-text-muted)] aria-disabled:text-[var(--ui-text-muted)] focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
528
+ }, {
529
+ size: "xs",
530
+ square: true,
531
+ class: "p-1"
532
+ }, {
533
+ size: "sm",
534
+ square: true,
535
+ class: "p-1.5"
536
+ }, {
537
+ size: "md",
538
+ square: true,
539
+ class: "p-1.5"
540
+ }, {
541
+ size: "lg",
542
+ square: true,
543
+ class: "p-2"
544
+ }, {
545
+ size: "xl",
546
+ square: true,
547
+ class: "p-2"
548
+ }, {
549
+ loading: true,
550
+ leading: true,
551
+ class: {
552
+ leadingIcon: "animate-spin"
553
+ }
554
+ }, {
555
+ loading: true,
556
+ leading: false,
557
+ trailing: true,
558
+ class: {
559
+ trailingIcon: "animate-spin"
560
+ }
561
+ }],
562
+ defaultVariants: {
563
+ color: "primary",
564
+ variant: "solid",
565
+ size: "md"
566
+ }
567
+ });
568
+
569
+ const card = {
570
+ slots: {
571
+ root: "bg-[var(--ui-bg)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] rounded-[calc(var(--ui-radius)*2)] shadow",
572
+ header: "p-4 sm:px-6",
573
+ body: "p-4 sm:p-6",
574
+ footer: "p-4 sm:px-6"
575
+ }
576
+ };
577
+
578
+ const carousel = (options) => ({
579
+ slots: {
580
+ root: "relative focus:outline-none",
581
+ viewport: "overflow-hidden",
582
+ container: "flex items-start",
583
+ item: "min-w-0 shrink-0 basis-full",
584
+ controls: "",
585
+ arrows: "",
586
+ prev: "absolute rounded-full",
587
+ next: "absolute rounded-full",
588
+ dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
589
+ dot: ["cursor-pointer size-3 bg-[var(--ui-border-accented)] rounded-full", options.theme.transitions && "transition"]
590
+ },
591
+ variants: {
592
+ orientation: {
593
+ vertical: {
594
+ container: "flex-col -mt-4",
595
+ item: "pt-4",
596
+ prev: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
597
+ next: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"
598
+ },
599
+ horizontal: {
600
+ container: "flex-row -ms-4",
601
+ item: "ps-4",
602
+ prev: "-start-12 top-1/2 -translate-y-1/2",
603
+ next: "-end-12 top-1/2 -translate-y-1/2"
604
+ }
605
+ },
606
+ active: {
607
+ true: {
608
+ dot: "bg-[var(--ui-border-inverted)]"
609
+ }
610
+ }
611
+ },
612
+ defaultVariants: {
613
+ orientation: "horizontal"
614
+ }
615
+ });
616
+
617
+ const checkbox = (options) => ({
618
+ slots: {
619
+ root: "relative flex items-start",
620
+ base: "shrink-0 flex items-center justify-center rounded-[var(--ui-radius)] text-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
621
+ container: "flex items-center",
622
+ wrapper: "ms-2",
623
+ icon: "shrink-0 size-full",
624
+ label: "block font-medium text-[var(--ui-text)]",
625
+ description: "text-[var(--ui-text-muted)]"
626
+ },
627
+ variants: {
628
+ color: {
629
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-[var(--ui-${color})]`])),
630
+ neutral: "focus-visible:outline-[var(--ui-border-inverted)]"
631
+ },
632
+ size: {
633
+ xs: {
634
+ base: "size-3",
635
+ container: "h-4",
636
+ wrapper: "text-xs"
637
+ },
638
+ sm: {
639
+ base: "size-3.5",
640
+ container: "h-4",
641
+ wrapper: "text-xs"
642
+ },
643
+ md: {
644
+ base: "size-4",
645
+ container: "h-5",
646
+ wrapper: "text-sm"
647
+ },
648
+ lg: {
649
+ base: "size-4.5",
650
+ container: "h-5",
651
+ wrapper: "text-sm"
652
+ },
653
+ xl: {
654
+ base: "size-5",
655
+ container: "h-6",
656
+ wrapper: "text-base"
657
+ }
658
+ },
659
+ required: {
660
+ true: {
661
+ label: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
662
+ }
663
+ },
664
+ disabled: {
665
+ true: {
666
+ base: "cursor-not-allowed opacity-75",
667
+ label: "cursor-not-allowed opacity-75",
668
+ description: "cursor-not-allowed opacity-75"
669
+ }
670
+ },
671
+ checked: {
672
+ true: ""
673
+ }
674
+ },
675
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
676
+ color,
677
+ checked: true,
678
+ class: `ring-2 ring-[var(--ui-${color})] bg-[var(--ui-${color})]`
679
+ })), {
680
+ color: "neutral",
681
+ checked: true,
682
+ class: "ring-2 ring-[var(--ui-border-inverted)] bg-[var(--ui-bg-inverted)]"
683
+ }],
684
+ defaultVariants: {
685
+ size: "md",
686
+ color: "primary"
687
+ }
688
+ });
689
+
690
+ const chip = (options) => ({
691
+ slots: {
692
+ root: "relative inline-flex items-center justify-center shrink-0",
693
+ base: "rounded-full ring ring-[var(--ui-bg)] flex items-center justify-center text-[var(--ui-bg)] font-medium whitespace-nowrap"
694
+ },
695
+ variants: {
696
+ color: {
697
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-[var(--ui-${color})]`])),
698
+ neutral: "bg-[var(--ui-text-muted)]"
699
+ },
700
+ size: {
701
+ "3xs": "h-[4px] min-w-[4px] text-[4px]",
702
+ "2xs": "h-[5px] min-w-[5px] text-[5px]",
703
+ "xs": "h-[6px] min-w-[6px] text-[6px]",
704
+ "sm": "h-[7px] min-w-[7px] text-[7px]",
705
+ "md": "h-[8px] min-w-[8px] text-[8px]",
706
+ "lg": "h-[9px] min-w-[9px] text-[9px]",
707
+ "xl": "h-[10px] min-w-[10px] text-[10px]",
708
+ "2xl": "h-[11px] min-w-[11px] text-[11px]",
709
+ "3xl": "h-[12px] min-w-[12px] text-[12px]"
710
+ },
711
+ position: {
712
+ "top-right": "top-0 right-0",
713
+ "bottom-right": "bottom-0 right-0",
714
+ "top-left": "top-0 left-0",
715
+ "bottom-left": "bottom-0 left-0"
716
+ },
717
+ inset: {
718
+ false: ""
719
+ },
720
+ standalone: {
721
+ false: "absolute"
722
+ }
723
+ },
724
+ compoundVariants: [{
725
+ position: "top-right",
726
+ inset: false,
727
+ class: "-translate-y-1/2 translate-x-1/2 transform"
728
+ }, {
729
+ position: "bottom-right",
730
+ inset: false,
731
+ class: "translate-y-1/2 translate-x-1/2 transform"
732
+ }, {
733
+ position: "top-left",
734
+ inset: false,
735
+ class: "-translate-y-1/2 -translate-x-1/2 transform"
736
+ }, {
737
+ position: "bottom-left",
738
+ inset: false,
739
+ class: "translate-y-1/2 -translate-x-1/2 transform"
740
+ }],
741
+ defaultVariants: {
742
+ size: "md",
743
+ color: "primary",
744
+ position: "top-right"
745
+ }
746
+ });
747
+
748
+ const collapsible = {
749
+ slots: {
750
+ root: "",
751
+ content: "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
752
+ }
753
+ };
754
+
755
+ const commandPalette = (options) => ({
756
+ slots: {
757
+ root: "flex flex-col min-h-0 min-w-0 divide-y divide-[var(--ui-border)]",
758
+ input: "[&>input]:h-12",
759
+ close: "",
760
+ content: "relative overflow-hidden",
761
+ viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
762
+ group: "p-1 isolate",
763
+ empty: "py-6 text-center text-sm text-[var(--ui-text-muted)]",
764
+ label: "px-2 py-1.5 text-xs font-semibold text-[var(--ui-text-highlighted)]",
765
+ 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-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
766
+ itemLeadingIcon: ["shrink-0 size-5 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
767
+ itemLeadingAvatar: "shrink-0",
768
+ itemLeadingAvatarSize: "2xs",
769
+ itemLeadingChip: "shrink-0 size-5",
770
+ itemLeadingChipSize: "md",
771
+ itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
772
+ itemTrailingIcon: "shrink-0 size-5",
773
+ itemTrailingHighlightedIcon: "shrink-0 size-5 text-[var(--ui-text-dimmed)] hidden group-data-highlighted:inline-flex",
774
+ itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
775
+ itemTrailingKbdsSize: "md",
776
+ itemLabel: "truncate space-x-1 rtl:space-x-reverse",
777
+ itemLabelBase: "text-[var(--ui-text-highlighted)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]",
778
+ itemLabelPrefix: "text-[var(--ui-text)]",
779
+ itemLabelSuffix: "text-[var(--ui-text-dimmed)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]"
780
+ },
781
+ variants: {
782
+ loading: {
783
+ true: {
784
+ itemLeadingIcon: "animate-spin"
785
+ }
786
+ }
787
+ }
788
+ });
789
+
790
+ const container = {
791
+ base: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"
792
+ };
793
+
794
+ const contextMenu = (options) => ({
795
+ slots: {
796
+ content: "min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
797
+ group: "p-1 isolate",
798
+ label: "w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]",
799
+ separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
800
+ item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
801
+ itemLeadingIcon: "shrink-0",
802
+ itemLeadingAvatar: "shrink-0",
803
+ itemLeadingAvatarSize: "",
804
+ itemTrailing: "ms-auto inline-flex",
805
+ itemTrailingIcon: "shrink-0",
806
+ itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
807
+ itemTrailingKbdsSize: "",
808
+ itemLabel: "truncate",
809
+ itemLabelExternalIcon: "inline-block size-3 align-top text-[var(--ui-text-dimmed)]"
810
+ },
811
+ variants: {
812
+ color: {
813
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
814
+ neutral: ""
815
+ },
816
+ active: {
817
+ true: {
818
+ item: "text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]",
819
+ itemLeadingIcon: "text-[var(--ui-text)]"
820
+ },
821
+ false: {
822
+ item: ["text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
823
+ itemLeadingIcon: ["text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
824
+ }
825
+ },
826
+ loading: {
827
+ true: {
828
+ itemLeadingIcon: "animate-spin"
829
+ }
830
+ },
831
+ size: {
832
+ xs: {
833
+ label: "p-1 text-xs gap-1",
834
+ item: "p-1 text-xs gap-1",
835
+ itemLeadingIcon: "size-4",
836
+ itemLeadingAvatarSize: "3xs",
837
+ itemTrailingIcon: "size-4",
838
+ itemTrailingKbds: "gap-0.5",
839
+ itemTrailingKbdsSize: "sm"
840
+ },
841
+ sm: {
842
+ label: "p-1.5 text-xs gap-1.5",
843
+ item: "p-1.5 text-xs gap-1.5",
844
+ itemLeadingIcon: "size-4",
845
+ itemLeadingAvatarSize: "3xs",
846
+ itemTrailingIcon: "size-4",
847
+ itemTrailingKbds: "gap-0.5",
848
+ itemTrailingKbdsSize: "sm"
849
+ },
850
+ md: {
851
+ label: "p-1.5 text-sm gap-1.5",
852
+ item: "p-1.5 text-sm gap-1.5",
853
+ itemLeadingIcon: "size-5",
854
+ itemLeadingAvatarSize: "2xs",
855
+ itemTrailingIcon: "size-5",
856
+ itemTrailingKbds: "gap-0.5",
857
+ itemTrailingKbdsSize: "md"
858
+ },
859
+ lg: {
860
+ label: "p-2 text-sm gap-2",
861
+ item: "p-2 text-sm gap-2",
862
+ itemLeadingIcon: "size-5",
863
+ itemLeadingAvatarSize: "2xs",
864
+ itemTrailingIcon: "size-5",
865
+ itemTrailingKbds: "gap-1",
866
+ itemTrailingKbdsSize: "md"
867
+ },
868
+ xl: {
869
+ label: "p-2 text-base gap-2",
870
+ item: "p-2 text-base gap-2",
871
+ itemLeadingIcon: "size-6",
872
+ itemLeadingAvatarSize: "xs",
873
+ itemTrailingIcon: "size-6",
874
+ itemTrailingKbds: "gap-1",
875
+ itemTrailingKbdsSize: "lg"
876
+ }
877
+ }
878
+ },
879
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
880
+ color,
881
+ active: false,
882
+ class: {
883
+ item: `text-[var(--ui-${color})] data-highlighted:text-[var(--ui-${color})] data-highlighted:before:bg-[var(--ui-${color})]/10 data-[state=open]:before:bg-[var(--ui-${color})]/10`,
884
+ itemLeadingIcon: `text-[var(--ui-${color})]/75 group-data-highlighted:text-[var(--ui-${color})] group-data-[state=open]:text-[var(--ui-${color})]`
885
+ }
886
+ })), ...(options.theme.colors || []).map((color) => ({
887
+ color,
888
+ active: true,
889
+ class: {
890
+ item: `text-[var(--ui-${color})] before:bg-[var(--ui-${color})]/10`,
891
+ itemLeadingIcon: `text-[var(--ui-${color})]`
892
+ }
893
+ }))],
894
+ defaultVariants: {
895
+ size: "md"
896
+ }
897
+ });
898
+
899
+ const drawer = {
900
+ slots: {
901
+ overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
902
+ content: "fixed bg-[var(--ui-bg)] ring ring-[var(--ui-border)] flex focus:outline-none",
903
+ handle: "shrink-0 rounded-full bg-[var(--ui-bg-accented)]",
904
+ container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
905
+ header: "",
906
+ title: "text-[var(--ui-text-highlighted)] font-semibold",
907
+ description: "mt-1 text-[var(--ui-text-muted)] text-sm",
908
+ body: "flex-1",
909
+ footer: "flex flex-col gap-1.5"
910
+ },
911
+ variants: {
912
+ direction: {
913
+ top: {
914
+ content: "top-0 mb-24 flex-col-reverse rounded-b-[calc(var(--ui-radius)*2)]",
915
+ handle: "mb-4"
916
+ },
917
+ right: {
918
+ content: "right-4 flex-row",
919
+ handle: "ml-4"
920
+ },
921
+ bottom: {
922
+ content: "bottom-0 mt-24 flex-col rounded-t-[calc(var(--ui-radius)*2)]",
923
+ handle: "mt-4"
924
+ },
925
+ left: {
926
+ content: "left-4 flex-row-reverse",
927
+ handle: "mr-4"
928
+ }
929
+ }
930
+ },
931
+ compoundVariants: [{
932
+ direction: ["top", "bottom"],
933
+ class: {
934
+ content: "inset-x-0 h-auto max-h-[96%]",
935
+ handle: "w-12 h-1.5 mx-auto"
936
+ }
937
+ }, {
938
+ direction: ["right", "left"],
939
+ class: {
940
+ content: "inset-y-4 w-auto max-w-[calc(100%-2rem)] rounded-[calc(var(--ui-radius)*2)] after:hidden",
941
+ handle: "h-12 w-1.5 mt-auto mb-auto"
942
+ }
943
+ }]
944
+ };
945
+
946
+ const dropdownMenu = (options) => ({
947
+ slots: {
948
+ content: "min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
949
+ arrow: "fill-[var(--ui-border)]",
950
+ group: "p-1 isolate",
951
+ label: "w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]",
952
+ separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
953
+ item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
954
+ itemLeadingIcon: "shrink-0",
955
+ itemLeadingAvatar: "shrink-0",
956
+ itemLeadingAvatarSize: "",
957
+ itemTrailing: "ms-auto inline-flex",
958
+ itemTrailingIcon: "shrink-0",
959
+ itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
960
+ itemTrailingKbdsSize: "",
961
+ itemLabel: "truncate",
962
+ itemLabelExternalIcon: "inline-block size-3 align-top text-[var(--ui-text-dimmed)]"
963
+ },
964
+ variants: {
965
+ color: {
966
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
967
+ neutral: ""
968
+ },
969
+ active: {
970
+ true: {
971
+ item: "text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]",
972
+ itemLeadingIcon: "text-[var(--ui-text)]"
973
+ },
974
+ false: {
975
+ item: ["text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
976
+ itemLeadingIcon: ["text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
977
+ }
978
+ },
979
+ loading: {
980
+ true: {
981
+ itemLeadingIcon: "animate-spin"
982
+ }
983
+ },
984
+ size: {
985
+ xs: {
986
+ label: "p-1 text-xs gap-1",
987
+ item: "p-1 text-xs gap-1",
988
+ itemLeadingIcon: "size-4",
989
+ itemLeadingAvatarSize: "3xs",
990
+ itemTrailingIcon: "size-4",
991
+ itemTrailingKbds: "gap-0.5",
992
+ itemTrailingKbdsSize: "sm"
993
+ },
994
+ sm: {
995
+ label: "p-1.5 text-xs gap-1.5",
996
+ item: "p-1.5 text-xs gap-1.5",
997
+ itemLeadingIcon: "size-4",
998
+ itemLeadingAvatarSize: "3xs",
999
+ itemTrailingIcon: "size-4",
1000
+ itemTrailingKbds: "gap-0.5",
1001
+ itemTrailingKbdsSize: "sm"
1002
+ },
1003
+ md: {
1004
+ label: "p-1.5 text-sm gap-1.5",
1005
+ item: "p-1.5 text-sm gap-1.5",
1006
+ itemLeadingIcon: "size-5",
1007
+ itemLeadingAvatarSize: "2xs",
1008
+ itemTrailingIcon: "size-5",
1009
+ itemTrailingKbds: "gap-0.5",
1010
+ itemTrailingKbdsSize: "md"
1011
+ },
1012
+ lg: {
1013
+ label: "p-2 text-sm gap-2",
1014
+ item: "p-2 text-sm gap-2",
1015
+ itemLeadingIcon: "size-5",
1016
+ itemLeadingAvatarSize: "2xs",
1017
+ itemTrailingIcon: "size-5",
1018
+ itemTrailingKbds: "gap-1",
1019
+ itemTrailingKbdsSize: "md"
1020
+ },
1021
+ xl: {
1022
+ label: "p-2 text-base gap-2",
1023
+ item: "p-2 text-base gap-2",
1024
+ itemLeadingIcon: "size-6",
1025
+ itemLeadingAvatarSize: "xs",
1026
+ itemTrailingIcon: "size-6",
1027
+ itemTrailingKbds: "gap-1",
1028
+ itemTrailingKbdsSize: "lg"
1029
+ }
1030
+ }
1031
+ },
1032
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
1033
+ color,
1034
+ active: false,
1035
+ class: {
1036
+ item: `text-[var(--ui-${color})] data-highlighted:text-[var(--ui-${color})] data-highlighted:before:bg-[var(--ui-${color})]/10 data-[state=open]:before:bg-[var(--ui-${color})]/10`,
1037
+ itemLeadingIcon: `text-[var(--ui-${color})]/75 group-data-highlighted:text-[var(--ui-${color})] group-data-[state=open]:text-[var(--ui-${color})]`
1038
+ }
1039
+ })), ...(options.theme.colors || []).map((color) => ({
1040
+ color,
1041
+ active: true,
1042
+ class: {
1043
+ item: `text-[var(--ui-${color})] before:bg-[var(--ui-${color})]/10`,
1044
+ itemLeadingIcon: `text-[var(--ui-${color})]`
1045
+ }
1046
+ }))],
1047
+ defaultVariants: {
1048
+ size: "md"
1049
+ }
1050
+ });
1051
+
1052
+ const form = {
1053
+ base: ""
1054
+ };
1055
+
1056
+ const formField = {
1057
+ slots: {
1058
+ root: "",
1059
+ wrapper: "",
1060
+ labelWrapper: "flex content-center items-center justify-between",
1061
+ label: "block font-medium text-[var(--ui-text)]",
1062
+ container: "mt-1 relative",
1063
+ description: "text-[var(--ui-text-muted)]",
1064
+ error: "mt-2 text-[var(--ui-error)]",
1065
+ hint: "text-[var(--ui-text-muted)]",
1066
+ help: "mt-2 text-[var(--ui-text-muted)]"
1067
+ },
1068
+ variants: {
1069
+ size: {
1070
+ xs: { root: "text-xs" },
1071
+ sm: { root: "text-xs" },
1072
+ md: { root: "text-sm" },
1073
+ lg: { root: "text-sm" },
1074
+ xl: { root: "text-base" }
1075
+ },
1076
+ required: {
1077
+ true: {
1078
+ label: `after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]`
1079
+ }
1080
+ }
1081
+ },
1082
+ defaultVariants: {
1083
+ size: "md"
1084
+ }
1085
+ };
1086
+
1087
+ const input = (options) => ({
1088
+ slots: {
1089
+ root: "relative inline-flex items-center",
1090
+ base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
1091
+ leading: "absolute inset-y-0 start-0 flex items-center",
1092
+ leadingIcon: "shrink-0 text-[var(--ui-text-dimmed)]",
1093
+ leadingAvatar: "shrink-0",
1094
+ leadingAvatarSize: "",
1095
+ trailing: "absolute inset-y-0 end-0 flex items-center",
1096
+ trailingIcon: "shrink-0 text-[var(--ui-text-dimmed)]"
1097
+ },
1098
+ variants: {
1099
+ ...buttonGroupVariantWithRoot,
1100
+ size: {
1101
+ xs: {
1102
+ base: "px-2 py-1 text-xs gap-1",
1103
+ leading: "ps-2",
1104
+ trailing: "pe-2",
1105
+ leadingIcon: "size-4",
1106
+ leadingAvatarSize: "3xs",
1107
+ trailingIcon: "size-4"
1108
+ },
1109
+ sm: {
1110
+ base: "px-2.5 py-1.5 text-xs gap-1.5",
1111
+ leading: "ps-2.5",
1112
+ trailing: "pe-2.5",
1113
+ leadingIcon: "size-4",
1114
+ leadingAvatarSize: "3xs",
1115
+ trailingIcon: "size-4"
1116
+ },
1117
+ md: {
1118
+ base: "px-2.5 py-1.5 text-sm gap-1.5",
1119
+ leading: "ps-2.5",
1120
+ trailing: "pe-2.5",
1121
+ leadingIcon: "size-5",
1122
+ leadingAvatarSize: "2xs",
1123
+ trailingIcon: "size-5"
1124
+ },
1125
+ lg: {
1126
+ base: "px-3 py-2 text-sm gap-2",
1127
+ leading: "ps-3",
1128
+ trailing: "pe-3",
1129
+ leadingIcon: "size-5",
1130
+ leadingAvatarSize: "2xs",
1131
+ trailingIcon: "size-5"
1132
+ },
1133
+ xl: {
1134
+ base: "px-3 py-2 text-base gap-2",
1135
+ leading: "ps-3",
1136
+ trailing: "pe-3",
1137
+ leadingIcon: "size-6",
1138
+ leadingAvatarSize: "xs",
1139
+ trailingIcon: "size-6"
1140
+ }
1141
+ },
1142
+ variant: {
1143
+ outline: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)]",
1144
+ soft: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50 hover:bg-[var(--ui-bg-elevated)] focus:bg-[var(--ui-bg-elevated)] disabled:bg-[var(--ui-bg-elevated)]/50",
1145
+ subtle: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)] ring ring-inset ring-[var(--ui-border-accented)]",
1146
+ ghost: "text-[var(--ui-text-highlighted)] hover:bg-[var(--ui-bg-elevated)] focus:bg-[var(--ui-bg-elevated)] disabled:bg-transparent dark:disabled:bg-transparent",
1147
+ none: "text-[var(--ui-text-highlighted)]"
1148
+ },
1149
+ color: {
1150
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1151
+ neutral: ""
1152
+ },
1153
+ leading: {
1154
+ true: ""
1155
+ },
1156
+ trailing: {
1157
+ true: ""
1158
+ },
1159
+ loading: {
1160
+ true: ""
1161
+ },
1162
+ highlight: {
1163
+ true: ""
1164
+ },
1165
+ type: {
1166
+ file: "file:me-1.5 file:font-medium file:text-[var(--ui-text-muted)] file:outline-none"
1167
+ }
1168
+ },
1169
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
1170
+ color,
1171
+ variant: ["outline", "subtle"],
1172
+ class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
1173
+ })), ...(options.theme.colors || []).map((color) => ({
1174
+ color,
1175
+ highlight: true,
1176
+ class: `ring ring-inset ring-[var(--ui-${color})]`
1177
+ })), {
1178
+ color: "neutral",
1179
+ variant: ["outline", "subtle"],
1180
+ class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]"
1181
+ }, {
1182
+ color: "neutral",
1183
+ highlight: true,
1184
+ class: "ring ring-inset ring-[var(--ui-border-inverted)]"
1185
+ }, {
1186
+ leading: true,
1187
+ size: "xs",
1188
+ class: "ps-7"
1189
+ }, {
1190
+ leading: true,
1191
+ size: "sm",
1192
+ class: "ps-8"
1193
+ }, {
1194
+ leading: true,
1195
+ size: "md",
1196
+ class: "ps-9"
1197
+ }, {
1198
+ leading: true,
1199
+ size: "lg",
1200
+ class: "ps-10"
1201
+ }, {
1202
+ leading: true,
1203
+ size: "xl",
1204
+ class: "ps-11"
1205
+ }, {
1206
+ trailing: true,
1207
+ size: "xs",
1208
+ class: "pe-7"
1209
+ }, {
1210
+ trailing: true,
1211
+ size: "sm",
1212
+ class: "pe-8"
1213
+ }, {
1214
+ trailing: true,
1215
+ size: "md",
1216
+ class: "pe-9"
1217
+ }, {
1218
+ trailing: true,
1219
+ size: "lg",
1220
+ class: "pe-10"
1221
+ }, {
1222
+ trailing: true,
1223
+ size: "xl",
1224
+ class: "pe-11"
1225
+ }, {
1226
+ loading: true,
1227
+ leading: true,
1228
+ class: {
1229
+ leadingIcon: "animate-spin"
1230
+ }
1231
+ }, {
1232
+ loading: true,
1233
+ leading: false,
1234
+ trailing: true,
1235
+ class: {
1236
+ trailingIcon: "animate-spin"
1237
+ }
1238
+ }],
1239
+ defaultVariants: {
1240
+ size: "md",
1241
+ color: "primary",
1242
+ variant: "outline"
1243
+ }
1244
+ });
1245
+
1246
+ const inputMenu = (options) => {
1247
+ return defu.defuFn({
1248
+ slots: {
1249
+ base: () => ["rounded-[calc(var(--ui-radius)*1.5)]", options.theme.transitions && "transition-colors"],
1250
+ trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
1251
+ arrow: "fill-[var(--ui-border)]",
1252
+ content: "max-h-60 w-[var(--radix-popper-anchor-width)] bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1253
+ viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
1254
+ group: "p-1 isolate",
1255
+ empty: "py-2 text-center text-sm text-[var(--ui-text-muted)]",
1256
+ label: "font-semibold text-[var(--ui-text-highlighted)]",
1257
+ separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
1258
+ 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-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
1259
+ itemLeadingIcon: ["shrink-0 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
1260
+ itemLeadingAvatar: "shrink-0",
1261
+ itemLeadingAvatarSize: "",
1262
+ itemLeadingChip: "shrink-0",
1263
+ itemLeadingChipSize: "",
1264
+ itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
1265
+ itemTrailingIcon: "shrink-0",
1266
+ itemLabel: "truncate",
1267
+ tagsItem: "px-1.5 py-0.5 rounded-[var(--ui-radius)] font-medium inline-flex items-center gap-0.5 ring ring-inset ring-[var(--ui-border-accented)] bg-[var(--ui-bg-elevated)] text-[var(--ui-text)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
1268
+ tagsItemText: "truncate",
1269
+ tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-[var(--ui-text-dimmed)] hover:text-[var(--ui-text)] hover:bg-[var(--ui-bg-accented)]/75 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
1270
+ tagsItemDeleteIcon: "",
1271
+ tagsInput: ""
1272
+ },
1273
+ variants: {
1274
+ multiple: {
1275
+ true: {
1276
+ root: "flex-wrap",
1277
+ base: "",
1278
+ tagsInput: "border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1279
+ },
1280
+ false: {
1281
+ base: "w-full border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1282
+ }
1283
+ },
1284
+ size: {
1285
+ xs: {
1286
+ label: "p-1 text-[10px]/3 gap-1",
1287
+ item: "p-1 text-xs gap-1",
1288
+ itemLeadingIcon: "size-4",
1289
+ itemLeadingAvatarSize: "3xs",
1290
+ itemLeadingChip: "size-4",
1291
+ itemLeadingChipSize: "sm",
1292
+ itemTrailingIcon: "size-4",
1293
+ tagsItem: "text-[10px]/3",
1294
+ tagsItemDeleteIcon: "size-3"
1295
+ },
1296
+ sm: {
1297
+ label: "p-1.5 text-[10px]/3 gap-1.5",
1298
+ item: "p-1.5 text-xs gap-1.5",
1299
+ itemLeadingIcon: "size-4",
1300
+ itemLeadingAvatarSize: "3xs",
1301
+ itemLeadingChip: "size-4",
1302
+ itemLeadingChipSize: "sm",
1303
+ itemTrailingIcon: "size-4",
1304
+ tagsItem: "text-[10px]/3",
1305
+ tagsItemDeleteIcon: "size-3"
1306
+ },
1307
+ md: {
1308
+ label: "p-1.5 text-xs gap-1.5",
1309
+ item: "p-1.5 text-sm gap-1.5",
1310
+ itemLeadingIcon: "size-5",
1311
+ itemLeadingAvatarSize: "2xs",
1312
+ itemLeadingChip: "size-5",
1313
+ itemLeadingChipSize: "md",
1314
+ itemTrailingIcon: "size-5",
1315
+ tagsItem: "text-xs",
1316
+ tagsItemDeleteIcon: "size-3.5"
1317
+ },
1318
+ lg: {
1319
+ label: "p-2 text-xs gap-2",
1320
+ item: "p-2 text-sm gap-2",
1321
+ itemLeadingIcon: "size-5",
1322
+ itemLeadingAvatarSize: "2xs",
1323
+ itemLeadingChip: "size-5",
1324
+ itemLeadingChipSize: "md",
1325
+ itemTrailingIcon: "size-5",
1326
+ tagsItem: "text-xs",
1327
+ tagsItemDeleteIcon: "size-3.5"
1328
+ },
1329
+ xl: {
1330
+ label: "p-2 text-sm gap-2",
1331
+ item: "p-2 text-base gap-2",
1332
+ itemLeadingIcon: "size-6",
1333
+ itemLeadingAvatarSize: "xs",
1334
+ itemLeadingChip: "size-6",
1335
+ itemLeadingChipSize: "lg",
1336
+ itemTrailingIcon: "size-6",
1337
+ tagsItem: "text-sm",
1338
+ tagsItemDeleteIcon: "size-4"
1339
+ }
1340
+ }
1341
+ },
1342
+ compoundVariants: [...(options.theme.colors || []).map((color) => ({
1343
+ color,
1344
+ multiple: true,
1345
+ variant: ["outline", "subtle"],
1346
+ class: `has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--${color})]`
1347
+ })), {
1348
+ color: "neutral",
1349
+ multiple: true,
1350
+ variant: ["outline", "subtle"],
1351
+ class: "has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--ui-border-inverted)]"
1352
+ }]
1353
+ }, input(options));
1354
+ };
1355
+
1356
+ const kbd = {
1357
+ base: "inline-flex items-center justify-center px-1 rounded-[var(--ui-radius)] font-medium font-sans",
1358
+ variants: {
1359
+ variant: {
1360
+ solid: "bg-[var(--ui-bg-inverted)] text-[var(--ui-bg)]",
1361
+ outline: "bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] ring ring-inset ring-[var(--ui-border-accented)]",
1362
+ subtle: "bg-[var(--ui-bg-elevated)] text-[var(--ui-text)] ring ring-inset ring-[var(--ui-border-accented)]"
1363
+ },
1364
+ size: {
1365
+ sm: "h-4 min-w-[16px] text-[10px]",
1366
+ md: "h-5 min-w-[20px] text-[11px]",
1367
+ lg: "h-6 min-w-[24px] text-[12px]"
1368
+ }
1369
+ },
1370
+ defaultVariants: {
1371
+ variant: "outline",
1372
+ size: "md"
1373
+ }
1374
+ };
1375
+
1376
+ const link = (options) => ({
1377
+ base: "focus-visible:outline-[var(--ui-primary)]",
1378
+ variants: {
1379
+ active: {
1380
+ true: "text-[var(--ui-primary)]",
1381
+ false: ["text-[var(--ui-text-muted)] hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1382
+ },
1383
+ disabled: {
1384
+ true: "cursor-not-allowed opacity-75"
1385
+ }
1386
+ }
1387
+ });
1388
+
1389
+ const modal = {
1390
+ slots: {
1391
+ overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
1392
+ content: "fixed w-full h-dvh bg-[var(--ui-bg)] divide-y divide-[var(--ui-border)] flex flex-col focus:outline-none",
1393
+ header: "px-4 py-5 sm:px-6",
1394
+ body: "flex-1 p-4 sm:p-6",
1395
+ footer: "flex items-center gap-1.5 p-4 sm:px-6",
1396
+ title: "text-[var(--ui-text-highlighted)] font-semibold",
1397
+ description: "mt-1 text-[var(--ui-text-muted)] text-sm",
1398
+ close: "absolute top-4 end-4"
1399
+ },
1400
+ variants: {
1401
+ transition: {
1402
+ true: {
1403
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",
1404
+ content: "data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"
1405
+ }
1406
+ },
1407
+ fullscreen: {
1408
+ true: {
1409
+ content: "inset-0"
1410
+ },
1411
+ false: {
1412
+ content: "top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-[calc(var(--ui-radius)*2)] sm:shadow-lg sm:ring ring-[var(--ui-border)]"
1413
+ }
1414
+ }
1415
+ }
1416
+ };
1417
+
1418
+ const navigationMenu = (options) => ({
1419
+ slots: {
1420
+ root: "relative flex gap-1.5 [&>div]:min-w-0",
1421
+ list: "isolate min-w-0",
1422
+ item: "min-w-0",
1423
+ link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
1424
+ linkLeadingIcon: "shrink-0 size-5",
1425
+ linkLeadingAvatar: "shrink-0",
1426
+ linkLeadingAvatarSize: "2xs",
1427
+ linkTrailing: "ms-auto inline-flex",
1428
+ linkTrailingBadge: "shrink-0 rounded",
1429
+ linkTrailingBadgeSize: "sm",
1430
+ linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
1431
+ linkLabel: "truncate",
1432
+ linkLabelExternalIcon: "inline-block size-3 align-top text-[var(--ui-text-dimmed)]",
1433
+ childList: "",
1434
+ childItem: "",
1435
+ childLink: "group size-full px-3 py-2 rounded-[calc(var(--ui-radius)*1.5)] flex items-start gap-2 text-start",
1436
+ childLinkWrapper: "flex flex-col items-start",
1437
+ childLinkIcon: "size-5 shrink-0",
1438
+ childLinkLabel: "font-semibold text-sm relative inline-flex",
1439
+ childLinkLabelExternalIcon: "inline-block size-3 align-top text-[var(--ui-text-dimmed)]",
1440
+ childLinkDescription: "text-sm text-[var(--ui-text-muted)]",
1441
+ separator: "px-2 h-px bg-[var(--ui-border)]",
1442
+ viewportWrapper: "absolute top-full left-0 flex w-full justify-center",
1443
+ viewport: "relative overflow-hidden bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] h-[var(--radix-navigation-menu-viewport-height)] w-full transition-[width,height] origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1444
+ content: "absolute top-0 left-0 w-full data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]",
1445
+ indicator: "data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] bottom-0 z-[1] flex h-2.5 items-end justify-center overflow-hidden transition-transform duration-200 ease-out",
1446
+ arrow: "relative top-[50%] size-2.5 rotate-45 border border-[var(--ui-border)] bg-[var(--ui-bg)] z-[1] rounded-[calc(var(--ui-radius)/2)]"
1447
+ },
1448
+ variants: {
1449
+ color: {
1450
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1451
+ link: `focus-visible:before:ring-[var(--ui-${color})]`,
1452
+ childLink: `focus-visible:outline-[var(--ui-${color})]`
1453
+ }])),
1454
+ neutral: {
1455
+ link: "focus-visible:before:ring-[var(--ui-border-inverted)]",
1456
+ childLink: "focus-visible:outline-[var(--ui-border-inverted)]"
1457
+ }
1458
+ },
1459
+ highlightColor: {
1460
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1461
+ neutral: ""
1462
+ },
1463
+ variant: {
1464
+ pill: "",
1465
+ link: ""
1466
+ },
1467
+ orientation: {
1468
+ horizontal: {
1469
+ root: "w-full items-center justify-between",
1470
+ list: "flex items-center",
1471
+ item: "py-2",
1472
+ link: "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
1473
+ childList: "grid grid-cols-2 gap-2 p-2"
1474
+ },
1475
+ vertical: {
1476
+ root: "flex-col",
1477
+ link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",
1478
+ childList: "ms-5 border-s border-[var(--ui-border)]",
1479
+ childItem: "ps-1.5 -ms-px"
1480
+ }
1481
+ },
1482
+ active: {
1483
+ true: {
1484
+ childLink: "bg-[var(--ui-bg-elevated)] text-[var(--ui-text-highlighted)]",
1485
+ childLinkIcon: "text-[var(--ui-text)]"
1486
+ },
1487
+ false: {
1488
+ link: "text-[var(--ui-text-muted)]",
1489
+ linkLeadingIcon: "text-[var(--ui-text-dimmed)]",
1490
+ childLink: ["hover:bg-[var(--ui-bg-elevated)]/50 text-[var(--ui-text)] hover:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors"],
1491
+ childLinkIcon: ["text-[var(--ui-text-dimmed)] group-hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1492
+ }
1493
+ },
1494
+ disabled: {
1495
+ true: {
1496
+ link: "cursor-not-allowed opacity-75"
1497
+ }
1498
+ },
1499
+ highlight: {
1500
+ true: ""
1501
+ }
1502
+ },
1503
+ compoundVariants: [{
1504
+ highlight: true,
1505
+ orientation: "horizontal",
1506
+ class: {
1507
+ item: "-mb-px",
1508
+ link: "after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full"
1509
+ }
1510
+ }, {
1511
+ highlight: true,
1512
+ orientation: "vertical",
1513
+ class: {
1514
+ item: "px-1.5 -ms-px",
1515
+ link: "after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full"
1516
+ }
1517
+ }, {
1518
+ disabled: false,
1519
+ active: false,
1520
+ variant: "pill",
1521
+ class: {
1522
+ link: ["hover:text-[var(--ui-text-highlighted)] hover:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors before:transition-colors"],
1523
+ linkLeadingIcon: ["group-hover:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1524
+ }
1525
+ }, {
1526
+ disabled: false,
1527
+ variant: "pill",
1528
+ highlight: true,
1529
+ orientation: "horizontal",
1530
+ class: {
1531
+ link: "data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50"
1532
+ }
1533
+ }, {
1534
+ disabled: false,
1535
+ variant: "pill",
1536
+ highlight: false,
1537
+ active: false,
1538
+ orientation: "horizontal",
1539
+ class: {
1540
+ link: "data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50"
1541
+ }
1542
+ }, ...(options.theme.colors || []).map((color) => ({
1543
+ color,
1544
+ variant: "pill",
1545
+ active: true,
1546
+ class: {
1547
+ link: `text-[var(--ui-${color})]`,
1548
+ linkLeadingIcon: `text-[var(--ui-${color})]`
1549
+ }
1550
+ })), {
1551
+ color: "neutral",
1552
+ variant: "pill",
1553
+ active: true,
1554
+ class: {
1555
+ link: "text-[var(--ui-text-highlighted)]",
1556
+ linkLeadingIcon: "text-[var(--ui-text-highlighted)]"
1557
+ }
1558
+ }, {
1559
+ variant: "pill",
1560
+ active: true,
1561
+ highlight: false,
1562
+ class: {
1563
+ link: "before:bg-[var(--ui-bg-elevated)]"
1564
+ }
1565
+ }, {
1566
+ variant: "pill",
1567
+ active: true,
1568
+ highlight: true,
1569
+ class: {
1570
+ link: ["hover:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "before:transition-colors"]
1571
+ }
1572
+ }, {
1573
+ disabled: false,
1574
+ active: false,
1575
+ variant: "link",
1576
+ class: {
1577
+ link: ["hover:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors"],
1578
+ linkLeadingIcon: ["group-hover:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1579
+ }
1580
+ }, ...(options.theme.colors || []).map((color) => ({
1581
+ color,
1582
+ variant: "link",
1583
+ active: true,
1584
+ class: {
1585
+ link: `text-[var(--ui-${color})]`,
1586
+ linkLeadingIcon: `text-[var(--ui-${color})]`
1587
+ }
1588
+ })), {
1589
+ color: "neutral",
1590
+ variant: "link",
1591
+ active: true,
1592
+ class: {
1593
+ link: "text-[var(--ui-text-highlighted)]",
1594
+ linkLeadingIcon: "text-[var(--ui-text-highlighted)]"
1595
+ }
1596
+ }, ...(options.theme.colors || []).map((highlightColor) => ({
1597
+ highlightColor,
1598
+ highlight: true,
1599
+ active: true,
1600
+ class: {
1601
+ link: `after:bg-[var(--ui-${highlightColor})]`
1602
+ }
1603
+ })), {
1604
+ highlightColor: "neutral",
1605
+ highlight: true,
1606
+ active: true,
1607
+ class: {
1608
+ link: "after:bg-[var(--ui-bg-inverted)]"
1609
+ }
1610
+ }],
1611
+ defaultVariants: {
1612
+ color: "primary",
1613
+ highlightColor: "primary",
1614
+ variant: "pill"
1615
+ }
1616
+ });
1617
+
1618
+ const pagination = {
1619
+ slots: {
1620
+ root: "",
1621
+ list: "flex items-center gap-1",
1622
+ ellipsis: "pointer-events-none",
1623
+ label: "min-w-5 text-center"
1624
+ }
1625
+ };
1626
+
1627
+ const popover = {
1628
+ slots: {
1629
+ content: "bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] focus:outline-none",
1630
+ arrow: "fill-[var(--ui-border)]"
1631
+ }
1632
+ };
1633
+
1634
+ const progress = (options) => ({
1635
+ slots: {
1636
+ root: "gap-2",
1637
+ base: "relative overflow-hidden rounded-full bg-[var(--ui-bg-accented)]",
1638
+ indicator: "rounded-full size-full transition-transform duration-200 ease-out",
1639
+ status: "flex justify-end text-[var(--ui-text-dimmed)] transition-[width] duration-200",
1640
+ steps: "grid items-end",
1641
+ step: "truncate text-end row-start-1 col-start-1 transition-opacity"
1642
+ },
1643
+ variants: {
1644
+ animation: {
1645
+ "carousel": "",
1646
+ "carousel-inverse": "",
1647
+ "swing": "",
1648
+ "elastic": ""
1649
+ },
1650
+ color: {
1651
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1652
+ indicator: `bg-[var(--ui-${color})]`,
1653
+ steps: `text-[var(--ui-${color})]`
1654
+ }])),
1655
+ neutral: {
1656
+ indicator: "bg-[var(--ui-bg-inverted)]",
1657
+ steps: "text-[var(--ui-bg)]"
1658
+ }
1659
+ },
1660
+ size: {
1661
+ "2xs": {
1662
+ status: "text-xs",
1663
+ steps: "text-xs"
1664
+ },
1665
+ "xs": {
1666
+ status: "text-xs",
1667
+ steps: "text-xs"
1668
+ },
1669
+ "sm": {
1670
+ status: "text-sm",
1671
+ steps: "text-sm"
1672
+ },
1673
+ "md": {
1674
+ status: "text-sm",
1675
+ steps: "text-sm"
1676
+ },
1677
+ "lg": {
1678
+ status: "text-sm",
1679
+ steps: "text-sm"
1680
+ },
1681
+ "xl": {
1682
+ status: "text-base",
1683
+ steps: "text-base"
1684
+ },
1685
+ "2xl": {
1686
+ status: "text-base",
1687
+ steps: "text-base"
1688
+ }
1689
+ },
1690
+ step: {
1691
+ active: {
1692
+ step: "opacity-100"
1693
+ },
1694
+ first: {
1695
+ step: "opacity-100 text-[var(--ui-text-muted)]"
1696
+ },
1697
+ other: {
1698
+ step: "opacity-0"
1699
+ },
1700
+ last: {
1701
+ step: ""
1702
+ }
1703
+ },
1704
+ orientation: {
1705
+ horizontal: {
1706
+ root: "w-full flex flex-col",
1707
+ base: "w-full",
1708
+ status: "flex-row"
1709
+ },
1710
+ vertical: {
1711
+ root: "h-full flex flex-row-reverse",
1712
+ base: "h-full",
1713
+ status: "flex-col"
1714
+ }
1715
+ },
1716
+ inverted: {
1717
+ true: {
1718
+ status: "self-end"
1719
+ }
1720
+ }
1721
+ },
1722
+ compoundVariants: [{
1723
+ inverted: true,
1724
+ orientation: "horizontal",
1725
+ class: {
1726
+ step: "text-start",
1727
+ status: "flex-row-reverse"
1728
+ }
1729
+ }, {
1730
+ inverted: true,
1731
+ orientation: "vertical",
1732
+ class: {
1733
+ steps: "items-start",
1734
+ status: "flex-col-reverse"
1735
+ }
1736
+ }, {
1737
+ orientation: "horizontal",
1738
+ size: "2xs",
1739
+ class: "h-px"
1740
+ }, {
1741
+ orientation: "horizontal",
1742
+ size: "xs",
1743
+ class: "h-0.5"
1744
+ }, {
1745
+ orientation: "horizontal",
1746
+ size: "sm",
1747
+ class: "h-1"
1748
+ }, {
1749
+ orientation: "horizontal",
1750
+ size: "md",
1751
+ class: "h-2"
1752
+ }, {
1753
+ orientation: "horizontal",
1754
+ size: "lg",
1755
+ class: "h-3"
1756
+ }, {
1757
+ orientation: "horizontal",
1758
+ size: "xl",
1759
+ class: "h-4"
1760
+ }, {
1761
+ orientation: "horizontal",
1762
+ size: "2xl",
1763
+ class: "h-5"
1764
+ }, {
1765
+ orientation: "vertical",
1766
+ size: "2xs",
1767
+ class: "w-px"
1768
+ }, {
1769
+ orientation: "vertical",
1770
+ size: "xs",
1771
+ class: "w-0.5"
1772
+ }, {
1773
+ orientation: "vertical",
1774
+ size: "sm",
1775
+ class: "w-1"
1776
+ }, {
1777
+ orientation: "vertical",
1778
+ size: "md",
1779
+ class: "w-2"
1780
+ }, {
1781
+ orientation: "vertical",
1782
+ size: "lg",
1783
+ class: "w-3"
1784
+ }, {
1785
+ orientation: "vertical",
1786
+ size: "xl",
1787
+ class: "w-4"
1788
+ }, {
1789
+ orientation: "vertical",
1790
+ size: "2xl",
1791
+ class: "w-5"
1792
+ }, {
1793
+ orientation: "horizontal",
1794
+ animation: "carousel",
1795
+ class: {
1796
+ indicator: "data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite]"
1797
+ }
1798
+ }, {
1799
+ orientation: "vertical",
1800
+ animation: "carousel",
1801
+ class: {
1802
+ indicator: "data-[state=indeterminate]:animate-[carousel-vertical_2s_ease-in-out_infinite]"
1803
+ }
1804
+ }, {
1805
+ orientation: "horizontal",
1806
+ animation: "carousel-inverse",
1807
+ class: {
1808
+ indicator: "data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite]"
1809
+ }
1810
+ }, {
1811
+ orientation: "vertical",
1812
+ animation: "carousel-inverse",
1813
+ class: {
1814
+ indicator: "data-[state=indeterminate]:animate-[carousel-inverse-vertical_2s_ease-in-out_infinite]"
1815
+ }
1816
+ }, {
1817
+ orientation: "horizontal",
1818
+ animation: "swing",
1819
+ class: {
1820
+ indicator: "data-[state=indeterminate]:animate-[swing_2s_ease-in-out_infinite]"
1821
+ }
1822
+ }, {
1823
+ orientation: "vertical",
1824
+ animation: "swing",
1825
+ class: {
1826
+ indicator: "data-[state=indeterminate]:animate-[swing-vertical_2s_ease-in-out_infinite]"
1827
+ }
1828
+ }, {
1829
+ orientation: "horizontal",
1830
+ animation: "elastic",
1831
+ class: {
1832
+ indicator: "data-[state=indeterminate]:animate-[elastic_2s_ease-in-out_infinite]"
1833
+ }
1834
+ }, {
1835
+ orientation: "vertical",
1836
+ animation: "elastic",
1837
+ class: {
1838
+ indicator: "data-[state=indeterminate]:animate-[elastic-vertical_2s_ease-in-out_infinite]"
1839
+ }
1840
+ }],
1841
+ defaultVariants: {
1842
+ animation: "carousel",
1843
+ color: "primary",
1844
+ size: "md"
1845
+ }
1846
+ });
1847
+
1848
+ const radioGroup = (options) => ({
1849
+ slots: {
1850
+ root: "relative",
1851
+ fieldset: "flex",
1852
+ legend: "mb-1 block font-medium text-[var(--ui-text)]",
1853
+ item: "flex items-start",
1854
+ base: "rounded-full ring ring-inset ring-[var(--ui-border-accented)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-offset-[var(--ui-bg)]",
1855
+ indicator: "flex items-center justify-center size-full rounded-full after:bg-[var(--ui-bg)] after:rounded-full",
1856
+ container: "flex items-center",
1857
+ wrapper: "ms-2",
1858
+ label: "block font-medium text-[var(--ui-text)]",
1859
+ description: "text-[var(--ui-text-muted)]"
1860
+ },
1861
+ variants: {
1862
+ color: {
1863
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1864
+ base: `focus-visible:outline-[var(--ui-${color})]`,
1865
+ indicator: `bg-[var(--ui-${color})]`
1866
+ }])),
1867
+ neutral: {
1868
+ base: "focus-visible:outline-[var(--ui-border-inverted)]",
1869
+ indicator: "bg-[var(--ui-bg-inverted)]"
1870
+ }
1871
+ },
1872
+ orientation: {
1873
+ horizontal: {
1874
+ fieldset: "flex-row",
1875
+ wrapper: "me-2"
1876
+ },
1877
+ vertical: {
1878
+ fieldset: "flex-col"
1879
+ }
1880
+ },
1881
+ size: {
1882
+ xs: {
1883
+ fieldset: "gap-0.5",
1884
+ legend: "text-xs",
1885
+ base: "size-3",
1886
+ item: "text-xs",
1887
+ container: "h-4",
1888
+ indicator: "after:size-1"
1889
+ },
1890
+ sm: {
1891
+ fieldset: "gap-0.5",
1892
+ legend: "text-xs",
1893
+ base: "size-3.5",
1894
+ item: "text-xs",
1895
+ container: "h-4",
1896
+ indicator: "after:size-1"
1897
+ },
1898
+ md: {
1899
+ fieldset: "gap-1",
1900
+ legend: "text-sm",
1901
+ base: "size-4",
1902
+ item: "text-sm",
1903
+ container: "h-5",
1904
+ indicator: "after:size-1.5"
1905
+ },
1906
+ lg: {
1907
+ fieldset: "gap-1",
1908
+ legend: "text-sm",
1909
+ base: "size-4.5",
1910
+ item: "text-sm",
1911
+ container: "h-5",
1912
+ indicator: "after:size-1.5"
1913
+ },
1914
+ xl: {
1915
+ fieldset: "gap-1.5",
1916
+ legend: "text-base",
1917
+ base: "size-5",
1918
+ item: "text-base",
1919
+ container: "h-6",
1920
+ indicator: "after:size-2"
1921
+ }
1922
+ },
1923
+ disabled: {
1924
+ true: {
1925
+ base: "cursor-not-allowed opacity-75",
1926
+ label: "cursor-not-allowed opacity-75"
1927
+ }
1928
+ },
1929
+ required: {
1930
+ true: {
1931
+ legend: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
1932
+ }
1933
+ }
1934
+ },
1935
+ defaultVariants: {
1936
+ size: "md",
1937
+ color: "primary"
1938
+ }
1939
+ });
1940
+
1941
+ const select = (options) => {
1942
+ return defu.defuFn({
1943
+ slots: {
1944
+ root: () => void 0,
1945
+ base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
1946
+ value: "truncate group-data-placeholder:text-[var(--ui-text-dimmed)]",
1947
+ arrow: "fill-[var(--ui-border)]",
1948
+ content: "max-h-60 w-[var(--radix-popper-anchor-width)] bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1949
+ viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
1950
+ group: "p-1 isolate",
1951
+ empty: "py-2 text-center text-sm text-[var(--ui-text-muted)]",
1952
+ label: "font-semibold text-[var(--ui-text-highlighted)]",
1953
+ separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
1954
+ item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
1955
+ itemLeadingIcon: ["shrink-0 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
1956
+ itemLeadingAvatar: "shrink-0",
1957
+ itemLeadingAvatarSize: "",
1958
+ itemLeadingChip: "shrink-0",
1959
+ itemLeadingChipSize: "",
1960
+ itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
1961
+ itemTrailingIcon: "shrink-0",
1962
+ itemLabel: "truncate"
1963
+ },
1964
+ variants: {
1965
+ ...buttonGroupVariant,
1966
+ size: {
1967
+ xs: {
1968
+ label: "p-1 text-[10px]/3 gap-1",
1969
+ item: "p-1 text-xs gap-1",
1970
+ itemLeadingIcon: "size-4",
1971
+ itemLeadingAvatarSize: "3xs",
1972
+ itemLeadingChip: "size-4",
1973
+ itemLeadingChipSize: "sm",
1974
+ itemTrailingIcon: "size-4"
1975
+ },
1976
+ sm: {
1977
+ label: "p-1.5 text-[10px]/3 gap-1.5",
1978
+ item: "p-1.5 text-xs gap-1.5",
1979
+ itemLeadingIcon: "size-4",
1980
+ itemLeadingAvatarSize: "3xs",
1981
+ itemLeadingChip: "size-4",
1982
+ itemLeadingChipSize: "sm",
1983
+ itemTrailingIcon: "size-4"
1984
+ },
1985
+ md: {
1986
+ label: "p-1.5 text-xs gap-1.5",
1987
+ item: "p-1.5 text-sm gap-1.5",
1988
+ itemLeadingIcon: "size-5",
1989
+ itemLeadingAvatarSize: "2xs",
1990
+ itemLeadingChip: "size-5",
1991
+ itemLeadingChipSize: "md",
1992
+ itemTrailingIcon: "size-5"
1993
+ },
1994
+ lg: {
1995
+ label: "p-2 text-xs gap-2",
1996
+ item: "p-2 text-sm gap-2",
1997
+ itemLeadingIcon: "size-5",
1998
+ itemLeadingAvatarSize: "2xs",
1999
+ itemLeadingChip: "size-5",
2000
+ itemLeadingChipSize: "md",
2001
+ itemTrailingIcon: "size-5"
2002
+ },
2003
+ xl: {
2004
+ label: "p-2 text-sm gap-2",
2005
+ item: "p-2 text-base gap-2",
2006
+ itemLeadingIcon: "size-6",
2007
+ itemLeadingAvatarSize: "xs",
2008
+ itemLeadingChip: "size-6",
2009
+ itemLeadingChipSize: "lg",
2010
+ itemTrailingIcon: "size-6"
2011
+ }
2012
+ }
2013
+ }
2014
+ }, input(options));
2015
+ };
2016
+
2017
+ const selectMenu = (options) => {
2018
+ return defu.defu({
2019
+ slots: {
2020
+ value: "truncate",
2021
+ placeholder: "truncate text-[var(--ui-text-dimmed)]",
2022
+ input: "placeholder:text-[var(--ui-text-dimmed)] border-0 border-b border-[var(--ui-border)] focus:outline-none"
2023
+ },
2024
+ variants: {
2025
+ size: {
2026
+ xs: {
2027
+ input: "text-xs px-2 py-1"
2028
+ },
2029
+ sm: {
2030
+ input: "text-xs px-2.5 py-1.5"
2031
+ },
2032
+ md: {
2033
+ input: "text-sm px-2.5 py-1.5"
2034
+ },
2035
+ lg: {
2036
+ input: "text-sm px-3 py-2"
2037
+ },
2038
+ xl: {
2039
+ input: "text-base px-3 py-2"
2040
+ }
2041
+ }
2042
+ }
2043
+ }, select(options));
2044
+ };
2045
+
2046
+ const separator = (options) => ({
2047
+ slots: {
2048
+ root: "flex items-center align-center text-center",
2049
+ border: "",
2050
+ container: "font-medium text-[var(--ui-text)] flex",
2051
+ icon: "shrink-0 size-5",
2052
+ avatar: "shrink-0",
2053
+ avatarSize: "2xs",
2054
+ label: "text-sm"
2055
+ },
2056
+ variants: {
2057
+ color: {
2058
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-[var(--ui-${color})]` }])),
2059
+ neutral: { border: "border-[var(--ui-border)]" }
2060
+ },
2061
+ orientation: {
2062
+ horizontal: {
2063
+ root: "w-full flex-row",
2064
+ border: "w-full",
2065
+ container: "mx-3 whitespace-nowrap"
2066
+ },
2067
+ vertical: {
2068
+ root: "h-full flex-col",
2069
+ border: "h-full",
2070
+ container: "my-2"
2071
+ }
2072
+ },
2073
+ size: {
2074
+ xs: "",
2075
+ sm: "",
2076
+ md: "",
2077
+ lg: "",
2078
+ xl: ""
2079
+ },
2080
+ type: {
2081
+ solid: {
2082
+ border: "border-solid"
2083
+ },
2084
+ dashed: {
2085
+ border: "border-dashed"
2086
+ },
2087
+ dotted: {
2088
+ border: "border-dotted"
2089
+ }
2090
+ }
2091
+ },
2092
+ compoundVariants: [{
2093
+ orientation: "horizontal",
2094
+ size: "xs",
2095
+ class: { border: "border-t" }
2096
+ }, {
2097
+ orientation: "horizontal",
2098
+ size: "sm",
2099
+ class: { border: "border-t-[2px]" }
2100
+ }, {
2101
+ orientation: "horizontal",
2102
+ size: "md",
2103
+ class: { border: "border-t-[3px]" }
2104
+ }, {
2105
+ orientation: "horizontal",
2106
+ size: "lg",
2107
+ class: { border: "border-t-[4px]" }
2108
+ }, {
2109
+ orientation: "horizontal",
2110
+ size: "xl",
2111
+ class: { border: "border-t-[5px]" }
2112
+ }, {
2113
+ orientation: "vertical",
2114
+ size: "xs",
2115
+ class: { border: "border-s" }
2116
+ }, {
2117
+ orientation: "vertical",
2118
+ size: "sm",
2119
+ class: { border: "border-s-[2px]" }
2120
+ }, {
2121
+ orientation: "vertical",
2122
+ size: "md",
2123
+ class: { border: "border-s-[3px]" }
2124
+ }, {
2125
+ orientation: "vertical",
2126
+ size: "lg",
2127
+ class: { border: "border-s-[4px]" }
2128
+ }, {
2129
+ orientation: "vertical",
2130
+ size: "xl",
2131
+ class: { border: "border-s-[5px]" }
2132
+ }],
2133
+ defaultVariants: {
2134
+ color: "neutral",
2135
+ size: "xs",
2136
+ type: "solid"
2137
+ }
2138
+ });
2139
+
2140
+ const skeleton = {
2141
+ base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-[var(--ui-bg-elevated)]"
2142
+ };
2143
+
2144
+ const slideover = {
2145
+ slots: {
2146
+ overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
2147
+ content: "fixed bg-[var(--ui-bg)] divide-y divide-[var(--ui-border)] sm:ring ring-[var(--ui-border)] sm:shadow-lg flex flex-col focus:outline-none",
2148
+ header: "px-4 py-5 sm:px-6",
2149
+ body: "flex-1 overflow-y-auto p-4 sm:p-6",
2150
+ footer: "flex items-center gap-1.5 p-4 sm:px-6",
2151
+ title: "text-[var(--ui-text-highlighted)] font-semibold",
2152
+ description: "mt-1 text-[var(--ui-text-muted)] text-sm",
2153
+ close: "absolute top-4 end-4"
2154
+ },
2155
+ variants: {
2156
+ side: {
2157
+ top: {
2158
+ content: "inset-x-0 top-0 max-h-full"
2159
+ },
2160
+ right: {
2161
+ content: "right-0 inset-y-0 w-full max-w-md"
2162
+ },
2163
+ bottom: {
2164
+ content: "inset-x-0 bottom-0 max-h-full"
2165
+ },
2166
+ left: {
2167
+ content: "left-0 inset-y-0 w-full max-w-md"
2168
+ }
2169
+ },
2170
+ transition: {
2171
+ true: {
2172
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
2173
+ }
2174
+ }
2175
+ },
2176
+ compoundVariants: [{
2177
+ transition: true,
2178
+ side: "top",
2179
+ class: {
2180
+ content: "data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"
2181
+ }
2182
+ }, {
2183
+ transition: true,
2184
+ side: "right",
2185
+ class: {
2186
+ content: "data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"
2187
+ }
2188
+ }, {
2189
+ transition: true,
2190
+ side: "bottom",
2191
+ class: {
2192
+ content: "data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"
2193
+ }
2194
+ }, {
2195
+ transition: true,
2196
+ side: "left",
2197
+ class: {
2198
+ content: "data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"
2199
+ }
2200
+ }]
2201
+ };
2202
+
2203
+ const slider = (options) => ({
2204
+ slots: {
2205
+ root: "relative flex items-center select-none touch-none",
2206
+ track: "relative bg-[var(--ui-bg-accented)] overflow-hidden rounded-full grow",
2207
+ range: "absolute rounded-full",
2208
+ thumb: "rounded-full bg-[var(--ui-bg)] ring-2 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2"
2209
+ },
2210
+ variants: {
2211
+ color: {
2212
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2213
+ range: `bg-[var(--ui-${color})]`,
2214
+ thumb: `ring-[var(--ui-${color})] focus-visible:outline-[var(--ui-${color})]`
2215
+ }])),
2216
+ neutral: {
2217
+ range: "bg-[var(--ui-bg-inverted)]",
2218
+ thumb: "ring-[var(--ui-border-inverted)] focus-visible:outline-[var(--ui-border-inverted)]/50"
2219
+ }
2220
+ },
2221
+ size: {
2222
+ xs: {
2223
+ thumb: "size-3"
2224
+ },
2225
+ sm: {
2226
+ thumb: "size-3.5"
2227
+ },
2228
+ md: {
2229
+ thumb: "size-4"
2230
+ },
2231
+ lg: {
2232
+ thumb: "size-4.5"
2233
+ },
2234
+ xl: {
2235
+ thumb: "size-5"
2236
+ }
2237
+ },
2238
+ orientation: {
2239
+ horizontal: {
2240
+ root: "w-full",
2241
+ range: "h-full"
2242
+ },
2243
+ vertical: {
2244
+ root: "flex-col h-full",
2245
+ range: "w-full"
2246
+ }
2247
+ },
2248
+ disabled: {
2249
+ true: {
2250
+ root: "opacity-75 cursor-not-allowed"
2251
+ }
2252
+ }
2253
+ },
2254
+ compoundVariants: [{
2255
+ orientation: "horizontal",
2256
+ size: "xs",
2257
+ class: {
2258
+ track: "h-[6px]"
2259
+ }
2260
+ }, {
2261
+ orientation: "horizontal",
2262
+ size: "sm",
2263
+ class: {
2264
+ track: "h-[7px]"
2265
+ }
2266
+ }, {
2267
+ orientation: "horizontal",
2268
+ size: "md",
2269
+ class: {
2270
+ track: "h-[8px]"
2271
+ }
2272
+ }, {
2273
+ orientation: "horizontal",
2274
+ size: "lg",
2275
+ class: {
2276
+ track: "h-[9px]"
2277
+ }
2278
+ }, {
2279
+ orientation: "horizontal",
2280
+ size: "xl",
2281
+ class: {
2282
+ track: "h-[10px]"
2283
+ }
2284
+ }, {
2285
+ orientation: "vertical",
2286
+ size: "xs",
2287
+ class: {
2288
+ track: "w-[6px]"
2289
+ }
2290
+ }, {
2291
+ orientation: "vertical",
2292
+ size: "sm",
2293
+ class: {
2294
+ track: "w-[7px]"
2295
+ }
2296
+ }, {
2297
+ orientation: "vertical",
2298
+ size: "md",
2299
+ class: {
2300
+ track: "w-[8px]"
2301
+ }
2302
+ }, {
2303
+ orientation: "vertical",
2304
+ size: "lg",
2305
+ class: {
2306
+ track: "w-[9px]"
2307
+ }
2308
+ }, {
2309
+ orientation: "vertical",
2310
+ size: "xl",
2311
+ class: {
2312
+ track: "w-[10px]"
2313
+ }
2314
+ }],
2315
+ defaultVariants: {
2316
+ size: "md",
2317
+ color: "primary"
2318
+ }
2319
+ });
2320
+
2321
+ const _switch = (options) => ({
2322
+ slots: {
2323
+ root: "relative flex items-start",
2324
+ 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-[var(--ui-bg)] data-[state=unchecked]:bg-[var(--ui-bg-accented)]", options.theme.transitions && "transition-colors duration-200"],
2325
+ container: "flex items-center",
2326
+ thumb: "group pointer-events-none block rounded-full bg-[var(--ui-bg)] shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",
2327
+ icon: ["absolute shrink-0 group-data-[state=unchecked]:text-[var(--ui-text-dimmed)] opacity-0 size-10/12", options.theme.transitions && "transition-[color,opacity] duration-200"],
2328
+ wrapper: "ms-2",
2329
+ label: "block font-medium text-[var(--ui-text)]",
2330
+ description: "text-[var(--ui-text-muted)]"
2331
+ },
2332
+ variants: {
2333
+ color: {
2334
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2335
+ base: `data-[state=checked]:bg-[var(--ui-${color})] focus-visible:ring-[var(--ui-${color})]`,
2336
+ icon: `group-data-[state=checked]:text-[var(--ui-${color})]`
2337
+ }])),
2338
+ neutral: {
2339
+ base: "data-[state=checked]:bg-[var(--ui-bg-inverted)] focus-visible:ring-[var(--ui-border-inverted)]",
2340
+ icon: "group-data-[state=checked]:text-[var(--ui-text-highlighted)]"
2341
+ }
2342
+ },
2343
+ size: {
2344
+ xs: {
2345
+ base: "w-7",
2346
+ container: "h-4",
2347
+ thumb: "size-3 data-[state=checked]:translate-x-3 data-[state=checked]:rtl:-translate-x-3",
2348
+ wrapper: "text-xs"
2349
+ },
2350
+ sm: {
2351
+ base: "w-8",
2352
+ container: "h-4",
2353
+ thumb: "size-3.5 data-[state=checked]:translate-x-3.5 data-[state=checked]:rtl:-translate-x-3.5",
2354
+ wrapper: "text-xs"
2355
+ },
2356
+ md: {
2357
+ base: "w-9",
2358
+ container: "h-5",
2359
+ thumb: "size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4",
2360
+ wrapper: "text-sm"
2361
+ },
2362
+ lg: {
2363
+ base: "w-10",
2364
+ container: "h-5",
2365
+ thumb: "size-4.5 data-[state=checked]:translate-x-4.5 data-[state=checked]:rtl:-translate-x-4.5",
2366
+ wrapper: "text-sm"
2367
+ },
2368
+ xl: {
2369
+ base: "w-11",
2370
+ container: "h-6",
2371
+ thumb: "size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5",
2372
+ wrapper: "text-base"
2373
+ }
2374
+ },
2375
+ checked: {
2376
+ true: {
2377
+ icon: "group-data-[state=checked]:opacity-100"
2378
+ }
2379
+ },
2380
+ unchecked: {
2381
+ true: {
2382
+ icon: "group-data-[state=unchecked]:opacity-100"
2383
+ }
2384
+ },
2385
+ loading: {
2386
+ true: {
2387
+ icon: "animate-spin"
2388
+ }
2389
+ },
2390
+ required: {
2391
+ true: {
2392
+ label: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
2393
+ }
2394
+ },
2395
+ disabled: {
2396
+ true: {
2397
+ base: "cursor-not-allowed opacity-75",
2398
+ label: "cursor-not-allowed opacity-75",
2399
+ description: "cursor-not-allowed opacity-75"
2400
+ }
2401
+ }
2402
+ },
2403
+ defaultVariants: {
2404
+ color: "primary",
2405
+ size: "md"
2406
+ }
2407
+ });
2408
+
2409
+ const table = (options) => ({
2410
+ slots: {
2411
+ root: "relative overflow-auto",
2412
+ base: "min-w-full overflow-clip",
2413
+ thead: "relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-[var(--ui-border-accented)]",
2414
+ tbody: "divide-y divide-[var(--ui-border)]",
2415
+ tr: "data-[selected=true]:bg-[var(--ui-bg-elevated)]/50",
2416
+ th: "px-4 py-3.5 text-sm text-[var(--ui-text-highlighted)] text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
2417
+ td: "p-4 text-sm text-[var(--ui-text-muted)] whitespace-nowrap [&:has([role=checkbox])]:pe-0",
2418
+ empty: "py-6 text-center text-sm text-[var(--ui-text-muted)]"
2419
+ },
2420
+ variants: {
2421
+ pinned: {
2422
+ true: {
2423
+ th: "sticky bg-[var(--ui-bg)]/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0",
2424
+ td: "sticky bg-[var(--ui-bg)]/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0"
2425
+ }
2426
+ },
2427
+ sticky: {
2428
+ true: {
2429
+ thead: "sticky top-0 inset-x-0 bg-[var(--ui-bg)]/75 z-[1] backdrop-blur"
2430
+ }
2431
+ },
2432
+ loading: {
2433
+ true: {
2434
+ thead: "after:absolute after:bottom-0 after:inset-x-0 after:h-px"
2435
+ }
2436
+ },
2437
+ loadingAnimation: {
2438
+ "carousel": "",
2439
+ "carousel-inverse": "",
2440
+ "swing": "",
2441
+ "elastic": ""
2442
+ },
2443
+ loadingColor: {
2444
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2445
+ neutral: ""
2446
+ }
2447
+ },
2448
+ compoundVariants: [...(options.theme.colors || []).map((loadingColor) => ({
2449
+ loading: true,
2450
+ loadingColor,
2451
+ class: {
2452
+ thead: `after:bg-[var(--ui-${loadingColor})]`
2453
+ }
2454
+ })), {
2455
+ loading: true,
2456
+ loadingColor: "neutral",
2457
+ class: {
2458
+ thead: "after:bg-[var(--ui-bg-inverted)]"
2459
+ }
2460
+ }, {
2461
+ loading: true,
2462
+ loadingAnimation: "carousel",
2463
+ class: {
2464
+ thead: "after:animate-[carousel_2s_ease-in-out_infinite]"
2465
+ }
2466
+ }, {
2467
+ loading: true,
2468
+ loadingAnimation: "carousel-inverse",
2469
+ class: {
2470
+ thead: "after:animate-[carousel-inverse_2s_ease-in-out_infinite]"
2471
+ }
2472
+ }, {
2473
+ loading: true,
2474
+ loadingAnimation: "swing",
2475
+ class: {
2476
+ thead: "after:animate-[swing_2s_ease-in-out_infinite]"
2477
+ }
2478
+ }, {
2479
+ loading: true,
2480
+ loadingAnimation: "elastic",
2481
+ class: {
2482
+ thead: "after:animate-[elastic_2s_ease-in-out_infinite]"
2483
+ }
2484
+ }],
2485
+ defaultVariants: {
2486
+ loadingColor: "primary",
2487
+ loadingAnimation: "carousel"
2488
+ }
2489
+ });
2490
+
2491
+ const tabs = (options) => ({
2492
+ slots: {
2493
+ root: "flex items-center gap-2",
2494
+ list: "relative flex p-1 group",
2495
+ indicator: "absolute transition-[translate,width] duration-200",
2496
+ trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-[var(--ui-text-muted)] hover:data-[state=inactive]:text-[var(--ui-text)] font-medium rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", options.theme.transitions && "transition-colors"],
2497
+ content: "focus:outline-none w-full",
2498
+ leadingIcon: "shrink-0",
2499
+ leadingAvatar: "shrink-0",
2500
+ leadingAvatarSize: "",
2501
+ label: "truncate"
2502
+ },
2503
+ variants: {
2504
+ color: {
2505
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2506
+ neutral: ""
2507
+ },
2508
+ variant: {
2509
+ pill: {
2510
+ list: "bg-[var(--ui-bg-elevated)] rounded-[calc(var(--ui-radius)*2)]",
2511
+ trigger: "flex-1 w-full",
2512
+ indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-sm"
2513
+ },
2514
+ link: {
2515
+ list: "border-[var(--ui-border)]",
2516
+ indicator: "rounded-full"
2517
+ }
2518
+ },
2519
+ orientation: {
2520
+ horizontal: {
2521
+ root: "flex-col",
2522
+ list: "w-full",
2523
+ indicator: "left-0 w-[var(--radix-tabs-indicator-size)] translate-x-[var(--radix-tabs-indicator-position)]",
2524
+ trigger: "justify-center"
2525
+ },
2526
+ vertical: {
2527
+ list: "flex-col",
2528
+ indicator: "top-0 h-[var(--radix-tabs-indicator-size)] translate-y-[var(--radix-tabs-indicator-position)]"
2529
+ }
2530
+ },
2531
+ size: {
2532
+ xs: {
2533
+ trigger: "px-2 py-1 text-xs gap-1",
2534
+ leadingIcon: "size-4",
2535
+ leadingAvatarSize: "3xs"
2536
+ },
2537
+ sm: {
2538
+ trigger: "px-2.5 py-1.5 text-xs gap-1.5",
2539
+ leadingIcon: "size-4",
2540
+ leadingAvatarSize: "3xs"
2541
+ },
2542
+ md: {
2543
+ trigger: "px-3 py-1.5 text-sm gap-1.5",
2544
+ leadingIcon: "size-5",
2545
+ leadingAvatarSize: "2xs"
2546
+ },
2547
+ lg: {
2548
+ trigger: "px-3 py-2 text-sm gap-2",
2549
+ leadingIcon: "size-5",
2550
+ leadingAvatarSize: "2xs"
2551
+ },
2552
+ xl: {
2553
+ trigger: "px-3 py-2 text-base gap-2",
2554
+ leadingIcon: "size-6",
2555
+ leadingAvatarSize: "xs"
2556
+ }
2557
+ }
2558
+ },
2559
+ compoundVariants: [{
2560
+ orientation: "horizontal",
2561
+ variant: "pill",
2562
+ class: {
2563
+ indicator: "inset-y-1"
2564
+ }
2565
+ }, {
2566
+ orientation: "horizontal",
2567
+ variant: "link",
2568
+ class: {
2569
+ list: "border-b -mb-px",
2570
+ indicator: "-bottom-px h-px"
2571
+ }
2572
+ }, {
2573
+ orientation: "vertical",
2574
+ variant: "pill",
2575
+ class: {
2576
+ indicator: "inset-x-1",
2577
+ list: "items-center"
2578
+ }
2579
+ }, {
2580
+ orientation: "vertical",
2581
+ variant: "link",
2582
+ class: {
2583
+ list: "border-s -ms-px",
2584
+ indicator: "-start-px w-px"
2585
+ }
2586
+ }, ...(options.theme.colors || []).map((color) => ({
2587
+ color,
2588
+ variant: "pill",
2589
+ class: {
2590
+ indicator: `bg-[var(--ui-${color})]`,
2591
+ trigger: `data-[state=active]:text-[var(--ui-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-${color})]`
2592
+ }
2593
+ })), {
2594
+ color: "neutral",
2595
+ variant: "pill",
2596
+ class: {
2597
+ indicator: "bg-[var(--ui-bg-inverted)]",
2598
+ trigger: "data-[state=active]:text-[var(--ui-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-border-inverted)]"
2599
+ }
2600
+ }, ...(options.theme.colors || []).map((color) => ({
2601
+ color,
2602
+ variant: "link",
2603
+ class: {
2604
+ indicator: `bg-[var(--ui-${color})]`,
2605
+ trigger: `data-[state=active]:text-[var(--ui-${color})] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
2606
+ }
2607
+ })), {
2608
+ color: "neutral",
2609
+ variant: "link",
2610
+ class: {
2611
+ indicator: "bg-[var(--ui-bg-inverted)]",
2612
+ trigger: "data-[state=active]:text-[var(--ui-text-highlighted)] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]"
2613
+ }
2614
+ }],
2615
+ defaultVariants: {
2616
+ color: "primary",
2617
+ variant: "pill",
2618
+ size: "md"
2619
+ }
2620
+ });
2621
+
2622
+ const textarea = (options) => {
2623
+ return input(options);
2624
+ };
2625
+
2626
+ const toast = (options) => ({
2627
+ slots: {
2628
+ root: "relative group overflow-hidden bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*2)] ring ring-[var(--ui-border)] p-4 flex gap-2.5 focus:outline-none",
2629
+ wrapper: "w-0 flex-1 flex flex-col gap-1",
2630
+ title: "text-sm font-medium text-[var(--ui-text-highlighted)]",
2631
+ description: "text-sm text-[var(--ui-text-muted)]",
2632
+ icon: "shrink-0 size-5",
2633
+ avatar: "shrink-0",
2634
+ avatarSize: "2xl",
2635
+ actions: "flex gap-1.5 shrink-0",
2636
+ progress: "absolute inset-x-0 bottom-0 h-1 z-[-1]",
2637
+ close: "p-0.5"
2638
+ },
2639
+ variants: {
2640
+ color: {
2641
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2642
+ root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`,
2643
+ icon: `text-[var(--ui-${color})]`,
2644
+ progress: `bg-[var(--ui-${color})]`
2645
+ }])),
2646
+ neutral: {
2647
+ root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]",
2648
+ icon: "text-[var(--ui-text-highlighted)]",
2649
+ progress: "bg-[var(--ui-bg-inverted)]"
2650
+ }
2651
+ },
2652
+ multiline: {
2653
+ true: {
2654
+ root: "items-start",
2655
+ actions: "items-start mt-1"
2656
+ },
2657
+ false: {
2658
+ root: "items-center",
2659
+ actions: "items-center"
2660
+ }
2661
+ }
2662
+ },
2663
+ defaultVariants: {
2664
+ color: "primary"
2665
+ }
2666
+ });
2667
+
2668
+ const toaster = {
2669
+ slots: {
2670
+ viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[var(--height)] focus:outline-none",
2671
+ base: "absolute inset-x-0 z-[var(--index)] transform-[var(--transform)] data-[expanded=false]:data-[front=false]:h-[var(--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"
2672
+ },
2673
+ variants: {
2674
+ position: {
2675
+ "top-left": {
2676
+ viewport: "left-4"
2677
+ },
2678
+ "top-center": {
2679
+ viewport: "left-1/2 transform -translate-x-1/2"
2680
+ },
2681
+ "top-right": {
2682
+ viewport: "right-4"
2683
+ },
2684
+ "bottom-left": {
2685
+ viewport: "left-4"
2686
+ },
2687
+ "bottom-center": {
2688
+ viewport: "left-1/2 transform -translate-x-1/2"
2689
+ },
2690
+ "bottom-right": {
2691
+ viewport: "right-4"
2692
+ }
2693
+ },
2694
+ swipeDirection: {
2695
+ up: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]",
2696
+ right: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]",
2697
+ down: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]",
2698
+ left: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
2699
+ }
2700
+ },
2701
+ compoundVariants: [{
2702
+ position: ["top-left", "top-center", "top-right"],
2703
+ class: {
2704
+ viewport: "top-4",
2705
+ base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
2706
+ }
2707
+ }, {
2708
+ position: ["bottom-left", "bottom-center", "bottom-right"],
2709
+ class: {
2710
+ viewport: "bottom-4",
2711
+ base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
2712
+ }
2713
+ }, {
2714
+ swipeDirection: ["left", "right"],
2715
+ class: "data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=cancel]:translate-x-0"
2716
+ }, {
2717
+ swipeDirection: ["up", "down"],
2718
+ class: "data-[swipe=move]:translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=end]:translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=cancel]:translate-y-0"
2719
+ }],
2720
+ defaultVariants: {
2721
+ position: "bottom-right"
2722
+ }
2723
+ };
2724
+
2725
+ const tooltip = {
2726
+ slots: {
2727
+ content: "flex items-center gap-1 bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] shadow rounded-[var(--ui-radius)] ring ring-[var(--ui-border)] h-6 px-2 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]",
2728
+ arrow: "fill-[var(--ui-border)]",
2729
+ text: "truncate",
2730
+ kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:me-0.5`,
2731
+ kbdsSize: "sm"
2732
+ }
2733
+ };
2734
+
2735
+ const theme = {
2736
+ __proto__: null,
2737
+ accordion: accordion,
2738
+ alert: alert,
2739
+ avatar: avatar,
2740
+ avatarGroup: avatarGroup,
2741
+ badge: badge,
2742
+ breadcrumb: breadcrumb,
2743
+ button: button,
2744
+ buttonGroup: buttonGroup,
2745
+ card: card,
2746
+ carousel: carousel,
2747
+ checkbox: checkbox,
2748
+ chip: chip,
2749
+ collapsible: collapsible,
2750
+ commandPalette: commandPalette,
2751
+ container: container,
2752
+ contextMenu: contextMenu,
2753
+ drawer: drawer,
2754
+ dropdownMenu: dropdownMenu,
2755
+ form: form,
2756
+ formField: formField,
2757
+ input: input,
2758
+ inputMenu: inputMenu,
2759
+ kbd: kbd,
2760
+ link: link,
2761
+ modal: modal,
2762
+ navigationMenu: navigationMenu,
2763
+ pagination: pagination,
2764
+ popover: popover,
2765
+ progress: progress,
2766
+ radioGroup: radioGroup,
2767
+ select: select,
2768
+ selectMenu: selectMenu,
2769
+ separator: separator,
2770
+ skeleton: skeleton,
2771
+ slideover: slideover,
2772
+ slider: slider,
2773
+ switch: _switch,
2774
+ table: table,
2775
+ tabs: tabs,
2776
+ textarea: textarea,
2777
+ toast: toast,
2778
+ toaster: toaster,
2779
+ tooltip: tooltip
2780
+ };
2781
+
2782
+ function buildTemplates(options) {
2783
+ return Object.entries(theme).reduce((acc, [key, component]) => {
2784
+ acc[key] = typeof component === "function" ? component(options) : component;
2785
+ return acc;
2786
+ }, {});
2787
+ }
2788
+ function getTemplates(options, uiConfig) {
2789
+ const templates = [];
2790
+ for (const component in theme) {
2791
+ templates.push({
2792
+ filename: `ui/${scule.kebabCase(component)}.ts`,
2793
+ write: true,
2794
+ getContents: async () => {
2795
+ const template = theme[component];
2796
+ const result = typeof template === "function" ? template(options) : template;
2797
+ const variants = Object.keys(result.variants || {});
2798
+ let json = JSON.stringify(result, null, 2);
2799
+ for (const variant of variants) {
2800
+ json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"), "$1 as const");
2801
+ json = json.replace(new RegExp(`("${variant}": \\[\\s*)((?:"[^"]+",?\\s*)+)(\\])`, "g"), (_, before, match, after) => {
2802
+ const replaced = match.replace(/("[^"]+")/g, "$1 as const");
2803
+ return `${before}${replaced}${after}`;
2804
+ });
2805
+ }
2806
+ return `export default ${json}`;
2807
+ }
2808
+ });
2809
+ }
2810
+ templates.push({
2811
+ filename: "ui/index.ts",
2812
+ write: true,
2813
+ getContents: () => Object.keys(theme).map((component) => `export { default as ${component} } from './${scule.kebabCase(component)}'`).join("\n")
2814
+ });
2815
+ templates.push({
2816
+ filename: "types/ui.d.ts",
2817
+ getContents: () => `import * as ui from '#build/ui'
2818
+ import type { DeepPartial } from '#ui/types/utils'
2819
+ import colors from 'tailwindcss/colors'
2820
+
2821
+ const icons = ${JSON.stringify(uiConfig.icons)};
2822
+
2823
+ type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
2824
+ type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor>
2825
+
2826
+ type AppConfigUI = {
2827
+ colors?: {
2828
+ ${options.theme?.colors?.map((color) => `${color}?: Color`).join("\n ")}
2829
+ neutral?: NeutralColor
2830
+ }
2831
+ icons?: Partial<typeof icons>
2832
+ } & DeepPartial<typeof ui>
2833
+
2834
+ declare module '@nuxt/schema' {
2835
+ interface AppConfigInput {
2836
+ ui?: AppConfigUI
2837
+ }
2838
+ }
2839
+
2840
+ export {}
2841
+ `
2842
+ });
2843
+ templates.push({
2844
+ filename: "ui-image-component.ts",
2845
+ write: true,
2846
+ getContents: ({ app }) => {
2847
+ const image = app?.components?.find((c) => c.pascalName === "NuxtImg" && !c.filePath.includes("nuxt/dist/app"));
2848
+ return image ? `export { default } from "${image.filePath}"` : 'export default "img"';
2849
+ }
2850
+ });
2851
+ return templates;
2852
+ }
2853
+ function addTemplates(options, nuxt, resolve) {
2854
+ const templates = getTemplates(options, nuxt.options.appConfig.ui);
2855
+ for (const template of templates) {
2856
+ if (template.filename.endsWith(".d.ts")) {
2857
+ kit.addTypeTemplate(template);
2858
+ } else {
2859
+ kit.addTemplate(template);
2860
+ }
2861
+ }
2862
+ nuxt.hook("prepare:types", ({ references }) => {
2863
+ references.push({ path: resolve("./runtime/types/app.config.d.ts") });
2864
+ });
2865
+ }
2866
+
2867
+ exports.addTemplates = addTemplates;
2868
+ exports.buildTemplates = buildTemplates;
2869
+ exports.defaultOptions = defaultOptions;
2870
+ exports.getDefaultUiConfig = getDefaultUiConfig;
2871
+ exports.getTemplates = getTemplates;
2872
+ exports.resolveColors = resolveColors;