@slotted/styles 0.0.0-stage → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -2
  3. package/package.json +276 -3
  4. package/src/accordion/accordion.css +96 -0
  5. package/src/accordion/accordion.tokens.json +14 -0
  6. package/src/action-bar/action-bar.css +455 -0
  7. package/src/action-bar/action-bar.tokens.json +50 -0
  8. package/src/action-sheet/action-sheet.css +462 -0
  9. package/src/action-sheet/action-sheet.tokens.json +59 -0
  10. package/src/alert/alert.css +764 -0
  11. package/src/alert/alert.tokens.json +77 -0
  12. package/src/app-shell/app-shell.css +1899 -0
  13. package/src/app-shell/app-shell.tokens.json +88 -0
  14. package/src/aspect-ratio/aspect-ratio.css +131 -0
  15. package/src/aspect-ratio/aspect-ratio.tokens.json +1 -0
  16. package/src/attachment/attachment.css +906 -0
  17. package/src/attachment/attachment.tokens.json +85 -0
  18. package/src/avatar/avatar.css +598 -0
  19. package/src/avatar/avatar.tokens.json +64 -0
  20. package/src/avatar-group/avatar-group.css +268 -0
  21. package/src/avatar-group/avatar-group.tokens.json +16 -0
  22. package/src/badge/badge.css +462 -0
  23. package/src/badge/badge.tokens.json +58 -0
  24. package/src/breadcrumb/breadcrumb.css +441 -0
  25. package/src/breadcrumb/breadcrumb.tokens.json +50 -0
  26. package/src/button/button.css +754 -0
  27. package/src/button/button.tokens.json +72 -0
  28. package/src/button-group/button-group.css +455 -0
  29. package/src/button-group/button-group.tokens.json +11 -0
  30. package/src/calendar/calendar.css +846 -0
  31. package/src/calendar/calendar.tokens.json +67 -0
  32. package/src/card/card.css +602 -0
  33. package/src/card/card.tokens.json +68 -0
  34. package/src/carousel/carousel.css +860 -0
  35. package/src/carousel/carousel.tokens.json +62 -0
  36. package/src/cascader/cascader.css +1320 -0
  37. package/src/cascader/cascader.tokens.json +103 -0
  38. package/src/chart/chart.css +1473 -0
  39. package/src/chart/chart.tokens.json +107 -0
  40. package/src/checkbox/checkbox.css +1011 -0
  41. package/src/checkbox/checkbox.tokens.json +102 -0
  42. package/src/checkbox-group/checkbox-group.css +70 -0
  43. package/src/checkbox-group/checkbox-group.tokens.json +6 -0
  44. package/src/code-block/code-block.css +555 -0
  45. package/src/code-block/code-block.tokens.json +69 -0
  46. package/src/collapsible/collapsible.css +546 -0
  47. package/src/collapsible/collapsible.tokens.json +55 -0
  48. package/src/color-picker/color-picker.css +607 -0
  49. package/src/color-picker/color-picker.tokens.json +58 -0
  50. package/src/column-manager/column-manager.css +452 -0
  51. package/src/column-manager/column-manager.tokens.json +43 -0
  52. package/src/combobox/combobox.css +1048 -0
  53. package/src/combobox/combobox.tokens.json +112 -0
  54. package/src/command-palette/command-palette.css +1000 -0
  55. package/src/command-palette/command-palette.tokens.json +75 -0
  56. package/src/container/container.css +198 -0
  57. package/src/container/container.tokens.json +18 -0
  58. package/src/context-menu/context-menu.css +104 -0
  59. package/src/context-menu/context-menu.tokens.json +11 -0
  60. package/src/currency-field/currency-field.css +787 -0
  61. package/src/currency-field/currency-field.tokens.json +80 -0
  62. package/src/dashboard-grid/dashboard-grid.css +748 -0
  63. package/src/dashboard-grid/dashboard-grid.tokens.json +67 -0
  64. package/src/data-grid/data-grid.css +2484 -0
  65. package/src/data-grid/data-grid.tokens.json +100 -0
  66. package/src/data-list/data-list.css +455 -0
  67. package/src/data-list/data-list.tokens.json +35 -0
  68. package/src/date-field/date-field.css +560 -0
  69. package/src/date-field/date-field.tokens.json +80 -0
  70. package/src/date-picker/date-picker.css +420 -0
  71. package/src/date-picker/date-picker.tokens.json +49 -0
  72. package/src/date-range-picker/date-range-picker.css +983 -0
  73. package/src/date-range-picker/date-range-picker.tokens.json +109 -0
  74. package/src/datetime-field/datetime-field.css +850 -0
  75. package/src/datetime-field/datetime-field.tokens.json +91 -0
  76. package/src/datetime-picker/datetime-picker.css +843 -0
  77. package/src/datetime-picker/datetime-picker.tokens.json +78 -0
  78. package/src/datetime-range-picker/datetime-range-picker.css +1375 -0
  79. package/src/datetime-range-picker/datetime-range-picker.tokens.json +135 -0
  80. package/src/description-list/description-list.css +675 -0
  81. package/src/description-list/description-list.tokens.json +66 -0
  82. package/src/detail-panel/detail-panel.css +329 -0
  83. package/src/detail-panel/detail-panel.tokens.json +33 -0
  84. package/src/dialog/dialog.css +968 -0
  85. package/src/dialog/dialog.tokens.json +66 -0
  86. package/src/divider/divider.css +131 -0
  87. package/src/divider/divider.tokens.json +18 -0
  88. package/src/drawer/drawer.css +1303 -0
  89. package/src/drawer/drawer.tokens.json +75 -0
  90. package/src/entity-picker/entity-picker.css +1367 -0
  91. package/src/entity-picker/entity-picker.tokens.json +118 -0
  92. package/src/event-calendar/event-calendar.css +2148 -0
  93. package/src/event-calendar/event-calendar.tokens.json +87 -0
  94. package/src/field/field.css +707 -0
  95. package/src/field/field.tokens.json +58 -0
  96. package/src/field-group/field-group.css +226 -0
  97. package/src/field-group/field-group.tokens.json +33 -0
  98. package/src/filter-bar/filter-bar.css +1306 -0
  99. package/src/filter-bar/filter-bar.tokens.json +78 -0
  100. package/src/form/form.css +218 -0
  101. package/src/form/form.tokens.json +32 -0
  102. package/src/fullscreen/fullscreen.css +376 -0
  103. package/src/fullscreen/fullscreen.tokens.json +50 -0
  104. package/src/grid/grid.css +173 -0
  105. package/src/grid/grid.tokens.json +20 -0
  106. package/src/highlight/highlight.css +135 -0
  107. package/src/highlight/highlight.tokens.json +16 -0
  108. package/src/hover-card/hover-card.css +93 -0
  109. package/src/hover-card/hover-card.tokens.json +17 -0
  110. package/src/icon/icon.css +136 -0
  111. package/src/icon/icon.tokens.json +14 -0
  112. package/src/image/image.css +449 -0
  113. package/src/image/image.tokens.json +27 -0
  114. package/src/import-export-center/import-export-center.css +1175 -0
  115. package/src/import-export-center/import-export-center.tokens.json +84 -0
  116. package/src/inline/inline.css +149 -0
  117. package/src/inline/inline.tokens.json +14 -0
  118. package/src/inline-message/inline-message.css +396 -0
  119. package/src/inline-message/inline-message.tokens.json +19 -0
  120. package/src/kbd/kbd.css +490 -0
  121. package/src/kbd/kbd.tokens.json +40 -0
  122. package/src/link/link.css +237 -0
  123. package/src/link/link.tokens.json +25 -0
  124. package/src/list/list.css +240 -0
  125. package/src/list/list.tokens.json +42 -0
  126. package/src/list-item/list-item.css +937 -0
  127. package/src/list-item/list-item.tokens.json +114 -0
  128. package/src/listbox/listbox.css +674 -0
  129. package/src/listbox/listbox.tokens.json +72 -0
  130. package/src/loading-overlay/loading-overlay.css +730 -0
  131. package/src/loading-overlay/loading-overlay.tokens.json +48 -0
  132. package/src/markdown/markdown.css +168 -0
  133. package/src/markdown/markdown.tokens.json +18 -0
  134. package/src/menu/menu.css +817 -0
  135. package/src/menu/menu.tokens.json +78 -0
  136. package/src/menubar/menubar.css +170 -0
  137. package/src/menubar/menubar.tokens.json +32 -0
  138. package/src/message/message.css +1453 -0
  139. package/src/message/message.tokens.json +85 -0
  140. package/src/message-scroller/message-scroller.css +371 -0
  141. package/src/message-scroller/message-scroller.tokens.json +47 -0
  142. package/src/multi-select/multi-select.css +1427 -0
  143. package/src/multi-select/multi-select.tokens.json +114 -0
  144. package/src/navigation-menu/navigation-menu.css +1029 -0
  145. package/src/navigation-menu/navigation-menu.tokens.json +70 -0
  146. package/src/notification-center/notification-center.css +856 -0
  147. package/src/notification-center/notification-center.tokens.json +84 -0
  148. package/src/number-field/number-field.css +794 -0
  149. package/src/number-field/number-field.tokens.json +80 -0
  150. package/src/otp-input/otp-input.css +525 -0
  151. package/src/otp-input/otp-input.tokens.json +69 -0
  152. package/src/page/page.css +179 -0
  153. package/src/page/page.tokens.json +20 -0
  154. package/src/page-header/page-header.css +1181 -0
  155. package/src/page-header/page-header.tokens.json +71 -0
  156. package/src/pagination/pagination.css +500 -0
  157. package/src/pagination/pagination.tokens.json +56 -0
  158. package/src/popover/popover.css +526 -0
  159. package/src/popover/popover.tokens.json +60 -0
  160. package/src/progress-indicator/progress-indicator.css +1584 -0
  161. package/src/progress-indicator/progress-indicator.tokens.json +50 -0
  162. package/src/prompt-composer/prompt-composer.css +680 -0
  163. package/src/prompt-composer/prompt-composer.tokens.json +99 -0
  164. package/src/prose/prose.css +733 -0
  165. package/src/prose/prose.tokens.json +79 -0
  166. package/src/radio-group/radio-group.css +778 -0
  167. package/src/radio-group/radio-group.tokens.json +103 -0
  168. package/src/rating/rating.css +1071 -0
  169. package/src/rating/rating.tokens.json +88 -0
  170. package/src/result-state/result-state.css +980 -0
  171. package/src/result-state/result-state.tokens.json +63 -0
  172. package/src/runtime-properties.mjs +321 -0
  173. package/src/saved-views/saved-views.css +394 -0
  174. package/src/saved-views/saved-views.tokens.json +41 -0
  175. package/src/scroll-area/scroll-area.css +481 -0
  176. package/src/scroll-area/scroll-area.tokens.json +15 -0
  177. package/src/section/section.css +177 -0
  178. package/src/section/section.tokens.json +39 -0
  179. package/src/segmented-control/segmented-control.css +564 -0
  180. package/src/segmented-control/segmented-control.tokens.json +67 -0
  181. package/src/select/select.css +1593 -0
  182. package/src/select/select.tokens.json +110 -0
  183. package/src/side-navigation/side-navigation.css +1096 -0
  184. package/src/side-navigation/side-navigation.tokens.json +87 -0
  185. package/src/skeleton/skeleton.css +431 -0
  186. package/src/skeleton/skeleton.tokens.json +29 -0
  187. package/src/slider/slider.css +792 -0
  188. package/src/slider/slider.tokens.json +75 -0
  189. package/src/sparkline/sparkline.css +282 -0
  190. package/src/sparkline/sparkline.tokens.json +45 -0
  191. package/src/spinner/spinner.css +224 -0
  192. package/src/spinner/spinner.tokens.json +8 -0
  193. package/src/split-button/split-button.css +253 -0
  194. package/src/split-button/split-button.tokens.json +12 -0
  195. package/src/splitter/splitter.css +336 -0
  196. package/src/splitter/splitter.tokens.json +24 -0
  197. package/src/stack/stack.css +128 -0
  198. package/src/stack/stack.tokens.json +14 -0
  199. package/src/stat-card/stat-card.css +641 -0
  200. package/src/stat-card/stat-card.tokens.json +95 -0
  201. package/src/status-indicator/status-indicator.css +481 -0
  202. package/src/status-indicator/status-indicator.tokens.json +38 -0
  203. package/src/stepper/stepper.css +629 -0
  204. package/src/stepper/stepper.tokens.json +72 -0
  205. package/src/switch/switch.css +703 -0
  206. package/src/switch/switch.tokens.json +75 -0
  207. package/src/table/table.css +1482 -0
  208. package/src/table/table.tokens.json +69 -0
  209. package/src/table-of-contents/table-of-contents.css +533 -0
  210. package/src/table-of-contents/table-of-contents.tokens.json +53 -0
  211. package/src/tabs/tabs.css +998 -0
  212. package/src/tabs/tabs.tokens.json +82 -0
  213. package/src/tag/tag.css +768 -0
  214. package/src/tag/tag.tokens.json +85 -0
  215. package/src/tags-input/tags-input.css +757 -0
  216. package/src/tags-input/tags-input.tokens.json +84 -0
  217. package/src/text-field/text-field.css +900 -0
  218. package/src/text-field/text-field.tokens.json +87 -0
  219. package/src/textarea/textarea.css +365 -0
  220. package/src/textarea/textarea.tokens.json +59 -0
  221. package/src/time-field/time-field.css +719 -0
  222. package/src/time-field/time-field.tokens.json +86 -0
  223. package/src/time-picker/time-picker.css +665 -0
  224. package/src/time-picker/time-picker.tokens.json +66 -0
  225. package/src/time-range-picker/time-range-picker.css +1287 -0
  226. package/src/time-range-picker/time-range-picker.tokens.json +134 -0
  227. package/src/timeline/timeline.css +1596 -0
  228. package/src/timeline/timeline.tokens.json +96 -0
  229. package/src/toast/toast.css +943 -0
  230. package/src/toast/toast.tokens.json +90 -0
  231. package/src/toggle/toggle.css +290 -0
  232. package/src/toggle/toggle.tokens.json +54 -0
  233. package/src/toggle-group/toggle-group.css +463 -0
  234. package/src/toggle-group/toggle-group.tokens.json +54 -0
  235. package/src/toolbar/toolbar.css +434 -0
  236. package/src/toolbar/toolbar.tokens.json +49 -0
  237. package/src/tooltip/tooltip.css +368 -0
  238. package/src/tooltip/tooltip.tokens.json +39 -0
  239. package/src/top-navigation/top-navigation.css +1287 -0
  240. package/src/top-navigation/top-navigation.tokens.json +91 -0
  241. package/src/tour/tour.css +680 -0
  242. package/src/tour/tour.tokens.json +67 -0
  243. package/src/transfer/transfer.css +571 -0
  244. package/src/transfer/transfer.tokens.json +49 -0
  245. package/src/tree/tree.css +1000 -0
  246. package/src/tree/tree.tokens.json +80 -0
  247. package/src/typography/typography.css +211 -0
  248. package/src/typography/typography.tokens.json +31 -0
  249. package/src/upload/upload.css +1706 -0
  250. package/src/upload/upload.tokens.json +123 -0
  251. package/src/visually-hidden/visually-hidden.css +52 -0
  252. package/src/visually-hidden/visually-hidden.tokens.json +1 -0
  253. package/src/wizard/wizard.css +740 -0
  254. package/src/wizard/wizard.tokens.json +63 -0
