@una-ui/preset 0.33.0-beta.1 → 0.35.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1058 @@
1
+ import { parseColor } from '@unocss/preset-mini/utils';
2
+ import { parseColor as parseColor$1 } from '@unocss/preset-mini';
3
+
4
+ const staticAccordion = {
5
+ // config
6
+ "accordion-trailing-icon": "i-lucide-chevron-up",
7
+ "accordion-button-padding": "p-(x-3 y-4)",
8
+ "accordion-button-default-variant": "btn-text",
9
+ "accordion-divider": "divide-(y base)",
10
+ "accordion-border": "border-(~ base) rounded-md",
11
+ // base
12
+ "accordion": "flex-(~ col) relative w-full",
13
+ "accordion-item": "w-full",
14
+ "accordion-button": "justify-start",
15
+ "accordion-panel": "text-(muted 0.875em) border-(t $c-divider) accordion-button-padding",
16
+ "accordion-leading": "text-1.2em",
17
+ "accordion-trailing": "flex transition items-center text-1em duration-300",
18
+ "accordion-label": "flex w-full text-1em",
19
+ // trailing transition
20
+ "accordion-trailing-open": "-rotate-180",
21
+ "accordion-trailing-close": "rotate-0",
22
+ // panel transition
23
+ "accordion-enter-active": "overflow-hidden transition-height duration-300",
24
+ "accordion-leave-active": "overflow-hidden transition-height duration-300"
25
+ };
26
+ const dynamicAccordion = [];
27
+ const accordion = [
28
+ ...dynamicAccordion,
29
+ staticAccordion
30
+ ];
31
+
32
+ const staticAlert = {
33
+ // config
34
+ "alert-default-variant": "alert-outline",
35
+ "alert-info-icon": "i-info",
36
+ "alert-error-icon": "i-error",
37
+ "alert-success-icon": "i-success",
38
+ "alert-warning-icon": "i-warning",
39
+ "alert-close-icon": "i-close",
40
+ // base
41
+ "alert": "p-1em",
42
+ "alert-title": "text-0.875em font-medium text-brand",
43
+ "alert-description": "text-0.875em leading-1.625em text-brand/90",
44
+ "alert-icon-base": "h-1.25em w-1.25em",
45
+ "alert-close": "p-0.5em rounded-md hover:bg-brand/10 active:bg-brand/20 transition-colors duration-200",
46
+ "alert-close-icon-base": "h-1.2em w-1.2em",
47
+ // wrappers
48
+ "alert-inner-wrapper": "gap-0.75em flex",
49
+ "alert-content-wrapper": "flex flex-col w-full space-y-0.5em",
50
+ "alert-icon-wrapper": "-mt-0.2em",
51
+ "alert-close-wrapper": "ml-auto pl-0.2em",
52
+ "alert-close-inner-wrapper": "-mx-1.1 -my-1.1",
53
+ // static variants
54
+ "alert-solid-white": "rounded-md text-brand bg-base n-gray-950 dark:n-white border",
55
+ "alert-solid-black": "rounded-md text-brand bg-inverted n-white dark:n-gray-950 border border-foreground"
56
+ };
57
+ const dynamicAlert = [
58
+ // variants
59
+ [/^alert-solid(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md text-white bg-${c}-500 dark:bg-${c}-800 n-white dark:n-${c}-400`],
60
+ [/^alert-soft(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md bg-${c}-50 text-${c}-400 dark:text-${c}-300 dark:bg-${c}-950 n-${c}-800 dark:n-${c}-100`],
61
+ [/^alert-outline(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md border border-${c}-600 dark:border-${c}-500 text-brand n-${c}-600 dark:n-${c}-500`],
62
+ [/^alert-border(-(\S+))?$/, ([, , c = "primary"]) => `border-l-4 border-${c}-400 dark:border-${c}-500 bg-${c}-50 dark:bg-${c}-950 text-${c}-400 dark:text-${c}-300 n-${c}-800 dark:n-${c}-100`]
63
+ ];
64
+ const alert = [
65
+ ...dynamicAlert,
66
+ staticAlert
67
+ ];
68
+
69
+ const staticAvatar = {
70
+ // base
71
+ "avatar": "relative flex shrink-0 overflow-hidden leading-1.5em",
72
+ "avatar-image": "aspect-square h-full w-full",
73
+ "avatar-fallback": "flex h-full w-full items-center justify-center",
74
+ "avatar-label": "",
75
+ "avatar-icon": "text-1em",
76
+ // variants
77
+ "avatar-solid-white": "bg-base text-base ring-1 ring-base",
78
+ "avatar-solid-black": "bg-inverted text-inverted"
79
+ };
80
+ const dynamicAvatar = [
81
+ // variants
82
+ [/^avatar-solid(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-600 dark:bg-${c}-500 text-inverted`],
83
+ [/^avatar-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 text-${c}-700 dark:text-${c}-400 dark:bg-${c}-900`],
84
+ [/^avatar-outline(-(\S+))?$/, ([, , c = "gray"]) => `bg-transparent text-${c}-500 dark:text-${c}-400 ring-1 ring-${c}-500 dark:ring-${c}-400`]
85
+ ];
86
+ const avatar = [
87
+ ...dynamicAvatar,
88
+ staticAvatar
89
+ ];
90
+
91
+ const staticAvatarGroup = {
92
+ "avatar-group": "flex flex-row-reverse justify-end",
93
+ "avatar-group-child": "ring-2 ring-$c-background",
94
+ "avatar-group-margin": "-me-1.5 first:me-0",
95
+ "avatar-group-label": "text-.9em"
96
+ };
97
+ const dynamicAvatarGroup = [];
98
+ const avatarGroup = [
99
+ ...dynamicAvatarGroup,
100
+ staticAvatarGroup
101
+ ];
102
+
103
+ const staticBadge = {
104
+ // config
105
+ "badge-default-variant": "badge-soft",
106
+ "badge-close-icon": "i-close",
107
+ // base
108
+ "badge": "text-xs leading-tight py-0.3333333333333333em px-0.6666666666666666em gap-x-0.25em inline-flex items-center rounded-md font-medium text-brand",
109
+ "badge-icon-base": "text-1em",
110
+ "badge-close": "relative rounded-sm h-1.16em w-1.16em grid place-items-center -mr-0.375em hover:bg-brand/20 bg-transparent",
111
+ "badge-close-icon-base": "text-brand/75 group-hover:text-brand/90",
112
+ // variants
113
+ "badge-soft-gray": "bg-muted text-muted n-gray-900 dark:n-gray-50 ring-1 ring-gray-700/10 dark:ring-gray-400/30",
114
+ "badge-solid-black": "bg-inverted text-inverted n-gray-300 dark:n-gray-600",
115
+ "badge-outline-white": "bg-base text-base ring-1 ring-base n-gray-600 dark:n-gray-300"
116
+ };
117
+ const dynamicBadge = [
118
+ // variants
119
+ [/^badge-solid(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-100 dark:bg-${c}-800 n-${c}-700 dark:n-${c}-200`],
120
+ [/^badge-soft(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-50 n-${c}-700 dark:n-${c}-400 ring-1 ring-${c}-700/10 dark:bg-${c}-400/10 dark:ring-${c}-400/30`],
121
+ [/^badge-outline(-(\S+))?$/, ([, , c = "primary"]) => `bg-transparent n-${c}-700 dark:n-${c}-400 ring-1 ring-${c}-700/10 dark:ring-${c}-400/30`]
122
+ ];
123
+ const badge = [
124
+ ...dynamicBadge,
125
+ staticBadge
126
+ ];
127
+
128
+ const staticBreadcrumb = {
129
+ // config
130
+ "breadcrumb": "",
131
+ "breadcrumb-active": "breadcrumb-active-text-primary",
132
+ "breadcrumb-inactive": "breadcrumb-inactive-text-muted",
133
+ "breadcrumb-separator-icon": "i-radix-icons-chevron-right",
134
+ "breadcrumb-ellipsis-icon": "i-radix-icons-dots-horizontal",
135
+ // components
136
+ "breadcrumb-root": "",
137
+ "breadcrumb-list": "flex flex-wrap items-center break-words text-muted",
138
+ "breadcrumb-link": "transition-colors font-normal px-1.5 sm:px-2.5",
139
+ "breadcrumb-item": "inline-flex items-center gap-1.5",
140
+ "breadcrumb-separator": "flex",
141
+ // TODO
142
+ "breadcrumb-ellipsis": "flex items-center justify-center px-1.5 sm:px-2.5 cursor-pointer"
143
+ };
144
+ const dynamicBreadcrumb = [
145
+ // states
146
+ [
147
+ /^breadcrumb-active-([^-]+)-([^-]+)$/,
148
+ ([, variant = "text", color = "primary"]) => `data-[state=active]:btn-${variant}-${color}`
149
+ ],
150
+ [
151
+ /^breadcrumb-inactive-([^-]+)-([^-]+)$/,
152
+ ([, variant = "text", color = "muted"]) => `data-[state=inactive]:btn-${variant}-${color}`
153
+ ]
154
+ ];
155
+ const breadcrumb = [
156
+ ...dynamicBreadcrumb,
157
+ staticBreadcrumb
158
+ ];
159
+
160
+ const staticBtn = {
161
+ // config
162
+ "btn-default-variant": "btn-solid",
163
+ "btn-loading-icon": "i-loading",
164
+ "btn-default-radius": "rounded-md",
165
+ // base
166
+ "btn": "btn-rectangle px-1em py-0.5em bg-transparent transition-colors text-0.875em leading-5 gap-x-0.5em rounded-md whitespace-nowrap inline-flex justify-center items-center btn-disabled font-medium cursor-pointer",
167
+ "btn-disabled": "disabled:n-disabled",
168
+ "btn-label": "",
169
+ "btn-icon-label": "text-1em",
170
+ "btn-leading": "-ml-0.14285714285714285em text-1em",
171
+ "btn-trailing": "-mr-0.14285714285714285em text-1em",
172
+ "btn-loading": "animate-spin text-1em",
173
+ "btn-rectangle": "h-2.5em",
174
+ "btn-square": "w-2.5em h-2.5em",
175
+ // options
176
+ "btn-block": "w-full",
177
+ "btn-reverse": "flex-row-reverse",
178
+ // variants
179
+ "btn-solid-white": "bg-base text-base ring-1 ring-base ring-inset shadow-sm btn-focus hover:bg-muted",
180
+ "btn-ghost-white": "text-base btn-focus hover:bg-$c-gray-50",
181
+ "btn-outline-white": "text-base ring-1 ring-base ring-inset btn-focus hover:bg-$c-gray-50",
182
+ "btn-solid-gray": "bg-$c-gray-50 text-$c-gray-800 ring-1 ring-base ring-inset shadow-sm btn-focus hover:bg-$c-gray-100",
183
+ "btn-ghost-gray": "text-$c-gray-600 btn-focus hover:bg-$c-gray-100",
184
+ "btn-soft-gray": "text-$c-gray-600 bg-$c-gray-50 btn-focus hover:bg-$c-gray-100",
185
+ "btn-outline-gray": "text-muted hover:text-$c-gray-600 ring-1 ring-base ring-inset btn-focus hover:bg-$c-gray-50",
186
+ "btn-link-gray": "text-muted btn-focus hover:text-base hover:underline underline-offset-4",
187
+ "btn-text-gray": "text-$c-gray-600 btn-focus hover:text-$c-gray-900",
188
+ "btn-solid-black": "bg-inverted text-inverted shadow-sm btn-focus",
189
+ "btn-link-black": "text-base btn-focus hover:underline underline-offset-4",
190
+ "btn-text-black": "text-base btn-focus",
191
+ "btn-soft-black": "text-base bg-base btn-focus shadow-sm",
192
+ "btn-text-muted": "text-muted btn-focus hover:text-accent",
193
+ "btn-link-muted": "text-muted btn-focus hover:underline underline-offset-4",
194
+ "btn-ghost-muted": "text-accent hover:text-muted btn-focus hover:bg-muted",
195
+ "btn-soft-accent": "text-accent bg-accent btn-focus",
196
+ "btn-text-accent": "text-accent btn-focus",
197
+ "btn-link-accent": "text-accent btn-focus hover:underline underline-offset-4"
198
+ };
199
+ const dynamicBtn = [
200
+ // base
201
+ [/^btn-focus(-(\S+))?$/, ([, , c = "primary"]) => `focus-visible:outline-${c}-600 dark:focus-visible:outline-${c}-500 focus-visible:outline-2 focus-visible:outline-offset-2`],
202
+ // variants
203
+ [/^btn-solid(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-inverted shadow-sm bg-${c}-600 hover:bg-${c}-500 dark:bg-${c}-500 dark:hover:bg-${c}-400`],
204
+ [/^btn-text(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-500 hover:text-${c}-500 dark:hover:text-${c}-400`],
205
+ [/^btn-outline(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-500 dark:text-${c}-400 ring-1 ring-inset ring-${c}-500 dark:ring-${c}-400 hover:bg-${c}-50 dark:hover:bg-${c}-950`],
206
+ [/^btn-soft(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 bg-${c}-50 dark:bg-${c}-950 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
207
+ [/^btn-ghost(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
208
+ [/^btn-link(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-500 hover:underline underline-offset-4`]
209
+ ];
210
+ const btn = [
211
+ ...dynamicBtn,
212
+ staticBtn
213
+ ];
214
+
215
+ const staticCard = {
216
+ // base
217
+ "card": "relative flex flex-col rounded-lg overflow-hidden shadow-sm",
218
+ "card-default-variant": "card-outline-gray",
219
+ // components
220
+ "card-header": "",
221
+ "card-title": "text-2xl font-semibold leading-none tracking-tight",
222
+ "card-description": "text-sm text-muted",
223
+ "card-content": "px-4 py-5 pt-0 sm:p-6 sm:pt-0",
224
+ "card-footer": "flex items-center p-6 pt-0",
225
+ "card-about": "flex flex-col gap-y-1.5 px-4 py-5 sm:p-6",
226
+ // static variants
227
+ "card-soft-gray": "bg-muted border border-base",
228
+ "card-outline-gray": "bg-base border border-base"
229
+ };
230
+ const dynamicCard = [
231
+ // dynamic variants
232
+ [/^card-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 dark:bg-${c}-900 border-${c}-200 dark:border-${c}-700/58`],
233
+ [/^card-outline(-(\S+))?$/, ([, , c = "gray"]) => `border border-${c}-200 dark:border-${c}-700/58`]
234
+ ];
235
+ const card = [
236
+ ...dynamicCard,
237
+ staticCard
238
+ ];
239
+
240
+ const staticCheckbox = {
241
+ // base
242
+ "checkbox": "checkbox-primary text-md w-1em h-1em shrink-0 rounded-sm ring-offset-base focus-visible:outline-none disabled:n-disabled border border-brand bg-brand text-inverted focus-visible:(ring-2 ring-brand ring-offset-2) data-[state=unchecked]:(bg-base text-base)",
243
+ "checkbox-label": "block",
244
+ "checkbox-reverse": "flex-row-reverse",
245
+ // wrappers
246
+ "checkbox-wrapper": "gap-x-3 relative inline-flex items-center hover:cursor-pointer",
247
+ // icon
248
+ "checkbox-indicator": "flex items-center justify-center h-full w-full data-[state=unchecked]:opacity-0 transition-base opacity-100 text-inverted",
249
+ "checkbox-icon-base": "w-1em h-1em",
250
+ "checkbox-checked-icon": "i-check",
251
+ "checkbox-unchecked-icon": "",
252
+ "checkbox-indeterminate-icon": "i-lucide-minus"
253
+ };
254
+ const dynamicCheckbox = [
255
+ [/^checkbox-(.*)$/, ([, body], { theme }) => {
256
+ const color = parseColor(body, theme);
257
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
258
+ return `n-${body}-600 dark:n-${body}-500`;
259
+ }]
260
+ ];
261
+ const checkbox = [
262
+ ...dynamicCheckbox,
263
+ staticCheckbox
264
+ ];
265
+
266
+ const staticCollapsible = {
267
+ "collapsible-content": "overflow-hidden transition-all data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down"
268
+ };
269
+ const dynamicCollapsible = [
270
+ // dynamic preset
271
+ ];
272
+ const collapsible = [
273
+ ...dynamicCollapsible,
274
+ staticCollapsible
275
+ ];
276
+
277
+ const staticDialog = {
278
+ // base
279
+ "dialog": "",
280
+ // sub-components
281
+ "dialog-overlay": "fixed inset-0 z-50 bg-black/80",
282
+ "dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg",
283
+ "dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80",
284
+ "dialog-scroll-content": "relative z-50 grid w-full max-w-lg my-8 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
285
+ "dialog-header": "flex flex-col gap-y-1.5 text-center sm:text-left",
286
+ "dialog-title": "text-lg font-semibold leading-none tracking-tight",
287
+ "dialog-description": "text-sm text-muted",
288
+ "dialog-close": "absolute right-4 top-4",
289
+ "dialog-footer": "flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2"
290
+ };
291
+ const dynamicDialog = [
292
+ // dynamic preset
293
+ ];
294
+ const dialog = [
295
+ ...dynamicDialog,
296
+ staticDialog
297
+ ];
298
+
299
+ const staticDropdownMenu = {
300
+ // configurations
301
+ "dropdown-menu": "",
302
+ "dropdown-menu-default-variant": "btn-solid-white",
303
+ // dropdown-menu-trigger
304
+ "dropdown-menu-trigger": "",
305
+ "dropdown-menu-trigger-leading": "",
306
+ "dropdown-menu-trigger-trailing": "ml-auto",
307
+ // dropdown-menu-content
308
+ "dropdown-menu-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-md",
309
+ // dropdown-menu-item
310
+ "dropdown-menu-item-base": "text-left transition-color focus-visible:outline-0",
311
+ "dropdown-menu-item-leading": "text-1em",
312
+ "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1em",
313
+ // dropdown-menu-label
314
+ "dropdown-menu-label": "px-2 py-1.5 text-1em font-semibold",
315
+ // dropdown-menu-separator
316
+ "dropdown-menu-separator-root": "relative -mx-1",
317
+ "dropdown-menu-separator": "",
318
+ // dropdown-menu-shortcut
319
+ "dropdown-menu-shortcut": "pl-10 ml-auto text-0.875em tracking-widest n-disabled space-x-0.5",
320
+ // dropdown-menu-group
321
+ "dropdown-menu-group": "",
322
+ // dropdown-menu-sub
323
+ "dropdown-menu-sub-trigger": "transition-color focus-visible:outline-0",
324
+ "dropdown-menu-sub-trigger-leading": "text-1em",
325
+ "dropdown-menu-sub-trigger-trailing": "ml-auto opacity-75 text-1em",
326
+ "dropdown-menu-sub-trigger-trailing-icon": "i-lucide-chevron-right",
327
+ "dropdown-menu-sub-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-lg"
328
+ };
329
+ const dynamicDropdownMenu = [
330
+ [/^dropdown-menu-([^-]+)-([^-]+)$/, ([, v = "solid", c = "white"]) => `btn-${v}-${c}`],
331
+ [/^dropdown-menu-item(?:-(\S+))?$/, ([, c = "gray"]) => `focus:bg-${c}-100 focus:text-${c}-800 dark:focus:bg-${c}-800 dark:focus:text-${c}-100 data-[state=open]:bg-${c}-100 dark:data-[state=open]:bg-${c}-800`]
332
+ ];
333
+ const dropdowMenu = [
334
+ ...dynamicDropdownMenu,
335
+ staticDropdownMenu
336
+ ];
337
+
338
+ const staticForm = {
339
+ // base
340
+ "form": "",
341
+ "form-field": "",
342
+ "form-field-description": "text-muted",
343
+ "form-field-hint": "text-sm leading-none text-muted",
344
+ "form-field-message": "",
345
+ // wrappers
346
+ "form-field-top-wrapper": "flex flex-col space-y-1.5 pb-0.5",
347
+ "form-field-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
348
+ "form-field-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
349
+ "form-field-message-wrapper": "",
350
+ // label
351
+ "form-field-label-wrapper": "flex",
352
+ "form-field-label": "block",
353
+ "form-field-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
354
+ "form-message": "text-0.8rem font-medium transition-all duration-1000 ease-in-out text-error",
355
+ "form-label": "",
356
+ "form-description": "text-sm text-muted",
357
+ "form-item": "space-y-2"
358
+ };
359
+ const form = [
360
+ staticForm
361
+ ];
362
+
363
+ const staticFormGroup = {
364
+ // base
365
+ "form-group": "space-y-2",
366
+ "form-group-description": "text-0.8rem text-muted",
367
+ "form-group-hint": "text-sm leading-none text-muted",
368
+ "form-group-message": "text-0.8em transition-all duration-1000 ease-in-out",
369
+ // wrappers
370
+ "form-group-top-wrapper": "flex flex-col space-y-1.5",
371
+ "form-group-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
372
+ "form-group-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
373
+ "form-group-message-wrapper": "",
374
+ // label
375
+ "form-group-label-wrapper": "flex",
376
+ "form-group-label": "block label-base",
377
+ "form-group-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
378
+ // counter
379
+ "form-group-counter-wrapper": "text-0.8em",
380
+ "form-group-counter-error": "text-error",
381
+ "form-group-counter-current": "text-accent",
382
+ "form-group-counter-separator": "text-muted",
383
+ "form-group-counter-max": "text-muted"
384
+ };
385
+ const formGroup = [
386
+ staticFormGroup
387
+ ];
388
+
389
+ const staticIcons = {
390
+ "i-loading": "i-tabler-loader-2",
391
+ "i-warning": "i-tabler-alert-triangle-filled",
392
+ "i-error": "i-tabler-exclamation-circle-filled",
393
+ "i-success": "i-tabler-circle-check-filled",
394
+ "i-info": "i-tabler-info-circle-filled",
395
+ "i-close": "i-tabler-x",
396
+ "i-check": "i-tabler-check",
397
+ "i-dot": "i-tabler-circle-filled"
398
+ };
399
+
400
+ const staticGeneral = {
401
+ // text-size
402
+ "text-md": "text-1rem leading-1.5rem",
403
+ "size-md": "text-md",
404
+ // text color
405
+ "text-base": "text-$c-foreground",
406
+ "text-inverted": "text-$c-background",
407
+ "text-muted": "text-$c-muted-foreground",
408
+ "text-accent": "text-$c-accent-foreground",
409
+ "text-accent-foreground": "text-$c-accent",
410
+ "text-popover": "text-$c-popover-foreground",
411
+ "text-popover-foreground": "text-$c-popover",
412
+ "text-info": "text-info-600 dark:text-info-500",
413
+ "text-error": "text-error-600 dark:text-error-500",
414
+ "text-success": "text-success-600 dark:text-success-500",
415
+ "text-warning": "text-warning-600 dark:text-warning-500",
416
+ // ring
417
+ "ring-base": "ring-$c-ring",
418
+ "ring-offset-base": "ring-offset-$c-background",
419
+ // border
420
+ "border-base": "border-$c-border",
421
+ "border-foreground": "border-$c-border-foreground",
422
+ // divide
423
+ "divide-base": "divide-$c-divider",
424
+ // bg
425
+ "bg-base": "bg-$c-background",
426
+ "bg-inverted": "bg-$c-foreground",
427
+ "bg-muted": "bg-$c-muted",
428
+ "bg-accent": "bg-$c-accent",
429
+ "bg-accent-foreground": "bg-$c-accent-foreground",
430
+ "bg-popover": "bg-$c-popover",
431
+ "bg-popover-foreground": "bg-$c-popover-foreground",
432
+ // transition
433
+ "transition-base": "transition-all duration-100 ease-out",
434
+ // overrides
435
+ "square-false": ""
436
+ };
437
+ const dynamicGeneral = [
438
+ // TODO: una-text-<color><-number><-number>
439
+ // [/^una-text(-(\S+))?$/, ([, , c = 'primary']) => `text-${c}-700 dark:text-${c}-400`],
440
+ /**
441
+ * Since we override the default `size` utility, we need to provide an alternative for it.
442
+ * @refer https://tailwindcss.com/docs/size
443
+ * @example area-100 -> w-100 h-100
444
+ */
445
+ [/^square-([^-]+)$/, ([, size]) => `w-${size} h-${size}`]
446
+ ];
447
+ const general = [
448
+ ...dynamicGeneral,
449
+ staticGeneral,
450
+ staticIcons
451
+ ];
452
+
453
+ const staticIcon = {
454
+ // base
455
+ "icon-base": "flex-none"
456
+ };
457
+ const dynamicIcon = [];
458
+ const icon = [
459
+ ...dynamicIcon,
460
+ staticIcon
461
+ ];
462
+
463
+ const staticIndicator = {
464
+ // config
465
+ "indicator-default-variant": "indicator-solid",
466
+ "indicator-default-placement": "indicator-top-right",
467
+ // base
468
+ "indicator": "absolute min-h-1.5em min-w-1.5em flex items-center justify-center rounded-full font-medium py-none px-0.3em ring-2 ring-$c-background",
469
+ // indicator type sizes
470
+ "indicator-dot": "size-0.45em",
471
+ "indicator-label": "size-0.75em",
472
+ // wrapper
473
+ "indicator-wrapper": "relative inline-flex",
474
+ // placements
475
+ "indicator-top-right": "top-0 -ml-1.3em -mt-0.1em",
476
+ "indicator-bottom-right": "bottom-0 -ml-1.3em -mb-0.1em",
477
+ "indicator-top-left": "top-0 left-0 -mr-1.3em -mt-0.1em",
478
+ "indicator-bottom-left": "bottom-0 left-0 -mr-1.3em -mb-0.1em"
479
+ };
480
+ const dynamicIndicator = [
481
+ [/^indicator-solid(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-600 dark:bg-${c}-500 text-inverted`]
482
+ ];
483
+ const indicator = [
484
+ ...dynamicIndicator,
485
+ staticIndicator
486
+ ];
487
+
488
+ const staticInput = {
489
+ // config
490
+ "input-default-variant": "input-outline",
491
+ "input-loading-icon": "i-loading",
492
+ "input-info-icon": "i-info",
493
+ "input-error-icon": "i-error",
494
+ "input-success-icon": "i-success",
495
+ "input-warning-icon": "i-warning",
496
+ "input-leading-padding": "pl-2.9em",
497
+ "input-trailing-padding": "pr-2.9em",
498
+ // base
499
+ "input": "text-0.875em leading-6 px-0.8571428571428571em py-0.5em w-full input-disabled ring-base ring-inset placeholder:text-$c-gray-400 block outline-none rounded-md border-0 shadow-sm bg-transparent",
500
+ "input-input": "h-9",
501
+ // role='input'
502
+ "input-textarea": "",
503
+ // role='textarea'
504
+ "input-disabled": "disabled:(n-disabled)",
505
+ "input-status-ring": "ring-opacity-50 dark:ring-opacity-40",
506
+ "input-status-icon-base": "text-1.042em",
507
+ "input-leading": "text-1.042em",
508
+ "input-trailing": "text-1.042em",
509
+ "input-loading": "animate-spin text-1.042em",
510
+ // wrappers
511
+ "input-wrapper": "relative flex items-center",
512
+ "input-leading-wrapper": "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-0.75em text-$c-gray-400",
513
+ "input-trailing-wrapper": "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-0.75em text-$c-gray-400",
514
+ // variants
515
+ "input-outline-gray": "focus:ring-2 ring-1",
516
+ "input-outline-black": "ring-1 focus:ring-$c-foreground"
517
+ };
518
+ const dynamicInput = [
519
+ // config
520
+ [/^input-focus(-(\S+))?$/, ([, , c = "primary"]) => `focus:ring-2 focus:ring-${c}-500 dark:focus:ring-${c}-400`],
521
+ [/^input-status(-(\S+))?$/, ([, , c = "info"]) => `text-${c}-700 dark:text-${c}-200 placeholder-${c}-400/70 dark:placeholder-${c}-300/70`],
522
+ // variants
523
+ [/^input-outline(-(\S+))?$/, ([, , c = "primary"]) => `ring-1 input-focus-${c}`],
524
+ [/^input-solid(-(\S+))?$/, ([, , c = "primary"]) => ` ring-1 input-focus-${c} ring-${c}-500 dark:ring-${c}-400`]
525
+ ];
526
+ const input = [
527
+ ...dynamicInput,
528
+ staticInput
529
+ ];
530
+
531
+ const staticKbd = {
532
+ // config
533
+ "kbd-default-variant": "kbd-solid-gray",
534
+ // base
535
+ "kbd": "inline-flex text-nowrap items-center h-1.8181818181818181em min-w-1.8181818181818181em font-sans justify-center rounded px-0.5454545454545454em py-0.18181818181818182em text-0.6875em font-normal"
536
+ };
537
+ const dynamicKbd = [
538
+ // modifiers
539
+ [/^kbd-ring(-(\S+))?$/, ([, , c = "gray"]) => `ring-1 ring-inset ring-${c}-200 dark:ring-${c}-700/58`],
540
+ // variants
541
+ [/^kbd-solid(-(\S+))?$/, ([, , c = "gray"]) => `kbd-ring-${c} bg-${c}-50 text-${c}-500 dark:bg-${c}-900 dark:text-${c}-400`],
542
+ [/^kbd-outline(-(\S+))?$/, ([, , c = "gray"]) => `kbd-ring-${c} bg-transparent text-${c}-500 dark:text-${c}-400`]
543
+ ];
544
+ const kbd = [
545
+ ...dynamicKbd,
546
+ staticKbd
547
+ ];
548
+
549
+ const staticLabel = {
550
+ // base
551
+ "label-base": "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:n-disabled"
552
+ };
553
+ const dynamicLabel = [
554
+ // dynamic preset
555
+ ];
556
+ const label = [
557
+ ...dynamicLabel,
558
+ staticLabel
559
+ ];
560
+
561
+ const staticLink = {
562
+ // base
563
+ link: ""
564
+ };
565
+ const dynamicLink = [
566
+ // dynamic preset
567
+ ];
568
+ const link = [
569
+ ...dynamicLink,
570
+ staticLink
571
+ ];
572
+
573
+ const staticNavLink = {
574
+ // config
575
+ "nav-link-default-variant": "nav-link-text-primary",
576
+ // base
577
+ "nav-link": "transition-base leading-6 justify-start gap-x-3 rounded-md",
578
+ // badge
579
+ "nav-link-badge": "min-w-max whitespace-nowrap rounded-full px-2.5 py-.5 leading-5",
580
+ // text-variant
581
+ "nav-link-text-gray": "hover:bg-$c-gray-100 hover:text-$c-gray-950",
582
+ "nav-link-active-text-gray": "bg-$c-gray-100 text-$c-gray-950",
583
+ "nav-link-inactive-text-gray": "text-$c-gray-950"
584
+ };
585
+ const dynamicNavLink = [
586
+ // text-variant
587
+ [/^nav-link-active-text(-(\S+))?$/, ([, , c = "primary"]) => `bg-$c-gray-100 text-${c}-600 dark:text-${c}-500`],
588
+ [/^nav-link-inactive-text(-(\S+))?$/, ([, , c = "gray"]) => `text-${c}-800 dark:text-${c}-100`],
589
+ [/^nav-link-text(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-text-${c}`],
590
+ // solid-variant
591
+ [/^nav-link-active-solid(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-700 dark:bg-${c}-400 text-white dark:text-${c}-950`],
592
+ [/^nav-link-inactive-solid(-(\S+))?$/, ([, , c = "primary"]) => `text-white dark:text-${c}-950`],
593
+ [/^nav-link-solid(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-solid-${c}`]
594
+ ];
595
+ const navLink = [
596
+ ...dynamicNavLink,
597
+ staticNavLink
598
+ ];
599
+
600
+ const staticNavLinkGroup = {
601
+ // base
602
+ "nav-link-group": "w-60 flex flex-col border-2 border-base rounded-md border-dashed p-2 space-y-1",
603
+ // panel
604
+ "nav-link-group-panel": "mt-1 px-2 space-y-1"
605
+ };
606
+ const dynamicNavLinkGroup = [];
607
+ const navLinkGroup = [
608
+ ...dynamicNavLinkGroup,
609
+ staticNavLinkGroup
610
+ ];
611
+
612
+ const staticPagination = {
613
+ // configurations
614
+ "pagination": "overflow-hidden",
615
+ "pagination-list": "flex items-center gap-1 overflow-hidden",
616
+ // components
617
+ "pagination-root": "",
618
+ "pagination-list-item": "pagination",
619
+ "pagination-ellipsis-base": "btn flex items-center justify-center",
620
+ "pagination-ellipsis-icon-base": "w-1em h-1em",
621
+ "pagination-ellipsis-icon": "i-lucide-ellipsis",
622
+ "pagination-first": "pagination",
623
+ "pagination-first-icon": "i-lucide-chevrons-left",
624
+ "pagination-prev": "pagination",
625
+ "pagination-prev-icon": "i-lucide-chevron-left",
626
+ "pagination-next": "pagination",
627
+ "pagination-next-icon": "i-lucide-chevron-right",
628
+ "pagination-last": "pagination",
629
+ "pagination-last-icon": "i-lucide-chevrons-right"
630
+ };
631
+ const dynamicPagination = [
632
+ [
633
+ /^pagination-ellipsis(?:-([^-]+))?(?:-([^-]+))?$/,
634
+ ([, variant = "text", color = "black"]) => `btn-${variant}-${color}`
635
+ ],
636
+ [
637
+ /^pagination-selected(?:-([^-]+))?(?:-([^-]+))?$/,
638
+ ([, variant = "solid", color = "primary"]) => `data-[selected=true]:btn-${variant}-${color}`
639
+ ],
640
+ [
641
+ /^pagination-unselected(?:-([^-]+))?(?:-([^-]+))?$/,
642
+ ([, variant = "solid", color = "white"]) => `data-[selected=false]:btn-${variant}-${color}`
643
+ ]
644
+ ];
645
+ const pagination = [
646
+ ...dynamicPagination,
647
+ staticPagination
648
+ ];
649
+
650
+ const staticPopover = {
651
+ "popover-content": "z-50 w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
652
+ };
653
+ const dynamicPopover = [
654
+ // dynamic preset
655
+ ];
656
+ const popover = [
657
+ ...dynamicPopover,
658
+ staticPopover
659
+ ];
660
+
661
+ const staticProgress = {
662
+ // base
663
+ "progress-indeterminate": "absolute bg-brand h-full",
664
+ // components
665
+ "progress-root": "relative h-0.5em w-full overflow-hidden bg-brand/20",
666
+ "progress-indicator": "h-full w-full flex-1 bg-brand transition-all",
667
+ // static
668
+ "progress-white": "bg-inverted",
669
+ "progress-black": "bg-base"
670
+ };
671
+ const dynamicProgress = [
672
+ [/^progress-(.*)$/, ([, body], { theme }) => {
673
+ const color = parseColor(body, theme);
674
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
675
+ return `n-${body}-600 dark:n-${body}-500`;
676
+ }]
677
+ ];
678
+ const progress = [
679
+ ...dynamicProgress,
680
+ staticProgress
681
+ ];
682
+
683
+ const staticRadio = {
684
+ // base
685
+ "radio": "radio-primary flex items-center transition-base border border-$c-ring rounded-full p-0.12em h-1em w-1em n-checked:border-brand n-checked:bg-brand",
686
+ "radio-disabled": "n-disabled",
687
+ "radio-label": "block text-sm font-medium leading-6",
688
+ "radio-input": "absolute w-full opacity-0",
689
+ "radio-reverse": "flex-row-reverse",
690
+ "radio-peer-focus": "peer-focus-(ring-2 ring-brand ring-offset-2 ring-offset-base)",
691
+ // wrappers
692
+ "radio-wrapper": "gap-x-3 relative inline-flex items-center hover:cursor-pointer",
693
+ // icon
694
+ "radio-icon-base": "m-auto opacity-0 text-inverted w-full h-full transition-base n-checked:opacity-100",
695
+ "radio-icon": "i-dot"
696
+ // refer to general.ts
697
+ };
698
+ const dynamicRadio = [
699
+ [/^radio-(.*)$/, ([, body], { theme }) => {
700
+ const color = parseColor(body, theme);
701
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
702
+ return `n-${body}-600 dark:n-${body}-500`;
703
+ }]
704
+ ];
705
+ const radio = [
706
+ ...dynamicRadio,
707
+ staticRadio
708
+ ];
709
+
710
+ const staticRadioGroup = {
711
+ // configurations
712
+ "radio-group": "gap-2 flex flex-wrap",
713
+ "radio-group-orientation-vertical": "flex-col",
714
+ "radio-group-orientation-horizontal": "flex-row",
715
+ // components
716
+ "radio-group-item-wrapper": "flex items-center space-x-2",
717
+ "radio-group-item": "aspect-square rounded-full border border-brand text-brand shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-base disabled:n-disabled",
718
+ "radio-group-indicator": "flex items-center justify-center",
719
+ "radio-group-indicator-icon-base": "h-0.875em w-0.875em fill-brand",
720
+ "radio-group-indicator-icon": "i-dot",
721
+ "radio-group-item-label": ""
722
+ };
723
+ const dynamicRadioGroup = [
724
+ [/^radio-group-(.*)$/, ([, body], { theme }) => {
725
+ const color = parseColor(body, theme);
726
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
727
+ return `n-${body}-600 dark:n-${body}-500`;
728
+ }]
729
+ ];
730
+ const radioGroup = [
731
+ ...dynamicRadioGroup,
732
+ staticRadioGroup
733
+ ];
734
+
735
+ const staticSelect = {
736
+ // configurations
737
+ "select": "",
738
+ "select-default-variant": "btn-solid-white",
739
+ "select-disabled": "n-disabled",
740
+ "select-scroll": "flex cursor-default items-center justify-center py-1",
741
+ "select-trigger-info-icon": "i-info",
742
+ "select-trigger-error-icon": "i-error",
743
+ "select-trigger-success-icon": "i-success",
744
+ "select-trigger-warning-icon": "i-warning",
745
+ // components
746
+ "select-root": "",
747
+ "select-trigger": "w-full [&>span]:truncate",
748
+ "select-trigger-trailing-icon": "i-lucide-chevrons-up-down !text-1.042em",
749
+ "select-trigger-trailing": "ml-auto",
750
+ "select-trigger-leading": "",
751
+ "select-value": "h-1.5em",
752
+ "select-content": "relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border border-base bg-popover text-popover shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
753
+ "select-content-popper": "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
754
+ "select-group": "p-1 w-full",
755
+ "select-separator": "-mx-1 my-1 h-px bg-muted",
756
+ "select-item": "select-item-gray relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-1em outline-none data-[disabled]:pointer-events-none data-[disabled]:n-disabled",
757
+ "select-item-indicator": "absolute left-2 h-0.75em w-0.75em flex items-center justify-center",
758
+ "select-item-indicator-icon": "i-check",
759
+ "select-viewport": "p-1",
760
+ "select-viewport-popper": "h-[--radix-select-trigger-height] w-full min-w-[--radix-select-trigger-width]",
761
+ "select-scroll-up-button": "select-scroll",
762
+ "select-scroll-down-button": "select-scroll",
763
+ "select-scroll-up-button-icon": "i-lucide-chevron-up",
764
+ "select-scroll-down-button-icon": "i-lucide-chevron-down",
765
+ "select-label": "py-1.5 pl-8 pr-2 text-1em font-semibold",
766
+ // ⚠️ for overriding purposes only
767
+ "select-item-selectItem": ""
768
+ };
769
+ const dynamicSelect = [
770
+ [/^select-([^-]+)-([^-]+)$/, ([, v = "solid", c = "gray"]) => `btn-${v}-${c}`],
771
+ [/^select-item(-(\S+))?$/, ([, , c = "gray"]) => `focus:bg-${c}-100 focus:text-${c}-800 dark:focus:bg-${c}-800 dark:focus:text-${c}-100`]
772
+ ];
773
+ const select = [
774
+ ...dynamicSelect,
775
+ staticSelect
776
+ ];
777
+
778
+ const staticSeparator = {
779
+ // base
780
+ "separator": "text-md shrink-0 relative",
781
+ "separator-default-variant": "separator-solid-gray",
782
+ "separator-content": "text-0.75em text-muted bg-base absolute flex justify-center items-center",
783
+ // orientation states
784
+ "separator-horizontal": "h-px my-4 w-full border-t-0.0625em",
785
+ "separator-vertical": "w-px mx-4 h-full border-l-0.0625em",
786
+ "separator-content-horizontal": "h-1px py-1 px-2",
787
+ "separator-content-vertical": "w-1px px-1 py-2",
788
+ // horizontal positions
789
+ "separator-position-left": "left-6 top-1/2 -translate-y-1/2",
790
+ "separator-position-right": "right-6 top-1/2 -translate-y-1/2",
791
+ "separator-position-center": "left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2",
792
+ // vertical positions
793
+ "separator-position-bottom": "bottom-4 left-1/2 -translate-x-1/2",
794
+ "separator-position-top": "top-4 left-1/2 -translate-x-1/2",
795
+ // static variants
796
+ "separator-solid-gray": "border-base"
797
+ };
798
+ const dynamicSeparator = [
799
+ // dynamic variants
800
+ [/^separator-solid(-(\S+))?$/, ([, , c = "gray"]) => `border-solid border-${c}-200 dark:border-${c}-700/58`],
801
+ [/^separator-dashed(-(\S+))?$/, ([, , c = "gray"]) => `border-dashed border-${c}-200 dark:border-${c}-700/58`],
802
+ [/^separator-dotted(-(\S+))?$/, ([, , c = "gray"]) => `border-dotted border-${c}-200 dark:border-${c}-700/58`]
803
+ ];
804
+ const separator = [
805
+ ...dynamicSeparator,
806
+ staticSeparator
807
+ ];
808
+
809
+ const staticSkeleton = {
810
+ // base
811
+ skeleton: "skeleton-gray text-md animate-pulse rounded-md w-full h-0.5em bg-brand"
812
+ };
813
+ const dynamicSkeleton = [
814
+ [/^skeleton-(.*)$/, ([, body], { theme }) => {
815
+ const color = parseColor(body, theme);
816
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
817
+ return `n-${body}-100 dark:n-${body}-800`;
818
+ }]
819
+ ];
820
+ const skeleton = [
821
+ ...dynamicSkeleton,
822
+ staticSkeleton
823
+ ];
824
+
825
+ const staticSlider = {
826
+ // configurations
827
+ "slider-disabled": "n-disabled",
828
+ "slider-root-vertical": "flex-col w-1em h-full",
829
+ "slider-track-vertical": "w-0.5em h-full",
830
+ "slider-range-vertical": "w-full",
831
+ "slider-thumb-vertical": "w-1.25em h-1.25em",
832
+ // components
833
+ "slider-root": "relative flex w-full touch-none select-none items-center",
834
+ "slider-track": "h-0.5em relative w-full grow overflow-hidden rounded-full bg-muted",
835
+ "slider-range": "absolute h-full bg-brand",
836
+ "slider-thumb": "w-1.25em h-1.25em block border-2 border-brand rounded-full bg-base focus-visible:ring-base ring-offset-base transition-colors disabled:slider-disabled focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
837
+ "slider-accent": "n-gray-300 dark:n-gray-800"
838
+ };
839
+ const dynamicSlider = [
840
+ [/^slider-(.*)$/, ([, body], { theme }) => {
841
+ const color = parseColor(body, theme);
842
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
843
+ return `n-${body}-600 dark:n-${body}-500`;
844
+ }]
845
+ ];
846
+ const slider = [
847
+ ...dynamicSlider,
848
+ staticSlider
849
+ ];
850
+
851
+ const staticSwitch = {
852
+ // base
853
+ "switch": "bg-brand switch-focus h-1.25em w-2.25em switch-disabled inline-flex shrink-0 cursor-pointer items-center border-2 border-transparent rounded-full shadow-sm",
854
+ "switch-disabled": "data-[disabled]:n-disabled",
855
+ "switch-focus": "focus-visible:ring-brand focus-visible:ring-offset-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
856
+ // thumb
857
+ "switch-thumb": "square-1em flex items-center justify-center absolute pointer-events-none block border border-base rounded-full bg-base shadow-lg ring-0 transition-transform",
858
+ "switch-thumb-checked": "translate-x-1.01em",
859
+ "switch-thumb-unchecked": "translate-x-0.03em",
860
+ // icon
861
+ "switch-icon": "text-0.7em",
862
+ "switch-icon-unchecked": "text-muted",
863
+ "switch-icon-checked": "text-muted",
864
+ // loading
865
+ "switch-loading-icon": "text-gray animate-spin text-0.8em",
866
+ "switch-loading-icon-name": "i-loading"
867
+ };
868
+ const dynamicSwitch = [
869
+ [
870
+ /^switch-checked(?:-([^-]+))?(?:-([^-]+))?$/,
871
+ ([, color = "primary"], { theme }) => {
872
+ const parsedColor = parseColor$1(color, theme);
873
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
874
+ return `data-[state=checked]:n-${color}-600 dark:data-[state=checked]:n-${color}-500`;
875
+ }
876
+ ],
877
+ [
878
+ /^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
879
+ ([, color = "gray"], { theme }) => {
880
+ const parsedColor = parseColor$1(color, theme);
881
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
882
+ return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
883
+ }
884
+ ]
885
+ ];
886
+ const _switch = [
887
+ ...dynamicSwitch,
888
+ staticSwitch
889
+ ];
890
+
891
+ const staticTable = {
892
+ // config
893
+ "table-default-variant": "table-solid-gray",
894
+ "table": "",
895
+ // table-root
896
+ "table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
897
+ "table-root": "w-full caption-bottom text-sm",
898
+ "table-body": "[&_tr:last-child]:border-0",
899
+ "table-caption": "mt-4 text-sm text-muted",
900
+ // table-head
901
+ "table-head": "h-12 px-4 text-left align-middle font-medium text-muted [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
902
+ "table-head-pinned": "sticky bg-base",
903
+ "table-head-pinned-left": "left-0",
904
+ "table-head-pinned-right": "right-0",
905
+ // table-header
906
+ "table-header": "[&_tr]:border-b [&_tr]:border-base",
907
+ // table-row
908
+ "table-row": "border-b border-base transition-colors hover:bg-muted data-[filter=true]:hover:bg-base data-[state=selected]:bg-muted",
909
+ // table-cell
910
+ "table-cell": "p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
911
+ "table-cell-pinned": "sticky bg-base",
912
+ "table-cell-pinned-left": "left-0",
913
+ "table-cell-pinned-right": "right-0",
914
+ // table-empty
915
+ "table-empty-row": "",
916
+ "table-empty-cell": "p-4 whitespace-nowrap align-middle text-sm text-muted bg-base",
917
+ "table-empty": "flex items-center justify-center py-10",
918
+ // table-loading
919
+ "table-loading-icon": "animate-spin text-lg",
920
+ // TODO: to add
921
+ "table-loading-icon-name": "i-lucide-refresh-ccw",
922
+ // TODO: to add
923
+ "table-loading-row": "data-[loading=true]:border-0 absolute inset-x-0 -mt-1.5px",
924
+ "table-loading-cell": "",
925
+ "table-loading": "absolute inset-x-0 overflow-hidden p-0",
926
+ // table-footer
927
+ "table-footer": "border-t border-base bg-muted font-medium [&>tr]:last:border-b-0"
928
+ };
929
+ const dynamicTable = [];
930
+ const table = [
931
+ ...dynamicTable,
932
+ staticTable
933
+ ];
934
+
935
+ const staticTabs = {
936
+ // configurations
937
+ "tabs": "transition-colors duration-200 ease-out",
938
+ "tabs-default-variant": "tabs-soft-black",
939
+ "tabs-disabled": "n-disabled",
940
+ // components
941
+ "tabs-root": "flex flex-col w-full",
942
+ "tabs-trigger": "w-full focus-visible:z-10",
943
+ "tabs-list": "flex bg-muted items-center justify-center rounded-md p-1 w-full",
944
+ "tabs-content": "mt-4 text-base"
945
+ };
946
+ const dynamicTabs = [
947
+ [/^tabs-([^-]+)-([^-]+)$/, ([, v = "solid", c = "primary"]) => `data-[state=active]:btn-${v}-${c}`]
948
+ ];
949
+ const tabs = [
950
+ ...dynamicTabs,
951
+ staticTabs
952
+ ];
953
+
954
+ const staticToast = {
955
+ // config
956
+ "toast": "pointer-events-auto relative flex w-full space-x-2 justify-end overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all ",
957
+ "toast-viewport": "fixed top-0 z-100 flex max-h-screen gap-y-4 w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-420px",
958
+ "toast-wrapper": "w-0 flex flex-1 flex-col gap-2",
959
+ "toast-title": "text-sm font-semibold [&+div]:text-xs",
960
+ "toast-description": "text-sm opacity-90",
961
+ "toast-leading": "square-5",
962
+ "toast-close": "bg-transparent flex items-center justify-center absolute right-1 top-1 rounded-md p-1 text-brand/80 opacity-0 transition-opacity hover:text-brand focus:opacity-100 focus:ring-1 focus:ring-brand/80 focus:outline-none group-hover:opacity-100",
963
+ "toast-close-icon": "i-close",
964
+ "toast-close-icon-base": "h-1em w-1em",
965
+ "toast-info": "grid gap-1",
966
+ "toast-actions": "flex shrink-0 gap-1.5",
967
+ "toast-progress": "h-1 rounded-none"
968
+ };
969
+ const dynamicToast = [
970
+ // dynamic variants
971
+ [/^toast-solid(-(\S+))?$/, ([, , c = "primary"]) => `alert-solid-${c}`],
972
+ [/^toast-soft(-(\S+))?$/, ([, , c = "primary"]) => `alert-soft-${c}`],
973
+ [/^toast-outline(-(\S+))?$/, ([, , c = "primary"]) => `alert-outline-${c}`],
974
+ [/^toast-border(-(\S+))?$/, ([, , c = "primary"]) => `alert-border-${c}`]
975
+ ];
976
+ const toast = [
977
+ ...dynamicToast,
978
+ staticToast
979
+ ];
980
+
981
+ const staticToggle = {
982
+ // configurations
983
+ toggle: ""
984
+ };
985
+ const dynamicToggle = [
986
+ [
987
+ /^toggle-on(?:-([^-]+))?(?:-([^-]+))?$/,
988
+ ([, variant = "soft", color = "accent"]) => `data-[state=on]:btn-${variant}-${color}`
989
+ ],
990
+ [
991
+ /^toggle-off(?:-([^-]+))?(?:-([^-]+))?$/,
992
+ ([, variant = "ghost", color = "muted"]) => `data-[state=off]:btn-${variant}-${color}`
993
+ ]
994
+ ];
995
+ const toggle = [
996
+ ...dynamicToggle,
997
+ staticToggle
998
+ ];
999
+
1000
+ const staticTooltip = {
1001
+ "tooltip-content": "z-50 overflow-hidden rounded-md px-0.75em py-0.375em text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1002
+ "tooltip-white": "border border-base bg-popover text-popover",
1003
+ "tooltip-black": "border border-foreground bg-popover-foreground text-popover-foreground"
1004
+ };
1005
+ const dynamicTooltip = [
1006
+ [/^tooltip-(.*)$/, ([, c], { theme }) => {
1007
+ const color = parseColor(c, theme);
1008
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
1009
+ return `bg-${c}-100 border-${c}-50 text-${c}-800 dark:bg-${c}-800 dark:border-${c}-800 dark:text-${c}-100`;
1010
+ }]
1011
+ ];
1012
+ const tooltip = [
1013
+ ...dynamicTooltip,
1014
+ staticTooltip
1015
+ ];
1016
+
1017
+ const shortcuts = [
1018
+ ...general,
1019
+ ...breadcrumb,
1020
+ ...accordion,
1021
+ ...btn,
1022
+ ...dialog,
1023
+ ...formGroup,
1024
+ ...input,
1025
+ ...icon,
1026
+ ..._switch,
1027
+ ...alert,
1028
+ ...badge,
1029
+ ...avatarGroup,
1030
+ ...avatar,
1031
+ ...indicator,
1032
+ ...kbd,
1033
+ ...navLink,
1034
+ ...navLinkGroup,
1035
+ ...link,
1036
+ ...radio,
1037
+ ...checkbox,
1038
+ ...slider,
1039
+ ...progress,
1040
+ ...skeleton,
1041
+ ...tabs,
1042
+ ...select,
1043
+ ...separator,
1044
+ ...card,
1045
+ ...table,
1046
+ ...dropdowMenu,
1047
+ ...label,
1048
+ ...popover,
1049
+ ...tooltip,
1050
+ ...pagination,
1051
+ ...toast,
1052
+ ...toggle,
1053
+ ...collapsible,
1054
+ ...radioGroup,
1055
+ ...form
1056
+ ];
1057
+
1058
+ export { shortcuts as s };