@slotted/styles 0.1.0-beta.34 → 0.1.0-beta.35

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 (81) hide show
  1. package/package.json +5 -1
  2. package/src/accordion/accordion.css +20 -2
  3. package/src/accordion/accordion.tokens.json +2 -0
  4. package/src/avatar/avatar.css +1 -1
  5. package/src/avatar/avatar.tokens.json +1 -0
  6. package/src/badge/badge.css +1 -1
  7. package/src/badge/badge.tokens.json +1 -0
  8. package/src/button/button.css +168 -4
  9. package/src/button/button.tokens.json +5 -0
  10. package/src/calendar/calendar.css +131 -0
  11. package/src/calendar/calendar.tokens.json +10 -0
  12. package/src/card/card.css +63 -3
  13. package/src/cascader/cascader.css +13 -0
  14. package/src/chart/chart.css +3 -3
  15. package/src/chart/chart.tokens.json +1 -0
  16. package/src/checkbox/checkbox.css +47 -0
  17. package/src/checkbox/checkbox.tokens.json +4 -0
  18. package/src/collapsible/collapsible.css +174 -5
  19. package/src/collapsible/collapsible.tokens.json +4 -0
  20. package/src/combobox/combobox.css +13 -0
  21. package/src/command-palette/command-palette.css +10 -1
  22. package/src/command-palette/command-palette.tokens.json +1 -0
  23. package/src/dashboard-grid/dashboard-grid.css +12 -7
  24. package/src/dashboard-grid/dashboard-grid.tokens.json +1 -0
  25. package/src/data-grid/data-grid.css +44 -5
  26. package/src/data-list/data-list.css +17 -11
  27. package/src/description-list/description-list.css +15 -1
  28. package/src/entity-picker/entity-picker.css +23 -1
  29. package/src/entity-picker/entity-picker.tokens.json +1 -0
  30. package/src/filter-bar/filter-bar.css +24 -0
  31. package/src/floating-panel/floating-panel.css +123 -0
  32. package/src/floating-panel/floating-panel.tokens.json +30 -0
  33. package/src/inline-message/inline-message.css +1 -1
  34. package/src/inline-message/inline-message.tokens.json +1 -0
  35. package/src/kbd/kbd.css +1 -1
  36. package/src/kbd/kbd.tokens.json +1 -0
  37. package/src/list/list.css +10 -1
  38. package/src/list/list.tokens.json +1 -0
  39. package/src/list-item/list-item.css +108 -7
  40. package/src/list-item/list-item.tokens.json +3 -0
  41. package/src/listbox/listbox.css +50 -2
  42. package/src/listbox/listbox.tokens.json +6 -0
  43. package/src/message/message.css +20 -0
  44. package/src/message/message.tokens.json +1 -0
  45. package/src/meter/meter.css +136 -0
  46. package/src/meter/meter.tokens.json +23 -0
  47. package/src/multi-select/multi-select.css +13 -0
  48. package/src/page/page.css +58 -4
  49. package/src/page/page.tokens.json +7 -0
  50. package/src/progress-indicator/progress-indicator.css +70 -0
  51. package/src/progress-indicator/progress-indicator.tokens.json +3 -0
  52. package/src/prompt-composer/prompt-composer.css +18 -7
  53. package/src/radio-group/radio-group.css +50 -0
  54. package/src/radio-group/radio-group.tokens.json +2 -0
  55. package/src/rating/rating.css +1 -1
  56. package/src/rating/rating.tokens.json +1 -0
  57. package/src/runtime-properties.mjs +19 -0
  58. package/src/section/section.css +61 -4
  59. package/src/section/section.tokens.json +6 -0
  60. package/src/segmented-control/segmented-control.css +11 -0
  61. package/src/select/select.css +13 -0
  62. package/src/side-navigation/side-navigation.css +3 -3
  63. package/src/side-navigation/side-navigation.tokens.json +1 -0
  64. package/src/slider/slider.css +7 -1
  65. package/src/slider/slider.tokens.json +1 -0
  66. package/src/sparkline/sparkline.css +207 -0
  67. package/src/sparkline/sparkline.tokens.json +10 -0
  68. package/src/stat-card/stat-card.css +5 -0
  69. package/src/status-indicator/status-indicator.css +3 -2
  70. package/src/switch/switch.css +49 -25
  71. package/src/switch/switch.tokens.json +4 -0
  72. package/src/table/table.css +166 -12
  73. package/src/table/table.tokens.json +5 -0
  74. package/src/tag/tag.css +4 -1
  75. package/src/tag/tag.tokens.json +1 -0
  76. package/src/toolbar/toolbar.css +16 -2
  77. package/src/toolbar/toolbar.tokens.json +2 -1
  78. package/src/top-navigation/top-navigation.css +1 -1
  79. package/src/top-navigation/top-navigation.tokens.json +1 -0
  80. package/src/typography/typography.css +25 -0
  81. package/src/typography/typography.tokens.json +1 -0
