@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.
Files changed (120) hide show
  1. package/AUTHORING.md +21 -16
  2. package/CHANGELOG.md +89 -0
  3. package/README.md +3 -3
  4. package/dist/sri.json +85 -84
  5. package/dist/zazz.css +1 -1
  6. package/editor/zazz.css-data.json +9042 -1944
  7. package/editor/zazz.html-data.json +31 -41
  8. package/editor/zazz.language-data.json +468 -233
  9. package/editor/zazz.lint-data.json +412 -396
  10. package/package.json +2 -3
  11. package/src/base/_defaults.css +59 -40
  12. package/src/base/_layers.css +5 -2
  13. package/src/base/_properties-2xl.css +10 -0
  14. package/src/base/_properties-active.css +8 -0
  15. package/src/base/_properties-checked.css +8 -0
  16. package/src/base/_properties-current.css +8 -0
  17. package/src/base/_properties-disabled.css +8 -0
  18. package/src/base/_properties-focus-visible.css +8 -0
  19. package/src/base/_properties-focus-within.css +8 -0
  20. package/src/base/_properties-hover.css +8 -0
  21. package/src/base/_properties-lg.css +10 -0
  22. package/src/base/_properties-md.css +10 -0
  23. package/src/base/_properties-open.css +8 -0
  24. package/src/base/_properties-sm.css +10 -0
  25. package/src/base/_properties-starting.css +4 -0
  26. package/src/base/_properties-stuck.css +4 -0
  27. package/src/base/_properties-xl.css +10 -0
  28. package/src/base/_properties.css +55 -15
  29. package/src/base/_reset.css +8 -4
  30. package/src/base/_typography.css +26 -9
  31. package/src/base/_utilities-box.css +63 -59
  32. package/src/base/_utilities-color.css +55 -8
  33. package/src/base/_utilities-effects.css +8 -0
  34. package/src/base/_utilities-flow.css +28 -5
  35. package/src/base/_utilities-pseudo.css +4 -0
  36. package/src/base/_utilities-spacing.css +8 -8
  37. package/src/base/_utilities-sr.css +98 -0
  38. package/src/base/_utilities-tier-2xl.css +5 -0
  39. package/src/base/_utilities-tier-active.css +5 -1
  40. package/src/base/_utilities-tier-checked.css +5 -1
  41. package/src/base/_utilities-tier-current.css +5 -1
  42. package/src/base/_utilities-tier-disabled.css +5 -1
  43. package/src/base/_utilities-tier-focus-visible.css +5 -1
  44. package/src/base/_utilities-tier-focus-within.css +5 -1
  45. package/src/base/_utilities-tier-hover.css +5 -1
  46. package/src/base/_utilities-tier-lg.css +5 -0
  47. package/src/base/_utilities-tier-md.css +5 -0
  48. package/src/base/_utilities-tier-open.css +5 -1
  49. package/src/base/_utilities-tier-sm.css +5 -0
  50. package/src/base/_utilities-tier-starting.css +2 -0
  51. package/src/base/_utilities-tier-stuck.css +3 -0
  52. package/src/base/_utilities-tier-xl.css +5 -0
  53. package/src/base/_utilities-typography.css +263 -3
  54. package/src/base/_variables.css +123 -57
  55. package/src/base/kit-styling.d.ts.map +1 -1
  56. package/src/base/kit-styling.js +90 -86
  57. package/src/base/kit-styling.ts +90 -86
  58. package/src/base/utilities.d.ts +23 -8
  59. package/src/base/utilities.d.ts.map +1 -1
  60. package/src/base/utilities.js +78 -3
  61. package/src/base/utilities.ts +95 -11
  62. package/src/head.d.ts.map +1 -1
  63. package/src/head.js +4 -5
  64. package/src/head.ts +4 -5
  65. package/src/index.css +3 -2
  66. package/src/manifest.d.ts.map +1 -1
  67. package/src/manifest.js +13 -3
  68. package/src/manifest.ts +13 -3
  69. package/src/primitives/alert-dialog/alert-dialog.css +1 -1
  70. package/src/primitives/autocomplete/autocomplete.css +4 -2
  71. package/src/primitives/avatar/avatar.html +4 -6
  72. package/src/primitives/badge/badge.css +63 -56
  73. package/src/primitives/breadcrumbs/breadcrumbs.html +1 -7
  74. package/src/primitives/button/button.css +44 -57
  75. package/src/primitives/button-group/button-group.css +4 -0
  76. package/src/primitives/callout/callout.css +22 -43
  77. package/src/primitives/card/card-subgrid.html +2 -3
  78. package/src/primitives/card/card.css +4 -0
  79. package/src/primitives/card/card.html +2 -3
  80. package/src/primitives/checkbox/checkbox.css +4 -0
  81. package/src/primitives/combobox/combobox.css +8 -1
  82. package/src/primitives/command/command-actions.d.ts.map +1 -1
  83. package/src/primitives/command/command-actions.js +4 -9
  84. package/src/primitives/command/command-actions.ts +4 -9
  85. package/src/primitives/debug/audit-core.d.ts +1 -1
  86. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  87. package/src/primitives/debug/audit-core.js +30 -3
  88. package/src/primitives/debug/audit-core.ts +40 -2
  89. package/src/primitives/dialog/dialog-with-form.html +1 -1
  90. package/src/primitives/dialog/dialog.css +19 -4
  91. package/src/primitives/fields/fields.css +11 -5
  92. package/src/primitives/group/group.css +18 -0
  93. package/src/primitives/group/group.html +26 -0
  94. package/src/primitives/input/input.css +14 -8
  95. package/src/primitives/input-group/input-group-password-group.html +1 -1
  96. package/src/primitives/input-group/input-group.css +12 -8
  97. package/src/primitives/kbd/kbd.css +4 -0
  98. package/src/primitives/lightbox/lightbox.css +13 -0
  99. package/src/primitives/lightbox/lightbox.html +2 -1
  100. package/src/primitives/menu/menu.css +3 -1
  101. package/src/primitives/meter/meter.css +10 -3
  102. package/src/primitives/navigation-menu/navigation-menu.css +5 -0
  103. package/src/primitives/navigation-menu/navigation-menu.html +2 -2
  104. package/src/primitives/otp/otp.css +4 -0
  105. package/src/primitives/password-group/password-group.css +13 -9
  106. package/src/primitives/password-group/password-group.html +1 -1
  107. package/src/primitives/popover/popover.css +6 -0
  108. package/src/primitives/progress/progress.css +5 -0
  109. package/src/primitives/radio/radio.css +3 -0
  110. package/src/primitives/select/select.css +17 -9
  111. package/src/primitives/slider/slider.css +8 -0
  112. package/src/primitives/switch/switch.css +56 -20
  113. package/src/primitives/tabs/tabs.css +18 -0
  114. package/src/primitives/textarea/textarea.css +19 -10
  115. package/src/primitives/toaster/toaster.css +8 -4
  116. package/src/primitives/toggle/toggle.css +10 -6
  117. package/src/primitives/toggle-group/toggle-group.css +4 -0
  118. package/src/primitives/tooltip/tooltip.css +4 -0
  119. package/src/primitives/utilities/pile.html +2 -3
  120. package/src/base/_switches.css +0 -148
