@womp/kookie-ui 0.25.2 → 0.26.1

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 (151) hide show
  1. package/components.css +225 -529
  2. package/dist/cjs/components/_internal/base-checkbox.props.d.ts +0 -6
  3. package/dist/cjs/components/_internal/base-checkbox.props.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/base-checkbox.props.js +1 -1
  5. package/dist/cjs/components/_internal/base-checkbox.props.js.map +3 -3
  6. package/dist/cjs/components/_internal/base-radio.props.d.ts +0 -6
  7. package/dist/cjs/components/_internal/base-radio.props.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/base-radio.props.js +1 -1
  9. package/dist/cjs/components/_internal/base-radio.props.js.map +3 -3
  10. package/dist/cjs/components/checkbox-group.d.ts.map +1 -1
  11. package/dist/cjs/components/checkbox-group.js +1 -1
  12. package/dist/cjs/components/checkbox-group.js.map +3 -3
  13. package/dist/cjs/components/checkbox-group.props.d.ts +0 -6
  14. package/dist/cjs/components/checkbox-group.props.d.ts.map +1 -1
  15. package/dist/cjs/components/checkbox-group.props.js +1 -1
  16. package/dist/cjs/components/checkbox-group.props.js.map +3 -3
  17. package/dist/cjs/components/checkbox.js +1 -1
  18. package/dist/cjs/components/checkbox.js.map +3 -3
  19. package/dist/cjs/components/checkbox.props.js +1 -1
  20. package/dist/cjs/components/checkbox.props.js.map +3 -3
  21. package/dist/cjs/components/index.js +2 -2
  22. package/dist/cjs/components/index.js.map +4 -4
  23. package/dist/cjs/components/radio-group.d.ts.map +1 -1
  24. package/dist/cjs/components/radio-group.js +1 -1
  25. package/dist/cjs/components/radio-group.js.map +4 -4
  26. package/dist/cjs/components/radio-group.props.d.ts +0 -6
  27. package/dist/cjs/components/radio-group.props.d.ts.map +1 -1
  28. package/dist/cjs/components/radio-group.props.js +1 -1
  29. package/dist/cjs/components/radio-group.props.js.map +4 -4
  30. package/dist/cjs/components/radio.js +1 -1
  31. package/dist/cjs/components/radio.js.map +3 -3
  32. package/dist/cjs/components/radio.props.js +1 -1
  33. package/dist/cjs/components/radio.props.js.map +3 -3
  34. package/dist/cjs/components/slider.js +1 -1
  35. package/dist/cjs/components/slider.js.map +3 -3
  36. package/dist/cjs/components/slider.props.d.ts +0 -6
  37. package/dist/cjs/components/slider.props.d.ts.map +1 -1
  38. package/dist/cjs/components/slider.props.js +1 -1
  39. package/dist/cjs/components/slider.props.js.map +3 -3
  40. package/dist/cjs/components/switch.js +1 -1
  41. package/dist/cjs/components/switch.js.map +3 -3
  42. package/dist/cjs/components/switch.props.d.ts +0 -6
  43. package/dist/cjs/components/switch.props.d.ts.map +1 -1
  44. package/dist/cjs/components/switch.props.js +1 -1
  45. package/dist/cjs/components/switch.props.js.map +3 -3
  46. package/dist/cjs/index.js +4 -4
  47. package/dist/cjs/index.js.map +4 -4
  48. package/dist/esm/chunk-37GC4A2O.js +3 -0
  49. package/dist/esm/chunk-37GC4A2O.js.map +7 -0
  50. package/dist/esm/chunk-4S5L25RO.js +3 -0
  51. package/dist/esm/chunk-4S5L25RO.js.map +7 -0
  52. package/dist/esm/chunk-6BB2A6VU.js +3 -0
  53. package/dist/esm/chunk-6BB2A6VU.js.map +7 -0
  54. package/dist/esm/chunk-CBWERXF4.js +3 -0
  55. package/dist/esm/chunk-CBWERXF4.js.map +7 -0
  56. package/dist/esm/{chunk-XPVRXQSW.js → chunk-FCKJD2PW.js} +2 -2
  57. package/dist/esm/chunk-HV7USGHD.js +3 -0
  58. package/dist/esm/chunk-HV7USGHD.js.map +7 -0
  59. package/dist/esm/chunk-IE5ACUZS.js +3 -0
  60. package/dist/esm/{chunk-ZDSY6CJL.js → chunk-JS23YQ4M.js} +2 -2
  61. package/dist/esm/chunk-M3NI3D6R.js +3 -0
  62. package/dist/esm/chunk-M3NI3D6R.js.map +7 -0
  63. package/dist/esm/{chunk-PZZJH2LR.js → chunk-NZCAGHCL.js} +2 -2
  64. package/dist/esm/chunk-R7THBMND.js +3 -0
  65. package/dist/esm/chunk-R7THBMND.js.map +7 -0
  66. package/dist/esm/{chunk-3CY6H4TE.js → chunk-YDBFIJHB.js} +2 -2
  67. package/dist/esm/components/_internal/base-checkbox.props.d.ts +0 -6
  68. package/dist/esm/components/_internal/base-checkbox.props.d.ts.map +1 -1
  69. package/dist/esm/components/_internal/base-checkbox.props.js +1 -1
  70. package/dist/esm/components/_internal/base-radio.props.d.ts +0 -6
  71. package/dist/esm/components/_internal/base-radio.props.d.ts.map +1 -1
  72. package/dist/esm/components/_internal/base-radio.props.js +1 -1
  73. package/dist/esm/components/checkbox-group.d.ts.map +1 -1
  74. package/dist/esm/components/checkbox-group.js +1 -1
  75. package/dist/esm/components/checkbox-group.props.d.ts +0 -6
  76. package/dist/esm/components/checkbox-group.props.d.ts.map +1 -1
  77. package/dist/esm/components/checkbox-group.props.js +1 -1
  78. package/dist/esm/components/checkbox.js +1 -1
  79. package/dist/esm/components/checkbox.props.js +1 -1
  80. package/dist/esm/components/index.js +1 -1
  81. package/dist/esm/components/radio-group.d.ts.map +1 -1
  82. package/dist/esm/components/radio-group.js +1 -1
  83. package/dist/esm/components/radio-group.props.d.ts +0 -6
  84. package/dist/esm/components/radio-group.props.d.ts.map +1 -1
  85. package/dist/esm/components/radio-group.props.js +1 -1
  86. package/dist/esm/components/radio.js +1 -1
  87. package/dist/esm/components/radio.props.js +1 -1
  88. package/dist/esm/components/slider.js +1 -1
  89. package/dist/esm/components/slider.props.d.ts +0 -6
  90. package/dist/esm/components/slider.props.d.ts.map +1 -1
  91. package/dist/esm/components/slider.props.js +1 -1
  92. package/dist/esm/components/switch.js +1 -1
  93. package/dist/esm/components/switch.props.d.ts +0 -6
  94. package/dist/esm/components/switch.props.d.ts.map +1 -1
  95. package/dist/esm/components/switch.props.js +1 -1
  96. package/dist/esm/index.js +1 -1
  97. package/package.json +1 -1
  98. package/src/components/_internal/base-button.css +14 -6
  99. package/src/components/_internal/base-card.css +2 -2
  100. package/src/components/_internal/base-checkbox.css +39 -199
  101. package/src/components/_internal/base-checkbox.props.ts +0 -3
  102. package/src/components/_internal/base-dialog.css +1 -1
  103. package/src/components/_internal/base-menu.css +3 -2
  104. package/src/components/_internal/base-radio.css +38 -173
  105. package/src/components/_internal/base-radio.props.ts +0 -3
  106. package/src/components/accordion.css +2 -2
  107. package/src/components/avatar.css +2 -2
  108. package/src/components/chatbar.css +3 -4
  109. package/src/components/checkbox-group.css +1 -1
  110. package/src/components/checkbox-group.tsx +0 -2
  111. package/src/components/checkbox.css +1 -1
  112. package/src/components/chip.css +1 -1
  113. package/src/components/popover.css +1 -1
  114. package/src/components/radio-group.props.tsx +0 -5
  115. package/src/components/radio-group.tsx +0 -2
  116. package/src/components/segmented-control.css +4 -1
  117. package/src/components/select.css +14 -31
  118. package/src/components/shell.css +16 -16
  119. package/src/components/sidebar.css +10 -0
  120. package/src/components/slider.css +9 -40
  121. package/src/components/slider.props.tsx +0 -3
  122. package/src/components/switch.css +11 -52
  123. package/src/components/switch.props.tsx +0 -3
  124. package/src/components/text-area.css +16 -31
  125. package/src/components/text-field.css +16 -32
  126. package/src/components/toolbar.css +14 -1
  127. package/src/styles/tokens/color.css +31 -2
  128. package/src/styles/tokens/shadow.css +50 -122
  129. package/styles.css +270 -563
  130. package/tokens/base.css +45 -34
  131. package/tokens.css +45 -34
  132. package/dist/esm/chunk-2Z2I27ZS.js +0 -3
  133. package/dist/esm/chunk-2Z2I27ZS.js.map +0 -7
  134. package/dist/esm/chunk-AZHSPPBV.js +0 -3
  135. package/dist/esm/chunk-AZHSPPBV.js.map +0 -7
  136. package/dist/esm/chunk-BMKUGZ4I.js +0 -3
  137. package/dist/esm/chunk-FFJE25TJ.js +0 -3
  138. package/dist/esm/chunk-FFJE25TJ.js.map +0 -7
  139. package/dist/esm/chunk-FM3GBCX5.js +0 -3
  140. package/dist/esm/chunk-FM3GBCX5.js.map +0 -7
  141. package/dist/esm/chunk-N5H7C3PZ.js +0 -3
  142. package/dist/esm/chunk-N5H7C3PZ.js.map +0 -7
  143. package/dist/esm/chunk-RB5VHWAW.js +0 -3
  144. package/dist/esm/chunk-RB5VHWAW.js.map +0 -7
  145. package/dist/esm/chunk-ZFDHZEWN.js +0 -3
  146. package/dist/esm/chunk-ZFDHZEWN.js.map +0 -7
  147. /package/dist/esm/{chunk-XPVRXQSW.js.map → chunk-FCKJD2PW.js.map} +0 -0
  148. /package/dist/esm/{chunk-BMKUGZ4I.js.map → chunk-IE5ACUZS.js.map} +0 -0
  149. /package/dist/esm/{chunk-ZDSY6CJL.js.map → chunk-JS23YQ4M.js.map} +0 -0
  150. /package/dist/esm/{chunk-PZZJH2LR.js.map → chunk-NZCAGHCL.js.map} +0 -0
  151. /package/dist/esm/{chunk-3CY6H4TE.js.map → chunk-YDBFIJHB.js.map} +0 -0