@@ -32,6 +32,9 @@
32
32
  var(--slotted-font-size-md, 0.875rem)
33
33
  );
34
34
  --_subheading-line-height: var(--slotted-line-height-md, 1.5);
35
+ /* The heading as a title: mixed case, for a panel whose body outweighs a label. */
36
+ --_title-size: var(--slotted-section-title-size-md, var(--slotted-font-size-lg, 1rem));
37
+ --_title-line-height: var(--slotted-line-height-lg, 1.5);
35
38
  /**
36
39
  * The ground a sticky header paints, so the content passing under it is
37
40
  * covered rather than read through. The page states its own ground in
@@ -60,6 +63,8 @@
60
63
  var(--slotted-font-size-sm, 0.8125rem)
61
64
  );
62
65
  --_subheading-line-height: var(--slotted-line-height-sm, 1.45);
66
+ --_title-size: var(--slotted-section-title-size-sm, var(--slotted-font-size-md, 0.875rem));
67
+ --_title-line-height: var(--slotted-line-height-md, 1.5);
63
68
  }
64
69
  [data-ui-section][data-size='lg'] {
65
70
  --_heading-size: var(--slotted-section-heading-size-lg, var(--slotted-font-size-sm, 0.8125rem));
@@ -69,6 +74,8 @@
69
74
  var(--slotted-font-size-lg, 1rem)
70
75
  );
71
76
  --_subheading-line-height: var(--slotted-line-height-lg, 1.5);
77
+ --_title-size: var(--slotted-section-title-size-lg, var(--slotted-font-size-xl, 1.125rem));
78
+ --_title-line-height: var(--slotted-line-height-xl, 1.5);
72
79
  }
73
80
 
74
81
  /**
@@ -122,6 +129,10 @@
122
129
  container-type: inline-size;
123
130
  display: grid;
124
131
  grid-template-columns: minmax(0, 1fr);
132
+ /* The title takes the three middle rows. The flexible rows above and
133
+ below it are empty, so actions taller than the title grow them and not
134
+ the distance from the heading to the description. */
135
+ grid-template-rows: 1fr auto auto auto 1fr;
125
136
  min-inline-size: 0;
126
137
  }
127
138
 
@@ -190,7 +201,7 @@
190
201
  align-items: baseline;
191
202
  display: grid;
192
203
  grid-column: 1;
193
- grid-row: 1 / span 3;
204
+ grid-row: 2 / span 3;
194
205
  grid-template-columns: minmax(min-content, max-content) 1fr;
195
206
  grid-template-rows: subgrid;
196
207
  min-inline-size: 0;
@@ -227,6 +238,21 @@
227
238
  text-wrap: pretty;
228
239
  }
229
240
 