@@ -2,11 +2,13 @@
2
2
  * switch.css — Switch (input[type="checkbox"][role="switch"])
3
3
  *
4
4
  * @layer variables, reset
5
- * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow)
5
+ * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* border/ring)
6
6
  * @uses appearance: none on input[role="switch"]
7
7
  * @uses label:has(> input[role="switch"])::after — thumb drawn on label (no JS)
8
8
  * @uses oklch(from …) — checked/hover track tints
9
- * @tokens --ui-switch-* (@layer variables; consumed in @layer reset)
9
+ * @uses corner-shape — round by default, so circles stay circles; a hook takes any shape
10
+ * @tokens --ui-switch-* (@layer variables; consumed in @layer reset; border and
11
+ * ring default to the --ui-field-* family)
10
12
  */
11
13
 
12
14
  @layer variables {
@@ -14,17 +16,34 @@
14
16
  --ui-switch-track-w: calc(var(--spacing) * 7);
15
17
  --ui-switch-track-p: calc(var(--spacing) * 0.5);
16
18
  --ui-switch-track-h: calc(var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p));
17
- --ui-switch-thumb-bg: var(--color-background);
18
- --ui-switch-thumb-bg--hover: var(--color-primary-foreground);
19
+
20
+ --ui-switch-thumb-bg: var(--color-card);
21
+ --ui-switch-thumb-bg--checked: var(--color-primary-foreground);
19
22
  --ui-switch-thumb-size: calc((var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p));
20
- --ui-switch-thumb-shadow: var(--shadow-xs);
23
+ --ui-switch-thumb-shadow: var(--shadow-sm);
21
24
  --ui-switch-thumb-translate: var(--ui-switch-track-p), -50%;
22
25
  --ui-switch-thumb-scale: 1;
26
+
23
27
  --ui-switch-track-bg: var(--color-input);
24
- --ui-switch-track-bg--hover: oklch(from var(--color-input) l c h / calc(alpha + 0.04));
28
+ --ui-switch-track-bg--hover: oklch(from var(--color-muted) l c h / calc(alpha * 1.5));
25
29
  --ui-switch-track-bg--checked: var(--color-primary);
26
30
  --ui-switch-track-bg--checked-hover: var(--color-primary);
