@slotted/styles 0.1.0-beta.15 → 0.1.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slotted/styles",
3
- "version": "0.1.0-beta.15",
3
+ "version": "0.1.0-beta.17",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -504,6 +504,46 @@
504
504
  background-color: currentcolor;
505
505
  }
506
506
 
507
+ /**
508
+ * What falls on the day (`marks`): a dot in the row today's dot reserves, in
509
+ * the mark's tone. A marked day draws its mark there instead, and today
510
+ * keeps its colour and weight; on a chosen day the dot takes the day's ink.
511
+ */
512
+ [data-ui-calendar] [data-part-day]:has(> [data-part-mark])::before {
513
+ display: none;
514
+ }
515
+
516
+ [data-ui-calendar] [data-part-mark] {
517
+ --_mark: var(--slotted-tone-accent-solid, currentcolor);
518
+
519
+ background-color: var(--_mark);
520
+ block-size: var(--slotted-space-2, 0.25rem);
521
+ border-radius: var(--slotted-radius-full, 9999px);
522
+ flex: 0 0 auto;
523
+ inline-size: var(--slotted-space-2, 0.25rem);
524
+ order: 1;
525
+ }
526
+
527
+ [data-ui-calendar] [data-part-mark][data-tone='info'] {
528
+ --_mark: var(--slotted-tone-info-solid, currentcolor);
529
+ }
530
+
531
+ [data-ui-calendar] [data-part-mark][data-tone='success'] {
532
+ --_mark: var(--slotted-tone-success-solid, currentcolor);
533
+ }
534
+
535
+ [data-ui-calendar] [data-part-mark][data-tone='warning'] {
536
+ --_mark: var(--slotted-tone-warning-solid, currentcolor);
537
+ }
538
+
539
+ [data-ui-calendar] [data-part-mark][data-tone='danger'] {
540
+ --_mark: var(--slotted-tone-danger-solid, currentcolor);
541
+ }
542
+
543
+ [data-ui-calendar] [data-part-cell][data-selected] [data-part-mark] {
544
+ --_mark: currentcolor;
545
+ }
546
+
507
547
  /**
508
548
  * A day of the month either side. Quiet enough to read as context and legible
509
549
  * enough to press, because a reader who wants 1 October while looking at
@@ -62,6 +62,10 @@
62
62
  "--slotted-tone-accent-subtle-active",
63
63
  "--slotted-tone-accent-subtle-hover",
64
64
  "--slotted-tone-accent-text",
65
+ "--slotted-tone-danger-solid",
66
+ "--slotted-tone-info-solid",
65
67
  "--slotted-tone-secondary-subtle-active",
66
- "--slotted-tone-secondary-subtle-hover"
68
+ "--slotted-tone-secondary-subtle-hover",
69
+ "--slotted-tone-success-solid",
70
+ "--slotted-tone-warning-solid"
67
71
  ]
@@ -249,6 +249,9 @@
249
249
  }
250
250
 
251
251
  [data-ui-chart] > [data-part-header] > [data-part-actions] {
252
+ /* An action slot states one size for the links it holds. */
253
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
254
+
252
255
  align-items: center;
253
256
  display: flex;
254
257
  flex: none;
@@ -29,10 +29,20 @@
29
29
  min-inline-size: 0;
30
30
  }
31
31
 