241
+ /**
242
+ * `heading="title"`: the heading in mixed case at a larger step, for a
243
+ * section whose body opens with text heavier than a label. It stands above
244
+ * the subsection's rule, so a nested section keeps the subsection's form.
245
+ */
246
+ [data-ui-section][data-heading='title']
247
+ > [data-part-header]
248
+ > [data-part-title]
249
+ > [data-part-heading] {
250
+ font-size: var(--_title-size);
251
+ letter-spacing: normal;
252
+ line-height: var(--_title-line-height);
253
+ text-transform: none;
254
+ }
255
+
230
256
  /**
231
257
  * A subsection: the case, the size and the tone all change, so the level is
232
258
  * read without the color. The text stays the muted token, which the theme
@@ -269,7 +295,7 @@
269
295
  grid-column: 1 / -1;
270
296
  grid-row: 3;
271
297
  line-height: var(--slotted-line-height-sm, 1.45);
272
- margin: var(--slotted-space-1, 0.125rem) 0 0;
298
+ margin: var(--slotted-section-description-gap, var(--slotted-space-1, 0.125rem)) 0 0;
273
299
  max-inline-size: var(--slotted-section-description-measure, 70ch);
274
300
  text-wrap: pretty;
275
301
  }
@@ -280,10 +306,11 @@
280
306
  --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
281
307
 
282
308
  align-items: center;
309
+ align-self: center;
283
310
  display: flex;
284
311
  gap: var(--slotted-action-gap, 8px);
285
312
  grid-column: 2;
286
- grid-row: 2;
313
+ grid-row: 1 / -1;
287
314
  margin-inline-start: var(--slotted-space-6, 1rem);
288
315
  }
289
316
  [data-ui-section] > [data-part-header] > [data-part-actions]:empty {
@@ -298,7 +325,7 @@
298
325
  @container (inline-size < 20rem) {
299
326
  [data-ui-section] > [data-part-header] > [data-part-actions] {
300
327
  grid-column: 1 / -1;
301
- grid-row: 4;
328
+ grid-row: 6;
302
329
  justify-self: end;
303
330
  margin: var(--slotted-space-3, 0.375rem) 0 0;
304
331
  }
@@ -309,4 +336,34 @@
309
336
  [data-ui-section] > [data-part-body] {
310
337
  min-inline-size: 0;
311
338
  }
339
+
340
+ /**
341
+ * A body that bleeds, in a surface section: a table or a grid with no frame
342
+ * of its own runs to the panel's inline edges, and to the block edge the
343
+ * body touches, where it is clipped to the panel's inner corners. The body
344
+ * takes back the inset the surface gave it; written by hand, the same
345
+ * margins left a grid one inset short of the panel's end edge. `clip` and
346
+ * not `hidden`, so a sticky header inside still sticks to the page.
347
+ */
348
+ [data-ui-section][data-ground='surface'] > [data-part-body][data-bleed] {
349
+ --_inner-radius: calc(
350
+ var(--slotted-section-radius, var(--slotted-radius-lg, 8px)) -
351
+ var(--slotted-border-width-thin, 1px)
352
+ );
353
+
354
+ margin-inline: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
355
+ overflow: clip;
356
+ }
357
+
358
+ [data-ui-section][data-ground='surface'] > [data-part-body][data-bleed]:first-child {
359
+ border-start-end-radius: var(--_inner-radius);
360
+ border-start-start-radius: var(--_inner-radius);
361
+ margin-block-start: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
362
+ }
363
+
364
+ [data-ui-section][data-ground='surface'] > [data-part-body][data-bleed]:last-child {
365
+ border-end-end-radius: var(--_inner-radius);
366
+ border-end-start-radius: var(--_inner-radius);
367
+ margin-block-end: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
368
+ }
312
369
  }
@@ -7,15 +7,18 @@
7
7
  "--slotted-font-size-lg",
8
8
  "--slotted-font-size-md",
9
9
  "--slotted-font-size-sm",
10
+ "--slotted-font-size-xl",
10
11
  "--slotted-font-size-xs",
11
12
  "--slotted-font-weight-semibold",
12
13
  "--slotted-line-height-lg",
13
14
  "--slotted-line-height-md",
14
15
  "--slotted-line-height-sm",
16
+ "--slotted-line-height-xl",
15
17
  "--slotted-line-height-xs",
16
18
  "--slotted-page-ground",
17
19
  "--slotted-radius-lg",
18
20
  "--slotted-section-border",
21
+ "--slotted-section-description-gap",
19
22
  "--slotted-section-description-measure",
20
23
  "--slotted-section-gap",
21
24
  "--slotted-section-header-background",
@@ -30,6 +33,9 @@
30
33
  "--slotted-section-subheading-size-sm",
31
34
  "--slotted-section-subsection-spacing",
32
35
  "--slotted-section-surface",
36
+ "--slotted-section-title-size-lg",
37
+ "--slotted-section-title-size-md",
38
+ "--slotted-section-title-size-sm",
33
39
  "--slotted-space-1",
34
40
  "--slotted-space-3",
35
41
  "--slotted-space-4",
@@ -171,6 +171,17 @@
171
171
  inline-size: 100%;
172
172
  }
173
173
 
174
+ /**
175
+ * A control told to condense to a column takes the width its parent gives,
176
+ * for the same reason: the binding compares that width with the width its
177
+ * labels need, and writes `data-orientation="vertical"` below it, which
178
+ * draws the column and moves the thumb on that axis.
179
+ */
180
+ [data-ui-segmented-control][data-part-root][data-condense='vertical'] {
181
+ display: grid;
182
+ inline-size: 100%;
183
+ }
184
+
174
185
  /* ── The segment ──────────────────────────────────────────────────────── */
175
186
 
176
187
  [data-ui-segmented-control] [data-part-item] {
@@ -1580,6 +1580,19 @@
1580
1580
  display: none;
1581
1581
  }
1582
1582
 