31
+ --ui-switch-track-border-width: var(--ui-field-border-width);
32
+ --ui-switch-track-border-style: var(--ui-field-border-style);
33
+ --ui-switch-track-border-color: var(--ui-field-border-color);
34
+ --ui-switch-track-border-color--hover: var(--ui-field-border-color--hover);
35
+ --ui-switch-track-border-color--checked: var(--ui-switch-track-bg--checked);
36
+ --ui-switch-track-border-color--checked-hover: var(--ui-switch-track-bg--checked-hover);
37
+
38
+ /* dual-mode hooks: a scale number or a length */
27
39
  --ui-switch-radius: var(--radius-full);
40
+ --ui-switch-corner-shape: round;
41
+ --ui-switch-track-radius: var(--ui-switch-radius);
42
+ --ui-switch-track-corner-shape: var(--ui-switch-corner-shape);
43
+ --ui-switch-thumb-radius: var(--ui-switch-radius);
44
+ --ui-switch-thumb-corner-shape: var(--ui-switch-corner-shape);
45
+
46
+ --ui-switch-cursor: pointer;
28
47
  }
29
48
  }
30
49
 
@@ -44,30 +63,35 @@
44
63
  inset-inline-start: 0;
45
64
  inline-size: var(--ui-switch-thumb-size);
46
65
  block-size: var(--ui-switch-thumb-size);
47
- border-radius: var(--radius-full);
66
+ /* The thumb hangs off the label, out of reach of a --radius on the input,
67
+ so it reads the hook alone */
68
+ --_radius-len: var(--ui-switch-thumb-radius);
69
+ --_radius-num: var(--ui-switch-thumb-radius);
70
+ border-radius: calc(
71
+ var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
72
+ );
73
+ corner-shape: var(--ui-switch-thumb-corner-shape);
48
74
  background-color: var(--ui-switch-thumb-bg);
49
75
  box-shadow: var(--ui-switch-thumb-shadow);
50
76
  pointer-events: none;
51
77
  transform: translate(var(--ui-switch-thumb-translate)) scale(var(--ui-switch-thumb-scale));
52
- transition:
53
- box-shadow var(--default-transition-duration) var(--default-transition-timing-function),
54
- transform var(--default-transition-duration) var(--default-transition-timing-function);
78
+ transition: var(--default-transition);
55
79
  z-index: 1;
56
80
  }
57
81
 
58
82
  &:has(> input[role="switch"]:checked)::after {
59
- background-color: var(--ui-switch-thumb-bg--hover);
83
+ background-color: var(--ui-switch-thumb-bg--checked);
60
84
  --ui-switch-thumb-translate:
61
85
  calc(var(--ui-switch-track-p) + var(--ui-switch-thumb-size)), -50%;
62
86
  }
63
87
 
