@byyuurin/ui 0.0.11 → 0.2.0

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 (297) hide show
  1. package/README.md +170 -58
  2. package/dist/module.d.mts +4 -13
  3. package/dist/module.json +4 -4
  4. package/dist/module.mjs +54 -20
  5. package/dist/runtime/components/Accordion.vue +28 -23
  6. package/dist/runtime/components/Accordion.vue.d.ts +51 -29
  7. package/dist/runtime/components/Alert.vue +47 -27
  8. package/dist/runtime/components/Alert.vue.d.ts +37 -25
  9. package/dist/runtime/components/App.vue +9 -8
  10. package/dist/runtime/components/App.vue.d.ts +22 -20
  11. package/dist/runtime/components/Avatar.vue +65 -21
  12. package/dist/runtime/components/Avatar.vue.d.ts +27 -13
  13. package/dist/runtime/components/AvatarGroup.vue +14 -10
  14. package/dist/runtime/components/AvatarGroup.vue.d.ts +12 -9
  15. package/dist/runtime/components/Badge.vue +64 -32
  16. package/dist/runtime/components/Badge.vue.d.ts +30 -29
  17. package/dist/runtime/components/Breadcrumb.vue +40 -22
  18. package/dist/runtime/components/Breadcrumb.vue.d.ts +48 -21
  19. package/dist/runtime/components/Button.vue +113 -52
  20. package/dist/runtime/components/Button.vue.d.ts +36 -20
  21. package/dist/runtime/components/Calendar.vue +50 -43
  22. package/dist/runtime/components/Calendar.vue.d.ts +58 -31
  23. package/dist/runtime/components/Card.vue +18 -14
  24. package/dist/runtime/components/Card.vue.d.ts +18 -14
  25. package/dist/runtime/components/Carousel.vue +99 -46
  26. package/dist/runtime/components/Carousel.vue.d.ts +46 -25
  27. package/dist/runtime/components/Checkbox.vue +60 -35
  28. package/dist/runtime/components/Checkbox.vue.d.ts +35 -28
  29. package/dist/runtime/components/CheckboxGroup.vue +131 -0
  30. package/dist/runtime/components/CheckboxGroup.vue.d.ts +89 -0
  31. package/dist/runtime/components/Chip.vue +35 -32
  32. package/dist/runtime/components/Chip.vue.d.ts +33 -15
  33. package/dist/runtime/components/Collapsible.vue +13 -9
  34. package/dist/runtime/components/Collapsible.vue.d.ts +16 -8
  35. package/dist/runtime/components/Drawer.vue +80 -70
  36. package/dist/runtime/components/Drawer.vue.d.ts +51 -28
  37. package/dist/runtime/components/DropdownMenu.vue +23 -16
  38. package/dist/runtime/components/DropdownMenu.vue.d.ts +77 -36
  39. package/dist/runtime/components/DropdownMenuContent.vue +136 -106
  40. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +38 -26
  41. package/dist/runtime/components/FieldGroup.vue +33 -0
  42. package/dist/runtime/components/FieldGroup.vue.d.ts +33 -0
  43. package/dist/runtime/components/Form.vue +172 -88
  44. package/dist/runtime/components/Form.vue.d.ts +69 -44
  45. package/dist/runtime/components/FormField.vue +108 -0
  46. package/dist/runtime/components/FormField.vue.d.ts +63 -0
  47. package/dist/runtime/components/Icon.vue +20 -0
  48. package/dist/runtime/components/Icon.vue.d.ts +9 -0
  49. package/dist/runtime/components/Input.vue +84 -79
  50. package/dist/runtime/components/Input.vue.d.ts +55 -43
  51. package/dist/runtime/components/InputNumber.vue +66 -52
  52. package/dist/runtime/components/InputNumber.vue.d.ts +50 -109
  53. package/dist/runtime/components/InputTags.vue +155 -0
  54. package/dist/runtime/components/InputTags.vue.d.ts +85 -0
  55. package/dist/runtime/components/Kbd.vue +11 -5
  56. package/dist/runtime/components/Kbd.vue.d.ts +17 -11
  57. package/dist/runtime/components/Link.vue +54 -197
  58. package/dist/runtime/components/Link.vue.d.ts +17 -17
  59. package/dist/runtime/components/LinkBase.vue +11 -33
  60. package/dist/runtime/components/LinkBase.vue.d.ts +8 -3
  61. package/dist/runtime/components/Marquee.vue +38 -0
  62. package/dist/runtime/components/Marquee.vue.d.ts +54 -0
  63. package/dist/runtime/components/Modal.vue +53 -39
  64. package/dist/runtime/components/Modal.vue.d.ts +64 -34
  65. package/dist/runtime/components/NavigationMenu.vue +345 -0
  66. package/dist/runtime/components/NavigationMenu.vue.d.ts +216 -0
  67. package/dist/runtime/components/OverlayProvider.vue +3 -3
  68. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -1
  69. package/dist/runtime/components/Pagination.vue +39 -47
  70. package/dist/runtime/components/Pagination.vue.d.ts +54 -31
  71. package/dist/runtime/components/PinInput.vue +46 -32
  72. package/dist/runtime/components/PinInput.vue.d.ts +40 -21
  73. package/dist/runtime/components/Popover.vue +33 -19
  74. package/dist/runtime/components/Popover.vue.d.ts +57 -32
  75. package/dist/runtime/components/Progress.vue +31 -26
  76. package/dist/runtime/components/Progress.vue.d.ts +32 -23
  77. package/dist/runtime/components/RadioGroup.vue +75 -48
  78. package/dist/runtime/components/RadioGroup.vue.d.ts +58 -36
  79. package/dist/runtime/components/ScrollArea.vue +33 -31
  80. package/dist/runtime/components/ScrollArea.vue.d.ts +9 -5
  81. package/dist/runtime/components/Select.vue +166 -76
  82. package/dist/runtime/components/Select.vue.d.ts +206 -65
  83. package/dist/runtime/components/Separator.vue +42 -16
  84. package/dist/runtime/components/Separator.vue.d.ts +35 -14
  85. package/dist/runtime/components/Skeleton.vue +18 -6
  86. package/dist/runtime/components/Skeleton.vue.d.ts +4 -4
  87. package/dist/runtime/components/Slider.vue +42 -24
  88. package/dist/runtime/components/Slider.vue.d.ts +43 -27
  89. package/dist/runtime/components/Switch.vue +40 -31
  90. package/dist/runtime/components/Switch.vue.d.ts +36 -27
  91. package/dist/runtime/components/Table.vue +329 -79
  92. package/dist/runtime/components/Table.vue.d.ts +152 -66
  93. package/dist/runtime/components/Tabs.vue +70 -23
  94. package/dist/runtime/components/Tabs.vue.d.ts +61 -29
  95. package/dist/runtime/components/Textarea.vue +102 -54
  96. package/dist/runtime/components/Textarea.vue.d.ts +57 -41
  97. package/dist/runtime/components/Timeline.vue +102 -0
  98. package/dist/runtime/components/Timeline.vue.d.ts +74 -0
  99. package/dist/runtime/components/Toast.vue +84 -38
  100. package/dist/runtime/components/Toast.vue.d.ts +48 -27
  101. package/dist/runtime/components/ToastProvider.vue +31 -22
  102. package/dist/runtime/components/ToastProvider.vue.d.ts +30 -17
  103. package/dist/runtime/components/Tooltip.vue +33 -21
  104. package/dist/runtime/components/Tooltip.vue.d.ts +37 -15
  105. package/dist/runtime/composables/defineShortcuts.d.ts +16 -0
  106. package/dist/runtime/composables/defineShortcuts.js +129 -0
  107. package/dist/runtime/composables/useAvatarGroup.d.ts +8 -3
  108. package/dist/runtime/composables/useAvatarGroup.js +10 -3
  109. package/dist/runtime/composables/useComponentIcons.d.ts +9 -6
  110. package/dist/runtime/composables/useComponentIcons.js +4 -4
  111. package/dist/runtime/composables/useFieldGroup.d.ts +8 -0
  112. package/dist/runtime/composables/useFieldGroup.js +14 -0
  113. package/dist/runtime/composables/useFormField.d.ts +62 -0
  114. package/dist/runtime/composables/useFormField.js +99 -0
  115. package/dist/runtime/composables/useKbd.d.ts +3 -2
  116. package/dist/runtime/composables/useKbd.js +3 -2
  117. package/dist/runtime/composables/useLocale.d.ts +68 -5
  118. package/dist/runtime/composables/useLocale.js +11 -11
  119. package/dist/runtime/composables/useOverlay.d.ts +51 -15
  120. package/dist/runtime/composables/useOverlay.js +44 -30
  121. package/dist/runtime/composables/usePortal.d.ts +6 -0
  122. package/dist/runtime/composables/usePortal.js +17 -0
  123. package/dist/runtime/composables/useToast.d.ts +12 -5
  124. package/dist/runtime/composables/useToast.js +12 -7
  125. package/dist/runtime/locale/en.d.ts +30 -1
  126. package/dist/runtime/locale/en.js +2 -1
  127. package/dist/runtime/locale/index.d.ts +2 -2
  128. package/dist/runtime/locale/index.js +1 -1
  129. package/dist/runtime/locale/zh_tw.d.ts +31 -0
  130. package/dist/runtime/locale/{zh-tw.js → zh_tw.js} +2 -1
  131. package/dist/runtime/plugins/colors.d.ts +2 -0
  132. package/dist/runtime/plugins/colors.js +50 -0
  133. package/dist/runtime/types/app.config.d.ts +6 -0
  134. package/dist/runtime/types/form.d.ts +58 -17
  135. package/dist/runtime/types/form.js +11 -0
  136. package/dist/runtime/types/index.d.ts +56 -8
  137. package/dist/runtime/types/index.js +49 -1
  138. package/dist/runtime/types/input.d.ts +8 -0
  139. package/dist/runtime/types/locale.d.ts +5 -0
  140. package/dist/runtime/types/style.d.ts +33 -0
  141. package/dist/runtime/types/style.js +0 -0
  142. package/dist/runtime/types/unocss.d.ts +4 -0
  143. package/dist/runtime/types/utils.d.ts +41 -37
  144. package/dist/runtime/utils/form.d.ts +5 -1
  145. package/dist/runtime/utils/form.js +49 -0
  146. package/dist/runtime/utils/index.d.ts +10 -13
  147. package/dist/runtime/utils/index.js +41 -48
  148. package/dist/runtime/utils/link.d.ts +3 -2
  149. package/dist/runtime/utils/link.js +16 -2
  150. package/dist/runtime/utils/locale.d.ts +5 -0
  151. package/dist/runtime/utils/locale.js +10 -0
  152. package/dist/runtime/utils/style.d.ts +94 -0
  153. package/dist/runtime/utils/style.js +37 -0
  154. package/dist/runtime/vue/components/Icon.vue +15 -0
  155. package/dist/runtime/vue/components/Icon.vue.d.ts +7 -0
  156. package/dist/runtime/vue/components/Link.vue +163 -0
  157. package/dist/runtime/vue/components/Link.vue.d.ts +95 -0
  158. package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
  159. package/dist/runtime/vue/composables/useAppConfig.js +4 -0
  160. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  161. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  162. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  163. package/dist/runtime/vue/plugins/head.js +9 -0
  164. package/dist/runtime/vue/stubs.d.ts +16 -1
  165. package/dist/runtime/vue/stubs.js +32 -1
  166. package/dist/setup.d.mts +13 -0
  167. package/dist/setup.mjs +12 -0
  168. package/dist/shared/ui.CzIlLITK.mjs +51 -0
  169. package/dist/shared/ui.DLOxhmP0.mjs +4242 -0
  170. package/dist/shared/ui.DpbffTXs.d.mts +84 -0
  171. package/dist/shared/ui.IulR-OYx.d.mts +64 -0
  172. package/dist/types.d.mts +3 -1
  173. package/dist/unocss.d.mts +12 -52
  174. package/dist/unocss.mjs +144 -254
  175. package/dist/unplugin.d.mts +13 -26
  176. package/dist/unplugin.mjs +193 -18
  177. package/dist/vite.d.mts +10 -1
  178. package/dist/vite.mjs +12 -3
  179. package/package.json +154 -87
  180. package/vue-plugin.d.ts +5 -0
  181. package/dist/module.d.ts +0 -13
  182. package/dist/module.mjs.map +0 -1
  183. package/dist/runtime/app/injections.d.ts +0 -9331
  184. package/dist/runtime/app/injections.js +0 -61
  185. package/dist/runtime/components/ButtonGroup.vue +0 -26
  186. package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -26
  187. package/dist/runtime/components/FormItem.vue +0 -90
  188. package/dist/runtime/components/FormItem.vue.d.ts +0 -60
  189. package/dist/runtime/composables/useButtonGroup.d.ts +0 -5
  190. package/dist/runtime/composables/useButtonGroup.js +0 -9
  191. package/dist/runtime/composables/useFormItem.d.ts +0 -27
  192. package/dist/runtime/composables/useFormItem.js +0 -64
  193. package/dist/runtime/composables/useTheme.d.ts +0 -9
  194. package/dist/runtime/composables/useTheme.js +0 -23
  195. package/dist/runtime/index.d.ts +0 -44
  196. package/dist/runtime/index.js +0 -44
  197. package/dist/runtime/locale/zh-tw.d.ts +0 -2
  198. package/dist/runtime/theme/accordion.d.ts +0 -50
  199. package/dist/runtime/theme/accordion.js +0 -28
  200. package/dist/runtime/theme/alert.d.ts +0 -119
  201. package/dist/runtime/theme/alert.js +0 -47
  202. package/dist/runtime/theme/app.d.ts +0 -19
  203. package/dist/runtime/theme/app.js +0 -19
  204. package/dist/runtime/theme/avatar-group.d.ts +0 -46
  205. package/dist/runtime/theme/avatar-group.js +0 -32
  206. package/dist/runtime/theme/avatar.d.ts +0 -50
  207. package/dist/runtime/theme/avatar.js +0 -34
  208. package/dist/runtime/theme/badge.d.ts +0 -76
  209. package/dist/runtime/theme/badge.js +0 -92
  210. package/dist/runtime/theme/breadcrumb.d.ts +0 -61
  211. package/dist/runtime/theme/breadcrumb.js +0 -44
  212. package/dist/runtime/theme/button-group.d.ts +0 -60
  213. package/dist/runtime/theme/button-group.js +0 -42
  214. package/dist/runtime/theme/button.d.ts +0 -184
  215. package/dist/runtime/theme/button.js +0 -164
  216. package/dist/runtime/theme/calendar.d.ts +0 -58
  217. package/dist/runtime/theme/calendar.js +0 -86
  218. package/dist/runtime/theme/card.d.ts +0 -56
  219. package/dist/runtime/theme/card.js +0 -37
  220. package/dist/runtime/theme/carousel.d.ts +0 -107
  221. package/dist/runtime/theme/carousel.js +0 -43
  222. package/dist/runtime/theme/checkbox.d.ts +0 -82
  223. package/dist/runtime/theme/checkbox.js +0 -54
  224. package/dist/runtime/theme/chip.d.ts +0 -61
  225. package/dist/runtime/theme/chip.js +0 -66
  226. package/dist/runtime/theme/collapsible.d.ts +0 -32
  227. package/dist/runtime/theme/collapsible.js +0 -10
  228. package/dist/runtime/theme/drawer.d.ts +0 -142
  229. package/dist/runtime/theme/drawer.js +0 -113
  230. package/dist/runtime/theme/dropdown-menu.d.ts +0 -65
  231. package/dist/runtime/theme/dropdown-menu.js +0 -83
  232. package/dist/runtime/theme/form-item.d.ts +0 -70
  233. package/dist/runtime/theme/form-item.js +0 -34
  234. package/dist/runtime/theme/form.d.ts +0 -2
  235. package/dist/runtime/theme/form.js +0 -7
  236. package/dist/runtime/theme/index.d.ts +0 -41
  237. package/dist/runtime/theme/index.js +0 -41
  238. package/dist/runtime/theme/input-number.d.ts +0 -115
  239. package/dist/runtime/theme/input-number.js +0 -95
  240. package/dist/runtime/theme/input.d.ts +0 -172
  241. package/dist/runtime/theme/input.js +0 -151
  242. package/dist/runtime/theme/kbd.d.ts +0 -33
  243. package/dist/runtime/theme/kbd.js +0 -26
  244. package/dist/runtime/theme/link.d.ts +0 -38
  245. package/dist/runtime/theme/link.js +0 -26
  246. package/dist/runtime/theme/modal.d.ts +0 -42
  247. package/dist/runtime/theme/modal.js +0 -55
  248. package/dist/runtime/theme/pagination.d.ts +0 -74
  249. package/dist/runtime/theme/pagination.js +0 -17
  250. package/dist/runtime/theme/pinInput.d.ts +0 -94
  251. package/dist/runtime/theme/pinInput.js +0 -111
  252. package/dist/runtime/theme/popover.d.ts +0 -32
  253. package/dist/runtime/theme/popover.js +0 -13
  254. package/dist/runtime/theme/progress.d.ts +0 -180
  255. package/dist/runtime/theme/progress.js +0 -95
  256. package/dist/runtime/theme/radio-group.d.ts +0 -104
  257. package/dist/runtime/theme/radio-group.js +0 -61
  258. package/dist/runtime/theme/scroll-area.d.ts +0 -67
  259. package/dist/runtime/theme/scroll-area.js +0 -33
  260. package/dist/runtime/theme/select.d.ts +0 -186
  261. package/dist/runtime/theme/select.js +0 -173
  262. package/dist/runtime/theme/separator.d.ts +0 -74
  263. package/dist/runtime/theme/separator.js +0 -53
  264. package/dist/runtime/theme/skeleton.d.ts +0 -2
  265. package/dist/runtime/theme/skeleton.js +0 -7
  266. package/dist/runtime/theme/slider.d.ts +0 -70
  267. package/dist/runtime/theme/slider.js +0 -52
  268. package/dist/runtime/theme/switch.d.ts +0 -116
  269. package/dist/runtime/theme/switch.js +0 -78
  270. package/dist/runtime/theme/table.d.ts +0 -86
  271. package/dist/runtime/theme/table.js +0 -36
  272. package/dist/runtime/theme/tabs.d.ts +0 -129
  273. package/dist/runtime/theme/tabs.js +0 -146
  274. package/dist/runtime/theme/textarea.d.ts +0 -90
  275. package/dist/runtime/theme/textarea.js +0 -116
  276. package/dist/runtime/theme/toast-provider.d.ts +0 -116
  277. package/dist/runtime/theme/toast-provider.js +0 -97
  278. package/dist/runtime/theme/toast.d.ts +0 -83
  279. package/dist/runtime/theme/toast.js +0 -35
  280. package/dist/runtime/theme/tooltip.d.ts +0 -38
  281. package/dist/runtime/theme/tooltip.js +0 -11
  282. package/dist/runtime/types/components.d.ts +0 -42
  283. package/dist/runtime/utils/extend-theme.d.ts +0 -9
  284. package/dist/runtime/utils/extend-theme.js +0 -27
  285. package/dist/runtime/utils/styler.d.ts +0 -4
  286. package/dist/runtime/utils/styler.js +0 -10
  287. package/dist/runtime/utils/translator.d.ts +0 -18
  288. package/dist/runtime/utils/translator.js +0 -8
  289. package/dist/shared/ui.D1BTWZFB.mjs +0 -5
  290. package/dist/shared/ui.D1BTWZFB.mjs.map +0 -1
  291. package/dist/unocss.d.ts +0 -52
  292. package/dist/unocss.mjs.map +0 -1
  293. package/dist/unplugin.d.ts +0 -26
  294. package/dist/unplugin.mjs.map +0 -1
  295. package/dist/vite.d.ts +0 -9
  296. package/dist/vite.mjs.map +0 -1
  297. /package/dist/runtime/types/{components.js → input.js} +0 -0