@@ -217,7 +217,7 @@
217
217
  --v-bg-active-a: var(--accent-a5);
218
218
  --v-bg-pressed: var(--accent-5);
219
219
  --v-bg-pressed-a: var(--accent-a5);
220
- --v-shadow-hover: var(--shadow-2);
220
+ --v-shadow-hover: var(--control-chrome);
221
221
  }
222
222
 
223
223
  /* Ghost variant palette */
@@ -311,7 +311,9 @@
311
311
  /* Active state */
312
312
  &:where(:active:not([data-state='open'], [data-disabled], [aria-disabled='true'])) {
313
313
  background-color: var(--v-bg-active);
314
- box-shadow: var(--shadow-1);
314
+ /* A pressed soft or ghost button darkens its fill and casts nothing. Outline and surface
315
+ keep their edge through their own rules. */
316
+ box-shadow: none;
315
317
  }
316
318
 
317
319
  /* Pressed state (toggle on) */
@@ -369,12 +371,13 @@
369
371
  position: relative;
370
372
  color: var(--accent-ink);
371
373
  background-color: var(--color-surface);
372
- box-shadow: var(--shadow-2);
374
+ background-image: var(--control-light);
375
+ box-shadow: var(--control-chrome);
373
376
 
374
377
  @media (hover: hover) {
375
378
  &:where(:hover:not([data-disabled], [aria-disabled='true'])) {
376
379
  background-color: var(--neutral-2);
377
- box-shadow: var(--shadow-2);
380
+ box-shadow: var(--control-chrome);
378
381
  }
379
382
  }