1583
+ /* Beside the empty message the status says the same thing to the eye. It
1584
+ stays the live region that announces the count, clipped to one pixel. */
1585
+ [data-ui-select] [data-part-empty] ~ [data-part-status] {
1586
+ block-size: 1px;
1587
+ clip-path: inset(50%);
1588
+ inline-size: 1px;
1589
+ min-inline-size: 0;
1590
+ overflow: hidden;
1591
+ padding: 0;
1592
+ position: absolute;
1593
+ white-space: nowrap;
1594
+ }
1595
+
1583
1596
  /**
1584
1597
  * The wait, as the shape of the list that is coming. Three rows the height of
1585
1598
  * an option rather than one sentence, so the surface a reader is looking at
@@ -658,19 +658,19 @@
658
658
  @supports (text-box: trim-both cap alphabetic) {
659
659
  [data-ui-side-navigation] [data-part-label] {
660
660
  padding-block: calc((var(--_line-height) * 1em - 0.75em) / 2);
661
- text-box: trim-both cap alphabetic;
661
+ text-box: trim-both var(--slotted-text-box-edge, cap alphabetic);
662
662
  }
663
663
 
664
664
  [data-ui-side-navigation] [data-part-description],
665
665
  [data-ui-side-navigation] [data-part-section-label] {
666
666
  padding-block: calc((var(--slotted-line-height-xs, 1.4) * 1em - 0.75em) / 2);
667
- text-box: trim-both cap alphabetic;
667
+ text-box: trim-both var(--slotted-text-box-edge, cap alphabetic);
668
668
  }
669
669
 
670
670
  [data-ui-side-navigation] [data-part-count] {
671
671
  line-height: var(--slotted-line-height-xs, 1.4);
672
672
  padding-block: calc((var(--slotted-line-height-xs, 1.4) * 1em - 0.75em) / 2);
673
- text-box: trim-both cap alphabetic;
673
+ text-box: trim-both var(--slotted-text-box-edge, cap alphabetic);
674
674
  }
675
675
  }
676
676
 
@@ -78,6 +78,7 @@
78
78
  "--slotted-space-7",
79
79
  "--slotted-surface-raised",
80
80
  "--slotted-text",
81
+ "--slotted-text-box-edge",
81
82
  "--slotted-text-muted",
82
83
  "--slotted-tone-accent-solid",
83
84
  "--slotted-tone-accent-surface",
@@ -258,8 +258,14 @@
258
258
  * bounds are the two places a thumb's center can reach and the thumb itself
259
259
  * stays inside the band.
260
260
  */
261
+ /* `--slotted-slider-track-background` takes any background, a gradient
262
+ included: a scale whose colors are what each position yields. With it,
263
+ `indicator={false}` leaves the scale whole on both sides of the thumb. */
261
264
  [data-ui-slider] [data-part-track] {
262
- background-color: var(--slotted-slider-track-color, var(--slotted-surface-sunken, Canvas));
265
+ background: var(
266
+ --slotted-slider-track-background,
267
+ var(--slotted-slider-track-color, var(--slotted-surface-sunken, Canvas))
268
+ );
263
269
  border: var(--slotted-control-border-width, 1px) solid
264
270
  var(--slotted-slider-track-border-color, var(--slotted-control-border-color, ButtonBorder));
265
271
  border-radius: var(--slotted-radius-full, 9999px);
@@ -55,6 +55,7 @@
55
55
  "--slotted-slider-thumb-hover-background",
56
56
  "--slotted-slider-thumb-shadow",
57
57
  "--slotted-slider-thumb-size",
58
+ "--slotted-slider-track-background",
58
59
  "--slotted-slider-track-border-color",
59
60
  "--slotted-slider-track-color",
60
61
  "--slotted-slider-track-size",
@@ -301,4 +301,211 @@
301
301
  stroke: Canvas;
302
302
  }
303
303
  }
