claymorph-ui 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 (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +130 -2
  3. package/dist/attach.d.ts +115 -0
  4. package/dist/attach.js +328 -0
  5. package/dist/attach.js.map +1 -0
  6. package/dist/clay.css +1648 -0
  7. package/dist/color.d.ts +5 -0
  8. package/dist/color.js +44 -0
  9. package/dist/color.js.map +1 -0
  10. package/dist/components/action-button.d.ts +31 -0
  11. package/dist/components/action-button.js +158 -0
  12. package/dist/components/action-button.js.map +1 -0
  13. package/dist/components/bars.d.ts +33 -0
  14. package/dist/components/bars.js +135 -0
  15. package/dist/components/bars.js.map +1 -0
  16. package/dist/components/button.d.ts +10 -0
  17. package/dist/components/button.js +36 -0
  18. package/dist/components/button.js.map +1 -0
  19. package/dist/components/card.d.ts +24 -0
  20. package/dist/components/card.js +139 -0
  21. package/dist/components/card.js.map +1 -0
  22. package/dist/components/controls.d.ts +54 -0
  23. package/dist/components/controls.js +310 -0
  24. package/dist/components/controls.js.map +1 -0
  25. package/dist/components/forms.d.ts +41 -0
  26. package/dist/components/forms.js +266 -0
  27. package/dist/components/forms.js.map +1 -0
  28. package/dist/components/group.d.ts +26 -0
  29. package/dist/components/group.js +180 -0
  30. package/dist/components/group.js.map +1 -0
  31. package/dist/components/overlays.d.ts +89 -0
  32. package/dist/components/overlays.js +383 -0
  33. package/dist/components/overlays.js.map +1 -0
  34. package/dist/components/popups.d.ts +55 -0
  35. package/dist/components/popups.js +308 -0
  36. package/dist/components/popups.js.map +1 -0
  37. package/dist/components/slide.d.ts +34 -0
  38. package/dist/components/slide.js +234 -0
  39. package/dist/components/slide.js.map +1 -0
  40. package/dist/components/tabs.d.ts +20 -0
  41. package/dist/components/tabs.js +105 -0
  42. package/dist/components/tabs.js.map +1 -0
  43. package/dist/config.d.ts +48 -0
  44. package/dist/config.js +50 -0
  45. package/dist/config.js.map +1 -0
  46. package/dist/element.d.ts +39 -0
  47. package/dist/element.js +135 -0
  48. package/dist/element.js.map +1 -0
  49. package/dist/engine.d.ts +91 -0
  50. package/dist/engine.js +454 -0
  51. package/dist/engine.js.map +1 -0
  52. package/dist/entries/action-button.d.ts +8 -0
  53. package/dist/entries/action-button.js +8 -0
  54. package/dist/entries/action-button.js.map +1 -0
  55. package/dist/entries/avatar.d.ts +8 -0
  56. package/dist/entries/avatar.js +8 -0
  57. package/dist/entries/avatar.js.map +1 -0
  58. package/dist/entries/badge.d.ts +7 -0
  59. package/dist/entries/badge.js +7 -0
  60. package/dist/entries/badge.js.map +1 -0
  61. package/dist/entries/button-group.d.ts +9 -0
  62. package/dist/entries/button-group.js +9 -0
  63. package/dist/entries/button-group.js.map +1 -0
  64. package/dist/entries/button.d.ts +8 -0
  65. package/dist/entries/button.js +8 -0
  66. package/dist/entries/button.js.map +1 -0
  67. package/dist/entries/card.d.ts +7 -0
  68. package/dist/entries/card.js +7 -0
  69. package/dist/entries/card.js.map +1 -0
  70. package/dist/entries/checkbox.d.ts +9 -0
  71. package/dist/entries/checkbox.js +9 -0
  72. package/dist/entries/checkbox.js.map +1 -0
  73. package/dist/entries/dialog.d.ts +8 -0
  74. package/dist/entries/dialog.js +8 -0
  75. package/dist/entries/dialog.js.map +1 -0
  76. package/dist/entries/input.d.ts +9 -0
  77. package/dist/entries/input.js +9 -0
  78. package/dist/entries/input.js.map +1 -0
  79. package/dist/entries/menu.d.ts +8 -0
  80. package/dist/entries/menu.js +8 -0
  81. package/dist/entries/menu.js.map +1 -0
  82. package/dist/entries/meter.d.ts +8 -0
  83. package/dist/entries/meter.js +8 -0
  84. package/dist/entries/meter.js.map +1 -0
  85. package/dist/entries/popover.d.ts +8 -0
  86. package/dist/entries/popover.js +8 -0
  87. package/dist/entries/popover.js.map +1 -0
  88. package/dist/entries/progress.d.ts +8 -0
  89. package/dist/entries/progress.js +8 -0
  90. package/dist/entries/progress.js.map +1 -0
  91. package/dist/entries/radio.d.ts +9 -0
  92. package/dist/entries/radio.js +9 -0
  93. package/dist/entries/radio.js.map +1 -0
  94. package/dist/entries/segmented.d.ts +8 -0
  95. package/dist/entries/segmented.js +8 -0
  96. package/dist/entries/segmented.js.map +1 -0
  97. package/dist/entries/select.d.ts +8 -0
  98. package/dist/entries/select.js +8 -0
  99. package/dist/entries/select.js.map +1 -0
  100. package/dist/entries/slide-confirm.d.ts +8 -0
  101. package/dist/entries/slide-confirm.js +8 -0
  102. package/dist/entries/slide-confirm.js.map +1 -0
  103. package/dist/entries/slider.d.ts +9 -0
  104. package/dist/entries/slider.js +9 -0
  105. package/dist/entries/slider.js.map +1 -0
  106. package/dist/entries/switch.d.ts +9 -0
  107. package/dist/entries/switch.js +9 -0
  108. package/dist/entries/switch.js.map +1 -0
  109. package/dist/entries/tabs.d.ts +8 -0
  110. package/dist/entries/tabs.js +8 -0
  111. package/dist/entries/tabs.js.map +1 -0
  112. package/dist/entries/toast.d.ts +9 -0
  113. package/dist/entries/toast.js +8 -0
  114. package/dist/entries/toast.js.map +1 -0
  115. package/dist/entries/toggle.d.ts +8 -0
  116. package/dist/entries/toggle.js +8 -0
  117. package/dist/entries/toggle.js.map +1 -0
  118. package/dist/entries/tooltip.d.ts +8 -0
  119. package/dist/entries/tooltip.js +8 -0
  120. package/dist/entries/tooltip.js.map +1 -0
  121. package/dist/highlight.d.ts +26 -0
  122. package/dist/highlight.js +100 -0
  123. package/dist/highlight.js.map +1 -0
  124. package/dist/index.d.ts +29 -0
  125. package/dist/index.js +37 -0
  126. package/dist/shared.d.ts +28 -0
  127. package/dist/shared.js +80 -0
  128. package/dist/shared.js.map +1 -0
  129. package/dist/spring.d.ts +14 -0
  130. package/dist/spring.js +50 -0
  131. package/dist/spring.js.map +1 -0
  132. package/dist/surface.d.ts +88 -0
  133. package/dist/surface.js +240 -0
  134. package/dist/surface.js.map +1 -0
  135. package/package.json +140 -4
package/dist/clay.css ADDED
@@ -0,0 +1,1648 @@
1
+ @layer ui-sdk;
2
+
3
+ :root {
4
+ --clay-surface: #dde5ed;
5
+ --clay-knob: #f6f9fb;
6
+ --clay-popup: #eef3f7;
7
+ --clay-neutral: #e1e8ef;
8
+ --clay-teal: #4e9fa3;
9
+ --clay-lilac: #9a98d6;
10
+ --clay-sky: #7fb2e3;
11
+ --clay-peach: #f4ad8d;
12
+ --clay-mint: #8fd3b5;
13
+ --clay-butter: #f3d27c;
14
+ --clay-rose: #ec9cab;
15
+ --clay-slate: #51647f;
16
+ --clay-ink: #2c3648;
17
+ --clay-success: #74cca3;
18
+ --clay-danger: #ee8e8e;
19
+ --clay-text: #1d2a3a;
20
+ --clay-text-soft: #475769;
21
+ --clay-ring: #2a6f78;
22
+ --clay-shade: #0c1626;
23
+ --clay-on-knob: #1d2a3a;
24
+ --clay-danger-text: #a4282c;
25
+ --clay-spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
26
+ }
27
+
28
+ :root[data-theme="dark"] {
29
+ --clay-surface: #3a4659;
30
+ --clay-knob: #dfe6ee;
31
+ --clay-popup: #455268;
32
+ --clay-neutral: #4b586d;
33
+ --clay-text: #eef2f6;
34
+ --clay-text-soft: #cbd4de;
35
+ --clay-ring: #8fd3d6;
36
+ --clay-shade: #02050a;
37
+ --clay-danger-text: #ffb3b3;
38
+ }
39
+
40
+ @media (prefers-color-scheme: dark) {
41
+ :root:not([data-theme="light"]) {
42
+ --clay-surface: #3a4659;
43
+ --clay-knob: #dfe6ee;
44
+ --clay-popup: #455268;
45
+ --clay-neutral: #4b586d;
46
+ --clay-text: #eef2f6;
47
+ --clay-text-soft: #cbd4de;
48
+ --clay-ring: #8fd3d6;
49
+ --clay-shade: #02050a;
50
+ --clay-danger-text: #ffb3b3;
51
+ }
52
+ }
53
+
54
+ [data-clay-host] {
55
+ isolation: isolate;
56
+ scale: var(--clay-sx, 1) var(--clay-sy, 1);
57
+ }
58
+
59
+ .clay-canvas {
60
+ position: absolute;
61
+ z-index: -1;
62
+ pointer-events: none;
63
+ }
64
+
65
+ .clay-sr {
66
+ position: absolute;
67
+ width: 1px;
68
+ height: 1px;
69
+ overflow: hidden;
70
+ clip-path: inset(50%);
71
+ white-space: nowrap;
72
+ }
73
+
74
+ :is(clay-button, clay-action-button, clay-button-group, clay-badge, clay-card, clay-tooltip, clay-menu, clay-popover, clay-dialog) {
75
+ color: var(--clay-text);
76
+
77
+ &[data-tone="light"] {
78
+ color: var(--clay-on-knob);
79
+ }
80
+
81
+ &[data-tone="dark"] {
82
+ color: #fff;
83
+ }
84
+ }
85
+
86
+ :where(clay-button, clay-action-button, clay-button-group, clay-badge, clay-card, clay-select, clay-tooltip, clay-menu, clay-popover, clay-dialog, clay-avatar) {
87
+ --clay-color: var(--clay-neutral);
88
+ }
89
+
90
+ :where(clay-switch, clay-checkbox, clay-slider, clay-toggle, clay-input, clay-radio, clay-progress, clay-meter, clay-slide-confirm) {
91
+ --clay-color: var(--clay-teal);
92
+ }
93
+
94
+ :where(clay-segmented, clay-tabs) {
95
+ --clay-color: var(--clay-knob);
96
+ }
97
+
98
+ :where(clay-tooltip) {
99
+ --clay-color: var(--clay-ink);
100
+ }
101
+
102
+ /* Without WebGL2, or before the first frame, the same clay is drawn with layered shadows. */
103
+ :is(
104
+ clay-button,
105
+ clay-action-button,
106
+ clay-badge,
107
+ clay-card,
108
+ clay-button-group,
109
+ clay-avatar,
110
+ clay-select [data-slot="select-trigger"],
111
+ clay-select [data-slot="select-content"],
112
+ clay-tooltip [data-slot="tooltip-content"],
113
+ :is(clay-menu, clay-popover, clay-dialog) :is([data-slot="menu-trigger"], [data-slot="popover-trigger"], [data-slot="dialog-trigger"]),
114
+ clay-menu [data-slot="menu-content"],
115
+ clay-popover [data-slot="popover-content"],
116
+ clay-dialog [data-slot="dialog-content"],
117
+ clay-toast-region [data-slot="toast"]
118
+ ):not([data-clay-ready]) {
119
+ background: var(--clay-color);
120
+ box-shadow:
121
+ 0 12px 22px -10px color-mix(in oklab, var(--clay-color), var(--clay-shade) 60%),
122
+ inset 4px 4px 9px color-mix(in oklab, var(--clay-color), white 50%),
123
+ inset -5px -6px 11px color-mix(in oklab, var(--clay-color), var(--clay-shade) 25%);
124
+ }
125
+
126
+ clay-select [data-slot="select-content"]:not([data-clay-ready]),
127
+ clay-menu [data-slot="menu-content"]:not([data-clay-ready]),
128
+ clay-popover [data-slot="popover-content"]:not([data-clay-ready]),
129
+ clay-dialog [data-slot="dialog-content"]:not([data-clay-ready]),
130
+ clay-toast-region [data-slot="toast"]:not([data-clay-ready], [data-type="success"], [data-type="error"], [data-type="warning"]) {
131
+ --clay-color: var(--clay-popup);
132
+ }
133
+
134
+ clay-toast-region [data-slot="toast"]:not([data-clay-ready]) {
135
+ &[data-type="success"] { --clay-color: var(--clay-success); }
136
+ &[data-type="error"] { --clay-color: var(--clay-danger); }
137
+ &[data-type="warning"] { --clay-color: var(--clay-butter); }
138
+ }
139
+
140
+ :is(clay-segmented, clay-switch, clay-checkbox, clay-toggle, clay-input, clay-slide-confirm, clay-tabs [data-slot="tabs-list"]):not([data-clay-ready]) {
141
+ border-radius: 999px;
142
+ background: var(--clay-surface);
143
+ box-shadow:
144
+ 0 8px 16px -8px color-mix(in oklab, var(--clay-surface), var(--clay-shade) 55%),
145
+ inset 2px 2px 5px color-mix(in oklab, var(--clay-surface), white 55%);
146
+ }
147
+
148
+ :is(clay-button, clay-toggle, clay-button-group, clay-menu, clay-popover, clay-dialog) {
149
+ --h: 44px;
150
+ display: inline-flex;
151
+ height: var(--h);
152
+ border-radius: 999px;
153
+ vertical-align: middle;
154
+
155
+ &[size="sm"] { --h: 36px; }
156
+ &[size="lg"] { --h: 52px; }
157
+ &[size="xl"] { --h: 64px; }
158
+
159
+ &[shape="rounded"] {
160
+ border-radius: min(calc(var(--h) * 0.34), 18px);
161
+ }
162
+ }
163
+
164
+ :is(clay-button, clay-toggle)[icon] {
165
+ width: var(--h);
166
+ }
167
+
168
+ :is(clay-button, clay-action-button, clay-toggle, clay-button-group) :is([data-slot="button"], [data-slot="toggle"], [data-slot="tooltip-trigger"], [data-slot="popover-trigger"], [data-slot="popover-close"], [data-slot="menu-trigger"], [data-slot="dialog-trigger"], [data-slot="dialog-close"]),
169
+ :is(clay-menu, clay-popover, clay-dialog) :is([data-slot="menu-trigger"], [data-slot="popover-trigger"], [data-slot="dialog-trigger"]):not(:is([data-slot="menu-content"], [data-slot="popover-content"], [data-slot="dialog-content"]) *) {
170
+ display: inline-flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ gap: 8px;
174
+ height: 100%;
175
+ padding: 0 calc(var(--h) * 0.48);
176
+ border: 0;
177
+ border-radius: inherit;
178
+ background: transparent;
179
+ color: inherit;
180
+ font: inherit;
181
+ font-size: max(0.82rem, calc(var(--h) * 0.32));
182
+ font-weight: 800;
183
+ letter-spacing: 0.01em;
184
+ cursor: pointer;
185
+
186
+ &:hover:not([data-disabled]) {
187
+ background: transparent;
188
+ }
189
+
190
+ &:focus-visible {
191
+ outline: 3px solid var(--clay-ring);
192
+ outline-offset: 4px;
193
+ }
194
+
195
+ &:is(:disabled, [data-disabled]) {
196
+ cursor: not-allowed;
197
+ opacity: 0.55;
198
+ }
199
+
200
+ & svg {
201
+ width: 1.1em;
202
+ height: 1.1em;
203
+ }
204
+ }
205
+
206
+ clay-action-button {
207
+ --h: 48px;
208
+ --gap: 6px;
209
+ display: inline-flex;
210
+ height: var(--h);
211
+ border-radius: 999px;
212
+ vertical-align: middle;
213
+
214
+ &[size="sm"] { --h: 40px; }
215
+ &[size="lg"] { --h: 56px; }
216
+
217
+ & [data-slot="button"] {
218
+ position: relative;
219
+ justify-content: flex-start;
220
+ padding: 0 calc(var(--h) + var(--gap) + 16px) 0 calc(var(--h) * 0.5);
221
+ }
222
+ }
223
+
224
+ .clay-action-label {
225
+ display: grid;
226
+
227
+ & > span {
228
+ grid-area: 1 / 1;
229
+ opacity: 0;
230
+ translate: 0 0.6em;
231
+ filter: blur(3px);
232
+ transition:
233
+ opacity 0.25s,
234
+ translate 0.45s var(--clay-spring),
235
+ filter 0.3s;
236
+ }
237
+ }
238
+
239
+ clay-action-button:is(:not([data-state]), [data-state="idle"]) [data-label="idle"],
240
+ clay-action-button[data-state="pending"] [data-label="pending"],
241
+ clay-action-button[data-state="success"] [data-label="success"],
242
+ clay-action-button[data-state="error"] [data-label="error"] {
243
+ opacity: 1;
244
+ translate: 0 0;
245
+ filter: none;
246
+ }
247
+
248
+ .clay-bead {
249
+ position: absolute;
250
+ top: 0;
251
+ right: 0;
252
+ display: grid;
253
+ place-items: center;
254
+ width: var(--h);
255
+ height: var(--h);
256
+ border-radius: 50%;
257
+ color: inherit;
258
+
259
+ & svg {
260
+ grid-area: 1 / 1;
261
+ width: 42%;
262
+ height: 42%;
263
+ fill: none;
264
+ stroke: currentColor;
265
+ stroke-linecap: round;
266
+ stroke-linejoin: round;
267
+ stroke-width: 2.6;
268
+ opacity: 0;
269
+ scale: 0.4;
270
+ rotate: -40deg;
271
+ transition:
272
+ opacity 0.2s,
273
+ scale 0.45s var(--clay-spring),
274
+ rotate 0.45s var(--clay-spring);
275
+ }
276
+ }
277
+
278
+ clay-action-button:not([data-clay-ready]) .clay-bead {
279
+ background: color-mix(in oklab, var(--clay-color), var(--clay-shade) 16%);
280
+ box-shadow:
281
+ inset 3px 3px 6px color-mix(in oklab, var(--clay-color), white 40%),
282
+ inset -3px -4px 7px color-mix(in oklab, var(--clay-color), var(--clay-shade) 30%);
283
+ }
284
+
285
+ clay-action-button:is([data-state="success"], [data-state="error"]) .clay-bead {
286
+ color: var(--clay-on-knob);
287
+ }
288
+
289
+ clay-action-button:is(:not([data-state]), [data-state="idle"]) [data-icon="idle"],
290
+ clay-action-button[data-state="pending"] [data-icon="pending"],
291
+ clay-action-button[data-state="success"] [data-icon="success"],
292
+ clay-action-button[data-state="error"] [data-icon="error"] {
293
+ opacity: 1;
294
+ scale: 1;
295
+ rotate: 0deg;
296
+ }
297
+
298
+ clay-action-button[data-state="pending"] [data-icon="pending"] {
299
+ animation: clay-spin 0.8s linear infinite;
300
+ }
301
+
302
+ clay-action-button:is(:not([data-state]), [data-state="idle"]) [data-slot="button"]:hover [data-icon="idle"] {
303
+ translate: 2px 0;
304
+ }
305
+
306
+ clay-card {
307
+ display: block;
308
+ padding: 24px;
309
+ border-radius: var(--clay-radius, 28px);
310
+ }
311
+
312
+ clay-badge {
313
+ display: inline-flex;
314
+ align-items: center;
315
+ gap: 6px;
316
+ height: 26px;
317
+ padding: 0 12px;
318
+ border-radius: 999px;
319
+ font-size: 0.76rem;
320
+ font-weight: 800;
321
+ letter-spacing: 0.02em;
322
+ vertical-align: middle;
323
+ animation: clay-stamp 0.55s var(--clay-spring) backwards;
324
+ }
325
+
326
+ clay-segmented {
327
+ display: inline-flex;
328
+ border-radius: 999px;
329
+ vertical-align: middle;
330
+
331
+ & [data-slot="segmented-control"] {
332
+ gap: 2px;
333
+ padding: 9px;
334
+ border: 0;
335
+ border-radius: inherit;
336
+ background: transparent;
337
+ }
338
+
339
+ & [data-slot="segmented-control-item"] {
340
+ height: 34px;
341
+ padding-inline: 18px;
342
+ border-radius: 999px;
343
+ color: var(--clay-text-soft);
344
+ font-weight: 700;
345
+ transition: color 0.2s;
346
+
347
+ &[data-checked] {
348
+ color: var(--clay-on-knob);
349
+ }
350
+
351
+ &:focus-visible {
352
+ outline: 3px solid var(--clay-ring);
353
+ outline-offset: 2px;
354
+ }
355
+ }
356
+
357
+ & [data-slot="segmented-control-indicator"] {
358
+ border: 0;
359
+ border-radius: 999px;
360
+ background: var(--clay-color);
361
+ box-shadow:
362
+ 0 6px 10px -6px color-mix(in oklab, var(--clay-color), var(--clay-shade) 60%),
363
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-color), white 50%);
364
+ }
365
+
366
+ &[data-clay-ready] [data-slot="segmented-control-indicator"] {
367
+ opacity: 0;
368
+ }
369
+ }
370
+
371
+ clay-switch {
372
+ --w: 56px;
373
+ --h: 32px;
374
+ display: inline-flex;
375
+ border-radius: 999px;
376
+ vertical-align: middle;
377
+
378
+ &[size="sm"] { --w: 46px; --h: 26px; }
379
+ &[size="lg"] { --w: 68px; --h: 38px; }
380
+
381
+ & [data-slot="switch"] {
382
+ width: var(--w);
383
+ height: var(--h);
384
+ padding: 5px;
385
+ border: 0;
386
+ border-radius: 999px;
387
+ background: transparent;
388
+
389
+ &[data-checked] {
390
+ background: transparent;
391
+ }
392
+
393
+ &:focus-visible {
394
+ outline: 3px solid var(--clay-ring);
395
+ outline-offset: 3px;
396
+ }
397
+ }
398
+
399
+ & [data-slot="switch-thumb"] {
400
+ width: calc(var(--h) - 10px);
401
+ height: calc(var(--h) - 10px);
402
+ background: var(--clay-knob);
403
+ box-shadow: 0 3px 6px -2px rgb(12 22 38 / 0.45);
404
+ transition: margin 0.3s var(--clay-spring);
405
+ }
406
+
407
+ &:not([data-clay-ready]) [data-slot="switch"][data-checked] {
408
+ background: var(--clay-color);
409
+ }
410
+
411
+ &[data-clay-ready] [data-slot="switch-thumb"] {
412
+ opacity: 0;
413
+ }
414
+ }
415
+
416
+ clay-checkbox {
417
+ display: inline-flex;
418
+ border-radius: 9px;
419
+ vertical-align: middle;
420
+
421
+ & [data-slot="checkbox"] {
422
+ width: 28px;
423
+ height: 28px;
424
+ border: 0;
425
+ border-radius: 9px;
426
+ background: transparent;
427
+ color: #fff;
428
+
429
+ &[data-checked] {
430
+ background: transparent;
431
+ }
432
+
433
+ &:focus-visible {
434
+ outline: 3px solid var(--clay-ring);
435
+ outline-offset: 3px;
436
+ }
437
+ }
438
+
439
+ &:not([data-clay-ready]) [data-slot="checkbox"][data-checked] {
440
+ background: var(--clay-color);
441
+ }
442
+
443
+ & [data-slot="checkbox-indicator"] svg {
444
+ width: 16px;
445
+ height: 16px;
446
+ fill: none;
447
+ stroke: currentColor;
448
+ stroke-width: 3;
449
+ stroke-linecap: round;
450
+ stroke-linejoin: round;
451
+ stroke-dasharray: 24;
452
+ stroke-dashoffset: 24;
453
+ filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.25));
454
+ transition: stroke-dashoffset 0.35s 0.08s ease-out;
455
+ }
456
+
457
+ & [data-checked] [data-slot="checkbox-indicator"] svg {
458
+ stroke-dashoffset: 0;
459
+ }
460
+ }
461
+
462
+ clay-slider {
463
+ display: block;
464
+ width: 100%;
465
+ max-width: 22rem;
466
+
467
+ & [data-slot="slider"] {
468
+ min-width: 0;
469
+ }
470
+
471
+ & [data-slot="slider-control"] {
472
+ height: 44px;
473
+ padding-inline: 16px;
474
+ }
475
+
476
+ & [data-slot="slider-track"] {
477
+ position: relative;
478
+ height: 12px;
479
+ border-radius: 999px;
480
+ background: color-mix(in oklab, var(--clay-surface), var(--clay-shade) 12%);
481
+ box-shadow: inset 2px 2px 4px rgb(12 22 38 / 0.25);
482
+ }
483
+
484
+ & [data-slot="slider-indicator"] {
485
+ background: var(--clay-color);
486
+ }
487
+
488
+ & [data-slot="slider-thumb"] {
489
+ width: 26px;
490
+ height: 26px;
491
+ border: 0;
492
+ background: var(--clay-knob);
493
+ box-shadow: 0 5px 10px -4px rgb(12 22 38 / 0.5);
494
+
495
+ &:has(:focus-visible) {
496
+ outline: 3px solid var(--clay-ring);
497
+ outline-offset: 3px;
498
+ }
499
+ }
500
+
501
+ & [data-slot="slider-value"] {
502
+ color: var(--clay-text-soft);
503
+ font-family: var(--ui-font-mono, ui-monospace, monospace);
504
+ font-size: 0.82rem;
505
+ font-weight: 700;
506
+ }
507
+
508
+ & .clay-slider-head {
509
+ display: flex;
510
+ align-items: baseline;
511
+ justify-content: space-between;
512
+ padding-inline: 4px;
513
+ }
514
+
515
+ & [data-slot="field-label"] {
516
+ color: var(--clay-text);
517
+ font-weight: 800;
518
+ }
519
+
520
+ &[data-clay-ready] {
521
+ & [data-slot="slider-track"],
522
+ & [data-slot="slider-indicator"],
523
+ & [data-slot="slider-thumb"] {
524
+ background: transparent;
525
+ box-shadow: none;
526
+ }
527
+ }
528
+ }
529
+
530
+ clay-select {
531
+ display: inline-grid;
532
+ gap: 8px;
533
+
534
+ & [data-slot="select-label"] {
535
+ color: var(--clay-text-soft);
536
+ font-size: 0.85rem;
537
+ font-weight: 800;
538
+ }
539
+
540
+ & [data-slot="select-value"] {
541
+ display: inline-block;
542
+ }
543
+
544
+ & .clay-select-ghost {
545
+ position: absolute;
546
+ pointer-events: none;
547
+ white-space: nowrap;
548
+ }
549
+
550
+ & [data-slot="select-trigger"] {
551
+ position: relative;
552
+ height: 46px;
553
+ min-width: 12rem;
554
+ padding-inline: 18px 14px;
555
+ border: 0;
556
+ border-radius: 18px;
557
+ color: var(--clay-text);
558
+ font-weight: 800;
559
+
560
+ &[data-clay-ready] {
561
+ background: transparent;
562
+ }
563
+
564
+ &:focus-visible {
565
+ outline: 3px solid var(--clay-ring);
566
+ outline-offset: 4px;
567
+ }
568
+ }
569
+
570
+ & [data-slot="select-content"] {
571
+ max-height: none;
572
+ padding: 8px;
573
+ overflow: visible;
574
+ border: 0;
575
+ border-radius: 22px;
576
+ color: var(--clay-text);
577
+ transform-origin: var(--transform-origin);
578
+ transition:
579
+ scale 0.5s var(--clay-spring),
580
+ opacity 0.18s;
581
+
582
+ &[data-clay-ready] {
583
+ background: transparent;
584
+ box-shadow: none;
585
+ }
586
+
587
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
588
+ scale: 0.82 0.5;
589
+ opacity: 0;
590
+ }
591
+
592
+ & [data-slot="select-item"] {
593
+ min-height: 38px;
594
+ padding-inline: 12px;
595
+ border-radius: 14px;
596
+ font-weight: 700;
597
+ transition:
598
+ translate 0.4s var(--clay-spring),
599
+ opacity 0.3s,
600
+ background 0.15s;
601
+ transition-delay: calc(var(--clay-i, 0) * 28ms), calc(var(--clay-i, 0) * 28ms), 0s;
602
+
603
+ &[data-highlighted] {
604
+ background: color-mix(in oklab, var(--clay-popup), var(--clay-shade) 8%);
605
+ box-shadow:
606
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-popup), var(--clay-shade) 18%),
607
+ inset -2px -2px 4px color-mix(in oklab, var(--clay-popup), white 60%);
608
+ }
609
+
610
+ &[data-selected] {
611
+ color: var(--clay-ring);
612
+ font-weight: 800;
613
+ }
614
+ }
615
+
616
+ &[data-starting-style] [data-slot="select-item"] {
617
+ translate: 0 -10px;
618
+ opacity: 0;
619
+ }
620
+ }
621
+ }
622
+
623
+ clay-tooltip [data-slot="tooltip-content"] {
624
+ padding: 7px 12px;
625
+ border-radius: 12px;
626
+ color: inherit;
627
+ font-weight: 700;
628
+ transform-origin: var(--transform-origin);
629
+ transition:
630
+ scale 0.4s var(--clay-spring),
631
+ opacity 0.15s;
632
+
633
+ &[data-clay-ready] {
634
+ background: transparent;
635
+ box-shadow: none;
636
+ }
637
+
638
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
639
+ scale: 0.6;
640
+ opacity: 0;
641
+ }
642
+ }
643
+
644
+ /* Icon-only buttons and triggers: square, no padding. */
645
+ :is(clay-button, clay-toggle, clay-menu, clay-popover, clay-dialog)[icon] :is([data-slot="button"], [data-slot="toggle"], [data-slot="tooltip-trigger"], [data-slot="popover-trigger"], [data-slot="menu-trigger"], [data-slot="dialog-trigger"]) {
646
+ width: var(--h);
647
+ padding: 0;
648
+ }
649
+
650
+ :is(clay-menu, clay-popover, clay-dialog) :is([data-slot="menu-trigger"], [data-slot="popover-trigger"], [data-slot="dialog-trigger"]):not(:is([data-slot="menu-content"], [data-slot="popover-content"], [data-slot="dialog-content"]) *) {
651
+ border-radius: 999px;
652
+ }
653
+
654
+ /* Latch */
655
+ clay-toggle {
656
+ color: var(--clay-text);
657
+
658
+ & [data-slot="toggle"] {
659
+ transition: color 0.2s;
660
+
661
+ &[data-pressed] {
662
+ background: transparent;
663
+ }
664
+ }
665
+
666
+ &[data-pressed="true"] {
667
+ &[data-tone="dark"] { color: #fff; }
668
+ &[data-tone="light"] { color: var(--clay-on-knob); }
669
+ }
670
+
671
+ &:not([data-clay-ready]):has([aria-pressed="true"]) {
672
+ background: var(--clay-color);
673
+ box-shadow:
674
+ inset 3px 4px 8px color-mix(in oklab, var(--clay-color), var(--clay-shade) 40%),
675
+ inset -2px -2px 5px color-mix(in oklab, var(--clay-color), white 35%);
676
+ }
677
+ }
678
+
679
+ /* Fuse */
680
+ clay-button-group {
681
+ & :is([data-slot="button"], [data-slot="toggle"]) {
682
+ min-width: var(--h);
683
+ padding: 0 calc(var(--h) * 0.4);
684
+ border-radius: 999px;
685
+
686
+ &[aria-pressed="true"] {
687
+ background: transparent;
688
+ }
689
+ }
690
+
691
+ &:not([data-clay-ready]) :is([data-slot="button"], [data-slot="toggle"]) + :is([data-slot="button"], [data-slot="toggle"]),
692
+ &:not([data-clay-ready]) > * + * {
693
+ box-shadow: inset 1px 0 0 color-mix(in oklab, var(--clay-color), var(--clay-shade) 22%);
694
+ }
695
+ }
696
+
697
+ /* Shift */
698
+ clay-tabs {
699
+ display: block;
700
+
701
+ & [data-slot="tabs"][data-orientation="vertical"] {
702
+ gap: 20px;
703
+ }
704
+
705
+ & [data-slot="tabs-list"] {
706
+ display: inline-flex;
707
+ align-self: flex-start;
708
+ gap: 2px;
709
+ padding: 9px;
710
+ border: 0;
711
+ border-radius: 999px;
712
+
713
+ &[data-orientation="vertical"] {
714
+ flex-direction: column;
715
+ align-items: stretch;
716
+ border: 0;
717
+ border-radius: 24px;
718
+ }
719
+ }
720
+
721
+ & [data-slot="tabs-tab"] {
722
+ justify-content: flex-start;
723
+ height: 38px;
724
+ margin: 0;
725
+ padding-inline: 18px;
726
+ border: 0;
727
+ border-radius: 999px;
728
+ color: var(--clay-text-soft);
729
+ font-weight: 750;
730
+ transition: color 0.2s;
731
+
732
+ &[data-orientation="vertical"] {
733
+ margin: 0;
734
+ border: 0;
735
+ }
736
+
737
+ &:hover:not([data-disabled], [data-selected]) {
738
+ color: var(--clay-text);
739
+ }
740
+
741
+ &[data-selected] {
742
+ color: var(--clay-on-knob);
743
+ }
744
+
745
+ &:focus-visible {
746
+ outline: 3px solid var(--clay-ring);
747
+ outline-offset: 2px;
748
+ }
749
+
750
+ & svg {
751
+ width: 1.15em;
752
+ height: 1.15em;
753
+ }
754
+ }
755
+
756
+ &[data-tone="dark"] [data-slot="tabs-tab"][data-selected] {
757
+ color: #fff;
758
+ }
759
+
760
+ &:not(:has([data-slot="tabs-list"][data-clay-ready])) [data-slot="tabs-tab"][data-selected] {
761
+ background: var(--clay-color);
762
+ box-shadow:
763
+ 0 6px 10px -6px color-mix(in oklab, var(--clay-color), var(--clay-shade) 60%),
764
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-color), white 50%);
765
+ }
766
+
767
+ & [data-slot="tabs-panel"] {
768
+ padding-top: 18px;
769
+ outline: none;
770
+ transition:
771
+ opacity 0.3s,
772
+ translate 0.5s var(--clay-spring);
773
+
774
+ &[data-orientation="vertical"] {
775
+ padding: 0;
776
+ }
777
+
778
+ &[data-starting-style] {
779
+ opacity: 0;
780
+
781
+ &[data-activation-direction="right"] { translate: 24px 0; }
782
+ &[data-activation-direction="left"] { translate: -24px 0; }
783
+ &[data-activation-direction="down"] { translate: 0 20px; }
784
+ &[data-activation-direction="up"] { translate: 0 -20px; }
785
+ }
786
+
787
+ &:focus-visible {
788
+ outline: 3px solid var(--clay-ring);
789
+ outline-offset: 4px;
790
+ border-radius: 12px;
791
+ }
792
+ }
793
+ }
794
+
795
+ /* Spill, Unfold and Lift: popups */
796
+ :is(clay-menu [data-slot="menu-content"], clay-popover [data-slot="popover-content"], clay-dialog [data-slot="dialog-content"]) {
797
+ overflow: visible;
798
+ border: 0;
799
+ color: var(--clay-text);
800
+
801
+ &[data-clay-ready] {
802
+ background: transparent;
803
+ box-shadow: none;
804
+ }
805
+ }
806
+
807
+ clay-menu [data-slot="menu-content"] {
808
+ min-width: 12rem;
809
+ max-height: none;
810
+ padding: 8px;
811
+ border-radius: 20px;
812
+ transform-origin: var(--transform-origin);
813
+ transition:
814
+ scale 0.5s var(--clay-spring),
815
+ opacity 0.18s;
816
+
817
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
818
+ scale: 0.7 0.4;
819
+ opacity: 0;
820
+ }
821
+
822
+ & :is([data-slot="menu-item"], [data-slot="menu-checkbox-item"], [data-slot="menu-radio-item"]) {
823
+ gap: 10px;
824
+ min-height: 38px;
825
+ padding-inline: 12px;
826
+ border-radius: 13px;
827
+ font-weight: 700;
828
+ transition:
829
+ translate 0.4s var(--clay-spring),
830
+ opacity 0.3s,
831
+ background 0.15s;
832
+ transition-delay: calc(var(--clay-i, 0) * 26ms), calc(var(--clay-i, 0) * 26ms), 0s;
833
+
834
+ &[data-highlighted] {
835
+ background: color-mix(in oklab, var(--clay-popup), var(--clay-shade) 8%);
836
+ box-shadow:
837
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-popup), var(--clay-shade) 18%),
838
+ inset -2px -2px 4px color-mix(in oklab, var(--clay-popup), white 60%);
839
+ }
840
+
841
+ &[variant="danger"] {
842
+ color: var(--clay-danger-text);
843
+ }
844
+
845
+ & svg {
846
+ width: 1.05em;
847
+ height: 1.05em;
848
+ }
849
+ }
850
+
851
+ &[data-starting-style] :is([data-slot="menu-item"], [data-slot="menu-checkbox-item"], [data-slot="menu-radio-item"]) {
852
+ translate: 0 -8px;
853
+ opacity: 0;
854
+ }
855
+
856
+ & [data-slot="menu-separator"] {
857
+ height: 3px;
858
+ margin: 6px 10px;
859
+ border: 0;
860
+ border-radius: 3px;
861
+ background: color-mix(in oklab, var(--clay-popup), var(--clay-shade) 10%);
862
+ box-shadow: 0 1px 0 color-mix(in oklab, var(--clay-popup), white 60%);
863
+ }
864
+
865
+ & [data-slot="menu-group-label"] {
866
+ padding: 6px 12px 2px;
867
+ color: var(--clay-text-soft);
868
+ font-size: 0.75rem;
869
+ font-weight: 800;
870
+ letter-spacing: 0.06em;
871
+ text-transform: uppercase;
872
+ }
873
+
874
+ & [data-slot="menu-shortcut"] {
875
+ margin-inline-start: auto;
876
+ color: var(--clay-text-soft);
877
+ font-size: 0.8rem;
878
+ }
879
+ }
880
+
881
+ clay-popover [data-slot="popover-content"] {
882
+ gap: 10px;
883
+ max-width: 21rem;
884
+ padding: 22px;
885
+ border-radius: 26px;
886
+ transform-origin: var(--transform-origin);
887
+ transition:
888
+ scale 0.55s var(--clay-spring),
889
+ opacity 0.2s;
890
+
891
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
892
+ scale: 0.5 0.25;
893
+ opacity: 0;
894
+ }
895
+
896
+ & > :not(.clay-canvas) {
897
+ transition:
898
+ opacity 0.3s 0.08s,
899
+ translate 0.45s 0.06s var(--clay-spring);
900
+ }
901
+
902
+ &[data-starting-style] > :not(.clay-canvas) {
903
+ translate: 0 8px;
904
+ opacity: 0;
905
+ }
906
+ }
907
+
908
+ :is(clay-popover [data-slot="popover-title"], clay-dialog [data-slot="dialog-title"]) {
909
+ margin: 0;
910
+ color: var(--clay-text);
911
+ font-size: 1.08rem;
912
+ font-weight: 850;
913
+ }
914
+
915
+ clay-dialog [data-slot="dialog-title"] {
916
+ font-size: 1.35rem;
917
+ }
918
+
919
+ :is(clay-popover [data-slot="popover-description"], clay-dialog [data-slot="dialog-description"]) {
920
+ margin: 0;
921
+ color: var(--clay-text-soft);
922
+ font-weight: 600;
923
+ }
924
+
925
+ clay-dialog [data-slot="dialog-backdrop"] {
926
+ background: color-mix(in oklab, var(--clay-shade) 30%, transparent);
927
+ backdrop-filter: blur(6px) saturate(1.2);
928
+ transition: opacity 0.3s;
929
+
930
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
931
+ opacity: 0;
932
+ }
933
+ }
934
+
935
+ clay-dialog [data-slot="dialog-content"] {
936
+ gap: 14px;
937
+ padding: 30px;
938
+ border-radius: 32px;
939
+ transition:
940
+ translate 0.6s var(--clay-spring),
941
+ scale 0.6s var(--clay-spring),
942
+ opacity 0.2s;
943
+
944
+ &[data-starting-style] {
945
+ translate: 0 -48px;
946
+ scale: 1.04 0.86;
947
+ opacity: 0;
948
+ }
949
+
950
+ /* data-closed stays on after the ending style comes off, a frame before ui-sdk hides it. */
951
+ &:is([data-ending-style], [data-closed]) {
952
+ translate: 0 24px;
953
+ scale: 0.94;
954
+ opacity: 0;
955
+ }
956
+ }
957
+
958
+ .clay-actions {
959
+ display: flex;
960
+ flex-wrap: wrap;
961
+ justify-content: flex-end;
962
+ gap: 12px;
963
+ margin-top: 8px;
964
+ }
965
+
966
+ /* Drop */
967
+ clay-toast-region {
968
+ display: contents;
969
+
970
+ & [data-slot="toast-region"] {
971
+ width: 22rem;
972
+ }
973
+
974
+ & [data-slot="toast-list"] {
975
+ gap: 14px;
976
+ }
977
+
978
+ & [data-slot="toast"] {
979
+ padding: 16px 18px;
980
+ border: 0;
981
+ border-radius: 22px;
982
+ color: var(--clay-text);
983
+ transition:
984
+ translate 0.55s var(--clay-spring),
985
+ opacity 0.25s,
986
+ scale 0.4s;
987
+
988
+ &[data-clay-ready] {
989
+ background: transparent;
990
+ box-shadow: none;
991
+ }
992
+
993
+ &:is([data-type="success"], [data-type="error"], [data-type="warning"]) {
994
+ color: var(--clay-on-knob);
995
+ }
996
+
997
+ /* Leaving runs the way in backwards: back toward the edge it dropped from. */
998
+ &:is([data-starting-style], [data-ending-style]) {
999
+ translate: 0 40px;
1000
+ opacity: 0;
1001
+ }
1002
+
1003
+ &[data-ending-style] {
1004
+ transition:
1005
+ translate 0.42s cubic-bezier(0.5, -0.4, 0.8, 0.6),
1006
+ opacity 0.3s 0.1s;
1007
+ }
1008
+ }
1009
+
1010
+ & [data-slot="toast-region"][data-side="top"] [data-slot="toast"]:is([data-starting-style], [data-ending-style]) {
1011
+ translate: 0 -40px;
1012
+ }
1013
+
1014
+ &[attached] {
1015
+ & [data-slot="toast-list"] {
1016
+ gap: 6px;
1017
+ }
1018
+
1019
+ & [data-slot="toast"] {
1020
+ transition:
1021
+ opacity 0.22s 0.16s,
1022
+ translate 0.55s var(--clay-spring);
1023
+
1024
+ &[data-starting-style] {
1025
+ translate: 0 var(--clay-from, 28px);
1026
+ opacity: 0;
1027
+ }
1028
+
1029
+ &[data-ending-style] {
1030
+ translate: 0 var(--clay-to, 28px);
1031
+ opacity: 0;
1032
+ transition:
1033
+ opacity 0.2s,
1034
+ translate 0.45s cubic-bezier(0.5, -0.3, 0.7, 0.9);
1035
+ }
1036
+ }
1037
+
1038
+ & [data-slot="toast-region"][data-clay-ready] [data-slot="toast"] {
1039
+ background: transparent;
1040
+ box-shadow: none;
1041
+ }
1042
+ }
1043
+
1044
+ & [data-slot="toast-title"] {
1045
+ font-weight: 850;
1046
+ }
1047
+
1048
+ & [data-slot="toast-description"] {
1049
+ color: inherit;
1050
+ font-weight: 600;
1051
+ opacity: 0.85;
1052
+ }
1053
+
1054
+ & :is([data-slot="toast-action"], [data-slot="toast-close"]) {
1055
+ height: 32px;
1056
+ padding-inline: 14px;
1057
+ border: 0;
1058
+ border-radius: 999px;
1059
+ background: color-mix(in oklab, currentColor 8%, transparent);
1060
+ box-shadow:
1061
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-shade) 16%, transparent),
1062
+ inset -2px -2px 4px rgb(255 255 255 / 0.35);
1063
+ color: inherit;
1064
+ font: inherit;
1065
+ font-weight: 800;
1066
+ cursor: pointer;
1067
+
1068
+ &:focus-visible {
1069
+ outline: 3px solid var(--clay-ring);
1070
+ outline-offset: 2px;
1071
+ }
1072
+ }
1073
+ }
1074
+
1075
+ /* Type */
1076
+ clay-input {
1077
+ --h: 48px;
1078
+ display: flex;
1079
+ min-width: min(100%, 16rem);
1080
+ align-items: center;
1081
+ gap: 10px;
1082
+ min-height: var(--h);
1083
+ padding: 0 18px;
1084
+ border-radius: 20px;
1085
+ color: var(--clay-text-soft);
1086
+
1087
+ &[size="sm"] { --h: 40px; }
1088
+ &[size="lg"] { --h: 56px; }
1089
+
1090
+ &:has(textarea) {
1091
+ align-items: stretch;
1092
+ padding-block: 14px;
1093
+ }
1094
+
1095
+ & > svg,
1096
+ & [data-slot="input-group"] > svg {
1097
+ flex-shrink: 0;
1098
+ width: 18px;
1099
+ height: 18px;
1100
+ }
1101
+
1102
+ & [data-slot="input-group"] {
1103
+ flex: 1;
1104
+ align-items: center;
1105
+ gap: 10px;
1106
+ min-width: 0;
1107
+ height: auto;
1108
+ padding: 0;
1109
+ border: 0;
1110
+ background: transparent;
1111
+ box-shadow: none;
1112
+ outline: none;
1113
+ }
1114
+
1115
+ & :is([data-slot="input"], textarea) {
1116
+ flex: 1;
1117
+ min-width: 0;
1118
+ height: calc(var(--h) - 4px);
1119
+ padding: 0;
1120
+ border: 0;
1121
+ background: transparent;
1122
+ box-shadow: none;
1123
+ color: var(--clay-text);
1124
+ font: inherit;
1125
+ font-weight: 650;
1126
+ outline: none;
1127
+
1128
+ &::placeholder {
1129
+ color: var(--clay-text-soft);
1130
+ opacity: 1;
1131
+ }
1132
+ }
1133
+
1134
+ & textarea {
1135
+ height: auto;
1136
+ min-height: 4.5rem;
1137
+ resize: vertical;
1138
+ }
1139
+
1140
+ & [data-slot="input-clear"] {
1141
+ flex-shrink: 0;
1142
+ width: 28px;
1143
+ height: 28px;
1144
+ border: 0;
1145
+ border-radius: 50%;
1146
+ background: color-mix(in oklab, var(--clay-surface), var(--clay-shade) 12%);
1147
+ color: var(--clay-text-soft);
1148
+ }
1149
+
1150
+ /* With WebGL2 the rim itself glows on focus; the outline is for the CSS clay. */
1151
+ &:not([data-clay-ready]):has(:focus-visible) {
1152
+ outline: 3px solid var(--clay-ring);
1153
+ outline-offset: 3px;
1154
+ }
1155
+
1156
+ &:not([data-clay-ready])[data-invalid] {
1157
+ outline-color: var(--clay-danger-text);
1158
+ }
1159
+
1160
+ &:not([data-clay-ready]) {
1161
+ background: color-mix(in oklab, var(--clay-surface), var(--clay-shade) 7%);
1162
+ box-shadow:
1163
+ inset 3px 3px 7px color-mix(in oklab, var(--clay-surface), var(--clay-shade) 25%),
1164
+ inset -3px -3px 6px color-mix(in oklab, var(--clay-surface), white 55%);
1165
+ }
1166
+
1167
+ &:has(:disabled) {
1168
+ opacity: 0.6;
1169
+ }
1170
+ }
1171
+
1172
+ clay-input[attached] {
1173
+ position: relative;
1174
+ margin-block: 24px 22px;
1175
+
1176
+ & > :is([data-slot="field-label"], [data-slot="field-description"]) {
1177
+ position: absolute;
1178
+ left: 16px;
1179
+ margin: 0;
1180
+ padding: 4px 12px;
1181
+ border-radius: 999px;
1182
+ font-size: 0.78rem;
1183
+ line-height: 1.25;
1184
+ white-space: nowrap;
1185
+ opacity: var(--clay-out, 1);
1186
+ }
1187
+
1188
+ & > [data-slot="field-label"] {
1189
+ bottom: calc(100% - 3px);
1190
+ color: var(--clay-text);
1191
+ font-weight: 800;
1192
+ translate: 0 calc((1 - var(--clay-out, 1)) * 18px - var(--clay-pull, 0) * 4px);
1193
+ }
1194
+
1195
+ & > [data-slot="field-description"] {
1196
+ top: calc(100% - 3px);
1197
+ color: var(--clay-text-soft);
1198
+ font-weight: 650;
1199
+ translate: 0 calc(var(--clay-pull, 0) * 4px - (1 - var(--clay-out, 1)) * 18px);
1200
+ }
1201
+
1202
+ &:not([data-clay-ready]) > :is([data-slot="field-label"], [data-slot="field-description"]) {
1203
+ background: var(--clay-surface);
1204
+ box-shadow:
1205
+ 0 4px 8px -4px color-mix(in oklab, var(--clay-surface), var(--clay-shade) 50%),
1206
+ inset 1px 1px 2px color-mix(in oklab, var(--clay-surface), white 55%);
1207
+ }
1208
+ }
1209
+
1210
+ /* Pick */
1211
+ clay-radio {
1212
+ display: block;
1213
+
1214
+ & [data-slot="radio-group"] {
1215
+ gap: 14px;
1216
+ }
1217
+
1218
+ &[orientation="horizontal"] [data-slot="radio-group"] {
1219
+ flex-direction: row;
1220
+ flex-wrap: wrap;
1221
+ gap: 14px 24px;
1222
+ }
1223
+
1224
+ & label {
1225
+ display: inline-flex;
1226
+ align-items: center;
1227
+ gap: 12px;
1228
+ color: var(--clay-text);
1229
+ font-weight: 700;
1230
+ cursor: pointer;
1231
+ }
1232
+
1233
+ & [data-slot="radio"] {
1234
+ width: 26px;
1235
+ height: 26px;
1236
+ border: 0;
1237
+ border-radius: 50%;
1238
+ background: transparent;
1239
+
1240
+ &:focus-visible {
1241
+ outline: 3px solid var(--clay-ring);
1242
+ outline-offset: 4px;
1243
+ }
1244
+ }
1245
+
1246
+ &[data-clay-ready] [data-slot="radio-indicator"] {
1247
+ opacity: 0;
1248
+ }
1249
+
1250
+ &:not([data-clay-ready]) {
1251
+ & [data-slot="radio"] {
1252
+ background: color-mix(in oklab, var(--clay-surface), var(--clay-shade) 8%);
1253
+ box-shadow:
1254
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-surface), var(--clay-shade) 30%),
1255
+ 0 0 0 3px var(--clay-surface);
1256
+ }
1257
+
1258
+ & [data-slot="radio-indicator"] {
1259
+ width: 14px;
1260
+ height: 14px;
1261
+ background: var(--clay-color);
1262
+ box-shadow: inset 1px 1px 2px rgb(255 255 255 / 0.5);
1263
+ }
1264
+ }
1265
+ }
1266
+
1267
+ /* A well slides between options in the clay; the items' own highlight steps aside for it. */
1268
+ :is(clay-select [data-slot="select-content"], clay-menu [data-slot="menu-content"])[data-clay-ready]
1269
+ :is([data-slot="select-item"], [data-slot="menu-item"], [data-slot="menu-checkbox-item"], [data-slot="menu-radio-item"])[data-highlighted] {
1270
+ background: transparent;
1271
+ box-shadow: none;
1272
+ }
1273
+
1274
+ /* Fill and Gauge */
1275
+ :is(clay-progress, clay-meter) {
1276
+ display: block;
1277
+ width: 100%;
1278
+ max-width: 24rem;
1279
+
1280
+ & :is([data-slot="progress"], [data-slot="meter"]) {
1281
+ gap: 12px 8px;
1282
+ min-width: 0;
1283
+ }
1284
+
1285
+ & :is([data-slot="progress-label"], [data-slot="meter-label"]) {
1286
+ color: var(--clay-text);
1287
+ font-weight: 800;
1288
+ }
1289
+
1290
+ & :is([data-slot="progress-value"], [data-slot="meter-value"]) {
1291
+ color: var(--clay-text-soft);
1292
+ font-weight: 700;
1293
+ }
1294
+
1295
+ & :is([data-slot="progress-track"], [data-slot="meter-track"]) {
1296
+ height: 14px;
1297
+ margin: 6px;
1298
+ overflow: visible;
1299
+ border-radius: 999px;
1300
+ }
1301
+
1302
+ & :is([data-slot="progress-indicator"], [data-slot="meter-indicator"]) {
1303
+ border-radius: 999px;
1304
+ background: var(--clay-color);
1305
+ }
1306
+
1307
+ &[data-clay-ready] {
1308
+ & :is([data-slot="progress-track"], [data-slot="meter-track"]) {
1309
+ background: transparent;
1310
+ }
1311
+
1312
+ & :is([data-slot="progress-indicator"], [data-slot="meter-indicator"]) {
1313
+ opacity: 0;
1314
+ }
1315
+ }
1316
+
1317
+ &:not([data-clay-ready]) :is([data-slot="progress-track"], [data-slot="meter-track"]) {
1318
+ background: color-mix(in oklab, var(--clay-surface), var(--clay-shade) 10%);
1319
+ box-shadow:
1320
+ inset 2px 2px 4px color-mix(in oklab, var(--clay-surface), var(--clay-shade) 30%),
1321
+ 0 0 0 6px var(--clay-surface);
1322
+ }
1323
+ }
1324
+
1325
+ clay-meter[orientation="vertical"] {
1326
+ display: inline-block;
1327
+ width: auto;
1328
+ height: 100%;
1329
+
1330
+ & [data-slot="meter"] {
1331
+ display: flex;
1332
+ flex-direction: column;
1333
+ align-items: center;
1334
+ gap: 8px;
1335
+ height: 100%;
1336
+ min-width: 0;
1337
+ }
1338
+
1339
+ & [data-slot="meter-value"] { order: 1; }
1340
+ & [data-slot="meter-track"] { order: 2; }
1341
+ & [data-slot="meter-label"] { order: 3; }
1342
+
1343
+ & [data-slot="meter-track"] {
1344
+ flex: 1;
1345
+ width: 14px;
1346
+ height: auto;
1347
+ min-height: 3rem;
1348
+ }
1349
+
1350
+ & [data-slot="meter-indicator"] {
1351
+ inset: auto 0 0 !important;
1352
+ width: 100% !important;
1353
+ height: var(--clay-fill);
1354
+ }
1355
+
1356
+ & [data-slot="meter-label"] {
1357
+ font-weight: 700;
1358
+ }
1359
+ }
1360
+
1361
+ /* Frame */
1362
+ clay-avatar {
1363
+ --size: 48px;
1364
+ position: relative;
1365
+ display: inline-grid;
1366
+ width: var(--size);
1367
+ height: var(--size);
1368
+ padding: max(3px, calc(var(--size) * 0.07));
1369
+ border-radius: 50%;
1370
+ vertical-align: middle;
1371
+
1372
+ &[size="sm"] { --size: 36px; }
1373
+ &[size="lg"] { --size: 64px; }
1374
+ &[size="xl"] { --size: 96px; }
1375
+
1376
+ & [data-slot="avatar"] {
1377
+ width: 100%;
1378
+ height: 100%;
1379
+ border-radius: 50%;
1380
+ background: color-mix(in oklab, var(--clay-color), var(--clay-shade) 10%);
1381
+ color: var(--clay-on-knob);
1382
+ font-weight: 800;
1383
+ font-size: calc(var(--size) * 0.34);
1384
+ }
1385
+
1386
+ & [data-slot="avatar-image"] {
1387
+ width: 100%;
1388
+ height: 100%;
1389
+ object-fit: cover;
1390
+ }
1391
+
1392
+ &[data-tone="dark"] [data-slot="avatar"] {
1393
+ color: #fff;
1394
+ }
1395
+
1396
+ &::after {
1397
+ content: "";
1398
+ position: absolute;
1399
+ inset: max(3px, calc(var(--size) * 0.07));
1400
+ border-radius: 50%;
1401
+ box-shadow:
1402
+ inset 2px 3px 6px rgb(8 14 24 / 0.35),
1403
+ inset -2px -2px 4px rgb(255 255 255 / 0.2);
1404
+ pointer-events: none;
1405
+ }
1406
+ }
1407
+
1408
+ /* Drag */
1409
+ clay-slide-confirm {
1410
+ --h: 58px;
1411
+ display: block;
1412
+ width: 100%;
1413
+ max-width: 24rem;
1414
+ border-radius: 999px;
1415
+ font-weight: 800;
1416
+
1417
+ & [data-slot="slider"] {
1418
+ min-width: 0;
1419
+ }
1420
+
1421
+ & [data-slot="slider-control"] {
1422
+ position: relative;
1423
+ height: var(--h);
1424
+ padding-inline: calc(var(--h) / 2);
1425
+ cursor: grab;
1426
+ }
1427
+
1428
+ & [data-slot="slider-track"] {
1429
+ height: 4px;
1430
+ background: transparent;
1431
+ }
1432
+
1433
+ & [data-slot="slider-indicator"] {
1434
+ background: transparent;
1435
+ }
1436
+
1437
+ & [data-slot="slider-thumb"] {
1438
+ z-index: 1;
1439
+ display: grid;
1440
+ place-items: center;
1441
+ width: calc(var(--h) - 12px);
1442
+ height: calc(var(--h) - 12px);
1443
+ border: 0;
1444
+ background: var(--clay-knob);
1445
+ box-shadow: 0 5px 12px -4px rgb(12 22 38 / 0.5);
1446
+ color: var(--clay-on-knob);
1447
+
1448
+ &:has(:focus-visible) {
1449
+ outline: 3px solid var(--clay-ring);
1450
+ outline-offset: 3px;
1451
+ }
1452
+ }
1453
+
1454
+ &[data-clay-ready] [data-slot="slider-thumb"] {
1455
+ background: transparent;
1456
+ box-shadow: none;
1457
+ }
1458
+
1459
+ &:not([data-clay-ready]) [data-slot="slider-control"] {
1460
+ border-radius: 999px;
1461
+ background: linear-gradient(90deg, var(--clay-color) calc(var(--clay-slide, 0) * 100%), transparent 0) no-repeat;
1462
+ }
1463
+
1464
+ &[data-state="pending"],
1465
+ &[data-state="success"] {
1466
+ & [data-slot="slider-control"] {
1467
+ cursor: default;
1468
+ }
1469
+ }
1470
+ }
1471
+
1472
+ .clay-slide-label {
1473
+ position: absolute;
1474
+ inset: 0;
1475
+ display: grid;
1476
+ place-items: center;
1477
+ padding-inline: var(--h);
1478
+ color: var(--clay-text-soft);
1479
+ pointer-events: none;
1480
+
1481
+ & > span {
1482
+ grid-area: 1 / 1;
1483
+ opacity: 0;
1484
+ translate: 0 0.5em;
1485
+ transition:
1486
+ opacity 0.25s,
1487
+ translate 0.45s var(--clay-spring);
1488
+ }
1489
+ }
1490
+
1491
+ clay-slide-confirm[data-state="idle"] [data-label="idle"] {
1492
+ opacity: calc(1 - var(--clay-slide, 0) * 1.8);
1493
+ translate: calc(var(--clay-slide, 0) * 40px) 0;
1494
+ transition: none;
1495
+ }
1496
+
1497
+ clay-slide-confirm:is([data-state="pending"], [data-state="success"]) .clay-slide-label {
1498
+ color: var(--clay-on-knob);
1499
+ }
1500
+
1501
+ clay-slide-confirm[data-tone="dark"]:is([data-state="pending"], [data-state="success"]) .clay-slide-label {
1502
+ color: #fff;
1503
+ }
1504
+
1505
+ clay-slide-confirm[data-state="error"] .clay-slide-label {
1506
+ color: var(--clay-danger-text);
1507
+ }
1508
+
1509
+ clay-slide-confirm[data-state="pending"] [data-label="pending"],
1510
+ clay-slide-confirm[data-state="success"] [data-label="success"],
1511
+ clay-slide-confirm[data-state="error"] [data-label="error"] {
1512
+ opacity: 1;
1513
+ translate: 0 0;
1514
+ }
1515
+
1516
+ .clay-slide-icon {
1517
+ display: grid;
1518
+
1519
+ & svg {
1520
+ grid-area: 1 / 1;
1521
+ width: 22px;
1522
+ height: 22px;
1523
+ fill: none;
1524
+ stroke: currentColor;
1525
+ stroke-linecap: round;
1526
+ stroke-linejoin: round;
1527
+ stroke-width: 2.6;
1528
+ opacity: 0;
1529
+ scale: 0.4;
1530
+ transition:
1531
+ opacity 0.2s,
1532
+ scale 0.45s var(--clay-spring);
1533
+ }
1534
+ }
1535
+
1536
+ clay-slide-confirm:is([data-state="idle"], [data-state="error"]) [data-icon="idle"],
1537
+ clay-slide-confirm[data-state="pending"] [data-icon="pending"],
1538
+ clay-slide-confirm[data-state="success"] [data-icon="success"] {
1539
+ opacity: 1;
1540
+ scale: 1;
1541
+ }
1542
+
1543
+ clay-slide-confirm[data-state="pending"] [data-icon="pending"] {
1544
+ animation: clay-spin 0.8s linear infinite;
1545
+ }
1546
+
1547
+ /*
1548
+ * Attached popups: the clay grows out of the trigger, so the popup itself stays opaque (its canvas is
1549
+ * inside it). Only its contents fade, and a hair of travel keeps ui-sdk from removing it until the clay
1550
+ * has tucked back in.
1551
+ */
1552
+ :is(clay-select, clay-menu, clay-popover, clay-tooltip)[attached]
1553
+ :is([data-slot="select-content"], [data-slot="menu-content"], [data-slot="popover-content"], [data-slot="tooltip-content"]) {
1554
+ scale: 1;
1555
+ opacity: 1;
1556
+ translate: 0 0;
1557
+ transition: translate 0.5s linear;
1558
+
1559
+ &:is([data-starting-style], [data-ending-style], [data-closed]) {
1560
+ scale: 1;
1561
+ opacity: 1;
1562
+ translate: 0 0.01px;
1563
+ }
1564
+
1565
+ /* Not the way it came in: a transition that only reverses is cut short, and closing soon after
1566
+ opening would hide the popup before its clay has tucked back in. */
1567
+ &[data-ending-style] {
1568
+ translate: 0 0.02px;
1569
+ }
1570
+
1571
+ & > :not(.clay-canvas) {
1572
+ transition:
1573
+ opacity 0.22s 0.12s,
1574
+ translate 0.45s 0.08s var(--clay-spring),
1575
+ background 0.15s;
1576
+ }
1577
+
1578
+ & > .clay-canvas {
1579
+ opacity: 1;
1580
+ translate: none;
1581
+ transition: none;
1582
+ }
1583
+
1584
+ &:is([data-starting-style], [data-ending-style], [data-closed]) > :not(.clay-canvas) {
1585
+ translate: 0 4px;
1586
+ opacity: 0;
1587
+ transition:
1588
+ opacity 0.12s,
1589
+ translate 0.2s;
1590
+ }
1591
+ }
1592
+
1593
+ clay-tooltip[attached] [data-slot="tooltip-content"] {
1594
+ color: var(--clay-text);
1595
+ }
1596
+
1597
+ clay-tooltip[attached][data-tone="light"] [data-slot="tooltip-content"] {
1598
+ color: var(--clay-on-knob);
1599
+ }
1600
+
1601
+ clay-tooltip[attached][data-tone="dark"] [data-slot="tooltip-content"] {
1602
+ color: #fff;
1603
+ }
1604
+
1605
+ .clay-tip-text {
1606
+ display: inline-block;
1607
+ }
1608
+
1609
+ @keyframes clay-spin {
1610
+ to { rotate: 360deg; }
1611
+ }
1612
+
1613
+ @keyframes clay-stamp {
1614
+ from {
1615
+ scale: 0.4 0.7;
1616
+ opacity: 0;
1617
+ }
1618
+ }
1619
+
1620
+ @media (prefers-reduced-motion: reduce) {
1621
+ :is(clay-badge, .clay-action-label > span, .clay-bead svg, .clay-slide-label > span, .clay-slide-icon svg, [data-slot="select-content"], [data-slot="select-item"], [data-slot="tooltip-content"], [data-slot="menu-content"], [data-slot="menu-item"], [data-slot="popover-content"], [data-slot="popover-content"] > :not(.clay-canvas), [data-slot="dialog-content"], [data-slot="dialog-backdrop"], [data-slot="toast"], [data-slot="tabs-panel"]) {
1622
+ animation: none;
1623
+ transition: none;
1624
+ }
1625
+
1626
+ :is(clay-action-button, clay-slide-confirm)[data-state="pending"] [data-icon="pending"] {
1627
+ animation-duration: 2.4s;
1628
+ }
1629
+ }
1630
+
1631
+ @media (forced-colors: active) {
1632
+ .clay-canvas {
1633
+ display: none;
1634
+ }
1635
+
1636
+ :is(clay-button, clay-action-button, clay-toggle, clay-button-group, clay-badge, clay-card, clay-avatar, clay-segmented, clay-switch, clay-checkbox, clay-input, clay-slide-confirm, clay-select [data-slot="select-trigger"], clay-tabs [data-slot="tabs-list"], [data-slot="menu-content"], [data-slot="popover-content"], [data-slot="dialog-content"], [data-slot="toast"]) {
1637
+ border: 1px solid CanvasText;
1638
+ }
1639
+
1640
+ :is(clay-toggle [aria-pressed="true"], clay-tabs [data-slot="tabs-tab"][data-selected]) {
1641
+ outline: 2px solid Highlight;
1642
+ }
1643
+
1644
+ clay-input:has(:focus-visible) {
1645
+ outline: 3px solid Highlight;
1646
+ outline-offset: 3px;
1647
+ }
1648
+ }