@frontile/theme 0.18.0-beta.1 → 0.18.0-beta.2
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/declarations/components/accordion.d.ts +10 -10
- package/declarations/components/alert.d.ts +26 -26
- package/declarations/components/button.d.ts +62 -61
- package/declarations/components/calendar.d.ts +11 -11
- package/declarations/components/chip.d.ts +32 -32
- package/declarations/components/close-button.d.ts +10 -10
- package/declarations/components/forms/forms.d.ts +459 -18
- package/declarations/components/kbd.d.ts +32 -32
- package/declarations/components/listbox.d.ts +87 -35
- package/declarations/components/notification-card.d.ts +26 -26
- package/declarations/components/overlays.d.ts +16 -16
- package/declarations/components/pagination.d.ts +11 -11
- package/declarations/components/popover.d.ts +5 -0
- package/declarations/components/progress-bar.d.ts +11 -11
- package/declarations/components/segmented-control.d.ts +11 -11
- package/declarations/components/spinner.d.ts +11 -11
- package/declarations/components/tabs.d.ts +11 -11
- package/declarations/components/tooltip.d.ts +11 -11
- package/dist/index.js +534 -429
- package/dist/index.js.map +1 -1
- package/dist/{overlays-DIZlPzFH.js → overlays-DD7muPLd.js} +9 -9
- package/dist/overlays-DD7muPLd.js.map +1 -0
- package/dist/plugin.js +1 -1
- package/package.json +2 -2
- package/dist/overlays-DIZlPzFH.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as tv, b as backdrop, d as drawer, m as modal, o as overlay, a as overlayArrow, c as overlayTransitions } from './overlays-
|
|
2
|
-
export { e as twMerge } from './overlays-
|
|
1
|
+
import { t as tv, b as backdrop, d as drawer, m as modal, o as overlay, a as overlayArrow, c as overlayTransitions } from './overlays-DD7muPLd.js';
|
|
2
|
+
export { e as twMerge } from './overlays-DD7muPLd.js';
|
|
3
3
|
|
|
4
4
|
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'];
|
|
5
5
|
|
|
@@ -15,7 +15,7 @@ const statusRowCloseButton = ['shrink-0 self-center -mr-1 inline-block p-1.5 rou
|
|
|
15
15
|
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'];
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* `
|
|
18
|
+
* `surface` and `soft` wear the same outer box. `soft` carries its colour
|
|
19
19
|
* on the inner element instead (see its compound variants), so the two must
|
|
20
20
|
* stay identical out here — sharing the object keeps that structural rather
|
|
21
21
|
* than a thing a future edit has to remember.
|
|
@@ -38,20 +38,20 @@ const alert = tv({
|
|
|
38
38
|
// the notification stack's geometry.
|
|
39
39
|
//
|
|
40
40
|
// `overflow-hidden` is not optional: this element owns the radius, but
|
|
41
|
-
// the `
|
|
41
|
+
// the `soft` variant paints its tint on `inner` (it needs an opaque
|
|
42
42
|
// surface underneath — see that slot). `inner` has square corners, so
|
|
43
43
|
// without clipping here its tint paints over all four rounded corners
|
|
44
44
|
// and the alert reads as a rectangle.
|
|
45
45
|
base: 'w-full rounded-lg border overflow-hidden',
|
|
46
46
|
// The inner element carries the row layout. Alert has no
|
|
47
47
|
// ResizeObserver, so unlike the card it does not need this split for
|
|
48
|
-
// measurement — it needs it because the `
|
|
49
|
-
// `{
|
|
48
|
+
// measurement — it needs it because the `soft` variant's translucent
|
|
49
|
+
// `{status}-soft` tint has to composite over an opaque surface. All
|
|
50
50
|
// three variants share the structure rather than branching the DOM.
|
|
51
51
|
inner: 'flex gap-3 p-4 font-body text-body-2xs',
|
|
52
52
|
// `inline-flex items-center justify-center` turns this slot into a
|
|
53
53
|
// fixed 20px centering box, and `[&>*]:size-full` forces whatever
|
|
54
|
-
// element lands inside it (default
|
|
54
|
+
// element lands inside it (default status glyph, or arbitrary content
|
|
55
55
|
// yielded through the `icon` block, e.g. `<Spinner @size='sm' />`) to
|
|
56
56
|
// fill that box rather than render at its own intrinsic size. Without
|
|
57
57
|
// this, a yielded `Spinner` (`sm` = 24px) would overflow and
|
|
@@ -72,25 +72,25 @@ const alert = tv({
|
|
|
72
72
|
closeButton: statusRowCloseButton
|
|
73
73
|
},
|
|
74
74
|
variants: {
|
|
75
|
-
//
|
|
75
|
+
// Status alone paints nothing; every colour comes from an status ×
|
|
76
76
|
// variant compound below.
|
|
77
77
|
//
|
|
78
|
-
// The other half of an
|
|
79
|
-
// alert.gts maps it to a glyph and an ARIA role. Adding an
|
|
78
|
+
// The other half of an status lives in the component: `STATUS_CONFIG` in
|
|
79
|
+
// alert.gts maps it to a glyph and an ARIA role. Adding an status means
|
|
80
80
|
// adding it in both places — this list plus its three compound variants
|
|
81
81
|
// here, and a row there.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
status: {
|
|
83
|
+
neutral: {},
|
|
84
|
+
primary: {},
|
|
85
85
|
success: {},
|
|
86
86
|
warning: {},
|
|
87
87
|
danger: {}
|
|
88
88
|
},
|
|
89
89
|
variant: {
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
// *inner* element instead, so the outer box is `
|
|
93
|
-
|
|
90
|
+
surface: neutralSurface,
|
|
91
|
+
// Status-independent out here: every `soft` compound below tints the
|
|
92
|
+
// *inner* element instead, so the outer box is `surface`'s.
|
|
93
|
+
soft: neutralSurface,
|
|
94
94
|
solid: {
|
|
95
95
|
base: 'border-transparent'
|
|
96
96
|
}
|
|
@@ -140,20 +140,20 @@ const alert = tv({
|
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
compoundVariants: [
|
|
143
|
-
//
|
|
144
|
-
// The `
|
|
143
|
+
// surface: neutral surface, colour carried by the icon and title.
|
|
144
|
+
// The `neutral` status has no accent colour to lend the title emphasis,
|
|
145
145
|
// so the title earns its prominence from weight of ink instead, sitting
|
|
146
146
|
// a level above the icon.
|
|
147
147
|
{
|
|
148
|
-
variant: '
|
|
149
|
-
|
|
148
|
+
variant: 'surface',
|
|
149
|
+
status: 'neutral',
|
|
150
150
|
class: {
|
|
151
151
|
icon: 'text-neutral-firm',
|
|
152
152
|
title: 'text-neutral-bolder'
|
|
153
153
|
}
|
|
154
154
|
}, {
|
|
155
|
-
variant: '
|
|
156
|
-
|
|
155
|
+
variant: 'surface',
|
|
156
|
+
status: 'primary',
|
|
157
157
|
class: {
|
|
158
158
|
icon: 'text-primary',
|
|
159
159
|
title: 'text-primary'
|
|
@@ -161,8 +161,8 @@ const alert = tv({
|
|
|
161
161
|
}, {
|
|
162
162
|
// `success-firm` is only ~2.3:1 on a light surface; `bolder` clears
|
|
163
163
|
// AA in both themes. Same measurement the card's theme records.
|
|
164
|
-
variant: '
|
|
165
|
-
|
|
164
|
+
variant: 'surface',
|
|
165
|
+
status: 'success',
|
|
166
166
|
class: {
|
|
167
167
|
icon: 'text-success-bolder',
|
|
168
168
|
title: 'text-success-bolder'
|
|
@@ -170,59 +170,58 @@ const alert = tv({
|
|
|
170
170
|
}, {
|
|
171
171
|
// `warning-firm` is only ~3:1 on a light surface; `bolder` clears AA
|
|
172
172
|
// in both themes.
|
|
173
|
-
variant: '
|
|
174
|
-
|
|
173
|
+
variant: 'surface',
|
|
174
|
+
status: 'warning',
|
|
175
175
|
class: {
|
|
176
176
|
icon: 'text-warning-bolder',
|
|
177
177
|
title: 'text-warning-bolder'
|
|
178
178
|
}
|
|
179
179
|
}, {
|
|
180
|
-
variant: '
|
|
181
|
-
|
|
180
|
+
variant: 'surface',
|
|
181
|
+
status: 'danger',
|
|
182
182
|
class: {
|
|
183
183
|
icon: 'text-danger-firm',
|
|
184
184
|
title: 'text-danger-firm'
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
-
//
|
|
187
|
+
// soft: an opaque outer surface with the translucent `{status}-soft`
|
|
188
188
|
// tint and its `on-*` contrast ink applied to the inner element, which
|
|
189
|
-
// composites over that opaque surface. Same recipe as
|
|
190
|
-
// `appearance: 'tonal'` and NotificationCard's.
|
|
189
|
+
// composites over that opaque surface. Same recipe as NotificationCard's.
|
|
191
190
|
{
|
|
192
|
-
variant: '
|
|
193
|
-
|
|
191
|
+
variant: 'soft',
|
|
192
|
+
status: 'neutral',
|
|
194
193
|
class: {
|
|
195
194
|
inner: 'bg-neutral-soft',
|
|
196
195
|
icon: 'text-on-neutral-soft',
|
|
197
196
|
title: 'text-on-neutral-soft'
|
|
198
197
|
}
|
|
199
198
|
}, {
|
|
200
|
-
variant: '
|
|
201
|
-
|
|
199
|
+
variant: 'soft',
|
|
200
|
+
status: 'primary',
|
|
202
201
|
class: {
|
|
203
202
|
inner: 'bg-primary-soft',
|
|
204
203
|
icon: 'text-on-primary-soft',
|
|
205
204
|
title: 'text-on-primary-soft'
|
|
206
205
|
}
|
|
207
206
|
}, {
|
|
208
|
-
variant: '
|
|
209
|
-
|
|
207
|
+
variant: 'soft',
|
|
208
|
+
status: 'success',
|
|
210
209
|
class: {
|
|
211
210
|
inner: 'bg-success-soft',
|
|
212
211
|
icon: 'text-on-success-soft',
|
|
213
212
|
title: 'text-on-success-soft'
|
|
214
213
|
}
|
|
215
214
|
}, {
|
|
216
|
-
variant: '
|
|
217
|
-
|
|
215
|
+
variant: 'soft',
|
|
216
|
+
status: 'warning',
|
|
218
217
|
class: {
|
|
219
218
|
inner: 'bg-warning-soft',
|
|
220
219
|
icon: 'text-on-warning-soft',
|
|
221
220
|
title: 'text-on-warning-soft'
|
|
222
221
|
}
|
|
223
222
|
}, {
|
|
224
|
-
variant: '
|
|
225
|
-
|
|
223
|
+
variant: 'soft',
|
|
224
|
+
status: 'danger',
|
|
226
225
|
class: {
|
|
227
226
|
inner: 'bg-danger-soft',
|
|
228
227
|
icon: 'text-on-danger-soft',
|
|
@@ -230,11 +229,11 @@ const alert = tv({
|
|
|
230
229
|
}
|
|
231
230
|
},
|
|
232
231
|
// solid: filled surface, contrast ink. The description uses the
|
|
233
|
-
// full-strength `on-{
|
|
232
|
+
// full-strength `on-{status}` ink rather than a translucent cut — a
|
|
234
233
|
// translucent cut failed WCAG AA in the equivalent card recipe.
|
|
235
234
|
{
|
|
236
235
|
variant: 'solid',
|
|
237
|
-
|
|
236
|
+
status: 'neutral',
|
|
238
237
|
class: {
|
|
239
238
|
base: 'bg-neutral text-on-neutral',
|
|
240
239
|
icon: 'text-on-neutral',
|
|
@@ -243,7 +242,7 @@ const alert = tv({
|
|
|
243
242
|
}
|
|
244
243
|
}, {
|
|
245
244
|
variant: 'solid',
|
|
246
|
-
|
|
245
|
+
status: 'primary',
|
|
247
246
|
class: {
|
|
248
247
|
base: 'bg-primary text-on-primary',
|
|
249
248
|
icon: 'text-on-primary',
|
|
@@ -252,7 +251,7 @@ const alert = tv({
|
|
|
252
251
|
}
|
|
253
252
|
}, {
|
|
254
253
|
variant: 'solid',
|
|
255
|
-
|
|
254
|
+
status: 'success',
|
|
256
255
|
class: {
|
|
257
256
|
base: 'bg-success text-on-success',
|
|
258
257
|
icon: 'text-on-success',
|
|
@@ -261,7 +260,7 @@ const alert = tv({
|
|
|
261
260
|
}
|
|
262
261
|
}, {
|
|
263
262
|
variant: 'solid',
|
|
264
|
-
|
|
263
|
+
status: 'warning',
|
|
265
264
|
class: {
|
|
266
265
|
base: 'bg-warning text-on-warning',
|
|
267
266
|
icon: 'text-on-warning',
|
|
@@ -270,7 +269,7 @@ const alert = tv({
|
|
|
270
269
|
}
|
|
271
270
|
}, {
|
|
272
271
|
variant: 'solid',
|
|
273
|
-
|
|
272
|
+
status: 'danger',
|
|
274
273
|
class: {
|
|
275
274
|
base: 'bg-danger text-on-danger',
|
|
276
275
|
icon: 'text-on-danger',
|
|
@@ -309,8 +308,8 @@ const alert = tv({
|
|
|
309
308
|
}
|
|
310
309
|
}],
|
|
311
310
|
defaultVariants: {
|
|
312
|
-
|
|
313
|
-
variant: '
|
|
311
|
+
status: 'neutral',
|
|
312
|
+
variant: 'surface',
|
|
314
313
|
layout: 'inline',
|
|
315
314
|
hasDescription: false,
|
|
316
315
|
hasCloseButton: false
|
|
@@ -355,11 +354,11 @@ const avatar = tv({
|
|
|
355
354
|
const baseButton = tv({
|
|
356
355
|
base: ['inline-flex items-center justify-center', '[&_svg]:size-[1em]', 'font-header', 'border', 'border-transparent', 'disabled:cursor-not-allowed', 'disabled:opacity-disabled', ...focusVisibleRing],
|
|
357
356
|
variants: {
|
|
358
|
-
|
|
359
|
-
|
|
357
|
+
variant: {
|
|
358
|
+
outline: ''
|
|
360
359
|
},
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
color: {
|
|
361
|
+
neutral: '',
|
|
363
362
|
primary: 'focus-visible:ring-primary-soft',
|
|
364
363
|
secondary: 'focus-visible:ring-secondary-soft',
|
|
365
364
|
tertiary: 'focus-visible:ring-tertiary-soft',
|
|
@@ -380,49 +379,50 @@ const baseButton = tv({
|
|
|
380
379
|
}
|
|
381
380
|
},
|
|
382
381
|
compoundVariants: [{
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
variant: 'outline',
|
|
383
|
+
color: 'neutral',
|
|
385
384
|
class: 'text-neutral-bolder border-neutral-bolder hover:bg-neutral-subtle hover:text-neutral-firm/80 hover:border-neutral-strong active:bg-neutral-muted active:text-neutral-firm active:border-neutral-firm'
|
|
386
385
|
}, {
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
variant: 'outline',
|
|
387
|
+
color: 'primary',
|
|
389
388
|
class: 'text-primary border-primary hover:text-primary-mild hover:border-primary-mild active:text-primary-firm active:border-primary-firm'
|
|
390
389
|
}, {
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
variant: 'outline',
|
|
391
|
+
color: 'secondary',
|
|
393
392
|
class: 'text-secondary-strong border-secondary-strong hover:text-secondary-firm hover:border-secondary-firm active:text-secondary-bolder active:border-secondary-bolder'
|
|
394
393
|
}, {
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
variant: 'outline',
|
|
395
|
+
color: 'tertiary',
|
|
397
396
|
class: 'text-tertiary-strong border-tertiary-strong hover:text-tertiary-firm hover:border-tertiary-firm active:text-tertiary-bolder active:border-tertiary-bolder'
|
|
398
397
|
}, {
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
variant: 'outline',
|
|
399
|
+
color: 'success',
|
|
401
400
|
class: 'text-success-strong border-success-strong hover:text-success-firm hover:border-success-firm active:text-success-bolder active:border-success-bolder'
|
|
402
401
|
}, {
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
variant: 'outline',
|
|
403
|
+
color: 'warning',
|
|
405
404
|
class: 'text-warning-strong border-warning-strong hover:text-warning-firm hover:border-warning-firm active:text-warning-bolder active:border-warning-bolder'
|
|
406
405
|
}, {
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
variant: 'outline',
|
|
407
|
+
color: 'danger',
|
|
409
408
|
class: 'text-danger border-danger hover:text-danger-mild hover:border-danger-mild active:text-danger-firm active:border-danger-firm'
|
|
410
409
|
}],
|
|
411
410
|
defaultVariants: {
|
|
412
411
|
size: 'md',
|
|
413
|
-
|
|
412
|
+
color: 'neutral'
|
|
414
413
|
}
|
|
415
414
|
});
|
|
416
415
|
const button = tv({
|
|
417
416
|
extend: baseButton,
|
|
418
417
|
base: [''],
|
|
419
418
|
variants: {
|
|
420
|
-
|
|
421
|
-
|
|
419
|
+
variant: {
|
|
420
|
+
solid: 'shadow-elevation-2',
|
|
422
421
|
soft: '',
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
subtle: '',
|
|
423
|
+
outline: '',
|
|
424
|
+
ghost: '',
|
|
425
|
+
plain: '',
|
|
426
426
|
custom: ''
|
|
427
427
|
},
|
|
428
428
|
isLoading: {
|
|
@@ -430,159 +430,191 @@ const button = tv({
|
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
432
|
compoundVariants: [
|
|
433
|
-
//
|
|
433
|
+
// VARIANT: solid (Facet "filled") — fill + border + on-color
|
|
434
434
|
{
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
variant: 'solid',
|
|
436
|
+
color: 'neutral',
|
|
437
437
|
class: 'bg-neutral-bolder border-neutral-bolder text-on-neutral-bolder hover:bg-neutral-strong hover:border-neutral-strong hover:text-on-neutral-strong active:bg-neutral-firm active:border-neutral-firm active:text-on-neutral-firm'
|
|
438
438
|
}, {
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
variant: 'solid',
|
|
440
|
+
color: 'primary',
|
|
441
441
|
class: 'bg-primary border-primary text-on-primary hover:bg-primary-mild hover:border-primary-mild hover:text-on-primary-mild active:bg-primary-firm active:border-primary-firm active:text-on-primary-firm'
|
|
442
442
|
}, {
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
variant: 'solid',
|
|
444
|
+
color: 'secondary',
|
|
445
445
|
class: 'bg-secondary border-secondary text-on-secondary hover:bg-secondary-mild hover:border-secondary-mild hover:text-on-secondary-mild active:bg-secondary-firm active:border-secondary-firm active:text-on-secondary-firm'
|
|
446
446
|
}, {
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
variant: 'solid',
|
|
448
|
+
color: 'tertiary',
|
|
449
449
|
class: 'bg-tertiary border-tertiary text-on-tertiary hover:bg-tertiary-mild hover:border-tertiary-mild hover:text-on-tertiary-mild active:bg-tertiary-firm active:border-tertiary-firm active:text-on-tertiary-firm'
|
|
450
450
|
}, {
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
variant: 'solid',
|
|
452
|
+
color: 'success',
|
|
453
453
|
class: 'bg-success border-success text-on-success hover:bg-success-mild hover:border-success-mild hover:text-on-success-mild active:bg-success-firm active:border-success-firm active:text-on-success-firm'
|
|
454
454
|
}, {
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
variant: 'solid',
|
|
456
|
+
color: 'warning',
|
|
457
457
|
class: 'bg-warning border-warning text-on-warning hover:bg-warning-mild hover:border-warning-mild hover:text-on-warning-mild active:bg-warning-firm active:border-warning-firm active:text-on-warning-firm'
|
|
458
458
|
}, {
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
variant: 'solid',
|
|
460
|
+
color: 'danger',
|
|
461
461
|
class: 'bg-danger border-danger text-on-danger hover:bg-danger-mild hover:border-danger-mild hover:text-on-danger-mild active:bg-danger-firm active:border-danger-firm active:text-on-danger-firm'
|
|
462
462
|
},
|
|
463
|
-
//
|
|
463
|
+
// VARIANT: subtle — tint fill, plus the border Facet gives it
|
|
464
464
|
{
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
variant: 'subtle',
|
|
466
|
+
color: 'neutral',
|
|
467
467
|
class: 'bg-neutral-soft border-neutral-bolder text-neutral-bolder hover:bg-neutral-subtle hover:border-neutral-strong hover:text-neutral-strong active:bg-neutral-muted active:border-neutral-firm active:text-neutral-firm'
|
|
468
468
|
}, {
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
variant: 'subtle',
|
|
470
|
+
color: 'primary',
|
|
471
471
|
class: 'bg-primary-soft border-primary text-primary hover:bg-primary-subtle hover:border-primary-mild hover:text-primary-mild active:bg-primary-muted active:border-primary-firm active:text-primary-firm'
|
|
472
472
|
}, {
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
variant: 'subtle',
|
|
474
|
+
color: 'secondary',
|
|
475
475
|
class: 'bg-secondary-soft border-secondary-strong text-secondary-strong hover:bg-secondary-subtle hover:border-secondary-firm hover:text-secondary-firm active:bg-secondary-muted active:border-secondary-bolder active:text-secondary-bolder'
|
|
476
476
|
}, {
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
variant: 'subtle',
|
|
478
|
+
color: 'tertiary',
|
|
479
479
|
class: 'bg-tertiary-soft border-tertiary-strong text-tertiary-strong hover:bg-tertiary-subtle hover:border-tertiary-firm hover:text-tertiary-firm active:bg-tertiary-muted active:border-tertiary-bolder active:text-tertiary-bolder'
|
|
480
480
|
}, {
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
variant: 'subtle',
|
|
482
|
+
color: 'success',
|
|
483
483
|
class: 'bg-success-soft border-success-strong text-success-strong hover:bg-success-subtle hover:border-success-firm hover:text-success-firm active:bg-success-muted active:border-success-bolder active:text-success-bolder'
|
|
484
484
|
}, {
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
variant: 'subtle',
|
|
486
|
+
color: 'warning',
|
|
487
487
|
class: 'bg-warning-soft border-warning-strong text-warning-strong hover:bg-warning-subtle hover:border-warning-firm hover:text-warning-firm active:bg-warning-muted active:border-warning-bolder active:text-warning-bolder'
|
|
488
488
|
}, {
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
variant: 'subtle',
|
|
490
|
+
color: 'danger',
|
|
491
491
|
class: 'bg-danger-soft border-danger text-danger hover:bg-danger-subtle hover:border-danger-mild hover:text-danger-mild active:bg-danger-muted active:border-danger-firm active:text-danger-firm'
|
|
492
492
|
},
|
|
493
|
-
//
|
|
493
|
+
// VARIANT: plain (Facet "ghost") — ink only, no fill
|
|
494
494
|
{
|
|
495
|
-
|
|
496
|
-
|
|
495
|
+
variant: 'plain',
|
|
496
|
+
color: 'neutral',
|
|
497
497
|
class: 'text-neutral-bolder hover:text-neutral-firm/80 active:text-neutral-firm'
|
|
498
498
|
}, {
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
variant: 'plain',
|
|
500
|
+
color: 'primary',
|
|
501
501
|
class: 'text-primary hover:text-primary-mild active:text-primary-firm'
|
|
502
502
|
}, {
|
|
503
|
-
|
|
504
|
-
|
|
503
|
+
variant: 'plain',
|
|
504
|
+
color: 'secondary',
|
|
505
505
|
class: 'text-secondary-strong hover:text-secondary-firm active:text-secondary-bolder'
|
|
506
506
|
}, {
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
variant: 'plain',
|
|
508
|
+
color: 'tertiary',
|
|
509
509
|
class: 'text-tertiary-strong hover:text-tertiary-firm active:text-tertiary-bolder'
|
|
510
510
|
}, {
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
variant: 'plain',
|
|
512
|
+
color: 'success',
|
|
513
513
|
class: 'text-success-strong hover:text-success-firm active:text-success-bolder'
|
|
514
514
|
}, {
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
variant: 'plain',
|
|
516
|
+
color: 'warning',
|
|
517
517
|
class: 'text-warning-strong hover:text-warning-firm active:text-warning-bolder'
|
|
518
518
|
}, {
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
variant: 'plain',
|
|
520
|
+
color: 'danger',
|
|
521
521
|
class: 'text-danger hover:text-danger-mild active:text-danger-firm'
|
|
522
522
|
},
|
|
523
|
-
//
|
|
523
|
+
// VARIANT: ghost — plain's ink, plus a hover tint. New in 0.18; `plain`
|
|
524
|
+
// (formerly `minimal`) stays the no-fill option.
|
|
524
525
|
{
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
variant: 'ghost',
|
|
527
|
+
color: 'neutral',
|
|
528
|
+
class: 'text-neutral-bolder hover:bg-neutral-subtle hover:text-neutral-firm/80 active:bg-neutral-muted active:text-neutral-firm'
|
|
529
|
+
}, {
|
|
530
|
+
variant: 'ghost',
|
|
531
|
+
color: 'primary',
|
|
532
|
+
class: 'text-primary hover:bg-primary-soft hover:text-primary-mild active:bg-primary-muted active:text-primary-firm'
|
|
533
|
+
}, {
|
|
534
|
+
variant: 'ghost',
|
|
535
|
+
color: 'secondary',
|
|
536
|
+
class: 'text-secondary-strong hover:bg-secondary-soft hover:text-secondary-firm active:bg-secondary-muted active:text-secondary-bolder'
|
|
537
|
+
}, {
|
|
538
|
+
variant: 'ghost',
|
|
539
|
+
color: 'tertiary',
|
|
540
|
+
class: 'text-tertiary-strong hover:bg-tertiary-soft hover:text-tertiary-firm active:bg-tertiary-muted active:text-tertiary-bolder'
|
|
541
|
+
}, {
|
|
542
|
+
variant: 'ghost',
|
|
543
|
+
color: 'success',
|
|
544
|
+
class: 'text-success-strong hover:bg-success-soft hover:text-success-firm active:bg-success-muted active:text-success-bolder'
|
|
545
|
+
}, {
|
|
546
|
+
variant: 'ghost',
|
|
547
|
+
color: 'warning',
|
|
548
|
+
class: 'text-warning-strong hover:bg-warning-soft hover:text-warning-firm active:bg-warning-muted active:text-warning-bolder'
|
|
549
|
+
}, {
|
|
550
|
+
variant: 'ghost',
|
|
551
|
+
color: 'danger',
|
|
552
|
+
class: 'text-danger hover:bg-danger-soft hover:text-danger-mild active:bg-danger-muted active:text-danger-firm'
|
|
553
|
+
},
|
|
554
|
+
// VARIANT: soft — tint fill that deepens through the ramp
|
|
555
|
+
{
|
|
556
|
+
variant: 'soft',
|
|
557
|
+
color: 'neutral',
|
|
527
558
|
class: 'bg-neutral-soft text-on-neutral-soft hover:bg-neutral-muted hover:text-on-neutral-muted active:bg-neutral-mild active:text-on-neutral-mild'
|
|
528
559
|
}, {
|
|
529
|
-
|
|
530
|
-
|
|
560
|
+
variant: 'soft',
|
|
561
|
+
color: 'primary',
|
|
531
562
|
class: 'bg-primary-soft text-on-primary-soft hover:bg-primary-muted hover:text-on-primary-muted active:bg-primary-mild active:text-on-primary-mild'
|
|
532
563
|
}, {
|
|
533
|
-
|
|
534
|
-
|
|
564
|
+
variant: 'soft',
|
|
565
|
+
color: 'secondary',
|
|
535
566
|
class: 'bg-secondary-soft text-on-secondary-soft hover:bg-secondary-muted hover:text-on-secondary-muted active:bg-secondary-mild active:text-on-secondary-mild'
|
|
536
567
|
}, {
|
|
537
|
-
|
|
538
|
-
|
|
568
|
+
variant: 'soft',
|
|
569
|
+
color: 'tertiary',
|
|
539
570
|
class: 'bg-tertiary-soft text-on-tertiary-soft hover:bg-tertiary-muted hover:text-on-tertiary-muted active:bg-tertiary-mild active:text-on-tertiary-mild'
|
|
540
571
|
}, {
|
|
541
|
-
|
|
542
|
-
|
|
572
|
+
variant: 'soft',
|
|
573
|
+
color: 'success',
|
|
543
574
|
class: 'bg-success-soft text-on-success-soft hover:bg-success-muted hover:text-on-success-muted active:bg-success-mild active:text-on-success-mild'
|
|
544
575
|
}, {
|
|
545
|
-
|
|
546
|
-
|
|
576
|
+
variant: 'soft',
|
|
577
|
+
color: 'warning',
|
|
547
578
|
class: 'bg-warning-soft text-on-warning-soft hover:bg-warning-muted hover:text-on-warning-muted active:bg-warning-mild active:text-on-warning-mild'
|
|
548
579
|
}, {
|
|
549
|
-
|
|
550
|
-
|
|
580
|
+
variant: 'soft',
|
|
581
|
+
color: 'danger',
|
|
551
582
|
class: 'bg-danger-soft text-on-danger-soft hover:bg-danger-muted hover:text-on-danger-muted active:bg-danger-mild active:text-on-danger-mild'
|
|
552
583
|
},
|
|
553
|
-
//
|
|
584
|
+
// VARIANT: custom
|
|
554
585
|
{
|
|
555
|
-
|
|
556
|
-
|
|
586
|
+
variant: 'custom',
|
|
587
|
+
color: 'neutral',
|
|
557
588
|
class: 'text-neutral-strong'
|
|
558
589
|
}, {
|
|
559
|
-
|
|
560
|
-
|
|
590
|
+
variant: 'custom',
|
|
591
|
+
color: 'primary',
|
|
561
592
|
class: 'text-primary-strong'
|
|
562
593
|
}, {
|
|
563
|
-
|
|
564
|
-
|
|
594
|
+
variant: 'custom',
|
|
595
|
+
color: 'secondary',
|
|
565
596
|
class: 'text-secondary-strong'
|
|
566
597
|
}, {
|
|
567
|
-
|
|
568
|
-
|
|
598
|
+
variant: 'custom',
|
|
599
|
+
color: 'tertiary',
|
|
569
600
|
class: 'text-tertiary-strong'
|
|
570
601
|
}, {
|
|
571
|
-
|
|
572
|
-
|
|
602
|
+
variant: 'custom',
|
|
603
|
+
color: 'success',
|
|
573
604
|
class: 'text-success-strong'
|
|
574
605
|
}, {
|
|
575
|
-
|
|
576
|
-
|
|
606
|
+
variant: 'custom',
|
|
607
|
+
color: 'warning',
|
|
577
608
|
class: 'text-warning-strong'
|
|
578
609
|
}, {
|
|
579
|
-
|
|
580
|
-
|
|
610
|
+
variant: 'custom',
|
|
611
|
+
color: 'danger',
|
|
581
612
|
class: 'text-danger-strong'
|
|
582
613
|
}],
|
|
583
614
|
defaultVariants: {
|
|
584
615
|
size: 'md',
|
|
585
|
-
|
|
616
|
+
color: 'primary',
|
|
617
|
+
variant: 'solid'
|
|
586
618
|
}
|
|
587
619
|
});
|
|
588
620
|
const toggleButton = tv({
|
|
@@ -595,45 +627,45 @@ const toggleButton = tv({
|
|
|
595
627
|
},
|
|
596
628
|
// Selected is a *filled* state, so every color has to be restated here —
|
|
597
629
|
// fill, border and ink, for the resting, hover and active steps. The
|
|
598
|
-
// unselected `
|
|
630
|
+
// unselected `outline` rules in `baseButton` set their own
|
|
599
631
|
// `hover:text-*`/`active:*` colors, and anything we leave out keeps leaking
|
|
600
632
|
// through: an unselected ink color over a selected fill is what produced the
|
|
601
633
|
// unreadable label on hover. The ramp matches the filled button
|
|
602
|
-
// (`
|
|
634
|
+
// (`variant: 'solid'`) — one step deeper on hover, another on active —
|
|
603
635
|
// and pairs each fill with its generated `on-*` contrast ink.
|
|
604
636
|
compoundVariants: [{
|
|
605
|
-
|
|
606
|
-
|
|
637
|
+
variant: 'outline',
|
|
638
|
+
color: 'neutral',
|
|
607
639
|
isSelected: true,
|
|
608
640
|
class: 'bg-neutral-bolder border-neutral-bolder text-on-neutral-bolder hover:bg-neutral-strong hover:border-neutral-strong hover:text-on-neutral-strong active:bg-neutral-firm active:border-neutral-firm active:text-on-neutral-firm'
|
|
609
641
|
}, {
|
|
610
|
-
|
|
611
|
-
|
|
642
|
+
variant: 'outline',
|
|
643
|
+
color: 'primary',
|
|
612
644
|
isSelected: true,
|
|
613
645
|
class: 'bg-primary border-primary text-on-primary hover:bg-primary-mild hover:border-primary-mild hover:text-on-primary-mild active:bg-primary-firm active:border-primary-firm active:text-on-primary-firm'
|
|
614
646
|
}, {
|
|
615
|
-
|
|
616
|
-
|
|
647
|
+
variant: 'outline',
|
|
648
|
+
color: 'secondary',
|
|
617
649
|
isSelected: true,
|
|
618
650
|
class: 'bg-secondary border-secondary text-on-secondary hover:bg-secondary-mild hover:border-secondary-mild hover:text-on-secondary-mild active:bg-secondary-firm active:border-secondary-firm active:text-on-secondary-firm'
|
|
619
651
|
}, {
|
|
620
|
-
|
|
621
|
-
|
|
652
|
+
variant: 'outline',
|
|
653
|
+
color: 'tertiary',
|
|
622
654
|
isSelected: true,
|
|
623
655
|
class: 'bg-tertiary border-tertiary text-on-tertiary hover:bg-tertiary-mild hover:border-tertiary-mild hover:text-on-tertiary-mild active:bg-tertiary-firm active:border-tertiary-firm active:text-on-tertiary-firm'
|
|
624
656
|
}, {
|
|
625
|
-
|
|
626
|
-
|
|
657
|
+
variant: 'outline',
|
|
658
|
+
color: 'success',
|
|
627
659
|
isSelected: true,
|
|
628
660
|
class: 'bg-success border-success text-on-success hover:bg-success-mild hover:border-success-mild hover:text-on-success-mild active:bg-success-firm active:border-success-firm active:text-on-success-firm'
|
|
629
661
|
}, {
|
|
630
|
-
|
|
631
|
-
|
|
662
|
+
variant: 'outline',
|
|
663
|
+
color: 'warning',
|
|
632
664
|
isSelected: true,
|
|
633
665
|
class: 'bg-warning border-warning text-on-warning hover:bg-warning-mild hover:border-warning-mild hover:text-on-warning-mild active:bg-warning-firm active:border-warning-firm active:text-on-warning-firm'
|
|
634
666
|
}, {
|
|
635
|
-
|
|
636
|
-
|
|
667
|
+
variant: 'outline',
|
|
668
|
+
color: 'danger',
|
|
637
669
|
isSelected: true,
|
|
638
670
|
class: 'bg-danger border-danger text-on-danger hover:bg-danger-mild hover:border-danger-mild hover:text-on-danger-mild active:bg-danger-firm active:border-danger-firm active:text-on-danger-firm'
|
|
639
671
|
}]
|
|
@@ -665,18 +697,18 @@ const chip = tv({
|
|
|
665
697
|
isDisabled: {
|
|
666
698
|
true: 'opacity-disabled cursor-not-allowed'
|
|
667
699
|
},
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
700
|
+
variant: {
|
|
701
|
+
solid: '',
|
|
702
|
+
outline: '',
|
|
703
|
+
soft: ''
|
|
672
704
|
},
|
|
673
|
-
// The close button is a filled circle in every
|
|
674
|
-
// light enough to sit on the page in `
|
|
705
|
+
// The close button is a filled circle in every variant. `-muted` is
|
|
706
|
+
// light enough to sit on the page in `outline`/`soft` and to read as a
|
|
675
707
|
// disc on a filled chip, and each level carries its own `on-` colour — the
|
|
676
708
|
// pairing this used to get wrong, by putting `text-on-{intent}` (the
|
|
677
709
|
// contrast colour for the DEFAULT level) on a `-muted` circle.
|
|
678
|
-
|
|
679
|
-
|
|
710
|
+
color: {
|
|
711
|
+
neutral: {
|
|
680
712
|
dot: 'bg-neutral-strong',
|
|
681
713
|
closeButton: 'bg-neutral-muted text-on-neutral-muted'
|
|
682
714
|
},
|
|
@@ -737,163 +769,163 @@ const chip = tv({
|
|
|
737
769
|
// dot disappears into it. Inherit the chip's text colour instead — the one
|
|
738
770
|
// colour guaranteed to contrast the fill.
|
|
739
771
|
{
|
|
740
|
-
|
|
772
|
+
variant: 'solid',
|
|
741
773
|
class: {
|
|
742
774
|
dot: 'bg-current'
|
|
743
775
|
}
|
|
744
776
|
},
|
|
745
|
-
//
|
|
777
|
+
// VARIANT: solid (filled)
|
|
746
778
|
//
|
|
747
779
|
// The chip's own fill is the intent's DEFAULT level, so the close button
|
|
748
|
-
// cannot hover *towards* it the way the other two
|
|
780
|
+
// cannot hover *towards* it the way the other two variants do — the
|
|
749
781
|
// circle would vanish into the chip. It steps down to `-subtle` instead.
|
|
750
782
|
{
|
|
751
|
-
|
|
752
|
-
|
|
783
|
+
variant: 'solid',
|
|
784
|
+
color: 'neutral',
|
|
753
785
|
class: {
|
|
754
786
|
base: 'bg-neutral-bolder text-on-neutral-bolder',
|
|
755
787
|
closeButton: 'hover:bg-neutral-subtle hover:text-on-neutral-subtle'
|
|
756
788
|
}
|
|
757
789
|
}, {
|
|
758
|
-
|
|
759
|
-
|
|
790
|
+
variant: 'solid',
|
|
791
|
+
color: 'primary',
|
|
760
792
|
class: {
|
|
761
793
|
base: 'bg-primary text-on-primary',
|
|
762
794
|
closeButton: 'hover:bg-primary-subtle hover:text-on-primary-subtle'
|
|
763
795
|
}
|
|
764
796
|
}, {
|
|
765
|
-
|
|
766
|
-
|
|
797
|
+
variant: 'solid',
|
|
798
|
+
color: 'secondary',
|
|
767
799
|
class: {
|
|
768
800
|
base: 'bg-secondary text-on-secondary',
|
|
769
801
|
closeButton: 'hover:bg-secondary-subtle hover:text-on-secondary-subtle'
|
|
770
802
|
}
|
|
771
803
|
}, {
|
|
772
|
-
|
|
773
|
-
|
|
804
|
+
variant: 'solid',
|
|
805
|
+
color: 'tertiary',
|
|
774
806
|
class: {
|
|
775
807
|
base: 'bg-tertiary text-on-tertiary',
|
|
776
808
|
closeButton: 'hover:bg-tertiary-subtle hover:text-on-tertiary-subtle'
|
|
777
809
|
}
|
|
778
810
|
}, {
|
|
779
|
-
|
|
780
|
-
|
|
811
|
+
variant: 'solid',
|
|
812
|
+
color: 'success',
|
|
781
813
|
class: {
|
|
782
814
|
base: 'bg-success text-on-success',
|
|
783
815
|
closeButton: 'hover:bg-success-subtle hover:text-on-success-subtle'
|
|
784
816
|
}
|
|
785
817
|
}, {
|
|
786
|
-
|
|
787
|
-
|
|
818
|
+
variant: 'solid',
|
|
819
|
+
color: 'warning',
|
|
788
820
|
class: {
|
|
789
821
|
base: 'bg-warning text-on-warning',
|
|
790
822
|
closeButton: 'hover:bg-warning-subtle hover:text-on-warning-subtle'
|
|
791
823
|
}
|
|
792
824
|
}, {
|
|
793
|
-
|
|
794
|
-
|
|
825
|
+
variant: 'solid',
|
|
826
|
+
color: 'danger',
|
|
795
827
|
class: {
|
|
796
828
|
base: 'bg-danger text-on-danger',
|
|
797
829
|
closeButton: 'hover:bg-danger-subtle hover:text-on-danger-subtle'
|
|
798
830
|
}
|
|
799
831
|
},
|
|
800
|
-
//
|
|
832
|
+
// VARIANT: soft (tonal)
|
|
801
833
|
{
|
|
802
|
-
|
|
803
|
-
|
|
834
|
+
variant: 'soft',
|
|
835
|
+
color: 'neutral',
|
|
804
836
|
class: {
|
|
805
837
|
base: 'text-neutral-strong bg-neutral-subtle',
|
|
806
838
|
closeButton: 'hover:bg-neutral hover:text-on-neutral'
|
|
807
839
|
}
|
|
808
840
|
}, {
|
|
809
|
-
|
|
810
|
-
|
|
841
|
+
variant: 'soft',
|
|
842
|
+
color: 'primary',
|
|
811
843
|
class: {
|
|
812
844
|
base: 'text-primary-strong bg-primary-subtle',
|
|
813
845
|
closeButton: 'hover:bg-primary hover:text-on-primary'
|
|
814
846
|
}
|
|
815
847
|
}, {
|
|
816
|
-
|
|
817
|
-
|
|
848
|
+
variant: 'soft',
|
|
849
|
+
color: 'secondary',
|
|
818
850
|
class: {
|
|
819
851
|
base: 'text-secondary-strong bg-secondary-subtle',
|
|
820
852
|
closeButton: 'hover:bg-secondary hover:text-on-secondary'
|
|
821
853
|
}
|
|
822
854
|
}, {
|
|
823
|
-
|
|
824
|
-
|
|
855
|
+
variant: 'soft',
|
|
856
|
+
color: 'tertiary',
|
|
825
857
|
class: {
|
|
826
858
|
base: 'text-tertiary-strong bg-tertiary-subtle',
|
|
827
859
|
closeButton: 'hover:bg-tertiary hover:text-on-tertiary'
|
|
828
860
|
}
|
|
829
861
|
}, {
|
|
830
|
-
|
|
831
|
-
|
|
862
|
+
variant: 'soft',
|
|
863
|
+
color: 'success',
|
|
832
864
|
class: {
|
|
833
865
|
base: 'text-success-strong bg-success-subtle',
|
|
834
866
|
closeButton: 'hover:bg-success hover:text-on-success'
|
|
835
867
|
}
|
|
836
868
|
}, {
|
|
837
|
-
|
|
838
|
-
|
|
869
|
+
variant: 'soft',
|
|
870
|
+
color: 'warning',
|
|
839
871
|
class: {
|
|
840
872
|
base: 'text-warning-strong bg-warning-subtle',
|
|
841
873
|
closeButton: 'hover:bg-warning hover:text-on-warning'
|
|
842
874
|
}
|
|
843
875
|
}, {
|
|
844
|
-
|
|
845
|
-
|
|
876
|
+
variant: 'soft',
|
|
877
|
+
color: 'danger',
|
|
846
878
|
class: {
|
|
847
879
|
base: 'text-danger-strong bg-danger-subtle',
|
|
848
880
|
closeButton: 'hover:bg-danger hover:text-on-danger'
|
|
849
881
|
}
|
|
850
882
|
},
|
|
851
|
-
//
|
|
883
|
+
// VARIANT: outline
|
|
852
884
|
{
|
|
853
|
-
|
|
854
|
-
|
|
885
|
+
variant: 'outline',
|
|
886
|
+
color: 'neutral',
|
|
855
887
|
class: {
|
|
856
888
|
base: 'text-neutral-strong border border-neutral',
|
|
857
889
|
closeButton: 'hover:bg-neutral hover:text-on-neutral'
|
|
858
890
|
}
|
|
859
891
|
}, {
|
|
860
|
-
|
|
861
|
-
|
|
892
|
+
variant: 'outline',
|
|
893
|
+
color: 'primary',
|
|
862
894
|
class: {
|
|
863
895
|
base: 'text-primary-strong border border-primary',
|
|
864
896
|
closeButton: 'hover:bg-primary hover:text-on-primary'
|
|
865
897
|
}
|
|
866
898
|
}, {
|
|
867
|
-
|
|
868
|
-
|
|
899
|
+
variant: 'outline',
|
|
900
|
+
color: 'secondary',
|
|
869
901
|
class: {
|
|
870
902
|
base: 'text-secondary-strong border border-secondary',
|
|
871
903
|
closeButton: 'hover:bg-secondary hover:text-on-secondary'
|
|
872
904
|
}
|
|
873
905
|
}, {
|
|
874
|
-
|
|
875
|
-
|
|
906
|
+
variant: 'outline',
|
|
907
|
+
color: 'tertiary',
|
|
876
908
|
class: {
|
|
877
909
|
base: 'text-tertiary-strong border border-tertiary',
|
|
878
910
|
closeButton: 'hover:bg-tertiary hover:text-on-tertiary'
|
|
879
911
|
}
|
|
880
912
|
}, {
|
|
881
|
-
|
|
882
|
-
|
|
913
|
+
variant: 'outline',
|
|
914
|
+
color: 'success',
|
|
883
915
|
class: {
|
|
884
916
|
base: 'text-success-strong border border-success',
|
|
885
917
|
closeButton: 'hover:bg-success hover:text-on-success'
|
|
886
918
|
}
|
|
887
919
|
}, {
|
|
888
|
-
|
|
889
|
-
|
|
920
|
+
variant: 'outline',
|
|
921
|
+
color: 'warning',
|
|
890
922
|
class: {
|
|
891
923
|
base: 'text-warning-strong border border-warning',
|
|
892
924
|
closeButton: 'hover:bg-warning hover:text-on-warning'
|
|
893
925
|
}
|
|
894
926
|
}, {
|
|
895
|
-
|
|
896
|
-
|
|
927
|
+
variant: 'outline',
|
|
928
|
+
color: 'danger',
|
|
897
929
|
class: {
|
|
898
930
|
base: 'text-danger-strong border border-danger',
|
|
899
931
|
closeButton: 'hover:bg-danger hover:text-on-danger'
|
|
@@ -901,8 +933,8 @@ const chip = tv({
|
|
|
901
933
|
}],
|
|
902
934
|
defaultVariants: {
|
|
903
935
|
size: 'md',
|
|
904
|
-
|
|
905
|
-
|
|
936
|
+
color: 'neutral',
|
|
937
|
+
variant: 'solid',
|
|
906
938
|
radius: 'full'
|
|
907
939
|
}
|
|
908
940
|
});
|
|
@@ -920,8 +952,8 @@ const progressBar = tv({
|
|
|
920
952
|
progress: ['animate-loading origin-left']
|
|
921
953
|
}
|
|
922
954
|
},
|
|
923
|
-
|
|
924
|
-
|
|
955
|
+
color: {
|
|
956
|
+
neutral: {
|
|
925
957
|
progress: 'bg-neutral-strong'
|
|
926
958
|
},
|
|
927
959
|
primary: {
|
|
@@ -976,7 +1008,7 @@ const progressBar = tv({
|
|
|
976
1008
|
},
|
|
977
1009
|
defaultVariants: {
|
|
978
1010
|
size: 'md',
|
|
979
|
-
|
|
1011
|
+
color: 'neutral',
|
|
980
1012
|
radius: 'sm'
|
|
981
1013
|
}
|
|
982
1014
|
});
|
|
@@ -1005,17 +1037,17 @@ const closeButton = tv({
|
|
|
1005
1037
|
}
|
|
1006
1038
|
},
|
|
1007
1039
|
variant: {
|
|
1008
|
-
|
|
1040
|
+
ghost: {
|
|
1009
1041
|
base: ['bg-transparent', 'hover:bg-surface-overlay-subtle']
|
|
1010
1042
|
},
|
|
1011
|
-
|
|
1043
|
+
soft: {
|
|
1012
1044
|
base: ['bg-neutral-subtle', 'text-on-neutral-subtle', 'hover:bg-surface-overlay-subtle']
|
|
1013
1045
|
}
|
|
1014
1046
|
}
|
|
1015
1047
|
},
|
|
1016
1048
|
defaultVariants: {
|
|
1017
1049
|
size: 'md',
|
|
1018
|
-
variant: '
|
|
1050
|
+
variant: 'ghost'
|
|
1019
1051
|
}
|
|
1020
1052
|
});
|
|
1021
1053
|
|
|
@@ -1138,20 +1170,20 @@ const kbd = tv({
|
|
|
1138
1170
|
key: 'h-7 min-w-7 px-2 rounded-md text-label-sm'
|
|
1139
1171
|
}
|
|
1140
1172
|
},
|
|
1141
|
-
// Colours live in the compound variants below, paired with `
|
|
1142
|
-
|
|
1143
|
-
|
|
1173
|
+
// Colours live in the compound variants below, paired with `color`.
|
|
1174
|
+
variant: {
|
|
1175
|
+
solid: {
|
|
1144
1176
|
key: 'border border-transparent'
|
|
1145
1177
|
},
|
|
1146
|
-
|
|
1178
|
+
outline: {
|
|
1147
1179
|
key: 'border bg-transparent'
|
|
1148
1180
|
},
|
|
1149
|
-
|
|
1181
|
+
subtle: {
|
|
1150
1182
|
key: 'border'
|
|
1151
1183
|
},
|
|
1152
1184
|
// Follows whatever colour it is sitting on. This is what lets a keycap
|
|
1153
1185
|
// ride an active, filled Listbox row without the row's theme having to
|
|
1154
|
-
// repaint it for every
|
|
1186
|
+
// repaint it for every color.
|
|
1155
1187
|
inherit: {
|
|
1156
1188
|
key: 'border border-current/20 bg-transparent text-current'
|
|
1157
1189
|
},
|
|
@@ -1161,8 +1193,8 @@ const kbd = tv({
|
|
|
1161
1193
|
key: 'border-0 bg-transparent px-0 min-w-0 text-current tracking-wide'
|
|
1162
1194
|
}
|
|
1163
1195
|
},
|
|
1164
|
-
|
|
1165
|
-
|
|
1196
|
+
color: {
|
|
1197
|
+
neutral: {},
|
|
1166
1198
|
primary: {},
|
|
1167
1199
|
secondary: {},
|
|
1168
1200
|
tertiary: {},
|
|
@@ -1181,148 +1213,162 @@ const kbd = tv({
|
|
|
1181
1213
|
}
|
|
1182
1214
|
},
|
|
1183
1215
|
compoundVariants: [
|
|
1184
|
-
//
|
|
1216
|
+
// variant: solid -- a filled cap. `-muted` is light enough to read as
|
|
1185
1217
|
// a key on a page and each level carries its own `on-` contrast colour.
|
|
1186
1218
|
{
|
|
1187
|
-
|
|
1188
|
-
|
|
1219
|
+
variant: 'solid',
|
|
1220
|
+
color: 'neutral',
|
|
1189
1221
|
class: {
|
|
1190
1222
|
key: 'bg-neutral-muted text-on-neutral-muted'
|
|
1191
1223
|
}
|
|
1192
1224
|
}, {
|
|
1193
|
-
|
|
1194
|
-
|
|
1225
|
+
variant: 'solid',
|
|
1226
|
+
color: 'primary',
|
|
1195
1227
|
class: {
|
|
1196
1228
|
key: 'bg-primary-muted text-on-primary-muted'
|
|
1197
1229
|
}
|
|
1198
1230
|
}, {
|
|
1199
|
-
|
|
1200
|
-
|
|
1231
|
+
variant: 'solid',
|
|
1232
|
+
color: 'secondary',
|
|
1201
1233
|
class: {
|
|
1202
1234
|
key: 'bg-secondary-muted text-on-secondary-muted'
|
|
1203
1235
|
}
|
|
1204
1236
|
}, {
|
|
1205
|
-
|
|
1206
|
-
|
|
1237
|
+
variant: 'solid',
|
|
1238
|
+
color: 'tertiary',
|
|
1207
1239
|
class: {
|
|
1208
1240
|
key: 'bg-tertiary-muted text-on-tertiary-muted'
|
|
1209
1241
|
}
|
|
1210
1242
|
}, {
|
|
1211
|
-
|
|
1212
|
-
|
|
1243
|
+
variant: 'solid',
|
|
1244
|
+
color: 'success',
|
|
1213
1245
|
class: {
|
|
1214
1246
|
key: 'bg-success-muted text-on-success-muted'
|
|
1215
1247
|
}
|
|
1216
1248
|
}, {
|
|
1217
|
-
|
|
1218
|
-
|
|
1249
|
+
variant: 'solid',
|
|
1250
|
+
color: 'warning',
|
|
1219
1251
|
class: {
|
|
1220
1252
|
key: 'bg-warning-muted text-on-warning-muted'
|
|
1221
1253
|
}
|
|
1222
1254
|
}, {
|
|
1223
|
-
|
|
1224
|
-
|
|
1255
|
+
variant: 'solid',
|
|
1256
|
+
color: 'danger',
|
|
1225
1257
|
class: {
|
|
1226
1258
|
key: 'bg-danger-muted text-on-danger-muted'
|
|
1227
1259
|
}
|
|
1228
1260
|
},
|
|
1229
|
-
//
|
|
1261
|
+
// variant: outline
|
|
1230
1262
|
{
|
|
1231
|
-
|
|
1232
|
-
|
|
1263
|
+
variant: 'outline',
|
|
1264
|
+
color: 'neutral',
|
|
1233
1265
|
class: {
|
|
1234
1266
|
key: 'border-neutral text-neutral-strong'
|
|
1235
1267
|
}
|
|
1236
1268
|
}, {
|
|
1237
|
-
|
|
1238
|
-
|
|
1269
|
+
variant: 'outline',
|
|
1270
|
+
color: 'primary',
|
|
1239
1271
|
class: {
|
|
1240
1272
|
key: 'border-primary text-primary-strong'
|
|
1241
1273
|
}
|
|
1242
1274
|
}, {
|
|
1243
|
-
|
|
1244
|
-
|
|
1275
|
+
variant: 'outline',
|
|
1276
|
+
color: 'secondary',
|
|
1245
1277
|
class: {
|
|
1246
1278
|
key: 'border-secondary text-secondary-strong'
|
|
1247
1279
|
}
|
|
1248
1280
|
}, {
|
|
1249
|
-
|
|
1250
|
-
|
|
1281
|
+
variant: 'outline',
|
|
1282
|
+
color: 'tertiary',
|
|
1251
1283
|
class: {
|
|
1252
1284
|
key: 'border-tertiary text-tertiary-strong'
|
|
1253
1285
|
}
|
|
1254
1286
|
}, {
|
|
1255
|
-
|
|
1256
|
-
|
|
1287
|
+
variant: 'outline',
|
|
1288
|
+
color: 'success',
|
|
1257
1289
|
class: {
|
|
1258
1290
|
key: 'border-success text-success-strong'
|
|
1259
1291
|
}
|
|
1260
1292
|
}, {
|
|
1261
|
-
|
|
1262
|
-
|
|
1293
|
+
variant: 'outline',
|
|
1294
|
+
color: 'warning',
|
|
1263
1295
|
class: {
|
|
1264
1296
|
key: 'border-warning text-warning-strong'
|
|
1265
1297
|
}
|
|
1266
1298
|
}, {
|
|
1267
|
-
|
|
1268
|
-
|
|
1299
|
+
variant: 'outline',
|
|
1300
|
+
color: 'danger',
|
|
1269
1301
|
class: {
|
|
1270
1302
|
key: 'border-danger text-danger-strong'
|
|
1271
1303
|
}
|
|
1272
1304
|
},
|
|
1273
|
-
//
|
|
1305
|
+
// variant: subtle
|
|
1274
1306
|
{
|
|
1275
|
-
|
|
1276
|
-
|
|
1307
|
+
variant: 'subtle',
|
|
1308
|
+
color: 'neutral',
|
|
1277
1309
|
class: {
|
|
1278
1310
|
key: 'bg-neutral-subtle border-neutral-soft text-neutral-strong'
|
|
1279
1311
|
}
|
|
1280
1312
|
}, {
|
|
1281
|
-
|
|
1282
|
-
|
|
1313
|
+
variant: 'subtle',
|
|
1314
|
+
color: 'primary',
|
|
1283
1315
|
class: {
|
|
1284
1316
|
key: 'bg-primary-subtle border-primary-soft text-primary-strong'
|
|
1285
1317
|
}
|
|
1286
1318
|
}, {
|
|
1287
|
-
|
|
1288
|
-
|
|
1319
|
+
variant: 'subtle',
|
|
1320
|
+
color: 'secondary',
|
|
1289
1321
|
class: {
|
|
1290
1322
|
key: 'bg-secondary-subtle border-secondary-soft text-secondary-strong'
|
|
1291
1323
|
}
|
|
1292
1324
|
}, {
|
|
1293
|
-
|
|
1294
|
-
|
|
1325
|
+
variant: 'subtle',
|
|
1326
|
+
color: 'tertiary',
|
|
1295
1327
|
class: {
|
|
1296
1328
|
key: 'bg-tertiary-subtle border-tertiary-soft text-tertiary-strong'
|
|
1297
1329
|
}
|
|
1298
1330
|
}, {
|
|
1299
|
-
|
|
1300
|
-
|
|
1331
|
+
variant: 'subtle',
|
|
1332
|
+
color: 'success',
|
|
1301
1333
|
class: {
|
|
1302
1334
|
key: 'bg-success-subtle border-success-soft text-success-strong'
|
|
1303
1335
|
}
|
|
1304
1336
|
}, {
|
|
1305
|
-
|
|
1306
|
-
|
|
1337
|
+
variant: 'subtle',
|
|
1338
|
+
color: 'warning',
|
|
1307
1339
|
class: {
|
|
1308
1340
|
key: 'bg-warning-subtle border-warning-soft text-warning-strong'
|
|
1309
1341
|
}
|
|
1310
1342
|
}, {
|
|
1311
|
-
|
|
1312
|
-
|
|
1343
|
+
variant: 'subtle',
|
|
1344
|
+
color: 'danger',
|
|
1313
1345
|
class: {
|
|
1314
1346
|
key: 'bg-danger-subtle border-danger-soft text-danger-strong'
|
|
1315
1347
|
}
|
|
1316
1348
|
}],
|
|
1317
1349
|
defaultVariants: {
|
|
1318
1350
|
size: 'md',
|
|
1319
|
-
|
|
1320
|
-
|
|
1351
|
+
color: 'neutral',
|
|
1352
|
+
variant: 'solid'
|
|
1321
1353
|
}
|
|
1322
1354
|
});
|
|
1323
1355
|
|
|
1324
1356
|
const listbox = tv({
|
|
1325
|
-
base: 'w-full flex flex-col gap-0.5 outline-hidden p-1'
|
|
1357
|
+
base: 'w-full flex flex-col gap-0.5 outline-hidden p-1',
|
|
1358
|
+
variants: {
|
|
1359
|
+
color: {
|
|
1360
|
+
neutral: '',
|
|
1361
|
+
primary: '',
|
|
1362
|
+
secondary: '',
|
|
1363
|
+
tertiary: '',
|
|
1364
|
+
success: '',
|
|
1365
|
+
warning: '',
|
|
1366
|
+
danger: ''
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
defaultVariants: {
|
|
1370
|
+
color: 'neutral'
|
|
1371
|
+
}
|
|
1326
1372
|
});
|
|
1327
1373
|
const listboxItem = tv({
|
|
1328
1374
|
slots: {
|
|
@@ -1338,19 +1384,19 @@ const listboxItem = tv({
|
|
|
1338
1384
|
submenuIndicator: ['text-neutral-firm', 'group-data-is-active:text-inherit', 'w-4', 'h-4', 'shrink-0']
|
|
1339
1385
|
},
|
|
1340
1386
|
variants: {
|
|
1341
|
-
|
|
1342
|
-
|
|
1387
|
+
variant: {
|
|
1388
|
+
solid: {
|
|
1343
1389
|
base: ''
|
|
1344
1390
|
},
|
|
1345
|
-
|
|
1391
|
+
outline: {
|
|
1346
1392
|
base: 'border border-transparent bg-transparent'
|
|
1347
1393
|
},
|
|
1348
|
-
|
|
1394
|
+
subtle: {
|
|
1349
1395
|
base: ['border border-transparent']
|
|
1350
1396
|
}
|
|
1351
1397
|
},
|
|
1352
|
-
|
|
1353
|
-
|
|
1398
|
+
color: {
|
|
1399
|
+
neutral: {},
|
|
1354
1400
|
primary: {},
|
|
1355
1401
|
secondary: {},
|
|
1356
1402
|
tertiary: {},
|
|
@@ -1380,138 +1426,138 @@ const listboxItem = tv({
|
|
|
1380
1426
|
}
|
|
1381
1427
|
},
|
|
1382
1428
|
defaultVariants: {
|
|
1383
|
-
|
|
1384
|
-
|
|
1429
|
+
variant: 'solid',
|
|
1430
|
+
color: 'neutral'
|
|
1385
1431
|
},
|
|
1386
1432
|
compoundVariants: [
|
|
1387
|
-
//
|
|
1433
|
+
// variant: solid
|
|
1388
1434
|
{
|
|
1389
|
-
|
|
1390
|
-
|
|
1435
|
+
variant: 'solid',
|
|
1436
|
+
color: 'neutral',
|
|
1391
1437
|
class: {
|
|
1392
1438
|
base: ['data-is-active:bg-neutral-subtle', 'data-is-active:text-neutral-strong']
|
|
1393
1439
|
}
|
|
1394
1440
|
}, {
|
|
1395
|
-
|
|
1396
|
-
|
|
1441
|
+
variant: 'solid',
|
|
1442
|
+
color: 'primary',
|
|
1397
1443
|
class: {
|
|
1398
1444
|
base: ['data-is-active:bg-primary-soft', 'data-is-active:text-on-primary-soft']
|
|
1399
1445
|
}
|
|
1400
1446
|
}, {
|
|
1401
|
-
|
|
1402
|
-
|
|
1447
|
+
variant: 'solid',
|
|
1448
|
+
color: 'secondary',
|
|
1403
1449
|
class: {
|
|
1404
1450
|
base: ['data-is-active:bg-secondary-soft', 'data-is-active:text-on-secondary-soft']
|
|
1405
1451
|
}
|
|
1406
1452
|
}, {
|
|
1407
|
-
|
|
1408
|
-
|
|
1453
|
+
variant: 'solid',
|
|
1454
|
+
color: 'tertiary',
|
|
1409
1455
|
class: {
|
|
1410
1456
|
base: ['data-is-active:bg-tertiary-soft', 'data-is-active:text-on-tertiary-soft']
|
|
1411
1457
|
}
|
|
1412
1458
|
}, {
|
|
1413
|
-
|
|
1414
|
-
|
|
1459
|
+
variant: 'solid',
|
|
1460
|
+
color: 'success',
|
|
1415
1461
|
class: {
|
|
1416
1462
|
base: ['data-is-active:bg-success-soft', 'data-is-active:text-on-success-soft']
|
|
1417
1463
|
}
|
|
1418
1464
|
}, {
|
|
1419
|
-
|
|
1420
|
-
|
|
1465
|
+
variant: 'solid',
|
|
1466
|
+
color: 'warning',
|
|
1421
1467
|
class: {
|
|
1422
1468
|
base: ['data-is-active:bg-warning-soft', 'data-is-active:text-on-warning-soft']
|
|
1423
1469
|
}
|
|
1424
1470
|
}, {
|
|
1425
|
-
|
|
1426
|
-
|
|
1471
|
+
variant: 'solid',
|
|
1472
|
+
color: 'danger',
|
|
1427
1473
|
class: {
|
|
1428
1474
|
base: ['data-is-active:bg-danger-soft', 'data-is-active:text-on-danger-soft']
|
|
1429
1475
|
}
|
|
1430
1476
|
},
|
|
1431
|
-
//
|
|
1477
|
+
// variant: outline
|
|
1432
1478
|
{
|
|
1433
|
-
|
|
1434
|
-
|
|
1479
|
+
variant: 'outline',
|
|
1480
|
+
color: 'neutral',
|
|
1435
1481
|
class: {
|
|
1436
1482
|
base: ['data-is-active:border-neutral', 'data-is-active:text-neutral-strong']
|
|
1437
1483
|
}
|
|
1438
1484
|
}, {
|
|
1439
|
-
|
|
1440
|
-
|
|
1485
|
+
variant: 'outline',
|
|
1486
|
+
color: 'primary',
|
|
1441
1487
|
class: {
|
|
1442
1488
|
base: ['data-is-active:border-primary', 'data-is-active:text-primary-strong']
|
|
1443
1489
|
}
|
|
1444
1490
|
}, {
|
|
1445
|
-
|
|
1446
|
-
|
|
1491
|
+
variant: 'outline',
|
|
1492
|
+
color: 'secondary',
|
|
1447
1493
|
class: {
|
|
1448
1494
|
base: ['data-is-active:border-secondary', 'data-is-active:text-secondary-strong']
|
|
1449
1495
|
}
|
|
1450
1496
|
}, {
|
|
1451
|
-
|
|
1452
|
-
|
|
1497
|
+
variant: 'outline',
|
|
1498
|
+
color: 'tertiary',
|
|
1453
1499
|
class: {
|
|
1454
1500
|
base: ['data-is-active:border-tertiary', 'data-is-active:text-tertiary-strong']
|
|
1455
1501
|
}
|
|
1456
1502
|
}, {
|
|
1457
|
-
|
|
1458
|
-
|
|
1503
|
+
variant: 'outline',
|
|
1504
|
+
color: 'success',
|
|
1459
1505
|
class: {
|
|
1460
1506
|
base: ['data-is-active:border-success', 'data-is-active:text-success-strong']
|
|
1461
1507
|
}
|
|
1462
1508
|
}, {
|
|
1463
|
-
|
|
1464
|
-
|
|
1509
|
+
variant: 'outline',
|
|
1510
|
+
color: 'warning',
|
|
1465
1511
|
class: {
|
|
1466
1512
|
base: ['data-is-active:border-warning', 'data-is-active:text-warning-strong']
|
|
1467
1513
|
}
|
|
1468
1514
|
}, {
|
|
1469
|
-
|
|
1470
|
-
|
|
1515
|
+
variant: 'outline',
|
|
1516
|
+
color: 'danger',
|
|
1471
1517
|
class: {
|
|
1472
1518
|
base: ['data-is-active:border-danger', 'data-is-active:text-danger-strong']
|
|
1473
1519
|
}
|
|
1474
1520
|
},
|
|
1475
|
-
//
|
|
1521
|
+
// variant: subtle
|
|
1476
1522
|
{
|
|
1477
|
-
|
|
1478
|
-
|
|
1523
|
+
variant: 'subtle',
|
|
1524
|
+
color: 'neutral',
|
|
1479
1525
|
class: {
|
|
1480
1526
|
base: ['data-is-active:bg-neutral-soft/20', 'data-is-active:border-neutral', 'data-is-active:text-neutral-strong']
|
|
1481
1527
|
}
|
|
1482
1528
|
}, {
|
|
1483
|
-
|
|
1484
|
-
|
|
1529
|
+
variant: 'subtle',
|
|
1530
|
+
color: 'primary',
|
|
1485
1531
|
class: {
|
|
1486
1532
|
base: ['data-is-active:bg-primary-soft/20', 'data-is-active:border-primary', 'data-is-active:text-primary-strong']
|
|
1487
1533
|
}
|
|
1488
1534
|
}, {
|
|
1489
|
-
|
|
1490
|
-
|
|
1535
|
+
variant: 'subtle',
|
|
1536
|
+
color: 'secondary',
|
|
1491
1537
|
class: {
|
|
1492
1538
|
base: ['data-is-active:bg-secondary-soft/20', 'data-is-active:border-secondary', 'data-is-active:text-secondary-strong']
|
|
1493
1539
|
}
|
|
1494
1540
|
}, {
|
|
1495
|
-
|
|
1496
|
-
|
|
1541
|
+
variant: 'subtle',
|
|
1542
|
+
color: 'tertiary',
|
|
1497
1543
|
class: {
|
|
1498
1544
|
base: ['data-is-active:bg-tertiary-soft/20', 'data-is-active:border-tertiary', 'data-is-active:text-tertiary-strong']
|
|
1499
1545
|
}
|
|
1500
1546
|
}, {
|
|
1501
|
-
|
|
1502
|
-
|
|
1547
|
+
variant: 'subtle',
|
|
1548
|
+
color: 'success',
|
|
1503
1549
|
class: {
|
|
1504
1550
|
base: ['data-is-active:bg-success-soft/20', 'data-is-active:border-success', 'data-is-active:text-success-strong']
|
|
1505
1551
|
}
|
|
1506
1552
|
}, {
|
|
1507
|
-
|
|
1508
|
-
|
|
1553
|
+
variant: 'subtle',
|
|
1554
|
+
color: 'warning',
|
|
1509
1555
|
class: {
|
|
1510
1556
|
base: ['data-is-active:bg-warning-soft/20', 'data-is-active:border-warning', 'data-is-active:text-warning-strong']
|
|
1511
1557
|
}
|
|
1512
1558
|
}, {
|
|
1513
|
-
|
|
1514
|
-
|
|
1559
|
+
variant: 'subtle',
|
|
1560
|
+
color: 'danger',
|
|
1515
1561
|
class: {
|
|
1516
1562
|
base: ['data-is-active:bg-danger-soft/20', 'data-is-active:border-danger', 'data-is-active:text-danger-strong']
|
|
1517
1563
|
}
|
|
@@ -1543,7 +1589,12 @@ const popover = tv({
|
|
|
1543
1589
|
md: 'w-64',
|
|
1544
1590
|
lg: 'w-96',
|
|
1545
1591
|
xl: 'w-136',
|
|
1546
|
-
trigger: 'w-(--trigger-width)'
|
|
1592
|
+
trigger: 'w-(--trigger-width)',
|
|
1593
|
+
// Sizes to the content instead of a fixed width. For panels whose
|
|
1594
|
+
// natural width is the point -- a calendar grid is as wide as seven day
|
|
1595
|
+
// cells, and wider still with two months side by side -- a fixed width
|
|
1596
|
+
// either clips the content or leaves it swimming.
|
|
1597
|
+
auto: 'w-auto'
|
|
1547
1598
|
}
|
|
1548
1599
|
},
|
|
1549
1600
|
defaultVariants: {
|
|
@@ -1704,8 +1755,8 @@ const spinner = tv({
|
|
|
1704
1755
|
lg: 'w-10 h-10',
|
|
1705
1756
|
xl: 'w-12 h-12'
|
|
1706
1757
|
},
|
|
1707
|
-
|
|
1708
|
-
|
|
1758
|
+
color: {
|
|
1759
|
+
neutral: 'fill-neutral-strong',
|
|
1709
1760
|
primary: 'fill-primary',
|
|
1710
1761
|
secondary: 'fill-secondary',
|
|
1711
1762
|
tertiary: 'fill-tertiary',
|
|
@@ -1716,7 +1767,7 @@ const spinner = tv({
|
|
|
1716
1767
|
},
|
|
1717
1768
|
defaultVariants: {
|
|
1718
1769
|
size: 'md',
|
|
1719
|
-
|
|
1770
|
+
color: 'neutral'
|
|
1720
1771
|
}
|
|
1721
1772
|
});
|
|
1722
1773
|
|
|
@@ -2060,8 +2111,8 @@ const segmentedControl = tv({
|
|
|
2060
2111
|
// modes -- the two express selection on different elements, so a rule per
|
|
2061
2112
|
// mode is one mode away from being forgotten. Written literally: Tailwind
|
|
2062
2113
|
// generates nothing from a composed class string.
|
|
2063
|
-
|
|
2064
|
-
|
|
2114
|
+
color: {
|
|
2115
|
+
neutral: {
|
|
2065
2116
|
// Opaque white in light mode. In dark, `surface-card` is translucent,
|
|
2066
2117
|
// so an opaque neutral is used instead -- see the track above.
|
|
2067
2118
|
indicator: 'bg-surface-card dark:bg-neutral-soft',
|
|
@@ -2182,7 +2233,7 @@ const segmentedControl = tv({
|
|
|
2182
2233
|
}],
|
|
2183
2234
|
defaultVariants: {
|
|
2184
2235
|
variant: 'solid',
|
|
2185
|
-
|
|
2236
|
+
color: 'neutral',
|
|
2186
2237
|
size: 'md',
|
|
2187
2238
|
orientation: 'horizontal'
|
|
2188
2239
|
}
|
|
@@ -2233,11 +2284,11 @@ const tabs = tv({
|
|
|
2233
2284
|
}
|
|
2234
2285
|
},
|
|
2235
2286
|
// Fill and selected ink travel together: the label sits on the fill, so a
|
|
2236
|
-
// new
|
|
2287
|
+
// new color needs both or its selected label is unreadable on its own
|
|
2237
2288
|
// background. `underline` overrides the ink in one compound below, since a
|
|
2238
2289
|
// bare bar puts no fill behind the label.
|
|
2239
|
-
|
|
2240
|
-
|
|
2290
|
+
color: {
|
|
2291
|
+
neutral: {
|
|
2241
2292
|
indicator: 'bg-surface-card dark:bg-neutral-soft',
|
|
2242
2293
|
tab: 'data-[selected=true]:text-neutral-bolder'
|
|
2243
2294
|
},
|
|
@@ -2309,8 +2360,8 @@ const tabs = tv({
|
|
|
2309
2360
|
}
|
|
2310
2361
|
},
|
|
2311
2362
|
compoundVariants: [
|
|
2312
|
-
// -- underline: no fill behind the label, so the
|
|
2313
|
-
// bar alone and the label stays high-contrast neutral at every
|
|
2363
|
+
// -- underline: no fill behind the label, so the color colour lives on the
|
|
2364
|
+
// bar alone and the label stays high-contrast neutral at every color --
|
|
2314
2365
|
// matching the reference designs. The hover chip shares this matcher, so it
|
|
2315
2366
|
// rides along rather than repeating the condition in a second entry.
|
|
2316
2367
|
{
|
|
@@ -2332,10 +2383,10 @@ const tabs = tv({
|
|
|
2332
2383
|
tab: 'rounded-xl'
|
|
2333
2384
|
}
|
|
2334
2385
|
},
|
|
2335
|
-
// `
|
|
2386
|
+
// `neutral` color's fill is a surface in solid; a bare bar needs ink.
|
|
2336
2387
|
{
|
|
2337
2388
|
variant: 'underline',
|
|
2338
|
-
|
|
2389
|
+
color: 'neutral',
|
|
2339
2390
|
class: {
|
|
2340
2391
|
indicator: 'bg-neutral-bolder'
|
|
2341
2392
|
}
|
|
@@ -2363,7 +2414,7 @@ const tabs = tv({
|
|
|
2363
2414
|
}],
|
|
2364
2415
|
defaultVariants: {
|
|
2365
2416
|
variant: 'solid',
|
|
2366
|
-
|
|
2417
|
+
color: 'neutral',
|
|
2367
2418
|
size: 'md',
|
|
2368
2419
|
orientation: 'horizontal'
|
|
2369
2420
|
}
|
|
@@ -2398,12 +2449,12 @@ const accordion = tv({
|
|
|
2398
2449
|
// No chrome at all.
|
|
2399
2450
|
ghost: {},
|
|
2400
2451
|
// Rules between items, none after the last.
|
|
2401
|
-
|
|
2452
|
+
separated: {
|
|
2402
2453
|
item: 'border-b border-neutral-muted last:border-b-0'
|
|
2403
2454
|
},
|
|
2404
2455
|
// A soft fill on the open item. Horizontal padding comes with the
|
|
2405
2456
|
// surface -- text running to the edge of a tinted box reads as a bug.
|
|
2406
|
-
|
|
2457
|
+
soft: {
|
|
2407
2458
|
item: 'rounded-lg data-[open=true]:bg-surface-overlay-soft',
|
|
2408
2459
|
trigger: 'px-3',
|
|
2409
2460
|
contentBody: 'px-3'
|
|
@@ -2458,7 +2509,7 @@ const accordion = tv({
|
|
|
2458
2509
|
}
|
|
2459
2510
|
},
|
|
2460
2511
|
defaultVariants: {
|
|
2461
|
-
variant: '
|
|
2512
|
+
variant: 'separated',
|
|
2462
2513
|
size: 'md'
|
|
2463
2514
|
}
|
|
2464
2515
|
});
|
|
@@ -2541,9 +2592,9 @@ const calendar = tv({
|
|
|
2541
2592
|
// `relative` is the positioning context for the today dot. Deliberately
|
|
2542
2593
|
// no z-index -- see `cellBand`.
|
|
2543
2594
|
'relative', 'inline-flex items-center justify-center', 'size-[calc(var(--calendar-cell-size)-0.25rem)]', 'rounded-[var(--calendar-cell-radius)]', 'text-body-sm text-neutral-strong', 'cursor-pointer select-none', 'transition-colors duration-200 motion-reduce:transition-none',
|
|
2544
|
-
// Selected days are excluded here and get their own hover per
|
|
2595
|
+
// Selected days are excluded here and get their own hover per color.
|
|
2545
2596
|
// Without the exclusion this rule wins on specificity -- it carries an
|
|
2546
|
-
// extra `:hover` over the
|
|
2597
|
+
// extra `:hover` over the color's plain `data-[selected=true]` -- so
|
|
2547
2598
|
// hovering the selected day replaced its fill with a grey overlay and
|
|
2548
2599
|
// made it look deselected.
|
|
2549
2600
|
'not-data-[disabled=true]:not-data-[selected=true]:hover:bg-surface-overlay-soft', 'data-[outside=true]:text-neutral-mild', 'data-[disabled=true]:cursor-not-allowed data-[disabled=true]:text-neutral-mild', 'data-[unavailable=true]:line-through data-[unavailable=true]:cursor-not-allowed', 'data-[unavailable=true]:hover:bg-transparent'],
|
|
@@ -2570,8 +2621,8 @@ const calendar = tv({
|
|
|
2570
2621
|
yearCell: [...focusVisibleRing, 'rounded-full px-3 py-2 text-body-sm cursor-pointer', 'hover:bg-surface-overlay-soft', 'data-[selected=true]:bg-surface-overlay-soft data-[selected=true]:font-medium']
|
|
2571
2622
|
},
|
|
2572
2623
|
variants: {
|
|
2573
|
-
|
|
2574
|
-
|
|
2624
|
+
color: {
|
|
2625
|
+
neutral: {
|
|
2575
2626
|
day: 'data-[selected=true]:bg-neutral-strong data-[selected=true]:text-on-neutral-strong data-[selected=true]:hover:bg-neutral-bolder',
|
|
2576
2627
|
cellBand: 'data-[in-range=true]:bg-neutral-soft'
|
|
2577
2628
|
},
|
|
@@ -2622,7 +2673,7 @@ const calendar = tv({
|
|
|
2622
2673
|
}
|
|
2623
2674
|
},
|
|
2624
2675
|
defaultVariants: {
|
|
2625
|
-
|
|
2676
|
+
color: 'primary',
|
|
2626
2677
|
size: 'md'
|
|
2627
2678
|
}
|
|
2628
2679
|
});
|
|
@@ -2702,9 +2753,9 @@ const pagination = tv({
|
|
|
2702
2753
|
}
|
|
2703
2754
|
},
|
|
2704
2755
|
// Fill and label travel together: the digit sits on the fill, so each
|
|
2705
|
-
//
|
|
2706
|
-
|
|
2707
|
-
|
|
2756
|
+
// color needs both or the active chip is unreadable.
|
|
2757
|
+
color: {
|
|
2758
|
+
neutral: {
|
|
2708
2759
|
page: 'data-[active=true]:bg-neutral-bolder data-[active=true]:text-on-neutral-bolder'
|
|
2709
2760
|
},
|
|
2710
2761
|
primary: {
|
|
@@ -2739,7 +2790,7 @@ const pagination = tv({
|
|
|
2739
2790
|
},
|
|
2740
2791
|
defaultVariants: {
|
|
2741
2792
|
size: 'md',
|
|
2742
|
-
|
|
2793
|
+
color: 'neutral',
|
|
2743
2794
|
isDisabled: false
|
|
2744
2795
|
}
|
|
2745
2796
|
});
|
|
@@ -2765,22 +2816,22 @@ const tooltip = tv({
|
|
|
2765
2816
|
base: 'px-3 py-2 text-label-md'
|
|
2766
2817
|
}
|
|
2767
2818
|
},
|
|
2768
|
-
// `bg-inherit` on the arrow (see `overlayArrow`) means each
|
|
2819
|
+
// `bg-inherit` on the arrow (see `overlayArrow`) means each color only
|
|
2769
2820
|
// has to state the background once, on `base`. The border is stated on
|
|
2770
|
-
// both `base` and `arrow` for every
|
|
2821
|
+
// both `base` and `arrow` for every color so the two agree at the join:
|
|
2771
2822
|
// `default` carries a visible `border-neutral-soft` on each (the arrow's
|
|
2772
2823
|
// own shadow-less edge needs a level with more contrast than the body's
|
|
2773
|
-
// `shadow-md` gets away with), and every coloured
|
|
2824
|
+
// `shadow-md` gets away with), and every coloured color clears both to
|
|
2774
2825
|
// `border-transparent`. The body needs this explicitly, not just the
|
|
2775
2826
|
// arrow: `Content`'s classNames (`popover.gts`) run this `base` class
|
|
2776
2827
|
// through the *`popover`* tv, whose own base carries
|
|
2777
2828
|
// `border border-neutral-subtle` (`popover.ts`) -- twMerge only drops
|
|
2778
2829
|
// that when a later class from the same border-color group replaces it,
|
|
2779
|
-
// so a coloured
|
|
2830
|
+
// so a coloured color with no border class of its own left that
|
|
2780
2831
|
// neutral border showing on the body while the arrow (fixed here to
|
|
2781
2832
|
// `border-transparent`) went invisible, a visible seam at the join.
|
|
2782
|
-
|
|
2783
|
-
|
|
2833
|
+
color: {
|
|
2834
|
+
neutral: {
|
|
2784
2835
|
base: 'bg-surface-input text-on-surface-input border border-neutral-soft',
|
|
2785
2836
|
arrow: 'border-neutral-soft'
|
|
2786
2837
|
},
|
|
@@ -2812,7 +2863,7 @@ const tooltip = tv({
|
|
|
2812
2863
|
},
|
|
2813
2864
|
defaultVariants: {
|
|
2814
2865
|
size: 'md',
|
|
2815
|
-
|
|
2866
|
+
color: 'neutral'
|
|
2816
2867
|
}
|
|
2817
2868
|
});
|
|
2818
2869
|
|
|
@@ -2895,12 +2946,12 @@ const notificationCard = tv({
|
|
|
2895
2946
|
inner: 'flex gap-3 p-4 font-body text-body-2xs',
|
|
2896
2947
|
icon: 'shrink-0 size-5',
|
|
2897
2948
|
// The loading spinner's own slot, distinct from `icon`. It must NOT
|
|
2898
|
-
// reuse `icon` — `icon`'s
|
|
2949
|
+
// reuse `icon` — `icon`'s status-coloured `text-*` class (the compound
|
|
2899
2950
|
// variants below) would win the Tailwind-merge over the Spinner's own
|
|
2900
2951
|
// dim `text-neutral-muted` track, making the arc and track nearly
|
|
2901
2952
|
// identical and the spin unreadable. `size-5` matches `icon` exactly so
|
|
2902
2953
|
// a promise settling (spinner -> icon) never resizes the card. The arc
|
|
2903
|
-
// colour comes from `@
|
|
2954
|
+
// colour comes from `@status` passed to <Spinner>, not from this slot;
|
|
2904
2955
|
// this slot only ever supplies sizing/position and, where needed
|
|
2905
2956
|
// (solid variant below), an explicit track/arc override.
|
|
2906
2957
|
spinner: 'shrink-0 size-5',
|
|
@@ -2912,9 +2963,9 @@ const notificationCard = tv({
|
|
|
2912
2963
|
closeButton: statusRowCloseButton
|
|
2913
2964
|
},
|
|
2914
2965
|
variants: {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2966
|
+
status: {
|
|
2967
|
+
neutral: {},
|
|
2968
|
+
primary: {},
|
|
2918
2969
|
success: {},
|
|
2919
2970
|
warning: {},
|
|
2920
2971
|
danger: {}
|
|
@@ -2925,15 +2976,15 @@ const notificationCard = tv({
|
|
|
2925
2976
|
// size. `text-neutral-firm` clears it comfortably against every
|
|
2926
2977
|
// surface this description can sit on, light or dark, tonal or not.
|
|
2927
2978
|
// See packages/frontile/docs/notifications-usage.md's contrast note for the measured ratios.
|
|
2928
|
-
|
|
2979
|
+
surface: {
|
|
2929
2980
|
base: 'bg-surface-modal border-surface-overlay-mild',
|
|
2930
2981
|
description: 'text-neutral-firm'
|
|
2931
2982
|
},
|
|
2932
|
-
// The outer surface/border is
|
|
2933
|
-
// compound variant below borrows the same neutral surface `
|
|
2934
|
-
// uses (see the comment above the `
|
|
2983
|
+
// The outer surface/border is status-independent — every `soft`
|
|
2984
|
+
// compound variant below borrows the same neutral surface `surface`
|
|
2985
|
+
// uses (see the comment above the `soft` compound variants), so it
|
|
2935
2986
|
// lives here once instead of repeating in each of them.
|
|
2936
|
-
|
|
2987
|
+
soft: {
|
|
2937
2988
|
base: 'bg-surface-modal border-surface-overlay-mild',
|
|
2938
2989
|
description: 'text-neutral-firm'
|
|
2939
2990
|
},
|
|
@@ -2972,19 +3023,19 @@ const notificationCard = tv({
|
|
|
2972
3023
|
}
|
|
2973
3024
|
},
|
|
2974
3025
|
compoundVariants: [
|
|
2975
|
-
//
|
|
2976
|
-
// `default`
|
|
2977
|
-
// `firm` level the other
|
|
3026
|
+
// surface: neutral surface, colour carried by the icon and title.
|
|
3027
|
+
// `default` status has no accent — icon and title stay neutral, same
|
|
3028
|
+
// `firm` level the other statuses use for their accent text.
|
|
2978
3029
|
{
|
|
2979
|
-
variant: '
|
|
2980
|
-
|
|
3030
|
+
variant: 'surface',
|
|
3031
|
+
status: 'neutral',
|
|
2981
3032
|
class: {
|
|
2982
3033
|
icon: 'text-neutral-firm',
|
|
2983
3034
|
title: 'text-neutral-firm'
|
|
2984
3035
|
}
|
|
2985
3036
|
}, {
|
|
2986
|
-
variant: '
|
|
2987
|
-
|
|
3037
|
+
variant: 'surface',
|
|
3038
|
+
status: 'primary',
|
|
2988
3039
|
class: {
|
|
2989
3040
|
icon: 'text-primary',
|
|
2990
3041
|
title: 'text-primary'
|
|
@@ -2993,8 +3044,8 @@ const notificationCard = tv({
|
|
|
2993
3044
|
// `success-firm` is only ~2.3:1 on the white card surface in light
|
|
2994
3045
|
// mode; `bolder` clears AA in both themes. See packages/frontile/docs/notifications-usage.md's
|
|
2995
3046
|
// contrast note.
|
|
2996
|
-
variant: '
|
|
2997
|
-
|
|
3047
|
+
variant: 'surface',
|
|
3048
|
+
status: 'success',
|
|
2998
3049
|
class: {
|
|
2999
3050
|
icon: 'text-success-bolder',
|
|
3000
3051
|
title: 'text-success-bolder'
|
|
@@ -3003,64 +3054,61 @@ const notificationCard = tv({
|
|
|
3003
3054
|
// `warning-firm` is only ~3:1 on the white card surface in light
|
|
3004
3055
|
// mode; `bolder` clears AA in both themes. See packages/frontile/docs/notifications-usage.md's
|
|
3005
3056
|
// contrast note.
|
|
3006
|
-
variant: '
|
|
3007
|
-
|
|
3057
|
+
variant: 'surface',
|
|
3058
|
+
status: 'warning',
|
|
3008
3059
|
class: {
|
|
3009
3060
|
icon: 'text-warning-bolder',
|
|
3010
3061
|
title: 'text-warning-bolder'
|
|
3011
3062
|
}
|
|
3012
3063
|
}, {
|
|
3013
|
-
variant: '
|
|
3014
|
-
|
|
3064
|
+
variant: 'surface',
|
|
3065
|
+
status: 'danger',
|
|
3015
3066
|
class: {
|
|
3016
3067
|
icon: 'text-danger-firm',
|
|
3017
3068
|
title: 'text-danger-firm'
|
|
3018
3069
|
}
|
|
3019
3070
|
},
|
|
3020
|
-
//
|
|
3021
|
-
//
|
|
3022
|
-
//
|
|
3023
|
-
//
|
|
3024
|
-
//
|
|
3025
|
-
//
|
|
3026
|
-
// tonal has no border at all, but a card floating over arbitrary page
|
|
3027
|
-
// content benefits from the same edge definition `default` already
|
|
3028
|
-
// uses, so it borrows that treatment rather than inventing a new one.
|
|
3071
|
+
// soft: an opaque outer surface (so the floating card never lets page
|
|
3072
|
+
// content show through) with the translucent `{status}-soft` tint and its
|
|
3073
|
+
// `on-*` contrast ink applied to the *inner* element, which composites
|
|
3074
|
+
// over that opaque surface. The outer picks up the `surface` variant's
|
|
3075
|
+
// neutral surface/border instead of a colour-matched one, so it borrows
|
|
3076
|
+
// that treatment rather than inventing a new one.
|
|
3029
3077
|
{
|
|
3030
|
-
variant: '
|
|
3031
|
-
|
|
3078
|
+
variant: 'soft',
|
|
3079
|
+
status: 'neutral',
|
|
3032
3080
|
class: {
|
|
3033
3081
|
inner: 'bg-neutral-soft',
|
|
3034
3082
|
icon: 'text-on-neutral-soft',
|
|
3035
3083
|
title: 'text-on-neutral-soft'
|
|
3036
3084
|
}
|
|
3037
3085
|
}, {
|
|
3038
|
-
variant: '
|
|
3039
|
-
|
|
3086
|
+
variant: 'soft',
|
|
3087
|
+
status: 'primary',
|
|
3040
3088
|
class: {
|
|
3041
3089
|
inner: 'bg-primary-soft',
|
|
3042
3090
|
icon: 'text-on-primary-soft',
|
|
3043
3091
|
title: 'text-on-primary-soft'
|
|
3044
3092
|
}
|
|
3045
3093
|
}, {
|
|
3046
|
-
variant: '
|
|
3047
|
-
|
|
3094
|
+
variant: 'soft',
|
|
3095
|
+
status: 'success',
|
|
3048
3096
|
class: {
|
|
3049
3097
|
inner: 'bg-success-soft',
|
|
3050
3098
|
icon: 'text-on-success-soft',
|
|
3051
3099
|
title: 'text-on-success-soft'
|
|
3052
3100
|
}
|
|
3053
3101
|
}, {
|
|
3054
|
-
variant: '
|
|
3055
|
-
|
|
3102
|
+
variant: 'soft',
|
|
3103
|
+
status: 'warning',
|
|
3056
3104
|
class: {
|
|
3057
3105
|
inner: 'bg-warning-soft',
|
|
3058
3106
|
icon: 'text-on-warning-soft',
|
|
3059
3107
|
title: 'text-on-warning-soft'
|
|
3060
3108
|
}
|
|
3061
3109
|
}, {
|
|
3062
|
-
variant: '
|
|
3063
|
-
|
|
3110
|
+
variant: 'soft',
|
|
3111
|
+
status: 'danger',
|
|
3064
3112
|
class: {
|
|
3065
3113
|
inner: 'bg-danger-soft',
|
|
3066
3114
|
icon: 'text-on-danger-soft',
|
|
@@ -3068,18 +3116,18 @@ const notificationCard = tv({
|
|
|
3068
3116
|
}
|
|
3069
3117
|
},
|
|
3070
3118
|
// solid: filled surface, contrast text. `description` uses the
|
|
3071
|
-
// full-strength `on-{
|
|
3119
|
+
// full-strength `on-{status}` ink rather than a translucent cut — see
|
|
3072
3120
|
// packages/frontile/docs/notifications-usage.md's contrast note for why
|
|
3073
3121
|
// (a translucent cut used to fail WCAG AA here).
|
|
3074
3122
|
//
|
|
3075
|
-
// The spinner override matters because `@
|
|
3076
|
-
// arc via `fill-{
|
|
3077
|
-
// `bg-{
|
|
3123
|
+
// The spinner override matters because `@status` on <Spinner> drives its
|
|
3124
|
+
// arc via `fill-{status}`, the exact same color as this variant's own
|
|
3125
|
+
// `bg-{status}` surface — left alone the arc would be camouflaged
|
|
3078
3126
|
// against its own card, so `solid` forces both halves of the spinner to
|
|
3079
3127
|
// the contrast ink instead.
|
|
3080
3128
|
{
|
|
3081
3129
|
variant: 'solid',
|
|
3082
|
-
|
|
3130
|
+
status: 'neutral',
|
|
3083
3131
|
class: {
|
|
3084
3132
|
base: 'bg-neutral text-on-neutral',
|
|
3085
3133
|
icon: 'text-on-neutral',
|
|
@@ -3089,7 +3137,7 @@ const notificationCard = tv({
|
|
|
3089
3137
|
}
|
|
3090
3138
|
}, {
|
|
3091
3139
|
variant: 'solid',
|
|
3092
|
-
|
|
3140
|
+
status: 'primary',
|
|
3093
3141
|
class: {
|
|
3094
3142
|
base: 'bg-primary text-on-primary',
|
|
3095
3143
|
icon: 'text-on-primary',
|
|
@@ -3099,7 +3147,7 @@ const notificationCard = tv({
|
|
|
3099
3147
|
}
|
|
3100
3148
|
}, {
|
|
3101
3149
|
variant: 'solid',
|
|
3102
|
-
|
|
3150
|
+
status: 'success',
|
|
3103
3151
|
class: {
|
|
3104
3152
|
base: 'bg-success text-on-success',
|
|
3105
3153
|
icon: 'text-on-success',
|
|
@@ -3109,7 +3157,7 @@ const notificationCard = tv({
|
|
|
3109
3157
|
}
|
|
3110
3158
|
}, {
|
|
3111
3159
|
variant: 'solid',
|
|
3112
|
-
|
|
3160
|
+
status: 'warning',
|
|
3113
3161
|
class: {
|
|
3114
3162
|
base: 'bg-warning text-on-warning',
|
|
3115
3163
|
icon: 'text-on-warning',
|
|
@@ -3119,7 +3167,7 @@ const notificationCard = tv({
|
|
|
3119
3167
|
}
|
|
3120
3168
|
}, {
|
|
3121
3169
|
variant: 'solid',
|
|
3122
|
-
|
|
3170
|
+
status: 'danger',
|
|
3123
3171
|
class: {
|
|
3124
3172
|
base: 'bg-danger text-on-danger',
|
|
3125
3173
|
icon: 'text-on-danger',
|
|
@@ -3129,8 +3177,8 @@ const notificationCard = tv({
|
|
|
3129
3177
|
}
|
|
3130
3178
|
}],
|
|
3131
3179
|
defaultVariants: {
|
|
3132
|
-
|
|
3133
|
-
variant: '
|
|
3180
|
+
status: 'neutral',
|
|
3181
|
+
variant: 'surface',
|
|
3134
3182
|
hasDescription: false,
|
|
3135
3183
|
stackPlacement: 'none'
|
|
3136
3184
|
}
|
|
@@ -3175,7 +3223,9 @@ const formFeedback = tv({
|
|
|
3175
3223
|
// validation/feedback text — body role
|
|
3176
3224
|
base: 'font-body text-body-2xs pt-1',
|
|
3177
3225
|
variants: {
|
|
3178
|
-
|
|
3226
|
+
// `status`, not `color`: this value also decides whether the message is
|
|
3227
|
+
// announced assertively. See `isError` in form-feedback.gts.
|
|
3228
|
+
status: {
|
|
3179
3229
|
primary: 'text-primary',
|
|
3180
3230
|
secondary: 'text-secondary',
|
|
3181
3231
|
tertiary: 'text-tertiary',
|
|
@@ -3574,6 +3624,60 @@ const select = tv({
|
|
|
3574
3624
|
}
|
|
3575
3625
|
});
|
|
3576
3626
|
|
|
3627
|
+
// Extends `input` directly rather than `select`, even though the two look
|
|
3628
|
+
// alike. tv() loses slot types across a two-level extend, and
|
|
3629
|
+
// input -> select -> datePicker would be that second level; the shared
|
|
3630
|
+
// appearance comes from the common base instead.
|
|
3631
|
+
const datePicker = tv({
|
|
3632
|
+
extend: input,
|
|
3633
|
+
slots: {
|
|
3634
|
+
base: [],
|
|
3635
|
+
placeholder: 'text-neutral',
|
|
3636
|
+
input: 'cursor-default text-left',
|
|
3637
|
+
// The calendar sits in the popover, which supplies its own surface and
|
|
3638
|
+
// padding, so this only reserves room around the grid.
|
|
3639
|
+
calendar: 'p-2',
|
|
3640
|
+
// `border-default` is not a generated utility -- there is no `default`
|
|
3641
|
+
// semantic level. `border-neutral-soft` is the same divider treatment
|
|
3642
|
+
// `command.ts` uses to separate a footer from the content above it.
|
|
3643
|
+
// `w-0 min-w-full` keeps the footer out of the popover's intrinsic width:
|
|
3644
|
+
// the popover is sized `auto`, so it takes the width of its widest child,
|
|
3645
|
+
// and a row of preset buttons would otherwise stretch it well past the
|
|
3646
|
+
// calendar. Contributing zero and then filling the resolved width lets the
|
|
3647
|
+
// calendar decide how wide the popover is, and the buttons wrap within it.
|
|
3648
|
+
footer: ['flex flex-wrap items-center gap-2', 'w-0 min-w-full', 'border-t border-neutral-soft p-2'],
|
|
3649
|
+
icon: 'w-5 h-5',
|
|
3650
|
+
clearButton: 'pointer-events-auto'
|
|
3651
|
+
},
|
|
3652
|
+
variants: {
|
|
3653
|
+
// The trigger is a `<button>` whose text *is* the value, so with neither a
|
|
3654
|
+
// value nor a `@placeholder` it has no content at all and collapses to its
|
|
3655
|
+
// padding -- noticeably shorter than every other field on the form.
|
|
3656
|
+
// (Select hit the same thing once chips took over its trigger's content.)
|
|
3657
|
+
//
|
|
3658
|
+
// The floor has to be stated per size, and as a border-box total: Tailwind
|
|
3659
|
+
// sets `box-sizing: border-box`, so a bare `min-h-5` is already satisfied
|
|
3660
|
+
// by the padding alone and does nothing. Each value is one line of
|
|
3661
|
+
// `text-base`/`leading-tight` (1.25rem) plus that size's vertical padding
|
|
3662
|
+
// plus the 1px borders -- i.e. exactly the height the field has once it
|
|
3663
|
+
// holds a single line of text.
|
|
3664
|
+
size: {
|
|
3665
|
+
sm: {
|
|
3666
|
+
input: 'min-h-[calc(1.25rem+1rem+2px)]'
|
|
3667
|
+
},
|
|
3668
|
+
md: {
|
|
3669
|
+
input: 'min-h-[calc(1.25rem+1.5rem+2px)]'
|
|
3670
|
+
},
|
|
3671
|
+
lg: {
|
|
3672
|
+
input: 'min-h-[calc(1.25rem+2rem+2px)]'
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
},
|
|
3676
|
+
defaultVariants: {
|
|
3677
|
+
size: 'md'
|
|
3678
|
+
}
|
|
3679
|
+
});
|
|
3680
|
+
|
|
3577
3681
|
// Note: extends `input` rather than `select` because tailwind-variants
|
|
3578
3682
|
// loses inherited slot types across two levels of `extend`.
|
|
3579
3683
|
const autocomplete = tv({
|
|
@@ -3662,8 +3766,8 @@ const switchInput = tv({
|
|
|
3662
3766
|
label: 'text-lg'
|
|
3663
3767
|
}
|
|
3664
3768
|
},
|
|
3665
|
-
|
|
3666
|
-
|
|
3769
|
+
color: {
|
|
3770
|
+
neutral: {
|
|
3667
3771
|
wrapper: ['group-data-[selected=true]:bg-neutral-firm', 'group-data-[selected=true]:text-on-neutral-firm']
|
|
3668
3772
|
},
|
|
3669
3773
|
primary: {
|
|
@@ -3688,7 +3792,7 @@ const switchInput = tv({
|
|
|
3688
3792
|
},
|
|
3689
3793
|
defaultVariants: {
|
|
3690
3794
|
size: 'md',
|
|
3691
|
-
|
|
3795
|
+
color: 'primary',
|
|
3692
3796
|
isDisabled: false
|
|
3693
3797
|
}
|
|
3694
3798
|
});
|
|
@@ -3829,6 +3933,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
3829
3933
|
closeButton: closeButton,
|
|
3830
3934
|
command: command,
|
|
3831
3935
|
commandDialog: commandDialog,
|
|
3936
|
+
datePicker: datePicker,
|
|
3832
3937
|
divider: divider,
|
|
3833
3938
|
drawer: drawer,
|
|
3834
3939
|
dropdownContent: dropdownContent,
|