380
383
 
@@ -382,7 +385,7 @@
382
385
  &:where(:active:not([data-state='open'], [data-disabled], [aria-disabled='true'])),
383
386
  &:where([data-state='on']:not([data-disabled], [aria-disabled='true'])) {
384
387
  background-color: var(--neutral-3);
385
- box-shadow: var(--shadow-1);
388
+ box-shadow: var(--control-chrome-active);
386
389
  }
387
390
 
388
391
  @media (pointer: coarse) {
@@ -395,6 +398,7 @@
395
398
  &:where([data-disabled], [aria-disabled='true']) {
396
399
  color: var(--neutral-a8);
397
400
  background-color: var(--neutral-a3);
401
+ background-image: none;
398
402
  box-shadow: none;
399
403
  top: 0;
400
404
  }
@@ -404,13 +408,15 @@
404
408
  (gray resolves the three to step 12 and the filters carry the change) */
405
409
  .kui-BaseButton:where(.kui-variant-solid) {
406
410
  background-color: var(--accent-solid);
411
+ background-image: var(--control-light);
407
412
  color: var(--accent-solid-contrast);
413
+ box-shadow: var(--control-chrome);
408
414
 
409
415
  @media (hover: hover) {
410
416
  &:where(:hover:not([data-disabled], [aria-disabled='true'])) {
411
417
  background-color: var(--accent-solid-hover);
412
418
  filter: var(--accent-solid-hover-filter);
413
- box-shadow: var(--shadow-2);
419
+ box-shadow: var(--control-chrome);
414
420
  }
415
421
  }
416
422
 
@@ -422,6 +428,7 @@
422
428
  &:where(:active:not([data-state='open'], [data-disabled], [aria-disabled='true'])) {
423
429
  background-color: var(--accent-solid-active);
424
430
  filter: var(--accent-solid-active-filter);
431
+ box-shadow: var(--control-chrome-active);
425
432
  }
426
433
 
427
434
  &:where([data-state='on']) {
@@ -439,6 +446,7 @@
439
446
  &:where([data-disabled], [aria-disabled='true']) {
440
447
  color: var(--neutral-a8);
441
448
  background-color: var(--neutral-a3);
449
+ background-image: none;
442
450
  box-shadow: none;
443
451
  filter: none;
444
452
  opacity: 1;
@@ -327,7 +327,7 @@
327
327
  --card-background-color: var(--color-surface);
328
328
  position: relative;
329
329
  top: var(--raised-elevation-offset);
330
- box-shadow: var(--shadow-2);
330
+ box-shadow: var(--surface-chrome);
331
331
 
332
332
  &::before {
333
333
  background-color: var(--card-background-color);
@@ -345,7 +345,7 @@
345
345
  &:where(:any-link, button, label) {
346
346
  @media (hover: hover) {
347
347
  &:where(:hover) {
348
- box-shadow: var(--shadow-2);
348
+ box-shadow: var(--surface-chrome);
349
349
 
350
350
  &::before {
351
351
  background-color: var(--neutral-2);
@@ -88,226 +88,66 @@
88
88
 
89
89
  /***************************************************************************************************
90
90
  * *
91
- * VARIANTS *
91
+ * THE LOOK *
92
+ * *
93
+ * One look, as in v2. Unchecked, the box is a soft fill with a hairline edge. Checked, it is the *
94
+ * accent solid, the edge melts into the fill, and the glyph takes the solid's contrast colour. *
95
+ * Hover is one step darker, press two. Disabled marks take neither. *
92
96
  * *
93
97
  ***************************************************************************************************/
94
98
 
95
- /* solid */
96
-
97
- .kui-BaseCheckboxRoot:where(.kui-variant-solid) {
98
- &:where([data-state='unchecked']) {
99
- &::before {
100
- background-color: transparent;
101
- box-shadow: inset 0 0 0 1px var(--accent-9);
102
- }
103
- }
99
+ .kui-BaseCheckboxRoot {
100
+ --checkbox-fill: var(--color-mark);
101
+ --checkbox-fill-hover: var(--color-mark-hover);
102
+ --checkbox-fill-active: var(--color-mark-active);
103
+ --checkbox-edge: var(--color-mark-edge);
104
+ --checkbox-glyph: var(--accent-solid-contrast);
104
105
 
105
106
  &:where([data-state='checked'], [data-state='indeterminate']) {
106
- &::before {
107
- background-color: var(--accent-solid);
108
- box-shadow: inset 0 0 0 1px var(--accent-solid);
109
- }
110
- & :where(.kui-BaseCheckboxIndicator) {
111
- color: var(--accent-solid-contrast);
112
- }
107
+ --checkbox-fill: var(--accent-solid);
108
+ --checkbox-fill-hover: var(--accent-solid-hover);
109
+ --checkbox-fill-active: var(--accent-solid-active);
110
+ --checkbox-edge: transparent;
113
111
  }
114
112
 
115
- &:where(:disabled) {
116
- &::before {
117
- box-shadow: inset 0 0 0 1px var(--neutral-a6);
118
- background-color: var(--neutral-a3);
119
- }
120
- & :where(.kui-BaseCheckboxIndicator) {
121
- color: var(--neutral-a8);
122
- }
123
- }
124
- }
125
-
126
- /* raised */
127
-
128
- .kui-BaseCheckboxRoot:where(.kui-variant-raised) {
129
- position: relative;
130
- top: var(--raised-elevation-offset);
131
-
132
- &:where([data-state='unchecked']) {
133
- &::before {
134
- color: var(--accent-ink);
135
- background-color: var(--color-surface);
136
- box-shadow: var(--shadow-2);
137
- }
138
- }
139
-
140
- &:where([data-state='checked'], [data-state='indeterminate']) {
141
- &::before {
142
- background-color: var(--accent-3);
143
- }
144
- & :where(.kui-BaseCheckboxIndicator) {
145
- color: var(--accent-ink);
146
- }
113
+ /* Invalid, keyed on aria-invalid: unchecked, only the edge turns red; checked, the box takes
114
+ * the red wash and the glyph the red ink, rather than a red solid. */
115
+ &:where([aria-invalid='true']) {
116
+ --checkbox-edge: var(--red-8);
147
117
  }
148
-
149
- &:where(:active:not(:disabled)) {
150
- top: calc(var(--raised-elevation-offset) + var(--raised-active-padding-offset-1));
151
-
152
- &::before {
153
- background-color: var(--accent-3);
154
- }
118
+ &:where([aria-invalid='true']):where([data-state='checked'], [data-state='indeterminate']) {
119
+ --checkbox-fill: var(--red-3);
120
+ --checkbox-fill-hover: var(--red-4);
121
+ --checkbox-fill-active: var(--red-5);
122
+ --checkbox-edge: var(--red-8);
123
+ --checkbox-glyph: var(--red-11);
155
124
  }
156
125
 
157
- &:where(:disabled) {
158
- &::before {
159
- background-color: var(--neutral-a3);
160
- box-shadow: none;
161
- background-image: none;
162
- }
163
- & :where(.kui-BaseCheckboxIndicator) {
164
- color: var(--neutral-a8);
165
- }
166
- top: 0;
126
+ /* Disabled is a colour remap, never opacity. Dead outranks wrong, so this comes last. */
127
+ &:where(:disabled, [data-disabled]) {
128
+ --checkbox-fill: var(--neutral-a3);
129
+ --checkbox-fill-hover: var(--neutral-a3);
130
+ --checkbox-fill-active: var(--neutral-a3);
131
+ --checkbox-edge: var(--neutral-a6);
132
+ --checkbox-glyph: var(--neutral-a8);
167
133
  }
168
- }
169
-
170
- /* soft */
171
134
 
172
- .kui-BaseCheckboxRoot:where(.kui-variant-soft) {
173
135
  &::before {
174
- background-color: var(--accent-3);
175
- }
176
-
177
- &:where([data-state='checked'], [data-state='indeterminate']) {
178
- & :where(.kui-BaseCheckboxIndicator) {
179
- color: var(--accent-ink);
180
- }
181
- }
182
-
183
- &:where(:disabled) {
184
- &::before {
185
- background-color: var(--neutral-a3);
186
- }
187
- & :where(.kui-BaseCheckboxIndicator) {
188
- color: var(--neutral-a8);
189
- }
190
- }
191
- }
192
-
193
- /* outline */
194
-
195
- .kui-BaseCheckboxRoot:where(.kui-variant-outline) {
196
- &:where([data-state='unchecked']) {
197
- &::before {
198
- box-shadow: inset 0 0 0 1px var(--accent-6);
199
- color: var(--accent-ink);
200
- }
136
+ background-color: var(--checkbox-fill);
137
+ box-shadow: inset 0 0 0 1px var(--checkbox-edge);
201
138
  }
202
139
 
203
- &:where([data-state='checked'], [data-state='indeterminate']) {
204
- &::before {
205
- background-color: var(--accent-2);
206
- box-shadow: inset 0 0 0 1px var(--accent-7);
207
- }
208
- & :where(.kui-BaseCheckboxIndicator) {
209
- color: var(--accent-ink);
210
- }
211
- }
212
-
213
- &:where(:disabled) {
214
- &::before {
215
- box-shadow: inset 0 0 0 1px var(--neutral-a7);
216
- background-color: transparent;
217
- }
218
- & :where(.kui-BaseCheckboxIndicator) {
219
- color: var(--neutral-a8);
220
- }
221
- }
222
- }
223
-
224
- /* surface */
225
-
226
- .kui-BaseCheckboxRoot:where(.kui-variant-surface) {
227
- &:where([data-state='unchecked']) {
228
- &::before {
229
- background-color: var(--accent-2);
230
- box-shadow: inset 0 0 0 1px var(--accent-6);
231
- }
232
- }
233
-
234
- &:where([data-state='checked'], [data-state='indeterminate']) {
235
- &::before {
236
- background-color: var(--accent-3);
237
- box-shadow: inset 0 0 0 1px var(--accent-8);
238
- }
239
- & :where(.kui-BaseCheckboxIndicator) {
240
- color: var(--accent-ink);
241
- }
242
- }
243
-
244
- &:where(:disabled) {
245
- &::before {
246
- box-shadow: inset 0 0 0 1px var(--neutral-a6);
247
- background-color: var(--neutral-a2);
248
- }
249
- & :where(.kui-BaseCheckboxIndicator) {
250
- color: var(--neutral-a8);
251
- }
252
- }
253
- }
254
-
255
- /***************************************************************************************************
256
- * *
257
- * INTERACTION *
258
- * *
259
- * Hover is one step up the variant's own ramp, press two. Disabled marks take neither. *
260
- * *
261
- ***************************************************************************************************/
262
-
263
- .kui-BaseCheckboxRoot {
264
- --checkbox-unchecked-hover: var(--accent-a2);
265
- --checkbox-unchecked-active: var(--accent-a3);
266
- --checkbox-checked-hover: var(--accent-4);
267
- --checkbox-checked-active: var(--accent-5);
268
-
269
- &:where(.kui-variant-solid) {
270
- --checkbox-checked-hover: var(--accent-solid-hover);
271
- --checkbox-checked-active: var(--accent-solid-active);
272
- }
273
- &:where(.kui-variant-raised) {
274
- --checkbox-unchecked-hover: var(--color-surface);
275
- --checkbox-unchecked-active: var(--accent-3);
276
- }
277
- &:where(.kui-variant-soft) {
278
- --checkbox-unchecked-hover: var(--accent-4);
279
- --checkbox-unchecked-active: var(--accent-5);
280
- }
281
- &:where(.kui-variant-outline) {
282
- --checkbox-checked-hover: var(--accent-3);
283
- --checkbox-checked-active: var(--accent-4);
284
- }
285
- &:where(.kui-variant-surface) {
286
- --checkbox-unchecked-hover: var(--accent-3);
287
- --checkbox-unchecked-active: var(--accent-4);
140
+ & :where(.kui-BaseCheckboxIndicator) {
141
+ color: var(--checkbox-glyph);
288
142
  }
289
143
 
290
144
  @media (hover: hover) {
291
145
  &:where(:hover:not(:disabled, [data-disabled]))::before {
292
- background-color: var(--checkbox-unchecked-hover);
293
- }
294
- &:where(:hover:not(:disabled, [data-disabled])):where([data-state='checked'], [data-state='indeterminate'])::before {
295
- background-color: var(--checkbox-checked-hover);
146
+ background-color: var(--checkbox-fill-hover);
296
147
  }
297
148
  }
298
149
  &:where(:active:not(:disabled, [data-disabled]))::before {
299
- background-color: var(--checkbox-unchecked-active);
300
- }
301
- &:where(:active:not(:disabled, [data-disabled])):where([data-state='checked'], [data-state='indeterminate'])::before {
302
- background-color: var(--checkbox-checked-active);
303
- }
304
- &:where(.kui-variant-solid:active:not(:disabled, [data-disabled])):where([data-state='checked'], [data-state='indeterminate'])::before {
305
- box-shadow: inset 0 0 0 1px var(--checkbox-checked-active);
306
- }
307
- @media (hover: hover) {
308
- &:where(.kui-variant-solid:hover:not(:disabled, [data-disabled])):where([data-state='checked'], [data-state='indeterminate'])::before {
309
- box-shadow: inset 0 0 0 1px var(--checkbox-checked-hover);
310
- }
150
+ background-color: var(--checkbox-fill-active);
311
151
  }
312
152
  }
313
153
 
@@ -319,7 +159,7 @@
319
159
 
320
160
  /* The focus ring lives on Checkbox and CheckboxGroup. */
321
161
  .kui-BaseCheckboxRoot {
322
- /* Disabled is a colour remap (per variant above), never opacity; the cursor stays default. */
162
+ /* Disabled is a colour remap (above), never opacity; the cursor stays default. */
323
163
  &:where(:disabled, [data-disabled]) {
324
164
  cursor: default;
325
165
  }
@@ -3,15 +3,12 @@ import { colorPropDef } from '../../props/color.prop.js';
3
3
  import type { PropDef } from '../../props/prop-def.js';
4
4
 
5
5
  const sizes = ['1', '2', '3', '4'] as const;
6
- const variants = ['raised', 'solid', 'soft', 'outline', 'surface'] as const;
7
6
 
8
7
  const baseCheckboxPropDefs = {
9
8
  size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },
10
- variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },
11
9
  ...colorPropDef,
12
10
  } satisfies {
13
11
  size: PropDef<(typeof sizes)[number]>;
14
- variant: PropDef<(typeof variants)[number]>;
15
12
  };
16
13
 
17
14
  export { baseCheckboxPropDefs };
@@ -50,7 +50,7 @@
50
50
  box-sizing: border-box;
51
51
 
52
52
  background-color: var(--color-surface);
53
- box-shadow: var(--shadow-6);
53
+ box-shadow: var(--dialog-chrome);
54
54
  outline: none;
55
55
  }
56
56
 
@@ -11,7 +11,7 @@
11
11
  z-index: 200; /* Above dialogs (100) so menus inside dialogs/sheets work */
12
12
 
13
13
  background-color: var(--color-surface);
14
- box-shadow: var(--shadow-5);
14
+ box-shadow: var(--floating-chrome);
15
15
 
16
16
  /* Limit paint scope to the menu */
17
17
  contain: paint;
@@ -351,7 +351,8 @@
351
351
  outline-offset: 2px;
352
352
  }
353
353
 
354
- .kui-BaseMenuContent {
354
+ /* A floating menu needs an edge; a sidebar's menu sits in a pane that already has one. */
355
+ .kui-BaseMenuContent:not(:where(.kui-SidebarContent)) {
355
356
  border: 1px solid CanvasText;
356
357
  }
357
358
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  isolation: isolate;
14
14
 
15
- /* Disabled is a colour remap (per variant below), never opacity; the cursor stays default. */
15
+ /* Disabled is a colour remap (below), never opacity; the cursor stays default. */
16
16
  &:where(:disabled, [data-disabled]) {
17
17
  cursor: default;
18
18
  }
@@ -73,201 +73,66 @@
73
73
 
74
74
  /***************************************************************************************************
75
75
  * *
76
- * VARIANTS *
76
+ * THE LOOK *
77
+ * *
78
+ * One look, as in v2, and the same as Checkbox. Unchecked, the circle is a soft fill with a *
79
+ * hairline edge. Checked, it is the accent solid, the edge melts into the fill, and the dot takes *
80
+ * the solid's contrast colour. Hover is one step darker, press two. Disabled marks take neither. *
77
81
  * *
78
82
  ***************************************************************************************************/
79
83
 
80
- /* solid */
81
-
82
- .kui-BaseRadioRoot:where(.kui-variant-solid) {
83
- &:where(:not(:checked), [data-state='unchecked'])::before {
84
- background-color: transparent;
85
- box-shadow: inset 0 0 0 1px var(--accent-9);
86
- }
87
- &:where(:checked, [data-state='checked'])::before {
88
- background-color: var(--accent-solid);
89
- box-shadow: inset 0 0 0 1px var(--accent-solid);
90
- }
91
- &::after {
92
- background-color: var(--accent-solid-contrast);
93
- }
94
-
95
- &:where(:disabled, [data-disabled])::before {
96
- box-shadow: inset 0 0 0 1px var(--neutral-a6);
97
- background-color: var(--neutral-a3);
98
- }
99
- &:where(:disabled, [data-disabled])::after {
100
- background-color: var(--neutral-a8);
101
- }
102
- }
103
-
104
- /* raised */
105
-
106
- .kui-BaseRadioRoot:where(.kui-variant-raised) {
107
- position: relative;
108
- top: var(--raised-elevation-offset);
84
+ .kui-BaseRadioRoot {
85
+ --radio-fill: var(--color-mark);
86
+ --radio-fill-hover: var(--color-mark-hover);
87
+ --radio-fill-active: var(--color-mark-active);
88
+ --radio-edge: var(--color-mark-edge);
89
+ --radio-dot: var(--accent-solid-contrast);
109
90
 
110
- &:where(:not(:checked), [data-state='unchecked'])::before {
111
- color: var(--accent-ink);
112
- background-color: var(--color-surface);
113
- box-shadow: var(--shadow-2);
91
+ &:where(:checked, [data-state='checked']) {
92
+ --radio-fill: var(--accent-solid);
93
+ --radio-fill-hover: var(--accent-solid-hover);
94
+ --radio-fill-active: var(--accent-solid-active);
95
+ --radio-edge: transparent;
114
96
  }
115
97
 
116
- &:where(:checked, [data-state='checked'])::before {
117
- background-color: var(--accent-3);
98
+ /* Invalid, keyed on aria-invalid: unchecked, only the edge turns red; checked, the circle takes
99
+ * the red wash and the dot the red ink, rather than a red solid. */
100
+ &:where([aria-invalid='true']) {
101
+ --radio-edge: var(--red-8);
118
102
  }
119
- &::after {
120
- background-color: var(--accent-ink);
103
+ &:where([aria-invalid='true']):where(:checked, [data-state='checked']) {
104
+ --radio-fill: var(--red-3);
105
+ --radio-fill-hover: var(--red-4);
106
+ --radio-fill-active: var(--red-5);
107
+ --radio-edge: var(--red-8);
108
+ --radio-dot: var(--red-11);
121
109
  }
122
110
 
123
- &:where(:active:not(:disabled, [data-disabled])) {
124
- top: calc(var(--raised-elevation-offset) + var(--raised-active-padding-offset-1));
125
-
126
- &::before {
127
- background-color: var(--accent-3);
128
- }
129
- }
130
-
131
- &:where(:disabled, [data-disabled])::before {
132
- background-color: var(--neutral-a3);
133
- box-shadow: none;
134
- background-image: none;
135
- }
136
- &:where(:disabled, [data-disabled])::after {
137
- background-color: var(--neutral-a8);
138
- }
111
+ /* Disabled is a colour remap, never opacity. Dead outranks wrong, so this comes last. */
139
112
  &:where(:disabled, [data-disabled]) {
140
- top: 0;
113
+ --radio-fill: var(--neutral-a3);
114
+ --radio-fill-hover: var(--neutral-a3);
115
+ --radio-fill-active: var(--neutral-a3);
116
+ --radio-edge: var(--neutral-a6);
117
+ --radio-dot: var(--neutral-a8);
141
118
  }
142
- }
143
119
 
144
- /* soft */
145
-
146
- .kui-BaseRadioRoot:where(.kui-variant-soft) {
147
120
  &::before {
148
- background-color: var(--accent-3);
149
- }
150
- &::after {
151
- background-color: var(--accent-ink);
152
- }
153
-
154
- &:where(:focus-visible)::before {
155
- /* Use gray outline when component color is gray */
156
- outline-color: var(--accent-a8);
157
- }
158
-
159
- &:where(:disabled, [data-disabled])::before {
160
- background-color: var(--neutral-a3);
161
- }
162
- &:where(:disabled, [data-disabled])::after {
163
- background-color: var(--neutral-a8);
164
- }
165
- }
166
-
167
- /* outline */
168
-
169
- .kui-BaseRadioRoot:where(.kui-variant-outline) {
170
- &:where(:not(:checked), [data-state='unchecked'])::before {
171
- box-shadow: inset 0 0 0 1px var(--accent-6);
172
- color: var(--accent-ink);
173
- }
174
-
175
- &:where(:checked, [data-state='checked'])::before {
176
- background-color: var(--accent-2);
177
- box-shadow: inset 0 0 0 1px var(--accent-7);
178
- }
179
- &::after {
180
- background-color: var(--accent-ink);
181
- }
182
-
183
- &:where(:disabled, [data-disabled])::before {
184
- box-shadow: inset 0 0 0 1px var(--neutral-a7);
185
- background-color: transparent;
186
- }
187
- &:where(:disabled, [data-disabled])::after {
188
- background-color: var(--neutral-a8);
189
- }
190
- }
191
-
192
- /* surface */
193
-
194
- .kui-BaseRadioRoot:where(.kui-variant-surface) {
195
- &:where(:not(:checked), [data-state='unchecked'])::before {
196
- background-color: var(--accent-2);
197
- box-shadow: inset 0 0 0 1px var(--accent-6);
121
+ background-color: var(--radio-fill);
122
+ box-shadow: inset 0 0 0 1px var(--radio-edge);
198
123
  }
199
124
 
200
- &:where(:checked, [data-state='checked'])::before {
201
- background-color: var(--accent-3);
202
- box-shadow: inset 0 0 0 1px var(--accent-8);
203
- }
204
125
  &::after {
205
- background-color: var(--accent-ink);
206
- }
207
-
208
- &:where(:disabled, [data-disabled])::before {
209
- box-shadow: inset 0 0 0 1px var(--neutral-a6);
210
- background-color: var(--neutral-a2);
211
- }
212
- &:where(:disabled, [data-disabled])::after {
213
- background-color: var(--neutral-a8);
214
- }
215
- }
216
-
217
- /***************************************************************************************************
218
- * *
219
- * INTERACTION *
220
- * *
221
- * Hover is one step up the variant's own ramp, press two. Disabled marks take neither. *
222
- * *
223
- ***************************************************************************************************/
224
-
225
- .kui-BaseRadioRoot {
226
- --radio-unchecked-hover: var(--accent-a2);
227
- --radio-unchecked-active: var(--accent-a3);
228
- --radio-checked-hover: var(--accent-4);
229
- --radio-checked-active: var(--accent-5);
230
-
231
- &:where(.kui-variant-solid) {
232
- --radio-checked-hover: var(--accent-solid-hover);
233
- --radio-checked-active: var(--accent-solid-active);
234
- }
235
- &:where(.kui-variant-raised) {
236
- --radio-unchecked-hover: var(--color-surface);
237
- --radio-unchecked-active: var(--accent-3);
238
- }
239
- &:where(.kui-variant-soft) {
240
- --radio-unchecked-hover: var(--accent-4);
241
- --radio-unchecked-active: var(--accent-5);
242
- }
243
- &:where(.kui-variant-outline) {
244
- --radio-checked-hover: var(--accent-3);
245
- --radio-checked-active: var(--accent-4);
246
- }
247
- &:where(.kui-variant-surface) {
248
- --radio-unchecked-hover: var(--accent-3);
249
- --radio-unchecked-active: var(--accent-4);
126
+ background-color: var(--radio-dot);
250
127
  }
251
128
 
252
129
  @media (hover: hover) {
253
130
  &:where(:hover:not(:disabled, [data-disabled]))::before {
254
- background-color: var(--radio-unchecked-hover);
255
- }
256
- &:where(:hover:not(:disabled, [data-disabled])):where(:checked, [data-state='checked'])::before {
257
- background-color: var(--radio-checked-hover);
258
- }
259
- &:where(.kui-variant-solid:hover:not(:disabled, [data-disabled])):where(:checked, [data-state='checked'])::before {
260
- box-shadow: inset 0 0 0 1px var(--radio-checked-hover);
131
+ background-color: var(--radio-fill-hover);
261
132
  }
262
133
  }
263
134
  &:where(:active:not(:disabled, [data-disabled]))::before {
264
- background-color: var(--radio-unchecked-active);
265
- }
266
- &:where(:active:not(:disabled, [data-disabled])):where(:checked, [data-state='checked'])::before {
267
- background-color: var(--radio-checked-active);
268
- }
269
- &:where(.kui-variant-solid:active:not(:disabled, [data-disabled])):where(:checked, [data-state='checked'])::before {
270
- box-shadow: inset 0 0 0 1px var(--radio-checked-active);
135
+ background-color: var(--radio-fill-active);
271
136
  }
272
137
  }
273
138