304
+
305
+ /**
306
+ * ── The position strip ──────────────────────────────────────────────
307
+ *
308
+ * ┌─ root ─ role="img" ─ data-type="strip" ─────────────────────────┐
309
+ * │ start │ ┌─ track ───────────────────────────────────────┐ │ end │
310
+ * │ │ │ ░░░░░░ band ░░░░░░ · dot ● value ┆ ref │ │ │
311
+ * │ │ └───────────────────────────────────────────────┘ │ │
312
+ * └──────────────────────────────────────────────────────────────────┘
313
+ *
314
+ * Every mark is placed by a share of the track the binding writes as
315
+ * --slotted-sparkline-at, so the strip is drawn without measuring. Each end
316
+ * is as wide as its text, never cut: rows that state the same extent write
317
+ * the same ends in tabular figures, so their tracks line up.
318
+ */
319
+ [data-ui-sparkline][data-type='strip'] {
320
+ --_end: var(--slotted-sparkline-end-size, max-content);
321
+ --_dot: var(--_marker);
322
+ --_value-dot: calc(var(--_marker) * 1.75);
323
+ --_band-color: color-mix(in oklab, var(--_color) 18%, var(--slotted-surface, Canvas));
324
+
325
+ align-items: center;
326
+ column-gap: var(--slotted-space-3, 0.375rem);
327
+ display: inline-grid;
328
+ font-size: var(--slotted-font-size-xs, 0.75rem);
329
+ font-variant-numeric: tabular-nums;
330
+ grid-template-columns: var(--_end) minmax(0, 1fr) var(--_end);
331
+ line-height: var(--slotted-line-height-sm, 1.45);
332
+ }
333
+
334
+ [data-ui-sparkline][data-type='strip'] [data-part-track] {
335
+ block-size: var(--_size);
336
+ position: relative;
337
+ }
338
+
339
+ [data-ui-sparkline][data-type='strip'] :is([data-part-start], [data-part-end]) {
340
+ color: var(--slotted-text-muted, GrayText);
341
+ white-space: nowrap;
342
+ }
343
+
344
+ [data-ui-sparkline][data-type='strip'] [data-part-start] {
345
+ text-align: end;
346
+ }
347
+
348
+ [data-ui-sparkline][data-type='strip'] [data-part-band] {
349
+ background-color: var(--_band-color);
350
+ block-size: calc(var(--_size) / 2);
351
+ border-radius: var(--slotted-radius-full, 9999px);
352
+ inline-size: calc((var(--slotted-sparkline-to, 0) - var(--slotted-sparkline-from, 0)) * 100%);
353
+ inset-block-start: calc(var(--_size) / 4);
354
+ inset-inline-start: calc(var(--slotted-sparkline-from, 0) * 100%);
355
+ position: absolute;
356
+ }
357
+
358
+ [data-ui-sparkline][data-type='strip']
359
+ :is([data-part-dot], [data-part-value], [data-part-reference], [data-part-zero]) {
360
+ inset-inline-start: calc(var(--slotted-sparkline-at, 0) * 100%);
361
+ position: absolute;
362
+ }
363
+
364
+ [data-ui-sparkline][data-type='strip'] [data-part-dot] {
365
+ background-color: var(--_bar-dim);
366
+ block-size: var(--_dot);
367
+ border-radius: 50%;
368
+ inline-size: var(--_dot);
369
+ inset-block-start: calc((var(--_size) - var(--_dot)) / 2);
370
+ margin-inline-start: calc(var(--_dot) / -2);
371
+ }
372
+
373
+ [data-ui-sparkline][data-type='strip'] [data-part-value] {
374
+ background-color: var(--_color);
375
+ block-size: var(--_value-dot);
376
+ border-radius: 50%;
377
+ box-shadow: 0 0 0 var(--_ring) var(--_ring-color);
378
+ inline-size: var(--_value-dot);
379
+ inset-block-start: calc((var(--_size) - var(--_value-dot)) / 2);
380
+ margin-inline-start: calc(var(--_value-dot) / -2);
381
+ }
382
+
383
+ /* The reference is dashed and the zero is solid: one is not data, the other is the origin. */
384
+ [data-ui-sparkline][data-type='strip'] :is([data-part-reference], [data-part-zero]) {
385
+ block-size: var(--_size);
386
+ border-inline-start: var(--slotted-border-width-thin, 1px) solid var(--_reference-color);
387
+ inset-block-start: 0;
388
+ margin-inline-start: calc(var(--slotted-border-width-thin, 1px) / -2);
389
+ }
390
+
391
+ [data-ui-sparkline][data-type='strip'] [data-part-reference] {
392
+ border-inline-start-style: dashed;
393
+ }
394
+
395
+ /**
396
+ * ── The comparison ──────────────────────────────────────────────────
397
+ *
398
+ * One row per value: a label column, then a track whose zero, ticks and
399
+ * bar are placed by shares the binding writes, so roots that state the
400
+ * same domain draw the same axis. The track keeps room on both sides for
401
+ * the value written past a bar's end, and rows touch, so the zero line and
402
+ * the ticks run unbroken through a root.
403
+ */
404
+ [data-ui-sparkline][data-type='compare'] {
405
+ --_label: var(--slotted-sparkline-label-size, 6rem);
406
+ --_room: var(--slotted-sparkline-value-size, 3.5rem);
407
+ --_thickness: var(--slotted-sparkline-bar-thickness, var(--slotted-space-5, 0.625rem));
408
+ --_texture: repeating-linear-gradient(
409
+ -45deg,
410
+ var(--_color) 0 var(--slotted-border-width-thin, 1px),
411
+ var(--slotted-surface, Canvas) var(--slotted-border-width-thin, 1px) 4px
412
+ );
413
+
414
+ block-size: auto;
415
+ display: grid;
416
+ font-size: var(--slotted-font-size-xs, 0.75rem);
417
+ font-variant-numeric: tabular-nums;
418
+ grid-template-columns: var(--_label) minmax(0, 1fr);
419
+ line-height: var(--slotted-line-height-sm, 1.45);
420
+ }
421
+
422
+ [data-ui-sparkline][data-type='compare'] [data-part-row] {
423
+ align-items: center;
424
+ display: grid;
425
+ grid-column: 1 / -1;
426
+ grid-template-columns: subgrid;
427
+ }
428
+
429
+ [data-ui-sparkline][data-type='compare'] [data-part-label] {
430
+ color: var(--slotted-text-muted, GrayText);
431
+ overflow: hidden;
432
+ padding-inline-end: var(--slotted-space-4, 0.5rem);
433
+ text-overflow: ellipsis;
434
+ white-space: nowrap;
435
+ }
436
+
437
+ [data-ui-sparkline][data-type='compare'] [data-part-track] {
438
+ block-size: calc(var(--_thickness) + var(--slotted-space-4, 0.5rem));
439
+ margin-inline: var(--_room);
440
+ position: relative;
441
+ }
442
+
443
+ [data-ui-sparkline][data-type='compare'] :is([data-part-zero], [data-part-tick]) {
444
+ border-inline-start: var(--slotted-border-width-thin, 1px) solid var(--_reference-color);
445
+ inset-block: 0;
446
+ inset-inline-start: calc(var(--slotted-sparkline-at, 0) * 100%);
447
+ margin-inline-start: calc(var(--slotted-border-width-thin, 1px) / -2);
448
+ position: absolute;
449
+ }
450
+
451
+ [data-ui-sparkline][data-type='compare'] [data-part-tick] {
452
+ border-inline-start-color: color-mix(in oklab, var(--_reference-color) 40%, transparent);
453
+ }
454
+
455
+ [data-ui-sparkline][data-type='compare'] [data-part-bar] {
456
+ background-color: var(--_color);
457
+ block-size: var(--_thickness);
458
+ inline-size: calc((var(--slotted-sparkline-to, 0) - var(--slotted-sparkline-from, 0)) * 100%);
459
+ inset-block-start: calc(50% - var(--_thickness) / 2);
460
+ inset-inline-start: calc(var(--slotted-sparkline-from, 0) * 100%);
461
+ position: absolute;
462
+ }
463
+
464
+ [data-ui-sparkline][data-type='compare'] [data-part-row][data-texture] [data-part-bar] {
465
+ background-image: var(--_texture);
466
+ box-shadow: inset 0 0 0 var(--slotted-border-width-thin, 1px) var(--_color);
467
+ }
468
+
469
+ /* The value stands past the bar's far end: after a positive bar, before a negative one. */
470
+ [data-ui-sparkline][data-type='compare'] [data-part-value] {
471
+ color: var(--slotted-text, CanvasText);
472
+ inset-block-start: 50%;
473
+ inset-inline-start: calc(
474
+ var(--slotted-sparkline-to, 0) * 100% + var(--slotted-space-3, 0.375rem)
475
+ );
476
+ position: absolute;
477
+ translate: 0 -50%;
478
+ white-space: nowrap;
479
+ }
480
+
481
+ [data-ui-sparkline][data-type='compare'] [data-part-row][data-negative] [data-part-value] {
482
+ inset-inline-end: calc(
483
+ (1 - var(--slotted-sparkline-from, 0)) * 100% + var(--slotted-space-3, 0.375rem)
484
+ );
485
+ inset-inline-start: auto;
486
+ }
487
+
488
+ /**
489
+ * Under forced colors a mix of two system colors is a color the mode does
490
+ * not have: the band and the dots take GrayText, the value and the bars
491
+ * CanvasText, and the texture is drawn in CanvasText over Canvas.
492
+ */
493
+ @media (forced-colors: active) {
494
+ [data-ui-sparkline][data-type='strip'] :is([data-part-band], [data-part-dot]) {
495
+ background-color: GrayText;
496
+ forced-color-adjust: none;
497
+ }
498
+
499
+ [data-ui-sparkline][data-type='strip'] [data-part-value],
500
+ [data-ui-sparkline][data-type='compare'] [data-part-bar] {
501
+ background-color: CanvasText;
502
+ forced-color-adjust: none;
503
+ }
504
+
505
+ [data-ui-sparkline][data-type='compare'] [data-part-row][data-texture] [data-part-bar] {
506
+ background-color: Canvas;
507
+ background-image: repeating-linear-gradient(-45deg, CanvasText 0 1px, Canvas 1px 4px);
508
+ box-shadow: inset 0 0 0 1px CanvasText;
509
+ }
510
+ }
304
511
  }