64
88
  @media (hover: hover) {
65
- &:has(> input[role="switch"]:hover):after {
89
+ &:has(> input[role="switch"]:hover:not(:disabled))::after {
66
90
  --ui-switch-thumb-scale: 1.1;
67
91
  }
68
92
  }
69
93
 
70
- &:has(> input[role="switch"]:active):after {
94
+ &:has(> input[role="switch"]:active:not(:disabled))::after {
71
95
  --ui-switch-thumb-shadow: none;
72
96
  --ui-switch-thumb-scale: 0.98;
73
97
  }
@@ -93,18 +117,23 @@
93
117
  block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
94
118
 
95
119
  background-color: var(--_bg-resolved, var(--ui-switch-track-bg));
96
-
97
- --_radius-len: var(--_radius-resolved, var(--ui-switch-radius));
98
- --_radius-num: var(--_radius-resolved, var(--ui-switch-radius));
120
+ border-width: var(--_border-width-resolved, var(--ui-switch-track-border-width));
121
+ border-style: var(--_border-style-resolved, var(--ui-switch-track-border-style));
122
+ border-color: var(--_border-color-resolved, var(--ui-switch-track-border-color));
123
+ --_radius-len: var(--_radius-resolved, var(--ui-switch-track-radius));
124
+ --_radius-num: var(--_radius-resolved, var(--ui-switch-track-radius));
99
125
  border-radius: calc(
100
126
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
101
127
  );
102
- cursor: pointer;
128
+ corner-shape: var(--_corner-shape-resolved, var(--ui-switch-track-corner-shape));
129
+ cursor: var(--_cursor-resolved, var(--ui-switch-cursor));
103
130
 
104
- /* the transparent outline keeps focus visible in forced-colors */
131
+ /* The ring is published to --_focus-shadow so a --shadow utility keeps
132
+ it; the transparent outline twin keeps focus visible in forced-colors */
105
133
  --_ring-offset-width: 0px;
106
134
  --_ring-width: 0px;
107
135
  --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
136
+ --_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
108
137
  --_focus-shadow:
109
138
  0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
110
139
  0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
@@ -123,22 +152,29 @@
123
152
  }
124
153
 
125
154
  @media (hover: hover) {
126
- :where(input[role="switch"]:hover) {
155
+ :where(input[role="switch"]:hover:not(:disabled)) {
127
156
  background-color: var(--_bg-resolved, var(--ui-switch-track-bg--hover));
157
+ border-color: var(--_border-color-resolved, var(--ui-switch-track-border-color--hover));
128
158
  }
129
159
  }
130
160
 
131
161
  :where(input[role="switch"]:checked) {
132
162
  background-color: var(--_bg-resolved, var(--ui-switch-track-bg--checked));
163
+ border-color: var(--_border-color-resolved, var(--ui-switch-track-border-color--checked));
133
164
  }
134
165
 
135
166
  @media (hover: hover) {
136
- :where(input[role="switch"]:hover:checked) {
167
+ :where(input[role="switch"]:hover:checked:not(:disabled)) {
137
168
  background-color: var(--_bg-resolved, var(--ui-switch-track-bg--checked-hover));
169
+ border-color: var(
170
+ --_border-color-resolved,
171
+ var(--ui-switch-track-border-color--checked-hover)
172
+ );
138
173
  }
139
174
  }
140
175
 
141
176
  :where(input[role="switch"]:focus-visible) {
177
+ border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
142
178
  --_ring-offset-width: var(--ring-offset-width);
143
179
  --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
144
180
  outline-color: transparent;
@@ -8,6 +8,8 @@
8
8
  * (@supports gated; checked-label fallback paints card fill without pill)
9
9
  * @uses anchor-scope — isolates --active-tab inside nested menus
10
10
  * @uses text-box, color-mix() — label trim and focus ring
11
+ * @uses corner-shape — superellipse corners; unsupported browsers keep plain
12
+ * rounded corners
11
13
  * @tokens --ui-tabs-* (@layer variables)
12
14
  */
13
15
 
@@ -18,13 +20,21 @@
18
20
  --ui-tabs-gap: var(--space-xs);
19
21
  --ui-tabs-track-p: calc(var(--spacing) * 0.5);
20
22
  --ui-tabs-track-radius: var(--ui-field-radius);
23
+ --ui-tabs-track-corner-shape: var(--ui-field-corner-shape);
21
24
  --ui-tabs-track-gap: calc(var(--spacing) * 0.5);
22
25
  --ui-tabs-track-bg: var(--color-muted);
26
+ --ui-tabs-track-border-width: 1px;
27
+ --ui-tabs-track-border-style: solid;
28
+ --ui-tabs-track-border-color: var(--color-border);
23
29
 
24
30
  --ui-tabs-indicator-bg: var(--color-card);
25
31
  --ui-tabs-indicator-radius: var(--ui-field-inset-child-radius);
32
+ --ui-tabs-indicator-corner-shape: var(--ui-field-corner-shape);
26
33
  --ui-tabs-indicator-shadow: var(--shadow-xs);
27
34
  --ui-tabs-indicator-inset: var(--ui-tabs-track-p);
35
+ --ui-tabs-indicator-border-width: 1px;
36
+ --ui-tabs-indicator-border-style: solid;
37
+ --ui-tabs-indicator-border-color: transparent;
28
38
 
29
39
  --ui-tabs-label-font-family: var(--font-family-body);
30
40
  --ui-tabs-label-font-size: var(--font-size-sm);
@@ -67,7 +77,10 @@
67
77
  border-radius: calc(
68
78
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
69
79
  );
80
+ corner-shape: var(--_corner-shape-resolved, var(--ui-tabs-track-corner-shape));
70
81
  background-color: var(--ui-tabs-track-bg);
82
+ border: var(--ui-tabs-track-border-width) var(--ui-tabs-track-border-style)
83
+ var(--ui-tabs-track-border-color);
71
84
 
72
85
  /* Scoped so [data-tabs-slot~="indicator"] can resolve --active-tab even when an ancestor
73
86
  (e.g. [data-navigation-menu-slot~="item"]) sets anchor-scope to its own trigger name. */
@@ -78,7 +91,10 @@
78
91
  position: absolute;
79
92
  z-index: 0;
80
93
  pointer-events: none;
94
+ border: var(--ui-tabs-indicator-border-width) var(--ui-tabs-indicator-border-style)
95
+ var(--ui-tabs-indicator-border-color);
81
96
  border-radius: var(--ui-tabs-indicator-radius);
97
+ corner-shape: var(--ui-tabs-indicator-corner-shape);
82
98
  background-color: var(--ui-tabs-indicator-bg);
83
99
  box-shadow: var(--ui-tabs-indicator-shadow);
84
100
  transition-property: left, right, top, bottom;
@@ -118,6 +134,7 @@
118
134
  text-box: trim-both ex alphabetic;
119
135
 
120
136
  border-radius: var(--ui-tabs-indicator-radius);
137
+ corner-shape: var(--ui-tabs-indicator-corner-shape);
121
138
 
122
139
  /* ring renders as box-shadow so it composes with the indicator shadow in
123
140
  the no-anchor fallback below; the ring widths animate from 0 so the
@@ -211,6 +228,7 @@
211
228
  input[type="radio"]:checked
212
229
  + [data-tabs-slot~="label"] {
213
230
  border-radius: var(--ui-tabs-indicator-radius);
231
+ corner-shape: var(--ui-tabs-indicator-corner-shape);
214
232
  background-color: var(--ui-tabs-indicator-bg);
215
233
  box-shadow:
216
234
  0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in)))
@@ -5,8 +5,11 @@
5
5
  * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css
6
6
  * @uses field-sizing: content — auto-grow with text (modern browsers;
7
7
  * falls back to fixed min/max block-size where unsupported)
8
+ * @uses corner-shape — superellipse corners; unsupported browsers keep plain
9
+ * rounded corners
8
10
  * @tokens --ui-textarea-* (@layer variables;
9
- * --ui-textarea-min-h / -max-h default to lh units and are read raw;
11
+ * --ui-textarea-min-h / -max-h default to lh units and take a scale
12
+ * number or a length, not a keyword;
10
13
  * surface colors read the --ui-field-* family directly)
11
14
  */
12
15
 
@@ -23,6 +26,7 @@
23
26
  --ui-textarea-border-style: var(--ui-field-border-style);
24
27
  --ui-textarea-border-color: var(--ui-field-border-color);
25
28
  --ui-textarea-radius: var(--ui-field-radius);
29
+ --ui-textarea-corner-shape: var(--ui-field-corner-shape);
26
30
  --ui-textarea-resize: vertical;
27
31
  }
28
32
  }
@@ -37,8 +41,12 @@
37
41
  --_min-w-len: var(--_min-w-resolved, var(--ui-textarea-min-w));
38
42
  --_min-w-num: var(--_min-w-resolved, var(--ui-textarea-min-w));
39
43
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
40
- min-block-size: var(--_min-h-resolved, var(--ui-textarea-min-h));
41
- max-block-size: var(--_max-h-resolved, var(--ui-textarea-max-h));
44
+ --_min-h-len: var(--_min-h-resolved, var(--ui-textarea-min-h));
45
+ --_min-h-num: var(--_min-h-resolved, var(--ui-textarea-min-h));
46
+ min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
47
+ --_max-h-len: var(--_max-h-resolved, var(--ui-textarea-max-h));
48
+ --_max-h-num: var(--_max-h-resolved, var(--ui-textarea-max-h));
49
+ max-block-size: calc(var(--_max-h-len) + var(--_max-h-num) * var(--spacing));
42
50
  --_p-len: var(--_p-resolved, var(--ui-textarea-p));
43
51
  --_p-num: var(--_p-resolved, var(--ui-textarea-p));
44
52
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
@@ -56,6 +64,7 @@
56
64
  border-radius: calc(
57
65
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
58
66
  );
67
+ corner-shape: var(--_corner-shape-resolved, var(--ui-textarea-corner-shape));
59
68
  resize: var(--ui-textarea-resize);
60
69
 
61
70
  /* The ring is published to --_focus-shadow so a --shadow utility keeps
@@ -105,13 +114,13 @@
105
114
  }
106
115
 
107
116
  :where([data-ui~="textarea"]):user-invalid {
108
- --ui-field-bg: color-mix(in oklch, var(--color-destructive) 5%, var(--color-input));
109
- --ui-field-bg--hover: color-mix(in oklch, var(--color-destructive) 10%, var(--color-input));
110
- --ui-field-border-color: var(--color-destructive);
111
- --ui-field-border-color--hover: var(--color-destructive);
112
- --ui-field-border-color--focus-within: var(--color-destructive);
113
- --ui-field-ring-color: var(--color-destructive);
117
+ --ui-field-bg: var(--color-destructive);
118
+ --ui-field-bg--hover: oklch(from var(--color-destructive) calc(l - 0.025) c h);
119
+ --ui-field-border-color: var(--color-destructive-foreground);
120
+ --ui-field-border-color--hover: var(--color-destructive-foreground);
121
+ --ui-field-border-color--focus-within: var(--color-destructive-foreground);
122
+ --ui-field-ring-color: var(--color-destructive-foreground);
114
123
 
115
- border-color: var(--color-destructive);
124
+ border-color: var(--color-destructive-foreground);
116
125
  }
117
126
  }
@@ -13,6 +13,8 @@
13
13
  * _view-transitions.css so page transitions never repaint the stack
14
14
  * @uses JS-maintained custom properties (--toasts-before, --offset, --initial-height,
15
15
  * --front-toast-height + inline z-index): stack math from toaster.js
16
+ * @uses corner-shape — superellipse corners; unsupported browsers keep plain
17
+ * rounded corners
16
18
  * @tokens --ui-toaster-* (@layer variables)
17
19
  */
18
20
 
@@ -23,6 +25,7 @@
23
25
  --ui-toaster-text: var(--color-popover-foreground);
24
26
  --ui-toaster-border-color: var(--color-border);
25
27
  --ui-toaster-radius: var(--radius-md);
28
+ --ui-toaster-corner-shape: var(--radius-corner-shape);
26
29
  --ui-toaster-shadow: var(--shadow-md);
27
30
  /* status accent: icon color; variants reassign */
28
31
  --ui-toaster-accent: var(--color-popover-foreground);
@@ -135,6 +138,7 @@
135
138
  background-color: var(--ui-toaster-bg);
136
139
  border: 1px solid var(--ui-toaster-border-color);
137
140
  border-radius: var(--ui-toaster-radius);
141
+ corner-shape: var(--ui-toaster-corner-shape);
138
142
  box-shadow: var(--ui-toaster-shadow);
139
143
  overflow-wrap: anywhere;
140
144
 
@@ -287,21 +291,21 @@
287
291
 
288
292
  :where(ui-toaster, [data-ui~="toaster"])
289
293
  [data-toaster-slot~="toast"][data-toaster-variant="success"] {
290
- --ui-toaster-accent: var(--color-success);
294
+ --ui-toaster-accent: var(--color-success-foreground);
291
295
  }
292
296
 
293
297
  :where(ui-toaster, [data-ui~="toaster"])
294
298
  [data-toaster-slot~="toast"][data-toaster-variant="info"] {
295
- --ui-toaster-accent: var(--color-info);
299
+ --ui-toaster-accent: var(--color-info-foreground);
296
300
  }
297
301
 
298
302
  :where(ui-toaster, [data-ui~="toaster"])
299
303
  [data-toaster-slot~="toast"][data-toaster-variant="warning"] {
300
- --ui-toaster-accent: var(--color-warning);
304
+ --ui-toaster-accent: var(--color-warning-foreground);
301
305
  }
302
306
 
303
307
  :where(ui-toaster, [data-ui~="toaster"])
304
308
  [data-toaster-slot~="toast"][data-toaster-variant="destructive"] {
305
- --ui-toaster-accent: var(--color-destructive);
309
+ --ui-toaster-accent: var(--color-destructive-foreground);
306
310
  }
307
311
  }
@@ -13,6 +13,8 @@
13
13
  * @uses :has(): drive label state from the nested input (checked/focus/disabled)
14
14
  * @uses oklch(from …): variant hover/active tints (inherited from --ui-button-*)
15
15
  * @uses text-box: vertical trim (patchy browser support)
16
+ * @uses corner-shape — superellipse corners; unsupported browsers keep plain
17
+ * rounded corners
16
18
  * @tokens --ui-toggle-* (@layer variables;
17
19
  * default to the --ui-button-* family)
18
20
  * @consumedby toggle-group.css
@@ -58,6 +60,7 @@
58
60
  --ui-toggle-px: var(--ui-button-px);
59
61
  --ui-toggle-min-h: var(--ui-button-min-h);
60
62
  --ui-toggle-radius: var(--ui-button-radius);
63
+ --ui-toggle-corner-shape: var(--ui-button-corner-shape);
61
64
 
62
65
  --ui-toggle-icon-size: var(--ui-button-icon-size);
63
66
 
@@ -241,6 +244,7 @@
241
244
  border-radius: calc(
242
245
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
243
246
  );
247
+ corner-shape: var(--_corner-shape-resolved, var(--ui-toggle-corner-shape));
244
248
 
245
249
  color: var(--_text-resolved, var(--_toggle-text, var(--ui-toggle-text)));
246
250
  background-color: var(--_bg-resolved, var(--_toggle-bg, var(--ui-toggle-bg)));
@@ -464,19 +468,19 @@
464
468
  }
