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