@@ -0,0 +1,84 @@
1
+ [
2
+ "--slotted-border-strong",
3
+ "--slotted-border-subtle",
4
+ "--slotted-border-width-thin",
5
+ "--slotted-control-gap-sm",
6
+ "--slotted-control-height-sm",
7
+ "--slotted-control-icon-size-md",
8
+ "--slotted-control-icon-size-sm",
9
+ "--slotted-control-inner-size-md",
10
+ "--slotted-control-inner-size-sm",
11
+ "--slotted-control-line-height",
12
+ "--slotted-control-padding-inline-md",
13
+ "--slotted-control-radius",
14
+ "--slotted-control-transition-duration",
15
+ "--slotted-control-transition-easing",
16
+ "--slotted-focus-ring-color",
17
+ "--slotted-focus-ring-offset",
18
+ "--slotted-focus-ring-width",
19
+ "--slotted-font-family-heading",
20
+ "--slotted-font-family-sans",
21
+ "--slotted-font-size-lg",
22
+ "--slotted-font-size-md",
23
+ "--slotted-font-size-sm",
24
+ "--slotted-font-size-xs",
25
+ "--slotted-font-weight-medium",
26
+ "--slotted-font-weight-regular",
27
+ "--slotted-font-weight-semibold",
28
+ "--slotted-import-export-center-background",
29
+ "--slotted-import-export-center-border",
30
+ "--slotted-import-export-center-errors-max-block-size",
31
+ "--slotted-import-export-center-gap-md",
32
+ "--slotted-import-export-center-gap-sm",
33
+ "--slotted-import-export-center-inset-block-md",
34
+ "--slotted-import-export-center-inset-block-sm",
35
+ "--slotted-import-export-center-inset-inline-md",
36
+ "--slotted-import-export-center-inset-inline-sm",
37
+ "--slotted-import-export-center-min-inline-size-sm",
38
+ "--slotted-import-export-center-status-column",
39
+ "--slotted-line-height-lg",
40
+ "--slotted-line-height-md",
41
+ "--slotted-line-height-sm",
42
+ "--slotted-line-height-xs",
43
+ "--slotted-radius-full",
44
+ "--slotted-radius-md",
45
+ "--slotted-radius-sm",
46
+ "--slotted-radius-xs",
47
+ "--slotted-space-1",
48
+ "--slotted-space-2",
49
+ "--slotted-space-3",
50
+ "--slotted-space-4",
51
+ "--slotted-space-5",
52
+ "--slotted-space-6",
53
+ "--slotted-space-7",
54
+ "--slotted-space-8",
55
+ "--slotted-space-9",
56
+ "--slotted-surface",
57
+ "--slotted-surface-sunken",
58
+ "--slotted-target-min",
59
+ "--slotted-text",
60
+ "--slotted-text-muted",
61
+ "--slotted-tone-accent-solid",
62
+ "--slotted-tone-accent-surface",
63
+ "--slotted-tone-accent-text",
64
+ "--slotted-tone-danger-solid",
65
+ "--slotted-tone-danger-text",
66
+ "--slotted-tone-secondary-solid",
67
+ "--slotted-tone-secondary-subtle-active",
68
+ "--slotted-tone-secondary-subtle-hover",
69
+ "--slotted-tone-secondary-text",
70
+ "--slotted-tone-success-solid",
71
+ "--slotted-tone-success-text",
72
+ "--slotted-tone-warning-solid",
73
+ "--slotted-tone-warning-text",
74
+ "--slotted-upload-kind-archive",
75
+ "--slotted-upload-kind-audio",
76
+ "--slotted-upload-kind-document",
77
+ "--slotted-upload-kind-foreground",
78
+ "--slotted-upload-kind-image",
79
+ "--slotted-upload-kind-other",
80
+ "--slotted-upload-kind-pdf",
81
+ "--slotted-upload-kind-presentation",
82
+ "--slotted-upload-kind-spreadsheet",
83
+ "--slotted-upload-kind-video"
84
+ ]
@@ -0,0 +1,149 @@
1
+ @layer slotted.components {
2
+ /**
3
+ * Inline arranges its children along the inline axis and lets them wrap. It
4
+ * paints nothing: a layout that carried a colour would be a surface, and a
5
+ * surface is another family's decision.
6
+ *
7
+ * Wrapping is the default because a row that cannot wrap has only one answer
8
+ * to a container narrower than its content, and that answer is to overflow
9
+ * it. The separation defaults to a step below the line height of the default
10
+ * type step, so a run of items reads as one line rather than as a list laid
11
+ * sideways.
12
+ */
13
+ [data-ui='inline'] {
14
+ --_gap: var(--slotted-space-4, 0.5rem);
15
+
16
+ display: flex;
17
+ flex-direction: row;
18
+ flex-wrap: wrap;
19
+ align-items: center;
20
+ gap: var(--_gap);
21
+ /**
22
+ * A flex or grid item is at least as wide as its content unless it is told
23
+ * otherwise, so a run nested in one would refuse to narrow below its widest
24
+ * child and push the layout past the edge instead of reflowing.
25
+ */
26
+ min-inline-size: 0;
27
+ }
28
+
29
+ /* Separation is a step on the scale, never a length the consumer states. */
30
+ [data-ui='inline'][data-gap='0'] {
31
+ --_gap: 0;
32
+ }
33
+
34
+ [data-ui='inline'][data-gap='1'] {
35
+ --_gap: var(--slotted-space-1, 0.125rem);
36
+ }
37
+
38
+ [data-ui='inline'][data-gap='2'] {
39
+ --_gap: var(--slotted-space-2, 0.25rem);
40
+ }
41
+
42
+ [data-ui='inline'][data-gap='3'] {
43
+ --_gap: var(--slotted-space-3, 0.375rem);
44
+ }
45
+
46
+ [data-ui='inline'][data-gap='4'] {
47
+ --_gap: var(--slotted-space-4, 0.5rem);
48
+ }
49
+
50
+ [data-ui='inline'][data-gap='5'] {
51
+ --_gap: var(--slotted-space-5, 0.75rem);
52
+ }
53
+
54
+ [data-ui='inline'][data-gap='6'] {
55
+ --_gap: var(--slotted-space-6, 1rem);
56
+ }
57
+
58
+ [data-ui='inline'][data-gap='7'] {
59
+ --_gap: var(--slotted-space-7, 1.25rem);
60
+ }
61
+
62
+ [data-ui='inline'][data-gap='8'] {
63
+ --_gap: var(--slotted-space-8, 1.5rem);
64
+ }
65
+
66
+ [data-ui='inline'][data-gap='9'] {
67
+ --_gap: var(--slotted-space-9, 2rem);
68
+ }
69
+
70
+ [data-ui='inline'][data-gap='10'] {
71
+ --_gap: var(--slotted-space-10, 2.5rem);
72
+ }
73
+
74
+ [data-ui='inline'][data-gap='11'] {
75
+ --_gap: var(--slotted-space-11, 3rem);
76
+ }
77
+
78
+ [data-ui='inline'][data-gap='12'] {
79
+ --_gap: var(--slotted-space-12, 4rem);
80
+ }
81
+
82
+ /**
83
+ * `align` positions children across the flow, which for a run is the block
84
+ * axis. `baseline` is offered here and nowhere else: items sitting on one
85
+ * line can share a baseline, and a label beside a badge reads wrong without
86
+ * it.
87
+ */
88
+ [data-ui='inline'][data-align='start'] {
89
+ align-items: start;
90
+ }
91
+
92
+ [data-ui='inline'][data-align='center'] {
93
+ align-items: center;
94
+ }
95
+
96
+ [data-ui='inline'][data-align='end'] {
97
+ align-items: end;
98
+ }
99
+
100
+ [data-ui='inline'][data-align='stretch'] {
101
+ align-items: stretch;
102
+ }
103
+
104
+ [data-ui='inline'][data-align='baseline'] {
105
+ align-items: baseline;
106
+ }
107
+
108
+ /**
109
+ * `justify` positions children along the flow, which for a run is the inline
110
+ * axis. The keywords are the logical ones, so a right-to-left document is the
111
+ * same component mirrored rather than a second stylesheet.
112
+ */
113
+ [data-ui='inline'][data-justify='start'] {
114
+ justify-content: start;
115
+ }
116
+
117
+ [data-ui='inline'][data-justify='center'] {
118
+ justify-content: center;
119
+ }
120
+
121
+ [data-ui='inline'][data-justify='end'] {
122
+ justify-content: end;
123
+ }
124
+
125
+ [data-ui='inline'][data-justify='between'] {
126
+ justify-content: space-between;
127
+ }
128
+
129
+ [data-ui='inline'][data-justify='around'] {
130
+ justify-content: space-around;
131
+ }
132
+
133
+ [data-ui='inline'][data-justify='evenly'] {
134
+ justify-content: space-evenly;
135
+ }
136
+
137
+ [data-ui='inline'][data-wrap='wrap'] {
138
+ flex-wrap: wrap;
139
+ }
140
+
141
+ /**
142
+ * A run that is told not to wrap overflows a container narrower than its
143
+ * content. That is what the consumer asked for, and it is why the family does
144
+ * not ask for it on the consumer's behalf.
145
+ */
146
+ [data-ui='inline'][data-wrap='nowrap'] {
147
+ flex-wrap: nowrap;
148
+ }
149
+ }
@@ -0,0 +1,14 @@
1
+ [
2
+ "--slotted-space-1",
3
+ "--slotted-space-10",
4
+ "--slotted-space-11",
5
+ "--slotted-space-12",
6
+ "--slotted-space-2",
7
+ "--slotted-space-3",
8
+ "--slotted-space-4",
9
+ "--slotted-space-5",
10
+ "--slotted-space-6",
11
+ "--slotted-space-7",
12
+ "--slotted-space-8",
13
+ "--slotted-space-9"
14
+ ]
@@ -0,0 +1,396 @@
1
+ @layer slotted.components {
2
+ /**
3
+ * ── The message ────────────────────────────────────────────────────────
4
+ *
5
+ * One sentence about something else: a field, a section, an action. It has a
6
+ * mark saying how serious it is, a word saying the same thing to a reader who
7
+ * cannot see the mark, and the sentence itself.
8
+ *
9
+ * The box is a paragraph with no ground and no border. That is the whole
10
+ * difference from `alert`, which is a box a message sits inside; this is the
11
+ * message with nothing around it, so it inherits the rhythm of whatever
12
+ * placed it — a field, a `Stack`, a table cell.
13
+ *
14
+ * Two facts the layout rests on:
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.
18
+ * - The severity word is out of flow. It is a real element with real text,
19
+ * clipped by the WCAG 2.2 technique C7 rule set and placed first in the
20
+ * DOM so it is read first; `position: absolute` is what keeps it from
21
+ * taking a grid cell or adding a line.
22
+ */
23
+ [data-ui='inline-message'][data-part='root'] {
24
+ /**
25
+ * The default is the help tone, which is what most fields carry. It is the
26
+ * 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 colour
28
+ * calibrated for that tone's tinted ground — `#172033` in the light scheme
29
+ * — and text at that strength under a field reads as loud as the label
30
+ * above it. `--slotted-text-muted` is the ink the theme already darkened to
31
+ * meet 4.5 : 1 against the sunken surface.
32
+ */
33
+ --_text: var(--slotted-text-muted);
34
+
35
+ /**
36
+ * Type comes from the control scales, the only ones the theme restates per
37
+ * density, so a message under a dense field shrinks with it. The leading
38
+ * does not: a control's `line-height` of `1` is for a box holding one
39
+ * line, and this box holds a sentence.
40
+ *
41
+ * 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
+ */
47
+ --_font-size: var(--slotted-control-font-size-sm, 12px);
48
+ --_mark-size: 1em;
49
+ /**
50
+ * The distance from the mark to its own sentence: eight pixels, the step
51
+ * `alert` uses (R5). It does not step with the size — the mark already
52
+ * does, through `em`, and a gap that shrank beside a smaller mark pulled
53
+ * the two apart twice.
54
+ */
55
+ --_column-gap: var(--slotted-inline-message-column-gap, var(--slotted-space-4, 0.5rem));
56
+
57
+ 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;
65
+ font-family: var(
66
+ --slotted-inline-message-font-family,
67
+ var(--slotted-control-font-family, sans-serif)
68
+ );
69
+ 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
+ /* A `p` arrives with the user agent's block margins; the distance between a
73
+ control and its message belongs to whatever placed the two. */
74
+ margin: 0;
75
+ /* The containing block for the clipped severity word. */
76
+ position: relative;
77
+ }
78
+
79
+ /* ── Tone: what the message is about ──────────────────────────────────
80
+ *
81
+ * Four severities and one absence of severity. Each severity takes its own
82
+ * `text` role, which is the pair `packages/themes/test/default-theme.test.mjs`
83
+ * measures against the three neutral surfaces — this family paints on the
84
+ * page's own surface, so that is the pair that applies.
85
+ *
86
+ * The glyph is the binding's, from the map in
87
+ * `specs/components/inline-message/contract.json` — the same map
88
+ * `status-indicator` and `alert` declare, so a status light and an alert
89
+ * about the same thing draw the same silhouette, and an error under a field
90
+ * the same as the alert about it (F1). Help draws none, because help is not
91
+ * a severity.
92
+ */
93
+
94
+ [data-ui='inline-message'][data-part='root'][data-tone='accent'] {
95
+ --_text: var(--slotted-tone-accent-text);
96
+ }
97
+
98
+ [data-ui='inline-message'][data-part='root'][data-tone='secondary'] {
99
+ --_text: var(--slotted-text-muted);
100
+ }
101
+
102
+ [data-ui='inline-message'][data-part='root'][data-tone='success'] {
103
+ --_text: var(--slotted-tone-success-text);
104
+ }
105
+
106
+ [data-ui='inline-message'][data-part='root'][data-tone='warning'] {
107
+ --_text: var(--slotted-tone-warning-text);
108
+ }
109
+
110
+ [data-ui='inline-message'][data-part='root'][data-tone='danger'] {
111
+ --_text: var(--slotted-tone-danger-text);
112
+ }
113
+
114
+ /* ── Size: the step the control it belongs to is at ────────────────────
115
+ *
116
+ * Two values rather than three. A message is quieter than the thing it is
117
+ * about, so the family starts one step below the control's own type and has
118
+ * one step to grow into when the message is about a section rather than a
119
+ * field. Both are restated per density by the theme.
120
+ */
121
+
122
+ [data-ui='inline-message'][data-part='root'][data-size='sm'] {
123
+ --_font-size: var(--slotted-control-font-size-sm, 12px);
124
+ }
125
+
126
+ [data-ui='inline-message'][data-part='root'][data-size='md'] {
127
+ --_font-size: var(--slotted-control-font-size-md, 13px);
128
+ }
129
+
130
+ /**
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.
135
+ *
136
+ * Material UI reserves the same line by asking the consumer to pass a space
137
+ * character as the message. A space is content: it defeats `:empty` below, so
138
+ * the mark and the severity word would be drawn beside nothing.
139
+ */
140
+ [data-ui='inline-message'][data-part='root'][data-reserve] {
141
+ min-block-size: 1lh;
142
+ }
143
+
144
+ /* ── The severity, in words ───────────────────────────────────────────
145
+ *
146
+ * The defect this family exists to fix. A reader who cannot see the message
147
+ * hears the sentence and nothing else: neither the red ink nor the mark
148
+ * reaches the accessibility tree, so “Informe um CNPJ válido” carries
149
+ * no evidence that it is an error rather than a hint.
150
+ *
151
+ * GOV.UK's Error message component answers it with a hidden “Error:” before
152
+ * the text. This is that answer, generalised to every severity and to a table
153
+ * an application replaces once.
154
+ *
155
+ * The rule set is WCAG 2.2 technique C7, as `visually-hidden` publishes it:
156
+ * a one-pixel box, clipped, out of flow, on a single line, with the negative
157
+ * margin that keeps it from adding a pixel of scrollable overflow.
158
+ */
159
+ [data-ui='inline-message'] > [data-part='prefix'] {
160
+ block-size: 1px;
161
+ border: 0;
162
+ clip-path: inset(50%);
163
+ inline-size: 1px;
164
+ margin: -1px;
165
+ overflow: hidden;
166
+ padding: 0;
167
+ position: absolute;
168
+ white-space: nowrap;
169
+ }
170
+
171
+ /* ── The mark ─────────────────────────────────────────────────────────
172
+ *
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.
180
+ *
181
+ * 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.
185
+ */
186
+ [data-ui='inline-message'] > [data-part='icon'] {
187
+ --slotted-icon-size: var(--_mark-size);
188
+
189
+ align-items: center;
190
+ align-self: start;
191
+ block-size: var(--_mark-size);
192
+ box-sizing: border-box;
193
+ display: flex;
194
+ grid-column: 1;
195
+ grid-row: 1;
196
+ inline-size: var(--_mark-size);
197
+ justify-content: center;
198
+ margin-block-start: calc((1lh - var(--_mark-size)) / 2);
199
+ margin-inline-end: var(--_column-gap);
200
+ }
201
+
202
+ /**
203
+ * ── A bullet instead of a silhouette ──────────────────────────────────
204
+ *
205
+ * `mark='dot'` is for a page that wants a column of sentences rather than a
206
+ * column of silhouettes — a checklist, a changelog. The dot is the same for
207
+ * every tone, including the help tone that draws no mark at all otherwise,
208
+ * so every message in the column starts on one left edge and only the ink
209
+ * changes between them. `field` asked for it once and no longer does (F1):
210
+ * help under a field draws no mark, and an error draws the tone's own.
211
+ *
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
214
+ * slot is the disc's own width and the glyph's box is twice that, because
215
+ * the `dot` glyph draws a circle half the width of its own viewBox: at twice
216
+ * the slot the disc fills the slot exactly, the box overhanging it equally
217
+ * on both sides, and the bullet sits on the message's left edge under the
218
+ * label above it rather than inside a column sized for a circled glyph.
219
+ *
220
+ * The rule keys on the `dot` glyph the binding draws, which leaves the
221
+ * page's own artwork alone: a supplied mark keeps the full box it was
222
+ * measured for.
223
+ */
224
+ [data-ui='inline-message'][data-part='root'][data-mark='dot'] {
225
+ --_dot-size: calc(var(--_mark-size) / 3);
226
+ }
227
+
228
+ [data-ui='inline-message'][data-mark='dot']
229
+ > [data-part='icon']:has(> [data-ui='icon'] > [data-glyph='dot']) {
230
+ --slotted-icon-size: calc(var(--_dot-size) * 2);
231
+
232
+ inline-size: var(--_dot-size);
233
+ }
234
+
235
+ /**
236
+ * Help draws no mark, so the binding draws no glyph, and the empty box is
237
+ * withdrawn rather than left holding a column open for nothing.
238
+ *
239
+ * `:empty` keeps the page's own artwork, and `:not([data-loading])` keeps the
240
+ * ring below — a help message can be waiting for something like any other.
241
+ * `:not([data-mark='dot'])` keeps the bullet: the dot is a mark help has,
242
+ * and it is stated as an absence rather than as `[data-mark='glyph']` so
243
+ * markup written without the attribute keeps the rule.
244
+ */
245
+ [data-ui='inline-message'][data-tone='secondary']:not([data-loading]):not([data-mark='dot'])
246
+ > [data-part='icon']:empty {
247
+ display: none;
248
+ }
249
+
250
+ /**
251
+ * ── No mark at all ────────────────────────────────────────────────────
252
+ *
253
+ * `mark='none'` is the third value, and the one a form asks for. A
254
+ * silhouette per severity is right for a message that stands alone and
255
+ * wrong for a column of them: four fields in error draw four circled
256
+ * exclamations one under the other, and what was there to catch the eye
257
+ * becomes texture — the limit R5 draws, and the reason `field` and
258
+ * `field-group` default to this value. What says the tone there is the ink
259
+ * and the weight of the sentence, which is what F1 settled.
260
+ *
261
+ * The box is withdrawn for the reason help's is, and the same two
262
+ * exceptions hold: `:empty` leaves the page's own artwork alone, and
263
+ * `:not([data-loading])` keeps the ring, because a message with no mark can
264
+ * be waiting for something like any other.
265
+ */
266
+ [data-ui='inline-message'][data-mark='none']:not([data-loading]) > [data-part='icon']:empty {
267
+ display: none;
268
+ }
269
+
270
+ /* ── The sentence ─────────────────────────────────────────────────────
271
+ *
272
+ * 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.
276
+ *
277
+ * `overflow-wrap: anywhere` breaks the one string a field message is likeliest
278
+ * to carry that no language can break — a token, a container digest, a host
279
+ * name without a hyphen. Nothing is removed: the whole string stays in the
280
+ * DOM, in the accessibility tree, and findable by a page search.
281
+ */
282
+ [data-ui='inline-message'] > [data-part='text'] {
283
+ grid-column: 2;
284
+ grid-row: 1;
285
+ min-inline-size: 0;
286
+ overflow-wrap: anywhere;
287
+ }
288
+
289
+ /**
290
+ * Nothing to say, so nothing is drawn. This is the half of `reserve` that
291
+ * makes it usable: the line is held open, and a mark and a severity word
292
+ * standing beside an empty sentence would be the layout shift moved rather
293
+ * than removed.
294
+ */
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'] {
297
+ display: none;
298
+ }
299
+
300
+ /* ── The wait ─────────────────────────────────────────────────────────
301
+ *
302
+ * The guide names “progresso” as one of the kinds of inline message, and not
303
+ * one of the thirteen surveyed implementations ships it. It is a state of the
304
+ * same message rather than a sixth tone: the mark becomes a ring turning in
305
+ * the same place, and the tone, the size and every distance stay where they
306
+ * were — so “Verificando disponibilidade…” becomes “Nome disponível” with no
307
+ * geometry moving under the reader's eye.
308
+ *
309
+ * It is the ring `button` draws for the same reason, at the same duration,
310
+ * in the mark's own square on the first line where the mark it replaced was.
311
+ */
312
+ [data-ui='inline-message'][data-loading] > [data-part='icon'] {
313
+ animation: slotted-inline-message-spin var(--slotted-duration-loop-fast) linear infinite;
314
+ block-size: var(--_mark-size);
315
+ border: max(var(--slotted-border-width-thin, 1px), calc(var(--_mark-size) / 8)) solid
316
+ currentcolor;
317
+ /* One missing quarter, named logically so the gap leads the turn in both
318
+ directions. */
319
+ border-inline-end-color: transparent;
320
+ 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
323
+ dot is an ellipse. The text moves by the difference for as long as the
324
+ message is waiting, which is the cost of a bullet that starts at the
325
+ message's own left edge. */
326
+ inline-size: var(--_mark-size);
327
+ margin-block-start: calc((1lh - var(--_mark-size)) / 2);
328
+ }
329
+
330
+ /* The page's own artwork withdraws for the ring rather than sitting inside
331
+ it, because the ring is the mark while the message is waiting. */
332
+ [data-ui='inline-message'][data-loading] > [data-part='icon'] > * {
333
+ display: none;
334
+ }
335
+
336
+ /* ── Disabled ─────────────────────────────────────────────────────────
337
+ *
338
+ * Muted rather than faded: `--slotted-disabled-foreground` is a colour the
339
+ * theme measures, and lowering opacity until the sentence is unreadable is
340
+ * how a message beside a disabled control stops being a message.
341
+ *
342
+ * The mark is painted in `currentcolor`, so it follows without a rule of its
343
+ * own. The ring does need one: `STATE_PRECEDENCE` puts `disabled` above
344
+ * `loading`, and a control nobody can use is not waiting for anything.
345
+ */
346
+ [data-ui='inline-message'][data-part='root'][data-disabled] {
347
+ color: var(--slotted-disabled-foreground);
348
+ }
349
+
350
+ [data-ui='inline-message'][data-disabled] > [data-part='icon'] {
351
+ animation: none;
352
+ }
353
+
354
+ /**
355
+ * A frozen ring still says that something is in progress. Stopping it is less
356
+ * distracting than replacing one continuous motion with a slower one, which
357
+ * is the decision `button` recorded for the same ring.
358
+ */
359
+ @media (prefers-reduced-motion: reduce) {
360
+ [data-ui='inline-message'][data-loading] > [data-part='icon'] {
361
+ animation: none;
362
+ }
363
+ }
364
+
365
+ /* ── Forced colours ───────────────────────────────────────────────────
366
+ *
367
+ * The theme remaps every colour this family reads, so the ink needs no rule
368
+ * here. The mark takes a system colour of its own, so the silhouette keeps
369
+ * the ink that says it is a mark and not a word, and the muted one when the
370
+ * message is disabled.
371
+ *
372
+ * The ring is the same problem from the other side: its missing quarter is
373
+ * `transparent`, which survives, but its border would otherwise be forced to
374
+ * one colour and the turn would be a complete circle turning invisibly.
375
+ */
376
+ @media (forced-colors: active) {
377
+ [data-ui='inline-message'] > [data-part='icon'] {
378
+ color: CanvasText;
379
+ }
380
+
381
+ [data-ui='inline-message'][data-part='root'][data-disabled] > [data-part='icon'] {
382
+ color: GrayText;
383
+ }
384
+
385
+ [data-ui='inline-message'][data-loading] > [data-part='icon'] {
386
+ border-color: CanvasText;
387
+ border-inline-end-color: Canvas;
388
+ }
389
+ }
390
+ }
391
+
392
+ @keyframes slotted-inline-message-spin {
393
+ to {
394
+ transform: rotate(1turn);
395
+ }
396
+ }
@@ -0,0 +1,19 @@
1
+ [
2
+ "--slotted-border-width-thin",
3
+ "--slotted-control-font-family",
4
+ "--slotted-control-font-size-md",
5
+ "--slotted-control-font-size-sm",
6
+ "--slotted-disabled-foreground",
7
+ "--slotted-duration-loop-fast",
8
+ "--slotted-inline-message-column-gap",
9
+ "--slotted-inline-message-font-family",
10
+ "--slotted-inline-message-line-height",
11
+ "--slotted-line-height-md",
12
+ "--slotted-radius-full",
13
+ "--slotted-space-4",
14
+ "--slotted-text-muted",
15
+ "--slotted-tone-accent-text",
16
+ "--slotted-tone-danger-text",
17
+ "--slotted-tone-success-text",
18
+ "--slotted-tone-warning-text"
19
+ ]