465
469
 
466
470
  :where([data-ui~="toggle"][data-toggle-variant="destructive"]) {
467
- --_toggle-ring-color: var(--color-destructive);
471
+ --_toggle-ring-color: var(--color-destructive-foreground);
468
472
 
469
473
  --_toggle-bg: var(--color-destructive);
470
- --_toggle-bg--hover: oklch(from var(--color-destructive) l c h / 0.9);
471
- --_toggle-bg--active: oklch(from var(--color-destructive) l c h / 0.8);
474
+ --_toggle-bg--hover: oklch(from var(--color-destructive) calc(l - 0.025) c h);
475
+ --_toggle-bg--active: oklch(from var(--color-destructive) calc(l - 0.05) c h);
472
476
 
473
477
  --_toggle-text: var(--color-destructive-foreground);
474
478
  --_toggle-text--hover: var(--color-destructive-foreground);
475
479
  --_toggle-text--active: var(--color-destructive-foreground);
476
480
 
477
- --_toggle-border-color: var(--color-destructive);
478
- --_toggle-border-color--hover: var(--color-destructive);
479
- --_toggle-border-color--active: var(--color-destructive);
481
+ --_toggle-border-color: transparent;
482
+ --_toggle-border-color--hover: transparent;
483
+ --_toggle-border-color--active: transparent;
480
484
 
481
485
  --_toggle-shadow: 0 0 transparent;
482
486
  }
