@slotted/styles 0.1.0-beta.4 → 0.1.0-beta.40
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 +21 -1
- package/src/accordion/accordion.css +31 -13
- package/src/accordion/accordion.tokens.json +2 -0
- package/src/action-bar/action-bar.css +47 -44
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +39 -39
- package/src/alert/alert.css +97 -97
- package/src/alert/alert.tokens.json +6 -1
- package/src/app-shell/app-shell.css +472 -342
- package/src/app-shell/app-shell.tokens.json +6 -3
- package/src/aspect-ratio/aspect-ratio.css +24 -23
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +97 -67
- package/src/avatar/avatar.tokens.json +8 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +58 -47
- package/src/badge/badge.tokens.json +6 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +408 -93
- package/src/button/button.tokens.json +13 -0
- package/src/button-group/button-group.css +80 -79
- package/src/button-group/button-group.tokens.json +1 -0
- package/src/calendar/calendar.css +594 -267
- package/src/calendar/calendar.tokens.json +35 -3
- package/src/card/card.css +133 -70
- package/src/card/card.tokens.json +1 -0
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +174 -159
- package/src/cascader/cascader.tokens.json +2 -0
- package/src/chart/chart.css +300 -271
- package/src/chart/chart.tokens.json +5 -0
- package/src/checkbox/checkbox.css +190 -148
- package/src/checkbox/checkbox.tokens.json +4 -0
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +273 -85
- package/src/collapsible/collapsible.tokens.json +6 -0
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +219 -132
- package/src/combobox/combobox.tokens.json +4 -0
- package/src/command-palette/command-palette.css +214 -102
- package/src/command-palette/command-palette.tokens.json +4 -0
- package/src/container/container.css +27 -27
- package/src/context-menu/context-menu.css +9 -9
- package/src/currency-field/currency-field.css +119 -119
- package/src/currency-field/currency-field.tokens.json +1 -0
- package/src/dashboard-grid/dashboard-grid.css +231 -115
- package/src/dashboard-grid/dashboard-grid.tokens.json +3 -1
- package/src/data-grid/data-grid.css +637 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +93 -76
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +62 -57
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +31 -269
- package/src/date-picker/date-picker.tokens.json +1 -21
- package/src/date-range-picker/date-range-picker.css +72 -528
- package/src/date-range-picker/date-range-picker.tokens.json +1 -37
- package/src/datetime-field/datetime-field.css +90 -90
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +49 -711
- package/src/datetime-picker/datetime-picker.tokens.json +1 -50
- package/src/datetime-range-picker/datetime-range-picker.css +60 -985
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -67
- package/src/description-list/description-list.css +120 -76
- package/src/description-list/description-list.tokens.json +1 -0
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +462 -199
- package/src/dialog/dialog.tokens.json +10 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +736 -237
- package/src/drawer/drawer.tokens.json +15 -0
- package/src/entity-picker/entity-picker.css +402 -272
- package/src/entity-picker/entity-picker.tokens.json +6 -0
- package/src/event-calendar/event-calendar.css +357 -399
- package/src/field/field.css +106 -93
- package/src/field/field.tokens.json +2 -0
- package/src/field-group/field-group.css +58 -38
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +224 -216
- package/src/floating-panel/floating-panel.css +147 -0
- package/src/floating-panel/floating-panel.tokens.json +32 -0
- package/src/form/form.css +103 -26
- package/src/form/form.tokens.json +6 -1
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +32 -31
- package/src/highlight/highlight.css +11 -11
- package/src/hover-card/hover-card.css +9 -9
- package/src/icon/icon.css +67 -20
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +42 -42
- package/src/import-export-center/import-export-center.css +147 -168
- package/src/import-export-center/import-export-center.tokens.json +1 -0
- package/src/inline/inline.css +29 -29
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +5 -0
- package/src/kbd/kbd.css +63 -51
- package/src/kbd/kbd.tokens.json +4 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +55 -24
- package/src/list/list.tokens.json +2 -0
- package/src/list-item/list-item.css +195 -80
- package/src/list-item/list-item.tokens.json +10 -0
- package/src/listbox/listbox.css +121 -72
- package/src/listbox/listbox.tokens.json +6 -1
- package/src/loading-overlay/loading-overlay.css +86 -103
- package/src/markdown/markdown.css +20 -20
- package/src/media-viewer/media-viewer.css +790 -0
- package/src/media-viewer/media-viewer.tokens.json +53 -0
- package/src/menu/menu.css +166 -83
- package/src/menu/menu.tokens.json +3 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1296 -1243
- package/src/message/message.tokens.json +14 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/meter/meter.css +136 -0
- package/src/meter/meter.tokens.json +23 -0
- package/src/multi-select/multi-select.css +246 -174
- package/src/multi-select/multi-select.tokens.json +3 -0
- package/src/navigation-menu/navigation-menu.css +170 -191
- package/src/navigation-menu/navigation-menu.tokens.json +1 -0
- package/src/notification-center/notification-center.css +155 -163
- package/src/notification-center/notification-center.tokens.json +4 -0
- package/src/number-field/number-field.css +93 -93
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +74 -64
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +109 -31
- package/src/page/page.tokens.json +8 -0
- package/src/page-header/page-header.css +342 -287
- package/src/page-header/page-header.tokens.json +6 -1
- package/src/pagination/pagination.css +75 -79
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/popover/popover.css +85 -65
- package/src/popover/popover.tokens.json +2 -0
- package/src/progress-indicator/progress-indicator.css +194 -137
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +274 -116
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +77 -82
- package/src/radio-group/radio-group.css +107 -112
- package/src/rating/rating.css +147 -143
- package/src/rating/rating.tokens.json +2 -0
- package/src/result-state/result-state.css +95 -102
- package/src/result-state/result-state.tokens.json +1 -0
- package/src/runtime-properties.mjs +44 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +50 -37
- package/src/section/section.css +311 -46
- package/src/section/section.tokens.json +13 -1
- package/src/segmented-control/segmented-control.css +221 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +226 -149
- package/src/select/select.tokens.json +4 -0
- package/src/side-navigation/side-navigation.css +204 -201
- package/src/side-navigation/side-navigation.tokens.json +2 -0
- package/src/skeleton/skeleton.css +76 -58
- package/src/slider/slider.css +108 -104
- package/src/slider/slider.tokens.json +1 -0
- package/src/sparkline/sparkline.css +75 -53
- package/src/sparkline/sparkline.tokens.json +2 -0
- package/src/spinner/spinner.css +83 -180
- package/src/spinner/spinner.tokens.json +0 -1
- package/src/split-button/split-button.css +34 -35
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +47 -48
- package/src/stack/stack.css +26 -26
- package/src/stat-card/stat-card.css +420 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +126 -101
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +143 -125
- package/src/switch/switch.tokens.json +4 -0
- package/src/table/table.css +653 -222
- package/src/table/table.tokens.json +10 -0
- package/src/table-of-contents/table-of-contents.css +60 -59
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +327 -294
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +113 -89
- package/src/tag/tag.tokens.json +11 -0
- package/src/tags-input/tags-input.css +152 -87
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +146 -148
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +38 -33
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +82 -77
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +30 -519
- package/src/time-picker/time-picker.tokens.json +1 -38
- package/src/time-range-picker/time-range-picker.css +53 -895
- package/src/time-range-picker/time-range-picker.tokens.json +1 -66
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +139 -122
- package/src/toast/toast.tokens.json +7 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +49 -40
- package/src/toolbar/toolbar.tokens.json +2 -1
- package/src/tooltip/tooltip.css +95 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +253 -269
- package/src/top-navigation/top-navigation.tokens.json +1 -0
- package/src/tour/tour.css +68 -74
- package/src/tour/tour.tokens.json +1 -0
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +118 -122
- package/src/typography/typography.css +67 -38
- package/src/typography/typography.tokens.json +2 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
package/src/inline/inline.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@layer slotted.components {
|
|
2
2
|
/**
|
|
3
3
|
* Inline arranges its children along the inline axis and lets them wrap. It
|
|
4
|
-
* paints nothing: a layout that carried a
|
|
4
|
+
* paints nothing: a layout that carried a color would be a surface, and a
|
|
5
5
|
* surface is another family's decision.
|
|
6
6
|
*
|
|
7
7
|
* Wrapping is the default because a row that cannot wrap has only one answer
|
|
@@ -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
|
|
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
|
|
31
|
-
--_gap:
|
|
30
|
+
[data-ui-inline][data-gap='0'] {
|
|
31
|
+
--_gap: 0px;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
[data-ui
|
|
34
|
+
[data-ui-inline][data-gap='1'] {
|
|
35
35
|
--_gap: var(--slotted-space-1, 0.125rem);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
[data-ui
|
|
38
|
+
[data-ui-inline][data-gap='2'] {
|
|
39
39
|
--_gap: var(--slotted-space-2, 0.25rem);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
[data-ui
|
|
42
|
+
[data-ui-inline][data-gap='3'] {
|
|
43
43
|
--_gap: var(--slotted-space-3, 0.375rem);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
[data-ui
|
|
46
|
+
[data-ui-inline][data-gap='4'] {
|
|
47
47
|
--_gap: var(--slotted-space-4, 0.5rem);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
[data-ui
|
|
50
|
+
[data-ui-inline][data-gap='5'] {
|
|
51
51
|
--_gap: var(--slotted-space-5, 0.75rem);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
[data-ui
|
|
54
|
+
[data-ui-inline][data-gap='6'] {
|
|
55
55
|
--_gap: var(--slotted-space-6, 1rem);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
[data-ui
|
|
58
|
+
[data-ui-inline][data-gap='7'] {
|
|
59
59
|
--_gap: var(--slotted-space-7, 1.25rem);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
[data-ui
|
|
62
|
+
[data-ui-inline][data-gap='8'] {
|
|
63
63
|
--_gap: var(--slotted-space-8, 1.5rem);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
[data-ui
|
|
66
|
+
[data-ui-inline][data-gap='9'] {
|
|
67
67
|
--_gap: var(--slotted-space-9, 2rem);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
[data-ui
|
|
70
|
+
[data-ui-inline][data-gap='10'] {
|
|
71
71
|
--_gap: var(--slotted-space-10, 2.5rem);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
[data-ui
|
|
74
|
+
[data-ui-inline][data-gap='11'] {
|
|
75
75
|
--_gap: var(--slotted-space-11, 3rem);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
[data-ui
|
|
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
|
|
88
|
+
[data-ui-inline][data-align='start'] {
|
|
89
89
|
align-items: start;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
[data-ui
|
|
92
|
+
[data-ui-inline][data-align='center'] {
|
|
93
93
|
align-items: center;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
[data-ui
|
|
96
|
+
[data-ui-inline][data-align='end'] {
|
|
97
97
|
align-items: end;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
[data-ui
|
|
100
|
+
[data-ui-inline][data-align='stretch'] {
|
|
101
101
|
align-items: stretch;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
[data-ui
|
|
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
|
|
113
|
+
[data-ui-inline][data-justify='start'] {
|
|
114
114
|
justify-content: start;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
[data-ui
|
|
117
|
+
[data-ui-inline][data-justify='center'] {
|
|
118
118
|
justify-content: center;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
[data-ui
|
|
121
|
+
[data-ui-inline][data-justify='end'] {
|
|
122
122
|
justify-content: end;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
[data-ui
|
|
125
|
+
[data-ui-inline][data-justify='between'] {
|
|
126
126
|
justify-content: space-between;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
[data-ui
|
|
129
|
+
[data-ui-inline][data-justify='around'] {
|
|
130
130
|
justify-content: space-around;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
[data-ui
|
|
133
|
+
[data-ui-inline][data-justify='evenly'] {
|
|
134
134
|
justify-content: space-evenly;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
[data-ui
|
|
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
|
|
146
|
+
[data-ui-inline][data-wrap='nowrap'] {
|
|
147
147
|
flex-wrap: nowrap;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -11,20 +11,24 @@
|
|
|
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
|
-
*
|
|
14
|
+
* Three facts the layout rests on:
|
|
15
15
|
*
|
|
16
|
-
* - The mark is
|
|
17
|
-
*
|
|
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
|
-
*
|
|
25
|
+
* adding a line.
|
|
22
26
|
*/
|
|
23
|
-
[data-ui
|
|
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
|
|
27
|
-
* own `text` role: `--slotted-tone-secondary-text` is a label
|
|
31
|
+
* own `text` role: `--slotted-tone-secondary-text` is a label color
|
|
28
32
|
* calibrated for that tone's tinted ground — `#172033` in the light scheme
|
|
29
33
|
* — and text at that strength under a field reads as loud as the label
|
|
30
34
|
* above it. `--slotted-text-muted` is the ink the theme already darkened to
|
|
@@ -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
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
+
* mark with, rounded to an even pixel so its center 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
|
-
|
|
71
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The leading, rounded up to an even pixel: 13 × 1.5 is 19.5 and lands
|
|
74
|
+
* every line, and the mark centerd 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 var(--slotted-text-box-edge, 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
136
|
+
[data-ui-inline-message][data-part-root][data-tone='danger'] {
|
|
111
137
|
--_text: var(--slotted-tone-danger-text);
|
|
112
138
|
}
|
|
113
139
|
|
|
@@ -119,44 +145,51 @@
|
|
|
119
145
|
* field. Both are restated per density by the theme.
|
|
120
146
|
*/
|
|
121
147
|
|
|
122
|
-
[data-ui
|
|
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
|
|
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
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
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
|
|
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
|
|
147
180
|
* hears the sentence and nothing else: neither the red ink nor the mark
|
|
148
|
-
* reaches the accessibility tree, so “
|
|
181
|
+
* reaches the accessibility tree, so “Enter a valid tax ID” carries
|
|
149
182
|
* no evidence that it is an error rather than a hint.
|
|
150
183
|
*
|
|
151
184
|
* GOV.UK's Error message component answers it with a hidden “Error:” before
|
|
152
|
-
* the text. This is that answer,
|
|
185
|
+
* the text. This is that answer, generalized to every severity and to a table
|
|
153
186
|
* an application replaces once.
|
|
154
187
|
*
|
|
155
188
|
* The rule set is WCAG 2.2 technique C7, as `visually-hidden` publishes it:
|
|
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
|
|
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)
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
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 center is
|
|
207
|
+
* the center 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
|
|
183
|
-
* A mark the page supplies instead takes the same box
|
|
184
|
-
*
|
|
214
|
+
* and filled in `currentcolor`; the slot sizes it through the icon token.
|
|
215
|
+
* A mark the page supplies instead takes the same box, centerd 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
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
|
213
|
-
* steps
|
|
253
|
+
* The disc is a third of the mark rounded to an even pixel — 4 pixels at
|
|
254
|
+
* both steps — so its center 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
|
|
225
|
-
--_dot-size:
|
|
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
|
|
229
|
-
> [data-part
|
|
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
|
|
246
|
-
> [data-part
|
|
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
|
|
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
|
|
274
|
-
*
|
|
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
|
|
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
|
|
296
|
-
[data-ui
|
|
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
|
|
|
@@ -303,13 +381,13 @@
|
|
|
303
381
|
* one of the thirteen surveyed implementations ships it. It is a state of the
|
|
304
382
|
* same message rather than a sixth tone: the mark becomes a ring turning in
|
|
305
383
|
* the same place, and the tone, the size and every distance stay where they
|
|
306
|
-
* were — so “
|
|
384
|
+
* were — so “Checking availability…” becomes “Name available” with no
|
|
307
385
|
* geometry moving under the reader's eye.
|
|
308
386
|
*
|
|
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
|
|
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,24 +396,22 @@
|
|
|
318
396
|
directions. */
|
|
319
397
|
border-inline-end-color: transparent;
|
|
320
398
|
border-radius: var(--slotted-radius-full, 9999px);
|
|
321
|
-
|
|
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
|
|
408
|
+
[data-ui-inline-message][data-loading] > [data-part-icon] > * {
|
|
333
409
|
display: none;
|
|
334
410
|
}
|
|
335
411
|
|
|
336
412
|
/* ── Disabled ─────────────────────────────────────────────────────────
|
|
337
413
|
*
|
|
338
|
-
* Muted rather than faded: `--slotted-disabled-foreground` is a
|
|
414
|
+
* Muted rather than faded: `--slotted-disabled-foreground` is a color the
|
|
339
415
|
* theme measures, and lowering opacity until the sentence is unreadable is
|
|
340
416
|
* how a message beside a disabled control stops being a message.
|
|
341
417
|
*
|
|
@@ -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
|
|
422
|
+
[data-ui-inline-message][data-part-root][data-disabled] {
|
|
347
423
|
color: var(--slotted-disabled-foreground);
|
|
348
424
|
}
|
|
349
425
|
|
|
350
|
-
[data-ui
|
|
426
|
+
[data-ui-inline-message][data-disabled] > [data-part-icon] {
|
|
351
427
|
animation: none;
|
|
352
428
|
}
|
|
353
429
|
|
|
@@ -357,32 +433,32 @@
|
|
|
357
433
|
* is the decision `button` recorded for the same ring.
|
|
358
434
|
*/
|
|
359
435
|
@media (prefers-reduced-motion: reduce) {
|
|
360
|
-
[data-ui
|
|
436
|
+
[data-ui-inline-message][data-loading] > [data-part-icon] {
|
|
361
437
|
animation: none;
|
|
362
438
|
}
|
|
363
439
|
}
|
|
364
440
|
|
|
365
|
-
/* ── Forced
|
|
441
|
+
/* ── Forced colors ───────────────────────────────────────────────────
|
|
366
442
|
*
|
|
367
|
-
* The theme remaps every
|
|
368
|
-
* here. The mark takes a system
|
|
443
|
+
* The theme remaps every color this family reads, so the ink needs no rule
|
|
444
|
+
* here. The mark takes a system color of its own, so the silhouette keeps
|
|
369
445
|
* the ink that says it is a mark and not a word, and the muted one when the
|
|
370
446
|
* message is disabled.
|
|
371
447
|
*
|
|
372
448
|
* The ring is the same problem from the other side: its missing quarter is
|
|
373
449
|
* `transparent`, which survives, but its border would otherwise be forced to
|
|
374
|
-
* one
|
|
450
|
+
* one color and the turn would be a complete circle turning invisibly.
|
|
375
451
|
*/
|
|
376
452
|
@media (forced-colors: active) {
|
|
377
|
-
[data-ui
|
|
453
|
+
[data-ui-inline-message] > [data-part-icon] {
|
|
378
454
|
color: CanvasText;
|
|
379
455
|
}
|
|
380
456
|
|
|
381
|
-
[data-ui
|
|
457
|
+
[data-ui-inline-message][data-part-root][data-disabled] > [data-part-icon] {
|
|
382
458
|
color: GrayText;
|
|
383
459
|
}
|
|
384
460
|
|
|
385
|
-
[data-ui
|
|
461
|
+
[data-ui-inline-message][data-loading] > [data-part-icon] {
|
|
386
462
|
border-color: CanvasText;
|
|
387
463
|
border-inline-end-color: Canvas;
|
|
388
464
|
}
|