@frontile/theme 0.18.0-alpha.0 → 0.18.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +20 -22
  2. package/declarations/colors/config.d.ts +8 -32
  3. package/declarations/colors/palette-absolute.d.ts +2 -2
  4. package/declarations/colors/palette.d.ts +1 -1
  5. package/declarations/colors/types.d.ts +102 -151
  6. package/declarations/components/button.d.ts +13 -0
  7. package/declarations/components/dropdown.d.ts +2 -2
  8. package/declarations/components/forms/forms.d.ts +414 -23
  9. package/declarations/components/listbox.d.ts +5 -0
  10. package/declarations/components/popover.d.ts +2 -2
  11. package/declarations/components/progress-bar.d.ts +15 -0
  12. package/declarations/components/spinner.d.ts +5 -0
  13. package/declarations/plugin/default-config.d.ts +8 -32
  14. package/dist/colors.js +1 -1
  15. package/dist/config-CDp8PRHs.js +370 -0
  16. package/dist/config-CDp8PRHs.js.map +1 -0
  17. package/dist/{forms-legacy-B-L2HELt.js → forms-legacy-CgoY8bbm.js} +256 -170
  18. package/dist/forms-legacy-CgoY8bbm.js.map +1 -0
  19. package/dist/index.js +3 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/plugin.js +10 -6
  22. package/dist/plugin.js.map +1 -1
  23. package/dist/styles/font-faces.css +52 -8
  24. package/dist/styles/typography.css +213 -117
  25. package/package.json +24 -19
  26. package/public/fonts/domine-variable.woff2 +0 -0
  27. package/public/fonts/open-sans-italic-variable.woff2 +0 -0
  28. package/public/fonts/open-sans-variable.woff2 +0 -0
  29. package/public/fonts/source-code-pro-italic-variable.woff2 +0 -0
  30. package/public/fonts/source-code-pro-variable.woff2 +0 -0
  31. package/src/styles/font-faces.css +52 -8
  32. package/src/styles/typography.css +213 -117
  33. package/dist/config-4CswsBlg.js +0 -342
  34. package/dist/config-4CswsBlg.js.map +0 -1
  35. package/dist/config-B3XkEtHW.js +0 -377
  36. package/dist/config-B3XkEtHW.js.map +0 -1
  37. package/dist/config-BpWBpuzR.js +0 -335
  38. package/dist/config-BpWBpuzR.js.map +0 -1
  39. package/dist/config-Cle59Y4k.js +0 -523
  40. package/dist/config-Cle59Y4k.js.map +0 -1
  41. package/dist/config-D0EoeVzn.js +0 -388
  42. package/dist/config-D0EoeVzn.js.map +0 -1
  43. package/dist/config-DBAavoE2.js +0 -336
  44. package/dist/config-DBAavoE2.js.map +0 -1
  45. package/dist/config-Oysuq2Z9.js +0 -341
  46. package/dist/config-Oysuq2Z9.js.map +0 -1
  47. package/dist/config-PYki2g7N.js +0 -335
  48. package/dist/config-PYki2g7N.js.map +0 -1
  49. package/dist/forms-legacy-15iy0KmK.js +0 -1851
  50. package/dist/forms-legacy-15iy0KmK.js.map +0 -1
  51. package/dist/forms-legacy-B-L2HELt.js.map +0 -1
  52. package/dist/forms-legacy-BMIAioRi.js +0 -1807
  53. package/dist/forms-legacy-BMIAioRi.js.map +0 -1
  54. package/dist/forms-legacy-B_EygtyK.js +0 -1763
  55. package/dist/forms-legacy-B_EygtyK.js.map +0 -1
  56. package/dist/forms-legacy-Bg_UoLDR.js +0 -1763
  57. package/dist/forms-legacy-Bg_UoLDR.js.map +0 -1
  58. package/dist/forms-legacy-CVLZ-9BG.js +0 -1804
  59. package/dist/forms-legacy-CVLZ-9BG.js.map +0 -1
  60. package/dist/forms-legacy-CuFc3hcn.js +0 -1807
  61. package/dist/forms-legacy-CuFc3hcn.js.map +0 -1
  62. package/dist/forms-legacy-DiKImAli.js +0 -1809
  63. package/dist/forms-legacy-DiKImAli.js.map +0 -1
  64. package/dist/forms-legacy-edWQVbZP.js +0 -1809
  65. package/dist/forms-legacy-edWQVbZP.js.map +0 -1
  66. package/dist/semantic-DUv6Lpqq.js +0 -218
  67. package/dist/semantic-DUv6Lpqq.js.map +0 -1
  68. package/public/fonts/stix-two-text-italic-variable.woff2 +0 -0
  69. package/public/fonts/stix-two-text-variable.woff2 +0 -0
