@grafctory/clay-widgets 0.0.0-stage → 0.4.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 (185) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +46 -2
  3. package/dist/content/empty.css +107 -0
  4. package/dist/content/empty.d.ts +40 -0
  5. package/dist/content/empty.d.ts.map +1 -0
  6. package/dist/content/empty.js +42 -0
  7. package/dist/content/empty.js.map +1 -0
  8. package/dist/content/heading.css +34 -0
  9. package/dist/content/heading.d.ts +45 -0
  10. package/dist/content/heading.d.ts.map +1 -0
  11. package/dist/content/heading.js +49 -0
  12. package/dist/content/heading.js.map +1 -0
  13. package/dist/content/image.css +176 -0
  14. package/dist/content/image.d.ts +71 -0
  15. package/dist/content/image.d.ts.map +1 -0
  16. package/dist/content/image.js +63 -0
  17. package/dist/content/image.js.map +1 -0
  18. package/dist/content/infobox.css +186 -0
  19. package/dist/content/infobox.d.ts +72 -0
  20. package/dist/content/infobox.d.ts.map +1 -0
  21. package/dist/content/infobox.js +63 -0
  22. package/dist/content/infobox.js.map +1 -0
  23. package/dist/content/pill.css +76 -0
  24. package/dist/content/pill.d.ts +57 -0
  25. package/dist/content/pill.d.ts.map +1 -0
  26. package/dist/content/pill.js +48 -0
  27. package/dist/content/pill.js.map +1 -0
  28. package/dist/content/text.css +44 -0
  29. package/dist/content/text.d.ts +30 -0
  30. package/dist/content/text.d.ts.map +1 -0
  31. package/dist/content/text.js +42 -0
  32. package/dist/content/text.js.map +1 -0
  33. package/dist/controls/button.css +469 -0
  34. package/dist/controls/button.d.ts +116 -0
  35. package/dist/controls/button.d.ts.map +1 -0
  36. package/dist/controls/button.js +61 -0
  37. package/dist/controls/button.js.map +1 -0
  38. package/dist/controls/checkbox.css +23 -0
  39. package/dist/controls/checkbox.d.ts +54 -0
  40. package/dist/controls/checkbox.d.ts.map +1 -0
  41. package/dist/controls/checkbox.js +49 -0
  42. package/dist/controls/checkbox.js.map +1 -0
  43. package/dist/controls/choice.css +288 -0
  44. package/dist/controls/choice.d.ts +63 -0
  45. package/dist/controls/choice.d.ts.map +1 -0
  46. package/dist/controls/choice.js +52 -0
  47. package/dist/controls/choice.js.map +1 -0
  48. package/dist/controls/fieldset.css +37 -0
  49. package/dist/controls/fieldset.d.ts +49 -0
  50. package/dist/controls/fieldset.d.ts.map +1 -0
  51. package/dist/controls/fieldset.js +51 -0
  52. package/dist/controls/fieldset.js.map +1 -0
  53. package/dist/controls/form.css +50 -0
  54. package/dist/controls/form.d.ts +64 -0
  55. package/dist/controls/form.d.ts.map +1 -0
  56. package/dist/controls/form.js +62 -0
  57. package/dist/controls/form.js.map +1 -0
  58. package/dist/controls/input.css +57 -0
  59. package/dist/controls/input.d.ts +120 -0
  60. package/dist/controls/input.d.ts.map +1 -0
  61. package/dist/controls/input.js +78 -0
  62. package/dist/controls/input.js.map +1 -0
  63. package/dist/controls/label.css +73 -0
  64. package/dist/controls/label.d.ts +76 -0
  65. package/dist/controls/label.d.ts.map +1 -0
  66. package/dist/controls/label.js +73 -0
  67. package/dist/controls/label.js.map +1 -0
  68. package/dist/controls/radio.css +23 -0
  69. package/dist/controls/radio.d.ts +60 -0
  70. package/dist/controls/radio.d.ts.map +1 -0
  71. package/dist/controls/radio.js +50 -0
  72. package/dist/controls/radio.js.map +1 -0
  73. package/dist/controls/select.css +37 -0
  74. package/dist/controls/select.d.ts +62 -0
  75. package/dist/controls/select.d.ts.map +1 -0
  76. package/dist/controls/select.js +59 -0
  77. package/dist/controls/select.js.map +1 -0
  78. package/dist/controls/switch.css +154 -0
  79. package/dist/controls/switch.d.ts +44 -0
  80. package/dist/controls/switch.d.ts.map +1 -0
  81. package/dist/controls/switch.js +48 -0
  82. package/dist/controls/switch.js.map +1 -0
  83. package/dist/controls/textarea.css +50 -0
  84. package/dist/controls/textarea.d.ts +97 -0
  85. package/dist/controls/textarea.d.ts.map +1 -0
  86. package/dist/controls/textarea.js +75 -0
  87. package/dist/controls/textarea.js.map +1 -0
  88. package/dist/glyphs/icon.core.d.ts +52 -0
  89. package/dist/glyphs/icon.core.d.ts.map +1 -0
  90. package/dist/glyphs/icon.core.js +67 -0
  91. package/dist/glyphs/icon.core.js.map +1 -0
  92. package/dist/glyphs/icon.css +32 -0
  93. package/dist/glyphs/icon.d.ts +152 -0
  94. package/dist/glyphs/icon.d.ts.map +1 -0
  95. package/dist/glyphs/icon.js +167 -0
  96. package/dist/glyphs/icon.js.map +1 -0
  97. package/dist/glyphs/icon.md +76 -0
  98. package/dist/glyphs/logo.css +73 -0
  99. package/dist/glyphs/logo.d.ts +27 -0
  100. package/dist/glyphs/logo.d.ts.map +1 -0
  101. package/dist/glyphs/logo.js +49 -0
  102. package/dist/glyphs/logo.js.map +1 -0
  103. package/dist/index.d.ts +65 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +95 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/layouts/card.css +166 -0
  108. package/dist/layouts/card.d.ts +69 -0
  109. package/dist/layouts/card.d.ts.map +1 -0
  110. package/dist/layouts/card.js +57 -0
  111. package/dist/layouts/card.js.map +1 -0
  112. package/dist/layouts/stack.css +58 -0
  113. package/dist/layouts/stack.d.ts +64 -0
  114. package/dist/layouts/stack.d.ts.map +1 -0
  115. package/dist/layouts/stack.js +69 -0
  116. package/dist/layouts/stack.js.map +1 -0
  117. package/dist/layouts/strip.css +58 -0
  118. package/dist/layouts/strip.d.ts +72 -0
  119. package/dist/layouts/strip.d.ts.map +1 -0
  120. package/dist/layouts/strip.js +73 -0
  121. package/dist/layouts/strip.js.map +1 -0
  122. package/dist/layouts/tabs.core.d.ts +73 -0
  123. package/dist/layouts/tabs.core.d.ts.map +1 -0
  124. package/dist/layouts/tabs.core.js +65 -0
  125. package/dist/layouts/tabs.core.js.map +1 -0
  126. package/dist/layouts/tabs.css +260 -0
  127. package/dist/layouts/tabs.d.ts +57 -0
  128. package/dist/layouts/tabs.d.ts.map +1 -0
  129. package/dist/layouts/tabs.js +128 -0
  130. package/dist/layouts/tabs.js.map +1 -0
  131. package/dist/layouts/tree.css +138 -0
  132. package/dist/layouts/tree.d.ts +46 -0
  133. package/dist/layouts/tree.d.ts.map +1 -0
  134. package/dist/layouts/tree.js +69 -0
  135. package/dist/layouts/tree.js.map +1 -0
  136. package/dist/navigation/link.css +229 -0
  137. package/dist/navigation/link.d.ts +89 -0
  138. package/dist/navigation/link.d.ts.map +1 -0
  139. package/dist/navigation/link.js +91 -0
  140. package/dist/navigation/link.js.map +1 -0
  141. package/dist/navigation/path.css +122 -0
  142. package/dist/navigation/path.d.ts +42 -0
  143. package/dist/navigation/path.d.ts.map +1 -0
  144. package/dist/navigation/path.js +49 -0
  145. package/dist/navigation/path.js.map +1 -0
  146. package/dist/navigation/toc.core.d.ts +111 -0
  147. package/dist/navigation/toc.core.d.ts.map +1 -0
  148. package/dist/navigation/toc.core.js +60 -0
  149. package/dist/navigation/toc.core.js.map +1 -0
  150. package/dist/navigation/toc.css +53 -0
  151. package/dist/navigation/toc.d.ts +112 -0
  152. package/dist/navigation/toc.d.ts.map +1 -0
  153. package/dist/navigation/toc.js +321 -0
  154. package/dist/navigation/toc.js.map +1 -0
  155. package/dist/scopes/guard.css +26 -0
  156. package/dist/scopes/guard.d.ts +37 -0
  157. package/dist/scopes/guard.d.ts.map +1 -0
  158. package/dist/scopes/guard.js +60 -0
  159. package/dist/scopes/guard.js.map +1 -0
  160. package/dist/scopes/style.css +26 -0
  161. package/dist/scopes/style.d.ts +68 -0
  162. package/dist/scopes/style.d.ts.map +1 -0
  163. package/dist/scopes/style.js +108 -0
  164. package/dist/scopes/style.js.map +1 -0
  165. package/dist/shells/tool.css +778 -0
  166. package/dist/shells/tool.d.ts +164 -0
  167. package/dist/shells/tool.d.ts.map +1 -0
  168. package/dist/shells/tool.js +251 -0
  169. package/dist/shells/tool.js.map +1 -0
  170. package/dist/signals/more.css +42 -0
  171. package/dist/signals/more.d.ts +28 -0
  172. package/dist/signals/more.d.ts.map +1 -0
  173. package/dist/signals/more.js +61 -0
  174. package/dist/signals/more.js.map +1 -0
  175. package/dist/signals/note.css +221 -0
  176. package/dist/signals/note.d.ts +83 -0
  177. package/dist/signals/note.d.ts.map +1 -0
  178. package/dist/signals/note.js +72 -0
  179. package/dist/signals/note.js.map +1 -0
  180. package/dist/signals/toasts.css +463 -0
  181. package/dist/signals/toasts.d.ts +68 -0
  182. package/dist/signals/toasts.d.ts.map +1 -0
  183. package/dist/signals/toasts.js +160 -0
  184. package/dist/signals/toasts.js.map +1 -0
  185. package/package.json +331 -4