@@ -0,0 +1,4242 @@
1
+ import process from 'node:process';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { findPath, addTypeTemplate, addTemplate } from '@nuxt/kit';
4
+ import { loadConfig } from '@unocss/config';
5
+ import { genExport } from 'knitwork';
6
+ import { kebabCase } from 'scule';
7
+ import { n as neutralColors } from './ui.CzIlLITK.mjs';
8
+ import { ct } from '@byyuurin/ui-kit';
9
+ import { defu } from 'defu';
10
+
11
+ const name = "@byyuurin/ui";
12
+ const version = "0.2.0";
13
+
14
+ const accordion = ct({
15
+ parts: {
16
+ root: "w-full",
17
+ item: "border-b border-default last:border-b-0",
18
+ header: "flex",
19
+ trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-primary min-w-0 cursor-pointer",
20
+ content: [
21
+ "overflow-hidden focus:outline-none",
22
+ "data-[state=open]:animate-[accordion-down_200ms_ease-out]",
23
+ "data-[state=closed]:animate-[accordion-up_200ms_ease-out]"
24
+ ],
25
+ body: "text-sm pb-3.5",
26
+ leadingIcon: "shrink-0 size-5",
27
+ trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
28
+ label: "text-start break-words"
29
+ },
30
+ variants: {
31
+ disabled: {
32
+ true: {
33
+ trigger: "cursor-not-allowed opacity-75"
34
+ }
35
+ }
36
+ }
37
+ });
38
+
39
+ const alert = (options) => ct({
40
+ parts: {
41
+ root: "relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5",
42
+ wrapper: "min-w-0 flex-1 flex flex-col",
43
+ title: "text-sm font-medium",
44
+ description: "text-sm opacity-90",
45
+ icon: "shrink-0 size-5",
46
+ avatar: "shrink-0",
47
+ avatarSize: "2xl",
48
+ actions: "flex flex-wrap gap-1.5 shrink-0",
49
+ close: "p-0"
50
+ },
51
+ variants: {
52
+ color: {
53
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
54
+ neutral: ""
55
+ },
56
+ variant: {
57
+ solid: "",
58
+ outline: "",
59
+ soft: "",
60
+ subtle: ""
61
+ },
62
+ orientation: {
63
+ horizontal: {
64
+ root: "items-center",
65
+ actions: "items-center"
66
+ },
67
+ vertical: {
68
+ root: "items-start",
69
+ actions: "items-start mt-2.5"
70
+ }
71
+ },
72
+ title: {
73
+ true: {
74
+ description: "mt-1"
75
+ }
76
+ }
77
+ },
78
+ compoundVariants: [
79
+ ...(options.theme.colors || []).map((color) => ({
80
+ color,
81
+ variant: "solid",
82
+ class: {
83
+ root: `bg-${color} text-inverted`
84
+ }
85
+ })),
86
+ ...(options.theme.colors || []).map((color) => ({
87
+ color,
88
+ variant: "outline",
89
+ class: {
90
+ root: `text-${color} ring ring-inset ring-${color}/25`
91
+ }
92
+ })),
93
+ ...(options.theme.colors || []).map((color) => ({
94
+ color,
95
+ variant: "soft",
96
+ class: {
97
+ root: `bg-${color}/10 text-${color}`
98
+ }
99
+ })),
100
+ ...(options.theme.colors || []).map((color) => ({
101
+ color,
102
+ variant: "subtle",
103
+ class: {
104
+ root: `bg-${color}/10 text-${color} ring ring-inset ring-${color}/25`
105
+ }
106
+ })),
107
+ {
108
+ color: "neutral",
109
+ variant: "solid",
110
+ class: {
111
+ root: "text-inverted bg-inverted"
112
+ }
113
+ },
114
+ {
115
+ color: "neutral",
116
+ variant: "outline",
117
+ class: {
118
+ root: "text-highlighted bg-default ring ring-inset ring-default"
119
+ }
120
+ },
121
+ {
122
+ color: "neutral",
123
+ variant: "soft",
124
+ class: {
125
+ root: "text-highlighted bg-elevated/50"
126
+ }
127
+ },
128
+ {
129
+ color: "neutral",
130
+ variant: "subtle",
131
+ class: {
132
+ root: "text-highlighted bg-elevated/50 ring ring-inset ring-accented"
133
+ }
134
+ }
135
+ ],
136
+ defaultVariants: {
137
+ color: "primary",
138
+ variant: "solid"
139
+ }
140
+ });
141
+
142
+ const avatar = ct({
143
+ parts: {
144
+ root: "inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated",
145
+ image: "h-full w-full rounded-[inherit] object-cover",
146
+ fallback: "font-medium leading-none text-muted truncate",
147
+ icon: "text-muted shrink-0"
148
+ },
149
+ variants: {
150
+ size: {
151
+ "3xs": {
152
+ root: "size-4 text-2"
153
+ },
154
+ "2xs": {
155
+ root: "size-5 text-2.5"
156
+ },
157
+ "xs": {
158
+ root: "size-6 text-3"
159
+ },
160
+ "sm": {
161
+ root: "size-7 text-3.5"
162
+ },
163
+ "md": {
164
+ root: "size-8 text-4"
165
+ },
166
+ "lg": {
167
+ root: "size-9 text-4.5"
168
+ },
169
+ "xl": {
170
+ root: "size-10 text-5"
171
+ },
172
+ "2xl": {
173
+ root: "size-11 text-5.5"
174
+ },
175
+ "3xl": {
176
+ root: "size-12 text-6"
177
+ }
178
+ }
179
+ },
180
+ defaultVariants: {
181
+ size: "md"
182
+ }
183
+ });
184
+
185
+ const avatarGroup = ct({
186
+ parts: {
187
+ root: "inline-flex flex-row-reverse justify-end",
188
+ base: "relative rounded-full ring-bg first:me-0"
189
+ },
190
+ variants: {
191
+ size: {
192
+ "3xs": {
193
+ base: "ring -me-0.5"
194
+ },
195
+ "2xs": {
196
+ base: "ring -me-0.5"
197
+ },
198
+ "xs": {
199
+ base: "ring -me-0.5"
200
+ },
201
+ "sm": {
202
+ base: "ring-2 -me-1.5"
203
+ },
204
+ "md": {
205
+ base: "ring-2 -me-1.5"
206
+ },
207
+ "lg": {
208
+ base: "ring-2 -me-1.5"
209
+ },
210
+ "xl": {
211
+ base: "ring-3 -me-2"
212
+ },
213
+ "2xl": {
214
+ base: "ring-3 -me-2"
215
+ },
216
+ "3xl": {
217
+ base: "ring-3 -me-2"
218
+ }
219
+ }
220
+ },
221
+ defaultVariants: {
222
+ size: "md"
223
+ }
224
+ });
225
+
226
+ const fieldGroup = ct(
227
+ /* @unocss-include */
228
+ {
229
+ base: "relative",
230
+ variants: {
231
+ size: {
232
+ xs: "",
233
+ sm: "",
234
+ md: "",
235
+ lg: "",
236
+ xl: ""
237
+ },
238
+ orientation: {
239
+ horizontal: "inline-flex -space-x-px",
240
+ vertical: "flex flex-col -space-y-px"
241
+ }
242
+ }
243
+ }
244
+ );
245
+ const fieldGroupVariant = {
246
+ fieldGroup: {
247
+ horizontal: {
248
+ base: "not-only-child:first:rounded-e-none not-only-child:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]"
249
+ },
250
+ vertical: {
251
+ base: "not-only-child:first:rounded-b-none not-only-child:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"
252
+ }
253
+ }
254
+ };
255
+ const fieldGroupVariantWithRoot = {
256
+ fieldGroup: {
257
+ horizontal: {
258
+ root: "group has-focus-visible:z-[1]",
259
+ base: "group-not-only-child:group-first:rounded-e-none group-not-only-child:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
260
+ },
261
+ vertical: {
262
+ root: "group has-focus-visible:z-[1]",
263
+ base: "group-not-only-child:group-first:rounded-b-none group-not-only-child:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
264
+ }
265
+ }
266
+ };
267
+
268
+ const badge = (options) => ct({
269
+ parts: {
270
+ base: "font-medium inline-flex items-center",
271
+ label: "truncate",
272
+ leadingIcon: "shrink-0",
273
+ leadingAvatar: "shrink-0",
274
+ leadingAvatarSize: "",
275
+ trailingIcon: "shrink-0"
276
+ },
277
+ variants: {
278
+ ...fieldGroupVariant,
279
+ color: {
280
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
281
+ neutral: ""
282
+ },
283
+ variant: {
284
+ solid: "",
285
+ outline: "",
286
+ soft: "",
287
+ subtle: ""
288
+ },
289
+ size: {
290
+ xs: {
291
+ base: "text-2/3 px-1 py-0.5 gap-1 rounded-sm",
292
+ leadingIcon: "size-3",
293
+ leadingAvatarSize: "3xs",
294
+ trailingIcon: "size-3"
295
+ },
296
+ sm: {
297
+ base: "text-2.5/3 px-1.5 py-1 gap-1 rounded-sm",
298
+ leadingIcon: "size-3",
299
+ leadingAvatarSize: "3xs",
300
+ trailingIcon: "size-3"
301
+ },
302
+ md: {
303
+ base: "text-3/4 px-2 py-1 gap-1 rounded-md",
304
+ leadingIcon: "size-4",
305
+ leadingAvatarSize: "3xs",
306
+ trailingIcon: "size-4"
307
+ },
308
+ lg: {
309
+ base: "text-3.5/5 px-2 py-1 gap-1.5 rounded-md",
310
+ leadingIcon: "size-5",
311
+ leadingAvatarSize: "2xs",
312
+ trailingIcon: "size-5"
313
+ },
314
+ xl: {
315
+ base: "text-4/6 px-2.5 py-1 gap-1.5 rounded-md",
316
+ leadingIcon: "size-6",
317
+ leadingAvatarSize: "2xs",
318
+ trailingIcon: "size-6"
319
+ }
320
+ },
321
+ square: {
322
+ true: ""
323
+ }
324
+ },
325
+ compoundVariants: [
326
+ ...(options.theme.colors || []).map((color) => ({
327
+ color,
328
+ variant: "solid",
329
+ class: { base: `bg-${color} text-inverted` }
330
+ })),
331
+ ...(options.theme.colors || []).map((color) => ({
332
+ color,
333
+ variant: "outline",
334
+ class: { base: `text-${color} ring ring-inset ring-${color}/50` }
335
+ })),
336
+ ...(options.theme.colors || []).map((color) => ({
337
+ color,
338
+ variant: "soft",
339
+ class: { base: `bg-${color}/10 text-${color}` }
340
+ })),
341
+ ...(options.theme.colors || []).map((color) => ({
342
+ color,
343
+ variant: "subtle",
344
+ class: { base: `bg-${color}/10 text-${color} ring ring-inset ring-${color}/25` }
345
+ })),
346
+ {
347
+ color: "neutral",
348
+ variant: "solid",
349
+ class: { base: "text-inverted bg-inverted" }
350
+ },
351
+ {
352
+ color: "neutral",
353
+ variant: "outline",
354
+ class: { base: "ring ring-inset ring-accented text-default bg-default" }
355
+ },
356
+ {
357
+ color: "neutral",
358
+ variant: "soft",
359
+ class: { base: "text-default bg-elevated" }
360
+ },
361
+ {
362
+ color: "neutral",
363
+ variant: "subtle",
364
+ class: { base: "ring ring-inset ring-accented text-default bg-elevated" }
365
+ },
366
+ {
367
+ size: "xs",
368
+ square: true,
369
+ class: { base: "p-0.5" }
370
+ },
371
+ {
372
+ size: "sm",
373
+ square: true,
374
+ class: { base: "p-1" }
375
+ },
376
+ {
377
+ size: "md",
378
+ square: true,
379
+ class: { base: "p-1" }
380
+ },
381
+ {
382
+ size: "lg",
383
+ square: true,
384
+ class: { base: "p-1" }
385
+ },
386
+ {
387
+ size: "xl",
388
+ square: true,
389
+ class: { base: "p-1" }
390
+ }
391
+ ],
392
+ defaultVariants: {
393
+ color: "primary",
394
+ variant: "solid",
395
+ size: "md"
396
+ }
397
+ });
398
+
399
+ const breadcrumb = (options) => ct({
400
+ parts: {
401
+ root: "relative min-w-0",
402
+ list: "flex items-center gap-1.5",
403
+ item: "flex min-w-0",
404
+ link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-primary",
405
+ linkLeadingIcon: "shrink-0 size-5",
406
+ linkLeadingAvatar: "shrink-0",
407
+ linkLeadingAvatarSize: "2xs",
408
+ linkLabel: "truncate",
409
+ separator: "flex",
410
+ separatorIcon: "shrink-0 size-5 text-muted"
411
+ },
412
+ variants: {
413
+ active: {
414
+ true: {
415
+ link: "text-primary font-semibold"
416
+ },
417
+ false: {
418
+ link: "text-muted font-medium"
419
+ }
420
+ },
421
+ disabled: {
422
+ true: {
423
+ link: "cursor-not-allowed opacity-75"
424
+ }
425
+ },
426
+ to: {
427
+ true: ""
428
+ }
429
+ },
430
+ compoundVariants: [
431
+ {
432
+ disabled: false,
433
+ active: false,
434
+ to: true,
435
+ class: {
436
+ link: [
437
+ "hover:text-default",
438
+ options.theme.transitions && "transition-colors"
439
+ ]
440
+ }
441
+ }
442
+ ]
443
+ });
444
+
445
+ const button = (options) => ct({
446
+ parts: {
447
+ base: [
448
+ "rounded-md font-medium inline-flex items-center",
449
+ options.theme.transitions && "transition-colors",
450
+ "cursor-pointer disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75"
451
+ ],
452
+ label: "truncate",
453
+ leadingIcon: "shrink-0",
454
+ leadingAvatar: "shrink-0",
455
+ leadingAvatarSize: "",
456
+ trailingIcon: "shrink-0"
457
+ },
458
+ variants: {
459
+ ...fieldGroupVariant,
460
+ color: {
461
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
462
+ neutral: ""
463
+ },
464
+ variant: {
465
+ solid: "",
466
+ outline: "",
467
+ soft: "",
468
+ subtle: "",
469
+ ghost: "",
470
+ link: ""
471
+ },
472
+ size: {
473
+ xs: {
474
+ base: "px-2 py-1 text-xs gap-1",
475
+ leadingIcon: "size-4",
476
+ leadingAvatarSize: "3xs",
477
+ trailingIcon: "size-4"
478
+ },
479
+ sm: {
480
+ base: "px-2.5 py-1.5 text-xs gap-1.5",
481
+ leadingIcon: "size-4",
482
+ leadingAvatarSize: "3xs",
483
+ trailingIcon: "size-4"
484
+ },
485
+ md: {
486
+ base: "px-2.5 py-1.5 text-sm gap-1.5",
487
+ leadingIcon: "size-5",
488
+ leadingAvatarSize: "2xs",
489
+ trailingIcon: "size-5"
490
+ },
491
+ lg: {
492
+ base: "px-3 py-2 text-sm gap-2",
493
+ leadingIcon: "size-5",
494
+ leadingAvatarSize: "2xs",
495
+ trailingIcon: "size-5"
496
+ },
497
+ xl: {
498
+ base: "px-3 py-2 text-base gap-2",
499
+ leadingIcon: "size-6",
500
+ leadingAvatarSize: "xs",
501
+ trailingIcon: "size-6"
502
+ }
503
+ },
504
+ block: {
505
+ true: {
506
+ base: "w-full justify-center",
507
+ trailingIcon: "ms-auto"
508
+ }
509
+ },
510
+ square: {
511
+ true: ""
512
+ },
513
+ leading: {
514
+ true: ""
515
+ },
516
+ trailing: {
517
+ true: ""
518
+ },
519
+ loading: {
520
+ true: ""
521
+ },
522
+ active: {
523
+ true: {
524
+ base: ""
525
+ },
526
+ false: {
527
+ base: ""
528
+ }
529
+ }
530
+ },
531
+ compoundVariants: [
532
+ ...(options.theme.colors || []).map((color) => ({
533
+ color,
534
+ variant: "solid",
535
+ class: {
536
+ base: `text-inverted bg-${color} hover:bg-${color}/75 active:bg-${color}/75 disabled:bg-${color} aria-disabled:bg-${color} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}`
537
+ }
538
+ })),
539
+ ...(options.theme.colors || []).map((color) => ({
540
+ color,
541
+ variant: "outline",
542
+ class: {
543
+ base: `ring ring-inset ring-${color}/50 text-${color} hover:bg-${color}/10 active:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 } focus-visible:ring-${color}`
544
+ }
545
+ })),
546
+ ...(options.theme.colors || []).map((color) => ({
547
+ color,
548
+ variant: "soft",
549
+ class: {
550
+ base: `text-${color} bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 focus:outline-none focus-visible:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10`
551
+ }
552
+ })),
553
+ ...(options.theme.colors || []).map((color) => ({
554
+ color,
555
+ variant: "subtle",
556
+ class: {
557
+ base: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}`
558
+ }
559
+ })),
560
+ ...(options.theme.colors || []).map((color) => ({
561
+ color,
562
+ variant: "ghost",
563
+ class: {
564
+ base: `text-${color} hover:bg-${color}/10 active:bg-${color}/10 focus:outline-none focus-visible:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
565
+ }
566
+ })),
567
+ ...(options.theme.colors || []).map((color) => ({
568
+ color,
569
+ variant: "link",
570
+ class: {
571
+ base: `text-${color} hover:text-${color}/75 active:text-${color}/75 disabled:text-${color} aria-disabled:text-${color} focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`
572
+ }
573
+ })),
574
+ {
575
+ color: "neutral",
576
+ variant: "solid",
577
+ class: {
578
+ base: "text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"
579
+ }
580
+ },
581
+ {
582
+ color: "neutral",
583
+ variant: "outline",
584
+ class: {
585
+ base: "ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
586
+ }
587
+ },
588
+ {
589
+ color: "neutral",
590
+ variant: "soft",
591
+ class: {
592
+ base: "text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 focus:outline-none focus-visible:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated"
593
+ }
594
+ },
595
+ {
596
+ color: "neutral",
597
+ variant: "subtle",
598
+ class: {
599
+ base: "ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted"
600
+ }
601
+ },
602
+ {
603
+ color: "neutral",
604
+ variant: "ghost",
605
+ class: {
606
+ base: "text-default hover:bg-elevated active:bg-elevated focus:outline-none focus-visible:bg-elevated hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
607
+ }
608
+ },
609
+ {
610
+ color: "neutral",
611
+ variant: "link",
612
+ class: {
613
+ base: "text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted focus:outline-none focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-inverted"
614
+ }
615
+ },
616
+ {
617
+ size: "xs",
618
+ square: true,
619
+ class: { base: "p-1" }
620
+ },
621
+ {
622
+ size: "sm",
623
+ square: true,
624
+ class: { base: "p-1.5" }
625
+ },
626
+ {
627
+ size: "md",
628
+ square: true,
629
+ class: { base: "p-1.5" }
630
+ },
631
+ {
632
+ size: "lg",
633
+ square: true,
634
+ class: { base: "p-2" }
635
+ },
636
+ {
637
+ size: "xl",
638
+ square: true,
639
+ class: { base: "p-2" }
640
+ },
641
+ {
642
+ loading: true,
643
+ leading: true,
644
+ class: {
645
+ leadingIcon: "animate-spin"
646
+ }
647
+ },
648
+ {
649
+ loading: true,
650
+ leading: false,
651
+ trailing: true,
652
+ class: {
653
+ trailingIcon: "animate-spin"
654
+ }
655
+ }
656
+ ],
657
+ defaultVariants: {
658
+ color: "primary",
659
+ variant: "solid",
660
+ size: "md"
661
+ }
662
+ });
663
+
664
+ const calendar = (options) => ct({
665
+ parts: {
666
+ root: "",
667
+ header: "flex items-center justify-between",
668
+ body: "flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0",
669
+ heading: "text-center font-medium truncate mx-auto",
670
+ grid: "w-full border-collapse select-none space-y-1 focus:outline-none",
671
+ gridRow: "grid grid-cols-7 place-items-center",
672
+ gridWeekDaysRow: "mb-1 grid w-full grid-cols-7",
673
+ gridBody: "grid",
674
+ headCell: "rounded-md",
675
+ cell: "relative text-center",
676
+ cellTrigger: [
677
+ "m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap cursor-pointer focus-visible:ring-2 focus:outline-none",
678
+ "data-[today]:font-semibold",
679
+ "data-[unavailable]:line-through data-[unavailable]:text-muted data-[unavailable]:pointer-events-none",
680
+ "data-[outside-view]:text-muted",
681
+ "data-[disabled]:not-[[data-selected]]:text-muted data-[disabled]:cursor-not-allowed",
682
+ options.theme.transitions && "transition"
683
+ ]
684
+ },
685
+ variants: {
686
+ color: {
687
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
688
+ headCell: `text-${color}`,
689
+ cellTrigger: `focus-visible:ring-${color}`
690
+ }])),
691
+ neutral: {
692
+ headCell: "text-highlighted",
693
+ cellTrigger: "focus-visible:ring-inverted"
694
+ }
695
+ },
696
+ variant: {
697
+ solid: "",
698
+ outline: "",
699
+ soft: "",
700
+ subtle: ""
701
+ },
702
+ size: {
703
+ xs: {
704
+ heading: "text-xs",
705
+ cell: "text-xs",
706
+ headCell: "text-2.5",
707
+ cellTrigger: "size-7",
708
+ body: "space-y-2 pt-2"
709
+ },
710
+ sm: {
711
+ heading: "text-xs",
712
+ headCell: "text-3",
713
+ cell: "text-xs",
714
+ cellTrigger: "size-7"
715
+ },
716
+ md: {
717
+ heading: "text-sm",
718
+ headCell: "text-3",
719
+ cell: "text-sm",
720
+ cellTrigger: "size-8"
721
+ },
722
+ lg: {
723
+ heading: "text-base",
724
+ headCell: "text-4",
725
+ cellTrigger: "size-9 text-base"
726
+ },
727
+ xl: {
728
+ heading: "text-lg",
729
+ headCell: "text-4.5",
730
+ cellTrigger: "size-10 text-lg"
731
+ }
732
+ },
733
+ outsideView: {
734
+ false: {
735
+ cellTrigger: "not-hover:data-[outside-view]:data-[selected]:bg-default not-hover:data-[outside-view]:data-[selected]:text-muted not-hover:data-[outside-view]:data-[selected]:ring-0"
736
+ }
737
+ }
738
+ },
739
+ compoundVariants: [
740
+ ...(options.theme.colors || []).map((color) => ({
741
+ color,
742
+ variant: "solid",
743
+ class: {
744
+ cellTrigger: `data-[selected]:bg-${color} data-[selected]:text-inverted data-[today]:not-[[data-selected]]:text-${color} data-[highlighted]:bg-${color}/20 hover:not-[[data-selected]]:bg-${color}/20`
745
+ }
746
+ })),
747
+ ...(options.theme.colors || []).map((color) => ({
748
+ color,
749
+ variant: "solid",
750
+ outsideView: false,
751
+ class: {
752
+ cellTrigger: `hover:data-[outside-view]:data-[selected]:bg-${color}/20`
753
+ }
754
+ })),
755
+ {
756
+ color: "neutral",
757
+ variant: "solid",
758
+ class: {
759
+ cellTrigger: "data-[selected]:bg-inverted data-[selected]:text-inverted data-[today]:not-[[data-selected]]:text-highlighted data-[highlighted]:bg-inverted/20 hover:not-[[data-selected]]:bg-inverted/10"
760
+ }
761
+ },
762
+ {
763
+ color: "neutral",
764
+ variant: "solid",
765
+ outsideView: false,
766
+ class: {
767
+ cellTrigger: "hover:data-[outside-view]:data-[selected]:bg-inverted/10"
768
+ }
769
+ },
770
+ ...(options.theme.colors || []).map((color) => ({
771
+ color,
772
+ variant: "outline",
773
+ class: {
774
+ cellTrigger: `data-[selected]:ring data-[selected]:ring-inset data-[selected]:ring-${color}/50 data-[selected]:text-${color} data-[today]:not-[[data-selected]]:text-${color} data-[highlighted]:bg-${color}/10 hover:not-[[data-selected]]:bg-${color}/10`
775
+ }
776
+ })),
777
+ {
778
+ color: "neutral",
779
+ variant: "outline",
780
+ class: {
781
+ cellTrigger: "data-[selected]:ring data-[selected]:ring-inset data-[selected]:ring-accented data-[selected]:text-default data-[selected]:bg-default data-[today]:not-[[data-selected]]:text-highlighted data-[highlighted]:bg-inverted/10 hover:not-[[data-selected]]:bg-inverted/10"
782
+ }
783
+ },
784
+ ...(options.theme.colors || []).map((color) => ({
785
+ color,
786
+ variant: "soft",
787
+ class: {
788
+ cellTrigger: `data-[selected]:bg-${color}/10 data-[selected]:text-${color} data-[today]:not-[[data-selected]]:text-${color} data-[highlighted]:bg-${color}/20 hover:not-[[data-selected]]:bg-${color}/20`
789
+ }
790
+ })),
791
+ {
792
+ color: "neutral",
793
+ variant: "soft",
794
+ class: {
795
+ cellTrigger: "data-[selected]:bg-elevated data-[selected]:text-default data-[today]:not-[[data-selected]]:text-highlighted data-[highlighted]:bg-inverted/20 hover:not-[[data-selected]]:bg-inverted/10"
796
+ }
797
+ },
798
+ ...(options.theme.colors || []).map((color) => ({
799
+ color,
800
+ variant: "subtle",
801
+ class: {
802
+ cellTrigger: `data-[selected]:bg-${color}/10 data-[selected]:text-${color} data-[selected]:ring data-[selected]:ring-inset data-[selected]:ring-${color}/25 data-[today]:not-[[data-selected]]:text-${color} data-[highlighted]:bg-${color}/20 hover:not-[[data-selected]]:bg-${color}/20`
803
+ }
804
+ })),
805
+ {
806
+ color: "neutral",
807
+ variant: "subtle",
808
+ class: {
809
+ cellTrigger: "data-[selected]:bg-elevated data-[selected]:text-default data-[selected]:ring data-[selected]:ring-inset data-[selected]:ring-accented data-[today]:not-[[data-selected]]:text-highlighted data-[highlighted]:bg-inverted/20 hover:not-[[data-selected]]:bg-inverted/10"
810
+ }
811
+ }
812
+ ],
813
+ defaultVariants: {
814
+ color: "primary",
815
+ variant: "solid",
816
+ size: "md",
817
+ outsideView: true
818
+ }
819
+ });
820
+
821
+ const card = ct({
822
+ parts: {
823
+ root: "rounded divide-y",
824
+ header: "flex flex-wrap items-center gap-1 p-4 sm:px-6",
825
+ body: "flex-1 overflow-y-auto p-4 sm:p-6 empty:hidden",
826
+ footer: "flex items-center gap-1.5 p-4 sm:px-6",
827
+ title: "flex-grow text-xl text-highlighted font-semibold",
828
+ description: "w-full text-muted text-sm"
829
+ },
830
+ variants: {
831
+ variant: {
832
+ solid: {
833
+ root: "bg-inverted text-inverted"
834
+ },
835
+ outline: {
836
+ root: "bg-default ring ring-default divide-y divide-default"
837
+ },
838
+ soft: {
839
+ root: "bg-elevated/50 divide-y divide-default"
840
+ },
841
+ subtle: {
842
+ root: "bg-elevated/50 ring ring-default divide-y divide-default"
843
+ }
844
+ }
845
+ },
846
+ defaultVariants: {
847
+ variant: "outline"
848
+ }
849
+ });
850
+
851
+ const carousel = (options) => ct({
852
+ parts: {
853
+ root: "relative focus:outline-none",
854
+ viewport: "overflow-hidden",
855
+ container: "flex items-start",
856
+ item: "min-w-0 shrink-0 basis-full",
857
+ controls: "",
858
+ arrows: "",
859
+ prev: "absolute rounded-full",
860
+ next: "absolute rounded-full",
861
+ dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
862
+ dot: [
863
+ "cursor-pointer size-3 bg-accented rounded-full",
864
+ options.theme.transitions && "transition"
865
+ ]
866
+ },
867
+ variants: {
868
+ orientation: {
869
+ vertical: {
870
+ container: "flex-col -mt-4",
871
+ item: "pt-4",
872
+ prev: "top-4 sm:-top-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90",
873
+ next: "bottom-4 sm:-bottom-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90"
874
+ },
875
+ horizontal: {
876
+ container: "flex-row -ms-4",
877
+ item: "ps-4",
878
+ prev: "start-4 sm:-start-12 top-1/2 -translate-y-1/2",
879
+ next: "end-4 sm:-end-12 top-1/2 -translate-y-1/2"
880
+ }
881
+ },
882
+ active: {
883
+ true: {
884
+ dot: "data-[state=active]:bg-inverted"
885
+ }
886
+ }
887
+ }
888
+ });
889
+
890
+ const checkbox = (options) => ct({
891
+ parts: {
892
+ root: "relative flex items-start",
893
+ container: "flex items-center",
894
+ base: "rounded-sm ring ring-inset ring-accented overflow-hidden cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2",
895
+ indicator: "flex items-center justify-center size-full text-inverted data-[state=checked]:animate-[scale-in_100ms_ease-in-out]",
896
+ icon: "shrink-0 size-full",
897
+ wrapper: "w-full",
898
+ label: "block font-medium text-default cursor-pointer",
899
+ description: "text-muted"
900
+ },
901
+ variants: {
902
+ color: {
903
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
904
+ base: `focus-visible:outline-${color}`,
905
+ indicator: `bg-${color}`
906
+ }])),
907
+ neutral: {
908
+ base: "focus-visible:outline-inverted",
909
+ indicator: "bg-inverted"
910
+ }
911
+ },
912
+ variant: {
913
+ list: {
914
+ root: ""
915
+ },
916
+ card: {
917
+ root: "border border-muted rounded-lg cursor-pointer"
918
+ }
919
+ },
920
+ indicator: {
921
+ start: {
922
+ root: "flex-row",
923
+ wrapper: "ms-2"
924
+ },
925
+ end: {
926
+ root: "flex-row-reverse",
927
+ wrapper: "me-2"
928
+ },
929
+ hidden: {
930
+ base: "sr-only",
931
+ wrapper: "text-center"
932
+ }
933
+ },
934
+ size: {
935
+ xs: {
936
+ base: "size-3",
937
+ container: "h-4",
938
+ wrapper: "text-xs"
939
+ },
940
+ sm: {
941
+ base: "size-3.5",
942
+ container: "h-4",
943
+ wrapper: "text-xs"
944
+ },
945
+ md: {
946
+ base: "size-4",
947
+ container: "h-5",
948
+ wrapper: "text-sm"
949
+ },
950
+ lg: {
951
+ base: "size-4.5",
952
+ container: "h-5",
953
+ wrapper: "text-sm"
954
+ },
955
+ xl: {
956
+ base: "size-5",
957
+ container: "h-6",
958
+ wrapper: "text-base"
959
+ }
960
+ },
961
+ required: {
962
+ true: {
963
+ label: `after:content-['*'] after:ms-0.5 after:text-error`
964
+ }
965
+ },
966
+ disabled: {
967
+ true: {
968
+ root: "cursor-not-allowed opacity-75",
969
+ base: "cursor-not-allowed",
970
+ label: "cursor-not-allowed",
971
+ description: "cursor-not-allowed"
972
+ }
973
+ },
974
+ checked: {
975
+ true: ""
976
+ }
977
+ },
978
+ compoundVariants: [
979
+ { size: "xs", variant: "card", class: { root: "p-2.5" } },
980
+ { size: "sm", variant: "card", class: { root: "p-3" } },
981
+ { size: "md", variant: "card", class: { root: "p-3.5" } },
982
+ { size: "lg", variant: "card", class: { root: "p-4" } },
983
+ { size: "xl", variant: "card", class: { root: "p-4.5" } },
984
+ ...(options.theme.colors || []).map((color) => ({
985
+ color,
986
+ variant: "card",
987
+ class: {
988
+ root: `has-data-[state=checked]:border-${color}`
989
+ }
990
+ })),
991
+ {
992
+ color: "neutral",
993
+ variant: "card",
994
+ class: {
995
+ root: "has-data-[state=checked]:border-inverted"
996
+ }
997
+ },
998
+ {
999
+ variant: "card",
1000
+ disabled: true,
1001
+ class: {
1002
+ root: "cursor-not-allowed opacity-75"
1003
+ }
1004
+ }
1005
+ ],
1006
+ defaultVariants: {
1007
+ size: "md",
1008
+ color: "primary",
1009
+ variant: "list",
1010
+ indicator: "start"
1011
+ }
1012
+ });
1013
+
1014
+ const checkboxGroup = (options) => ct({
1015
+ parts: {
1016
+ root: "relative",
1017
+ fieldset: "flex gap-x-2",
1018
+ legend: "mb-1 block font-medium text-default",
1019
+ item: ""
1020
+ },
1021
+ variants: {
1022
+ orientation: {
1023
+ horizontal: {
1024
+ fieldset: "flex-row"
1025
+ },
1026
+ vertical: {
1027
+ fieldset: "flex-col"
1028
+ }
1029
+ },
1030
+ color: {
1031
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1032
+ neutral: ""
1033
+ },
1034
+ variant: {
1035
+ list: "",
1036
+ card: "",
1037
+ table: {
1038
+ item: "border border-muted"
1039
+ }
1040
+ },
1041
+ size: {
1042
+ xs: {
1043
+ fieldset: "gap-y-0.5",
1044
+ legend: "text-xs"
1045
+ },
1046
+ sm: {
1047
+ fieldset: "gap-y-0.5",
1048
+ legend: "text-xs"
1049
+ },
1050
+ md: {
1051
+ fieldset: "gap-y-1",
1052
+ legend: "text-sm"
1053
+ },
1054
+ lg: {
1055
+ fieldset: "gap-y-1",
1056
+ legend: "text-sm"
1057
+ },
1058
+ xl: {
1059
+ fieldset: "gap-y-1.5",
1060
+ legend: "text-base"
1061
+ }
1062
+ },
1063
+ disabled: {
1064
+ true: ""
1065
+ },
1066
+ required: {
1067
+ true: {
1068
+ legend: `after:content-['*'] after:ms-0.5 after:text-error`
1069
+ }
1070
+ }
1071
+ },
1072
+ compoundVariants: [
1073
+ { size: "xs", variant: "table", class: { item: "p-2.5" } },
1074
+ { size: "sm", variant: "table", class: { item: "p-3" } },
1075
+ { size: "md", variant: "table", class: { item: "p-3.5" } },
1076
+ { size: "lg", variant: "table", class: { item: "p-4" } },
1077
+ { size: "xl", variant: "table", class: { item: "p-4.5" } },
1078
+ {
1079
+ orientation: "horizontal",
1080
+ variant: "table",
1081
+ class: {
1082
+ item: "first-of-type:rounded-s-lg last-of-type:rounded-e-lg",
1083
+ fieldset: "gap-0 -space-x-px"
1084
+ }
1085
+ },
1086
+ {
1087
+ orientation: "vertical",
1088
+ variant: "table",
1089
+ class: {
1090
+ item: "first-of-type:rounded-t-lg last-of-type:rounded-b-lg",
1091
+ fieldset: "gap-0 -space-y-px"
1092
+ }
1093
+ },
1094
+ ...(options.theme.colors || []).map((color) => ({
1095
+ color,
1096
+ variant: "table",
1097
+ class: {
1098
+ item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[1]`
1099
+ }
1100
+ })),
1101
+ {
1102
+ color: "neutral",
1103
+ variant: "table",
1104
+ class: {
1105
+ item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[1]"
1106
+ }
1107
+ },
1108
+ {
1109
+ variant: "table",
1110
+ disabled: false,
1111
+ class: {
1112
+ item: "cursor-pointer"
1113
+ }
1114
+ }
1115
+ ],
1116
+ defaultVariants: {
1117
+ size: "md",
1118
+ variant: "list",
1119
+ color: "primary"
1120
+ }
1121
+ });
1122
+
1123
+ const chip = (options) => ct({
1124
+ parts: {
1125
+ root: "relative inline-flex items-center justify-center shrink-0",
1126
+ base: "rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap"
1127
+ },
1128
+ variants: {
1129
+ color: {
1130
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { base: `bg-${color}` }])),
1131
+ neutral: { base: "bg-inverted" }
1132
+ },
1133
+ size: {
1134
+ "3xs": { base: "h-1 min-w-1 text-1" },
1135
+ "2xs": { base: "h-1.25 min-w-1.25 text-1.25" },
1136
+ "xs": { base: "h-1.5 min-w-1.5 text-1.5" },
1137
+ "sm": { base: "h-1.75 min-w-1.75 text-1.75" },
1138
+ "md": { base: "h-2 min-w-2 text-2" },
1139
+ "lg": { base: "h-2.25 min-w-2.25 text-2.25" },
1140
+ "xl": { base: "h-2.5 min-w-2.5 text-2.5" },
1141
+ "2xl": { base: "h-2.75 min-w-2.75 text-2.75" },
1142
+ "3xl": { base: "h-3 min-w-3 text-3" }
1143
+ },
1144
+ position: {
1145
+ "top-right": { base: "top-0 right-0" },
1146
+ "bottom-right": { base: "bottom-0 right-0" },
1147
+ "top-left": { base: "top-0 left-0" },
1148
+ "bottom-left": { base: "bottom-0 left-0" }
1149
+ },
1150
+ show: {
1151
+ true: {
1152
+ base: "animate-[scale-in_200ms_ease-out]"
1153
+ }
1154
+ },
1155
+ inset: {
1156
+ false: ""
1157
+ },
1158
+ standalone: {
1159
+ false: { base: "absolute" }
1160
+ }
1161
+ },
1162
+ compoundVariants: [
1163
+ {
1164
+ position: "top-right",
1165
+ inset: false,
1166
+ class: {
1167
+ base: "-translate-y-1/2 translate-x-1/2 transform"
1168
+ }
1169
+ },
1170
+ {
1171
+ position: "bottom-right",
1172
+ inset: false,
1173
+ class: {
1174
+ base: "translate-y-1/2 translate-x-1/2 transform"
1175
+ }
1176
+ },
1177
+ {
1178
+ position: "top-left",
1179
+ inset: false,
1180
+ class: {
1181
+ base: "-translate-y-1/2 -translate-x-1/2 transform"
1182
+ }
1183
+ },
1184
+ {
1185
+ position: "bottom-left",
1186
+ inset: false,
1187
+ class: {
1188
+ base: "translate-y-1/2 -translate-x-1/2 transform"
1189
+ }
1190
+ }
1191
+ ],
1192
+ defaultVariants: {
1193
+ size: "md",
1194
+ color: "primary",
1195
+ position: "top-right"
1196
+ }
1197
+ });
1198
+
1199
+ const collapsible = ct({
1200
+ parts: {
1201
+ root: "",
1202
+ content: "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
1203
+ }
1204
+ });
1205
+
1206
+ const drawer = ct({
1207
+ parts: {
1208
+ overlay: "fixed inset-0 bg-elevated/75",
1209
+ content: "fixed bg-default divide-y divide-default flex flex-col focus:outline-none",
1210
+ header: "flex flex-wrap items-center gap-1 p-4 sm:px-6",
1211
+ body: "flex-1 overflow-y-auto p-4 sm:p-6",
1212
+ footer: "flex items-center gap-1 p-4 sm:p-6",
1213
+ title: "flex-grow text-xl text-highlighted font-semibold",
1214
+ description: "w-full text-muted text-sm",
1215
+ close: "ms-auto"
1216
+ },
1217
+ variants: {
1218
+ direction: {
1219
+ top: {
1220
+ content: "inset-x-0 top-0 max-h-full"
1221
+ },
1222
+ right: {
1223
+ content: "right-0 inset-y-0 w-full max-w-md"
1224
+ },
1225
+ bottom: {
1226
+ content: "inset-x-0 bottom-0 max-h-full"
1227
+ },
1228
+ left: {
1229
+ content: "left-0 inset-y-0 w-full max-w-md"
1230
+ }
1231
+ },
1232
+ transition: {
1233
+ true: {
1234
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
1235
+ }
1236
+ },
1237
+ inset: {
1238
+ true: {
1239
+ content: "rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"
1240
+ }
1241
+ }
1242
+ },
1243
+ compoundVariants: [
1244
+ {
1245
+ direction: ["top", "bottom"],
1246
+ class: {
1247
+ content: "h-auto max-h-[96%]"
1248
+ }
1249
+ },
1250
+ {
1251
+ direction: ["left", "right"],
1252
+ class: {
1253
+ content: "w-auto max-w-[calc(100%-2rem)]"
1254
+ }
1255
+ },
1256
+ {
1257
+ direction: "top",
1258
+ inset: true,
1259
+ class: {
1260
+ content: "inset-x-4 top-4"
1261
+ }
1262
+ },
1263
+ {
1264
+ direction: "top",
1265
+ inset: false,
1266
+ class: {
1267
+ content: "inset-x-0 top-0 rounded-b-lg"
1268
+ }
1269
+ },
1270
+ {
1271
+ direction: ["top"],
1272
+ transition: true,
1273
+ class: {
1274
+ content: "data-[state=open]:animate-[slide-in-from-top_500ms_cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-[slide-out-to-top_500ms_cubic-bezier(0.32,0.72,0,1)]"
1275
+ }
1276
+ },
1277
+ {
1278
+ direction: "bottom",
1279
+ inset: true,
1280
+ class: {
1281
+ content: "inset-x-4 bottom-4"
1282
+ }
1283
+ },
1284
+ {
1285
+ direction: "bottom",
1286
+ inset: false,
1287
+ class: {
1288
+ content: "inset-x-0 bottom-0 rounded-t-lg"
1289
+ }
1290
+ },
1291
+ {
1292
+ direction: ["bottom"],
1293
+ transition: true,
1294
+ class: {
1295
+ content: "data-[state=open]:animate-[slide-in-from-bottom_500ms_cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-[slide-out-to-bottom_500ms_cubic-bezier(0.32,0.72,0,1)]"
1296
+ }
1297
+ },
1298
+ {
1299
+ direction: "left",
1300
+ inset: true,
1301
+ class: {
1302
+ content: "inset-y-4 left-4"
1303
+ }
1304
+ },
1305
+ {
1306
+ direction: "left",
1307
+ inset: false,
1308
+ class: {
1309
+ content: "inset-y-0 left-0 rounded-r-lg"
1310
+ }
1311
+ },
1312
+ {
1313
+ direction: ["left"],
1314
+ transition: true,
1315
+ class: {
1316
+ content: "data-[state=open]:animate-[slide-in-from-left_500ms_cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-[slide-out-to-left_500ms_cubic-bezier(0.32,0.72,0,1)]"
1317
+ }
1318
+ },
1319
+ {
1320
+ direction: "right",
1321
+ inset: true,
1322
+ class: {
1323
+ content: "inset-y-4 right-4"
1324
+ }
1325
+ },
1326
+ {
1327
+ direction: "right",
1328
+ inset: false,
1329
+ class: {
1330
+ content: "inset-y-0 right-0 rounded-l-lg"
1331
+ }
1332
+ },
1333
+ {
1334
+ direction: ["right"],
1335
+ transition: true,
1336
+ class: {
1337
+ content: "data-[state=open]:animate-[slide-in-from-right_500ms_cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-[slide-out-to-right_500ms_cubic-bezier(0.32,0.72,0,1)]"
1338
+ }
1339
+ }
1340
+ ]
1341
+ });
1342
+
1343
+ const dropdownMenu = (options) => ct({
1344
+ parts: {
1345
+ content: "min-w-32 bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-[--reka-dropdown-menu-content-transform-origin] flex flex-col",
1346
+ viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",
1347
+ arrow: "fill-default",
1348
+ group: "p-1 isolate",
1349
+ label: "w-full flex items-center font-semibold text-highlighted",
1350
+ separator: "-mx-1 my-1 h-px bg-border",
1351
+ item: "group relative w-full flex items-start select-none outline-none before:content-empty before:absolute before:z-[-1] before:inset-px before:rounded-md data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
1352
+ itemLeadingIcon: "shrink-0",
1353
+ itemLeadingAvatar: "shrink-0",
1354
+ itemLeadingAvatarSize: "",
1355
+ itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
1356
+ itemTrailingIcon: "shrink-0",
1357
+ itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
1358
+ itemTrailingKbdsSize: "",
1359
+ itemWrapper: "flex-1 flex flex-col items-start min-w-0",
1360
+ itemLabel: "truncate",
1361
+ itemDescription: "truncate text-muted",
1362
+ itemLabelExternalIcon: "inline-block size-3 align-top text-dimmed"
1363
+ },
1364
+ variants: {
1365
+ color: {
1366
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1367
+ neutral: ""
1368
+ },
1369
+ active: {
1370
+ true: {
1371
+ item: "text-highlighted before:bg-elevated",
1372
+ itemLeadingIcon: "text-default"
1373
+ },
1374
+ false: {
1375
+ item: [
1376
+ "text-default data-[highlighted]:text-highlighted data-[state=open]:text-highlighted data-[highlighted]:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50",
1377
+ options.theme.transitions && "transition-colors before:transition-colors"
1378
+ ],
1379
+ itemLeadingIcon: [
1380
+ "text-dimmed group-data-[highlighted]:text-default group-data-[state=open]:text-default",
1381
+ options.theme.transitions && "transition-colors"
1382
+ ]
1383
+ }
1384
+ },
1385
+ loading: {
1386
+ true: {
1387
+ itemLeadingIcon: "animate-spin"
1388
+ }
1389
+ },
1390
+ size: {
1391
+ xs: {
1392
+ label: "p-1 text-xs gap-1",
1393
+ item: "p-1 text-xs gap-1",
1394
+ itemLeadingIcon: "size-4",
1395
+ itemLeadingAvatarSize: "3xs",
1396
+ itemTrailingIcon: "size-4",
1397
+ itemTrailingKbds: "gap-0.5",
1398
+ itemTrailingKbdsSize: "sm"
1399
+ },
1400
+ sm: {
1401
+ label: "p-1.5 text-xs gap-1.5",
1402
+ item: "p-1.5 text-xs gap-1.5",
1403
+ itemLeadingIcon: "size-4",
1404
+ itemLeadingAvatarSize: "3xs",
1405
+ itemTrailingIcon: "size-4",
1406
+ itemTrailingKbds: "gap-0.5",
1407
+ itemTrailingKbdsSize: "sm"
1408
+ },
1409
+ md: {
1410
+ label: "p-1.5 text-sm gap-1.5",
1411
+ item: "p-1.5 text-sm gap-1.5",
1412
+ itemLeadingIcon: "size-5",
1413
+ itemLeadingAvatarSize: "2xs",
1414
+ itemTrailingIcon: "size-5",
1415
+ itemTrailingKbds: "gap-0.5",
1416
+ itemTrailingKbdsSize: "md"
1417
+ },
1418
+ lg: {
1419
+ label: "p-2 text-sm gap-2",
1420
+ item: "p-2 text-sm gap-2",
1421
+ itemLeadingIcon: "size-5",
1422
+ itemLeadingAvatarSize: "2xs",
1423
+ itemTrailingIcon: "size-5",
1424
+ itemTrailingKbds: "gap-1",
1425
+ itemTrailingKbdsSize: "md"
1426
+ },
1427
+ xl: {
1428
+ label: "p-2 text-base gap-2",
1429
+ item: "p-2 text-base gap-2",
1430
+ itemLeadingIcon: "size-6",
1431
+ itemLeadingAvatarSize: "xs",
1432
+ itemTrailingIcon: "size-6",
1433
+ itemTrailingKbds: "gap-1",
1434
+ itemTrailingKbdsSize: "lg"
1435
+ }
1436
+ }
1437
+ },
1438
+ compoundVariants: [
1439
+ ...(options.theme.colors || []).map((color) => ({
1440
+ color,
1441
+ active: false,
1442
+ class: {
1443
+ item: `text-${color} data-[highlighted]:text-${color} data-[highlighted]:before:bg-${color}/10 data-[state=open]:before:bg-${color}/10`,
1444
+ itemLeadingIcon: `text-${color}/75 group-data-[highlighted]:text-${color} group-data-[state=open]:text-${color}`
1445
+ }
1446
+ })),
1447
+ ...(options.theme.colors || []).map((color) => ({
1448
+ color,
1449
+ active: true,
1450
+ class: {
1451
+ item: `text-${color} before:bg-${color}/10`,
1452
+ itemLeadingIcon: `text-${color}`
1453
+ }
1454
+ }))
1455
+ ],
1456
+ defaultVariants: {
1457
+ size: "md"
1458
+ }
1459
+ });
1460
+
1461
+ const form = ct({
1462
+ base: ""
1463
+ });
1464
+
1465
+ const formField = ct({
1466
+ parts: {
1467
+ root: "",
1468
+ wrapper: "",
1469
+ labelWrapper: "flex content-center items-center justify-between",
1470
+ label: "block font-medium text-default",
1471
+ container: "mt-1 relative",
1472
+ description: "text-muted",
1473
+ error: "mt-2 text-error",
1474
+ hint: "text-muted",
1475
+ help: "mt-2 text-muted"
1476
+ },
1477
+ variants: {
1478
+ size: {
1479
+ xs: { root: "text-xs" },
1480
+ sm: { root: "text-xs" },
1481
+ md: { root: "text-sm" },
1482
+ lg: { root: "text-sm" },
1483
+ xl: { root: "text-base" }
1484
+ },
1485
+ required: {
1486
+ true: {
1487
+ label: `after:content-['*'] after:ms-0.5 after:text-error`
1488
+ }
1489
+ }
1490
+ },
1491
+ defaultVariants: {
1492
+ size: "md"
1493
+ }
1494
+ });
1495
+
1496
+ const inputTheme = (options) => ct({
1497
+ parts: {
1498
+ root: "relative inline-flex items-center",
1499
+ base: [
1500
+ "w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75",
1501
+ options.theme.transitions && "transition-colors"
1502
+ ],
1503
+ leading: "absolute inset-y-0 start-0 flex items-center",
1504
+ leadingIcon: "shrink-0 text-dimmed",
1505
+ leadingAvatar: "shrink-0",
1506
+ leadingAvatarSize: "",
1507
+ trailing: "absolute inset-y-0 end-0 flex items-center",
1508
+ trailingIcon: "shrink-0 text-dimmed"
1509
+ },
1510
+ variants: {
1511
+ ...fieldGroupVariantWithRoot,
1512
+ size: {
1513
+ xs: {
1514
+ base: "px-2 py-1 text-xs gap-1",
1515
+ leading: "ps-2",
1516
+ trailing: "pe-2",
1517
+ leadingIcon: "size-4",
1518
+ leadingAvatarSize: "3xs",
1519
+ trailingIcon: "size-4"
1520
+ },
1521
+ sm: {
1522
+ base: "px-2.5 py-1.5 text-xs gap-1.5",
1523
+ leading: "ps-2.5",
1524
+ trailing: "pe-2.5",
1525
+ leadingIcon: "size-4",
1526
+ leadingAvatarSize: "3xs",
1527
+ trailingIcon: "size-4"
1528
+ },
1529
+ md: {
1530
+ base: "px-2.5 py-1.5 text-sm gap-1.5",
1531
+ leading: "ps-2.5",
1532
+ trailing: "pe-2.5",
1533
+ leadingIcon: "size-5",
1534
+ leadingAvatarSize: "2xs",
1535
+ trailingIcon: "size-5"
1536
+ },
1537
+ lg: {
1538
+ base: "px-3 py-2 text-sm gap-2",
1539
+ leading: "ps-3",
1540
+ trailing: "pe-3",
1541
+ leadingIcon: "size-5",
1542
+ leadingAvatarSize: "2xs",
1543
+ trailingIcon: "size-5"
1544
+ },
1545
+ xl: {
1546
+ base: "px-3 py-2 text-base gap-2",
1547
+ leading: "ps-3",
1548
+ trailing: "pe-3",
1549
+ leadingIcon: "size-6",
1550
+ leadingAvatarSize: "xs",
1551
+ trailingIcon: "size-6"
1552
+ }
1553
+ },
1554
+ variant: {
1555
+ outline: { base: "text-highlighted bg-default ring ring-inset ring-accented" },
1556
+ soft: { base: "text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50" },
1557
+ subtle: { base: "text-highlighted bg-elevated ring ring-inset ring-accented" },
1558
+ ghost: { base: "text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent" },
1559
+ none: { base: "text-highlighted bg-transparent" }
1560
+ },
1561
+ color: {
1562
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1563
+ neutral: ""
1564
+ },
1565
+ leading: {
1566
+ true: ""
1567
+ },
1568
+ trailing: {
1569
+ true: ""
1570
+ },
1571
+ loading: {
1572
+ true: ""
1573
+ },
1574
+ highlight: {
1575
+ true: ""
1576
+ },
1577
+ type: {
1578
+ file: { base: "file:me-1.5 file:font-medium file:text-muted file:outline-none" }
1579
+ }
1580
+ },
1581
+ compoundVariants: [
1582
+ ...(options.theme.colors || []).map((color) => ({
1583
+ color,
1584
+ variant: ["outline", "subtle"],
1585
+ class: { base: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}` }
1586
+ })),
1587
+ ...(options.theme.colors || []).map((color) => ({
1588
+ color,
1589
+ highlight: true,
1590
+ class: { base: `ring ring-inset ring-${color}` }
1591
+ })),
1592
+ {
1593
+ color: "neutral",
1594
+ variant: ["outline", "subtle"],
1595
+ class: { base: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted" }
1596
+ },
1597
+ {
1598
+ color: "neutral",
1599
+ highlight: true,
1600
+ class: { base: "ring ring-inset ring-inverted" }
1601
+ },
1602
+ {
1603
+ leading: true,
1604
+ size: "xs",
1605
+ class: { base: "ps-7" }
1606
+ },
1607
+ {
1608
+ leading: true,
1609
+ size: "sm",
1610
+ class: { base: "ps-8" }
1611
+ },
1612
+ {
1613
+ leading: true,
1614
+ size: "md",
1615
+ class: { base: "ps-9" }
1616
+ },
1617
+ {
1618
+ leading: true,
1619
+ size: "lg",
1620
+ class: { base: "ps-10" }
1621
+ },
1622
+ {
1623
+ leading: true,
1624
+ size: "xl",
1625
+ class: { base: "ps-11" }
1626
+ },
1627
+ {
1628
+ trailing: true,
1629
+ size: "xs",
1630
+ class: { base: "pe-7" }
1631
+ },
1632
+ {
1633
+ trailing: true,
1634
+ size: "sm",
1635
+ class: { base: "pe-8" }
1636
+ },
1637
+ {
1638
+ trailing: true,
1639
+ size: "md",
1640
+ class: { base: "pe-9" }
1641
+ },
1642
+ {
1643
+ trailing: true,
1644
+ size: "lg",
1645
+ class: { base: "pe-10" }
1646
+ },
1647
+ {
1648
+ trailing: true,
1649
+ size: "xl",
1650
+ class: { base: "pe-11" }
1651
+ },
1652
+ {
1653
+ loading: true,
1654
+ leading: true,
1655
+ class: {
1656
+ leadingIcon: "animate-spin"
1657
+ }
1658
+ },
1659
+ {
1660
+ loading: true,
1661
+ leading: false,
1662
+ trailing: true,
1663
+ class: {
1664
+ trailingIcon: "animate-spin"
1665
+ }
1666
+ }
1667
+ ],
1668
+ defaultVariants: {
1669
+ size: "md",
1670
+ color: "primary",
1671
+ variant: "outline"
1672
+ }
1673
+ });
1674
+
1675
+ const inputNumber = (options) => {
1676
+ const input = inputTheme(options);
1677
+ return ct({
1678
+ parts: {
1679
+ root: "relative inline-flex items-center",
1680
+ base: [
1681
+ "w-full rounded-md border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75",
1682
+ options.theme.transitions && "transition-colors"
1683
+ ],
1684
+ increment: "absolute flex items-center",
1685
+ decrement: "absolute flex items-center"
1686
+ },
1687
+ variants: {
1688
+ ...fieldGroupVariantWithRoot,
1689
+ color: {
1690
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1691
+ neutral: ""
1692
+ },
1693
+ size: {
1694
+ xs: { base: "px-2 py-1 text-xs gap-1" },
1695
+ sm: { base: "px-2.5 py-1.5 text-xs gap-1.5" },
1696
+ md: { base: "px-2.5 py-1.5 text-sm gap-1.5" },
1697
+ lg: { base: "px-3 py-2 text-sm gap-2" },
1698
+ xl: { base: "px-3 py-2 text-base gap-2" }
1699
+ },
1700
+ variant: {
1701
+ ...input.variants.variant
1702
+ },
1703
+ disabled: {
1704
+ true: {
1705
+ increment: "opacity-75 cursor-not-allowed",
1706
+ decrement: "opacity-75 cursor-not-allowed"
1707
+ }
1708
+ },
1709
+ orientation: {
1710
+ horizontal: {
1711
+ base: "text-center",
1712
+ increment: "inset-y-0 end-0 pe-1",
1713
+ decrement: "inset-y-0 start-0 ps-1"
1714
+ },
1715
+ vertical: {
1716
+ increment: "top-0 end-0 pe-1 [&>button]:py-0 scale-80",
1717
+ decrement: "bottom-0 end-0 pe-1 [&>button]:py-0 scale-80"
1718
+ }
1719
+ },
1720
+ highlight: {
1721
+ true: ""
1722
+ },
1723
+ increment: {
1724
+ false: ""
1725
+ },
1726
+ decrement: {
1727
+ false: ""
1728
+ }
1729
+ },
1730
+ compoundVariants: [
1731
+ ...(options.theme.colors || []).map((color) => ({
1732
+ color,
1733
+ variant: ["outline", "subtle"],
1734
+ class: { base: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}` }
1735
+ })),
1736
+ ...(options.theme.colors || []).map((color) => ({
1737
+ color,
1738
+ highlight: true,
1739
+ class: { base: `ring ring-inset ring-${color}` }
1740
+ })),
1741
+ {
1742
+ color: "neutral",
1743
+ variant: ["outline", "subtle"],
1744
+ class: { base: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted" }
1745
+ },
1746
+ {
1747
+ color: "neutral",
1748
+ highlight: true,
1749
+ class: { base: "ring ring-inset ring-inverted" }
1750
+ },
1751
+ {
1752
+ orientation: "horizontal",
1753
+ decrement: false,
1754
+ class: { base: "text-start" }
1755
+ },
1756
+ {
1757
+ decrement: true,
1758
+ size: "xs",
1759
+ class: { base: "ps-7" }
1760
+ },
1761
+ {
1762
+ decrement: true,
1763
+ size: "sm",
1764
+ class: { base: "ps-8" }
1765
+ },
1766
+ {
1767
+ decrement: true,
1768
+ size: "md",
1769
+ class: { base: "ps-9" }
1770
+ },
1771
+ {
1772
+ decrement: true,
1773
+ size: "lg",
1774
+ class: { base: "ps-10" }
1775
+ },
1776
+ {
1777
+ decrement: true,
1778
+ size: "xl",
1779
+ class: { base: "ps-11" }
1780
+ },
1781
+ {
1782
+ increment: true,
1783
+ size: "xs",
1784
+ class: { base: "pe-7" }
1785
+ },
1786
+ {
1787
+ increment: true,
1788
+ size: "sm",
1789
+ class: { base: "pe-8" }
1790
+ },
1791
+ {
1792
+ increment: true,
1793
+ size: "md",
1794
+ class: { base: "pe-9" }
1795
+ },
1796
+ {
1797
+ increment: true,
1798
+ size: "lg",
1799
+ class: { base: "pe-10" }
1800
+ },
1801
+ {
1802
+ increment: true,
1803
+ size: "xl",
1804
+ class: { base: "pe-11" }
1805
+ }
1806
+ ],
1807
+ defaultVariants: {
1808
+ size: "md",
1809
+ color: "primary",
1810
+ variant: "outline"
1811
+ }
1812
+ });
1813
+ };
1814
+
1815
+ const inputTags = (options) => {
1816
+ const input = inputTheme(options);
1817
+ return ct({
1818
+ ...input,
1819
+ parts: {
1820
+ ...input.parts,
1821
+ root: [input.parts.root, "flex-wrap"],
1822
+ base: [
1823
+ "rounded-md",
1824
+ options.theme.transitions && "transition-colors"
1825
+ ],
1826
+ item: "px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75 wrap-anywhere data-[state=active]:bg-accented",
1827
+ itemText: "",
1828
+ itemDelete: [
1829
+ "inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none",
1830
+ options.theme.transitions && "transition-colors"
1831
+ ],
1832
+ itemDeleteIcon: "shrink-0",
1833
+ input: "flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1834
+ },
1835
+ variants: {
1836
+ ...input.variants,
1837
+ size: {
1838
+ xs: {
1839
+ ...input.variants.size.xs,
1840
+ item: "text-2.5/3",
1841
+ itemDeleteIcon: "size-3"
1842
+ },
1843
+ sm: {
1844
+ ...input.variants.size.sm,
1845
+ item: "text-2.5/3",
1846
+ itemDeleteIcon: "size-3"
1847
+ },
1848
+ md: {
1849
+ ...input.variants.size.md,
1850
+ item: "text-3/4",
1851
+ itemDeleteIcon: "size-3.5"
1852
+ },
1853
+ lg: {
1854
+ ...input.variants.size.lg,
1855
+ item: "text-3/4",
1856
+ itemDeleteIcon: "size-3.5"
1857
+ },
1858
+ xl: {
1859
+ ...input.variants.size.xl,
1860
+ item: "text-3.5/5",
1861
+ itemDeleteIcon: "size-4"
1862
+ }
1863
+ },
1864
+ variant: {
1865
+ ...Object.fromEntries(Object.entries(input.variants.variant).map(([key, value]) => [key, { ...value, base: replaceFocus(value.base) }]))
1866
+ }
1867
+ },
1868
+ compoundVariants: [
1869
+ ...input.compoundVariants.map((item) => ({
1870
+ ...item,
1871
+ class: typeof item.class.base === "string" ? { ...item.class, base: replaceFocus(item.class.base) } : item.class
1872
+ }))
1873
+ ]
1874
+ });
1875
+ };
1876
+ function replaceFocus(str) {
1877
+ return str.replace(/focus:/g, "has-focus:").replace(/focus-visible:/g, "has-focus-visible:");
1878
+ }
1879
+
1880
+ const kbd = (options) => ct({
1881
+ base: "inline-flex items-center justify-center p-1 rounded-sm font-medium font-sans",
1882
+ variants: {
1883
+ color: {
1884
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1885
+ neutral: ""
1886
+ },
1887
+ variant: {
1888
+ solid: "",
1889
+ outline: "",
1890
+ soft: "",
1891
+ subtle: ""
1892
+ },
1893
+ size: {
1894
+ sm: "h-4 min-w-4 text-2",
1895
+ md: "h-5 min-w-5 text-3",
1896
+ lg: "h-6 min-w-6 text-4"
1897
+ }
1898
+ },
1899
+ compoundVariants: [
1900
+ ...(options.theme.colors || []).map((color) => ({
1901
+ color,
1902
+ variant: "solid",
1903
+ class: `text-inverted bg-${color}`
1904
+ })),
1905
+ ...(options.theme.colors || []).map((color) => ({
1906
+ color,
1907
+ variant: "outline",
1908
+ class: `ring ring-inset ring-${color}/50 text-${color}`
1909
+ })),
1910
+ ...(options.theme.colors || []).map((color) => ({
1911
+ color,
1912
+ variant: "soft",
1913
+ class: `text-${color} bg-${color}/10`
1914
+ })),
1915
+ ...(options.theme.colors || []).map((color) => ({
1916
+ color,
1917
+ variant: "subtle",
1918
+ class: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10`
1919
+ })),
1920
+ {
1921
+ color: "neutral",
1922
+ variant: "solid",
1923
+ class: "text-inverted bg-inverted"
1924
+ },
1925
+ {
1926
+ color: "neutral",
1927
+ variant: "outline",
1928
+ class: "ring ring-inset ring-accented text-default bg-default"
1929
+ },
1930
+ {
1931
+ color: "neutral",
1932
+ variant: "soft",
1933
+ class: "text-default bg-elevated"
1934
+ },
1935
+ {
1936
+ color: "neutral",
1937
+ variant: "subtle",
1938
+ class: "ring ring-inset ring-accented text-default bg-elevated"
1939
+ }
1940
+ ],
1941
+ defaultVariants: {
1942
+ variant: "outline",
1943
+ color: "neutral",
1944
+ size: "md"
1945
+ }
1946
+ });
1947
+
1948
+ const link = (options) => ct({
1949
+ base: "focus-visible:outline-primary",
1950
+ variants: {
1951
+ active: {
1952
+ true: "text-primary",
1953
+ false: "text-muted"
1954
+ },
1955
+ disabled: {
1956
+ true: "cursor-not-allowed opacity-75"
1957
+ }
1958
+ },
1959
+ compoundVariants: [
1960
+ {
1961
+ active: false,
1962
+ disabled: false,
1963
+ class: [
1964
+ "hover:text-default",
1965
+ options.theme.transitions && "transition-colors"
1966
+ ]
1967
+ }
1968
+ ]
1969
+ });
1970
+
1971
+ const marquee = ct({
1972
+ parts: {
1973
+ root: "group relative flex items-center overflow-hidden gap-[--gap] [--gap:--spacing(16)] [--duration:20s]",
1974
+ content: "flex items-center shrink-0 justify-around gap-[--gap] min-w-max"
1975
+ },
1976
+ variants: {
1977
+ orientation: {
1978
+ horizontal: {
1979
+ content: "w-full"
1980
+ },
1981
+ vertical: {
1982
+ content: "h-full"
1983
+ }
1984
+ },
1985
+ pauseOnHover: {
1986
+ true: {
1987
+ content: "group-hover:[animation-play-state:paused]"
1988
+ }
1989
+ },
1990
+ reverse: {
1991
+ true: {
1992
+ content: "![animation-direction:reverse]"
1993
+ }
1994
+ },
1995
+ overlay: {
1996
+ true: {
1997
+ root: "before:absolute before:pointer-events-none before:content-empty before:z-2 before:from-[--ui-bg] before:to-transparent after:absolute after:pointer-events-none after:content-empty after:z-2 after:from-[--ui-bg] after:to-transparent"
1998
+ }
1999
+ }
2000
+ },
2001
+ compoundVariants: [
2002
+ {
2003
+ orientation: "horizontal",
2004
+ class: {
2005
+ root: "flex-row",
2006
+ content: "flex-row animate-[marquee_var(--duration)_linear_infinite] rtl:animate-[marquee-rtl_var(--duration)_linear_infinite] backface-hidden"
2007
+ }
2008
+ },
2009
+ {
2010
+ orientation: "horizontal",
2011
+ overlay: true,
2012
+ class: {
2013
+ root: "before:inset-y-0 before:left-0 before:h-full before:w-1/3 before:bg-gradient-to-r after:inset-y-0 after:right-0 after:h-full after:w-1/3 after:bg-gradient-to-l backface-hidden"
2014
+ }
2015
+ },
2016
+ {
2017
+ orientation: "vertical",
2018
+ class: {
2019
+ root: "flex-col",
2020
+ content: "flex-col animate-[marquee-vertical_var(--duration)_linear_infinite] rtl:animate-[marquee-vertical-rtl_var(--duration)_linear_infinite] h-[fit-content] backface-hidden"
2021
+ }
2022
+ },
2023
+ {
2024
+ orientation: "vertical",
2025
+ overlay: true,
2026
+ class: {
2027
+ root: "before:inset-x-0 before:top-0 before:w-full before:h-1/3 before:bg-gradient-to-b after:inset-x-0 after:bottom-0 after:w-full after:h-1/3 after:bg-gradient-to-t backface-hidden"
2028
+ }
2029
+ }
2030
+ ]
2031
+ });
2032
+
2033
+ const modal = ct({
2034
+ parts: {
2035
+ overlay: "fixed inset-0 bg-elevated/75",
2036
+ content: "fixed bg-default divide-y divide-default flex flex-col focus:outline-none",
2037
+ header: "flex flex-wrap items-center gap-1 p-4 sm:px-6",
2038
+ body: "flex-1 overflow-y-auto p-4 sm:p-6",
2039
+ footer: "flex items-center gap-1 p-4 sm:px-6",
2040
+ title: "flex-grow text-xl text-highlighted font-semibold",
2041
+ description: "w-full text-muted text-sm",
2042
+ close: "ms-auto"
2043
+ },
2044
+ variants: {
2045
+ transition: {
2046
+ true: {
2047
+ overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",
2048
+ content: "data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"
2049
+ }
2050
+ },
2051
+ fullscreen: {
2052
+ true: {
2053
+ content: "inset-0"
2054
+ },
2055
+ false: {
2056
+ content: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-2rem)] max-w-lg max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] rounded-lg shadow-lg ring ring-default overflow-hidden"
2057
+ }
2058
+ }
2059
+ }
2060
+ });
2061
+
2062
+ const navigationMenu = (options) => ct({
2063
+ parts: {
2064
+ root: "relative flex gap-1.5 [&>div]:min-w-0",
2065
+ list: "isolate min-w-0",
2066
+ label: "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",
2067
+ item: "min-w-0",
2068
+ link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:content-empty before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2069
+ linkLeadingIcon: "shrink-0 size-5",
2070
+ linkLeadingAvatar: "shrink-0",
2071
+ linkLeadingAvatarSize: "2xs",
2072
+ linkTrailing: "group ms-auto inline-flex gap-1.5 items-center",
2073
+ linkTrailingBadge: "shrink-0",
2074
+ linkTrailingBadgeSize: "sm",
2075
+ linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
2076
+ linkLabel: "truncate",
2077
+ linkLabelExternalIcon: "inline-block size-3 align-top text-dimmed",
2078
+ childList: "isolate",
2079
+ childLabel: "text-xs text-highlighted",
2080
+ childItem: "",
2081
+ childLink: "group relative size-full flex items-start text-start text-sm before:content-empty before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
2082
+ childLinkWrapper: "min-w-0",
2083
+ childLinkIcon: "size-5 shrink-0",
2084
+ childLinkLabel: "truncate",
2085
+ childLinkLabelExternalIcon: "inline-block size-3 align-top text-dimmed",
2086
+ childLinkDescription: "text-muted",
2087
+ separator: "px-2 h-px bg-border",
2088
+ viewportWrapper: "absolute top-full left-0 flex w-full",
2089
+ viewport: "relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-[--reka-navigation-menu-viewport-height] w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] z-[1]",
2090
+ content: "",
2091
+ indicator: "absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[2] w-[--reka-navigation-menu-indicator-size] translate-x-[--reka-navigation-menu-indicator-position] flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",
2092
+ arrow: "relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-[1] rounded-xs"
2093
+ },
2094
+ variants: {
2095
+ color: {
2096
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2097
+ link: `focus-visible:before:ring-${color}`,
2098
+ childLink: `focus-visible:before:ring-${color}`
2099
+ }])),
2100
+ neutral: {
2101
+ link: "focus-visible:before:ring-inverted",
2102
+ childLink: "focus-visible:before:ring-inverted"
2103
+ }
2104
+ },
2105
+ highlightColor: {
2106
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2107
+ neutral: ""
2108
+ },
2109
+ variant: {
2110
+ pill: "",
2111
+ link: ""
2112
+ },
2113
+ orientation: {
2114
+ horizontal: {
2115
+ root: "items-center justify-between",
2116
+ list: "flex items-center",
2117
+ item: "py-2",
2118
+ link: "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
2119
+ childList: "grid p-2",
2120
+ childLink: "px-3 py-2 gap-2 before:inset-x-px before:inset-y-0",
2121
+ childLinkLabel: "font-medium",
2122
+ content: "absolute top-0 left-0 w-full max-h-[70vh] overflow-y-auto"
2123
+ },
2124
+ vertical: {
2125
+ root: "flex-col",
2126
+ link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",
2127
+ childLabel: "px-1.5 py-0.5",
2128
+ childLink: "p-1.5 gap-1.5 before:inset-y-px before:inset-x-0"
2129
+ }
2130
+ },
2131
+ contentOrientation: {
2132
+ horizontal: {
2133
+ viewportWrapper: "justify-center",
2134
+ content: "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]"
2135
+ },
2136
+ vertical: {
2137
+ viewport: "sm:w-[--reka-navigation-menu-viewport-width] left-[--reka-navigation-menu-viewport-left]"
2138
+ }
2139
+ },
2140
+ active: {
2141
+ true: {
2142
+ childLink: "before:bg-elevated text-highlighted",
2143
+ childLinkIcon: "text-default"
2144
+ },
2145
+ false: {
2146
+ link: "text-muted",
2147
+ linkLeadingIcon: "text-dimmed",
2148
+ childLink: [
2149
+ "hover:before:bg-elevated/50 text-default hover:text-highlighted",
2150
+ options.theme.transitions && "transition-colors before:transition-colors"
2151
+ ],
2152
+ childLinkIcon: [
2153
+ "text-dimmed group-hover:text-default",
2154
+ options.theme.transitions && "transition-colors"
2155
+ ]
2156
+ }
2157
+ },
2158
+ disabled: {
2159
+ true: {
2160
+ link: "cursor-not-allowed opacity-75"
2161
+ }
2162
+ },
2163
+ highlight: {
2164
+ true: ""
2165
+ },
2166
+ level: {
2167
+ true: ""
2168
+ },
2169
+ collapsed: {
2170
+ true: ""
2171
+ }
2172
+ },
2173
+ compoundVariants: [
2174
+ {
2175
+ orientation: "horizontal",
2176
+ contentOrientation: "horizontal",
2177
+ class: {
2178
+ childList: "grid-cols-2 gap-2"
2179
+ }
2180
+ },
2181
+ {
2182
+ orientation: "horizontal",
2183
+ contentOrientation: "vertical",
2184
+ class: {
2185
+ childList: "gap-1",
2186
+ content: "w-60"
2187
+ }
2188
+ },
2189
+ {
2190
+ orientation: "vertical",
2191
+ collapsed: false,
2192
+ class: {
2193
+ childList: "ms-5 border-s border-default",
2194
+ childItem: "ps-1.5 -ms-px",
2195
+ content: "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
2196
+ }
2197
+ },
2198
+ {
2199
+ orientation: "vertical",
2200
+ collapsed: true,
2201
+ class: {
2202
+ link: "px-1.5",
2203
+ linkLabel: "hidden",
2204
+ linkTrailing: "hidden",
2205
+ content: "shadow-sm rounded-sm min-h-6 p-1"
2206
+ }
2207
+ },
2208
+ {
2209
+ orientation: "horizontal",
2210
+ highlight: true,
2211
+ class: {
2212
+ link: [
2213
+ "after:content-empty after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full",
2214
+ options.theme.transitions && "after:transition-colors"
2215
+ ]
2216
+ }
2217
+ },
2218
+ {
2219
+ orientation: "vertical",
2220
+ highlight: true,
2221
+ level: true,
2222
+ class: {
2223
+ link: [
2224
+ "after:content-empty after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full",
2225
+ options.theme.transitions && "after:transition-colors"
2226
+ ]
2227
+ }
2228
+ },
2229
+ {
2230
+ disabled: false,
2231
+ active: false,
2232
+ variant: "pill",
2233
+ class: {
2234
+ link: [
2235
+ "hover:text-highlighted hover:before:bg-elevated/50",
2236
+ options.theme.transitions && "transition-colors before:transition-colors"
2237
+ ],
2238
+ linkLeadingIcon: [
2239
+ "group-hover:text-default",
2240
+ options.theme.transitions && "transition-colors"
2241
+ ]
2242
+ }
2243
+ },
2244
+ {
2245
+ disabled: false,
2246
+ active: false,
2247
+ variant: "pill",
2248
+ orientation: "horizontal",
2249
+ class: {
2250
+ link: "data-[state=open]:text-highlighted",
2251
+ linkLeadingIcon: "group-data-[state=open]:text-default"
2252
+ }
2253
+ },
2254
+ {
2255
+ disabled: false,
2256
+ variant: "pill",
2257
+ highlight: true,
2258
+ orientation: "horizontal",
2259
+ class: {
2260
+ link: "data-[state=open]:before:bg-elevated/50"
2261
+ }
2262
+ },
2263
+ {
2264
+ disabled: false,
2265
+ variant: "pill",
2266
+ highlight: false,
2267
+ active: false,
2268
+ orientation: "horizontal",
2269
+ class: {
2270
+ link: "data-[state=open]:before:bg-elevated/50"
2271
+ }
2272
+ },
2273
+ ...(options.theme.colors || []).map((color) => ({
2274
+ color,
2275
+ variant: "pill",
2276
+ active: true,
2277
+ class: {
2278
+ link: `text-${color}`,
2279
+ linkLeadingIcon: `text-${color} group-data-[state=open]:text-${color}`
2280
+ }
2281
+ })),
2282
+ {
2283
+ color: "neutral",
2284
+ variant: "pill",
2285
+ active: true,
2286
+ class: {
2287
+ link: "text-highlighted",
2288
+ linkLeadingIcon: "text-highlighted group-data-[state=open]:text-highlighted"
2289
+ }
2290
+ },
2291
+ {
2292
+ variant: "pill",
2293
+ active: true,
2294
+ highlight: false,
2295
+ class: {
2296
+ link: "before:bg-elevated"
2297
+ }
2298
+ },
2299
+ {
2300
+ variant: "pill",
2301
+ active: true,
2302
+ highlight: true,
2303
+ disabled: false,
2304
+ class: {
2305
+ link: ["hover:before:bg-elevated/50", options.theme.transitions && "before:transition-colors"]
2306
+ }
2307
+ },
2308
+ {
2309
+ disabled: false,
2310
+ active: false,
2311
+ variant: "link",
2312
+ class: {
2313
+ link: ["hover:text-highlighted", options.theme.transitions && "transition-colors"],
2314
+ linkLeadingIcon: ["group-hover:text-default", options.theme.transitions && "transition-colors"]
2315
+ }
2316
+ },
2317
+ {
2318
+ disabled: false,
2319
+ active: false,
2320
+ variant: "link",
2321
+ orientation: "horizontal",
2322
+ class: {
2323
+ link: "data-[state=open]:text-highlighted",
2324
+ linkLeadingIcon: "group-data-[state=open]:text-default"
2325
+ }
2326
+ },
2327
+ ...(options.theme.colors || []).map((color) => ({
2328
+ color,
2329
+ variant: "link",
2330
+ active: true,
2331
+ class: {
2332
+ link: `text-${color}`,
2333
+ linkLeadingIcon: `text-${color} group-data-[state=open]:text-${color}`
2334
+ }
2335
+ })),
2336
+ {
2337
+ color: "neutral",
2338
+ variant: "link",
2339
+ active: true,
2340
+ class: {
2341
+ link: "text-highlighted",
2342
+ linkLeadingIcon: "text-highlighted group-data-[state=open]:text-highlighted"
2343
+ }
2344
+ },
2345
+ ...(options.theme.colors || []).map((highlightColor) => ({
2346
+ highlightColor,
2347
+ highlight: true,
2348
+ level: true,
2349
+ active: true,
2350
+ class: {
2351
+ link: `after:bg-${highlightColor}`
2352
+ }
2353
+ })),
2354
+ {
2355
+ highlightColor: "neutral",
2356
+ highlight: true,
2357
+ level: true,
2358
+ active: true,
2359
+ class: {
2360
+ link: "after:bg-inverted"
2361
+ }
2362
+ }
2363
+ ],
2364
+ defaultVariants: {
2365
+ color: "primary",
2366
+ highlightColor: "primary",
2367
+ variant: "pill"
2368
+ }
2369
+ });
2370
+
2371
+ const pagination = ct({
2372
+ parts: {
2373
+ root: "",
2374
+ list: "flex items-center gap-1",
2375
+ ellipsis: "pointer-events-none",
2376
+ label: "min-w-5 text-center",
2377
+ item: "",
2378
+ first: "",
2379
+ prev: "",
2380
+ next: "",
2381
+ last: ""
2382
+ }
2383
+ });
2384
+
2385
+ const pinInput = (options) => ct({
2386
+ parts: {
2387
+ root: "relative inline-flex items-center gap-1.5",
2388
+ base: [
2389
+ "rounded-md border-0 placeholder:text-dimmed text-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75",
2390
+ options.theme.transitions && "transition-colors"
2391
+ ]
2392
+ },
2393
+ variants: {
2394
+ size: {
2395
+ xs: {
2396
+ base: "size-6 text-xs"
2397
+ },
2398
+ sm: {
2399
+ base: "size-7 text-xs"
2400
+ },
2401
+ md: {
2402
+ base: "size-8 text-sm"
2403
+ },
2404
+ lg: {
2405
+ base: "size-9 text-sm"
2406
+ },
2407
+ xl: {
2408
+ base: "size-10 text-base"
2409
+ }
2410
+ },
2411
+ variant: {
2412
+ outline: {
2413
+ base: "text-highlighted bg-default ring ring-inset ring-accented"
2414
+ },
2415
+ soft: {
2416
+ base: "text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50"
2417
+ },
2418
+ subtle: {
2419
+ base: "text-highlighted bg-elevated ring ring-inset ring-accented"
2420
+ },
2421
+ ghost: {
2422
+ base: "text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent"
2423
+ },
2424
+ none: {
2425
+ base: "text-highlighted bg-transparent"
2426
+ }
2427
+ },
2428
+ color: {
2429
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2430
+ neutral: ""
2431
+ },
2432
+ highlight: {
2433
+ true: ""
2434
+ }
2435
+ },
2436
+ compoundVariants: [
2437
+ ...(options.theme.colors || []).map((color) => ({
2438
+ color,
2439
+ variant: ["outline", "subtle"],
2440
+ class: { base: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}` }
2441
+ })),
2442
+ ...(options.theme.colors || []).map((color) => ({
2443
+ color,
2444
+ highlight: true,
2445
+ class: { base: `ring ring-inset ring-${color}` }
2446
+ })),
2447
+ {
2448
+ color: "neutral",
2449
+ variant: ["outline", "subtle"],
2450
+ class: { base: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted" }
2451
+ },
2452
+ {
2453
+ color: "neutral",
2454
+ highlight: true,
2455
+ class: { base: "ring ring-inset ring-inverted" }
2456
+ }
2457
+ ],
2458
+ defaultVariants: {
2459
+ size: "md",
2460
+ color: "primary",
2461
+ variant: "outline"
2462
+ }
2463
+ });
2464
+
2465
+ const popover = ct({
2466
+ parts: {
2467
+ content: [
2468
+ "z-1 bg-default shadow-lg rounded-md ring ring-default focus:outline-none pointer-events-auto",
2469
+ "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-[--reka-popover-content-transform-origin]"
2470
+ ],
2471
+ arrow: "fill-default"
2472
+ }
2473
+ });
2474
+
2475
+ const progress = (options) => ct({
2476
+ parts: {
2477
+ root: "gap-2",
2478
+ base: "relative overflow-hidden rounded-full bg-accented",
2479
+ indicator: "rounded-full size-full transition-transform duration-200 ease-out",
2480
+ status: "flex text-dimmed transition-[width] duration-200",
2481
+ steps: "grid items-end",
2482
+ step: "truncate text-end row-start-1 col-start-1 transition-opacity"
2483
+ },
2484
+ variants: {
2485
+ animation: {
2486
+ "carousel": "",
2487
+ "carousel-inverse": "",
2488
+ "swing": "",
2489
+ "elastic": ""
2490
+ },
2491
+ color: {
2492
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2493
+ indicator: `bg-${color}`,
2494
+ steps: `text-${color}`
2495
+ }])),
2496
+ neutral: {
2497
+ indicator: "bg-inverted",
2498
+ steps: "text-inverted"
2499
+ }
2500
+ },
2501
+ size: {
2502
+ "2xs": {
2503
+ status: "text-xs",
2504
+ steps: "text-xs"
2505
+ },
2506
+ "xs": {
2507
+ status: "text-xs",
2508
+ steps: "text-xs"
2509
+ },
2510
+ "sm": {
2511
+ status: "text-sm",
2512
+ steps: "text-sm"
2513
+ },
2514
+ "md": {
2515
+ status: "text-sm",
2516
+ steps: "text-sm"
2517
+ },
2518
+ "lg": {
2519
+ status: "text-sm",
2520
+ steps: "text-sm"
2521
+ },
2522
+ "xl": {
2523
+ status: "text-base",
2524
+ steps: "text-base"
2525
+ },
2526
+ "2xl": {
2527
+ status: "text-base",
2528
+ steps: "text-base"
2529
+ }
2530
+ },
2531
+ step: {
2532
+ active: {
2533
+ step: "opacity-100"
2534
+ },
2535
+ first: {
2536
+ step: "opacity-100 text-muted"
2537
+ },
2538
+ other: {
2539
+ step: "opacity-0"
2540
+ },
2541
+ last: {
2542
+ step: ""
2543
+ }
2544
+ },
2545
+ orientation: {
2546
+ horizontal: {
2547
+ root: "w-full flex flex-col",
2548
+ base: "w-full",
2549
+ status: "flex-row items-center justify-end min-w-fit"
2550
+ },
2551
+ vertical: {
2552
+ root: "h-full flex flex-row-reverse",
2553
+ base: "h-full",
2554
+ status: "flex-col justify-end min-h-fit"
2555
+ }
2556
+ },
2557
+ inverted: {
2558
+ true: {
2559
+ status: "self-end"
2560
+ }
2561
+ }
2562
+ },
2563
+ compoundVariants: [
2564
+ {
2565
+ inverted: true,
2566
+ orientation: "horizontal",
2567
+ class: {
2568
+ step: "text-start",
2569
+ status: "flex-row-reverse"
2570
+ }
2571
+ },
2572
+ {
2573
+ inverted: true,
2574
+ orientation: "vertical",
2575
+ class: {
2576
+ steps: "items-start",
2577
+ status: "flex-col-reverse"
2578
+ }
2579
+ },
2580
+ {
2581
+ orientation: "horizontal",
2582
+ size: "2xs",
2583
+ class: { base: "h-px" }
2584
+ },
2585
+ {
2586
+ orientation: "horizontal",
2587
+ size: "xs",
2588
+ class: { base: "h-0.5" }
2589
+ },
2590
+ {
2591
+ orientation: "horizontal",
2592
+ size: "sm",
2593
+ class: { base: "h-1" }
2594
+ },
2595
+ {
2596
+ orientation: "horizontal",
2597
+ size: "md",
2598
+ class: { base: "h-2" }
2599
+ },
2600
+ {
2601
+ orientation: "horizontal",
2602
+ size: "lg",
2603
+ class: { base: "h-3" }
2604
+ },
2605
+ {
2606
+ orientation: "horizontal",
2607
+ size: "xl",
2608
+ class: { base: "h-4" }
2609
+ },
2610
+ {
2611
+ orientation: "horizontal",
2612
+ size: "2xl",
2613
+ class: { base: "h-5" }
2614
+ },
2615
+ {
2616
+ orientation: "vertical",
2617
+ size: "2xs",
2618
+ class: { base: "w-px" }
2619
+ },
2620
+ {
2621
+ orientation: "vertical",
2622
+ size: "xs",
2623
+ class: { base: "w-0.5" }
2624
+ },
2625
+ {
2626
+ orientation: "vertical",
2627
+ size: "sm",
2628
+ class: { base: "w-1" }
2629
+ },
2630
+ {
2631
+ orientation: "vertical",
2632
+ size: "md",
2633
+ class: { base: "w-2" }
2634
+ },
2635
+ {
2636
+ orientation: "vertical",
2637
+ size: "lg",
2638
+ class: { base: "w-3" }
2639
+ },
2640
+ {
2641
+ orientation: "vertical",
2642
+ size: "xl",
2643
+ class: { base: "w-4" }
2644
+ },
2645
+ {
2646
+ orientation: "vertical",
2647
+ size: "2xl",
2648
+ class: { base: "w-5" }
2649
+ },
2650
+ {
2651
+ orientation: "horizontal",
2652
+ animation: "carousel",
2653
+ class: {
2654
+ indicator: "data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-rtl_2s_ease-in-out_infinite]"
2655
+ }
2656
+ },
2657
+ {
2658
+ orientation: "vertical",
2659
+ animation: "carousel",
2660
+ class: {
2661
+ indicator: "data-[state=indeterminate]:animate-[carousel-vertical_2s_ease-in-out_infinite]"
2662
+ }
2663
+ },
2664
+ {
2665
+ orientation: "horizontal",
2666
+ animation: "carousel-inverse",
2667
+ class: {
2668
+ indicator: "data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"
2669
+ }
2670
+ },
2671
+ {
2672
+ orientation: "vertical",
2673
+ animation: "carousel-inverse",
2674
+ class: {
2675
+ indicator: "data-[state=indeterminate]:animate-[carousel-inverse-vertical_2s_ease-in-out_infinite]"
2676
+ }
2677
+ },
2678
+ {
2679
+ orientation: "horizontal",
2680
+ animation: "swing",
2681
+ class: {
2682
+ indicator: "data-[state=indeterminate]:animate-[swing_2s_ease-in-out_infinite]"
2683
+ }
2684
+ },
2685
+ {
2686
+ orientation: "vertical",
2687
+ animation: "swing",
2688
+ class: {
2689
+ indicator: "data-[state=indeterminate]:animate-[swing-vertical_2s_ease-in-out_infinite]"
2690
+ }
2691
+ },
2692
+ {
2693
+ orientation: "horizontal",
2694
+ animation: "elastic",
2695
+ class: {
2696
+ indicator: "data-[state=indeterminate]:animate-[elastic_2s_ease-in-out_infinite]"
2697
+ }
2698
+ },
2699
+ {
2700
+ orientation: "vertical",
2701
+ animation: "elastic",
2702
+ class: {
2703
+ indicator: "data-[state=indeterminate]:animate-[elastic-vertical_2s_ease-in-out_infinite]"
2704
+ }
2705
+ }
2706
+ ],
2707
+ defaultVariants: {
2708
+ animation: "carousel",
2709
+ color: "primary",
2710
+ size: "md"
2711
+ }
2712
+ });
2713
+
2714
+ const radioGroup = (options) => ct({
2715
+ parts: {
2716
+ root: "relative",
2717
+ fieldset: "flex gap-x-2",
2718
+ legend: "mb-1 block font-medium text-default",
2719
+ item: "flex items-start",
2720
+ container: "flex items-center",
2721
+ base: "rounded-full ring ring-inset ring-accented overflow-hidden cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2",
2722
+ indicator: [
2723
+ "flex items-center justify-center size-full rounded-full scale-0 data-[state=checked]:scale-65",
2724
+ options.theme.transitions && "transition-transform"
2725
+ ],
2726
+ wrapper: "w-full",
2727
+ label: "block font-medium text-default cursor-pointer",
2728
+ description: "text-muted"
2729
+ },
2730
+ variants: {
2731
+ color: {
2732
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2733
+ base: `focus-visible:outline-${color} data-[state=checked]:ring-${color}/50`,
2734
+ indicator: `bg-${color}`
2735
+ }])),
2736
+ neutral: {
2737
+ base: "focus-visible:outline-inverted data-[state=checked]:ring-[--ui-text]/50",
2738
+ indicator: "bg-inverted"
2739
+ }
2740
+ },
2741
+ variant: {
2742
+ list: {
2743
+ item: ""
2744
+ },
2745
+ card: {
2746
+ item: "border border-muted rounded-lg"
2747
+ },
2748
+ table: {
2749
+ item: "border border-muted"
2750
+ }
2751
+ },
2752
+ orientation: {
2753
+ horizontal: {
2754
+ fieldset: "flex-row"
2755
+ },
2756
+ vertical: {
2757
+ fieldset: "flex-col"
2758
+ }
2759
+ },
2760
+ indicator: {
2761
+ start: {
2762
+ item: "flex-row",
2763
+ wrapper: "ms-2"
2764
+ },
2765
+ end: {
2766
+ item: "flex-row-reverse",
2767
+ wrapper: "me-2"
2768
+ },
2769
+ hidden: {
2770
+ base: "sr-only",
2771
+ wrapper: "text-center"
2772
+ }
2773
+ },
2774
+ size: {
2775
+ xs: {
2776
+ fieldset: "gap-y-0.5",
2777
+ legend: "text-xs",
2778
+ base: "size-3",
2779
+ item: "text-xs",
2780
+ container: "h-4",
2781
+ indicator: ""
2782
+ },
2783
+ sm: {
2784
+ fieldset: "gap-y-0.5",
2785
+ legend: "text-xs",
2786
+ base: "size-3.5",
2787
+ item: "text-xs",
2788
+ container: "h-4",
2789
+ indicator: ""
2790
+ },
2791
+ md: {
2792
+ fieldset: "gap-y-1",
2793
+ legend: "text-sm",
2794
+ base: "size-4",
2795
+ item: "text-sm",
2796
+ container: "h-5",
2797
+ indicator: ""
2798
+ },
2799
+ lg: {
2800
+ fieldset: "gap-y-1",
2801
+ legend: "text-sm",
2802
+ base: "size-4.5",
2803
+ item: "text-sm",
2804
+ container: "h-5",
2805
+ indicator: ""
2806
+ },
2807
+ xl: {
2808
+ fieldset: "gap-y-1.5",
2809
+ legend: "text-base",
2810
+ base: "size-5",
2811
+ item: "text-base",
2812
+ container: "h-6",
2813
+ indicator: ""
2814
+ }
2815
+ },
2816
+ disabled: {
2817
+ true: {
2818
+ base: "cursor-not-allowed opacity-75",
2819
+ label: "cursor-not-allowed opacity-75",
2820
+ description: "opacity-75"
2821
+ }
2822
+ },
2823
+ required: {
2824
+ true: {
2825
+ legend: `after:content-['*'] after:ms-0.5 after:text-error`
2826
+ }
2827
+ }
2828
+ },
2829
+ compoundVariants: [
2830
+ { variant: ["card", "table"], disabled: true, class: { item: "cursor-not-allowed" } },
2831
+ { variant: ["card", "table"], disabled: false, class: { item: "cursor-pointer" } },
2832
+ { size: "xs", variant: ["card", "table"], class: { item: "p-2.5" } },
2833
+ { size: "sm", variant: ["card", "table"], class: { item: "p-3" } },
2834
+ { size: "md", variant: ["card", "table"], class: { item: "p-3.5" } },
2835
+ { size: "lg", variant: ["card", "table"], class: { item: "p-4" } },
2836
+ { size: "xl", variant: ["card", "table"], class: { item: "p-4.5" } },
2837
+ {
2838
+ orientation: "horizontal",
2839
+ variant: "table",
2840
+ class: {
2841
+ item: "first-of-type:rounded-s-lg last-of-type:rounded-e-lg",
2842
+ fieldset: "gap-0 -space-x-px"
2843
+ }
2844
+ },
2845
+ {
2846
+ orientation: "vertical",
2847
+ variant: "table",
2848
+ class: {
2849
+ item: "first-of-type:rounded-t-lg last-of-type:rounded-b-lg",
2850
+ fieldset: "gap-0 -space-y-px"
2851
+ }
2852
+ },
2853
+ ...(options.theme.colors || []).map((color) => ({
2854
+ color,
2855
+ variant: "card",
2856
+ class: {
2857
+ item: `has-data-[state=checked]:border-${color}`
2858
+ }
2859
+ })),
2860
+ {
2861
+ color: "neutral",
2862
+ variant: "card",
2863
+ class: {
2864
+ item: "has-data-[state=checked]:border-inverted"
2865
+ }
2866
+ },
2867
+ ...(options.theme.colors || []).map((color) => ({
2868
+ color,
2869
+ variant: "table",
2870
+ class: {
2871
+ item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[1]`
2872
+ }
2873
+ })),
2874
+ {
2875
+ color: "neutral",
2876
+ variant: "table",
2877
+ class: {
2878
+ item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[1]"
2879
+ }
2880
+ }
2881
+ ],
2882
+ defaultVariants: {
2883
+ size: "md",
2884
+ color: "primary",
2885
+ variant: "list",
2886
+ orientation: "vertical",
2887
+ indicator: "start"
2888
+ }
2889
+ });
2890
+
2891
+ const scrollArea = ct({
2892
+ parts: {
2893
+ root: "relative overflow-hidden",
2894
+ viewport: "size-full rounded outline-none",
2895
+ scrollbar: [
2896
+ "flex select-none touch-none p-0.5 duration-160 ease-out",
2897
+ "data-[orientation=vertical]:w-3 data-[orientation=vertical]:my-2",
2898
+ "data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:mx-2"
2899
+ ],
2900
+ thumb: [
2901
+ "relative flex-1 bg-[--ui-border-accented] opacity-80 rounded cursor-pointer transition-colors",
2902
+ "hover:bg-[--ui-text-dimmed]",
2903
+ "before:content-empty before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-10 before:min-h-10 "
2904
+ ],
2905
+ corner: ""
2906
+ }
2907
+ });
2908
+
2909
+ const select = (options) => {
2910
+ const input = inputTheme(options);
2911
+ return ct({
2912
+ parts: {
2913
+ ...input.parts,
2914
+ root: void 0,
2915
+ base: [
2916
+ "relative group rounded-md inline-flex items-center focus:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-75",
2917
+ options.theme.transitions && "transition-colors"
2918
+ ],
2919
+ value: "truncate pointer-events-none",
2920
+ placeholder: "truncate text-dimmed",
2921
+ arrow: "fill-default",
2922
+ content: [
2923
+ "z-1 max-h-60 w-[--reka-select-trigger-width] bg-default shadow-lg rounded-md ring ring-default overflow-hidden origin-[--reka-select-content-transform-origin] pointer-events-auto flex flex-col",
2924
+ "data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]"
2925
+ ],
2926
+ viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",
2927
+ group: "p-1 isolate",
2928
+ empty: "text-center text-muted",
2929
+ label: "font-semibold text-highlighted",
2930
+ separator: "-mx-1 my-1 h-px bg-border",
2931
+ item: [
2932
+ "group relative w-full flex items-start select-none outline-none before:content-empty before:absolute before:z-[-1] before:inset-px before:rounded-md cursor-pointer data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75 text-default data-[highlighted]:not-[[data-disabled]]:text-highlighted data-[highlighted]:not-[[data-disabled]]:before:bg-elevated/50",
2933
+ options.theme.transitions && "transition-colors before:transition-colors"
2934
+ ],
2935
+ itemLeadingIcon: [
2936
+ "shrink-0 text-dimmed group-data-[highlighted]:group-not-[[data-disabled]]:text-default group-not-[[data-disabled]]:text-default",
2937
+ options.theme.transitions && "transition-colors"
2938
+ ],
2939
+ itemLeadingAvatar: "shrink-0",
2940
+ itemLeadingAvatarSize: "",
2941
+ itemLeadingChip: "shrink-0",
2942
+ itemLeadingChipSize: "",
2943
+ itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
2944
+ itemTrailingIcon: "shrink-0",
2945
+ itemWrapper: "flex-1 flex flex-col min-w-0",
2946
+ itemLabel: "truncate",
2947
+ itemDescription: "truncate text-muted"
2948
+ },
2949
+ variants: {
2950
+ ...input.variants,
2951
+ ...fieldGroupVariant,
2952
+ size: {
2953
+ xs: {
2954
+ ...input.variants.size.xs,
2955
+ label: "p-1 text-2.5/3 gap-1",
2956
+ item: "p-1 text-xs gap-1",
2957
+ itemLeadingIcon: "size-4",
2958
+ itemLeadingAvatarSize: "3xs",
2959
+ itemLeadingChip: "size-4",
2960
+ itemLeadingChipSize: "sm",
2961
+ itemTrailingIcon: "size-4",
2962
+ empty: "p-1 text-xs"
2963
+ },
2964
+ sm: {
2965
+ ...input.variants.size.sm,
2966
+ label: "p-1.5 text-2.5/3 gap-1.5",
2967
+ item: "p-1.5 text-xs gap-1.5",
2968
+ itemLeadingIcon: "size-4",
2969
+ itemLeadingAvatarSize: "3xs",
2970
+ itemLeadingChip: "size-4",
2971
+ itemLeadingChipSize: "sm",
2972
+ itemTrailingIcon: "size-4",
2973
+ empty: "p-1.5 text-xs"
2974
+ },
2975
+ md: {
2976
+ ...input.variants.size.md,
2977
+ label: "p-1.5 text-3/4 gap-1.5",
2978
+ item: "p-1.5 text-sm gap-1.5",
2979
+ itemLeadingIcon: "size-5",
2980
+ itemLeadingAvatarSize: "2xs",
2981
+ itemLeadingChip: "size-5",
2982
+ itemLeadingChipSize: "md",
2983
+ itemTrailingIcon: "size-5",
2984
+ empty: "p-1.5 text-sm"
2985
+ },
2986
+ lg: {
2987
+ ...input.variants.size.lg,
2988
+ label: "p-2 text-3/4 gap-2",
2989
+ item: "p-2 text-sm gap-2",
2990
+ itemLeadingIcon: "size-5",
2991
+ itemLeadingAvatarSize: "2xs",
2992
+ itemLeadingChip: "size-5",
2993
+ itemLeadingChipSize: "md",
2994
+ itemTrailingIcon: "size-5",
2995
+ empty: "p-2 text-sm"
2996
+ },
2997
+ xl: {
2998
+ ...input.variants.size.xl,
2999
+ label: "p-2 text-3.5/5 gap-2",
3000
+ item: "p-2 text-base gap-2",
3001
+ itemLeadingIcon: "size-6",
3002
+ itemLeadingAvatarSize: "xs",
3003
+ itemLeadingChip: "size-6",
3004
+ itemLeadingChipSize: "lg",
3005
+ itemTrailingIcon: "size-6",
3006
+ empty: "p-2 text-base"
3007
+ }
3008
+ }
3009
+ },
3010
+ compoundVariants: [
3011
+ ...input.compoundVariants.map((item) => {
3012
+ return {
3013
+ ...item,
3014
+ class: {
3015
+ ...item.class,
3016
+ base: typeof item.class.base === "string" ? item.class.base.replace(/focus-visible:/g, "focus:") : item.class.base
3017
+ }
3018
+ };
3019
+ })
3020
+ ],
3021
+ defaultVariants: {
3022
+ ...input.defaultVariants
3023
+ }
3024
+ });
3025
+ };
3026
+
3027
+ const separator = (options) => ct({
3028
+ parts: {
3029
+ root: "flex items-center align-middle text-center",
3030
+ border: "",
3031
+ container: "font-medium text-default flex",
3032
+ icon: "shrink-0 size-5",
3033
+ avatar: "shrink-0",
3034
+ avatarSize: "2xs",
3035
+ label: "text-sm"
3036
+ },
3037
+ variants: {
3038
+ color: {
3039
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-${color}` }])),
3040
+ neutral: { border: "border-default" }
3041
+ },
3042
+ orientation: {
3043
+ horizontal: {
3044
+ root: "w-full flex-row",
3045
+ border: "",
3046
+ container: "mx-3 whitespace-nowrap"
3047
+ },
3048
+ vertical: {
3049
+ root: "h-full flex-col",
3050
+ border: "",
3051
+ container: "my-2"
3052
+ }
3053
+ },
3054
+ start: {
3055
+ true: {
3056
+ border: "flex-grow data-[orientation=horizontal]:w-auto data-[orientation=vertical]:h-auto"
3057
+ }
3058
+ },
3059
+ end: {
3060
+ true: {
3061
+ border: "flex-grow data-[orientation=horizontal]:w-auto data-[orientation=vertical]:h-auto"
3062
+ }
3063
+ },
3064
+ size: {
3065
+ xs: "",
3066
+ sm: "",
3067
+ md: "",
3068
+ lg: "",
3069
+ xl: ""
3070
+ },
3071
+ type: {
3072
+ solid: {
3073
+ border: "border-solid"
3074
+ },
3075
+ dashed: {
3076
+ border: "border-dashed"
3077
+ },
3078
+ dotted: {
3079
+ border: "border-dotted"
3080
+ }
3081
+ }
3082
+ },
3083
+ compoundVariants: [
3084
+ {
3085
+ orientation: "horizontal",
3086
+ start: false,
3087
+ end: false,
3088
+ class: { border: "w-full" }
3089
+ },
3090
+ {
3091
+ orientation: "vertical",
3092
+ start: false,
3093
+ end: false,
3094
+ class: { border: "h-full" }
3095
+ },
3096
+ {
3097
+ orientation: "horizontal",
3098
+ size: "xs",
3099
+ class: { border: "border-t" }
3100
+ },
3101
+ {
3102
+ orientation: "horizontal",
3103
+ size: "sm",
3104
+ class: { border: "border-t-2" }
3105
+ },
3106
+ {
3107
+ orientation: "horizontal",
3108
+ size: "md",
3109
+ class: { border: "border-t-3" }
3110
+ },
3111
+ {
3112
+ orientation: "horizontal",
3113
+ size: "lg",
3114
+ class: { border: "border-t-4" }
3115
+ },
3116
+ {
3117
+ orientation: "horizontal",
3118
+ size: "xl",
3119
+ class: { border: "border-t-5" }
3120
+ },
3121
+ {
3122
+ orientation: "vertical",
3123
+ size: "xs",
3124
+ class: { border: "border-s" }
3125
+ },
3126
+ {
3127
+ orientation: "vertical",
3128
+ size: "sm",
3129
+ class: { border: "border-s-2" }
3130
+ },
3131
+ {
3132
+ orientation: "vertical",
3133
+ size: "md",
3134
+ class: { border: "border-s-3" }
3135
+ },
3136
+ {
3137
+ orientation: "vertical",
3138
+ size: "lg",
3139
+ class: { border: "border-s-4" }
3140
+ },
3141
+ {
3142
+ orientation: "vertical",
3143
+ size: "xl",
3144
+ class: { border: "border-s-5" }
3145
+ }
3146
+ ],
3147
+ defaultVariants: {
3148
+ color: "neutral",
3149
+ size: "xs",
3150
+ type: "solid"
3151
+ }
3152
+ });
3153
+
3154
+ const skeleton = ct({
3155
+ base: "animate-pulse rounded-md bg-elevated"
3156
+ });
3157
+
3158
+ const slider = (options) => ct({
3159
+ parts: {
3160
+ root: "relative flex items-center select-none touch-none",
3161
+ track: "relative bg-accented overflow-hidden rounded-full grow",
3162
+ range: "absolute rounded-full",
3163
+ thumb: "rounded-full ring-2 ring-bg/10 focus-visible:ring-bg focus-visible:outline-2 focus-visible:outline-offset-2"
3164
+ },
3165
+ variants: {
3166
+ color: {
3167
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
3168
+ range: `bg-${color}`,
3169
+ thumb: `bg-${color} focus-visible:outline-${color}`
3170
+ }])),
3171
+ neutral: {
3172
+ range: "bg-inverted",
3173
+ thumb: "bg-inverted focus-visible:outline-inverted"
3174
+ }
3175
+ },
3176
+ size: {
3177
+ xs: {
3178
+ thumb: "size-3"
3179
+ },
3180
+ sm: {
3181
+ thumb: "size-3.5"
3182
+ },
3183
+ md: {
3184
+ thumb: "size-4"
3185
+ },
3186
+ lg: {
3187
+ thumb: "size-4.5"
3188
+ },
3189
+ xl: {
3190
+ thumb: "size-5"
3191
+ }
3192
+ },
3193
+ orientation: {
3194
+ horizontal: {
3195
+ root: "w-full",
3196
+ range: "h-full"
3197
+ },
3198
+ vertical: {
3199
+ root: "flex-col h-full",
3200
+ range: "w-full"
3201
+ }
3202
+ },
3203
+ disabled: {
3204
+ true: {
3205
+ root: "opacity-75 cursor-not-allowed"
3206
+ }
3207
+ }
3208
+ },
3209
+ compoundVariants: [
3210
+ {
3211
+ orientation: "horizontal",
3212
+ size: "xs",
3213
+ class: {
3214
+ track: "h-1.5"
3215
+ }
3216
+ },
3217
+ {
3218
+ orientation: "horizontal",
3219
+ size: "sm",
3220
+ class: {
3221
+ track: "h-1.75"
3222
+ }
3223
+ },
3224
+ {
3225
+ orientation: "horizontal",
3226
+ size: "md",
3227
+ class: {
3228
+ track: "h-2"
3229
+ }
3230
+ },
3231
+ {
3232
+ orientation: "horizontal",
3233
+ size: "lg",
3234
+ class: {
3235
+ track: "h-2.25"
3236
+ }
3237
+ },
3238
+ {
3239
+ orientation: "horizontal",
3240
+ size: "xl",
3241
+ class: {
3242
+ track: "h-2.5"
3243
+ }
3244
+ },
3245
+ {
3246
+ orientation: "vertical",
3247
+ size: "xs",
3248
+ class: {
3249
+ track: "w-1.5"
3250
+ }
3251
+ },
3252
+ {
3253
+ orientation: "vertical",
3254
+ size: "sm",
3255
+ class: {
3256
+ track: "w-1.75"
3257
+ }
3258
+ },
3259
+ {
3260
+ orientation: "vertical",
3261
+ size: "md",
3262
+ class: {
3263
+ track: "w-2"
3264
+ }
3265
+ },
3266
+ {
3267
+ orientation: "vertical",
3268
+ size: "lg",
3269
+ class: {
3270
+ track: "w-2.25"
3271
+ }
3272
+ },
3273
+ {
3274
+ orientation: "vertical",
3275
+ size: "xl",
3276
+ class: {
3277
+ track: "w-2.5"
3278
+ }
3279
+ }
3280
+ ],
3281
+ defaultVariants: {
3282
+ size: "md",
3283
+ color: "primary"
3284
+ }
3285
+ });
3286
+
3287
+ const _switch = (options) => ct({
3288
+ parts: {
3289
+ root: "relative flex items-start",
3290
+ base: [
3291
+ "inline-flex items-center shrink-0 rounded-full border-2 border-transparent cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-accented",
3292
+ options.theme.transitions && "transition-colors duration-200"
3293
+ ],
3294
+ container: "flex items-center",
3295
+ thumb: "group pointer-events-none rounded-full bg-default 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",
3296
+ icon: [
3297
+ "absolute shrink-0 group-data-[state=unchecked]:text-dimmed opacity-0 size-10/12",
3298
+ options.theme.transitions && "transition-[color,opacity] duration-200"
3299
+ ],
3300
+ wrapper: "ms-2",
3301
+ label: "block font-medium text-default cursor-pointer",
3302
+ description: "text-muted"
3303
+ },
3304
+ variants: {
3305
+ color: {
3306
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
3307
+ base: `data-[state=checked]:bg-${color} focus-visible:outline-${color}`,
3308
+ icon: `group-data-[state=checked]:text-${color}`
3309
+ }])),
3310
+ neutral: {
3311
+ base: "data-[state=checked]:bg-inverted focus-visible:outline-inverted",
3312
+ icon: "group-data-[state=checked]:text-highlighted"
3313
+ }
3314
+ },
3315
+ size: {
3316
+ xs: {
3317
+ base: "w-7",
3318
+ container: "h-4",
3319
+ thumb: "size-3 data-[state=checked]:translate-x-3 data-[state=checked]:rtl:-translate-x-3",
3320
+ wrapper: "text-xs"
3321
+ },
3322
+ sm: {
3323
+ base: "w-8",
3324
+ container: "h-4",
3325
+ thumb: "size-3.5 data-[state=checked]:translate-x-3.5 data-[state=checked]:rtl:-translate-x-3.5",
3326
+ wrapper: "text-xs"
3327
+ },
3328
+ md: {
3329
+ base: "w-9",
3330
+ container: "h-5",
3331
+ thumb: "size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4",
3332
+ wrapper: "text-sm"
3333
+ },
3334
+ lg: {
3335
+ base: "w-10",
3336
+ container: "h-5",
3337
+ thumb: "size-4.5 data-[state=checked]:translate-x-4.5 data-[state=checked]:rtl:-translate-x-4.5",
3338
+ wrapper: "text-sm"
3339
+ },
3340
+ xl: {
3341
+ base: "w-11",
3342
+ container: "h-6",
3343
+ thumb: "size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5",
3344
+ wrapper: "text-base"
3345
+ }
3346
+ },
3347
+ checked: {
3348
+ true: {
3349
+ icon: "group-data-[state=checked]:opacity-100"
3350
+ }
3351
+ },
3352
+ unchecked: {
3353
+ true: {
3354
+ icon: "group-data-[state=unchecked]:opacity-100"
3355
+ }
3356
+ },
3357
+ loading: {
3358
+ true: {
3359
+ icon: "animate-spin"
3360
+ }
3361
+ },
3362
+ required: {
3363
+ true: {
3364
+ label: `after:content-['*'] after:ms-0.5 after:text-error`
3365
+ }
3366
+ },
3367
+ disabled: {
3368
+ true: {
3369
+ base: "cursor-not-allowed opacity-75",
3370
+ label: "cursor-not-allowed opacity-75",
3371
+ description: "cursor-not-allowed opacity-75"
3372
+ }
3373
+ }
3374
+ },
3375
+ defaultVariants: {
3376
+ color: "primary",
3377
+ size: "md"
3378
+ }
3379
+ });
3380
+
3381
+ const table = (options) => ct({
3382
+ parts: {
3383
+ root: "relative overflow-auto",
3384
+ base: "min-w-full",
3385
+ caption: "sr-only",
3386
+ thead: "relative",
3387
+ tbody: "isolate [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:focus-visible:outline-primary",
3388
+ tfoot: "relative",
3389
+ tr: "data-[selected=true]:bg-elevated/50",
3390
+ th: "px-4 py-3.5 text-sm text-highlighted text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
3391
+ td: "p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",
3392
+ separator: "absolute z-1 left-0 w-full h-px bg-[--ui-border-accented]",
3393
+ empty: "py-6 text-center text-sm text-muted",
3394
+ loading: "py-6 text-center"
3395
+ },
3396
+ variants: {
3397
+ virtualize: {
3398
+ false: {
3399
+ base: "overflow-clip",
3400
+ tbody: "divide-y divide-default"
3401
+ }
3402
+ },
3403
+ pinned: {
3404
+ true: {
3405
+ th: "sticky bg-default/75 z-1",
3406
+ td: "sticky bg-default/75 z-1"
3407
+ }
3408
+ },
3409
+ sticky: {
3410
+ true: {
3411
+ thead: "sticky top-0 inset-x-0 bg-default/75 z-1 backdrop-blur",
3412
+ tfoot: "sticky bottom-0 inset-x-0 bg-default/75 z-1 backdrop-blur"
3413
+ },
3414
+ header: {
3415
+ thead: "sticky top-0 inset-x-0 bg-default/75 z-1 backdrop-blur"
3416
+ },
3417
+ footer: {
3418
+ tfoot: "sticky bottom-0 inset-x-0 bg-default/75 z-1 backdrop-blur"
3419
+ }
3420
+ },
3421
+ loading: {
3422
+ true: {
3423
+ thead: "after:content-empty after:absolute after:z-1 after:h-px"
3424
+ }
3425
+ },
3426
+ loadingAnimation: {
3427
+ "carousel": "",
3428
+ "carousel-inverse": "",
3429
+ "swing": "",
3430
+ "elastic": ""
3431
+ },
3432
+ loadingColor: {
3433
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
3434
+ neutral: ""
3435
+ }
3436
+ },
3437
+ compoundVariants: [
3438
+ ...(options.theme.colors || []).map((loadingColor) => ({
3439
+ loading: true,
3440
+ loadingColor,
3441
+ class: {
3442
+ thead: `after:bg-${loadingColor}`
3443
+ }
3444
+ })),
3445
+ {
3446
+ loading: true,
3447
+ loadingColor: "neutral",
3448
+ class: {
3449
+ thead: "after:bg-inverted"
3450
+ }
3451
+ },
3452
+ {
3453
+ loading: true,
3454
+ loadingAnimation: "carousel",
3455
+ class: {
3456
+ thead: "after:animate-[carousel_2s_ease-in-out_infinite] rtl:after:animate-[carousel-rtl_2s_ease-in-out_infinite]"
3457
+ }
3458
+ },
3459
+ {
3460
+ loading: true,
3461
+ loadingAnimation: "carousel-inverse",
3462
+ class: {
3463
+ thead: "after:animate-[carousel-inverse_2s_ease-in-out_infinite] rtl:after:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"
3464
+ }
3465
+ },
3466
+ {
3467
+ loading: true,
3468
+ loadingAnimation: "swing",
3469
+ class: {
3470
+ thead: "after:animate-[swing_2s_ease-in-out_infinite]"
3471
+ }
3472
+ },
3473
+ {
3474
+ loading: true,
3475
+ loadingAnimation: "elastic",
3476
+ class: {
3477
+ thead: "after:animate-[elastic_2s_ease-in-out_infinite]"
3478
+ }
3479
+ }
3480
+ ],
3481
+ defaultVariants: {
3482
+ loadingColor: "primary",
3483
+ loadingAnimation: "carousel"
3484
+ }
3485
+ });
3486
+
3487
+ const tabs = (options) => ct({
3488
+ parts: {
3489
+ root: "flex items-center gap-2",
3490
+ list: "relative flex p-1",
3491
+ indicator: "absolute transition duration-200",
3492
+ trigger: [
3493
+ "relative inline-flex items-center min-w-0 font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75",
3494
+ "data-[state=inactive]:text-muted data-[state=inactive]:not-disabled:cursor-pointer hover:data-[state=inactive]:not-disabled:text-default",
3495
+ options.theme.transitions && "transition-colors"
3496
+ ],
3497
+ leadingIcon: "shrink-0",
3498
+ leadingAvatar: "shrink-0",
3499
+ leadingAvatarSize: "",
3500
+ label: "truncate",
3501
+ trailingBadge: "shrink-0",
3502
+ trailingBadgeSize: "sm",
3503
+ content: "focus:outline-none w-full"
3504
+ },
3505
+ variants: {
3506
+ color: {
3507
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
3508
+ neutral: ""
3509
+ },
3510
+ variant: {
3511
+ pill: {
3512
+ list: "bg-elevated rounded-lg",
3513
+ trigger: "grow",
3514
+ indicator: "rounded-md shadow-xs"
3515
+ },
3516
+ link: {
3517
+ list: "border-default",
3518
+ indicator: "rounded-full",
3519
+ trigger: "focus:outline-none"
3520
+ }
3521
+ },
3522
+ orientation: {
3523
+ horizontal: {
3524
+ root: "flex-col",
3525
+ list: "w-full",
3526
+ indicator: "left-0 w-[--reka-tabs-indicator-size] translate-x-[--reka-tabs-indicator-position]",
3527
+ trigger: "justify-center"
3528
+ },
3529
+ vertical: {
3530
+ list: "flex-col",
3531
+ indicator: "top-0 h-[--reka-tabs-indicator-size] translate-y-[--reka-tabs-indicator-position]"
3532
+ }
3533
+ },
3534
+ size: {
3535
+ xs: {
3536
+ trigger: "px-2 py-1 text-xs gap-1",
3537
+ leadingIcon: "size-4",
3538
+ leadingAvatarSize: "3xs"
3539
+ },
3540
+ sm: {
3541
+ trigger: "px-2.5 py-1.5 text-xs gap-1.5",
3542
+ leadingIcon: "size-4",
3543
+ leadingAvatarSize: "3xs"
3544
+ },
3545
+ md: {
3546
+ trigger: "px-3 py-1.5 text-sm gap-1.5",
3547
+ leadingIcon: "size-5",
3548
+ leadingAvatarSize: "2xs"
3549
+ },
3550
+ lg: {
3551
+ trigger: "px-3 py-2 text-sm gap-2",
3552
+ leadingIcon: "size-5",
3553
+ leadingAvatarSize: "2xs"
3554
+ },
3555
+ xl: {
3556
+ trigger: "px-3 py-2 text-base gap-2",
3557
+ leadingIcon: "size-6",
3558
+ leadingAvatarSize: "xs"
3559
+ }
3560
+ }
3561
+ },
3562
+ compoundVariants: [
3563
+ {
3564
+ orientation: "horizontal",
3565
+ variant: "pill",
3566
+ class: {
3567
+ indicator: "inset-y-1"
3568
+ }
3569
+ },
3570
+ {
3571
+ orientation: "horizontal",
3572
+ variant: "link",
3573
+ class: {
3574
+ list: "border-b -mb-px",
3575
+ indicator: "-bottom-px h-px"
3576
+ }
3577
+ },
3578
+ {
3579
+ orientation: "vertical",
3580
+ variant: "pill",
3581
+ class: {
3582
+ indicator: "inset-x-1",
3583
+ list: "items-center"
3584
+ }
3585
+ },
3586
+ {
3587
+ orientation: "vertical",
3588
+ variant: "link",
3589
+ class: {
3590
+ list: "border-s -ms-px",
3591
+ indicator: "-start-px w-px"
3592
+ }
3593
+ },
3594
+ ...(options.theme.colors || []).map((color) => ({
3595
+ color,
3596
+ variant: "pill",
3597
+ class: {
3598
+ indicator: `bg-${color}`,
3599
+ trigger: `data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}`
3600
+ }
3601
+ })),
3602
+ {
3603
+ color: "neutral",
3604
+ variant: "pill",
3605
+ class: {
3606
+ indicator: "bg-inverted",
3607
+ trigger: "data-[state=active]:text-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted"
3608
+ }
3609
+ },
3610
+ ...(options.theme.colors || []).map((color) => ({
3611
+ color,
3612
+ variant: "link",
3613
+ class: {
3614
+ indicator: `bg-${color}`,
3615
+ trigger: `data-[state=active]:text-${color} focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`
3616
+ }
3617
+ })),
3618
+ {
3619
+ color: "neutral",
3620
+ variant: "link",
3621
+ class: {
3622
+ indicator: "bg-inverted",
3623
+ trigger: "data-[state=active]:text-highlighted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"
3624
+ }
3625
+ }
3626
+ ],
3627
+ defaultVariants: {
3628
+ color: "primary",
3629
+ variant: "pill",
3630
+ size: "md"
3631
+ }
3632
+ });
3633
+
3634
+ const textarea = (options) => {
3635
+ const input = inputTheme(options);
3636
+ return ct(defu({
3637
+ parts: {
3638
+ leading: "absolute start-0 flex items-start",
3639
+ trailing: "absolute end-0 flex items-start"
3640
+ },
3641
+ variants: {
3642
+ autoresize: {
3643
+ true: {
3644
+ base: "resize-none"
3645
+ }
3646
+ },
3647
+ size: {
3648
+ xs: {
3649
+ leading: "ps-2 inset-y-1",
3650
+ trailing: "pe-2 inset-y-1"
3651
+ },
3652
+ sm: {
3653
+ leading: "ps-2.5 inset-y-1.5",
3654
+ trailing: "pe-2.5 inset-y-1.5"
3655
+ },
3656
+ md: {
3657
+ leading: "ps-2.5 inset-y-1.5",
3658
+ trailing: "pe-2.5 inset-y-1.5"
3659
+ },
3660
+ lg: {
3661
+ leading: "ps-3 inset-y-2",
3662
+ trailing: "pe-3 inset-y-2"
3663
+ },
3664
+ xl: {
3665
+ leading: "ps-3 inset-y-2",
3666
+ trailing: "pe-3 inset-y-2"
3667
+ }
3668
+ }
3669
+ }
3670
+ }, input));
3671
+ };
3672
+
3673
+ const timeline = (options) => ct({
3674
+ parts: {
3675
+ root: "flex gap-1.5",
3676
+ item: "group relative flex flex-1 gap-3",
3677
+ container: "relative flex items-center gap-1.5",
3678
+ indicator: "group-data-[state=completed]:text-inverted group-data-[state=active]:text-inverted text-muted",
3679
+ indicatorIcon: "text-inherit",
3680
+ indicatorFallback: "text-inherit",
3681
+ separator: "flex-1 rounded-full bg-elevated",
3682
+ wrapper: "w-full",
3683
+ date: "text-dimmed text-xs/5",
3684
+ title: "font-medium text-highlighted text-sm",
3685
+ description: "text-muted text-wrap text-sm"
3686
+ },
3687
+ variants: {
3688
+ orientation: {
3689
+ horizontal: {
3690
+ root: "flex-row w-full",
3691
+ item: "flex-col",
3692
+ separator: "h-0.5"
3693
+ },
3694
+ vertical: {
3695
+ root: "flex-col",
3696
+ container: "flex-col",
3697
+ separator: "w-0.5"
3698
+ }
3699
+ },
3700
+ color: {
3701
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
3702
+ indicator: `group-data-[state=completed]:bg-${color} group-data-[state=active]:bg-${color}`
3703
+ }])),
3704
+ neutral: {
3705
+ indicator: "group-data-[state=completed]:bg-inverted group-data-[state=active]:bg-inverted"
3706
+ }
3707
+ },
3708
+ size: {
3709
+ "3xs": "",
3710
+ "2xs": "",
3711
+ "xs": "",
3712
+ "sm": "",
3713
+ "md": "",
3714
+ "lg": "",
3715
+ "xl": "",
3716
+ "2xl": "",
3717
+ "3xl": ""
3718
+ },
3719
+ reverse: {
3720
+ true: ""
3721
+ }
3722
+ },
3723
+ compoundVariants: [
3724
+ ...(options.theme.colors || []).map((color) => ({
3725
+ color,
3726
+ reverse: false,
3727
+ class: {
3728
+ separator: `group-data-[state=completed]:bg-${color}`
3729
+ }
3730
+ })),
3731
+ {
3732
+ color: "neutral",
3733
+ reverse: false,
3734
+ class: {
3735
+ separator: "group-data-[state=completed]:bg-inverted"
3736
+ }
3737
+ },
3738
+ ...(options.theme.colors || []).map((color) => ({
3739
+ color,
3740
+ reverse: true,
3741
+ class: {
3742
+ separator: `group-data-[state=active]:bg-${color} group-data-[state=completed]:bg-${color}`
3743
+ }
3744
+ })),
3745
+ {
3746
+ color: "neutral",
3747
+ reverse: true,
3748
+ class: {
3749
+ separator: "group-data-[state=active]:bg-inverted group-data-[state=completed]:bg-inverted"
3750
+ }
3751
+ },
3752
+ {
3753
+ orientation: "horizontal",
3754
+ size: "3xs",
3755
+ class: {
3756
+ wrapper: "pe-4.5"
3757
+ }
3758
+ },
3759
+ {
3760
+ orientation: "horizontal",
3761
+ size: "2xs",
3762
+ class: {
3763
+ wrapper: "pe-5"
3764
+ }
3765
+ },
3766
+ {
3767
+ orientation: "horizontal",
3768
+ size: "xs",
3769
+ class: {
3770
+ wrapper: "pe-5.5"
3771
+ }
3772
+ },
3773
+ {
3774
+ orientation: "horizontal",
3775
+ size: "sm",
3776
+ class: {
3777
+ wrapper: "pe-6"
3778
+ }
3779
+ },
3780
+ {
3781
+ orientation: "horizontal",
3782
+ size: "md",
3783
+ class: {
3784
+ wrapper: "pe-6.5"
3785
+ }
3786
+ },
3787
+ {
3788
+ orientation: "horizontal",
3789
+ size: "lg",
3790
+ class: {
3791
+ wrapper: "pe-7"
3792
+ }
3793
+ },
3794
+ {
3795
+ orientation: "horizontal",
3796
+ size: "xl",
3797
+ class: {
3798
+ wrapper: "pe-7.5"
3799
+ }
3800
+ },
3801
+ {
3802
+ orientation: "horizontal",
3803
+ size: "2xl",
3804
+ class: {
3805
+ wrapper: "pe-8"
3806
+ }
3807
+ },
3808
+ {
3809
+ orientation: "horizontal",
3810
+ size: "3xl",
3811
+ class: {
3812
+ wrapper: "pe-8.5"
3813
+ }
3814
+ },
3815
+ {
3816
+ orientation: "vertical",
3817
+ size: "3xs",
3818
+ class: {
3819
+ wrapper: "-mt-0.5 pb-4.5"
3820
+ }
3821
+ },
3822
+ {
3823
+ orientation: "vertical",
3824
+ size: "2xs",
3825
+ class: {
3826
+ wrapper: "pb-5"
3827
+ }
3828
+ },
3829
+ {
3830
+ orientation: "vertical",
3831
+ size: "xs",
3832
+ class: {
3833
+ wrapper: "mt-0.5 pb-5.5"
3834
+ }
3835
+ },
3836
+ {
3837
+ orientation: "vertical",
3838
+ size: "sm",
3839
+ class: {
3840
+ wrapper: "mt-1 pb-6"
3841
+ }
3842
+ },
3843
+ {
3844
+ orientation: "vertical",
3845
+ size: "md",
3846
+ class: {
3847
+ wrapper: "mt-1.5 pb-6.5"
3848
+ }
3849
+ },
3850
+ {
3851
+ orientation: "vertical",
3852
+ size: "lg",
3853
+ class: {
3854
+ wrapper: "mt-2 pb-7"
3855
+ }
3856
+ },
3857
+ {
3858
+ orientation: "vertical",
3859
+ size: "xl",
3860
+ class: {
3861
+ wrapper: "mt-2.5 pb-7.5"
3862
+ }
3863
+ },
3864
+ {
3865
+ orientation: "vertical",
3866
+ size: "2xl",
3867
+ class: {
3868
+ wrapper: "mt-3 pb-8"
3869
+ }
3870
+ },
3871
+ {
3872
+ orientation: "vertical",
3873
+ size: "3xl",
3874
+ class: {
3875
+ wrapper: "mt-3.5 pb-8.5"
3876
+ }
3877
+ }
3878
+ ],
3879
+ defaultVariants: {
3880
+ size: "md",
3881
+ color: "primary"
3882
+ }
3883
+ });
3884
+
3885
+ const toast = (options) => ct({
3886
+ parts: {
3887
+ root: "relative group overflow-hidden bg-default shadow-lg rounded-lg ring ring-default p-4 flex gap-2.5 focus:outline-none",
3888
+ wrapper: "w-0 flex-1 flex flex-col",
3889
+ title: "text-sm font-medium text-highlighted",
3890
+ description: "text-sm text-muted",
3891
+ icon: "shrink-0 size-5",
3892
+ avatar: "shrink-0",
3893
+ avatarSize: "2xl",
3894
+ actions: "flex gap-1.5 shrink-0",
3895
+ progress: "absolute inset-x-0 bottom-0",
3896
+ close: "p-0"
3897
+ },
3898
+ variants: {
3899
+ color: {
3900
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
3901
+ root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}`,
3902
+ icon: `text-${color}`
3903
+ }])),
3904
+ neutral: {
3905
+ root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted",
3906
+ icon: "text-highlighted"
3907
+ }
3908
+ },
3909
+ orientation: {
3910
+ horizontal: {
3911
+ root: "items-center",
3912
+ actions: "items-center"
3913
+ },
3914
+ vertical: {
3915
+ root: "items-start",
3916
+ actions: "items-start mt-1"
3917
+ }
3918
+ },
3919
+ title: {
3920
+ true: {
3921
+ description: "mt-1"
3922
+ }
3923
+ }
3924
+ },
3925
+ defaultVariants: {
3926
+ color: "primary"
3927
+ }
3928
+ });
3929
+
3930
+ const toastProvider = ct({
3931
+ parts: {
3932
+ viewport: [
3933
+ "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] focus:outline-none",
3934
+ "data-[expanded=true]:h-[--height]"
3935
+ ],
3936
+ base: [
3937
+ "pointer-events-auto absolute inset-x-0 z-[--index] [transform:var(--transform)] transition-all duration-200 ease-out",
3938
+ "data-[expanded=false]:data-[front=false]:h-[--front-height]",
3939
+ "data-[expanded=false]:data-[front=false]:*:opacity-0 data-[front=false]:*:transition-opacity data-[front=false]:*:duration-100 data-[state=closed]:animate-[toast-closed_200ms_ease-in-out]",
3940
+ "data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out]",
3941
+ "data-[swipe=move]:transition-none"
3942
+ ]
3943
+ },
3944
+ variants: {
3945
+ position: {
3946
+ "top-left": {
3947
+ viewport: "left-4"
3948
+ },
3949
+ "top-center": {
3950
+ viewport: "left-1/2 transform -translate-x-1/2"
3951
+ },
3952
+ "top-right": {
3953
+ viewport: "right-4"
3954
+ },
3955
+ "bottom-left": {
3956
+ viewport: "left-4"
3957
+ },
3958
+ "bottom-center": {
3959
+ viewport: "left-1/2 transform -translate-x-1/2"
3960
+ },
3961
+ "bottom-right": {
3962
+ viewport: "right-4"
3963
+ }
3964
+ },
3965
+ swipeDirection: {
3966
+ up: {
3967
+ base: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]"
3968
+ },
3969
+ right: {
3970
+ base: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]"
3971
+ },
3972
+ down: {
3973
+ base: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]"
3974
+ },
3975
+ left: {
3976
+ base: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
3977
+ }
3978
+ }
3979
+ },
3980
+ compoundVariants: [
3981
+ {
3982
+ position: ["top-left", "top-center", "top-right"],
3983
+ class: {
3984
+ viewport: "top-4",
3985
+ base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
3986
+ }
3987
+ },
3988
+ {
3989
+ position: ["bottom-left", "bottom-center", "bottom-right"],
3990
+ class: {
3991
+ viewport: "bottom-4",
3992
+ base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
3993
+ }
3994
+ },
3995
+ {
3996
+ swipeDirection: ["left", "right"],
3997
+ class: {
3998
+ base: [
3999
+ "data-[swipe=move]:translate-x-[--reka-toast-swipe-move-x]",
4000
+ "data-[swipe=end]:translate-x-[--reka-toast-swipe-end-x]",
4001
+ "data-[swipe=cancel]:translate-x-0"
4002
+ ]
4003
+ }
4004
+ },
4005
+ {
4006
+ swipeDirection: ["up", "down"],
4007
+ class: {
4008
+ base: [
4009
+ "data-[swipe=move]:translate-y-[--reka-toast-swipe-move-y]",
4010
+ "data-[swipe=end]:translate-y-[--reka-toast-swipe-end-y]",
4011
+ "data-[swipe=cancel]:translate-y-0"
4012
+ ]
4013
+ }
4014
+ }
4015
+ ],
4016
+ defaultVariants: {
4017
+ position: "bottom-right"
4018
+ }
4019
+ });
4020
+
4021
+ const tooltip = ct({
4022
+ parts: {
4023
+ content: "flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-[--reka-tooltip-content-transform-origin] pointer-events-auto",
4024
+ arrow: "fill-default",
4025
+ text: "truncate",
4026
+ kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['\xB7'] not-first-of-type:before:me-0.5`,
4027
+ kbdsSize: "sm"
4028
+ }
4029
+ });
4030
+
4031
+ const theme = {
4032
+ __proto__: null,
4033
+ accordion: accordion,
4034
+ alert: alert,
4035
+ avatar: avatar,
4036
+ avatarGroup: avatarGroup,
4037
+ badge: badge,
4038
+ breadcrumb: breadcrumb,
4039
+ button: button,
4040
+ calendar: calendar,
4041
+ card: card,
4042
+ carousel: carousel,
4043
+ checkbox: checkbox,
4044
+ checkboxGroup: checkboxGroup,
4045
+ chip: chip,
4046
+ collapsible: collapsible,
4047
+ drawer: drawer,
4048
+ dropdownMenu: dropdownMenu,
4049
+ fieldGroup: fieldGroup,
4050
+ form: form,
4051
+ formField: formField,
4052
+ input: inputTheme,
4053
+ inputNumber: inputNumber,
4054
+ inputTags: inputTags,
4055
+ kbd: kbd,
4056
+ link: link,
4057
+ marquee: marquee,
4058
+ modal: modal,
4059
+ navigationMenu: navigationMenu,
4060
+ pagination: pagination,
4061
+ pinInput: pinInput,
4062
+ popover: popover,
4063
+ progress: progress,
4064
+ radioGroup: radioGroup,
4065
+ scrollArea: scrollArea,
4066
+ select: select,
4067
+ separator: separator,
4068
+ skeleton: skeleton,
4069
+ slider: slider,
4070
+ switch: _switch,
4071
+ table: table,
4072
+ tabs: tabs,
4073
+ textarea: textarea,
4074
+ timeline: timeline,
4075
+ toast: toast,
4076
+ toastProvider: toastProvider,
4077
+ tooltip: tooltip
4078
+ };
4079
+
4080
+ function getTemplates(options, uiConfig, nuxt) {
4081
+ const templates = [];
4082
+ const isDev = process.argv.includes("--uiDev");
4083
+ function writeThemeTemplate(theme2, path) {
4084
+ for (const component in theme2) {
4085
+ templates.push({
4086
+ filename: `ui/${""}${kebabCase(component)}.ts`,
4087
+ write: true,
4088
+ getContents: () => {
4089
+ const template = theme2[component];
4090
+ const result = typeof template === "function" ? template(options) : template;
4091
+ const json = JSON.stringify(result, null, 2);
4092
+ if (isDev) {
4093
+ const templatePath = fileURLToPath(new URL(`theme/${""}${kebabCase(component)}`, import.meta.url));
4094
+ return [
4095
+ [
4096
+ `// @unocss-include`,
4097
+ `import type { ModuleOptions } from '@byyuurin/ui'`,
4098
+ `import { ct } from '@byyuurin/ui-kit'`,
4099
+ `import template from ${JSON.stringify(templatePath)}`
4100
+ ].join("\n"),
4101
+ `const options: ModuleOptions = ${JSON.stringify(options, null, 2)}`,
4102
+ `const result = typeof template === 'function' ? (template as Function)(options) : template`,
4103
+ `if (result?.defaultVariants?.color && options.theme?.defaultVariants?.color)
4104
+ result.defaultVariants.color = options.theme.defaultVariants.color`,
4105
+ `if (result?.defaultVariants?.size && options.theme?.defaultVariants?.size)
4106
+ result.defaultVariants.size = options.theme.defaultVariants.size`,
4107
+ `const theme = ct(${json})`,
4108
+ `export default result as typeof theme`
4109
+ ].join("\n\n");
4110
+ }
4111
+ return [
4112
+ `// @unocss-include
4113
+ import { ct } from '@byyuurin/ui-kit'`,
4114
+ `export default ct(${json})`
4115
+ ].join("\n\n");
4116
+ }
4117
+ });
4118
+ }
4119
+ }
4120
+ function writeUnoTemplate() {
4121
+ templates.push({
4122
+ filename: "uno-merge.ts",
4123
+ write: true,
4124
+ async getContents() {
4125
+ const { config } = await loadConfig();
4126
+ const configPath = await findPath(["uno.config", "unocss.config"], { extensions: [".ts", ".mjs"] });
4127
+ const userConfigSource = [];
4128
+ if (configPath) {
4129
+ if (nuxt && isDev) {
4130
+ userConfigSource.push(
4131
+ `import config from ${JSON.stringify(configPath.replace(/\.ts$/, ""))}`,
4132
+ ``,
4133
+ `const userConfig: UserConfig = { theme: config.theme, shortcuts: config.shortcuts }`
4134
+ );
4135
+ } else {
4136
+ let shortcuts;
4137
+ if (config.shortcuts) {
4138
+ shortcuts = Array.isArray(config.shortcuts) ? config.shortcuts : [config.shortcuts];
4139
+ shortcuts = shortcuts.filter((s) => {
4140
+ if (Array.isArray(s))
4141
+ return !(s[0] instanceof RegExp);
4142
+ return true;
4143
+ });
4144
+ }
4145
+ userConfigSource.push(
4146
+ ``,
4147
+ `const userConfig: UserConfig = ${JSON.stringify({ theme: config.theme, shortcuts }, null, 2)}`
4148
+ );
4149
+ }
4150
+ } else {
4151
+ userConfigSource.push(
4152
+ ``,
4153
+ `const userConfig: UserConfig = {}`
4154
+ );
4155
+ }
4156
+ return `import { createUnoMerge } from '@byyuurin/uno-merge'
4157
+ import { createUnoPreset } from '@byyuurin/ui/unocss'
4158
+ import type { UserConfig } from '@unocss/core'
4159
+ import { mergeConfigs } from '@unocss/core'
4160
+ import { presetWind4 } from '@unocss/preset-wind4'
4161
+ ${userConfigSource.join("\n")}
4162
+
4163
+ export const { merge: unoMerge } = await createUnoMerge(mergeConfigs([
4164
+ {
4165
+ presets: [
4166
+ presetWind4(),
4167
+ createUnoPreset(${JSON.stringify({ colors: options.theme?.colors })})
4168
+ ]
4169
+ },
4170
+ userConfig,
4171
+ ]))`;
4172
+ }
4173
+ });
4174
+ }
4175
+ writeThemeTemplate(theme);
4176
+ writeUnoTemplate();
4177
+ templates.push({
4178
+ filename: "ui/index.ts",
4179
+ write: true,
4180
+ getContents() {
4181
+ const contents = Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n");
4182
+ return contents;
4183
+ }
4184
+ });
4185
+ templates.push({
4186
+ filename: "types/ui.d.ts",
4187
+ getContents() {
4188
+ const appIcon = Object.keys(uiConfig.icons ?? {}).map((s) => `'${s}'`).join(" | ");
4189
+ const appNeutralColor = neutralColors.map((s) => `'${s}'`).join(" | ");
4190
+ return `import * as ui from '#build/ui'
4191
+ import type { UIConfig } from '@byyuurin/ui'
4192
+ import type { colors } from '@unocss/preset-wind4/colors'
4193
+
4194
+ type NeutralColor = ${appNeutralColor}
4195
+ type Color = keyof Omit<typeof colors, NeutralColor | 'black' | 'white'> | (string & {})
4196
+
4197
+ type AppConfigIcons = Record<${appIcon} | (string & {}), string>
4198
+
4199
+ export type AppConfigUI = {
4200
+ colors?: {
4201
+ ${options.theme?.colors?.map((color) => `'${color}'?: Color`).join("\n ")}
4202
+ neutral?: NeutralColor | (string & {})
4203
+ }
4204
+ icons?: Partial<AppConfigIcons>
4205
+ } & UIConfig<typeof ui>
4206
+
4207
+ declare module '@nuxt/schema' {
4208
+ interface AppConfigInput {
4209
+ /** UI theme configuration */
4210
+ ui?: AppConfigUI
4211
+ }
4212
+ }
4213
+
4214
+ export {}
4215
+ `;
4216
+ }
4217
+ });
4218
+ templates.push({
4219
+ filename: "ui-image-component.ts",
4220
+ write: true,
4221
+ getContents: ({ app }) => {
4222
+ const image = app?.components?.find((c) => c.pascalName === "NuxtImg" && !/nuxt(?:-nightly)?\/dist\/app/.test(c.filePath));
4223
+ return image ? genExport(image.filePath, [{ name: image.export, as: "default" }]) : 'export default "img"';
4224
+ }
4225
+ });
4226
+ return templates;
4227
+ }
4228
+ function addTemplates(options, nuxt, resolve) {
4229
+ const templates = getTemplates(options, nuxt.options.appConfig.ui, nuxt);
4230
+ for (const template of templates) {
4231
+ if (template.filename.endsWith(".d.ts"))
4232
+ addTypeTemplate(template);
4233
+ else
4234
+ addTemplate(template);
4235
+ }
4236
+ nuxt.hook("prepare:types", ({ references }) => {
4237
+ references.push({ path: resolve("./runtime/types/app.config.d.ts") });
4238
+ references.push({ path: resolve("./runtime/types/unocss.d.ts") });
4239
+ });
4240
+ }
4241
+
4242
+ export { addTemplates as a, getTemplates as g, name as n, version as v };