32
+ /**
33
+ * A row is the unit a reader moves and resizes by; the tracks are twelve
34
+ * times finer (`DASHBOARD_SUBROWS` in `@slotted/core/dashboard-grid`), so a
35
+ * widget sized by its content ends within a twelfth of a row's step of it.
36
+ * The tracks have no gap between them: each widget draws the gap as its
37
+ * margin below, inside its own cells, and the grid takes the last one back.
38
+ * A widget of `h` rows is `h` rows and `h - 1` gaps tall, as before.
39
+ */
32
40
  [data-ui-dashboard-grid] > [data-part-grid] {
41
+ column-gap: var(--_gap);
33
42
  display: grid;
34
- gap: var(--_gap);
35
- grid-auto-rows: var(--_row);
43
+ grid-auto-rows: calc((var(--_row) + var(--_gap)) / 12);
44
+ margin-block-end: calc(-1 * var(--_gap));
45
+ row-gap: 0;
36
46
  grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
37
47
  list-style: none;
38
48
  margin: 0;
@@ -54,7 +64,8 @@
54
64
  */
55
65
  [data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
56
66
  grid-column: var(--_dg-x, auto) / span var(--_dg-w, 4);
57
- grid-row: var(--_dg-y, auto) / span var(--_dg-h, 2);
67
+ grid-row: var(--_dg-y, auto) / span var(--_dg-h, 24);
68
+ margin-block-end: var(--_gap);
58
69
  min-block-size: 0;
59
70
  min-inline-size: 0;
60
71
  }
@@ -68,37 +79,69 @@
68
79
  * The medium class flows the same order, each widget a half or the whole
69
80
  * of the row; its height stays in rows. The compact class is one
70
81
  * column whose widgets are as tall as their content, the way a phone reads a
71
- * dashboard. The thresholds are the size classes of §2.7, literal because
72
- * CSS refuses a custom property in a container condition.
82
+ * dashboard. Once the binding has measured the grid it writes the class on
83
+ * the root (`data-size-class`, from `expandedFrom`), and the rules follow
84
+ * the attribute. Before that the container queries draw the classes at the
85
+ * thresholds of §2.7, literal because CSS refuses a custom property in a
86
+ * container condition.
73
87
  */
74
88
  @container dashboard-grid (width < 1024px) {
75
- [data-ui-dashboard-grid] > [data-part-grid] {
89
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid] {
76
90
  --_cols: var(--_dg-columns-medium, 6);
77
91
  }
78
92
 
79
- [data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
93
+ [data-ui-dashboard-grid]:not([data-size-class])
94
+ :is([data-part-widget], [data-part-placeholder]) {
80
95
  grid-column: auto / span var(--_dg-span-medium, 3);
81
- grid-row: auto / span var(--_dg-h, 2);
96
+ grid-row: auto / span var(--_dg-h, 24);
82
97
  }
83
98
  }
84
99
 
100
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
101
+ > [data-part-grid] {
102
+ --_cols: var(--_dg-columns-medium, 6);
103
+ }
104
+
105
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
106
+ :is([data-part-widget], [data-part-placeholder]) {
107
+ grid-column: auto / span var(--_dg-span-medium, 3);
108
+ grid-row: auto / span var(--_dg-h, 24);
109
+ }
110
+
85
111
  @container dashboard-grid (width < 600px) {
86
- [data-ui-dashboard-grid] > [data-part-grid] {
112
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid] {
87
113
  --_cols: var(--_dg-columns-compact, 1);
88
114
 
89
115
  grid-auto-rows: auto;
90
116
  }
91
117
 
92
- [data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
118
+ [data-ui-dashboard-grid]:not([data-size-class])
119
+ :is([data-part-widget], [data-part-placeholder]) {
93
120
  grid-column: 1 / -1;
94
121
  grid-row: auto;
95
122
  }
96
123
 
97
- [data-ui-dashboard-grid] [data-part-placeholder] {
124
+ [data-ui-dashboard-grid]:not([data-size-class]) [data-part-placeholder] {
98
125
  min-block-size: calc(var(--_row) * 2);
99
126
  }
100
127
  }
101
128
 
129
+ [data-ui-dashboard-grid][data-size-class='compact'] > [data-part-grid] {
130
+ --_cols: var(--_dg-columns-compact, 1);
131
+
132
+ grid-auto-rows: auto;
133
+ }
134
+
135
+ [data-ui-dashboard-grid][data-size-class='compact']
136
+ :is([data-part-widget], [data-part-placeholder]) {
137
+ grid-column: 1 / -1;
138
+ grid-row: auto;
139
+ }
140
+
141
+ [data-ui-dashboard-grid][data-size-class='compact'] [data-part-placeholder] {
142
+ min-block-size: calc(var(--_row) * 2);
143
+ }
144
+
102
145
  /* ── The widget ──────────────────────────────────────────────────────── */
103
146
 
104
147
  /**
@@ -116,8 +159,11 @@
116
159
 
117
160
  [data-ui-dashboard-grid] [data-part-widget] > [data-ui-card] > [data-part-body] {
118
161
  /* A chart's plot takes whatever height the widget leaves it, down to a
119
- floor of one and a half rows, instead of its own size step. */
162
+ floor of one and a half rows, instead of its own size step: the
163
+ reader sizes a widget, and every step answers to that size. */
120
164
  --slotted-chart-plot-block-size: calc(var(--_row) * 1.5);
165
+ --slotted-chart-plot-block-size-sm: calc(var(--_row) * 1.5);
166
+ --slotted-chart-plot-block-size-lg: calc(var(--_row) * 1.5);
121
167
 
122
168
  display: flex;
123
169
  flex-direction: column;
@@ -136,6 +182,16 @@
136
182
  flex: 1 0 auto;
137
183
  }
138
184
 
185
+ /* A widget sized by its content is measured by it: what its body holds
186
+ keeps its own height, and the cell is that height to a twelfth of a row. */
187
+ [data-ui-dashboard-grid]
188
+ [data-part-widget][data-rows='auto']
189
+ > [data-ui-card]
190
+ > [data-part-body]
191
+ > :not([data-part-busy-indicator]) {
192
+ flex-grow: 0;
193
+ }
194
+
139
195
  /**
140
196
  * The title is the widget's name and a card header's first line: the
141
197
  * medium step, semibold, two lines and then an ellipsis. The clamp never
@@ -361,11 +417,16 @@
361
417
  /* Below the expanded class the widgets flow, so no cell is a place to drop
362
418
  on and the lattice would be specks in the gaps. */
363
419
  @container dashboard-grid (width < 1024px) {
364
- [data-ui-dashboard-grid] > [data-part-grid]::before {
420
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid]::before {
365
421
  display: none;
366
422
  }
367
423
  }
368
424
 
425
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
426
+ > [data-part-grid]::before {
427
+ display: none;
428
+ }
429
+
369
430
  /* ── Editing: the widget ─────────────────────────────────────────────── */
370
431
 
371
432
  /* The whole card is a place to pick the widget up from; its controls keep
@@ -638,21 +699,33 @@
638
699
  /* The medium class flows the widgets, so a widget's start is where the one
639
700
  before it ends: there is no start edge to pull. */
640
701
  @container dashboard-grid (width < 1024px) {
641
- [data-ui-dashboard-grid]
702
+ [data-ui-dashboard-grid]:not([data-size-class])
642
703
  [data-part-widget]
643
704
  > [data-part-resize-handle]:is([data-edge='start'], [data-edge='bottom-start']) {
644
705
  display: none;
645
706
  }
646
707
  }
647
708
 
709
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
710
+ [data-part-widget]
711
+ > [data-part-resize-handle]:is([data-edge='start'], [data-edge='bottom-start']) {
712
+ display: none;
713
+ }
714
+
648
715
  /* A phone reads a dashboard as one column as tall as its content: there is
649
716
  no size to pull, only an order to change. */
650
717
  @container dashboard-grid (width < 600px) {
651
- [data-ui-dashboard-grid] [data-part-widget] > [data-part-resize-handle] {
718
+ [data-ui-dashboard-grid]:not([data-size-class]) [data-part-widget] > [data-part-resize-handle] {
652
719
  display: none;
653
720
  }
654
721
  }
655
722
 
723
+ [data-ui-dashboard-grid][data-size-class='compact']
724
+ [data-part-widget]
725
+ > [data-part-resize-handle] {
726
+ display: none;
727
+ }
728
+
656
729
  /* ── Editing: a widget in hand ───────────────────────────────────────── */
657
730
 
658
731
  /**
@@ -954,6 +954,8 @@
954
954
 
955
955
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > form > [data-part-body],
956
956
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > [data-part-body] {
957
+ /* The row that stretches, with or without a header above it. */
958
+ grid-row: 2;
957
959
  min-block-size: 0;
958
960
  overflow-x: hidden;
959
961
  overflow-y: auto;
@@ -1005,6 +1007,8 @@
1005
1007
  */
1006
1008
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > form > [data-part-footer],
1007
1009
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > [data-part-footer] {
1010
+ /* The last row, with or without a body above it: without one it took the row that stretches. */
1011
+ grid-row: 3;
1008
1012
  display: flex;
1009
1013
  flex-wrap: wrap;
1010
1014
  align-items: center;
@@ -136,7 +136,8 @@
136
136
  * decide. A property is resolved on the element instead, and the three
137
137
  * states below read as what they are.
138
138
  */
139
- --_slide: var(--slotted-duration-long) var(--slotted-easing-enter);
139
+ --_slide: var(--slotted-drawer-slide-duration, var(--slotted-duration-long))
140
+ var(--slotted-easing-enter);
140
141
  --_move: var(--slotted-duration-medium) var(--slotted-easing-enter);
141
142
  /**
142
143
  * `allow-discrete` is the whole of it. Without it the rule that hides a
@@ -155,7 +156,8 @@
155
156
  * it had finished leaving — which is a hundred and fifty milliseconds
156
157
  * before `closed` fires.
157
158
  */
158
- --_reveal: content-visibility var(--slotted-duration-medium) allow-discrete;
159
+ --_reveal: content-visibility
160
+ var(--slotted-drawer-slide-exit-duration, var(--slotted-duration-medium)) allow-discrete;
159
161
 
160
162
  /**
161
163
  * The repository has no global reset, so a family that gives a box an
@@ -177,7 +179,8 @@
177
179
 
178
180
  /** Leaving is shorter than arriving: a reader who has decided is waiting. */
179
181
  [data-ui-drawer]:not([data-open]) {
180
- --_slide: var(--slotted-duration-medium) var(--slotted-easing-exit);
182
+ --_slide: var(--slotted-drawer-slide-exit-duration, var(--slotted-duration-medium))
183
+ var(--slotted-easing-exit);
181
184
  --_move: var(--slotted-duration-medium) var(--slotted-easing-exit);
182
185
  }
183
186
 
@@ -575,8 +578,9 @@
575
578
  /**
576
579
  * A sheet on a wide layer is a card over the page, not a strip across it:
577
580
  * forty rems, Material 3's 640 dp, centred, with the scrim on both sides. The
578
- * edge then shows on three sides, so the panel draws it on three; on a phone
579
- * the two side edges sit on the screen's own and read as nothing.
581
+ * edge then shows on three sides, so the panel draws it on three. An overlay
582
+ * layer is the viewport, so at the sheet's measure or under it — a phone —
583
+ * the side edges would sit on the screen's own and are not drawn.
580
584
  */
581
585
  [data-ui-drawer][data-mode='overlay'][data-side='top'] > [data-part-panel],
582
586
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'] > [data-part-panel] {
@@ -585,7 +589,12 @@
585
589
  100%,
586
590
  var(--slotted-drawer-sheet-inline-size, var(--slotted-drawer-extent-xl, 40rem))
587
591
  );
588
- border-inline-width: var(--_rule-size);
592
+ border-inline-width: clamp(
593
+ 0px,
594
+ (100vw - var(--slotted-drawer-sheet-inline-size, var(--slotted-drawer-extent-xl, 40rem))) *
595
+ 1000,
596
+ var(--_rule-size)
597
+ );
589
598
  }
590
599
 
591
600
  /**
@@ -689,7 +698,7 @@
689
698
  * step, because a container condition cannot hold a custom property — buy one
690
699
  * hairline at the extreme edge of the viewport.
691
700
  */
692
- [data-ui-drawer][data-size='full'] > [data-part-panel] {
701
+ [data-ui-drawer][data-mode][data-size='full'] > [data-part-panel] {
693
702
  border-width: 0;
694
703
  border-radius: 0;
695
704
  }
@@ -1112,6 +1121,20 @@
1112
1121
  color: var(--slotted-drawer-title-color, var(--slotted-text, CanvasText));
1113
1122
  }
1114
1123
 
1124
+ /* Actions take a column between the words and the close button, on the title's row. */
1125
+ [data-ui-drawer] > [data-part-panel] > [data-part-header]:has(> [data-part-actions]) {
1126
+ grid-template-columns: minmax(0, 1fr) auto auto;
1127
+ }
1128
+
1129
+ [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-actions] {
1130
+ grid-column: 2;
1131
+ grid-row: 1 / span 2;
1132
+ align-self: start;
1133
+ display: flex;
1134
+ align-items: center;
1135
+ gap: var(--slotted-space-2, 0.25rem);
1136
+ }
1137
+
1115
1138
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-description] {
1116
1139
  grid-column: 1;
1117
1140
  grid-row: 2;
@@ -1136,7 +1159,8 @@
1136
1159
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close] {
1137
1160
  --slotted-icon-size: var(--_icon-size);
1138
1161
 
1139
- grid-column: 2;
1162
+ /* The last column, beside the actions when there are any. */
1163
+ grid-column: -2;
1140
1164
  grid-row: 1 / span 2;
1141
1165
  align-self: start;
1142
1166
  display: inline-grid;
@@ -1428,6 +1452,14 @@
1428
1452
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
1429
1453
  }
1430
1454
 
1455
+ /* `size="full"` is the screen: the footer rests at its bottom, in the row that takes what is left. */
1456
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-size='full']
1457
+ > [data-part-panel]
1458
+ > [data-part-footer] {
1459
+ grid-row: 5;
1460
+ align-self: end;
1461
+ }
1462
+
1431
1463
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-sheet-scrolls]
1432
1464
  > [data-part-panel] {
1433
1465
  scroll-snap-align: start;
@@ -1504,6 +1536,13 @@
1504
1536
  touch-action: pan-y;
1505
1537
  }