@@ -0,0 +1,778 @@
1
+ /*
2
+ * Copyright © 2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /*
18
+ * The frame is a grid of two columns by three rows, the side column beside the main one, each a head over a body over
19
+ * a foot. Each column lays its parts out on the rows of the frame, so the heads of both share one row, and so do the
20
+ * feet, whichever holds more. A column with nothing for its foot leaves it out, and its body takes the row instead. The
21
+ * frame fills the height its host gives it, each body scrolling within what its bars leave.
22
+ */
23
+
24
+ /*
25
+ * The knobs below tune the geometry and type of the frame. They are properties of this shell rather than design system
26
+ * tokens, so a single dash keeps them apart from the `--skin--` contract. An app retunes one shell by restating a knob
27
+ * on it, or every shell inside an element by restating it there. A knob defaulting to a design system token carries no
28
+ * initial value and is read with that token as fallback, so while it is left untouched it follows the theme.
29
+ */
30
+
31
+ /* The width of the side column, room for a navigation label or a filter at the text size. */
32
+
33
+ @property --clay-tool-side-width {
34
+ syntax: "*";
35
+ inherits: true;
36
+ initial-value: 15rem;
37
+ }
38
+
39
+ /*
40
+ * The widest the main column grows, gutters included. Past it, the two columns stand centred in the frame, so a wide
41
+ * window leaves the screen as it was rather than stretching its lines and controls apart.
42
+ */
43
+
44
+ @property --clay-tool-main-width {
45
+ syntax: "*";
46
+ inherits: true;
47
+ initial-value: 60rem;
48
+ }
49
+
50
+ /* The inline gutter of the frame, keeping both columns clear of the edges of the window. */
51
+
52
+ @property --clay-tool-frame-gutter {
53
+ syntax: "*";
54
+ inherits: true;
55
+ initial-value: 0;
56
+ }
57
+
58
+ /* The inline gutter of the side column. */
59
+
60
+ @property --clay-tool-side-gutter {
61
+ syntax: "*";
62
+ inherits: true;
63
+ }
64
+
65
+ /* The inline gutter of the main column. */
66
+
67
+ @property --clay-tool-main-gutter {
68
+ syntax: "*";
69
+ inherits: true;
70
+ }
71
+
72
+ /* The block gutter of the head row, where two columns fit; narrower heads take the edge inset of the frame. */
73
+
74
+ @property --clay-tool-head-gutter {
75
+ syntax: "*";
76
+ inherits: true;
77
+ }
78
+
79
+ /* The block gutter of the body row, where two columns fit; narrower bodies take none. */
80
+
81
+ @property --clay-tool-body-gutter {
82
+ syntax: "*";
83
+ inherits: true;
84
+ }
85
+
86
+ /* The block gutter of the foot row, and of the copy closing the main body. */
87
+
88
+ @property --clay-tool-foot-gutter {
89
+ syntax: "*";
90
+ inherits: true;
91
+ }
92
+
93
+ /* The font size of the head row. */
94
+
95
+ @property --clay-tool-head-font-size {
96
+ syntax: "*";
97
+ inherits: true;
98
+ }
99
+
100
+ /* The font size of the foot row, and of the copy closing the main body. */
101
+
102
+ @property --clay-tool-foot-font-size {
103
+ syntax: "*";
104
+ inherits: true;
105
+ }
106
+
107
+ /*
108
+ * The gutters every part reads, and the edge inset of the heads, settled once on the frame. They are registered as
109
+ * lengths so a gutter stated in `em` resolves against the type of the frame and is handed down as a fixed length, not
110
+ * against each part: a head or a foot set in a size of its own keeps the gutters of the parts beside and below it, and
111
+ * what the columns hold stays on one line from head to foot. They are internal, offering nothing beyond the knobs.
112
+ */
113
+
114
+ @property --clay-tool-side-inset {
115
+ syntax: "<length>";
116
+ inherits: true;
117
+ initial-value: 0px;
118
+ }
119
+
120
+ @property --clay-tool-main-inset {
121
+ syntax: "<length>";
122
+ inherits: true;
123
+ initial-value: 0px;
124
+ }
125
+
126
+ @property --clay-tool-head-inset {
127
+ syntax: "<length>";
128
+ inherits: true;
129
+ initial-value: 0px;
130
+ }
131
+
132
+ @property --clay-tool-body-inset {
133
+ syntax: "<length>";
134
+ inherits: true;
135
+ initial-value: 0px;
136
+ }
137
+
138
+ @property --clay-tool-foot-inset {
139
+ syntax: "<length>";
140
+ inherits: true;
141
+ initial-value: 0px;
142
+ }
143
+
144
+ @property --clay-tool-edge-inset {
145
+ syntax: "<length>";
146
+ inherits: true;
147
+ initial-value: 0px;
148
+ }
149
+
150
+ /*
151
+ * The scroll state the rule under a head is drawn from, internal as well: how far the rule has drawn in, and whether
152
+ * the body has anything to scroll. They are registered as numbers so the scroll position can animate them, and stand
153
+ * at zero wherever no animation sets them, so a head shows no rule until its body scrolls.
154
+ */
155
+
156
+ @property --clay-tool-head-rule {
157
+ syntax: "<number>";
158
+ inherits: false;
159
+ initial-value: 0;
160
+ }
161
+
162
+ @property --clay-tool-scrollable {
163
+ syntax: "<number>";
164
+ inherits: false;
165
+ initial-value: 0;
166
+ }
167
+
168
+
169
+ clay-tool {
170
+
171
+ --clay-tool-side-inset: var(--clay-tool-side-gutter, var(--skin--spacing-100));
172
+ --clay-tool-main-inset: var(--clay-tool-main-gutter, var(--skin--spacing-100));
173
+ --clay-tool-head-inset: var(--clay-tool-head-gutter, var(--skin--spacing-100));
174
+ --clay-tool-body-inset: var(--clay-tool-body-gutter, var(--skin--spacing-100));
175
+ --clay-tool-foot-inset: var(--clay-tool-foot-gutter, var(--skin--spacing-100));
176
+ --clay-tool-edge-inset: var(--skin--spacing-100);
177
+
178
+ /* The track of the main column, capped at the width limit unless the frame goes wide. */
179
+
180
+ --clay-tool-main-track: minmax(0, var(--clay-tool-main-width));
181
+
182
+ position: relative;
183
+
184
+ display: grid;
185
+ grid-template-columns: var(--clay-tool-side-width) var(--clay-tool-main-track);
186
+ grid-template-rows: auto minmax(0, 1fr) auto;
187
+ justify-content: center;
188
+
189
+ padding-inline: var(--clay-tool-frame-gutter);
190
+
191
+ /* The scroll position of each body reaches the bars beside it, which are its siblings rather than its children. */
192
+
193
+ timeline-scope: --clay-tool-side-scroll, --clay-tool-main-scroll;
194
+
195
+ &[wide] {
196
+ --clay-tool-main-track: minmax(0, 1fr);
197
+ }
198
+
199
+ /* A frame with the side column tucked away takes it out of the track list, leaving no room for it. */
200
+
201
+ &[tucked] {
202
+ grid-template-columns: var(--clay-tool-main-track);
203
+ }
204
+
205
+ /*
206
+ * Waiting lays a veil of the page colour over the frame, washing everything toward the page by the same share, bold
207
+ * and large text included, where a fade would leave the heaviest text standing out. The frame ignores the input
208
+ * aimed inside it meanwhile, so the veil itself takes no gesture, leaving the bodies free to scroll beneath it.
209
+ */
210
+
211
+ &[waiting]::after {
212
+ content: "";
213
+ position: absolute;
214
+ inset: 0;
215
+ background-color: color-mix(in oklab, var(--skin--background-color) 50%, transparent);
216
+ backdrop-filter: blur(0.5px); /* A slight blur takes the edge off the text beneath, headings included. */
217
+ pointer-events: none;
218
+ }
219
+
220
+ /*
221
+ * Typing is ignored while the app is busy, so the caret is hidden at once, ahead of the veil, rather than blinking
222
+ * in a field that takes nothing; the focus stays put, so the field keeps its editing state. Skin defines no caret
223
+ * token, and a hidden caret has no colour to read from one, hence the keyword.
224
+ */
225
+
226
+ &[aria-busy="true"] * {
227
+ caret-color: transparent;
228
+ }
229
+
230
+ /* A locked side column fades what it holds while keeping its place, and the mark in the main head fades too. */
231
+
232
+ &[locked] > aside > *,
233
+ &[locked] > main > header > .mark > * {
234
+ opacity: var(--skin--opacity-locked);
235
+ }
236
+
237
+ /*
238
+ * Below the medium viewport two columns no longer fit: the main column takes the whole frame, and the side column
239
+ * stays out of view until the menu button leading the main head opens it as a drawer. From the medium viewport up
240
+ * the frame keeps its two columns. The bodies drop their block gutter, giving the narrow screen all their height.
241
+ */
242
+
243
+ @container style(--skin--viewport-medium: off) {
244
+ --clay-tool-body-inset: 0px;
245
+ grid-template-columns: var(--clay-tool-main-track);
246
+ }
247
+
248
+
249
+ /*
250
+ * Each column spans the three rows of the frame and lays its parts out on them, so the heads of both share one row
251
+ * and the feet another, while the column stays a box of its own that can carry the focus and its landmark. Each
252
+ * names the timeline its body scrolls, for the bars of the column to read. The columns are matched without weight,
253
+ * so the parts both share weigh no more than they did as bare children, and the rules of either column win.
254
+ */
255
+
256
+ & > :where(aside, main) {
257
+
258
+ /*
259
+ * The single track of a column is held to the width of the column, so a bar whose unwrapped content is wider
260
+ * clips it rather than widening the track past the column, which an automatic track sized to that content does.
261
+ */
262
+
263
+ display: grid;
264
+ grid-row: 1 / -1;
265
+ grid-template-columns: minmax(0, 1fr);
266
+ grid-template-rows: subgrid;
267
+ min-inline-size: 0;
268
+ min-block-size: 0;
269
+
270
+ /*
271
+ * Heads and feet are rows stretching to the taller of each pair and centring what they hold vertically, so the
272
+ * two columns line up. What they hold keeps its own width from the start of the bar, unless it grows to fill
273
+ * the row, and never wraps, so a bar keeps the height of a single row whatever text it carries. Items too wide
274
+ * for the bar shrink, clipping what overflows them and ending clipped text with an ellipsis. The clip reaches
275
+ * past the item, so the focus mark and the hover fill of a link nested in it show whole, while the ellipsis
276
+ * still cuts text at the edge of the item. A link standing in the bar is left unclipped, cutting its own
277
+ * wording short, so its marks show whole even where the browser keeps the clip to the edge of the box.
278
+ */
279
+
280
+ & > :is(header, footer) {
281
+
282
+ display: flex;
283
+ align-items: center;
284
+ white-space: nowrap;
285
+
286
+ & > * {
287
+
288
+ min-inline-size: 0;
289
+
290
+ &:not(clay-link) {
291
+ overflow: clip;
292
+ overflow-clip-margin: var(--skin--spacing-050);
293
+ text-overflow: ellipsis;
294
+ }
295
+
296
+ }
297
+
298
+ /*
299
+ * A button at either end of a bar, standing in it or in the row filling it, reaches into the gutter by the
300
+ * padding around what it carries, so its glyph or label stands on the edge the rest of the column starts
301
+ * from rather than inset by a padding showing only on hover. The box naming the main column counts as the
302
+ * bar it fills, so a row it holds is reached through it, and a turning glyph is not counted as an
303
+ * end. The ends are matched without weight, so a control reaching out by a measure of its own states it.
304
+ */
305
+
306
+ & > :is(button, clay-button):where(:first-child),
307
+ & > :not(clay-button):where(:first-child) > :is(button, clay-button):where(:first-child),
308
+ & > div:where(:first-child) > :not(clay-button):where(:first-child) > :is(button, clay-button):where(:first-child) {
309
+ margin-inline-start: calc(-1 * var(--skin--spacing-025));
310
+ }
311
+
312
+ & > :is(button, clay-button):where(:nth-last-child(1 of :not(.busy))),
313
+ & > :not(clay-button):where(:nth-last-child(1 of :not(.busy))) > :is(button, clay-button):where(:last-child),
314
+ & > div:where(:nth-last-child(1 of :not(.busy))) > :not(clay-button):where(:last-child) > :is(button, clay-button):where(:last-child) {
315
+ margin-inline-end: calc(-1 * var(--skin--spacing-025));
316
+ }
317
+
318
+ }
319
+
320
+ /*
321
+ * A rule parts each bar from the body only while content lies hidden past it, so the reader sees there is more
322
+ * to scroll to rather than taking the edge of the body for the end of it. The rule under a head draws in as the
323
+ * body starts scrolling down, and the one over a foot draws out as it nears the end. A body with nothing to
324
+ * scroll leaves both rules out, as does a browser unable to follow the scroll position.
325
+ */
326
+
327
+ & > header {
328
+
329
+ grid-row: 1;
330
+ padding-block: var(--clay-tool-head-inset);
331
+ font-size: var(--clay-tool-head-font-size, var(--skin--font-size));
332
+
333
+ /*
334
+ * The rule under a head is gated on the body having anything to scroll, a state animated over a range
335
+ * ending past the scroll range, so the animation never finishes. Chrome (seen in 157) keeps applying a
336
+ * scroll-driven animation that finished past the end of its range after its timeline turns inactive, so a
337
+ * rule drawn in alone stays drawn once the body stops overflowing, as a section collapses in it after the
338
+ * reader scrolled down. The gate drops it, as its own animation is never left finished. The foot needs no
339
+ * gate: past the end of its range its rule is already out, and the stale state shows nothing.
340
+ */
341
+
342
+ border-block-end-style: var(--skin--border-style);
343
+ border-block-end-color: color-mix(in oklab,
344
+ var(--skin--border-color) calc(min(var(--clay-tool-head-rule), var(--clay-tool-scrollable)) * 100%),
345
+ transparent
346
+ );
347
+
348
+ animation: clay-tool-head-rule linear both, clay-tool-scrollable linear both;
349
+ animation-timeline: var(--clay-tool-scroll), var(--clay-tool-scroll);
350
+ animation-range: 0 var(--skin--spacing-100), 0% calc(100% + 1px);
351
+
352
+ /*
353
+ * Where two columns do not fit, the heads hold only the buttons of the drawer, the mark and the menu, and
354
+ * take the edge inset above and below in place of the head gutter, which is sized for a heading, so a
355
+ * retuned gutter leaves them alone. The buttons reach out by their padding, so the menu glyph stands at
356
+ * the edge inset, a little below the diagonal of the corner, where the eye reads it as level.
357
+ */
358
+
359
+ @container style(--skin--viewport-medium: off) {
360
+ padding-block: calc(var(--clay-tool-edge-inset) - var(--skin--spacing-025));
361
+ }
362
+
363
+ /*
364
+ * The menu and close buttons are bare glyphs shown only where the side column is a drawer, the menu button
365
+ * leading the main head and the close button leading the side head, clear of what the head holds. Their
366
+ * padding widens the target past the glyph, and the menu button keeps that distance from the title too.
367
+ */
368
+
369
+ & > button {
370
+
371
+ display: none;
372
+ flex: none;
373
+ padding: var(--skin--spacing-025);
374
+ margin-inline-end: var(--skin--spacing-025);
375
+ border-style: none;
376
+ background-color: transparent;
377
+ color: inherit;
378
+ cursor: pointer;
379
+
380
+ /*
381
+ * They answer the pointer as a subtle button does, taking the neutral hover and pressed covers over
382
+ * their surface, so the reader sees the whole target rather than the glyph alone.
383
+ */
384
+
385
+ &:hover {
386
+ background-color: var(--skin--background-color-hover-neutral);
387
+ }
388
+
389
+ &:active {
390
+ background-color: var(--skin--background-color-pressed-neutral);
391
+ }
392
+
393
+ }
394
+
395
+ }
396
+
397
+ /*
398
+ * The body scrolls with no padding of its own, so content made sticky pins flush with the bars: the inset is
399
+ * carried by the boxes scrolling inside it, each column setting it on what its body holds. A column with no foot
400
+ * runs its body down to the end of the frame, leaving no empty bar beside the foot of the other column. Content
401
+ * scrolled into view, as the target of a link is, stops on the inset rather than flush with the head, so the
402
+ * first heading of the body lands where it stands before any scrolling.
403
+ */
404
+
405
+ & > div {
406
+
407
+ grid-row: 2;
408
+ overflow: auto;
409
+ scroll-padding-block-start: var(--clay-tool-body-inset);
410
+ scroll-timeline: var(--clay-tool-scroll) block;
411
+
412
+ &:last-child {
413
+ grid-row: 2 / -1;
414
+ }
415
+
416
+ }
417
+
418
+ & > footer {
419
+
420
+ grid-row: 3;
421
+ padding-block: var(--clay-tool-foot-inset);
422
+ font-size: var(--clay-tool-foot-font-size, var(--skin--font-size));
423
+
424
+ border-block-start-style: var(--skin--border-style);
425
+ border-block-start-color: transparent;
426
+
427
+ animation: clay-tool-foot-rule linear both;
428
+ animation-timeline: var(--clay-tool-scroll);
429
+ animation-range: calc(100% - var(--skin--spacing-100)) 100%;
430
+
431
+ }
432
+
433
+ }
434
+
435
+ /*
436
+ * The side column is a popover, which the platform places as a fixed box sized by what it holds; standing as a
437
+ * column it takes its track instead, until it is opened as a drawer.
438
+ */
439
+
440
+ & > aside {
441
+
442
+ --clay-tool-scroll: --clay-tool-side-scroll;
443
+
444
+ grid-column: 1;
445
+
446
+ position: static;
447
+ inset: auto;
448
+ inline-size: auto;
449
+ block-size: auto;
450
+ overflow: visible;
451
+
452
+ & > * {
453
+ padding-inline: var(--clay-tool-side-inset);
454
+ }
455
+
456
+ /*
457
+ * The meta stands apart from what leads the head, the mark or the close button of the drawer, pushed to its
458
+ * end. Never shrinking, it clips nothing, while the mark gives way to it where the head runs short. It takes
459
+ * the height of a single line of the head, what it holds centred on it and overhanging into the gutter above
460
+ * and below, so buttons and their padding leave the height of the head row unchanged.
461
+ */
462
+
463
+ & > header > .meta {
464
+ display: flex;
465
+ flex: none;
466
+ align-items: center;
467
+ block-size: 1lh;
468
+ margin-inline-start: auto;
469
+ overflow: visible;
470
+ }
471
+
472
+ /*
473
+ * The tray stands in a box of its own, carrying the inset without touching the margins of what it holds. The
474
+ * box fills the body and lays what it holds out as a column, so an item can grow, shrink or align with the flex
475
+ * properties it states, as a filter list pushing the controls after it to the bottom of the column.
476
+ */
477
+
478
+ & > div {
479
+
480
+ display: flex;
481
+ flex-direction: column;
482
+
483
+ & > div {
484
+ display: flex;
485
+ flex-direction: column;
486
+ flex: auto;
487
+ padding-block: var(--clay-tool-body-inset);
488
+ }
489
+
490
+ }
491
+
492
+ @container style(--skin--viewport-medium: off) {
493
+ &:not(:popover-open) {
494
+ display: none;
495
+ }
496
+ }
497
+
498
+ /*
499
+ * An open side column is a drawer: it covers the main column from the start edge, as wide as the side column
500
+ * but never wider than the window, over a blanket dimming what lies underneath. On a phone held upright, below
501
+ * the small viewport, it spans the whole window, as a narrower drawer would leave a sliver of the main column
502
+ * too thin to read. It slides in as the blanket fades in, quickly enough not to hold the reader up yet slowly
503
+ * enough to show where the drawer came from and where it will go; it leaves at once.
504
+ */
505
+
506
+ &:popover-open {
507
+
508
+ display: grid;
509
+ grid-template-rows: auto minmax(0, 1fr) auto;
510
+
511
+ position: fixed;
512
+ inset-block: 0;
513
+ inset-inline: 0 auto;
514
+ inline-size: min(100%, var(--clay-tool-side-width));
515
+ block-size: 100%;
516
+ overflow: hidden;
517
+
518
+ color: inherit;
519
+ background-color: var(--skin--background-color-overlay);
520
+
521
+ /*
522
+ * The neutral covers lose the glyph and the focus ring on an overlay, so the controls in the drawer answer
523
+ * the pointer with the accent states, which the design system holds legible on the overlay too.
524
+ */
525
+
526
+ --skin--background-color-hover-neutral: var(--skin--background-color-hover);
527
+ --skin--background-color-pressed-neutral: var(--skin--background-color-pressed);
528
+
529
+ translate: 0;
530
+ transition: translate var(--skin--duration-fast) ease-out;
531
+
532
+ @starting-style {
533
+ translate: -100% 0;
534
+ }
535
+
536
+ @container style(--skin--viewport-small: off) {
537
+ inline-size: 100%;
538
+ }
539
+
540
+ &:dir(rtl) {
541
+ @starting-style {
542
+ translate: 100% 0;
543
+ }
544
+ }
545
+
546
+ /*
547
+ * The close glyph is drawn in the middle half of its square, so beyond the padding every edge button
548
+ * gives up it reaches out by an eighth of the glyph, short of the quarter left blank, so the width of the
549
+ * stroke stays inside the edge of the drawer rather than spilling past it, as the menu stroke does.
550
+ */
551
+
552
+ & > header > button {
553
+ display: inline-flex;
554
+ margin-inline-start: calc(-1 * (var(--skin--spacing-025) + var(--skin--scaling-100) / 8));
555
+ }
556
+
557
+ &::backdrop {
558
+
559
+ background-color: var(--skin--background-color-blanket);
560
+ transition: background-color var(--skin--duration-fast) ease-out;
561
+
562
+ @starting-style {
563
+ background-color: transparent;
564
+ }
565
+
566
+ }
567
+
568
+ }
569
+
570
+ }
571
+
572
+ & > main {
573
+
574
+ --clay-tool-scroll: --clay-tool-main-scroll;
575
+
576
+ grid-column: -2;
577
+
578
+ /* The column takes the focus only to be announced, so it draws no ring a reader could take for a control. */
579
+
580
+ &:focus {
581
+ outline: none;
582
+ }
583
+
584
+ & > * {
585
+ padding-inline: var(--clay-tool-main-inset);
586
+ }
587
+
588
+ & > header {
589
+
590
+ position: relative;
591
+
592
+ /* The box of the mark stands aside from the layout, what it holds clipped as bar items. */
593
+
594
+ & > .mark {
595
+ display: contents;
596
+ }
597
+
598
+ /*
599
+ * The box of the heading lays out what it holds as a row filling the head, up to the menu. It takes the
600
+ * height of a single line of the head, what it holds centred on it and overhanging into the gutter above
601
+ * and below, so a button and its padding, shown or removed, leave the height of the head row unchanged.
602
+ */
603
+
604
+ & > div:not(.mark, .menu) {
605
+ display: flex;
606
+ flex: auto;
607
+ align-items: center;
608
+ block-size: 1lh;
609
+ overflow: visible;
610
+ }
611
+
612
+ & > div:not(.menu) {
613
+
614
+ & > * {
615
+
616
+ min-inline-size: 0;
617
+
618
+ &:not(clay-link) {
619
+ overflow: clip;
620
+ overflow-clip-margin: var(--skin--spacing-050);
621
+ text-overflow: ellipsis;
622
+ }
623
+
624
+ }
625
+
626
+ }
627
+
628
+ /*
629
+ * The menu stands apart from the head, pushed to its end whatever the head holds. Never shrinking, it clips
630
+ * nothing, so the button ending it reaches into the gutter as at the end of any bar. While a turning glyph
631
+ * stands over it, the menu keeps its box hidden beneath, so the head neither shrinks nor shifts. It takes
632
+ * the height of a single line of the head, as the heading does, its buttons overhanging into the gutter.
633
+ */
634
+
635
+ & > .menu {
636
+
637
+ display: flex;
638
+ flex: none;
639
+ align-items: center;
640
+ block-size: 1lh;
641
+ margin-inline-start: auto;
642
+ overflow: visible;
643
+
644
+ &:has(+ .busy) {
645
+ visibility: hidden;
646
+ }
647
+
648
+ }
649
+
650
+ /*
651
+ * The menu glyph leaves a sixth of its square blank on either side, so beyond the padding every edge button
652
+ * gives up it reaches out by that blank, and its stroke stands on the edge of the main column as the close
653
+ * stroke does on the edge of the drawer.
654
+ */
655
+
656
+ @container style(--skin--viewport-medium: off) {
657
+ & > button:first-child {
658
+ display: inline-flex;
659
+ margin-inline-start: calc(-1 * (var(--skin--spacing-025) + var(--skin--scaling-100) / 6));
660
+ }
661
+ }
662
+
663
+ /*
664
+ * The turning glyph stands over the end of the head, above the veil and out of the flow, so the head keeps
665
+ * its height and layout; it takes the box an edge button takes, glyph and padding reaching into the gutter
666
+ * alike. It turns at the spin period of the design system whatever motion the reader asked for.
667
+ */
668
+
669
+ & > .busy {
670
+
671
+ position: absolute;
672
+ inset-block: 0;
673
+ inset-inline-end: calc(var(--clay-tool-main-inset) - var(--skin--spacing-025));
674
+ z-index: 1;
675
+
676
+ display: flex;
677
+ block-size: fit-content;
678
+ margin-block: auto;
679
+ padding: var(--skin--spacing-025);
680
+
681
+ color: var(--skin--color-label);
682
+
683
+ & svg {
684
+ animation: clay-tool-turn var(--skin--duration-spin) linear infinite;
685
+ }
686
+
687
+ }
688
+
689
+ }
690
+
691
+ /*
692
+ * The body holds the content in a block of its own, laid out in the plain flow of a page, so floats wrap text
693
+ * and margins collapse. The block carries the inset of the body, as a box of the column rather than content,
694
+ * and is at least as tall as the body, so its height is definite and a lone item stating `block-size: 100%`
695
+ * fills it whole, as a map does, while longer content grows the block past the body and scrolls as usual.
696
+ */
697
+
698
+ & > div {
699
+
700
+ display: flex;
701
+ flex-direction: column;
702
+
703
+ & > div {
704
+ flex: 1 0 100%;
705
+ padding-block: var(--clay-tool-body-inset);
706
+ }
707
+
708
+ /*
709
+ * A head opening the body, where two columns do not fit, keeps the type it takes in the head and stands
710
+ * above the block, which keeps the full height of the body: scrolling down takes the head out of view and
711
+ * leaves the block filling the body, as it does where the head stands in the main head.
712
+ */
713
+
714
+ & > header {
715
+ font-size: var(--clay-tool-head-font-size, var(--skin--font-size));
716
+ }
717
+
718
+ /*
719
+ * A copy closes the body, taking the inset and type of a foot. The block then gives up the room the copy
720
+ * takes, never shrinking below what it holds, so the copy rests at the bottom of a body the content is
721
+ * too short to fill and follows the content otherwise; an item filling the block fills it less the copy.
722
+ */
723
+
724
+ &:has(> footer) > div {
725
+ flex-shrink: 1;
726
+ }
727
+
728
+ & > footer {
729
+ padding-block: var(--clay-tool-foot-inset);
730
+ font-size: var(--clay-tool-foot-font-size, var(--skin--font-size));
731
+ }
732
+
733
+ }
734
+
735
+ }
736
+
737
+ }
738
+
739
+
740
+ @keyframes clay-tool-head-rule {
741
+
742
+ from {
743
+ --clay-tool-head-rule: 0;
744
+ }
745
+
746
+ to {
747
+ --clay-tool-head-rule: 1;
748
+ }
749
+
750
+ }
751
+
752
+ @keyframes clay-tool-scrollable {
753
+
754
+ from, to {
755
+ --clay-tool-scrollable: 1;
756
+ }
757
+
758
+ }
759
+
760
+ @keyframes clay-tool-foot-rule {
761
+
762
+ from {
763
+ border-block-start-color: var(--skin--border-color);
764
+ }
765
+
766
+ to {
767
+ border-block-start-color: transparent;
768
+ }
769
+
770
+ }
771
+
772
+ @keyframes clay-tool-turn {
773
+
774
+ to {
775
+ rotate: 1turn;
776
+ }
777
+
778
+ }