@slotted/styles 0.1.0-beta.2 → 0.1.0-beta.21

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 (191) hide show
  1. package/package.json +1 -1
  2. package/src/accordion/accordion.css +10 -10
  3. package/src/action-bar/action-bar.css +45 -42
  4. package/src/action-bar/action-bar.tokens.json +1 -0
  5. package/src/action-sheet/action-sheet.css +36 -36
  6. package/src/alert/alert.css +68 -67
  7. package/src/alert/alert.tokens.json +5 -0
  8. package/src/app-shell/app-shell.css +452 -314
  9. package/src/app-shell/app-shell.tokens.json +5 -2
  10. package/src/aspect-ratio/aspect-ratio.css +9 -9
  11. package/src/attachment/attachment.css +91 -99
  12. package/src/avatar/avatar.css +71 -41
  13. package/src/avatar/avatar.tokens.json +7 -0
  14. package/src/avatar-group/avatar-group.css +21 -22
  15. package/src/badge/badge.css +45 -37
  16. package/src/badge/badge.tokens.json +5 -0
  17. package/src/breadcrumb/breadcrumb.css +37 -37
  18. package/src/button/button.css +149 -68
  19. package/src/button/button.tokens.json +10 -0
  20. package/src/button-group/button-group.css +79 -74
  21. package/src/button-group/button-group.tokens.json +2 -0
  22. package/src/calendar/calendar.css +133 -103
  23. package/src/calendar/calendar.tokens.json +5 -1
  24. package/src/card/card.css +54 -61
  25. package/src/carousel/carousel.css +150 -161
  26. package/src/cascader/cascader.css +154 -153
  27. package/src/cascader/cascader.tokens.json +1 -0
  28. package/src/chart/chart.css +258 -248
  29. package/src/chart/chart.tokens.json +1 -0
  30. package/src/checkbox/checkbox.css +119 -124
  31. package/src/checkbox-group/checkbox-group.css +7 -7
  32. package/src/code-block/code-block.css +81 -85
  33. package/src/collapsible/collapsible.css +72 -76
  34. package/src/color-picker/color-picker.css +83 -91
  35. package/src/column-manager/column-manager.css +106 -114
  36. package/src/combobox/combobox.css +157 -124
  37. package/src/combobox/combobox.tokens.json +2 -0
  38. package/src/command-palette/command-palette.css +103 -90
  39. package/src/command-palette/command-palette.tokens.json +1 -0
  40. package/src/container/container.css +24 -24
  41. package/src/context-menu/context-menu.css +8 -8
  42. package/src/currency-field/currency-field.css +212 -88
  43. package/src/currency-field/currency-field.tokens.json +13 -0
  44. package/src/dashboard-grid/dashboard-grid.css +184 -114
  45. package/src/data-grid/data-grid.css +535 -470
  46. package/src/data-grid/data-grid.tokens.json +4 -0
  47. package/src/data-list/data-list.css +81 -70
  48. package/src/data-list/data-list.tokens.json +2 -1
  49. package/src/date-field/date-field.css +57 -52
  50. package/src/date-field/date-field.tokens.json +1 -0
  51. package/src/date-picker/date-picker.css +75 -57
  52. package/src/date-picker/date-picker.tokens.json +1 -0
  53. package/src/date-range-picker/date-range-picker.css +116 -118
  54. package/src/datetime-field/datetime-field.css +80 -80
  55. package/src/datetime-field/datetime-field.tokens.json +1 -0
  56. package/src/datetime-picker/datetime-picker.css +63 -63
  57. package/src/datetime-range-picker/datetime-range-picker.css +151 -156
  58. package/src/description-list/description-list.css +80 -65
  59. package/src/detail-panel/detail-panel.css +86 -71
  60. package/src/detail-panel/detail-panel.tokens.json +2 -0
  61. package/src/dialog/dialog.css +376 -153
  62. package/src/dialog/dialog.tokens.json +6 -0
  63. package/src/divider/divider.css +18 -18
  64. package/src/drawer/drawer.css +513 -217
  65. package/src/drawer/drawer.tokens.json +6 -0
  66. package/src/entity-picker/entity-picker.css +273 -256
  67. package/src/entity-picker/entity-picker.tokens.json +2 -0
  68. package/src/event-calendar/event-calendar.css +343 -385
  69. package/src/field/field.css +74 -78
  70. package/src/field-group/field-group.css +22 -25
  71. package/src/filter-bar/filter-bar.css +193 -209
  72. package/src/form/form.css +34 -24
  73. package/src/form/form.tokens.json +1 -0
  74. package/src/fullscreen/fullscreen.css +24 -25
  75. package/src/grid/grid.css +28 -28
  76. package/src/highlight/highlight.css +6 -6
  77. package/src/hover-card/hover-card.css +6 -6
  78. package/src/icon/icon.css +62 -15
  79. package/src/icon/icon.tokens.json +1 -0
  80. package/src/image/image.css +39 -39
  81. package/src/import-export-center/import-export-center.css +135 -156
  82. package/src/inline/inline.css +27 -27
  83. package/src/inline-message/inline-message.css +153 -77
  84. package/src/inline-message/inline-message.tokens.json +4 -0
  85. package/src/kbd/kbd.css +48 -36
  86. package/src/kbd/kbd.tokens.json +3 -0
  87. package/src/link/link.css +36 -15
  88. package/src/link/link.tokens.json +4 -0
  89. package/src/list/list.css +44 -17
  90. package/src/list/list.tokens.json +4 -0
  91. package/src/list-item/list-item.css +80 -66
  92. package/src/list-item/list-item.tokens.json +7 -0
  93. package/src/listbox/listbox.css +56 -59
  94. package/src/loading-overlay/loading-overlay.css +75 -92
  95. package/src/markdown/markdown.css +17 -17
  96. package/src/menu/menu.css +117 -74
  97. package/src/menu/menu.tokens.json +1 -0
  98. package/src/menubar/menubar.css +13 -13
  99. package/src/message/message.css +192 -202
  100. package/src/message/message.tokens.json +5 -0
  101. package/src/message-scroller/message-scroller.css +41 -42
  102. package/src/multi-select/multi-select.css +177 -160
  103. package/src/multi-select/multi-select.tokens.json +1 -0
  104. package/src/navigation-menu/navigation-menu.css +167 -188
  105. package/src/notification-center/notification-center.css +140 -148
  106. package/src/notification-center/notification-center.tokens.json +3 -0
  107. package/src/number-field/number-field.css +83 -83
  108. package/src/number-field/number-field.tokens.json +1 -0
  109. package/src/otp-input/otp-input.css +67 -57
  110. package/src/otp-input/otp-input.tokens.json +1 -0
  111. package/src/page/page.css +39 -23
  112. package/src/page/page.tokens.json +1 -0
  113. package/src/page-header/page-header.css +339 -284
  114. package/src/page-header/page-header.tokens.json +5 -0
  115. package/src/pagination/pagination.css +68 -72
  116. package/src/popover/popover.css +73 -61
  117. package/src/popover/popover.tokens.json +1 -0
  118. package/src/progress-indicator/progress-indicator.css +169 -113
  119. package/src/progress-indicator/progress-indicator.tokens.json +1 -0
  120. package/src/prompt-composer/prompt-composer.css +251 -104
  121. package/src/prompt-composer/prompt-composer.tokens.json +15 -0
  122. package/src/prose/prose.css +71 -75
  123. package/src/radio-group/radio-group.css +98 -103
  124. package/src/rating/rating.css +136 -132
  125. package/src/rating/rating.tokens.json +1 -0
  126. package/src/result-state/result-state.css +74 -77
  127. package/src/runtime-properties.mjs +2 -0
  128. package/src/saved-views/saved-views.css +41 -47
  129. package/src/scroll-area/scroll-area.css +39 -32
  130. package/src/section/section.css +178 -43
  131. package/src/section/section.tokens.json +8 -2
  132. package/src/segmented-control/segmented-control.css +254 -97
  133. package/src/segmented-control/segmented-control.tokens.json +15 -11
  134. package/src/select/select.css +153 -132
  135. package/src/select/select.tokens.json +2 -0
  136. package/src/side-navigation/side-navigation.css +179 -182
  137. package/src/side-navigation/side-navigation.tokens.json +1 -0
  138. package/src/skeleton/skeleton.css +47 -48
  139. package/src/slider/slider.css +86 -88
  140. package/src/sparkline/sparkline.css +62 -40
  141. package/src/sparkline/sparkline.tokens.json +2 -0
  142. package/src/spinner/spinner.css +83 -180
  143. package/src/spinner/spinner.tokens.json +0 -1
  144. package/src/split-button/split-button.css +30 -31
  145. package/src/split-button/split-button.tokens.json +1 -0
  146. package/src/splitter/splitter.css +35 -35
  147. package/src/stack/stack.css +24 -24
  148. package/src/stat-card/stat-card.css +380 -241
  149. package/src/stat-card/stat-card.tokens.json +5 -0
  150. package/src/status-indicator/status-indicator.css +107 -82
  151. package/src/status-indicator/status-indicator.tokens.json +0 -3
  152. package/src/stepper/stepper.css +58 -62
  153. package/src/switch/switch.css +86 -92
  154. package/src/table/table.css +340 -175
  155. package/src/table/table.tokens.json +6 -0
  156. package/src/table-of-contents/table-of-contents.css +57 -56
  157. package/src/table-of-contents/table-of-contents.tokens.json +1 -0
  158. package/src/tabs/tabs.css +322 -289
  159. package/src/tabs/tabs.tokens.json +7 -1
  160. package/src/tag/tag.css +91 -71
  161. package/src/tag/tag.tokens.json +9 -0
  162. package/src/tags-input/tags-input.css +147 -82
  163. package/src/tags-input/tags-input.tokens.json +7 -1
  164. package/src/text-field/text-field.css +134 -136
  165. package/src/text-field/text-field.tokens.json +1 -0
  166. package/src/textarea/textarea.css +33 -28
  167. package/src/textarea/textarea.tokens.json +1 -0
  168. package/src/time-field/time-field.css +74 -69
  169. package/src/time-field/time-field.tokens.json +1 -0
  170. package/src/time-picker/time-picker.css +58 -58
  171. package/src/time-range-picker/time-range-picker.css +128 -133
  172. package/src/timeline/timeline.css +254 -266
  173. package/src/timeline/timeline.tokens.json +5 -0
  174. package/src/toast/toast.css +115 -98
  175. package/src/toast/toast.tokens.json +6 -0
  176. package/src/toggle/toggle.css +62 -25
  177. package/src/toggle/toggle.tokens.json +8 -0
  178. package/src/toggle-group/toggle-group.css +106 -60
  179. package/src/toggle-group/toggle-group.tokens.json +10 -0
  180. package/src/toolbar/toolbar.css +30 -35
  181. package/src/tooltip/tooltip.css +59 -38
  182. package/src/tooltip/tooltip.tokens.json +1 -0
  183. package/src/top-navigation/top-navigation.css +243 -259
  184. package/src/tour/tour.css +51 -60
  185. package/src/transfer/transfer.css +160 -164
  186. package/src/tree/tree.css +103 -111
  187. package/src/typography/typography.css +40 -36
  188. package/src/typography/typography.tokens.json +1 -0
  189. package/src/upload/upload.css +224 -224
  190. package/src/visually-hidden/visually-hidden.css +1 -1
  191. package/src/wizard/wizard.css +185 -197