@@ -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-toggle-group-* (@layer variables; named after the utilities they back)
10
12
  */
11
13
 
12
14
  @layer variables {
13
15
  :root {
14
16
  --ui-toggle-group-radius: var(--ui-toggle-radius);
17
+ --ui-toggle-group-corner-shape: var(--ui-toggle-corner-shape);
15
18
  --ui-toggle-group-bg: var(--color-card);
16
19
  }
17
20
  }
@@ -54,6 +57,7 @@
54
57
  border-radius: calc(
55
58
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
56
59
  );
60
+ corner-shape: var(--_corner-shape-resolved, var(--ui-toggle-group-corner-shape));
57
61
  background-color: var(--_bg-resolved, var(--_toggle-group-bg, var(--ui-toggle-group-bg)));
58
62
  position: relative;
59
63
  isolation: isolate;
@@ -7,6 +7,8 @@
7
7
  * @uses data-tooltip-slot="content": hint popover (light dismiss, auto-hides sibling hints)
8
8
  * @uses anchor-name, position-anchor, position-area, position-try-fallbacks:
9
9
  * explicit anchors for polyfill; data-popover-side maps to --ui-popover-position-*
10
+ * @uses corner-shape — superellipse corners; unsupported browsers keep plain
11
+ * rounded corners
10
12
  * @tokens --ui-tooltip-* (@layer variables; read on the content slot)
