@zazz-ui/core 0.9.1 → 0.10.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/AUTHORING.md +21 -16
- package/CHANGELOG.md +89 -0
- package/README.md +3 -3
- package/dist/sri.json +85 -84
- package/dist/zazz.css +1 -1
- package/editor/zazz.css-data.json +9042 -1944
- package/editor/zazz.html-data.json +31 -41
- package/editor/zazz.language-data.json +468 -233
- package/editor/zazz.lint-data.json +412 -396
- package/package.json +2 -3
- package/src/base/_defaults.css +59 -40
- package/src/base/_layers.css +5 -2
- package/src/base/_properties-2xl.css +10 -0
- package/src/base/_properties-active.css +8 -0
- package/src/base/_properties-checked.css +8 -0
- package/src/base/_properties-current.css +8 -0
- package/src/base/_properties-disabled.css +8 -0
- package/src/base/_properties-focus-visible.css +8 -0
- package/src/base/_properties-focus-within.css +8 -0
- package/src/base/_properties-hover.css +8 -0
- package/src/base/_properties-lg.css +10 -0
- package/src/base/_properties-md.css +10 -0
- package/src/base/_properties-open.css +8 -0
- package/src/base/_properties-sm.css +10 -0
- package/src/base/_properties-starting.css +4 -0
- package/src/base/_properties-stuck.css +4 -0
- package/src/base/_properties-xl.css +10 -0
- package/src/base/_properties.css +55 -15
- package/src/base/_reset.css +8 -4
- package/src/base/_typography.css +26 -9
- package/src/base/_utilities-box.css +63 -59
- package/src/base/_utilities-color.css +55 -8
- package/src/base/_utilities-effects.css +8 -0
- package/src/base/_utilities-flow.css +28 -5
- package/src/base/_utilities-pseudo.css +4 -0
- package/src/base/_utilities-spacing.css +8 -8
- package/src/base/_utilities-sr.css +98 -0
- package/src/base/_utilities-tier-2xl.css +5 -0
- package/src/base/_utilities-tier-active.css +5 -1
- package/src/base/_utilities-tier-checked.css +5 -1
- package/src/base/_utilities-tier-current.css +5 -1
- package/src/base/_utilities-tier-disabled.css +5 -1
- package/src/base/_utilities-tier-focus-visible.css +5 -1
- package/src/base/_utilities-tier-focus-within.css +5 -1
- package/src/base/_utilities-tier-hover.css +5 -1
- package/src/base/_utilities-tier-lg.css +5 -0
- package/src/base/_utilities-tier-md.css +5 -0
- package/src/base/_utilities-tier-open.css +5 -1
- package/src/base/_utilities-tier-sm.css +5 -0
- package/src/base/_utilities-tier-starting.css +2 -0
- package/src/base/_utilities-tier-stuck.css +3 -0
- package/src/base/_utilities-tier-xl.css +5 -0
- package/src/base/_utilities-typography.css +263 -3
- package/src/base/_variables.css +123 -57
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +90 -86
- package/src/base/kit-styling.ts +90 -86
- package/src/base/utilities.d.ts +23 -8
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +78 -3
- package/src/base/utilities.ts +95 -11
- package/src/head.d.ts.map +1 -1
- package/src/head.js +4 -5
- package/src/head.ts +4 -5
- package/src/index.css +3 -2
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +13 -3
- package/src/manifest.ts +13 -3
- package/src/primitives/alert-dialog/alert-dialog.css +1 -1
- package/src/primitives/autocomplete/autocomplete.css +4 -2
- package/src/primitives/avatar/avatar.html +4 -6
- package/src/primitives/badge/badge.css +63 -56
- package/src/primitives/breadcrumbs/breadcrumbs.html +1 -7
- package/src/primitives/button/button.css +44 -57
- package/src/primitives/button-group/button-group.css +4 -0
- package/src/primitives/callout/callout.css +22 -43
- package/src/primitives/card/card-subgrid.html +2 -3
- package/src/primitives/card/card.css +4 -0
- package/src/primitives/card/card.html +2 -3
- package/src/primitives/checkbox/checkbox.css +4 -0
- package/src/primitives/combobox/combobox.css +8 -1
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.js +4 -9
- package/src/primitives/command/command-actions.ts +4 -9
- package/src/primitives/debug/audit-core.d.ts +1 -1
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +30 -3
- package/src/primitives/debug/audit-core.ts +40 -2
- package/src/primitives/dialog/dialog-with-form.html +1 -1
- package/src/primitives/dialog/dialog.css +19 -4
- package/src/primitives/fields/fields.css +11 -5
- package/src/primitives/group/group.css +18 -0
- package/src/primitives/group/group.html +26 -0
- package/src/primitives/input/input.css +14 -8
- package/src/primitives/input-group/input-group-password-group.html +1 -1
- package/src/primitives/input-group/input-group.css +12 -8
- package/src/primitives/kbd/kbd.css +4 -0
- package/src/primitives/lightbox/lightbox.css +13 -0
- package/src/primitives/lightbox/lightbox.html +2 -1
- package/src/primitives/menu/menu.css +3 -1
- package/src/primitives/meter/meter.css +10 -3
- package/src/primitives/navigation-menu/navigation-menu.css +5 -0
- package/src/primitives/navigation-menu/navigation-menu.html +2 -2
- package/src/primitives/otp/otp.css +4 -0
- package/src/primitives/password-group/password-group.css +13 -9
- package/src/primitives/password-group/password-group.html +1 -1
- package/src/primitives/popover/popover.css +6 -0
- package/src/primitives/progress/progress.css +5 -0
- package/src/primitives/radio/radio.css +3 -0
- package/src/primitives/select/select.css +17 -9
- package/src/primitives/slider/slider.css +8 -0
- package/src/primitives/switch/switch.css +56 -20
- package/src/primitives/tabs/tabs.css +18 -0
- package/src/primitives/textarea/textarea.css +19 -10
- package/src/primitives/toaster/toaster.css +8 -4
- package/src/primitives/toggle/toggle.css +10 -6
- package/src/primitives/toggle-group/toggle-group.css +4 -0
- package/src/primitives/tooltip/tooltip.css +4 -0
- package/src/primitives/utilities/pile.html +2 -3
- package/src/base/_switches.css +0 -148
|
@@ -5,12 +5,19 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* border/ring)
|
|
6
6
|
* @uses color-mix(), oklch(from …): variant hover/active tints
|
|
7
7
|
* @uses text-box: vertical trim (patchy browser support)
|
|
8
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
9
|
+
* rounded corners
|
|
8
10
|
* @tokens --ui-badge-* (@layer variables; hooks are named after the utilities they back)
|
|
9
11
|
* @consumedby combobox.css (selection tags)
|
|
10
12
|
*
|
|
11
13
|
* Every utility-backed declaration reads one chain, highest first:
|
|
12
14
|
* var(--_<utility>-resolved, var(--_badge-<utility>, var(--ui-badge-<utility>)))
|
|
13
15
|
* States apply only to interactive badges (button, a[href]).
|
|
16
|
+
*
|
|
17
|
+
* States step one way and active goes further than hover. Unfilled surfaces (the
|
|
18
|
+
* default, outline, ghost) gain the muted role; filled ones fade toward the page;
|
|
19
|
+
* status surfaces darken. Button and badge resolve the same in every variant
|
|
20
|
+
* (badge-button-parity.browser.test.ts).
|
|
14
21
|
*/
|
|
15
22
|
|
|
16
23
|
@layer variables {
|
|
@@ -24,8 +31,8 @@
|
|
|
24
31
|
--ui-badge-leading: 1;
|
|
25
32
|
|
|
26
33
|
--ui-badge-bg: var(--color-background);
|
|
27
|
-
--ui-badge-bg--hover:
|
|
28
|
-
--ui-badge-bg--active: oklch(from var(--
|
|
34
|
+
--ui-badge-bg--hover: var(--color-muted);
|
|
35
|
+
--ui-badge-bg--active: oklch(from var(--ui-badge-bg--hover) l c h / calc(alpha * 1.5));
|
|
29
36
|
|
|
30
37
|
--ui-badge-text: var(--color-foreground);
|
|
31
38
|
--ui-badge-text--hover: var(--color-foreground);
|
|
@@ -42,6 +49,7 @@
|
|
|
42
49
|
--ui-badge-px: calc(var(--spacing) * 1.25);
|
|
43
50
|
--ui-badge-h: calc(var(--spacing) * 5);
|
|
44
51
|
--ui-badge-radius: var(--radius-sm);
|
|
52
|
+
--ui-badge-corner-shape: var(--radius-corner-shape);
|
|
45
53
|
--ui-badge-background-clip: border-box;
|
|
46
54
|
|
|
47
55
|
--ui-badge-icon-size: calc(var(--spacing) * 3);
|
|
@@ -215,6 +223,7 @@
|
|
|
215
223
|
border-radius: calc(
|
|
216
224
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
217
225
|
);
|
|
226
|
+
corner-shape: var(--_corner-shape-resolved, var(--ui-badge-corner-shape));
|
|
218
227
|
|
|
219
228
|
color: var(--_text-resolved, var(--_badge-text, var(--ui-badge-text)));
|
|
220
229
|
background-color: var(--_bg-resolved, var(--_badge-bg, var(--ui-badge-bg)));
|
|
@@ -302,6 +311,18 @@
|
|
|
302
311
|
outline-color: transparent;
|
|
303
312
|
}
|
|
304
313
|
|
|
314
|
+
/* before the variants at the same specificity: a disabled primary keeps its color */
|
|
315
|
+
:where([data-ui~="badge"]:is(:disabled, [aria-disabled="true"])) {
|
|
316
|
+
--_badge-text: var(--color-muted-foreground);
|
|
317
|
+
--_badge-bg: var(--color-muted);
|
|
318
|
+
--_badge-shadow: 0 0 transparent;
|
|
319
|
+
--decoration-line: none;
|
|
320
|
+
|
|
321
|
+
cursor: default;
|
|
322
|
+
opacity: 0.6;
|
|
323
|
+
outline: none;
|
|
324
|
+
}
|
|
325
|
+
|
|
305
326
|
:where([data-ui~="badge"]):is(button, a[href])[aria-busy="true"] {
|
|
306
327
|
cursor: progress;
|
|
307
328
|
}
|
|
@@ -324,6 +345,12 @@
|
|
|
324
345
|
BADGE VARIANTS — data-badge-variant writes the privates
|
|
325
346
|
=========================================================================== */
|
|
326
347
|
|
|
348
|
+
:where([data-ui~="badge"][data-badge-variant="outline"]) {
|
|
349
|
+
--_badge-bg: transparent;
|
|
350
|
+
|
|
351
|
+
--_badge-shadow: 0 0 transparent;
|
|
352
|
+
}
|
|
353
|
+
|
|
327
354
|
:where([data-ui~="badge"][data-badge-variant="primary"]) {
|
|
328
355
|
--_badge-bg: var(--color-primary);
|
|
329
356
|
--_badge-bg--hover: light-dark(
|
|
@@ -342,6 +369,8 @@
|
|
|
342
369
|
--_badge-border-color: transparent;
|
|
343
370
|
--_badge-border-color--hover: transparent;
|
|
344
371
|
--_badge-border-color--active: transparent;
|
|
372
|
+
|
|
373
|
+
--_badge-shadow: 0 0 transparent;
|
|
345
374
|
}
|
|
346
375
|
|
|
347
376
|
:where([data-ui~="badge"][data-badge-variant="secondary"]) {
|
|
@@ -362,6 +391,8 @@
|
|
|
362
391
|
--_badge-border-color: transparent;
|
|
363
392
|
--_badge-border-color--hover: transparent;
|
|
364
393
|
--_badge-border-color--active: transparent;
|
|
394
|
+
|
|
395
|
+
--_badge-shadow: 0 0 transparent;
|
|
365
396
|
}
|
|
366
397
|
|
|
367
398
|
:where([data-ui~="badge"][data-badge-variant="tertiary"]) {
|
|
@@ -382,16 +413,15 @@
|
|
|
382
413
|
--_badge-border-color: transparent;
|
|
383
414
|
--_badge-border-color--hover: transparent;
|
|
384
415
|
--_badge-border-color--active: transparent;
|
|
416
|
+
|
|
417
|
+
--_badge-shadow: 0 0 transparent;
|
|
385
418
|
}
|
|
386
419
|
|
|
387
420
|
:where([data-ui~="badge"][data-badge-variant="muted"]) {
|
|
388
|
-
/*
|
|
389
|
-
--_badge-bg:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
);
|
|
393
|
-
--_badge-bg--hover: oklch(from var(--_badge-bg) calc(l - 0.025) c h);
|
|
394
|
-
--_badge-bg--active: oklch(from var(--_badge-bg) calc(l - 0.05) c h);
|
|
421
|
+
/* the translucent muted role: fades toward the surface beneath */
|
|
422
|
+
--_badge-bg: var(--color-muted);
|
|
423
|
+
--_badge-bg--hover: oklch(from var(--_badge-bg) l c h / calc(alpha * 0.66));
|
|
424
|
+
--_badge-bg--active: oklch(from var(--_badge-bg) l c h / calc(alpha * 0.33));
|
|
395
425
|
|
|
396
426
|
--_badge-text: var(--color-foreground);
|
|
397
427
|
--_badge-text--hover: var(--color-foreground);
|
|
@@ -400,6 +430,8 @@
|
|
|
400
430
|
--_badge-border-color: transparent;
|
|
401
431
|
--_badge-border-color--hover: transparent;
|
|
402
432
|
--_badge-border-color--active: transparent;
|
|
433
|
+
|
|
434
|
+
--_badge-shadow: 0 0 transparent;
|
|
403
435
|
}
|
|
404
436
|
|
|
405
437
|
:where([data-ui~="badge"][data-badge-variant="ghost"]) {
|
|
@@ -415,15 +447,14 @@
|
|
|
415
447
|
--_badge-border-color: transparent;
|
|
416
448
|
--_badge-border-color--hover: transparent;
|
|
417
449
|
--_badge-border-color--active: transparent;
|
|
450
|
+
|
|
451
|
+
--_badge-shadow: 0 0 transparent;
|
|
418
452
|
}
|
|
419
453
|
|
|
420
|
-
/* Status variants (info, success, warning, destructive)
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
light, at least 0.82 in dark) so it holds 4.5:1 on the tint and on the
|
|
425
|
-
hover and active steps; status-contrast.browser.test.ts checks it. No border. One rule derives the states from the
|
|
426
|
-
surface; each variant names only its colors. */
|
|
454
|
+
/* Status variants (info, success, warning, destructive) pair the role's
|
|
455
|
+
surface with its -foreground. No border. One rule derives the states from
|
|
456
|
+
the surface; each variant names only its role. status-contrast.browser.test.ts
|
|
457
|
+
checks 4.5:1 at rest, hover, and active. */
|
|
427
458
|
:where(
|
|
428
459
|
[data-ui~="badge"]:is(
|
|
429
460
|
[data-badge-variant="info"],
|
|
@@ -446,51 +477,27 @@
|
|
|
446
477
|
}
|
|
447
478
|
|
|
448
479
|
:where([data-ui~="badge"][data-badge-variant="info"]) {
|
|
449
|
-
--_badge-ring-color: var(--color-info);
|
|
450
|
-
--_badge-bg:
|
|
451
|
-
|
|
452
|
-
color-mix(in srgb, var(--color-info) 20%, var(--color-background))
|
|
453
|
-
);
|
|
454
|
-
--_badge-text: light-dark(
|
|
455
|
-
oklch(from var(--color-info) min(l, 0.45) c h),
|
|
456
|
-
oklch(from var(--color-info) max(l, 0.82) c h)
|
|
457
|
-
);
|
|
480
|
+
--_badge-ring-color: var(--color-info-foreground);
|
|
481
|
+
--_badge-bg: var(--color-info);
|
|
482
|
+
--_badge-text: var(--color-info-foreground);
|
|
458
483
|
}
|
|
459
484
|
|
|
460
485
|
:where([data-ui~="badge"][data-badge-variant="success"]) {
|
|
461
|
-
--_badge-ring-color: var(--color-success);
|
|
462
|
-
--_badge-bg:
|
|
463
|
-
|
|
464
|
-
color-mix(in srgb, var(--color-success) 20%, var(--color-background))
|
|
465
|
-
);
|
|
466
|
-
--_badge-text: light-dark(
|
|
467
|
-
oklch(from var(--color-success) min(l, 0.45) c h),
|
|
468
|
-
oklch(from var(--color-success) max(l, 0.82) c h)
|
|
469
|
-
);
|
|
486
|
+
--_badge-ring-color: var(--color-success-foreground);
|
|
487
|
+
--_badge-bg: var(--color-success);
|
|
488
|
+
--_badge-text: var(--color-success-foreground);
|
|
470
489
|
}
|
|
471
490
|
|
|
472
491
|
:where([data-ui~="badge"][data-badge-variant="warning"]) {
|
|
473
|
-
--_badge-ring-color: var(--color-warning);
|
|
474
|
-
--_badge-bg:
|
|
475
|
-
|
|
476
|
-
color-mix(in srgb, var(--color-warning) 20%, var(--color-background))
|
|
477
|
-
);
|
|
478
|
-
--_badge-text: light-dark(
|
|
479
|
-
oklch(from var(--color-warning) min(l, 0.45) c h),
|
|
480
|
-
oklch(from var(--color-warning) max(l, 0.82) c h)
|
|
481
|
-
);
|
|
492
|
+
--_badge-ring-color: var(--color-warning-foreground);
|
|
493
|
+
--_badge-bg: var(--color-warning);
|
|
494
|
+
--_badge-text: var(--color-warning-foreground);
|
|
482
495
|
}
|
|
483
496
|
|
|
484
497
|
:where([data-ui~="badge"][data-badge-variant="destructive"]) {
|
|
485
|
-
--_badge-ring-color: var(--color-destructive);
|
|
486
|
-
--_badge-bg:
|
|
487
|
-
|
|
488
|
-
color-mix(in srgb, var(--color-destructive) 20%, var(--color-background))
|
|
489
|
-
);
|
|
490
|
-
--_badge-text: light-dark(
|
|
491
|
-
oklch(from var(--color-destructive) min(l, 0.45) c h),
|
|
492
|
-
oklch(from var(--color-destructive) max(l, 0.82) c h)
|
|
493
|
-
);
|
|
498
|
+
--_badge-ring-color: var(--color-destructive-foreground);
|
|
499
|
+
--_badge-bg: var(--color-destructive);
|
|
500
|
+
--_badge-text: var(--color-destructive-foreground);
|
|
494
501
|
}
|
|
495
502
|
|
|
496
503
|
:where([data-ui~="badge"][data-badge-variant="link"]) {
|
|
@@ -500,12 +507,12 @@
|
|
|
500
507
|
|
|
501
508
|
--_badge-text: var(--color-foreground);
|
|
502
509
|
--_badge-text--hover: light-dark(
|
|
503
|
-
oklch(from var(--color-primary) calc(l + (1 - l) * 0.
|
|
504
|
-
oklch(from var(--color-primary) calc(l * 0.
|
|
510
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.2) c h),
|
|
511
|
+
oklch(from var(--color-primary) calc(l * 0.8) c h)
|
|
505
512
|
);
|
|
506
513
|
--_badge-text--active: light-dark(
|
|
507
|
-
oklch(from var(--color-primary) calc(l + (1 - l) * 0.
|
|
508
|
-
oklch(from var(--color-primary) calc(l * 0.
|
|
514
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.3) c h),
|
|
515
|
+
oklch(from var(--color-primary) calc(l * 0.7) c h)
|
|
509
516
|
);
|
|
510
517
|
|
|
511
518
|
--_badge-border-style: none;
|
|
@@ -14,13 +14,7 @@
|
|
|
14
14
|
>
|
|
15
15
|
<li><a data-ui="button" data-button-variant="link">Home</a></li>
|
|
16
16
|
<li>
|
|
17
|
-
<span
|
|
18
|
-
style="
|
|
19
|
-
--text: var(--color-muted-foreground);
|
|
20
|
-
--opacity: 0.5;
|
|
21
|
-
"
|
|
22
|
-
>/</span
|
|
23
|
-
>
|
|
17
|
+
<span style="--text: var(--color-muted-foreground)">/</span>
|
|
24
18
|
</li>
|
|
25
19
|
<li>
|
|
26
20
|
<div data-ui="button" data-button-variant="link" aria-disabled="true">Product name</div>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* metrics), kbd.css (--ui-kbd-*)
|
|
6
6
|
* @uses color-mix(), oklch(from …) — variant hover/active tints
|
|
7
7
|
* @uses text-box — vertical trim (patchy browser support)
|
|
8
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
9
|
+
* rounded corners
|
|
8
10
|
* @tokens --ui-button-* (@layer variables; hooks are named after the utilities they back; metrics default to the --ui-field-* family)
|
|
9
11
|
* @consumedby toggle.css, select.css, button-group.css, autocomplete.css, combobox.css,
|
|
10
12
|
* command.css, lightbox.css, menu.css, navigation-menu.css, popover.css
|
|
@@ -14,6 +16,11 @@
|
|
|
14
16
|
* The resolver is set by the utilities layer from the element's `style` gate
|
|
15
17
|
* (inline utilities and their tiers), the private by a variant or size on this
|
|
16
18
|
* element, and the hook by :root, a subtree, or an inline hook.
|
|
19
|
+
*
|
|
20
|
+
* States step one way and active goes further than hover. Unfilled surfaces (the
|
|
21
|
+
* default, outline, ghost) gain the muted role; filled ones fade toward the page;
|
|
22
|
+
* status surfaces darken. Button and badge resolve the same in every variant
|
|
23
|
+
* (badge-button-parity.browser.test.ts).
|
|
17
24
|
*/
|
|
18
25
|
|
|
19
26
|
@layer variables {
|
|
@@ -29,8 +36,8 @@
|
|
|
29
36
|
--ui-button-leading: 1;
|
|
30
37
|
|
|
31
38
|
--ui-button-bg: var(--color-background);
|
|
32
|
-
--ui-button-bg--hover:
|
|
33
|
-
--ui-button-bg--active: oklch(from var(--
|
|
39
|
+
--ui-button-bg--hover: var(--color-muted);
|
|
40
|
+
--ui-button-bg--active: oklch(from var(--ui-button-bg--hover) l c h / calc(alpha * 1.5));
|
|
34
41
|
|
|
35
42
|
--ui-button-text: var(--color-foreground);
|
|
36
43
|
--ui-button-text--hover: var(--color-foreground);
|
|
@@ -47,6 +54,7 @@
|
|
|
47
54
|
--ui-button-px: var(--ui-field-px);
|
|
48
55
|
--ui-button-min-h: var(--ui-field-h);
|
|
49
56
|
--ui-button-radius: var(--ui-field-radius);
|
|
57
|
+
--ui-button-corner-shape: var(--ui-field-corner-shape);
|
|
50
58
|
--ui-button-background-clip: padding-box;
|
|
51
59
|
|
|
52
60
|
--ui-button-icon-size: var(--ui-field-icon-size);
|
|
@@ -158,6 +166,11 @@
|
|
|
158
166
|
inherits: false;
|
|
159
167
|
}
|
|
160
168
|
|
|
169
|
+
@property --_button-corner-shape {
|
|
170
|
+
syntax: "*";
|
|
171
|
+
inherits: false;
|
|
172
|
+
}
|
|
173
|
+
|
|
161
174
|
@property --_button-background-clip {
|
|
162
175
|
syntax: "*";
|
|
163
176
|
inherits: false;
|
|
@@ -221,6 +234,10 @@
|
|
|
221
234
|
border-radius: calc(
|
|
222
235
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
223
236
|
);
|
|
237
|
+
corner-shape: var(
|
|
238
|
+
--_corner-shape-resolved,
|
|
239
|
+
var(--_button-corner-shape, var(--ui-button-corner-shape))
|
|
240
|
+
);
|
|
224
241
|
|
|
225
242
|
color: var(--_text-resolved, var(--_button-text, var(--ui-button-text)));
|
|
226
243
|
background-color: var(--_bg-resolved, var(--_button-bg, var(--ui-button-bg)));
|
|
@@ -313,7 +330,7 @@
|
|
|
313
330
|
--decoration-line: none;
|
|
314
331
|
|
|
315
332
|
cursor: default;
|
|
316
|
-
opacity: 0.
|
|
333
|
+
opacity: 0.6;
|
|
317
334
|
outline: none;
|
|
318
335
|
}
|
|
319
336
|
|
|
@@ -411,13 +428,10 @@
|
|
|
411
428
|
}
|
|
412
429
|
|
|
413
430
|
:where([data-ui~="button"][data-button-variant="muted"]) {
|
|
414
|
-
/*
|
|
415
|
-
--_button-bg:
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
);
|
|
419
|
-
--_button-bg--hover: oklch(from var(--_button-bg) calc(l - 0.025) c h);
|
|
420
|
-
--_button-bg--active: oklch(from var(--_button-bg) calc(l - 0.05) c h);
|
|
431
|
+
/* the translucent muted role: fades toward the surface beneath */
|
|
432
|
+
--_button-bg: var(--color-muted);
|
|
433
|
+
--_button-bg--hover: oklch(from var(--_button-bg) l c h / calc(alpha * 0.66));
|
|
434
|
+
--_button-bg--active: oklch(from var(--_button-bg) l c h / calc(alpha * 0.33));
|
|
421
435
|
|
|
422
436
|
--_button-text: var(--color-foreground);
|
|
423
437
|
--_button-text--hover: var(--color-foreground);
|
|
@@ -447,13 +461,10 @@
|
|
|
447
461
|
--_button-shadow: 0 0 transparent;
|
|
448
462
|
}
|
|
449
463
|
|
|
450
|
-
/* Status variants (info, success, warning, destructive)
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
light, at least 0.82 in dark) so it holds 4.5:1 on the tint and on the
|
|
455
|
-
hover and active steps; status-contrast.browser.test.ts checks it. No border. One rule derives the states from the
|
|
456
|
-
surface; each variant names only its colors. */
|
|
464
|
+
/* Status variants (info, success, warning, destructive) pair the role's
|
|
465
|
+
surface with its -foreground. No border. One rule derives the states from
|
|
466
|
+
the surface; each variant names only its role. status-contrast.browser.test.ts
|
|
467
|
+
checks 4.5:1 at rest, hover, and active. */
|
|
457
468
|
:where(
|
|
458
469
|
[data-ui~="button"]:is(
|
|
459
470
|
[data-button-variant="info"],
|
|
@@ -476,51 +487,27 @@
|
|
|
476
487
|
}
|
|
477
488
|
|
|
478
489
|
:where([data-ui~="button"][data-button-variant="info"]) {
|
|
479
|
-
--_button-ring-color: var(--color-info);
|
|
480
|
-
--_button-bg:
|
|
481
|
-
|
|
482
|
-
color-mix(in srgb, var(--color-info) 20%, var(--color-background))
|
|
483
|
-
);
|
|
484
|
-
--_button-text: light-dark(
|
|
485
|
-
oklch(from var(--color-info) min(l, 0.45) c h),
|
|
486
|
-
oklch(from var(--color-info) max(l, 0.82) c h)
|
|
487
|
-
);
|
|
490
|
+
--_button-ring-color: var(--color-info-foreground);
|
|
491
|
+
--_button-bg: var(--color-info);
|
|
492
|
+
--_button-text: var(--color-info-foreground);
|
|
488
493
|
}
|
|
489
494
|
|
|
490
495
|
:where([data-ui~="button"][data-button-variant="success"]) {
|
|
491
|
-
--_button-ring-color: var(--color-success);
|
|
492
|
-
--_button-bg:
|
|
493
|
-
|
|
494
|
-
color-mix(in srgb, var(--color-success) 20%, var(--color-background))
|
|
495
|
-
);
|
|
496
|
-
--_button-text: light-dark(
|
|
497
|
-
oklch(from var(--color-success) min(l, 0.45) c h),
|
|
498
|
-
oklch(from var(--color-success) max(l, 0.82) c h)
|
|
499
|
-
);
|
|
496
|
+
--_button-ring-color: var(--color-success-foreground);
|
|
497
|
+
--_button-bg: var(--color-success);
|
|
498
|
+
--_button-text: var(--color-success-foreground);
|
|
500
499
|
}
|
|
501
500
|
|
|
502
501
|
:where([data-ui~="button"][data-button-variant="warning"]) {
|
|
503
|
-
--_button-ring-color: var(--color-warning);
|
|
504
|
-
--_button-bg:
|
|
505
|
-
|
|
506
|
-
color-mix(in srgb, var(--color-warning) 20%, var(--color-background))
|
|
507
|
-
);
|
|
508
|
-
--_button-text: light-dark(
|
|
509
|
-
oklch(from var(--color-warning) min(l, 0.45) c h),
|
|
510
|
-
oklch(from var(--color-warning) max(l, 0.82) c h)
|
|
511
|
-
);
|
|
502
|
+
--_button-ring-color: var(--color-warning-foreground);
|
|
503
|
+
--_button-bg: var(--color-warning);
|
|
504
|
+
--_button-text: var(--color-warning-foreground);
|
|
512
505
|
}
|
|
513
506
|
|
|
514
507
|
:where([data-ui~="button"][data-button-variant="destructive"]) {
|
|
515
|
-
--_button-ring-color: var(--color-destructive);
|
|
516
|
-
--_button-bg:
|
|
517
|
-
|
|
518
|
-
color-mix(in srgb, var(--color-destructive) 20%, var(--color-background))
|
|
519
|
-
);
|
|
520
|
-
--_button-text: light-dark(
|
|
521
|
-
oklch(from var(--color-destructive) min(l, 0.45) c h),
|
|
522
|
-
oklch(from var(--color-destructive) max(l, 0.82) c h)
|
|
523
|
-
);
|
|
508
|
+
--_button-ring-color: var(--color-destructive-foreground);
|
|
509
|
+
--_button-bg: var(--color-destructive);
|
|
510
|
+
--_button-text: var(--color-destructive-foreground);
|
|
524
511
|
}
|
|
525
512
|
|
|
526
513
|
:where([data-ui~="button"][data-button-variant="link"]) {
|
|
@@ -530,12 +517,12 @@
|
|
|
530
517
|
|
|
531
518
|
--_button-text: var(--color-foreground);
|
|
532
519
|
--_button-text--hover: light-dark(
|
|
533
|
-
oklch(from var(--color-primary) calc(l + (1 - l) * 0.
|
|
534
|
-
oklch(from var(--color-primary) calc(l * 0.
|
|
520
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.2) c h),
|
|
521
|
+
oklch(from var(--color-primary) calc(l * 0.8) c h)
|
|
535
522
|
);
|
|
536
523
|
--_button-text--active: light-dark(
|
|
537
|
-
oklch(from var(--color-primary) calc(l + (1 - l) * 0.
|
|
538
|
-
oklch(from var(--color-primary) calc(l * 0.
|
|
524
|
+
oklch(from var(--color-primary) calc(l + (1 - l) * 0.3) c h),
|
|
525
|
+
oklch(from var(--color-primary) calc(l * 0.7) c h)
|
|
539
526
|
);
|
|
540
527
|
|
|
541
528
|
--_button-border-style: none;
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* @uses :not(): first/last edge selection for shared-border collapse
|
|
7
7
|
* @uses logical border-radius longhands: RTL-safe corner rounding per orientation
|
|
8
8
|
* @uses flex-item z-index: raise the active control so its border/ring isn't clipped
|
|
9
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
10
|
+
* rounded corners
|
|
9
11
|
* @tokens --ui-button-group-* (@layer variables; named after the utilities they back)
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
@layer variables {
|
|
13
15
|
:root {
|
|
14
16
|
--ui-button-group-radius: var(--ui-button-radius);
|
|
17
|
+
--ui-button-group-corner-shape: var(--ui-button-corner-shape);
|
|
15
18
|
--ui-button-group-bg: var(--color-card);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
border-radius: calc(
|
|
54
57
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
55
58
|
);
|
|
59
|
+
corner-shape: var(--_corner-shape-resolved, var(--ui-button-group-corner-shape));
|
|
56
60
|
background-color: var(--_bg-resolved, var(--_button-group-bg, var(--ui-button-group-bg)));
|
|
57
61
|
position: relative;
|
|
58
62
|
isolation: isolate;
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
5
|
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
|
|
6
|
-
* @uses
|
|
6
|
+
* @uses oklch(from …): faint status borders
|
|
7
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
8
|
+
* rounded corners
|
|
7
9
|
* @tokens --ui-callout-* (@layer variables; named after the utilities they back)
|
|
8
|
-
* @see badge.css (status
|
|
10
|
+
* @see badge.css (same status surfaces and text; the test keeps them in sync)
|
|
9
11
|
* @presets data-callout-variant="muted" | "info" | "success" | "warning" | "destructive"
|
|
10
12
|
*
|
|
11
13
|
* A callout is an aside or alert: a padded grid with a gap, a border, and a
|
|
12
14
|
* radius. The default matches an outline card and muted a muted card. Info,
|
|
13
|
-
* success, and
|
|
14
|
-
*
|
|
15
|
-
* solid fill.
|
|
15
|
+
* success, warning, and destructive use the role's surface and -foreground,
|
|
16
|
+
* like the matching badge, plus a faint border in the -foreground hue.
|
|
16
17
|
* Every variant keeps the 1px border (muted makes it transparent), so every
|
|
17
18
|
* variant is the same size.
|
|
18
19
|
* Its parts are plain elements laid out with utilities. Use <aside> for a
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
--ui-callout-bg: var(--color-card);
|
|
28
29
|
--ui-callout-text: var(--color-card-foreground);
|
|
29
30
|
--ui-callout-radius: var(--radius-md);
|
|
31
|
+
--ui-callout-corner-shape: var(--radius-corner-shape);
|
|
30
32
|
--ui-callout-shadow: none;
|
|
31
33
|
|
|
32
34
|
--ui-callout-border-width: 1px;
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
border-radius: calc(
|
|
78
80
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
79
81
|
);
|
|
82
|
+
corner-shape: var(--_corner-shape-resolved, var(--ui-callout-corner-shape));
|
|
80
83
|
box-shadow: var(--_shadow-resolved, var(--ui-callout-shadow));
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -90,54 +93,30 @@
|
|
|
90
93
|
--_callout-border-color: transparent;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
/* status variants: the
|
|
94
|
-
|
|
96
|
+
/* status variants: the role's surface and -foreground, as buttons and badges
|
|
97
|
+
use them, plus a faint status border that outlines the block */
|
|
95
98
|
|
|
96
99
|
:where([data-ui~="callout"][data-callout-variant="info"]) {
|
|
97
|
-
--_callout-bg:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
);
|
|
101
|
-
--_callout-text: light-dark(
|
|
102
|
-
oklch(from var(--color-info) min(l, 0.45) c h),
|
|
103
|
-
oklch(from var(--color-info) max(l, 0.82) c h)
|
|
104
|
-
);
|
|
105
|
-
--_callout-border-color: oklch(from var(--color-info) l c h / 0.2);
|
|
100
|
+
--_callout-bg: var(--color-info);
|
|
101
|
+
--_callout-text: var(--color-info-foreground);
|
|
102
|
+
--_callout-border-color: oklch(from var(--color-info-foreground) l c h / 0.2);
|
|
106
103
|
}
|
|
107
104
|
|
|
108
105
|
:where([data-ui~="callout"][data-callout-variant="success"]) {
|
|
109
|
-
--_callout-bg:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
);
|
|
113
|
-
--_callout-text: light-dark(
|
|
114
|
-
oklch(from var(--color-success) min(l, 0.45) c h),
|
|
115
|
-
oklch(from var(--color-success) max(l, 0.82) c h)
|
|
116
|
-
);
|
|
117
|
-
--_callout-border-color: oklch(from var(--color-success) l c h / 0.2);
|
|
106
|
+
--_callout-bg: var(--color-success);
|
|
107
|
+
--_callout-text: var(--color-success-foreground);
|
|
108
|
+
--_callout-border-color: oklch(from var(--color-success-foreground) l c h / 0.2);
|
|
118
109
|
}
|
|
119
110
|
|
|
120
111
|
:where([data-ui~="callout"][data-callout-variant="warning"]) {
|
|
121
|
-
--_callout-bg:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
);
|
|
125
|
-
--_callout-text: light-dark(
|
|
126
|
-
oklch(from var(--color-warning) min(l, 0.45) c h),
|
|
127
|
-
oklch(from var(--color-warning) max(l, 0.82) c h)
|
|
128
|
-
);
|
|
129
|
-
--_callout-border-color: oklch(from var(--color-warning) l c h / 0.2);
|
|
112
|
+
--_callout-bg: var(--color-warning);
|
|
113
|
+
--_callout-text: var(--color-warning-foreground);
|
|
114
|
+
--_callout-border-color: oklch(from var(--color-warning-foreground) l c h / 0.2);
|
|
130
115
|
}
|
|
131
116
|
|
|
132
117
|
:where([data-ui~="callout"][data-callout-variant="destructive"]) {
|
|
133
|
-
--_callout-bg:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
);
|
|
137
|
-
--_callout-text: light-dark(
|
|
138
|
-
oklch(from var(--color-destructive) min(l, 0.45) c h),
|
|
139
|
-
oklch(from var(--color-destructive) max(l, 0.82) c h)
|
|
140
|
-
);
|
|
141
|
-
--_callout-border-color: oklch(from var(--color-destructive) l c h / 0.2);
|
|
118
|
+
--_callout-bg: var(--color-destructive);
|
|
119
|
+
--_callout-text: var(--color-destructive-foreground);
|
|
120
|
+
--_callout-border-color: oklch(from var(--color-destructive-foreground) l c h / 0.2);
|
|
142
121
|
}
|
|
143
122
|
}
|
|
@@ -121,10 +121,9 @@
|
|
|
121
121
|
"
|
|
122
122
|
>
|
|
123
123
|
<figure
|
|
124
|
-
data-ui="pile"
|
|
125
124
|
role="img"
|
|
126
125
|
style="
|
|
127
|
-
--display: grid;
|
|
126
|
+
--display: grid-pile;
|
|
128
127
|
--size: 11;
|
|
129
128
|
--border-color: var(--color-border);
|
|
130
129
|
--border-width: 1px;
|
|
@@ -162,7 +161,7 @@
|
|
|
162
161
|
--bg: var(--color-primary);
|
|
163
162
|
"
|
|
164
163
|
>
|
|
165
|
-
<span
|
|
164
|
+
<span style="--sr: only">John Doe</span>
|
|
166
165
|
<span aria-hidden="true">JD</span>
|
|
167
166
|
</figcaption>
|
|
168
167
|
</figure>
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
5
|
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
|
|
6
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
7
|
+
* rounded corners
|
|
6
8
|
* @tokens --ui-card-* (@layer variables; named after the utilities they back)
|
|
7
9
|
* @presets data-card-variant="outline" | "muted" | "floating"
|
|
8
10
|
*
|
|
@@ -22,6 +24,7 @@
|
|
|
22
24
|
--ui-card-bg: transparent;
|
|
23
25
|
--ui-card-text: var(--color-card-foreground);
|
|
24
26
|
--ui-card-radius: var(--radius-lg);
|
|
27
|
+
--ui-card-corner-shape: var(--radius-corner-shape);
|
|
25
28
|
--ui-card-shadow: none;
|
|
26
29
|
|
|
27
30
|
--ui-card-border-width: 1px;
|
|
@@ -95,6 +98,7 @@
|
|
|
95
98
|
border-radius: calc(
|
|
96
99
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
97
100
|
);
|
|
101
|
+
corner-shape: var(--_corner-shape-resolved, var(--ui-card-corner-shape));
|
|
98
102
|
box-shadow: var(--_shadow-resolved, var(--_card-shadow, var(--ui-card-shadow)));
|
|
99
103
|
overflow: clip;
|
|
100
104
|
transition: var(--default-transition);
|
|
@@ -101,10 +101,9 @@
|
|
|
101
101
|
"
|
|
102
102
|
>
|
|
103
103
|
<figure
|
|
104
|
-
data-ui="pile"
|
|
105
104
|
role="img"
|
|
106
105
|
style="
|
|
107
|
-
--display: grid;
|
|
106
|
+
--display: grid-pile;
|
|
108
107
|
--size: 11;
|
|
109
108
|
--border-color: var(--color-border);
|
|
110
109
|
--border-width: 1px;
|
|
@@ -142,7 +141,7 @@
|
|
|
142
141
|
--bg: var(--color-primary);
|
|
143
142
|
"
|
|
144
143
|
>
|
|
145
|
-
<span
|
|
144
|
+
<span style="--sr: only">John Doe</span>
|
|
146
145
|
<span aria-hidden="true">JD</span>
|
|
147
146
|
</figcaption>
|
|
148
147
|
</figure>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* background/border)
|
|
6
6
|
* @uses appearance: none — redraws the native control from theme tokens
|
|
7
7
|
* @uses checked/indeterminate fill with --primary and layer a glyph (never color alone)
|
|
8
|
+
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
9
|
+
* rounded corners
|
|
8
10
|
* @tokens --ui-checkbox-* (@layer variables; named after the utilities they back;
|
|
9
11
|
* surface/border default to the --ui-field-* family)
|
|
10
12
|
* @see checkbox.ts: derives select-all group state (data-checkbox-controls)
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
--ui-checkbox-bg--checked: var(--color-primary);
|
|
25
27
|
--ui-checkbox-border-color--checked: var(--color-primary);
|
|
26
28
|
--ui-checkbox-radius: var(--radius-xs);
|
|
29
|
+
--ui-checkbox-corner-shape: var(--radius-corner-shape);
|
|
27
30
|
--ui-checkbox-glyph-size: 1em;
|
|
28
31
|
--ui-checkbox-checkmark-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' fill='none' stroke='currentColor' stroke-linecap='square' stroke-linejoin='square' stroke-width='3' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
|
|
29
32
|
center / contain no-repeat;
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
border-radius: calc(
|
|
54
57
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
55
58
|
);
|
|
59
|
+
corner-shape: var(--_corner-shape-resolved, var(--ui-checkbox-corner-shape));
|
|
56
60
|
|
|
57
61
|
/* centres the ::before glyph */
|
|
58
62
|
display: inline-grid;
|