@@ -10,7 +10,7 @@
10
10
  * type step, so a run of items reads as one line rather than as a list laid
11
11
  * sideways.
12
12
  */
13
- [data-ui='inline'] {
13
+ [data-ui-inline] {
14
14
  --_gap: var(--slotted-space-4, 0.5rem);
15
15
 
16
16
  display: flex;
@@ -27,55 +27,55 @@
27
27
  }
28
28
 
29
29
  /* Separation is a step on the scale, never a length the consumer states. */
30
- [data-ui='inline'][data-gap='0'] {
30
+ [data-ui-inline][data-gap='0'] {
31
31
  --_gap: 0;
32
32
  }
33
33
 
34
- [data-ui='inline'][data-gap='1'] {
34
+ [data-ui-inline][data-gap='1'] {
35
35
  --_gap: var(--slotted-space-1, 0.125rem);
36
36
  }
37
37
 
38
- [data-ui='inline'][data-gap='2'] {
38
+ [data-ui-inline][data-gap='2'] {
39
39
  --_gap: var(--slotted-space-2, 0.25rem);
40
40
  }
41
41
 
42
- [data-ui='inline'][data-gap='3'] {
42
+ [data-ui-inline][data-gap='3'] {
43
43
  --_gap: var(--slotted-space-3, 0.375rem);
44
44
  }
45
45
 
46
- [data-ui='inline'][data-gap='4'] {
46
+ [data-ui-inline][data-gap='4'] {
47
47
  --_gap: var(--slotted-space-4, 0.5rem);
48
48
  }
49
49
 
50
- [data-ui='inline'][data-gap='5'] {
50
+ [data-ui-inline][data-gap='5'] {
51
51
  --_gap: var(--slotted-space-5, 0.75rem);
52
52
  }
53
53
 
54
- [data-ui='inline'][data-gap='6'] {
54
+ [data-ui-inline][data-gap='6'] {
55
55
  --_gap: var(--slotted-space-6, 1rem);
56
56
  }
57
57
 
58
- [data-ui='inline'][data-gap='7'] {
58
+ [data-ui-inline][data-gap='7'] {
59
59
  --_gap: var(--slotted-space-7, 1.25rem);
60
60
  }
61
61
 
62
- [data-ui='inline'][data-gap='8'] {
62
+ [data-ui-inline][data-gap='8'] {
63
63
  --_gap: var(--slotted-space-8, 1.5rem);
64
64
  }
65
65
 
66
- [data-ui='inline'][data-gap='9'] {
66
+ [data-ui-inline][data-gap='9'] {
67
67
  --_gap: var(--slotted-space-9, 2rem);
68
68
  }
69
69
 
70
- [data-ui='inline'][data-gap='10'] {
70
+ [data-ui-inline][data-gap='10'] {
71
71
  --_gap: var(--slotted-space-10, 2.5rem);
72
72
  }
73
73
 
74
- [data-ui='inline'][data-gap='11'] {
74
+ [data-ui-inline][data-gap='11'] {
75
75
  --_gap: var(--slotted-space-11, 3rem);
76
76
  }
77
77
 
78
- [data-ui='inline'][data-gap='12'] {
78
+ [data-ui-inline][data-gap='12'] {
79
79
  --_gap: var(--slotted-space-12, 4rem);
80
80
  }
81
81
 
@@ -85,23 +85,23 @@
85
85
  * line can share a baseline, and a label beside a badge reads wrong without
86
86
  * it.
87
87
  */
88
- [data-ui='inline'][data-align='start'] {
88
+ [data-ui-inline][data-align='start'] {
89
89
  align-items: start;
90
90
  }
91
91
 
92
- [data-ui='inline'][data-align='center'] {
92
+ [data-ui-inline][data-align='center'] {
93
93
  align-items: center;
94
94
  }
95
95
 
96
- [data-ui='inline'][data-align='end'] {
96
+ [data-ui-inline][data-align='end'] {
97
97
  align-items: end;
98
98
  }
99
99
 
100
- [data-ui='inline'][data-align='stretch'] {
100
+ [data-ui-inline][data-align='stretch'] {
101
101
  align-items: stretch;
102
102
  }
103
103
 
104
- [data-ui='inline'][data-align='baseline'] {
104
+ [data-ui-inline][data-align='baseline'] {
105
105
  align-items: baseline;
106
106
  }
107
107
 
@@ -110,31 +110,31 @@
110
110
  * axis. The keywords are the logical ones, so a right-to-left document is the
111
111
  * same component mirrored rather than a second stylesheet.
112
112
  */
113
- [data-ui='inline'][data-justify='start'] {
113
+ [data-ui-inline][data-justify='start'] {
114
114
  justify-content: start;
115
115
  }
116
116
 
117
- [data-ui='inline'][data-justify='center'] {
117
+ [data-ui-inline][data-justify='center'] {
118
118
  justify-content: center;
119
119
  }
120
120
 
121
- [data-ui='inline'][data-justify='end'] {
121
+ [data-ui-inline][data-justify='end'] {
122
122
  justify-content: end;
123
123
  }
124
124
 
125
- [data-ui='inline'][data-justify='between'] {
125
+ [data-ui-inline][data-justify='between'] {
126
126
  justify-content: space-between;
127
127
  }
128
128
 
129
- [data-ui='inline'][data-justify='around'] {
129
+ [data-ui-inline][data-justify='around'] {
130
130
  justify-content: space-around;
131
131
  }
132
132
 
133
- [data-ui='inline'][data-justify='evenly'] {
133
+ [data-ui-inline][data-justify='evenly'] {
134
134
  justify-content: space-evenly;
135
135
  }
136
136
 
137
- [data-ui='inline'][data-wrap='wrap'] {
137
+ [data-ui-inline][data-wrap='wrap'] {
138
138
  flex-wrap: wrap;
139
139
  }
140
140
 
@@ -143,7 +143,7 @@
143
143
  * content. That is what the consumer asked for, and it is why the family does
144
144
  * not ask for it on the consumer's behalf.
145
145
  */
146
- [data-ui='inline'][data-wrap='nowrap'] {
146
+ [data-ui-inline][data-wrap='nowrap'] {
147
147
  flex-wrap: nowrap;
148
148
  }
149
149
  }
@@ -11,16 +11,20 @@
11
11
  * message with nothing around it, so it inherits the rhythm of whatever
12
12
  * placed it — a field, a `Stack`, a table cell.
13
13
  *
14
- * Two facts the layout rests on:
14
+ * Three facts the layout rests on:
15
15
  *
16
- * - The mark is one line box tall rather than centred on the whole message,
17
- * so it stays on the first line when the sentence wraps to three.
16
+ * - The mark is inside the first line, not in a column beside it: an
17
+ * `inline-flex` box before the sentence, so it is on that line at every
18
+ * wrap, font, zoom and baseline a parent aligns to.
19
+ * - The lines after the first hang: the root is padded by the mark and its
20
+ * gap and the first line indented back by the same, so a sentence that
21
+ * wraps continues under its own first word, never under the mark.
18
22
  * - The severity word is out of flow. It is a real element with real text,
19
23
  * clipped by the WCAG 2.2 technique C7 rule set and placed first in the
20
24
  * DOM so it is read first; `position: absolute` is what keeps it from
21
- * taking a grid cell or adding a line.
25
+ * adding a line.
22
26
  */
23
- [data-ui='inline-message'][data-part='root'] {
27
+ [data-ui-inline-message][data-part-root] {
24
28
  /**
25
29
  * The default is the help tone, which is what most fields carry. It is the
26
30
  * one tone that paints in the neutral muted ink rather than in a tone's
@@ -39,13 +43,15 @@
39
43
  * line, and this box holds a sentence.
40
44
  *
41
45
  * The mark is the sentence's own size (R5), the rule `alert` draws its
42
- * mark with: `1em` resolves against this box, so the mark steps with the
43
- * size and the density through the type rather than through a second
44
- * scale. A fourteen-pixel glyph beside twelve-pixel type was two pixels
45
- * taller than the capitals it stood next to.
46
+ * mark with, rounded to an even pixel so its centre lands on a whole one:
47
+ * 12 pixels beside 12-pixel type, 14 beside 13. The status glyphs are
48
+ * drawn on those two grids (`@slotted/core/glyph`), so every cut of the
49
+ * symbol is on a device pixel. A fourteen-pixel Lucide glyph reduced to
50
+ * twelve-pixel type was two pixels taller than the capitals it stood
51
+ * next to; a drawing made for the size has no such reduction.
46
52
  */
47
53
  --_font-size: var(--slotted-control-font-size-sm, 12px);
48
- --_mark-size: 1em;
54
+ --_mark-size: round(nearest, 1em, 2px);
49
55
  /**
50
56
  * The distance from the mark to its own sentence: eight pixels, the step
51
57
  * `alert` uses (R5). It does not step with the size — the mark already
@@ -53,27 +59,43 @@
53
59
  * the two apart twice.
54
60
  */
55
61
  --_column-gap: var(--slotted-inline-message-column-gap, var(--slotted-space-4, 0.5rem));
62
+ /* What the first line gives back to the mark. Zero wherever no mark is drawn. */
63
+ --_indent: calc(var(--_mark-size) + var(--_column-gap));
56
64
 
57
65
  color: var(--_text);
58
- /**
59
- * Two columns, both placed explicitly. Auto-placement would drop the
60
- * sentence into the first column whenever the message has no mark, and the
61
- * sentence would then be sized by a track that shrinks to its content
62
- * with an empty `1fr` beside it.
63
- */
64
- display: grid;
66
+ display: block;
65
67
  font-family: var(
66
68
  --slotted-inline-message-font-family,
67
69
  var(--slotted-control-font-family, sans-serif)
68
70
  );
69
71
  font-size: var(--_font-size);
70
- grid-template-columns: auto minmax(0, 1fr);
71
- line-height: var(--slotted-inline-message-line-height, var(--slotted-line-height-md, 1.5));
72
+ /**
73
+ * The leading, rounded up to an even pixel: 13 × 1.5 is 19.5 and lands
74
+ * every line, and the mark centred on it, across two device pixels. 20
75
+ * and 18 leave a whole pixel of half-leading on each side.
76
+ */
77
+ line-height: round(
78
+ up,
79
+ 1em * var(--slotted-inline-message-line-height, var(--slotted-line-height-md, 1.5)),
80
+ 2px
81
+ );
72
82
  /* A `p` arrives with the user agent's block margins; the distance between a
73
83
  control and its message belongs to whatever placed the two. */
74
84
  margin: 0;
85
+ /* A sentence longer than this is two sentences. */
86
+ max-inline-size: 68ch;
87
+ padding-inline-start: var(--_indent);
75
88
  /* The containing block for the clipped severity word. */
76
89
  position: relative;
90
+ text-indent: calc(-1 * var(--_indent));
91
+ /**
92
+ * The box runs from the capitals of the first line to the baseline of the
93
+ * last, so whatever placed the message measures its distance to the type
94
+ * rather than to the half-leading around it: the field's six-pixel row gap
95
+ * is six pixels from the control to the capitals.
96
+ */
97
+ text-box: trim-both cap alphabetic;
98
+ text-wrap: pretty;
77
99
  }
78
100
 
79
101
  /* ── Tone: what the message is about ──────────────────────────────────
@@ -91,23 +113,27 @@
91
113
  * a severity.
92
114
  */
93
115
 
94
- [data-ui='inline-message'][data-part='root'][data-tone='accent'] {
116
+ [data-ui-inline-message][data-part-root][data-tone='accent'] {
95
117
  --_text: var(--slotted-tone-accent-text);
96
118
  }
97
119
 
98
- [data-ui='inline-message'][data-part='root'][data-tone='secondary'] {
120
+ [data-ui-inline-message][data-part-root][data-tone='secondary'] {
99
121
  --_text: var(--slotted-text-muted);
100
122
  }
101
123
 
102
- [data-ui='inline-message'][data-part='root'][data-tone='success'] {
124
+ [data-ui-inline-message][data-part-root][data-tone='success'] {
103
125
  --_text: var(--slotted-tone-success-text);
104
126
  }
105
127
 
106
- [data-ui='inline-message'][data-part='root'][data-tone='warning'] {
128
+ [data-ui-inline-message][data-part-root][data-tone='info'] {
129
+ --_text: var(--slotted-tone-info-text);
130
+ }
131
+
132
+ [data-ui-inline-message][data-part-root][data-tone='warning'] {
107
133
  --_text: var(--slotted-tone-warning-text);
108
134
  }
109
135
 
110
- [data-ui='inline-message'][data-part='root'][data-tone='danger'] {
136
+ [data-ui-inline-message][data-part-root][data-tone='danger'] {
111
137
  --_text: var(--slotted-tone-danger-text);
112
138
  }
113
139
 
@@ -119,28 +145,35 @@
119
145
  * field. Both are restated per density by the theme.
120
146
  */
121
147
 
122
- [data-ui='inline-message'][data-part='root'][data-size='sm'] {
148
+ [data-ui-inline-message][data-part-root][data-size='sm'] {
123
149
  --_font-size: var(--slotted-control-font-size-sm, 12px);
124
150
  }
125
151
 
126
- [data-ui='inline-message'][data-part='root'][data-size='md'] {
152
+ [data-ui-inline-message][data-part-root][data-size='md'] {
127
153
  --_font-size: var(--slotted-control-font-size-md, 13px);
128
154
  }
129
155
 
130
156
  /**
131
- * The line held open for a message that has not arrived. `1lh` is one line
132
- * box of the family's own leading, so it follows the size step and the
133
- * density rather than a number — and an application renders the message
134
- * unconditionally without the field below it moving when the error appears.
157
+ * The line held open for a message that has not arrived: one line of the
158
+ * family's own type, so it follows the size step and the density rather than
159
+ * a number — and an application renders the message unconditionally without
160
+ * the field below it moving when the error appears. Where the box is trimmed
161
+ * to the capitals, one line of it is `1cap` tall, and so is the reserve.
135
162
  *
136
163
  * Material UI reserves the same line by asking the consumer to pass a space
137
164
  * character as the message. A space is content: it defeats `:empty` below, so
138
165
  * the mark and the severity word would be drawn beside nothing.
139
166
  */
140
- [data-ui='inline-message'][data-part='root'][data-reserve] {
167
+ [data-ui-inline-message][data-part-root][data-reserve] {
141
168
  min-block-size: 1lh;
142
169
  }
143
170
 
171
+ @supports (text-box: trim-both cap alphabetic) {
172
+ [data-ui-inline-message][data-part-root][data-reserve] {
173
+ min-block-size: 1cap;
174
+ }
175
+ }
176
+
144
177
  /* ── The severity, in words ───────────────────────────────────────────
145
178
  *
146
179
  * The defect this family exists to fix. A reader who cannot see the message
@@ -156,7 +189,7 @@
156
189
  * a one-pixel box, clipped, out of flow, on a single line, with the negative
157
190
  * margin that keeps it from adding a pixel of scrollable overflow.
158
191
  */
159
- [data-ui='inline-message'] > [data-part='prefix'] {
192
+ [data-ui-inline-message] > [data-part-prefix] {
160
193
  block-size: 1px;
161
194
  border: 0;
162
195
  clip-path: inset(50%);
@@ -170,33 +203,41 @@
170
203
 
171
204
  /* ── The mark ─────────────────────────────────────────────────────────
172
205
  *
173
- * A square the sentence's own size, on its first line (R5), and the rule
174
- * `alert` draws its mark with. The box is exactly the glyph — no line box
175
- * around it, no ground behind it — pushed down from the start of the row by
176
- * half the difference between one line and the mark. `1lh` and `1em` both
177
- * resolve against the root, so the mark's centre is the first line's centre
178
- * at every size, every density and every type step without a number saying
179
- * how, and it stays there when the sentence wraps to three.
206
+ * A square the sentence's own size, on its first line (R5). Its centre is
207
+ * the centre of the capitals, `0.5cap` above the baseline — the axis
208
+ * `[data-ui-icon]` aligns every icon on — so the mark sits on the words
209
+ * rather than on the line box around them, and stays there when the
210
+ * sentence wraps to three. The offset is rounded to the device pixel: half
211
+ * a pixel at 2×, a whole one below 1.5×.
180
212
  *
181
213
  * The glyph is the binding's `Glyph` in an `icon` box, chosen from the tone
182
- * and stroked in `currentcolor`; the slot sizes it through the icon token.
183
- * A mark the page supplies instead takes the same box and its place on the
184
- * first line, centred in it.
214
+ * and filled in `currentcolor`; the slot sizes it through the icon token.
215
+ * A mark the page supplies instead takes the same box, centred in it.
216
+ *
217
+ * `text-indent` is inherited, and the root's is negative: every box the
218
+ * message holds takes it back.
185
219
  */
186
- [data-ui='inline-message'] > [data-part='icon'] {
220
+ [data-ui-inline-message] > [data-part-icon] {
187
221
  --slotted-icon-size: var(--_mark-size);
188
222
 
189
223
  align-items: center;
190
- align-self: start;
191
224
  block-size: var(--_mark-size);
192
225
  box-sizing: border-box;
193
- display: flex;
194
- grid-column: 1;
195
- grid-row: 1;
226
+ /* The box's baseline is its own bottom edge, never the baseline of what it
227
+ holds: a dot glyph shorter than the box lowered the box by the difference. */
228
+ contain: layout;
229
+ display: inline-flex;
196
230
  inline-size: var(--_mark-size);
197
231
  justify-content: center;
198
- margin-block-start: calc((1lh - var(--_mark-size)) / 2);
199
232
  margin-inline-end: var(--_column-gap);
233
+ text-indent: 0;
234
+ vertical-align: round(nearest, calc(0.5cap - var(--_mark-size) / 2), 0.5px);
235
+ }
236
+
237
+ @media (max-resolution: 1.49dppx) {
238
+ [data-ui-inline-message] > [data-part-icon] {
239
+ vertical-align: round(nearest, calc(0.5cap - var(--_mark-size) / 2), 1px);
240
+ }
200
241
  }
201
242
 
202
243
  /**
@@ -209,8 +250,8 @@
209
250
  * changes between them. `field` asked for it once and no longer does (F1):
210
251
  * help under a field draws no mark, and an error draws the tone's own.
211
252
  *
212
- * The disc is a third of the mark — 4 pixels under 12-pixel type — so it
213
- * steps with the size step and with the density like every other mark. The
253
+ * The disc is a third of the mark rounded to an even pixel — 4 pixels at
254
+ * both steps — so its centre is on a whole pixel like every other mark. The
214
255
  * slot is the disc's own width and the glyph's box is twice that, because
215
256
  * the `dot` glyph draws a circle half the width of its own viewBox: at twice
216
257
  * the slot the disc fills the slot exactly, the box overhanging it equally
@@ -221,12 +262,18 @@
221
262
  * page's own artwork alone: a supplied mark keeps the full box it was
222
263
  * measured for.
223
264
  */
224
- [data-ui='inline-message'][data-part='root'][data-mark='dot'] {
225
- --_dot-size: calc(var(--_mark-size) / 3);
265
+ [data-ui-inline-message][data-part-root][data-mark='dot'] {
266
+ --_dot-size: round(nearest, var(--_mark-size) / 3, 2px);
267
+ }
268
+
269
+ [data-ui-inline-message][data-part-root][data-mark='dot']:has(
270
+ > [data-part-icon] > [data-ui-icon] > [data-glyph='dot']
271
+ ) {
272
+ --_indent: calc(var(--_dot-size) + var(--_column-gap));
226
273
  }
227
274
 
228
- [data-ui='inline-message'][data-mark='dot']
229
- > [data-part='icon']:has(> [data-ui='icon'] > [data-glyph='dot']) {
275
+ [data-ui-inline-message][data-mark='dot']
276
+ > [data-part-icon]:has(> [data-ui-icon] > [data-glyph='dot']) {
230
277
  --slotted-icon-size: calc(var(--_dot-size) * 2);
231
278
 
232
279
  inline-size: var(--_dot-size);
@@ -242,11 +289,27 @@
242
289
  * and it is stated as an absence rather than as `[data-mark='glyph']` so
243
290
  * markup written without the attribute keeps the rule.
244
291
  */
245
- [data-ui='inline-message'][data-tone='secondary']:not([data-loading]):not([data-mark='dot'])
246
- > [data-part='icon']:empty {
292
+ [data-ui-inline-message][data-tone='secondary']:not([data-loading]):not([data-mark='dot'])
293
+ > [data-part-icon]:empty {
247
294
  display: none;
248
295
  }
249
296
 
297
+ /**
298
+ * A withdrawn mark gives its indent back, under every condition that
299
+ * withdraws it: none drawn, help's empty box, `mark='none'`, and nothing to
300
+ * say.
301
+ */
302
+ [data-ui-inline-message][data-part-root]:not(:has(> [data-part-icon])),
303
+ [data-ui-inline-message][data-part-root][data-tone='secondary']:not([data-loading]):not(
304
+ [data-mark='dot']
305
+ ):has(> [data-part-icon]:empty),
306
+ [data-ui-inline-message][data-part-root][data-mark='none']:not([data-loading]):has(
307
+ > [data-part-icon]:empty
308
+ ),
309
+ [data-ui-inline-message][data-part-root]:has([data-part-text]:empty) {
310
+ --_indent: 0px;
311
+ }
312
+
250
313
  /**
251
314
  * ── No mark at all ────────────────────────────────────────────────────
252
315
  *
@@ -263,27 +326,42 @@
263
326
  * `:not([data-loading])` keeps the ring, because a message with no mark can
264
327
  * be waiting for something like any other.
265
328
  */
266
- [data-ui='inline-message'][data-mark='none']:not([data-loading]) > [data-part='icon']:empty {
329
+ [data-ui-inline-message][data-mark='none']:not([data-loading]) > [data-part-icon]:empty {
267
330
  display: none;
268
331
  }
269
332
 
270
333
  /* ── The sentence ─────────────────────────────────────────────────────
271
334
  *
272
335
  * Written by the family around the consumer's content rather than by the
273
- * consumer. Two things follow from that, and both are why the part exists:
274
- * a message holding a link is one grid item instead of two, and `:empty`
275
- * below is an exact question in both bindings.
336
+ * consumer, so `:empty` below is an exact question in both bindings. It is
337
+ * inline: a link inside it wraps with the words around it.
276
338
  *
277
339
  * `overflow-wrap: anywhere` breaks the one string a field message is likeliest
278
340
  * to carry that no language can break — a token, a container digest, a host
279
341
  * name without a hyphen. Nothing is removed: the whole string stays in the
280
342
  * DOM, in the accessibility tree, and findable by a page search.
281
343
  */
282
- [data-ui='inline-message'] > [data-part='text'] {
283
- grid-column: 2;
284
- grid-row: 1;
285
- min-inline-size: 0;
344
+ [data-ui-inline-message] > [data-part-text] {
286
345
  overflow-wrap: anywhere;
346
+ text-indent: 0;
347
+ }
348
+
349
+ /**
350
+ * The answers the message offers — "R$ 2,00 · R$ 15,00" under an amount that
351
+ * could be either. They wrap under the sentence, on its indent, at the gap
352
+ * the family puts between its mark and its sentence; the root is then a
353
+ * group named by the sentence, so a reader hears what the buttons answer.
354
+ */
355
+ [data-ui-inline-message] > [data-part-actions] {
356
+ align-items: center;
357
+ display: flex;
358
+ flex-wrap: wrap;
359
+ gap: var(--slotted-inline-message-actions-gap, var(--_column-gap));
360
+ margin-block-start: var(
361
+ --slotted-inline-message-actions-offset,
362
+ var(--slotted-space-2, 0.25rem)
363
+ );
364
+ text-indent: 0;
287
365
  }
288
366
 
289
367
  /**
@@ -292,8 +370,8 @@
292
370
  * standing beside an empty sentence would be the layout shift moved rather
293
371
  * than removed.
294
372
  */
295
- [data-ui='inline-message']:has([data-part='text']:empty) > [data-part='icon'],
296
- [data-ui='inline-message']:has([data-part='text']:empty) > [data-part='prefix'] {
373
+ [data-ui-inline-message]:has([data-part-text]:empty) > [data-part-icon],
374
+ [data-ui-inline-message]:has([data-part-text]:empty) > [data-part-prefix] {
297
375
  display: none;
298
376
  }
299
377
 
@@ -309,7 +387,7 @@
309
387
  * It is the ring `button` draws for the same reason, at the same duration,
310
388
  * in the mark's own square on the first line where the mark it replaced was.
311
389
  */
312
- [data-ui='inline-message'][data-loading] > [data-part='icon'] {
390
+ [data-ui-inline-message][data-loading] > [data-part-icon] {
313
391
  animation: slotted-inline-message-spin var(--slotted-duration-loop-fast) linear infinite;
314
392
  block-size: var(--_mark-size);
315
393
  border: max(var(--slotted-border-width-thin, 1px), calc(var(--_mark-size) / 8)) solid
@@ -318,18 +396,16 @@
318
396
  directions. */
319
397
  border-inline-end-color: transparent;
320
398
  border-radius: var(--slotted-radius-full, 9999px);
321
- display: block;
322
- /* Restated for the bullet: a ring drawn in a column sized for a 4-pixel
399
+ /* Restated for the bullet: a ring drawn in a box sized for a 4-pixel
323
400
  dot is an ellipse. The text moves by the difference for as long as the
324
401
  message is waiting, which is the cost of a bullet that starts at the
325
402
  message's own left edge. */
326
403
  inline-size: var(--_mark-size);
327
- margin-block-start: calc((1lh - var(--_mark-size)) / 2);
328
404
  }
329
405
 
330
406
  /* The page's own artwork withdraws for the ring rather than sitting inside
331
407
  it, because the ring is the mark while the message is waiting. */
332
- [data-ui='inline-message'][data-loading] > [data-part='icon'] > * {
408
+ [data-ui-inline-message][data-loading] > [data-part-icon] > * {
333
409
  display: none;
334
410
  }
335
411
 
@@ -343,11 +419,11 @@
343
419
  * own. The ring does need one: `STATE_PRECEDENCE` puts `disabled` above
344
420
  * `loading`, and a control nobody can use is not waiting for anything.
345
421
  */
346
- [data-ui='inline-message'][data-part='root'][data-disabled] {
422
+ [data-ui-inline-message][data-part-root][data-disabled] {
347
423
  color: var(--slotted-disabled-foreground);
348
424
  }
349
425
 
350
- [data-ui='inline-message'][data-disabled] > [data-part='icon'] {
426
+ [data-ui-inline-message][data-disabled] > [data-part-icon] {
351
427
  animation: none;
352
428
  }
353
429
 
@@ -357,7 +433,7 @@
357
433
  * is the decision `button` recorded for the same ring.
358
434
  */
359
435
  @media (prefers-reduced-motion: reduce) {
360
- [data-ui='inline-message'][data-loading] > [data-part='icon'] {
436
+ [data-ui-inline-message][data-loading] > [data-part-icon] {
361
437
  animation: none;
362
438
  }
363
439
  }
@@ -374,15 +450,15 @@
374
450
  * one colour and the turn would be a complete circle turning invisibly.
375
451
  */
376
452
  @media (forced-colors: active) {
377
- [data-ui='inline-message'] > [data-part='icon'] {
453
+ [data-ui-inline-message] > [data-part-icon] {
378
454
  color: CanvasText;
379
455
  }
380
456
 
381
- [data-ui='inline-message'][data-part='root'][data-disabled] > [data-part='icon'] {
457
+ [data-ui-inline-message][data-part-root][data-disabled] > [data-part-icon] {
382
458
  color: GrayText;
383
459
  }
384
460
 
385
- [data-ui='inline-message'][data-loading] > [data-part='icon'] {
461
+ [data-ui-inline-message][data-loading] > [data-part-icon] {
386
462
  border-color: CanvasText;
387
463
  border-inline-end-color: Canvas;
388
464
  }
@@ -5,15 +5,19 @@
5
5
  "--slotted-control-font-size-sm",
6
6
  "--slotted-disabled-foreground",
7
7
  "--slotted-duration-loop-fast",
8
+ "--slotted-inline-message-actions-gap",
9
+ "--slotted-inline-message-actions-offset",
8
10
  "--slotted-inline-message-column-gap",
9
11
  "--slotted-inline-message-font-family",
10
12
  "--slotted-inline-message-line-height",
11
13
  "--slotted-line-height-md",
12
14
  "--slotted-radius-full",
15
+ "--slotted-space-2",
13
16
  "--slotted-space-4",
14
17
  "--slotted-text-muted",
15
18
  "--slotted-tone-accent-text",
16
19
  "--slotted-tone-danger-text",
20
+ "--slotted-tone-info-text",
17
21
  "--slotted-tone-success-text",
18
22
  "--slotted-tone-warning-text"
19
23
  ]