11
13
  */
12
14
 
@@ -16,6 +18,7 @@
16
18
  --ui-tooltip-text: var(--color-background);
17
19
  --ui-tooltip-border-color: transparent;
18
20
  --ui-tooltip-radius: var(--radius-sm);
21
+ --ui-tooltip-corner-shape: var(--radius-corner-shape);
19
22
  --ui-tooltip-shadow: var(--shadow-sm);
20
23
  --ui-tooltip-px: var(--space-xs);
21
24
  --ui-tooltip-py: var(--spacing);
@@ -156,6 +159,7 @@
156
159
  border-radius: calc(
157
160
  var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
158
161
  );
162
+ corner-shape: var(--_corner-shape-resolved, var(--ui-tooltip-corner-shape));
159
163
  box-shadow: var(--_shadow-resolved, var(--ui-tooltip-shadow));
160
164
 
161
165
  font-family: var(--_font-family-resolved, var(--ui-tooltip-font-family));
@@ -1,7 +1,6 @@
1
1
  <div
2
- data-ui="pile"
3
2
  style="
4
- --display: grid;
3
+ --display: grid-pile;
5
4
  --w: 100%;
6
5
  --h: 6;
7
6
  --max-w: 96;
@@ -14,7 +13,7 @@
14
13
  --radius: 4.5;
15
14
  "
16
15
  ></div>
17
- <span data-ui="badge" data-badge-variant="primary">grid-area-pile</span>
16
+ <span data-ui="badge" data-badge-variant="primary">grid-pile</span>
18
17
  <span
19
18
  data-ui="badge"
20
19
  data-badge-variant="muted"