1506
1538
 
1539
+ /* Every region inside the sheet passes its block-axis overscroll on to the sheet, a family's own `contain` included. */
1540
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1541
+ > [data-part-panel]
1542
+ * {
1543
+ overscroll-behavior-y: auto;
1544
+ }
1545
+
1507
1546
  /* A region the consumer keeps from the sheet: its own scroll never passes on to it. */
1508
1547
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] [data-drawer-drag='none'] {
1509
1548
  overscroll-behavior: contain;
@@ -32,6 +32,8 @@
32
32
  "--slotted-drawer-sheet-floor",
33
33
  "--slotted-drawer-sheet-height",
34
34
  "--slotted-drawer-sheet-inline-size",
35
+ "--slotted-drawer-slide-duration",
36
+ "--slotted-drawer-slide-exit-duration",
35
37
  "--slotted-drawer-surface",
36
38
  "--slotted-drawer-title-color",
37
39
  "--slotted-drawer-title-font-family",
package/src/link/link.css CHANGED
@@ -80,6 +80,27 @@
80
80
  * pointer. Fluent calls it `subtle`, Primer `muted`, Polaris `monochrome`,
81
81
  * and all three describe the same two colours.
82
82
  */
83
+ /**
84
+ * The text size. Unset, a link takes the size an action slot states for the
85
+ * controls it holds (`--slotted-link-font-size`), or else its parent's; a
86
+ * `size` states its own.
87
+ */
88
+ [data-ui-link] {
89
+ font-size: var(--slotted-link-font-size, inherit);
90
+ }
91
+
92
+ [data-ui-link][data-size='xs'] {
93
+ font-size: var(--slotted-font-size-xs, 0.75rem);
94
+ }
95
+
96
+ [data-ui-link][data-size='sm'] {
97
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
98
+ }
99
+
100
+ [data-ui-link][data-size='md'] {
101
+ font-size: var(--slotted-font-size-md, 0.875rem);
102
+ }
103
+
83
104
  [data-ui-link][data-variant='neutral'] {
84
105
  --_rest: var(--slotted-link-color, currentColor);
85
106
  --_hover: var(--slotted-link-color-hover, var(--slotted-tone-accent-text, LinkText));
@@ -5,6 +5,9 @@
5
5
  "--slotted-easing-standard",
6
6
  "--slotted-focus-ring-color",
7
7
  "--slotted-focus-ring-width",
8
+ "--slotted-font-size-md",
9
+ "--slotted-font-size-sm",
10
+ "--slotted-font-size-xs",
8
11
  "--slotted-link-color",
9
12
  "--slotted-link-color-active",
10
13
  "--slotted-link-color-current",
@@ -14,6 +17,7 @@
14
17
  "--slotted-link-external-icon-gap",
15
18
  "--slotted-link-external-icon-size",
16
19
  "--slotted-link-focus-ring-offset",
20
+ "--slotted-link-font-size",
17
21
  "--slotted-link-radius",
18
22
  "--slotted-link-underline-color",
19
23
  "--slotted-link-underline-offset",
@@ -617,6 +617,16 @@
617
617
  unicode-bidi: plaintext;
618
618
  }
619
619
 
620
+ /**
621
+ * A bubble is as wide as its words. Prose — markdown's typography — is a size
622
+ * container for its narrow-column rules, and a size container contributes no
623
+ * width, so the bubble shrank to its padding. Inside a bubble prose sizes to
624
+ * its text and its narrow-column rules do not apply.
625
+ */
626
+ [data-ui-message][data-part-bubble] > [data-part-content] [data-ui-prose] {
627
+ container-type: normal;
628
+ }
629
+
620
630
  [data-ui-message][data-part-bubble][data-variant='solid'] > [data-part-content] {
621
631
  --_ground: var(--_solid);
622
632
  --_ink: var(--_on-solid);
@@ -237,7 +237,7 @@
237
237
  */
238
238
  [data-ui-prompt-composer]
239
239
  > :is([data-part-header], [data-part-footer])
240
- > :is([data-part-action], [data-part-attach]) {
240
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]) {
241
241
  align-items: center;
242
242
  appearance: none;
243
243
  background-color: transparent;
@@ -313,7 +313,7 @@
313
313
  finger, and never across the edge two buttons share. */
314
314
  [data-ui-prompt-composer]
315
315
  > :is([data-part-header], [data-part-footer])
316
- > :is([data-part-action], [data-part-attach], [data-part-submit])::after {
316
+ > :is([data-part-action], [data-part-attach], [data-part-dictate], [data-part-submit])::after {
317
317
  content: '';
318
318
  inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
319
319
  position: absolute;
@@ -322,27 +322,41 @@
322
322
  @media (pointer: coarse) {
323
323
  [data-ui-prompt-composer]
324
324
  > :is([data-part-header], [data-part-footer])
325
- > :is([data-part-action], [data-part-attach], [data-part-submit])::after {
325
+ > :is(
326
+ [data-part-action],
327
+ [data-part-attach],
328
+ [data-part-dictate],
329
+ [data-part-submit]
330
+ )::after {
326
331
  inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
327
332
  }
328
333
 
329
334
  [data-ui-prompt-composer]
330
335
  > :is([data-part-header], [data-part-footer])
331
- > :is([data-part-action], [data-part-attach]):has(+ *)::after {
336
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):has(+ *)::after {
332
337
  inset-inline-end: 0;
333
338
  }
334
339
 
335
340
  [data-ui-prompt-composer]
336
341
  > :is([data-part-header], [data-part-footer])
337
342
  > *
338
- + :is([data-part-action], [data-part-attach], [data-part-submit])::after {
343
+ + :is(
344
+ [data-part-action],
345
+ [data-part-attach],
346
+ [data-part-dictate],
347
+ [data-part-submit]
348
+ )::after {
339
349
  inset-inline-start: 0;
340
350
  }
341
351
  }
342
352
 
343
353
  [data-ui-prompt-composer]
344
354
  > :is([data-part-header], [data-part-footer])
345
- > :is([data-part-action], [data-part-attach]):hover:not(:disabled, [aria-expanded='true']) {
355
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):hover:not(
356
+ :disabled,
357
+ [aria-expanded='true'],
358
+ [aria-pressed='true']
359
+ ) {
346
360
  background-color: var(
347
361
  --slotted-prompt-composer-action-hover-background,
348
362
  var(--slotted-tone-secondary-subtle-hover)
@@ -351,9 +365,11 @@
351
365
 
352
366
  [data-ui-prompt-composer]
353
367
  > :is([data-part-header], [data-part-footer])
354
- > :is([data-part-action], [data-part-attach]):is(:active, [aria-expanded='true']):not(
355
- :disabled
356
- ) {
368
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):is(
369
+ :active,
370
+ [aria-expanded='true'],
371
+ [aria-pressed='true']
372
+ ):not(:disabled) {
357
373
  background-color: var(
358
374
  --slotted-prompt-composer-action-active-background,
359
375
  var(--slotted-tone-secondary-subtle-active)
@@ -362,7 +378,7 @@
362
378
 
363
379
  [data-ui-prompt-composer]
364
380
  > :is([data-part-header], [data-part-footer])
365
- > :is([data-part-action], [data-part-attach]):disabled {
381
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):disabled {
366
382
  color: var(--slotted-disabled-foreground);
367
383
  cursor: not-allowed;
368
384
  }
@@ -535,7 +551,7 @@
535
551
  ring stands against the frame's ground rather than against the accent. */
536
552
  [data-ui-prompt-composer]
537
553
  > :is([data-part-header], [data-part-footer])
538
- > :is([data-part-action], [data-part-attach]):focus-visible {
554
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):focus-visible {
539
555
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
540
556
  outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
541
557
  }
@@ -576,8 +592,8 @@
576
592
  * outline and its raised shadow; the controls inside keep their own focus
577
593
  * rings. Two marks the binding draws, both `aria-hidden`: the ring, a band
578
594
  * the width of `--slotted-prompt-composer-ring-width` cut out of a turning
579
- * conic gradient, and the glow, the same gradient blurred and cut to what
580
- * lies outside the frame. Each turns a square larger than its box by a
595
+ * conic gradient, and the glow, the same gradient blurred under the frame's
596
+ * surface, so only its halo outside the frame shows. Each turns a square larger than its box by a
581
597
  * `transform`, which the compositor runs at a constant speed.
582
598
  */
583
599
  [data-ui-prompt-composer][data-part-root][data-emphasis='ring'] {
@@ -627,19 +643,31 @@
627
643
  z-index: 1;
628
644
  }
629
645
 
646
+ /**
647
+ * The glow is the frame's own box, blurred: the halo is the blur's ink, which
648
+ * fades to nothing past the edge, and ink adds no overflow to a scrolling
649
+ * ancestor. A box the reach larger, cut by a mask, gave both a hard edge and
650
+ * that overflow. The frame's surface is restated on `::after`, which paints
651
+ * above the glow, so the halo shows outside the frame only.
652
+ */
630
653
  [data-ui-prompt-composer] > [data-part-glow] {
631
- border-radius: calc(var(--_radius) + var(--_ring-reach));
632
654
  filter: blur(calc(var(--_ring-reach) / 2));
633
- inset: calc(-1 * var(--_ring-reach));
634
- mask:
635
- linear-gradient(#000 0 0) content-box exclude,
636
- linear-gradient(#000 0 0);
655
+ inset: calc(-1 * var(--slotted-control-border-width, 1px));
637
656
  opacity: var(--_glow);
638
- padding: var(--_ring-reach);
639
657
  transition: opacity var(--slotted-duration-medium) var(--slotted-easing-standard);
640
658
  z-index: -1;
641
659
  }
642
660
 
661
+ [data-ui-prompt-composer][data-part-root][data-emphasis='ring']::after {
662
+ background-color: inherit;
663
+ border-radius: inherit;
664
+ content: '';
665
+ inset: 0;
666
+ pointer-events: none;
667
+ position: absolute;
668
+ z-index: -1;
669
+ }
670
+
643
671
  [data-ui-prompt-composer] > :is([data-part-ring], [data-part-glow])::before {
644
672
  animation: slotted-prompt-composer-turn
645
673
  var(--slotted-prompt-composer-ring-duration, var(--slotted-duration-loop-slow)) linear
@@ -276,6 +276,9 @@
276
276
 
277
277
  /* An implicit column: a header with no actions has one column and no gap. */
278
278
  [data-ui-section] > [data-part-header] > [data-part-actions] {
279
+ /* An action slot states one size for the links it holds. */
280
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
281
+
279
282
  align-items: center;
280
283
  display: flex;
281
284
  gap: var(--slotted-control-gap-md, 8px);
@@ -28,6 +28,13 @@
28
28
  --slotted-stat-card-trend-inline-size,
29
29
  calc(var(--slotted-space-12, 4rem) * 1.5)
30
30
  );
31
+ /* The trend's height when it takes the last row and the card's whole
32
+ width: one step above the sparkline's own, because a line as wide as
33
+ the card at the sparkline's height reads flat. */
34
+ --_trend-block: var(--slotted-stat-card-trend-block-size, var(--slotted-space-11, 3rem));
35
+ /* The least height of a trend beside the figure, which otherwise takes
36
+ the figure's height: the sparkline's own step. */
37
+ --_trend-floor: var(--slotted-sparkline-block-size, var(--slotted-space-9, 2rem));
31
38
 
32
39
  --_surface: var(--slotted-stat-card-background, var(--slotted-surface-raised, Canvas));
33
40
  --_edge: var(--slotted-stat-card-border-color, var(--slotted-border-subtle, ButtonBorder));
@@ -102,6 +109,8 @@
102
109
  --_region-gap: var(--slotted-stat-card-region-gap-sm, var(--slotted-space-2, 0.25rem));
103
110
  --_trend-gap: var(--slotted-stat-card-trend-gap-sm, var(--slotted-space-5, 0.75rem));
104
111
  --_trend-size: var(--slotted-stat-card-trend-inline-size-sm, var(--slotted-space-12, 4rem));
112
+ --_trend-block: var(--slotted-stat-card-trend-block-size-sm, var(--slotted-space-9, 2rem));
113
+ --_trend-floor: var(--slotted-sparkline-block-size-sm, var(--slotted-space-7, 1.25rem));
105
114
  --_value-size: var(
106
115
  --slotted-stat-card-value-font-size-sm,
107
116
  var(--slotted-font-size-2xl, 1.25rem)
@@ -135,6 +144,8 @@
135
144
  --slotted-stat-card-trend-inline-size-lg,
136
145
  calc(var(--slotted-space-12, 4rem) * 2)
137
146
  );
147
+ --_trend-block: var(--slotted-stat-card-trend-block-size-lg, var(--slotted-space-12, 4rem));
148
+ --_trend-floor: var(--slotted-sparkline-block-size-lg, var(--slotted-space-11, 3rem));
138
149
  --_value-size: var(--slotted-stat-card-value-font-size-lg, var(--slotted-font-size-4xl, 2rem));
139
150
  --_value-line: var(
140
151
  --slotted-stat-card-value-line-height-lg,
@@ -239,8 +250,8 @@
239
250
  grid-template-areas:
240
251
  'header'
241
252
  'figure'
242
- 'trend'
243
- 'message';
253
+ 'message'
254
+ 'trend';
244
255
  grid-template-columns: minmax(0, 1fr);
245
256
  grid-template-rows: auto minmax(0, 1fr) auto auto;
246
257
  }
@@ -281,7 +292,7 @@
281
292
  /* The marker's ring is the card's ground, not the page's. */
282
293
  --slotted-sparkline-ring-color: var(--_surface);
283
294
 
284
- align-self: center;
295
+ align-self: stretch;
285
296
  container-name: stat-card-trend;
286
297
  container-type: inline-size;
287
298
  grid-area: trend;
@@ -298,10 +309,32 @@
298
309
  }
299
310
  }
300
311
 
312
+ /**
313
+ * On the last row the trend reaches the card's edges: its sides and its
314
+ * bottom bleed through the inset, and the card's corners round it. A line
315
+ * drawn inside the inset ends a gutter short of each edge and reads as a
316
+ * picture placed in the card; a line that runs to the frame reads as the
317
+ * card's ground. The edge is drawn over it, out of flow. A plain card has
318
+ * no inset, so the margins are nought there.
319
+ */
301
320
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
302
321
  :scope[data-layout='stacked'] [data-part-trend] {
303
322
  align-self: end;
323
+ border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
324
+ border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
325
+ margin-block-end: calc(-1 * var(--_inset-block));
304
326
  margin-block-start: var(--slotted-space-2, 0.25rem);
327
+ margin-inline: calc(-1 * var(--_inset-inline));
328
+ overflow: clip;
329
+ /* The region is wider than the column by the two insets. */
330
+ inline-size: auto;
331
+ }
332
+ }
333
+
334
+ @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
335
+ :scope[data-layout='stacked'] [data-part-trend] > * {
336
+ block-size: var(--_trend-block);
337
+ min-block-size: 0;
305
338
  }
306
339
  }
307
340
 
@@ -324,8 +357,8 @@
324
357
  grid-template-areas:
325
358
  'header'
326
359
  'figure'
327
- 'trend'
328
- 'message';
360
+ 'message'
361
+ 'trend';
329
362
  grid-template-columns: minmax(0, 1fr);
330
363
  grid-template-rows: auto minmax(0, 1fr) auto auto;
331
364
  }
@@ -334,7 +367,21 @@
334
367
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
335
368
  :scope [data-part-trend] {
336
369
  align-self: end;
370
+ border-end-end-radius: calc(var(--_radius) - var(--_edge-width));
371
+ border-end-start-radius: calc(var(--_radius) - var(--_edge-width));
372
+ margin-block-end: calc(-1 * var(--_inset-block));
337
373
  margin-block-start: var(--slotted-space-2, 0.25rem);
374
+ margin-inline: calc(-1 * var(--_inset-inline));
375
+ overflow: clip;
376
+ /* The region is wider than the column by the two insets. */
377
+ inline-size: auto;
378
+ }
379
+ }
380
+
381
+ @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
382
+ :scope [data-part-trend] > * {
383
+ block-size: var(--_trend-block);
384
+ min-block-size: 0;
338
385
  }
339
386
  }
340
387
 
@@ -406,6 +453,9 @@
406
453
  and a corner is where a control is looked for. */
407
454
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
408
455
  :scope [data-part-action] {
456
+ /* An action slot states one size for the links it holds. */
457
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
458
+
409
459
  flex: none;
410
460
  /* The label's line, so a link here is as tall in the fallback face as in
411
461
  the web face and the header does not grow when the font arrives. */
@@ -633,11 +683,27 @@
633
683
  */
634
684
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
635
685
  :scope [data-part-trend] {
636
- align-self: center;
637
686
  display: flex;
638
687
  }
639
688
  }
640
689
 
690
+ /**
691
+ * Beside the figure the trend is as tall as the figure — the value, the
692
+ * delta and the comparison under them — so its last point is read level
693
+ * with the number it ends at, and no gap opens above or below a line of a
694
+ * fixed height centred on a taller column. The sparkline's own step is the
695
+ * floor, for a figure with no comparison.
696
+ */
697
+ @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
698
+ :scope [data-part-trend] > * {
699
+ block-size: auto;
700
+ /* No height of its own to give the row: the drawing would otherwise
701
+ make the figure's row taller than the figure. */
702
+ contain: size;
703
+ min-block-size: var(--_trend-floor);
704
+ }
705
+ }
706
+
641
707
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
642
708
  :scope[data-tone='success'] [data-part-trend] {
643
709
  --slotted-sparkline-color: var(--slotted-tone-success-text);
@@ -710,9 +776,10 @@
710
776
 
711
777
  /**
712
778
  * The binding renders a `skeleton` in place of each text part and a block
713
- * in the trend, each the height of what it stands for; the sheet only has
714
- * to keep the trend's box at the sparkline's height so the card does not
715
- * change size when the line arrives.
779
+ * in the trend. The block is the trend region's child, so the rules that
780
+ * size a sparkline there size it too: the figure's height beside the
781
+ * figure, the card's width and `--_trend-block` on the last row. The card
782
+ * does not change size when the line arrives.
716
783
  */
717
784
  /**
718
785
  * The value's box is an inline flex line, so its height is its content's.
@@ -728,31 +795,4 @@
728
795
  min-block-size: calc(var(--_value-size) * var(--_value-line));
729
796
  }
730
797
  }
731
-
732
- @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
733
- :scope[data-loading] [data-part-trend] {
734
- --slotted-skeleton-block-size: var(
735
- --slotted-sparkline-block-size,
736
- var(--slotted-space-9, 2rem)
737
- );
738
- }
739
- }
740
-
741
- @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
742
- :scope[data-loading][data-size='sm'] [data-part-trend] {
743
- --slotted-skeleton-block-size: var(
744
- --slotted-sparkline-block-size-sm,
745
- var(--slotted-space-7, 1.25rem)
746
- );
747
- }
748
- }
749
-
750
- @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
751
- :scope[data-loading][data-size='lg'] [data-part-trend] {
752
- --slotted-skeleton-block-size: var(
753
- --slotted-sparkline-block-size-lg,
754
- var(--slotted-space-11, 3rem)
755
- );
756
- }
757
- }
758
798
  }
@@ -72,6 +72,9 @@
72
72
  "--slotted-stat-card-region-gap-sm",
73
73
  "--slotted-stat-card-shadow",
74
74
  "--slotted-stat-card-shadow-elevated",
75
+ "--slotted-stat-card-trend-block-size",
76
+ "--slotted-stat-card-trend-block-size-lg",
77
+ "--slotted-stat-card-trend-block-size-sm",
75
78
  "--slotted-stat-card-trend-gap",
76
79
  "--slotted-stat-card-trend-gap-lg",
77
80
  "--slotted-stat-card-trend-gap-sm",
@@ -259,6 +259,9 @@
259
259
  column's digits ended at one edge and their name at the other. */
260
260
  [data-ui-table] [data-part-column-header],
261
261
  [data-ui-table] [data-part-head] [data-part-selection] {
262
+ /* What a pinned header cell paints, in place of its row's ground. */
263
+ --_pinned-ground: var(--_head-surface);
264
+
262
265
  background-color: var(--_head-surface);
263
266
  border-block-end: var(--_rule-width) solid var(--_rule-strong);
264
267
  color: var(--_text);
@@ -279,6 +282,8 @@
279
282
  }
280
283
 
281
284
  [data-ui-table][data-variant='plain'] [data-part-column-header] {
285
+ --_pinned-ground: transparent;
286
+
282
287
  background-color: transparent;
283
288
  }
284
289
 
@@ -286,7 +291,10 @@
286
291
  * ── Rows and cells ─────────────────────────────────────────────────────
287
292
  */
288
293
  [data-ui-table] [data-part-row] {
289
- background-color: var(--_surface);
294
+ /* Published for a pinned cell, which paints it over an opaque ground. */
295
+ --_row-ground: var(--_surface);
296
+
297
+ background-color: var(--_row-ground);
290
298
  }
291
299
 
292
300
  /**
@@ -470,7 +478,7 @@
470
478
  the same body, so the stripe follows the record it belongs to rather than
471
479
  alternating around it — see the detail rule below. */
472
480
  [data-ui-table][data-striped] [data-part-body] > [data-part-row]:nth-child(even) {
473
- background-color: var(--_stripe);
481
+ --_row-ground: var(--_stripe);
474
482
  }
475
483
 
476
484
  /**
@@ -482,7 +490,7 @@
482
490
  * disabled does not answer the pointer at all.
483
491
  */
484
492
  [data-ui-table] [data-part-body] > [data-part-row]:not([data-disabled]):hover {
485
- background-color: var(--_hover);
493
+ --_row-ground: var(--_hover);
486
494
  }
487
495
 
488
496
  /**
@@ -498,12 +506,12 @@
498
506
  * requirement anyway.
499
507
  */
500
508
  [data-ui-table] [data-part-body] > [data-part-row][data-selected] {
501
- background-color: var(--_selected);
509
+ --_row-ground: var(--_selected);
502
510
  color: var(--_selected-text);
503
511
  }
504
512
 
505
513
  [data-ui-table] [data-part-body] > [data-part-row][data-selected]:not([data-disabled]):hover {
506
- background-color: var(--_selected-hover);
514
+ --_row-ground: var(--_selected-hover);
507
515
  }
508
516
 
509
517
  [data-ui-table] [data-part-row][data-disabled] {
@@ -518,7 +526,7 @@
518
526
  * scrolled cells through it. Selection is stronger and paints over it.
519
527
  */
520
528
  [data-ui-table] [data-part-body] > [data-part-row][data-current]:not([data-selected]) {
521
- background-color: var(
529
+ --_row-ground: var(
522
530
  --slotted-table-row-surface-current,
523
531
  var(--slotted-tone-secondary-subtle-active, ButtonFace)
524
532
  );
@@ -729,11 +737,20 @@
729
737
  z-index: calc(var(--slotted-z-index-sticky, 100) + 2);
730
738
  }
731
739
 
740
+ /* The ground the row is painted with, whatever state it is in, so a
741
+ hovered, striped or selected row keeps one colour across the seam — over
742
+ the page's own surface, so a row on a transparent table surface still
743
+ covers what scrolls under it. `inherit` copied a transparent row as is. */
744
+ [data-ui-table] [data-sticky] {
745
+ background:
746
+ linear-gradient(
747
+ var(--_pinned-ground, var(--_row-ground)),
748
+ var(--_pinned-ground, var(--_row-ground))
749
+ ),
750
+ var(--slotted-surface, Canvas);
751
+ }
752
+
732
753
  [data-ui-table] [data-sticky='start'] {
733
- /* The ground the row is painted with, whatever state it is in: `inherit`
734
- takes the row's own computed value, so a hovered, striped or selected row
735
- keeps one colour across the seam. */
736
- background-color: inherit;
737
754
  /**
738
755
  * Where the column stops, and it is stated rather than measured. Two
739
756
  * columns pinned to the same edge both resolve against the scroller, so
@@ -748,7 +765,6 @@
748
765
  }
749
766
 
750
767
  [data-ui-table] [data-sticky='end'] {
751
- background-color: inherit;
752
768
  inset-inline-end: var(--slotted-table-sticky-inset, 0);
753
769
  position: sticky;
754
770
  z-index: var(--slotted-z-index-sticky, 100);
@@ -1550,6 +1566,8 @@
1550
1566
  * table holding the consumer's own controls.
1551
1567
  */
1552
1568
  [data-ui-table] [data-part-summary] > [data-part-row] > * {
1569
+ --_pinned-ground: var(--_head-surface);
1570
+
1553
1571
  background-color: var(--_head-surface);
1554
1572
  border-block-start: var(--_rule-width) solid var(--_rule-strong);
1555
1573
  font-weight: var(--slotted-font-weight-medium, 500);
@@ -1558,6 +1576,8 @@
1558
1576
  }
1559
1577
 
1560
1578
  [data-ui-table][data-variant='plain'] [data-part-summary] > [data-part-row] > * {
1579
+ --_pinned-ground: transparent;
1580
+
1561
1581
  background-color: transparent;
1562
1582
  }
1563
1583