@@ -14,18 +14,25 @@
14
14
  "--slotted-duration-medium",
15
15
  "--slotted-duration-short",
16
16
  "--slotted-easing-standard",
17
+ "--slotted-font-size-xs",
18
+ "--slotted-line-height-sm",
19
+ "--slotted-radius-full",
17
20
  "--slotted-space-11",
18
21
  "--slotted-space-2",
19
22
  "--slotted-space-3",
20
23
  "--slotted-space-4",
24
+ "--slotted-space-5",
21
25
  "--slotted-space-7",
22
26
  "--slotted-space-9",
23
27
  "--slotted-sparkline-area-opacity",
24
28
  "--slotted-sparkline-bar-share",
29
+ "--slotted-sparkline-bar-thickness",
25
30
  "--slotted-sparkline-block-size",
26
31
  "--slotted-sparkline-block-size-lg",
27
32
  "--slotted-sparkline-block-size-sm",
28
33
  "--slotted-sparkline-color",
34
+ "--slotted-sparkline-end-size",
35
+ "--slotted-sparkline-label-size",
29
36
  "--slotted-sparkline-line-width",
30
37
  "--slotted-sparkline-line-width-sm",
31
38
  "--slotted-sparkline-marker-size",
@@ -36,7 +43,10 @@
36
43
  "--slotted-sparkline-ring-color",