@@ -1,148 +0,0 @@
1
- /**
2
- * _switches.css — Switches: fixed rule sets with no value, carried as
3
- * `data-ui` tokens.
4
- *
5
- * @layer utilities
6
- * @requires _layers.css
7
- * @uses data-ui="sr-only": visually hidden, still in the accessibility tree
8
- * @uses data-ui="pile": every child in one grid area
9
- * @uses data-ui="isolate": a new stacking context (isolation: isolate)
10
- * @uses data-ui="not-prose": a prose ancestor stops styling this subtree
11
- * (a widget inside an article; rules in _typography.css)
12
- * @uses data-ui="truncate": one line, overflow cut with an ellipsis
13
- * (`--line-clamp` clamps to more lines)
14
- * @uses data-ui="spin": a full turn every second (loading indicators)
15
- * @uses data-ui="ping": scale up and fade out every second, like a radar
16
- * ping (notification dots)
17
- * @uses data-ui="pulse": fade to half opacity and back every two
18
- * seconds (skeleton loaders)
19
- * @uses data-ui="bounce": drop and rise every second (scroll hints)
20
- * @uses data-ui="divide-x" / "divide-y": a border between direct children,
21
- * sized and colored by the container's `--divide` (default 1px --color-border)
22
- * @uses data-ui="container": an inline-size query container, so breakpoint
23
- * tiers inside it (`--grid-cols--md`) follow its width, not the page's
24
- * @uses data-ui="theme-dark" / "theme-light": pins the color scheme for the
25
- * subtree (usually on <html>); without either, the system setting applies
26
- * (rules in _variables.css, so they rank with the theme tokens)
27
- */
28
-
29
- @layer ui.utilities {
30
- :where([data-ui~="sr-only"]) {
31
- position: absolute;
32
- inline-size: 1px;
33
- block-size: 1px;
34
- padding: 0;
35
- margin: -1px;
36
- overflow: hidden;
37
- clip: rect(0, 0, 0, 0);
38
- white-space: nowrap;
39
- border-width: 0;
40
- }
41
-
42
- :where([data-ui~="pile"]) {
43
- display: grid;
44
- grid-template-areas: "pile";
45
- place-items: center;
46
-
47
- > * {
48
- grid-area: pile;
49
- }
50
- }
51
-
52
- :where([data-ui~="isolate"]) {
53
- isolation: isolate;
54
- }
55
-
56
- /* needs a width to overflow: a block, a sized element, or a flex item with
57
- `--min-w: 0` (a flex item's min width is its content by default) */
58
- :where([data-ui~="truncate"]) {
59
- overflow: hidden;
60
- text-overflow: ellipsis;
61
- white-space: nowrap;
62
- }
63
-
64
- /* dividers: a border on the trailing edge of every direct child but the last.
65
- `--divide` on the container sets it with the border shorthand's grammar (a
66
- number is px in --color-border, a color is 1px of it, a length is the width);
67
- its width and color channels inherit so the children read them. A switch,
68
- not a `--divide-x` utility: a `[style*=…] > *` rule would make every inline
69
- style change invalidate the changed element's whole subtree (CONVENTIONS §6). */
70
- :where([data-ui~="divide-x"]) > :where(:not(:last-child)) {
71
- border-inline-end-width: var(--_divide-w, 1px);
72
- border-inline-end-style: solid;
73
- border-inline-end-color: var(--_divide-c, var(--color-border));
74
- }
75
-
76
- :where([data-ui~="divide-y"]) > :where(:not(:last-child)) {
77
- border-block-end-width: var(--_divide-w, 1px);
78
- border-block-end-style: solid;
79
- border-block-end-color: var(--_divide-c, var(--color-border));
80
- }
81
-
82
- /* Tailwind's looping animations, on the kit's transition easing (applied to
83
- each keyframe segment). They animate `transform`, so the `--rotate`,
84
- `--scale`, and `--translate` utilities still compose with them; reduced
85
- motion stops them, like every looping animation in the kit. */
86
- @media (prefers-reduced-motion: no-preference) {
87
- :where([data-ui~="spin"]) {
88
- animation: ui-spin 1s var(--default-transition-timing-function) infinite;
89
- }
90
-
91
- :where([data-ui~="ping"]) {
92
- animation: ui-ping 1s var(--default-transition-timing-function) infinite;
93
- }
94
-
95
- :where([data-ui~="pulse"]) {
96
- animation: ui-pulse 2s var(--default-transition-timing-function) infinite;
97
- }
98
-
99
- :where([data-ui~="bounce"]) {
100
- animation: ui-bounce 1s var(--default-transition-timing-function) infinite;
101
- }
102
- }
103
-
104
- @keyframes ui-spin {
105
- to {
106
- transform: rotate(360deg);
107
- }
108
- }
109
-
110
- @keyframes ui-ping {
111
- 75%,
112
- 100% {
113
- transform: scale(2);
114
- opacity: 0;
115
- }
116
- }
117
-
118
- @keyframes ui-pulse {
119
- 50% {
120
- opacity: 0.5;
121
- }
122
- }
123
-
124
- @keyframes ui-bounce {
125
- 0%,
126
- 100% {
127
- transform: translateY(-25%);
128
- }
129
-
130
- 50% {
131
- transform: none;
132
- }
133
- }
134
-
135
- /* inline-size containment: its width cannot come from its content, so it
136
- needs a definite or stretched width (a block, grid or flex item, a cell) */
137
- :where([data-ui~="container"]) {
138
- container-type: inline-size;
139
- }
140
-
141
- /* a sticky container is also the stuck state's scroll-state container
142
- (_utilities-tier-stuck.css); this file loads after it, so keep both */
143
- @supports (container-type: scroll-state) {
144
- :where([data-ui~="container"]:is([style*=": sticky"], [style*="--stuck-state:"])) {
145
- container-type: inline-size scroll-state;
146
- }
147
- }
148
- }