@@ -1,1851 +0,0 @@
1
- import { extendTailwindMerge } from 'tailwind-merge';
2
- import { createTV } from 'tailwind-variants';
3
-
4
- function flat(arr, target) {
5
- arr.forEach(el => {
6
- if (Array.isArray(el)) {
7
- flat(el, target);
8
- } else {
9
- target.push(el);
10
- }
11
- });
12
- }
13
- function flatArray(arr) {
14
- const flattened = [];
15
- flat(arr, flattened);
16
- return flattened;
17
- }
18
- const voidEmpty = value => value ? value : undefined;
19
- const clsx = (...classes) => {
20
- return voidEmpty(flatArray(classes).filter(Boolean).join(' '));
21
- };
22
-
23
- // Common size units used across all design tokens (icons, typography, etc.)
24
- const COMMON_UNITS = ['pico', 'nano', 'micro', '3xs', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', 'kilo', 'mega'];
25
- const ELEVATION_LEVELS = ['0', '1', '2', '3', '4', '5'];
26
- const twMergeBase = extendTailwindMerge({
27
- extend: {
28
- classGroups: {
29
- // Icon sizes
30
- 'icon-size': [{
31
- 'size-icon': COMMON_UNITS
32
- }],
33
- // Border widths (directional variants handled automatically)
34
- 'border-w': [{
35
- border: ['thin', 'heavy', 'aggressive']
36
- }],
37
- // Border radius (extend existing rounded utilities)
38
- rounded: [{
39
- rounded: ['default', 'pill']
40
- }],
41
- // Elevation shadows
42
- shadow: [{
43
- 'shadow-elevation': ELEVATION_LEVELS
44
- }],
45
- // Opacity
46
- opacity: [{
47
- opacity: ['hover', 'disabled']
48
- }],
49
- // Typography composite text styles (extend font-size class group)
50
- // These set font-size + other properties, so they should conflict with text-* utilities
51
- 'font-size': [{
52
- 'text-marquee': [...COMMON_UNITS]
53
- }, {
54
- 'text-header': [...COMMON_UNITS]
55
- }, {
56
- 'text-body': [...COMMON_UNITS]
57
- }, {
58
- 'text-code': [...COMMON_UNITS]
59
- }, {
60
- 'text-caption': [...COMMON_UNITS]
61
- }, {
62
- 'text-label': [...COMMON_UNITS]
63
- }]
64
- },
65
- conflictingClassGroups: {
66
- 'icon-size': ['w', 'h', 'size']
67
- }
68
- }
69
- });
70
- function twMerge(defaultClass, overwrites) {
71
- if (overwrites) {
72
- return twMergeBase(clsx(defaultClass, overwrites));
73
- }
74
- return clsx(defaultClass);
75
- }
76
- const tv = createTV({
77
- twMerge: true,
78
- twMergeConfig: {
79
- extend: {
80
- classGroups: {
81
- // Icon sizes
82
- 'icon-size': [{
83
- 'size-icon': COMMON_UNITS
84
- }],
85
- // Border widths (directional variants handled automatically)
86
- 'border-w': [{
87
- border: ['thin', 'heavy', 'aggressive']
88
- }],
89
- // Border radius (extend existing rounded utilities)
90
- rounded: [{
91
- rounded: ['default', 'pill']
92
- }],
93
- // Elevation shadows
94
- shadow: [{
95
- 'shadow-elevation': ELEVATION_LEVELS
96
- }],
97
- // Opacity
98
- opacity: [{
99
- opacity: ['hover', 'disabled']
100
- }],
101
- // Typography composite text styles (extend font-size class group)
102
- // These set font-size + other properties, so they should conflict with text-* utilities
103
- 'font-size': [{
104
- 'text-marquee': [...COMMON_UNITS]
105
- }, {
106
- 'text-header': [...COMMON_UNITS]
107
- }, {
108
- 'text-body': [...COMMON_UNITS]
109
- }, {
110
- 'text-code': [...COMMON_UNITS]
111
- }, {
112
- 'text-caption': [...COMMON_UNITS]
113
- }, {
114
- 'text-label': [...COMMON_UNITS]
115
- }]
116
- },
117
- conflictingClassGroups: {
118
- 'icon-size': ['w', 'h', 'size']
119
- }
120
- }
121
- }
122
- });
123
-
124
- const avatar = tv({
125
- slots: {
126
- base: ['flex', 'relative', 'justify-center', 'items-center', 'box-border', 'overflow-hidden', 'align-middle', 'text-neutral-strong', 'z-0', 'bg-neutral-subtle', 'ring-1 ring-default ring-offset-1 ring-offset-background'],
127
- img: 'size-full',
128
- name: ['w-full', 'font-normal', 'text-center', 'text-inherit', 'absolute', 'top-1/2', 'left-1/2', '-translate-x-1/2', '-translate-y-1/2', 'select-none']
129
- },
130
- variants: {
131
- shape: {
132
- square: 'rounded-[20%]',
133
- circle: 'rounded-full'
134
- },
135
- size: {
136
- xs: {
137
- base: 'size-5 text-xs'
138
- },
139
- sm: {
140
- base: 'size-6 text-sm'
141
- },
142
- md: {
143
- base: 'size-8 text-base'
144
- },
145
- lg: {
146
- base: 'size-10 text-lg'
147
- },
148
- xl: {
149
- base: 'size-12 text-xl'
150
- }
151
- }
152
- },
153
- defaultVariants: {
154
- size: 'md',
155
- shape: 'circle'
156
- }
157
- });
158
-
159
- const focusVisibleRing = ['outline-hidden', 'focus-visible:z-10', 'focus-visible:ring-3', 'focus-visible:ring-focus', 'focus-visible:ring-offset-2', 'focus-visible:ring-offset-background'];
160
- const focusVisibleWithinRing = ['outline-hidden', 'has-focus-visible:z-10', 'has-focus-visible:ring-3', 'has-[:focus-visible]:ring-focus', 'has-focus-visible:ring-offset-2', 'has-[:focus-visible]:ring-offset-background'];
161
-
162
- const baseButton = tv({
163
- base: ['leading-tight', 'inline-block', 'font-semibold', 'border', 'border-transparent', 'rounded-sm', 'disabled:cursor-not-allowed', 'disabled:opacity-40', ...focusVisibleRing],
164
- variants: {
165
- appearance: {
166
- outlined: ''
167
- },
168
- isInGroup: {
169
- true: ['rounded-none first:rounded-l last:rounded-r', '[&:not(:first-child):not(:last-child)]:rounded-none', 'not-last-of-type:-me-px']
170
- },
171
- intent: {
172
- default: '',
173
- primary: 'focus-visible:ring-brand-soft',
174
- success: 'focus-visible:ring-success-soft',
175
- warning: 'focus-visible:ring-warning',
176
- danger: 'focus-visible:ring-danger'
177
- },
178
- size: {
179
- xs: 'text-sm px-2 py-1',
180
- sm: 'text-sm px-3 py-2',
181
- md: 'text-base px-4 py-2',
182
- lg: 'text-base px-5 py-4',
183
- xl: 'text-xl px-6 py-5'
184
- }
185
- },
186
- compoundVariants: [
187
- // APPEARANCE: outlined
188
- {
189
- appearance: 'outlined',
190
- intent: 'default',
191
- class: 'text-neutral-medium hover:text-background border-neutral-medium hover:bg-neutral-medium'
192
- }, {
193
- appearance: 'outlined',
194
- intent: 'primary',
195
- class: 'text-brand hover:text-on-brand border-brand-medium hover:bg-brand'
196
- }, {
197
- appearance: 'outlined',
198
- intent: 'success',
199
- class: 'text-success hover:text-on-success border-success hover:bg-success'
200
- }, {
201
- appearance: 'outlined',
202
- intent: 'warning',
203
- class: 'text-warning hover:text-on-warning border-warning hover:bg-warning'
204
- }, {
205
- appearance: 'outlined',
206
- intent: 'danger',
207
- class: 'text-danger hover:text-on-danger border-danger hover:bg-danger'
208
- }],
209
- defaultVariants: {
210
- size: 'md',
211
- intent: 'default'
212
- }
213
- });
214
- const button = tv({
215
- extend: baseButton,
216
- base: [''],
217
- variants: {
218
- appearance: {
219
- default: '',
220
- outlined: '',
221
- minimal: '',
222
- custom: ''
223
- }
224
- },
225
- compoundVariants: [
226
- // APPEARANCE: default
227
- {
228
- appearance: 'default',
229
- intent: 'default',
230
- class: 'bg-neutral-strong text-on-neutral-strong hover:bg-neutral-strong/80'
231
- }, {
232
- appearance: 'default',
233
- intent: 'primary',
234
- class: 'bg-brand text-on-brand hover:bg-brand-strong'
235
- }, {
236
- appearance: 'default',
237
- intent: 'success',
238
- class: 'bg-success-soft text-on-success-soft hover:bg-success-soft/80'
239
- }, {
240
- appearance: 'default',
241
- intent: 'warning',
242
- class: 'bg-warning-soft text-black hover:bg-warning-soft/80'
243
- }, {
244
- appearance: 'default',
245
- intent: 'danger',
246
- class: 'bg-danger text-on-danger hover:bg-danger/80'
247
- },
248
- // APPEARANCE: minimal
249
- {
250
- appearance: 'minimal',
251
- intent: 'default',
252
- class: 'text-neutral-medium hover:text-on-neutral hover:bg-neutral'
253
- }, {
254
- appearance: 'minimal',
255
- intent: 'primary',
256
- class: 'text-brand hover:text-on-brand hover:bg-brand'
257
- }, {
258
- appearance: 'minimal',
259
- intent: 'success',
260
- class: 'text-success hover:text-on-success hover:bg-success'
261
- }, {
262
- appearance: 'minimal',
263
- intent: 'warning',
264
- class: 'text-warning hover:text-on-warning hover:bg-warning'
265
- }, {
266
- appearance: 'minimal',
267
- intent: 'danger',
268
- class: 'text-danger hover:text-on-danger hover:bg-danger'
269
- },
270
- // APPEARANCE: custom
271
- {
272
- appearance: 'custom',
273
- intent: 'default',
274
- class: 'text-neutral-medium'
275
- }, {
276
- appearance: 'custom',
277
- intent: 'primary',
278
- class: 'text-brand'
279
- }, {
280
- appearance: 'custom',
281
- intent: 'success',
282
- class: 'text-success'
283
- }, {
284
- appearance: 'custom',
285
- intent: 'warning',
286
- class: 'text-warning'
287
- }, {
288
- appearance: 'custom',
289
- intent: 'danger',
290
- class: 'text-danger'
291
- }],
292
- defaultVariants: {
293
- size: 'md',
294
- intent: 'primary'
295
- }
296
- });
297
- const toggleButton = tv({
298
- extend: baseButton,
299
- base: [''],
300
- variants: {
301
- isSelected: {
302
- true: ''
303
- }
304
- },
305
- compoundVariants: [{
306
- appearance: 'outlined',
307
- intent: 'default',
308
- isSelected: true,
309
- class: 'bg-neutral-strong text-on-neutral-strong hover:bg-neutral-strong/80 dark:bg-neutral dark:text-neutral-strong dark:hover:bg-neutral/40'
310
- }, {
311
- appearance: 'outlined',
312
- intent: 'primary',
313
- isSelected: true,
314
- class: 'bg-brand text-on-brand hover:bg-brand/80'
315
- }, {
316
- appearance: 'outlined',
317
- intent: 'success',
318
- isSelected: true,
319
- class: 'bg-success text-on-success hover:bg-success/80'
320
- }, {
321
- appearance: 'outlined',
322
- intent: 'warning',
323
- isSelected: true,
324
- class: 'bg-warning text-on-warning hover:bg-warning/80'
325
- }, {
326
- appearance: 'outlined',
327
- intent: 'danger',
328
- isSelected: true,
329
- class: 'bg-danger text-on-danger hover:bg-danger/80'
330
- }]
331
- });
332
- const buttonGroup = tv({
333
- base: ['inline-flex items-center justify-center h-auto']
334
- });
335
-
336
- const chip = tv({
337
- slots: {
338
- base: ['leading-tight', 'disabled:cursor-not-allowed', 'disabled:opacity-40', 'whitespace-nowrap', 'inline-flex items-center justify-between box-border'],
339
- content: ['flex-1 text-inherit font-normal'],
340
- dot: ['w-2', 'h-2', 'ml-1', 'rounded-full'],
341
- closeButton: ['p-0.5']
342
- },
343
- variants: {
344
- isDisabled: {
345
- true: 'opacity-40'
346
- },
347
- appearance: {
348
- default: '',
349
- outlined: '',
350
- faded: ''
351
- },
352
- intent: {
353
- default: {
354
- dot: 'bg-neutral-strong dark:bg-neutral-medium',
355
- closeButton: ['bg-neutral-soft', 'text-on-neutral-soft dark:text-background', 'dark:bg-neutral-medium', 'hover:bg-neutral-soft/60 dark:hover:bg-neutral-medium/60']
356
- },
357
- primary: {
358
- dot: 'bg-brand',
359
- closeButton: ['bg-brand-medium', 'text-background', 'hover:bg-brand-medium/60', 'focus-visible:ring-brand-medium']
360
- },
361
- success: {
362
- dot: 'bg-success',
363
- closeButton: ['bg-success', 'text-background', 'hover:bg-success/60', 'focus-visible:ring-success']
364
- },
365
- warning: {
366
- dot: 'bg-warning',
367
- closeButton: ['bg-warning', 'text-background', 'hover:bg-warning/60', 'focus-visible:ring-warning']
368
- },
369
- danger: {
370
- dot: 'bg-danger',
371
- closeButton: ['bg-danger', 'text-background', 'hover:bg-danger/60', 'focus-visible:ring-danger']
372
- }
373
- },
374
- size: {
375
- sm: {
376
- base: 'text-xs px-1 h-6',
377
- content: 'px-1',
378
- closeButton: 'text-xs'
379
- },
380
- md: {
381
- base: 'text-sm px-1 h-7',
382
- content: 'px-2',
383
- closeButton: 'text-sm'
384
- },
385
- lg: {
386
- base: 'text-lg px-2 h-8',
387
- content: 'px-2',
388
- closeButton: 'text-lg'
389
- }
390
- },
391
- radius: {
392
- none: 'rounded-none',
393
- sm: 'rounded-sm',
394
- lg: 'rounded-lg',
395
- full: 'rounded-full'
396
- }
397
- },
398
- compoundVariants: [
399
- // APPEARANCE: default
400
- {
401
- appearance: 'default',
402
- intent: 'default',
403
- class: {
404
- base: 'bg-neutral-strong text-on-neutral-strong dark:bg-neutral dark:text-neutral-strong'
405
- }
406
- }, {
407
- appearance: 'default',
408
- intent: 'primary',
409
- class: {
410
- base: 'bg-brand text-on-brand'
411
- }
412
- }, {
413
- appearance: 'default',
414
- intent: 'success',
415
- class: {
416
- base: 'bg-success text-on-success'
417
- }
418
- }, {
419
- appearance: 'default',
420
- intent: 'warning',
421
- class: {
422
- base: 'bg-warning text-on-warning'
423
- }
424
- }, {
425
- appearance: 'default',
426
- intent: 'danger',
427
- class: {
428
- base: 'bg-danger text-on-danger'
429
- }
430
- },
431
- // APPEARANCE: faded
432
- {
433
- appearance: 'faded',
434
- intent: 'default',
435
- class: {
436
- base: 'text-neutral-medium border border-neutral-medium bg-neutral-soft/20'
437
- }
438
- }, {
439
- appearance: 'faded',
440
- intent: 'primary',
441
- class: {
442
- base: 'text-brand border border-brand-medium bg-brand-soft/20'
443
- }
444
- }, {
445
- appearance: 'faded',
446
- intent: 'success',
447
- class: {
448
- base: 'text-success border border-success bg-success-soft/20'
449
- }
450
- }, {
451
- appearance: 'faded',
452
- intent: 'warning',
453
- class: {
454
- base: 'text-warning border border-warning bg-warning-soft/20'
455
- }
456
- }, {
457
- appearance: 'faded',
458
- intent: 'danger',
459
- class: {
460
- base: 'text-danger border border-danger bg-danger-soft/20'
461
- }
462
- },
463
- // APPEARANCE: outlined
464
- {
465
- appearance: 'outlined',
466
- intent: 'default',
467
- class: {
468
- base: 'text-neutral-medium border border-neutral-medium'
469
- }
470
- }, {
471
- appearance: 'outlined',
472
- intent: 'primary',
473
- class: {
474
- base: 'text-brand border border-brand-medium'
475
- }
476
- }, {
477
- appearance: 'outlined',
478
- intent: 'success',
479
- class: {
480
- base: 'text-success border border-success'
481
- }
482
- }, {
483
- appearance: 'outlined',
484
- intent: 'warning',
485
- class: {
486
- base: 'text-warning border border-warning'
487
- }
488
- }, {
489
- appearance: 'outlined',
490
- intent: 'danger',
491
- class: {
492
- base: 'text-danger border border-danger'
493
- }
494
- }],
495
- defaultVariants: {
496
- size: 'md',
497
- intent: 'default',
498
- appearance: 'default',
499
- radius: 'full'
500
- }
501
- });
502
-
503
- const progressBar = tv({
504
- slots: {
505
- base: ['overflow-hidden w-full bg-surface-overlay-soft'],
506
- label: ['flex justify-between pb-1 gap-2 leading-tight'],
507
- progress: [''],
508
- description: ['text-neutral-soft text-xs pb-1']
509
- },
510
- variants: {
511
- isIndeterminate: {
512
- true: {
513
- progress: ['animate-loading origin-left']
514
- }
515
- },
516
- intent: {
517
- default: {
518
- progress: 'bg-neutral-strong dark:bg-neutral'
519
- },
520
- primary: {
521
- progress: 'bg-brand-soft'
522
- },
523
- success: {
524
- progress: 'bg-success-soft'
525
- },
526
- warning: {
527
- progress: 'bg-warning-soft'
528
- },
529
- danger: {
530
- progress: 'bg-danger-soft'
531
- }
532
- },
533
- size: {
534
- xs: {
535
- base: 'h-1',
536
- progress: 'h-1',
537
- label: 'text-xs',
538
- description: 'text-xs'
539
- },
540
- sm: {
541
- base: 'h-2',
542
- progress: 'h-2',
543
- label: 'text-sm',
544
- description: 'text-sm'
545
- },
546
- md: {
547
- base: 'h-4',
548
- progress: 'h-4'
549
- },
550
- lg: {
551
- base: 'h-8',
552
- progress: 'h-8',
553
- label: 'text-lg',
554
- description: 'text-lg'
555
- }
556
- },
557
- radius: {
558
- none: 'rounded-none',
559
- sm: 'rounded-sm',
560
- lg: 'rounded-lg',
561
- full: 'rounded-full'
562
- }
563
- },
564
- defaultVariants: {
565
- size: 'md',
566
- intent: 'default',
567
- radius: 'sm'
568
- }
569
- });
570
-
571
- const closeButton = tv({
572
- slots: {
573
- base: ['rounded-full transition transition-200 text-inherit', ...focusVisibleRing],
574
- icon: 'size-[1em]'
575
- },
576
- variants: {
577
- size: {
578
- xs: {
579
- base: 'text-sm p-1'
580
- },
581
- sm: {
582
- base: 'text-base p-2'
583
- },
584
- md: {
585
- base: 'text-xl p-2'
586
- },
587
- lg: {
588
- base: 'text-2xl p-3'
589
- },
590
- xl: {
591
- base: 'text-4xl p-3'
592
- }
593
- },
594
- variant: {
595
- transparent: {
596
- base: ['bg-transparent', 'hover:bg-surface-overlay-subtle']
597
- },
598
- subtle: {
599
- base: ['bg-neutral-subtle', 'text-on-neutral-subtle dark:text-default-background', 'hover:bg-surface-overlay-subtle']
600
- }
601
- }
602
- },
603
- defaultVariants: {
604
- size: 'md',
605
- variant: 'transparent'
606
- }
607
- });
608
-
609
- const listbox = tv({
610
- base: 'w-full flex flex-col gap-0.5 outline-hidden p-1'
611
- });
612
- const listboxItem = tv({
613
- slots: {
614
- base: ['flex', 'group', 'gap-2', 'items-center', 'justify-between', 'relative', 'px-2', 'py-1.5', 'w-full', 'h-full', 'box-border', 'rounded-sm', 'subpixel-antialiased', 'outline-hidden', 'cursor-pointer', 'tap-highlight-transparent'],
615
- descriptionWrapper: 'w-full flex flex-col items-start justify-center',
616
- label: 'flex-1 text-sm font-normal truncate',
617
- description: ['w-full', 'text-xs', 'text-neutral-medium', 'group-hover:text-current'],
618
- selectedIcon: ['text-inherit', 'w-4', 'h-4', 'shrink-0'],
619
- shortcut: ['px-1', 'py-0.5', 'rounded-sm', 'font-sans', 'text-neutral-medium', 'text-xs', 'border', 'border-neutral-soft', 'group-data-is-active:border-current']
620
- },
621
- variants: {
622
- appearance: {
623
- default: {
624
- base: ''
625
- },
626
- outlined: {
627
- base: 'border border-transparent bg-transparent'
628
- },
629
- faded: {
630
- base: ['border border-transparent']
631
- }
632
- },
633
- intent: {
634
- default: {},
635
- primary: {},
636
- secondary: {},
637
- success: {},
638
- warning: {},
639
- danger: {}
640
- },
641
- isActive: {
642
- true: {
643
- base: []
644
- }
645
- },
646
- withDivider: {
647
- true: {
648
- base: ['mb-1.5']
649
- }
650
- },
651
- isDisabled: {
652
- true: {
653
- base: 'opacity-disabled pointer-events-none'
654
- }
655
- },
656
- isSelected: {
657
- true: {
658
- base: ''
659
- }
660
- }
661
- },
662
- defaultVariants: {
663
- appearance: 'default',
664
- intent: 'default'
665
- },
666
- compoundVariants: [
667
- // appearance: default
668
- {
669
- appearance: 'default',
670
- intent: 'default',
671
- class: {
672
- base: ['data-is-active:bg-neutral', 'data-is-active:text-on-neutral']
673
- }
674
- }, {
675
- appearance: 'default',
676
- intent: 'primary',
677
- class: {
678
- base: ['data-is-active:bg-brand-soft', 'data-is-active:text-on-brand-soft']
679
- }
680
- }, {
681
- appearance: 'default',
682
- intent: 'success',
683
- class: {
684
- base: ['data-is-active:bg-success-soft', 'data-is-active:text-on-success-soft']
685
- }
686
- }, {
687
- appearance: 'default',
688
- intent: 'warning',
689
- class: {
690
- base: ['data-is-active:bg-warning-soft', 'data-is-active:text-on-warning-soft']
691
- }
692
- }, {
693
- appearance: 'default',
694
- intent: 'danger',
695
- class: {
696
- base: ['data-is-active:bg-danger-soft', 'data-is-active:text-on-danger-soft']
697
- }
698
- }, {
699
- appearance: 'default',
700
- intent: 'default',
701
- isActive: true,
702
- class: {
703
- shortcut: ['text-on-neutral', 'border-on-neutral/20']
704
- }
705
- }, {
706
- appearance: 'default',
707
- intent: 'primary',
708
- isActive: true,
709
- class: {
710
- shortcut: ['text-on-brand-soft', 'border-on-brand-soft/20']
711
- }
712
- }, {
713
- appearance: 'default',
714
- intent: 'success',
715
- isActive: true,
716
- class: {
717
- shortcut: ['text-on-success-soft', 'border-on-success-soft/20']
718
- }
719
- }, {
720
- appearance: 'default',
721
- intent: 'warning',
722
- isActive: true,
723
- class: {
724
- shortcut: ['text-on-warning-soft', 'border-on-warning-soft/20']
725
- }
726
- }, {
727
- appearance: 'default',
728
- intent: 'danger',
729
- isActive: true,
730
- class: {
731
- shortcut: ['text-on-danger-soft', 'border-on-danger-soft/20']
732
- }
733
- },
734
- // appearance: outlined
735
- {
736
- appearance: 'outlined',
737
- intent: 'default',
738
- class: {
739
- base: ['data-is-active:border-neutral-medium', 'data-is-active:text-neutral-medium']
740
- }
741
- }, {
742
- appearance: 'outlined',
743
- intent: 'primary',
744
- class: {
745
- base: ['data-is-active:border-brand-medium', 'data-is-active:text-brand']
746
- }
747
- }, {
748
- appearance: 'outlined',
749
- intent: 'success',
750
- class: {
751
- base: ['data-is-active:border-success', 'data-is-active:text-success']
752
- }
753
- }, {
754
- appearance: 'outlined',
755
- intent: 'warning',
756
- class: {
757
- base: ['data-is-active:border-warning', 'data-is-active:text-warning']
758
- }
759
- }, {
760
- appearance: 'outlined',
761
- intent: 'danger',
762
- class: {
763
- base: ['data-is-active:border-danger', 'data-is-active:text-danger']
764
- }
765
- },
766
- // appearance: faded
767
- {
768
- appearance: 'faded',
769
- intent: 'default',
770
- class: {
771
- base: ['data-is-active:bg-neutral-soft/20', 'data-is-active:border-neutral-medium', 'data-is-active:text-neutral-medium']
772
- }
773
- }, {
774
- appearance: 'faded',
775
- intent: 'primary',
776
- class: {
777
- base: ['data-is-active:bg-brand-soft/20', 'data-is-active:border-brand-medium', 'data-is-active:text-brand']
778
- }
779
- }, {
780
- appearance: 'faded',
781
- intent: 'success',
782
- class: {
783
- base: ['data-is-active:bg-success-soft/20', 'data-is-active:border-success', 'data-is-active:text-success']
784
- }
785
- }, {
786
- appearance: 'faded',
787
- intent: 'warning',
788
- class: {
789
- base: ['data-is-active:bg-warning-soft/20', 'data-is-active:border-warning', 'data-is-active:text-warning']
790
- }
791
- }, {
792
- appearance: 'faded',
793
- intent: 'danger',
794
- class: {
795
- base: ['data-is-active:bg-danger-soft/20', 'data-is-active:border-danger', 'data-is-active:text-danger']
796
- }
797
- }]
798
- });
799
-
800
- const dropdownContent = tv({
801
- base: 'bg-surface-solid-1 w-[260px] rounded-sm border border-neutral-subtle'
802
- });
803
-
804
- const popover = tv({
805
- base: 'bg-surface-solid-1 rounded-sm border border-neutral-subtle',
806
- variants: {
807
- size: {
808
- sm: 'w-40',
809
- md: 'w-64',
810
- lg: 'w-96',
811
- xl: 'w-136',
812
- trigger: 'w-(--trigger-width)'
813
- }
814
- },
815
- defaultVariants: {
816
- size: 'md'
817
- }
818
- });
819
-
820
- const divider = tv({
821
- base: 'shrink-0 bg-neutral-subtle border-none',
822
- variants: {
823
- orientation: {
824
- horizontal: 'w-full h-px',
825
- vertical: 'h-full w-px'
826
- }
827
- },
828
- defaultVariants: {
829
- orientation: 'horizontal'
830
- }
831
- });
832
-
833
- const spinner = tv({
834
- base: 'text-neutral-subtle animate-spin dark:text-neutral-soft',
835
- variants: {
836
- size: {
837
- xs: 'w-4 h-4',
838
- sm: 'w-6 h-6,',
839
- md: 'w-8 h-8,',
840
- lg: 'w-10 h-10',
841
- xl: 'w-12 h-12'
842
- },
843
- intent: {
844
- default: 'fill-neutral-strong dark:fill-neutral-subtle',
845
- primary: 'fill-primary',
846
- success: 'fill-success',
847
- warning: 'fill-warning',
848
- danger: 'fill-danger'
849
- }
850
- },
851
- defaultVariants: {
852
- size: 'md',
853
- intent: 'default'
854
- }
855
- });
856
-
857
- const table = tv({
858
- slots: {
859
- base: ['w-full', 'caption-bottom', 'text-sm'],
860
- wrapper: ['relative', 'isolate', 'overflow-auto'],
861
- table: ['w-full', 'table-auto'],
862
- thead: ['relative'],
863
- tbody: ['divide-y', 'divide-neutral-subtle', '[&>tr]:data-[selectable=true]:data-[selected=false]:hover:bg-neutral-subtle', '[&>tr]:data-[selectable=true]:transition-colors'],
864
- tfoot: ['relative'],
865
- tr: ['data-[disabled=true]:opacity-50', 'data-[disabled=true]:cursor-not-allowed', 'data-[disabled=true]:hover:bg-transparent', 'data-[selectable=true]:focus-visible:ring-2', 'data-[selectable=true]:focus-visible:ring-inset', 'data-[selectable=true]:focus-visible:ring-default', 'data-[selectable=true]:focus-visible:z-10', 'transition-colors', 'duration-150', 'outline-hidden'],
866
- separator: ['absolute', 'z-2', 'left-0', 'w-full', 'h-px', 'bg-neutral-subtle'],
867
- th: ['h-12', 'px-4', 'text-left', 'align-middle', 'font-medium', 'text-neutral-strong', '[&:has([role=checkbox])]:pr-0', 'data-[sortable=true]:cursor-pointer'],
868
- sortButton: ['group/sort', 'inline-flex', 'items-center', 'gap-1', 'w-full', 'text-left', 'font-medium', 'text-neutral-strong', 'outline-hidden', 'focus-visible:z-10', 'focus-visible:ring-3', 'focus-visible:ring-focus', 'focus-visible:ring-offset-2', 'focus-visible:ring-offset-background'],
869
- sortIcon: ['size-4', 'flex-shrink-0', 'text-neutral-soft', 'transition-opacity', 'data-[sorted=false]:opacity-0', 'group-hover/sort:data-[sorted=false]:opacity-100', 'data-[sorted=true]:opacity-100'],
870
- columnVisibilityButton: ['flex'],
871
- columnVisibilityIcon: ['size-6'],
872
- td: ['p-4', 'align-middle', 'text-neutral-strong', '[&:has([role=checkbox])]:pr-0'],
873
- empty: ['text-neutral-soft', 'align-middle', 'text-center', 'py-12']
874
- },
875
- variants: {
876
- size: {
877
- sm: {
878
- th: 'h-10 px-3 py-2 text-xs',
879
- td: 'px-3 py-2 text-xs'
880
- },
881
- md: {
882
- th: 'h-12 px-4 text-sm',
883
- td: 'p-4 text-sm'
884
- },
885
- lg: {
886
- th: 'h-14 px-6 text-base',
887
- td: 'p-6 text-base'
888
- }
889
- },
890
- isLoading: {
891
- true: {
892
- thead: ['after:absolute', 'after:top-full', 'after:left-0', 'after:w-1/2', 'after:animate-swing', 'after:h-px', 'after:z-10']
893
- }
894
- },
895
- loadingColor: {
896
- default: {},
897
- primary: {},
898
- success: {},
899
- warning: {},
900
- danger: {}
901
- },
902
- selectionColor: {
903
- default: {},
904
- primary: {},
905
- success: {},
906
- warning: {},
907
- danger: {}
908
- },
909
- layout: {
910
- auto: {
911
- table: 'table-auto'
912
- },
913
- fixed: {
914
- table: 'table-fixed'
915
- }
916
- },
917
- striped: {
918
- true: {
919
- tbody: '[&_tr:nth-child(odd)]:bg-neutral-subtle/50 dark:[&_tr:nth-child(odd)]:bg-neutral-subtle/10'
920
- }
921
- },
922
- isSticky: {
923
- true: {}
924
- },
925
- stickyPosition: {
926
- left: {},
927
- right: {},
928
- top: {},
929
- bottom: {}
930
- },
931
- isScrollable: {
932
- true: {
933
- wrapper: ['overflow-auto']
934
- }
935
- },
936
- hasStickyHeader: {
937
- true: {}
938
- },
939
- isInStickyRow: {
940
- true: {}
941
- }
942
- },
943
- compoundVariants: [
944
- // Sticky header - highest priority for intersections with columns
945
- {
946
- isSticky: true,
947
- stickyPosition: 'top',
948
- class: {
949
- thead: ['sticky', 'top-0', 'z-2', 'bg-background']
950
- }
951
- },
952
- // Sticky footer
953
- {
954
- isSticky: true,
955
- stickyPosition: 'bottom',
956
- class: {
957
- tfoot: ['sticky', 'bottom-0', 'z-2', 'bg-background']
958
- }
959
- },
960
- // Sticky columns - medium priority, header cells get higher z-index
961
- {
962
- isSticky: true,
963
- stickyPosition: 'left',
964
- class: {
965
- th: ['sticky', 'left-0', 'z-3', 'bg-background'],
966
- // Higher for header intersection
967
- td: ['sticky', 'left-0', 'z-1', 'bg-background']
968
- }
969
- }, {
970
- isSticky: true,
971
- stickyPosition: 'right',
972
- class: {
973
- th: ['sticky', 'right-0', 'z-3', 'bg-background'],
974
- // Higher for header intersection
975
- td: ['sticky', 'right-0', 'z-1', 'bg-background']
976
- }
977
- },
978
- // Sticky rows - base layer
979
- {
980
- isSticky: true,
981
- stickyPosition: 'top',
982
- class: {
983
- tr: ['sticky', 'top-0', 'z-1', 'bg-background']
984
- }
985
- }, {
986
- isSticky: true,
987
- stickyPosition: 'bottom',
988
- class: {
989
- tr: ['sticky', 'bottom-0', 'z-1', 'bg-background']
990
- }
991
- },
992
- // Sticky rows with sticky header - position after header
993
- {
994
- isSticky: true,
995
- stickyPosition: 'top',
996
- hasStickyHeader: true,
997
- class: {
998
- tr: ['sticky', 'z-2', 'bg-background', '[&.sticky]:[top:var(--table-header-height,48px)]']
999
- }
1000
- },
1001
- // Intersection cells: sticky column + sticky row - highest z-index
1002
- {
1003
- isSticky: true,
1004
- stickyPosition: 'left',
1005
- isInStickyRow: true,
1006
- class: {
1007
- td: ['sticky', 'left-0', 'z-2', 'bg-background']
1008
- }
1009
- }, {
1010
- isSticky: true,
1011
- stickyPosition: 'right',
1012
- isInStickyRow: true,
1013
- class: {
1014
- td: ['sticky', 'right-0', 'z-2', 'bg-background']
1015
- }
1016
- },
1017
- // Loading states with color variants
1018
- {
1019
- isLoading: true,
1020
- loadingColor: 'default',
1021
- class: {
1022
- thead: `after:bg-neutral`
1023
- }
1024
- }, {
1025
- isLoading: true,
1026
- loadingColor: 'primary',
1027
- class: {
1028
- thead: `after:bg-brand`
1029
- }
1030
- }, {
1031
- isLoading: true,
1032
- loadingColor: 'success',
1033
- class: {
1034
- thead: `after:bg-success`
1035
- }
1036
- }, {
1037
- isLoading: true,
1038
- loadingColor: 'warning',
1039
- class: {
1040
- thead: `after:bg-warning`
1041
- }
1042
- }, {
1043
- isLoading: true,
1044
- loadingColor: 'danger',
1045
- class: {
1046
- thead: `after:bg-danger`
1047
- }
1048
- },
1049
- // Selection color variants
1050
- {
1051
- selectionColor: 'default',
1052
- class: {
1053
- tbody: '[&>tr]:data-[selected=true]:bg-neutral-subtle/50',
1054
- tr: ['data-[selectable=true]:focus-visible:ring-default']
1055
- }
1056
- }, {
1057
- selectionColor: 'primary',
1058
- class: {
1059
- tbody: '[&>tr]:data-[selected=true]:bg-brand-subtle',
1060
- tr: ['data-[selectable=true]:focus-visible:ring-brand-soft']
1061
- }
1062
- }, {
1063
- selectionColor: 'success',
1064
- class: {
1065
- tbody: '[&>tr]:data-[selected=true]:bg-success-subtle',
1066
- tr: ['data-[selectable=true]:focus-visible:ring-success']
1067
- }
1068
- }, {
1069
- selectionColor: 'warning',
1070
- class: {
1071
- tbody: '[&>tr]:data-[selected=true]:bg-warning-subtle',
1072
- tr: ['data-[selectable=true]:focus-visible:ring-warning']
1073
- }
1074
- }, {
1075
- selectionColor: 'danger',
1076
- class: {
1077
- tbody: '[&>tr]:data-[selected=true]:bg-danger-subtle',
1078
- tr: ['data-[selectable=true]:focus-visible:ring-danger']
1079
- }
1080
- }],
1081
- defaultVariants: {
1082
- size: 'md',
1083
- layout: 'auto',
1084
- loadingColor: 'default',
1085
- selectionColor: 'primary'
1086
- }
1087
- });
1088
-
1089
- const notificationsContainer = tv({
1090
- base: ['w-full', 'max-h-full', 'overflow-hidden', 'px-4', 'fixed', 'max-w-lg', 'z-1000'],
1091
- variants: {
1092
- placement: {
1093
- 'top-left': 'top-0 left-0',
1094
- 'top-center': 'top-0 left-2/4 translate-x-[-50%]',
1095
- 'top-right': 'top-0 right-0',
1096
- 'bottom-left': 'bottom-0 left-0',
1097
- 'bottom-center': 'bottom-0 left-2/4 translate-x-[-50%]',
1098
- 'bottom-right': 'bottom-0 right-0 '
1099
- }
1100
- },
1101
- defaultVariants: {
1102
- placement: 'bottom-right'
1103
- }
1104
- });
1105
-
1106
- const btn = ['transition transition-200', ...focusVisibleRing];
1107
- const notificationCard = tv({
1108
- slots: {
1109
- base: 'py-3 px-4 overflow-hidden flex items-center justify-between relative min-h-16 text-sm rounded-sm shadow-sm transition-all transition-200 ease-in-out',
1110
- message: 'grow',
1111
- customActions: 'flex flex-nowrap',
1112
- customActionButton: [...btn, 'first:ml-4 last:-mr-2 font-semibold py-1 px-2 rounded-sm hover:bg-surface-overlay-soft'],
1113
- closeButton: [...btn, 'inline-block p-2 ml-2 -mr-2 rounded-full hover:bg-surface-overlay-soft']
1114
- },
1115
- variants: {
1116
- appearance: {
1117
- info: {
1118
- base: 'bg-neutral-strong text-on-neutral-strong'
1119
- },
1120
- success: {
1121
- base: 'bg-success text-on-success'
1122
- },
1123
- warning: {
1124
- base: 'bg-warning text-on-warning'
1125
- },
1126
- error: {
1127
- base: 'bg-danger text-on-danger'
1128
- }
1129
- }
1130
- },
1131
- defaultVariants: {
1132
- appearance: 'info'
1133
- }
1134
- });
1135
- const zoomOut = {
1136
- leaveTo: {
1137
- transform: 'scale(0.80)',
1138
- opacity: '0'
1139
- },
1140
- leave: {
1141
- transform: 'translate3d(0,0,0)'
1142
- }
1143
- };
1144
- const notificationEnteringFrom = {
1145
- right: {
1146
- transform: 'translate3d(125%, 0, 0)'
1147
- },
1148
- left: {
1149
- transform: 'translate3d(-125%, 0, 0)'
1150
- },
1151
- top: {
1152
- transform: 'translate3d(0, -125%, 0)'
1153
- },
1154
- bottom: {
1155
- transform: 'translate3d(0, 125%, 0)'
1156
- }
1157
- };
1158
- const notificationTransitions = {
1159
- slideFromTopLeft: {
1160
- ...zoomOut,
1161
- enter: {
1162
- ...notificationEnteringFrom.left
1163
- }
1164
- },
1165
- slideFromTopCenter: {
1166
- ...zoomOut,
1167
- enter: notificationEnteringFrom.top
1168
- },
1169
- slideFromTopRight: {
1170
- ...zoomOut,
1171
- enter: notificationEnteringFrom.right
1172
- },
1173
- slideFromBottomLeft: {
1174
- ...zoomOut,
1175
- enter: notificationEnteringFrom.left
1176
- },
1177
- slideFromBottomCenter: {
1178
- ...zoomOut,
1179
- enter: notificationEnteringFrom.bottom
1180
- },
1181
- slideFromBottomRight: {
1182
- ...zoomOut,
1183
- enter: notificationEnteringFrom.right
1184
- }
1185
- };
1186
-
1187
- const obscurer = `before:bg-linear-to-b before:to-surface-solid-1 before:from-surface-solid-1/75 before:absolute before:left-0 before:w-full before:h-4 before:-top-4 before:content-['_']`;
1188
- const overlay = tv({
1189
- base: 'will-change-transform overflow-auto',
1190
- variants: {
1191
- enableFlexContent: {
1192
- true: 'flex items-center fixed inset-0 flex-col'
1193
- },
1194
- inPlace: {
1195
- true: 'absolute'
1196
- }
1197
- }
1198
- });
1199
- const backdrop = tv({
1200
- base: 'fixed inset-0 select-none',
1201
- variants: {
1202
- type: {
1203
- none: '',
1204
- transparent: '',
1205
- blur: 'bg-surface-overlay-inverse-strong backdrop-blur-sm',
1206
- faded: 'bg-surface-overlay-inverse-strong'
1207
- },
1208
- inPlace: {
1209
- true: 'absolute'
1210
- }
1211
- }
1212
- });
1213
- const modal = tv({
1214
- slots: {
1215
- base: 'flex flex-col shrink-0 relative text-surface-solid-11 bg-surface-solid-1 rounded-sm my-24 w-full outline-hidden overflow-hidden',
1216
- closeButton: 'absolute top-2 right-2',
1217
- header: 'font-bold text-xl p-4 rounded-tl rounded-tr',
1218
- body: 'p-4 grow overflow-y-auto',
1219
- footer: `${obscurer} flex justify-end items-center relative border-t border-neutral-subtle bg-surface-overlay-subtle p-4`
1220
- },
1221
- variants: {
1222
- size: {
1223
- xs: 'modal--xs',
1224
- sm: 'modal--sm',
1225
- md: 'modal--md',
1226
- lg: 'modal--lg',
1227
- xl: 'modal--xl',
1228
- full: 'modal--full'
1229
- },
1230
- isCentered: {
1231
- true: 'my-auto'
1232
- }
1233
- }
1234
- });
1235
- const drawer = tv({
1236
- slots: {
1237
- base: 'flex flex-col absolute text-surface-solid-11 bg-surface-solid-1 w-full h-full shadow-sm outline-hidden',
1238
- closeButton: 'absolute top-2 right-2',
1239
- header: 'font-bold text-xl p-4 rounded-tl rounded-tr',
1240
- body: 'p-4 grow overflow-y-auto',
1241
- footer: `${obscurer} flex justify-end items-center relative border-t border-neutral-subtle bg-surface-overlay-subtle p-4`
1242
- },
1243
- variants: {
1244
- size: {
1245
- xs: '',
1246
- sm: '',
1247
- md: '',
1248
- lg: '',
1249
- xl: '',
1250
- full: ''
1251
- },
1252
- placement: {
1253
- top: 'top-0 right-0 left-0',
1254
- bottom: 'bottom-0 right-0 left-0',
1255
- left: 'top-0 bottom-0 left-0',
1256
- right: 'top-0 bottom-0 right-0'
1257
- }
1258
- },
1259
- compoundVariants: [
1260
- // vertical
1261
- {
1262
- placement: ['top', 'bottom'],
1263
- size: 'xs',
1264
- class: 'drawer--vertical-xs'
1265
- }, {
1266
- placement: ['top', 'bottom'],
1267
- size: 'sm',
1268
- class: 'drawer--vertical-sm'
1269
- }, {
1270
- placement: ['top', 'bottom'],
1271
- size: 'md',
1272
- class: 'drawer--vertical-md'
1273
- }, {
1274
- placement: ['top', 'bottom'],
1275
- size: 'lg',
1276
- class: 'drawer--vertical-lg'
1277
- }, {
1278
- placement: ['top', 'bottom'],
1279
- size: 'xl',
1280
- class: 'drawer--vertical-xl'
1281
- }, {
1282
- placement: ['top', 'bottom'],
1283
- size: 'full',
1284
- class: 'drawer--vertical-full'
1285
- },
1286
- // horizontal
1287
- {
1288
- placement: ['right', 'left'],
1289
- size: 'xs',
1290
- class: 'drawer--horizontal-xs'
1291
- }, {
1292
- placement: ['right', 'left'],
1293
- size: 'sm',
1294
- class: 'drawer--horizontal-sm'
1295
- }, {
1296
- placement: ['right', 'left'],
1297
- size: 'md',
1298
- class: 'drawer--horizontal-md'
1299
- }, {
1300
- placement: ['right', 'left'],
1301
- size: 'lg',
1302
- class: 'drawer--horizontal-lg'
1303
- }, {
1304
- placement: ['right', 'left'],
1305
- size: 'xl',
1306
- class: 'drawer--horizontal-xl'
1307
- }, {
1308
- placement: ['right', 'left'],
1309
- size: 'full',
1310
- class: 'drawer--horizontal-full'
1311
- }]
1312
- });
1313
- const slideTransition = {
1314
- enterActive: {
1315
- transition: 'transform 0.2s cubic-bezier(0.37, 0, 0.63, 1)'
1316
- },
1317
- leaveActive: {
1318
- transition: 'transform 0.2s cubic-bezier(0.37, 0, 0.63, 1)'
1319
- }
1320
- };
1321
- const overlayTransitions = {
1322
- fade: {
1323
- enter: {
1324
- opacity: '0'
1325
- },
1326
- enterActive: {
1327
- transition: 'opacity 0.2s linear'
1328
- },
1329
- leave: {
1330
- opacity: '1'
1331
- },
1332
- leaveActive: {
1333
- transition: 'opacity 0.2s linear'
1334
- }
1335
- },
1336
- zoom: {
1337
- enter: {
1338
- opacity: '0',
1339
- transform: 'scale(0.8)'
1340
- },
1341
- enterActive: {
1342
- transition: 'all 0.2s ease-in-out'
1343
- },
1344
- leave: {
1345
- opacity: '1',
1346
- transform: 'scale(1)'
1347
- },
1348
- leaveActive: {
1349
- transition: 'all 0.2s ease-in-out'
1350
- }
1351
- },
1352
- slideFromLeft: {
1353
- enter: {
1354
- transform: 'translateX(-100%)'
1355
- },
1356
- leave: {
1357
- transform: 'translateX(0%)'
1358
- },
1359
- ...slideTransition
1360
- },
1361
- slideFromRight: {
1362
- enter: {
1363
- transform: 'translateX(100%)'
1364
- },
1365
- leave: {
1366
- transform: 'translateX(0%)'
1367
- },
1368
- ...slideTransition
1369
- },
1370
- slideFromTop: {
1371
- enter: {
1372
- transform: 'translateY(-100%)'
1373
- },
1374
- leave: {
1375
- transform: 'translateY(0%)'
1376
- },
1377
- ...slideTransition
1378
- },
1379
- slideFromBottom: {
1380
- enter: {
1381
- transform: 'translateY(100%)'
1382
- },
1383
- leave: {
1384
- transform: 'translateY(0%)'
1385
- },
1386
- ...slideTransition
1387
- },
1388
- scale: {
1389
- enter: {
1390
- opacity: '0',
1391
- transform: 'scale(0.95)'
1392
- },
1393
- enterActive: {
1394
- transitionProperty: 'transform, opacity',
1395
- transitionDuration: '200ms',
1396
- transitionTimingFunction: 'cubic-bezier(0, 0, 0.2, 1)'
1397
- },
1398
- enterTo: {
1399
- opacity: '1',
1400
- transform: 'translate(scaleX(1) scaleY(1))'
1401
- },
1402
- leave: {
1403
- opacity: '1',
1404
- transform: 'translate(scaleX(1) scaleY(1))'
1405
- },
1406
- leaveActive: {
1407
- transitionProperty: 'transform, opacity',
1408
- transitionDuration: '100ms',
1409
- transitionTimingFunction: 'cubic-bezier(0.4, 0, 1, 1)'
1410
- },
1411
- leaveTo: {
1412
- opacity: '0',
1413
- transform: 'scale(0.95)'
1414
- }
1415
- }
1416
- };
1417
-
1418
- const label = tv({
1419
- slots: {
1420
- base: 'text-neutral-strong inline-block font-semibold leading-tight pb-1',
1421
- asterisk: 'text-danger'
1422
- },
1423
- variants: {
1424
- size: {
1425
- sm: {
1426
- base: 'text-xs'
1427
- },
1428
- md: {},
1429
- lg: {
1430
- base: 'text-lg'
1431
- }
1432
- }
1433
- },
1434
- defaultVariants: {
1435
- size: 'md'
1436
- }
1437
- });
1438
- const formDescription = tv({
1439
- base: 'text-neutral-soft text-xs pb-1 last:pb-0',
1440
- variants: {
1441
- size: {
1442
- sm: 'text-xs',
1443
- md: '',
1444
- lg: 'text-lg'
1445
- }
1446
- },
1447
- defaultVariants: {
1448
- size: 'md'
1449
- }
1450
- });
1451
- const formFeedback = tv({
1452
- base: 'text-xs pt-1',
1453
- variants: {
1454
- intent: {
1455
- primary: 'text-brand',
1456
- success: 'text-success',
1457
- danger: 'text-danger',
1458
- warning: 'text-warning'
1459
- },
1460
- size: {
1461
- sm: 'text-xs',
1462
- md: '',
1463
- lg: 'text-lg'
1464
- }
1465
- },
1466
- defaultVariants: {
1467
- size: 'sm'
1468
- }
1469
- });
1470
- const input = tv({
1471
- slots: {
1472
- base: '',
1473
- innerContainer: 'relative flex',
1474
- startContent: 'absolute inset-y-0 left-0 flex items-center',
1475
- endContent: 'absolute inset-y-0 right-0 flex items-center',
1476
- input: ['appearance-none', 'flex-1', 'w-full', 'bg-white dark:bg-neutral-subtle', 'text-neutral-strong', 'placeholder-neutral-soft', 'text-base text-left', 'border', 'border-neutral-soft', 'rounded-sm', 'leading-tight', 'focus:ring-3', 'focus:ring-focus', 'focus:outline-hidden', 'focus:border-brand-soft', 'selection:bg-surface-overlay-soft', 'disabled:border-neutral-subtle disabled:text-neutral-soft', 'aria-invalid:border-danger-soft', 'aria-invalid:focus:ring-danger-soft']
1477
- },
1478
- variants: {
1479
- size: {
1480
- sm: {
1481
- input: 'p-2',
1482
- startContent: 'pl-2',
1483
- endContent: 'pr-2'
1484
- },
1485
- md: {
1486
- input: 'p-3',
1487
- startContent: 'pl-3',
1488
- endContent: 'pr-3'
1489
- },
1490
- lg: {
1491
- input: 'p-4',
1492
- startContent: 'pl-4',
1493
- endContent: 'pr-4'
1494
- }
1495
- },
1496
- hasStartContent: {
1497
- true: {
1498
- input: 'ps-8'
1499
- }
1500
- },
1501
- hasEndContent: {
1502
- true: {
1503
- input: 'pe-10'
1504
- }
1505
- },
1506
- startContentPointerEvents: {
1507
- auto: {
1508
- startContent: 'pointer-events-auto'
1509
- },
1510
- none: {
1511
- startContent: 'pointer-events-none'
1512
- }
1513
- },
1514
- endContentPointerEvents: {
1515
- auto: {
1516
- endContent: 'pointer-events-auto'
1517
- },
1518
- none: {
1519
- endContent: 'pointer-events-none'
1520
- }
1521
- }
1522
- },
1523
- defaultVariants: {
1524
- size: 'md'
1525
- }
1526
- });
1527
- const textarea = tv({
1528
- extend: input,
1529
- slots: {
1530
- input: 'min-h-24'
1531
- },
1532
- variants: {
1533
- size: {
1534
- sm: {},
1535
- md: {},
1536
- lg: {}
1537
- }
1538
- }
1539
- });
1540
- const checkboxRadioBase = tv({
1541
- slots: {
1542
- base: ['max-w-fit flex items-center justify-start'],
1543
- input: ['appearance-none', 'inline-block', 'align-middle', 'select-none', 'shrink-0', 'h-[1em] w-[1em]', 'text-base', 'text-brand', 'border border-neutral-soft', 'bg-white dark:bg-neutral-subtle', 'checked:bg-origin-border checked:border-transparent dark:checked:bg-current checked:bg-current checked:bg-center checked:bg-no-repeat checked:disabled:bg-neutral-soft', ...focusVisibleRing],
1544
- labelContainer: ['flex flex-col ml-2'],
1545
- label: 'font-normal pb-0'
1546
- },
1547
- variants: {
1548
- size: {
1549
- sm: {
1550
- input: ''
1551
- },
1552
- md: {
1553
- input: ''
1554
- },
1555
- lg: {
1556
- input: ''
1557
- }
1558
- }
1559
- },
1560
- defaultVariants: {
1561
- size: 'md'
1562
- }
1563
- });
1564
- const checkboxRadioGroupBase = tv({
1565
- slots: {
1566
- base: '',
1567
- optionsContainer: ['flex flex-col flex-wrap gap-4 data-[orientation=horizontal]:flex-row'],
1568
- label: 'pb-2'
1569
- },
1570
- variants: {
1571
- size: {
1572
- sm: '',
1573
- md: '',
1574
- lg: ''
1575
- }
1576
- }
1577
- });
1578
- const checkbox = tv({
1579
- extend: checkboxRadioBase,
1580
- slots: {
1581
- input: ['checked-bg-checkbox', 'indeterminate-bg-checkbox', 'rounded-xs',
1582
- // Indeterminate state styles - show minus/dash icon
1583
- 'indeterminate:bg-brand', 'indeterminate:border-brand-medium', 'indeterminate:bg-origin-border', 'indeterminate:bg-center', 'indeterminate:bg-no-repeat', 'dark:indeterminate:bg-current']
1584
- },
1585
- variants: {
1586
- size: {
1587
- sm: {
1588
- input: ''
1589
- },
1590
- md: {
1591
- input: ''
1592
- },
1593
- lg: {
1594
- input: ''
1595
- }
1596
- }
1597
- },
1598
- defaultVariants: {
1599
- size: 'md'
1600
- }
1601
- });
1602
- const radio = tv({
1603
- extend: checkboxRadioBase,
1604
- slots: {
1605
- input: ['checked-bg-radio', 'rounded-full']
1606
- },
1607
- variants: {
1608
- size: {
1609
- sm: {
1610
- input: ''
1611
- },
1612
- md: {
1613
- input: ''
1614
- },
1615
- lg: {
1616
- input: ''
1617
- }
1618
- }
1619
- },
1620
- defaultVariants: {
1621
- size: 'md'
1622
- }
1623
- });
1624
- const radioGroup = tv({
1625
- extend: checkboxRadioGroupBase
1626
- });
1627
- const checkboxGroup = tv({
1628
- extend: checkboxRadioGroupBase
1629
- });
1630
- const select = tv({
1631
- extend: input,
1632
- slots: {
1633
- base: [],
1634
- placeholder: 'text-neutral-soft',
1635
- listbox: 'scroll-py-6 max-h-64',
1636
- icon: 'w-5 h-5',
1637
- clearButton: 'pointer-events-auto',
1638
- input: '[button]:cursor-default',
1639
- emptyContent: 'p-2'
1640
- },
1641
- variants: {
1642
- size: {
1643
- sm: {},
1644
- md: {},
1645
- lg: {}
1646
- }
1647
- },
1648
- defaultVariants: {
1649
- size: 'md'
1650
- }
1651
- });
1652
- const nativeSelect = tv({
1653
- extend: input,
1654
- slots: {
1655
- input: ['appearance-none'],
1656
- icon: 'w-5 h-5'
1657
- },
1658
- variants: {
1659
- size: {
1660
- sm: {},
1661
- md: {},
1662
- lg: {}
1663
- }
1664
- }
1665
- });
1666
- const switchInput = tv({
1667
- slots: {
1668
- base: 'group relative max-w-fit inline-flex items-center justify-start',
1669
- labelContainer: 'flex flex-col ml-2',
1670
- label: 'font-normal pb-0',
1671
- wrapper: ['px-1', 'relative', 'inline-flex', 'items-center', 'justify-start', 'shrink-0', 'overflow-hidden', 'bg-neutral-soft', 'rounded-full', 'cursor-pointer touch-none tap-highlight-transparent select-none', 'transition-background', ...focusVisibleWithinRing],
1672
- hiddenInput: ['font-inherit', 'text-[100%]', 'leading-[1.15]', 'm-0', 'p-0', 'overflow-visible', 'box-border', 'absolute', 'top-0', 'w-full', 'h-full', 'opacity-[0.0001]', 'z-1', 'cursor-pointer', 'disabled:cursor-default'],
1673
- thumb: ['z-10', 'flex', 'items-center', 'justify-center', 'bg-white', 'shadow-small', 'rounded-full', 'origin-right', 'transition-all', 'pointer-events-none', 'text-black'],
1674
- startContent: ['z-0 absolute start-1.5 text-current', 'opacity-0', 'scale-50', 'transition-transform-opacity', 'group-data-[selected=true]:scale-100', 'group-data-[selected=true]:opacity-100'],
1675
- endContent: ['z-0 absolute end-1.5 text-neutral-medium', 'opacity-100', 'transition-transform-opacity', 'group-data-[selected=true]:translate-x-3', 'group-data-[selected=true]:opacity-0']
1676
- },
1677
- variants: {
1678
- isDisabled: {
1679
- true: {
1680
- wrapper: 'opacity-disabled pointer-events-none'
1681
- }
1682
- },
1683
- size: {
1684
- sm: {
1685
- wrapper: 'w-6 h-3 px-[2px]',
1686
- thumb: ['w-2 h-2 text-xs', 'group-data-[selected=true]:ms-3'],
1687
- endContent: 'text-xs',
1688
- startContent: 'text-xs',
1689
- label: 'text-small'
1690
- },
1691
- md: {
1692
- wrapper: 'w-11 h-6',
1693
- thumb: ['w-4 h-4 text-sm', 'group-data-[selected=true]:ms-5'],
1694
- endContent: 'text-sm',
1695
- startContent: 'text-sm',
1696
- label: 'text-md'
1697
- },
1698
- lg: {
1699
- wrapper: 'w-12 h-7',
1700
- thumb: ['w-5 h-5 text-medium', 'group-data-[selected=true]:ms-5'],
1701
- endContent: 'text-md',
1702
- startContent: 'text-md',
1703
- label: 'text-lg'
1704
- }
1705
- },
1706
- intent: {
1707
- default: {
1708
- wrapper: ['group-data-[selected=true]:bg-neutral-soft', 'group-data-[selected=true]:text-on-neutral-soft']
1709
- },
1710
- primary: {
1711
- wrapper: ['group-data-[selected=true]:bg-brand', 'group-data-[selected=true]:text-on-brand']
1712
- },
1713
- success: {
1714
- wrapper: ['group-data-[selected=true]:bg-success', 'group-data-[selected=true]:text-on-success']
1715
- },
1716
- warning: {
1717
- wrapper: ['group-data-[selected=true]:bg-warning', 'group-data-[selected=true]:text-on-warning']
1718
- },
1719
- danger: {
1720
- wrapper: ['group-data-[selected=true]:bg-danger', 'data-[selected=true]:text-on-danger']
1721
- }
1722
- }
1723
- },
1724
- defaultVariants: {
1725
- size: 'md',
1726
- intent: 'primary',
1727
- isDisabled: false
1728
- }
1729
- });
1730
-
1731
- const base = tv({
1732
- slots: {
1733
- base: 'flex flex-wrap flex-row items-center',
1734
- labelContainer: 'leading-tight flex items-start',
1735
- inputContainer: 'flex items-center',
1736
- label: 'font-normal pl-2 pb-0',
1737
- hint: 'pl-2 flex basis-full before:content-["_"] before:inline-block before:w-[1em] before:h-[1em] shrink-0'
1738
- },
1739
- variants: {
1740
- size: {
1741
- sm: {
1742
- label: 'text-sm'
1743
- },
1744
- md: '',
1745
- lg: ''
1746
- }
1747
- },
1748
- defaultVariants: {
1749
- size: 'md'
1750
- }
1751
- });
1752
- const formCheckbox = tv({
1753
- extend: base,
1754
- slots: {
1755
- checkbox: ''
1756
- }
1757
- });
1758
- const formRadio = tv({
1759
- extend: base,
1760
- slots: {
1761
- radio: ''
1762
- }
1763
- });
1764
- const baseGroup = tv({
1765
- slots: {
1766
- base: '',
1767
- label: 'pb-1 last:pb-0',
1768
- hint: 'pb-1 last:pb-0',
1769
- feedback: 'pt-0 flex-[1_100%]'
1770
- },
1771
- variants: {
1772
- isInline: {
1773
- true: {
1774
- base: 'flex flex-wrap flex-row items-start',
1775
- label: 'pr-4 pb-0',
1776
- hint: 'pr-4 pb-0',
1777
- feedback: 'pr-4 pb-0'
1778
- }
1779
- }
1780
- }
1781
- });
1782
- const formCheckboxGroup = tv({
1783
- extend: baseGroup,
1784
- slots: {
1785
- formCheckbox: 'pb-1 last:pb-0'
1786
- },
1787
- variants: {
1788
- isInline: {
1789
- true: {
1790
- formCheckbox: 'pr-4 pb-0'
1791
- }
1792
- }
1793
- }
1794
- });
1795
- const formRadioGroup = tv({
1796
- extend: baseGroup,
1797
- slots: {
1798
- formRadio: 'pb-1 last:pb-0'
1799
- },
1800
- variants: {
1801
- isInline: {
1802
- true: {
1803
- formRadio: 'pr-4 pb-0'
1804
- }
1805
- }
1806
- }
1807
- });
1808
- const formInput = tv({
1809
- slots: {
1810
- base: 'flex flex-wrap flex-row',
1811
- label: 'flex-[1_100%]',
1812
- input: '',
1813
- hint: 'flex-[1_100%]',
1814
- feedback: 'flex-[1_100%]'
1815
- },
1816
- variants: {
1817
- size: {
1818
- sm: '',
1819
- md: '',
1820
- lg: ''
1821
- }
1822
- },
1823
- defaultVariants: {
1824
- size: 'md'
1825
- }
1826
- });
1827
- const formTextarea = tv({
1828
- extend: formInput
1829
- });
1830
- const formSelect = tv({
1831
- slots: {
1832
- base: 'flex flex-wrap flex-row',
1833
- label: 'flex-[1_100%]',
1834
- select: '',
1835
- hint: 'flex-[1_100%]',
1836
- feedback: 'flex-[1_100%]'
1837
- },
1838
- variants: {
1839
- size: {
1840
- sm: '',
1841
- md: '',
1842
- lg: ''
1843
- }
1844
- },
1845
- defaultVariants: {
1846
- size: 'md'
1847
- }
1848
- });
1849
-
1850
- export { notificationCard as A, notificationTransitions as B, notificationsContainer as C, overlay as D, overlayTransitions as E, popover as F, progressBar as G, radio as H, radioGroup as I, select as J, spinner as K, switchInput as L, table as M, textarea as N, toggleButton as O, twMerge as P, tv as Q, avatar as a, backdrop as b, button as c, buttonGroup as d, checkbox as e, checkboxGroup as f, chip as g, closeButton as h, divider as i, drawer as j, dropdownContent as k, formCheckbox as l, formCheckboxGroup as m, formDescription as n, formFeedback as o, formInput as p, formRadio as q, formRadioGroup as r, formSelect as s, formTextarea as t, input as u, label as v, listbox as w, listboxItem as x, modal as y, nativeSelect as z };
1851
- //# sourceMappingURL=forms-legacy-15iy0KmK.js.map