37
44
  "--slotted-sparkline-ring-width",
38
45
  "--slotted-sparkline-ring-width-sm",
46
+ "--slotted-sparkline-value-size",
47
+ "--slotted-surface",
39
48
  "--slotted-surface-raised",
49
+ "--slotted-text",
40
50
  "--slotted-text-muted",
41
51
  "--slotted-tone-accent-text",
42
52
  "--slotted-tone-danger-text",
@@ -822,9 +822,14 @@
822
822
  * the small step. Every box under a row of figures moved when the answer
823
823
  * arrived. The floor is one line of the value's own type, so the two states
824
824
  * occupy the same box.
825
+ *
826
+ * The bar stands at the middle of that line, where the figure's capitals
827
+ * stand. On the baseline rule of the loaded value a lone bar has no
828
+ * baseline to share and fell to the top of the line, against the label.
825
829
  */
826
830
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
827
831
  :scope[data-loading] [data-part-value] {
832
+ align-items: center;
828
833
  min-block-size: calc(var(--_value-size) * var(--_value-line));
829
834
  }
830
835
  }
@@ -49,10 +49,11 @@
49
49
  * fractional disc lands its edge across two device pixels at 1×. ReUI draws
50
50
  * the same light at 6 pixels beside 14-pixel type (0.43 em); 8 beside 13 is
51
51
  * 0.62 em, which keeps the tone legible in a table cell without
52
- * outweighing the word.
52
+ * outweighing the word. The step is rounded, because the space scale is
53
+ * in rems: at a 14px root `sm` was 5.25 pixels.
53
54
  */
54
55
  --_dot-size: var(--slotted-space-4, 0.5rem);
55
- --_mark-size: var(--_dot-size);
56
+ --_mark-size: round(nearest, var(--_dot-size), 1px);
56
57
  --_rim-width: var(
57
58
  --slotted-status-indicator-mark-border-width,
58
59
  var(--slotted-border-width-thin, 1px)
@@ -368,6 +368,37 @@
368
368
  --_gap: var(--slotted-control-label-gap-lg, 12px);
369
369
  }
370
370
 
