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