371
+ /**
372
+ * One control tall: in a row of fields aligned to their end, the box ends
373
+ * where their controls end and the pill is centered on their line. The
374
+ * padding is what the control height leaves past the switch's own row, so a
375
+ * label that wraps grows the box. The height is the control of the switch's
376
+ * size unless `--slotted-switch-control-block-size` names another step (a
377
+ * small switch in a row of medium fields).
378
+ */
379
+ [data-ui-switch][data-part-root][data-variant='control'] {
380
+ padding-block: max(
381
+ 0px,
382
+ (
383
+ var(--slotted-switch-control-block-size, var(--_control-height)) -
384
+ max(var(--_track-block), var(--_font-size) * var(--_line-height))
385
+ ) /
386
+ 2
387
+ );
388
+ }
389
+
390
+ [data-ui-switch][data-part-root][data-size='sm'] {
391
+ --_control-height: var(--slotted-control-height-sm, 30px);
392
+ }
393
+
394
+ [data-ui-switch][data-part-root][data-size='md'] {
395
+ --_control-height: var(--slotted-control-height-md, 34px);
396
+ }
397
+
398
+ [data-ui-switch][data-part-root][data-size='lg'] {
399
+ --_control-height: var(--slotted-control-height-lg, 38px);
400
+ }
401
+
371
402
  /* ── States ───────────────────────────────────────────────────────────
372
403
  *
373
404
  * Written strongest last, and each weaker one guarded against every stronger
@@ -545,25 +576,32 @@
545
576
  );
546
577
  }
547
578
 
548
- [data-ui-switch][data-part-root][data-invalid] > [data-part-track],
549
- [data-ui-switch][data-part-root][data-invalid] > [data-part-track] > [data-part-thumb] {
550
- border-color: var(--slotted-switch-invalid-border-color, var(--slotted-tone-danger-border));
551
- /*
552
- * Width as well as color (WCAG 1.4.1), the edge `text-field` draws: in
553
- * `high-contrast` the danger border is the resting edge's black. An edge
554
- * inside the border of the track and of the thumb, so neither moves, in
555
- * place of the thumb's resting lift; the thumb carries it where a checked
556
- * track's fill would hide the track's own.
557
- */
579
+ /*
580
+ * The outer edge of the track alone. An inset edge drew a second danger line
581
+ * inside the accent fill of a checked track and a ring around the thumb, in
582
+ * place of its own border and lift; the thumb keeps both. The edge stands
583
+ * outside the track's border at the invalid edge width, so the state is
584
+ * width as well as color (WCAG 1.4.1, the edge `text-field` draws), and the
585
+ * checked, hover and pressed rules that color the border do not take it.
586
+ */
587
+ [data-ui-switch][data-part-root][data-invalid] > [data-part-track] {
558
588
  --_invalid-edge-width: var(
559
589
  --slotted-switch-invalid-edge-width,
560
590
  var(--slotted-control-invalid-edge-width, 1px)
561
591
  );
562
592
 
563
- box-shadow: inset 0 0 0 var(--_invalid-edge-width)
593
+ box-shadow: 0 0 0 var(--_invalid-edge-width)
564
594
  var(--slotted-switch-invalid-border-color, var(--slotted-tone-danger-border));
565
595
  }
566
596
 
597
+ /* Forced colors remove every box shadow, and the edge with them: it comes
598
+ back as an outline of the same width around the track. */
599
+ @media (forced-colors: active) {
600
+ [data-ui-switch][data-part-root][data-invalid] > [data-part-track] {
601
+ outline: var(--_invalid-edge-width) solid CanvasText;
602
+ }
603
+ }
604
+
567
605
  /**
568
606
  * Loading. The geometry does not change — the thumb stays where it is and
569
607
  * the track keeps its size — because a control that resizes while it saves
@@ -680,18 +718,4 @@
680
718
  > [data-part-description] {
681
719
  color: var(--slotted-switch-disabled-color, var(--slotted-disabled-foreground, GrayText));
682
720
  }
683
-
684
- /*
685
- * Forced colors remove every box shadow, and the edge with them. The width
686
- * comes back as an outline inside the border, on the
687
- * track and on the thumb; the focus ring takes the track and the thumb keeps
688
- * its edge.
689
- */
690
- @media (forced-colors: active) {
691
- [data-ui-switch][data-part-root][data-invalid] > [data-part-track],
692
- [data-ui-switch][data-part-root][data-invalid] > [data-part-track] > [data-part-thumb] {
693
- outline: var(--_invalid-edge-width) solid CanvasText;
694
- outline-offset: calc(-1 * (var(--_border) + var(--_invalid-edge-width)));
695
- }
696
- }
697
721
  }
@@ -6,6 +6,9 @@
6
6
  "--slotted-control-font-size-lg",
7
7
  "--slotted-control-font-size-md",
8
8
  "--slotted-control-font-size-sm",
9
+ "--slotted-control-height-lg",
10
+ "--slotted-control-height-md",
11
+ "--slotted-control-height-sm",
9
12
  "--slotted-control-icon-size-lg",
10
13
  "--slotted-control-icon-size-md",
11
14
  "--slotted-control-icon-size-sm",
@@ -39,6 +42,7 @@
39
42
  "--slotted-switch-checked-hover-background",
40
43
  "--slotted-switch-checked-thumb-border-color",
41
44
  "--slotted-switch-color",
45
+ "--slotted-switch-control-block-size",
42
46
  "--slotted-switch-description-color",
43
47
  "--slotted-switch-description-font-size",
44
48
  "--slotted-switch-disabled-background",