asta-ui 0.6.1 → 0.8.0

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.
@@ -0,0 +1,861 @@
1
+ /* Forms: combobox, date picker, colour picker, number, OTP, password, tags, range, rating, upload, inline edit,
2
+ * segmented control, toggle group, copy button. Class lists mirror go/ui/<name>.templ.
3
+ * asta.js finds these parts by their data-asta-* attributes, so keep those. Runtime classes named in
4
+ * go/ui/assets/src/forms.css (asta-combo-chip, asta-date-cal, asta-otp-shake, asta-pw-slash…) stay in the markup too. */
5
+
6
+ /* ---- Combobox (combobox.templ) ----
7
+ * <div class="asta-combobox" data-asta-combo="single" data-name="framework">
8
+ * <div class="asta-combobox-box" data-asta-combo-box><input class="asta-combobox-input" data-asta-combo-input role="combobox" …>
9
+ * <button class="asta-combobox-toggle" data-asta-combo-toggle>…</button></div>
10
+ * <input type="hidden" name="framework" data-asta-combo-value>
11
+ * <ul class="asta-combobox-list" role="listbox" hidden><li class="asta-combobox-option" role="option" data-value data-label>…</li></ul>
12
+ * </div>
13
+ * Multiple: data-asta-combo="multiple", chips are .asta-combobox-chip (also .asta-combo-chip), plus a <template data-asta-combo-tpl>. */
14
+ .asta-combobox {
15
+ @apply relative w-full;
16
+ }
17
+ .asta-combobox-box {
18
+ @apply flex min-h-10 w-full flex-wrap items-center gap-1 rounded-lg bg-paper py-1 pl-1.5 pr-1 transition-shadow duration-200;
19
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)];
20
+ @apply focus-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)];
21
+ &:has(:disabled) {
22
+ @apply cursor-not-allowed opacity-45;
23
+ }
24
+ }
25
+ .asta-combobox-input {
26
+ @apply h-8 min-w-[6rem] flex-1 bg-transparent px-1.5 text-[14px] text-ink outline-none placeholder:text-mute disabled:cursor-not-allowed;
27
+ }
28
+ .asta-combobox-toggle {
29
+ @apply ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-mute outline-none transition-colors hover:bg-paper-2 hover:text-ink;
30
+ & > svg {
31
+ @apply h-4 w-4 transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)];
32
+ }
33
+ .asta-combobox[data-open] & > svg {
34
+ @apply rotate-180;
35
+ }
36
+ }
37
+ .asta-combobox-list {
38
+ @apply absolute inset-x-0 top-full z-50 mt-1.5 max-h-64 origin-top overflow-y-auto rounded-xl bg-paper p-1 outline-none [scrollbar-width:thin];
39
+ @apply shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-8px_rgb(0_0_0/0.22),0_4px_8px_-4px_rgb(0_0_0/0.08)];
40
+ }
41
+ .asta-combobox-option {
42
+ @apply flex cursor-pointer select-none items-center gap-2.5 rounded-md px-2.5 py-2 text-[14px] text-ink-2 transition-colors duration-150;
43
+ @apply data-[active]:bg-paper-2 data-[active]:text-ink aria-disabled:cursor-not-allowed aria-disabled:opacity-40;
44
+ }
45
+ .asta-combobox-icon {
46
+ @apply inline-flex shrink-0 [&_svg]:h-4 [&_svg]:w-4;
47
+ }
48
+ .asta-combobox-text {
49
+ @apply min-w-0 flex-1 truncate;
50
+ }
51
+ .asta-combobox-hint {
52
+ @apply text-[12px] tabular-nums text-mute;
53
+ }
54
+ .asta-combobox-check {
55
+ @apply h-4 w-4 shrink-0 scale-75 text-brand opacity-0 transition-[opacity,transform] duration-200 ease-[cubic-bezier(.16,1,.3,1)];
56
+ [aria-selected="true"] > & {
57
+ @apply scale-100 opacity-100;
58
+ }
59
+ }
60
+ .asta-combobox-empty {
61
+ @apply flex flex-col items-center gap-1 px-2.5 py-6 text-center;
62
+ }
63
+ .asta-combobox-empty-title {
64
+ @apply text-[13px] text-ink-2;
65
+ }
66
+ .asta-combobox-query {
67
+ @apply text-[12px] text-mute;
68
+ }
69
+ .asta-combobox-chip {
70
+ @apply inline-flex h-7 items-center gap-1 rounded-md bg-paper-2 pl-2 pr-0.5 text-[13px] text-ink;
71
+ }
72
+ .asta-combobox-chip-icon {
73
+ @apply inline-flex shrink-0 [&_svg]:h-3.5 [&_svg]:w-3.5;
74
+ }
75
+ .asta-combobox-remove {
76
+ @apply flex h-6 w-6 items-center justify-center rounded-[5px] text-mute outline-none transition-colors hover:bg-[color-mix(in_srgb,var(--ink)_8%,transparent)] hover:text-ink;
77
+ & > svg {
78
+ @apply h-3 w-3;
79
+ }
80
+ }
81
+
82
+ /* ---- Date picker (date_picker.templ) ----
83
+ * <div class="asta-date-picker" data-asta-date="single" data-placeholder="Pick a date">
84
+ * <button class="asta-date-picker-trigger" data-asta-date-trigger aria-haspopup="dialog" aria-expanded="false" aria-controls="d-cal">
85
+ * <svg class="asta-date-picker-icon">…</svg><span class="asta-date-picker-text asta-date-picker-placeholder" data-asta-date-text>Pick a date</span></button>
86
+ * <input type="hidden" name="day" data-asta-date-value>
87
+ * <div id="d-cal" class="asta-date-picker-cal asta-date-cal" role="dialog" hidden data-asta-date-cal></div>
88
+ * </div>
89
+ * Range: data-asta-date="range". Small: asta-date-picker-sm on the trigger. asta.js renders the calendar. */
90
+ .asta-date-picker {
91
+ @apply relative w-full;
92
+ }
93
+ .asta-date-picker-trigger {
94
+ @apply flex w-full items-center gap-2 bg-paper text-left outline-none transition-shadow duration-200 focus-visible:ring-2 focus-visible:ring-brand/50 disabled:cursor-not-allowed disabled:opacity-45;
95
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)];
96
+ @apply h-10 rounded-lg px-3 text-[14px];
97
+ .asta-date-picker[data-open] & {
98
+ @apply !shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_18%,transparent)];
99
+ }
100
+ }
101
+ .asta-date-picker-sm {
102
+ @apply h-8 rounded-md px-2.5 text-[13px];
103
+ }
104
+ .asta-date-picker-icon {
105
+ @apply h-4 w-4 shrink-0 text-mute;
106
+ }
107
+ .asta-date-picker-text {
108
+ @apply min-w-0 flex-1 truncate tabular-nums text-ink;
109
+ }
110
+ .asta-date-picker-placeholder {
111
+ @apply text-mute;
112
+ }
113
+ .asta-date-picker-cal {
114
+ @apply absolute left-0 top-full z-50 mt-2 w-[296px] max-w-[calc(100vw-32px)] origin-top-left rounded-xl bg-paper p-3 outline-none;
115
+ @apply shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-8px_rgb(0_0_0/0.22),0_4px_8px_-4px_rgb(0_0_0/0.08)];
116
+ }
117
+
118
+ /* ---- Colour picker (color_picker.templ) ----
119
+ * <div class="asta-color-picker" data-asta-color data-columns="5">
120
+ * <div class="asta-color-picker-swatches" role="radiogroup" style="grid-template-columns:repeat(5,28px);gap:10px">
121
+ * <label class="asta-color-picker-swatch"><input type="radio" name="c" value="#2f54eb"><span class="asta-color-picker-ring"></span>
122
+ * <span class="asta-color-picker-fill" style="background:#2f54eb"></span></label>…
123
+ * <input type="radio" name="c" hidden data-asta-color-custom></div>
124
+ * <div class="asta-color-picker-custom"><span class="asta-color-picker-preview" data-asta-color-preview>?</span>
125
+ * <div class="asta-color-picker-field"><span class="asta-color-picker-hash">#</span><input class="asta-color-picker-hex" data-asta-color-hex></div>
126
+ * <span class="asta-color-picker-hint" data-asta-color-hint></span></div>
127
+ * </div>
128
+ * Light swatches: asta-color-picker-fill-light adds an edge. Small: asta-color-picker-sm on each swatch. */
129
+ .asta-color-picker {
130
+ @apply inline-flex flex-col gap-3;
131
+ }
132
+ .asta-color-picker-swatches {
133
+ @apply grid w-max;
134
+ }
135
+ .asta-color-picker-swatch {
136
+ @apply relative h-7 w-7 cursor-pointer rounded-full transition-[scale] duration-200 ease-[cubic-bezier(.16,1,.3,1)] hover:scale-110 active:scale-95 motion-reduce:transition-none;
137
+ & > input {
138
+ @apply sr-only;
139
+ }
140
+ }
141
+ .asta-color-picker-sm {
142
+ @apply h-[22px] w-[22px];
143
+ }
144
+ .asta-color-picker-ring {
145
+ @apply pointer-events-none absolute -inset-[4px] scale-75 rounded-full opacity-0 shadow-[0_0_0_1.5px_var(--ink)] transition-[opacity,scale] duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
146
+ input:checked ~ & {
147
+ @apply scale-100 opacity-100;
148
+ }
149
+ input:focus-visible ~ & {
150
+ @apply scale-100 opacity-100 shadow-[0_0_0_1.5px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_22%,transparent)];
151
+ }
152
+ }
153
+ .asta-color-picker-fill {
154
+ @apply absolute inset-0 rounded-full;
155
+ }
156
+ .asta-color-picker-fill-light {
157
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)];
158
+ }
159
+ .asta-color-picker-custom {
160
+ @apply flex items-center gap-2.5;
161
+ }
162
+ .asta-color-picker-preview {
163
+ @apply relative grid h-8 w-8 shrink-0 place-items-center rounded-[8px] text-[12px] text-transparent shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_12%,transparent)] transition-[background-color] duration-200 data-[empty]:text-mute;
164
+ }
165
+ .asta-color-picker-field {
166
+ @apply flex h-8 min-w-0 flex-1 items-center rounded-[8px] bg-paper-2 pl-2.5 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)] transition-shadow duration-200 focus-within:shadow-[inset_0_0_0_1.5px_var(--brand)];
167
+ }
168
+ .asta-color-picker-hash {
169
+ @apply text-[13px] text-mute;
170
+ }
171
+ .asta-color-picker-hex {
172
+ @apply h-full w-full min-w-0 bg-transparent pl-1 pr-2.5 font-mono text-[13px] uppercase tracking-[0.02em] text-ink outline-none placeholder:text-mute;
173
+ }
174
+ .asta-color-picker-hint {
175
+ @apply w-14 text-[12px] text-mute opacity-0 transition-opacity duration-200 data-[on]:opacity-100;
176
+ }
177
+
178
+ /* ---- Number input (number_input.templ) ----
179
+ * <div class="asta-number-input" data-asta-number data-min="1" data-max="20" data-step="1">
180
+ * <button class="asta-number-input-step" data-asta-number-step="-1" aria-label="Decrease">…</button>
181
+ * <div class="asta-number-input-view" role="spinbutton" tabindex="0" data-asta-number-view aria-valuenow="4">
182
+ * <span class="asta-number-input-digits" data-asta-number-digits>…digits…</span><span class="asta-number-input-suffix">seats</span></div>
183
+ * <button class="asta-number-input-step" data-asta-number-step="1" aria-label="Increase">…</button>
184
+ * <input type="hidden" name="seats" value="4" data-asta-number-input>
185
+ * </div>
186
+ * A digit: <span class="asta-number-input-digit" data-asta-digit><span class="asta-number-input-reel" style="transform:translateY(-5em)">
187
+ * <span>0</span>…<span>9</span></span></span>. Small: asta-number-input-sm on the root. */
188
+ .asta-number-input {
189
+ @apply inline-flex h-12 items-center gap-1 rounded-[10px] bg-paper px-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)];
190
+ }
191
+ .asta-number-input-step {
192
+ @apply flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md text-ink-2 outline-none [touch-action:manipulation];
193
+ @apply transition-[background-color,transform,opacity] duration-150 hover:bg-paper-2 hover:text-ink active:scale-90 disabled:opacity-30 disabled:hover:bg-transparent;
194
+ & > svg {
195
+ @apply h-3.5 w-3.5;
196
+ }
197
+ }
198
+ .asta-number-input-view {
199
+ @apply flex min-w-[3.5em] items-center justify-center gap-1.5 rounded-lg px-1 text-[20px] font-medium tabular-nums tracking-[-0.02em] text-ink outline-none transition-transform duration-200 focus-visible:ring-2 focus-visible:ring-brand/50;
200
+ @apply data-[bump=max]:-translate-y-0.5 data-[bump=min]:translate-y-0.5;
201
+ }
202
+ .asta-number-input-digits {
203
+ @apply inline-flex;
204
+ }
205
+ .asta-number-input-digit {
206
+ @apply relative inline-block h-[1.25em] w-[0.62em] overflow-hidden;
207
+ }
208
+ .asta-number-input-reel {
209
+ @apply absolute inset-x-0 top-0 flex flex-col transition-transform duration-500 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
210
+ & > span {
211
+ @apply flex h-[1.25em] items-center justify-center;
212
+ }
213
+ }
214
+ .asta-number-input-suffix {
215
+ @apply text-[13px] font-normal text-mute;
216
+ }
217
+ .asta-number-input-sm {
218
+ @apply h-8 rounded-full px-1;
219
+ & .asta-number-input-step {
220
+ @apply h-6 w-6;
221
+ }
222
+ & .asta-number-input-view {
223
+ @apply text-[14px];
224
+ }
225
+ & .asta-number-input-suffix {
226
+ @apply text-[12px];
227
+ }
228
+ }
229
+
230
+ /* ---- OTP input (otp_input.templ) ----
231
+ * <div class="asta-otp-input" data-asta-otp>
232
+ * <div class="asta-otp-input-boxes" aria-hidden="true" data-asta-otp-boxes>
233
+ * <span class="asta-otp-input-wave" data-asta-otp-wave style="--asta-otp-i:0ms"><span class="asta-otp-input-box" data-asta-otp-box></span></span>…
234
+ * <span class="asta-otp-input-sep"></span> (between groups)</div>
235
+ * <input class="asta-otp-input-field" name="code" maxlength="6" inputmode="numeric" autocomplete="one-time-code">
236
+ * </div>
237
+ * Box states come from data-state: filled, full, active, error. Error shake: asta-otp-shake on the boxes. */
238
+ .asta-otp-input {
239
+ @apply relative inline-flex;
240
+ &:has(:disabled) {
241
+ @apply opacity-45;
242
+ }
243
+ }
244
+ .asta-otp-input-boxes {
245
+ @apply flex items-center gap-2;
246
+ }
247
+ .asta-otp-input-wave {
248
+ @apply block;
249
+ }
250
+ .asta-otp-input-box {
251
+ @apply grid h-12 w-10 place-items-center rounded-[10px] bg-paper text-[22px] font-medium tabular-nums tracking-[-0.02em] text-ink transition-shadow duration-200 sm:h-14 sm:w-12 sm:text-[24px];
252
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)];
253
+ @apply data-[state=filled]:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_26%,transparent)];
254
+ @apply data-[state=full]:shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--brand)_55%,transparent)];
255
+ @apply data-[state=active]:shadow-[inset_0_0_0_1.5px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)];
256
+ @apply data-[state=error]:shadow-[inset_0_0_0_1.5px_var(--ink)];
257
+ }
258
+ .asta-otp-input-sep {
259
+ @apply mx-0.5 h-[2px] w-2.5 rounded-full bg-[color-mix(in_srgb,var(--ink)_22%,transparent)];
260
+ }
261
+ .asta-otp-input-field {
262
+ @apply absolute inset-0 h-full w-full cursor-text bg-transparent text-[16px] text-transparent caret-transparent opacity-0 outline-none disabled:cursor-not-allowed;
263
+ }
264
+
265
+ /* ---- Segmented control (segmented_control.templ) ----
266
+ * <div class="asta-segmented" role="radiogroup" data-asta-segmented aria-label="View">
267
+ * <label class="asta-segmented-item"><input type="radio" name="view" value="list" checked>
268
+ * <span class="asta-segmented-pill" data-asta-ind></span><span class="asta-segmented-label">List</span></label>…
269
+ * </div>
270
+ * Small: asta-segmented-sm on the root. Full width: asta-segmented-full. */
271
+ .asta-segmented {
272
+ @apply relative isolate inline-flex rounded-[10px] bg-paper-2 p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_6%,transparent)];
273
+ }
274
+ .asta-segmented-item {
275
+ @apply relative inline-flex h-10 cursor-pointer select-none items-center justify-center whitespace-nowrap rounded-[7px] px-4 text-[14px] font-medium tracking-[-0.01em] text-mute transition-colors duration-300 hover:text-ink has-[:checked]:text-ink;
276
+ @apply has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-brand/50;
277
+ & > input {
278
+ @apply sr-only;
279
+ }
280
+ }
281
+ .asta-segmented-pill {
282
+ @apply pointer-events-none absolute inset-0 -z-10 rounded-[7px] bg-paper opacity-0;
283
+ @apply shadow-[0_1px_2px_rgb(0_0_0/0.08),0_3px_10px_-4px_rgb(0_0_0/0.18),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)];
284
+ input:checked ~ & {
285
+ @apply opacity-100;
286
+ }
287
+ }
288
+ .asta-segmented-label {
289
+ @apply relative inline-flex items-center gap-1.5 [&_svg]:h-[1.05em] [&_svg]:w-[1.05em];
290
+ }
291
+ .asta-segmented-sm .asta-segmented-item {
292
+ @apply h-8 px-3 text-[13px];
293
+ }
294
+ .asta-segmented-full {
295
+ @apply flex w-full;
296
+ & .asta-segmented-item {
297
+ @apply flex-1;
298
+ }
299
+ }
300
+
301
+ /* ---- Toggle group (toggle_group.templ) ----
302
+ * <div class="asta-toggle-group" role="radiogroup" data-asta-toggle="single" aria-label="Align">
303
+ * <label class="asta-toggle-group-item"><input type="radio" name="align" value="left" checked aria-label="Left">
304
+ * <span class="asta-toggle-group-ind" data-asta-ind></span><span class="asta-toggle-group-icon">svg</span></label>…
305
+ * </div>
306
+ * Multiple: data-asta-toggle="multiple", role="group", checkboxes. With text: <span class="asta-toggle-group-label">Bold</span>
307
+ * and asta-toggle-group-text on the item. Small: asta-toggle-group-sm on the root. Full width: asta-toggle-group-full. */
308
+ .asta-toggle-group {
309
+ @apply relative isolate inline-flex gap-0.5 rounded-[10px] bg-paper-2 p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_6%,transparent)];
310
+ &[aria-disabled="true"] {
311
+ @apply opacity-50;
312
+ }
313
+ }
314
+ .asta-toggle-group-item {
315
+ @apply relative inline-flex h-9 w-9 cursor-pointer select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-[7px] text-[13.5px] font-medium tracking-[-0.01em] outline-none;
316
+ @apply text-mute transition-[color,scale] duration-200 hover:text-ink has-[:checked]:text-ink active:scale-[0.97] motion-reduce:transition-none;
317
+ @apply has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-brand/50 has-[:disabled]:pointer-events-none [&_svg]:h-[1.05em] [&_svg]:w-[1.05em];
318
+ & > input {
319
+ @apply sr-only;
320
+ }
321
+ .asta-toggle-group:not([aria-disabled="true"]) &:has(:disabled) {
322
+ @apply opacity-40;
323
+ }
324
+ }
325
+ .asta-toggle-group-text {
326
+ @apply w-auto px-3.5;
327
+ }
328
+ .asta-toggle-group-ind {
329
+ @apply pointer-events-none absolute inset-0 -z-10 origin-left rounded-[7px] bg-paper opacity-0;
330
+ @apply shadow-[0_1px_2px_rgb(0_0_0/0.07),0_3px_10px_-4px_rgb(0_0_0/0.16),inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)];
331
+ input:checked ~ & {
332
+ @apply opacity-100;
333
+ }
334
+ [data-asta-toggle="multiple"] & {
335
+ @apply scale-[.94] transition-[opacity,scale] duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
336
+ }
337
+ [data-asta-toggle="multiple"] input:checked ~ & {
338
+ @apply scale-100;
339
+ }
340
+ }
341
+ .asta-toggle-group-icon {
342
+ @apply relative flex transition-colors duration-200;
343
+ input:checked ~ & {
344
+ @apply text-brand;
345
+ }
346
+ }
347
+ .asta-toggle-group-label {
348
+ @apply relative;
349
+ }
350
+ .asta-toggle-group-sm .asta-toggle-group-item {
351
+ @apply h-8 w-8 text-[13px];
352
+ &.asta-toggle-group-text {
353
+ @apply w-auto px-3;
354
+ }
355
+ }
356
+ .asta-toggle-group-full {
357
+ @apply flex w-full;
358
+ & .asta-toggle-group-item {
359
+ @apply flex-1;
360
+ }
361
+ }
362
+
363
+ /* ---- Copy button (copy_button.templ) ----
364
+ * <button class="asta-copy-button asta-copy-button-text" data-asta-copy="npm i asta-ui" data-timeout="1600" data-state="idle" data-copied="Copied">
365
+ * <span class="asta-copy-button-icons" aria-hidden="true"><svg class="asta-copy-button-copy">…</svg>
366
+ * <svg class="asta-copy-button-done"><path class="asta-copy-tick" pathLength="1" d="m3.5 8.5 3 3 6-7"/></svg></span>
367
+ * <span class="asta-copy-button-labels" aria-hidden="true"><span class="asta-copy-button-idle">Copy</span>
368
+ * <span class="asta-copy-button-copied"><span class="asta-copy-button-ok">Copied</span><span class="asta-copy-button-fail">Couldn't copy</span></span></span>
369
+ * <span class="asta-sr-only">Copy</span></button>
370
+ * <span class="asta-sr-only" role="status" aria-live="polite" data-asta-copy-status></span>
371
+ * Icon only: drop the labels and asta-copy-button-text, add aria-label="Copy". Variants: (ghost) asta-copy-button-outline,
372
+ * asta-copy-button-soft. Small: asta-copy-button-sm. Copy from an element: data-asta-copy-from="#id". */
373
+ .asta-sr-only {
374
+ @apply sr-only;
375
+ }
376
+ .asta-copy-button {
377
+ @apply inline-flex h-9 w-9 shrink-0 select-none items-center justify-center gap-1.5 rounded-lg text-[13px] font-medium outline-none;
378
+ @apply transition-[color,background-color,box-shadow,transform] duration-200 focus-visible:ring-2 focus-visible:ring-brand/50 active:scale-[.96] disabled:pointer-events-none disabled:opacity-40;
379
+ @apply text-mute hover:bg-paper-2 hover:text-ink;
380
+ }
381
+ .asta-copy-button-outline {
382
+ @apply bg-transparent text-ink-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:bg-transparent hover:text-ink hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_26%,transparent)];
383
+ }
384
+ .asta-copy-button-soft {
385
+ @apply bg-paper-2 text-ink-2 hover:bg-paper-2 hover:text-ink;
386
+ }
387
+ .asta-copy-button-text {
388
+ @apply w-auto px-3;
389
+ }
390
+ .asta-copy-button-sm {
391
+ @apply h-7 w-7 text-[12.5px];
392
+ &.asta-copy-button-text {
393
+ @apply w-auto px-2.5;
394
+ }
395
+ }
396
+ .asta-copy-button-icons {
397
+ @apply relative flex h-4 w-4 items-center justify-center;
398
+ .asta-copy-button-sm > & {
399
+ @apply h-3.5 w-3.5;
400
+ }
401
+ }
402
+ .asta-copy-button-copy,
403
+ .asta-copy-button-done,
404
+ .asta-copy-button-idle,
405
+ .asta-copy-button-copied {
406
+ @apply transition-[opacity,transform] duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
407
+ }
408
+ .asta-copy-button-copy {
409
+ @apply absolute inset-0;
410
+ [data-state="copied"] & {
411
+ @apply rotate-[-30deg] scale-50 opacity-0;
412
+ }
413
+ }
414
+ .asta-copy-button-done {
415
+ @apply absolute inset-0 scale-75 text-brand opacity-0;
416
+ [data-state="copied"] & {
417
+ @apply scale-100 opacity-100;
418
+ }
419
+ }
420
+ .asta-copy-button-labels {
421
+ @apply relative grid overflow-hidden;
422
+ }
423
+ .asta-copy-button-idle {
424
+ @apply col-start-1 row-start-1;
425
+ :is([data-state="copied"], [data-state="failed"]) & {
426
+ @apply -translate-y-full opacity-0;
427
+ }
428
+ }
429
+ .asta-copy-button-copied {
430
+ @apply col-start-1 row-start-1 translate-y-full opacity-0;
431
+ :is([data-state="copied"], [data-state="failed"]) & {
432
+ @apply translate-y-0 opacity-100;
433
+ }
434
+ }
435
+ .asta-copy-button-ok {
436
+ [data-state="failed"] & {
437
+ @apply hidden;
438
+ }
439
+ }
440
+ .asta-copy-button-fail {
441
+ @apply hidden;
442
+ [data-state="failed"] & {
443
+ @apply inline;
444
+ }
445
+ }
446
+
447
+ /* ---- Password input (password_input.templ) ----
448
+ * <div class="asta-password" data-asta-password data-strength="0">
449
+ * <label class="asta-password-label" for="pw">Password</label>
450
+ * <div class="asta-password-box"><input class="asta-password-input" id="pw" type="password" data-asta-password-input aria-describedby="pw-help">
451
+ * <button class="asta-password-toggle" data-asta-password-toggle aria-pressed="false" aria-label="Show password">
452
+ * <svg><path d="…eye…"/><circle class="asta-password-pupil" cx="10" cy="10" r="2.2"/><path class="asta-pw-slash" pathLength="1" d="M4 3.5 16 16.5"/></svg></button></div>
453
+ * <div id="pw-help" class="asta-password-help">
454
+ * <div class="asta-password-meter"><div class="asta-password-bars"><span class="asta-password-bar"><span class="asta-password-seg" data-asta-password-seg></span></span>…</div>
455
+ * <span class="asta-password-word" data-asta-password-word></span></div>
456
+ * <ul class="asta-password-rules"><li class="asta-password-rule" data-asta-password-rule="[A-Z]"><span class="asta-password-tick"><svg><path class="asta-pw-tick" pathLength="1" d="m3.5 8.5 3 3 6-7"/></svg></span>
457
+ * One uppercase letter<span class="asta-sr-only" data-asta-password-said>, not yet</span></li></ul></div>
458
+ * </div> */
459
+ .asta-password {
460
+ @apply flex w-full flex-col gap-2;
461
+ }
462
+ .asta-password-label {
463
+ @apply text-[13px] font-medium text-ink;
464
+ }
465
+ .asta-password-box {
466
+ @apply flex h-10 items-center gap-2 rounded-lg bg-paper pl-3 pr-1 transition-shadow duration-200;
467
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_24%,transparent)];
468
+ @apply focus-within:!shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_16%,transparent)];
469
+ &:has(input:disabled) {
470
+ @apply pointer-events-none opacity-50;
471
+ }
472
+ }
473
+ .asta-password-input {
474
+ @apply h-full min-w-0 flex-1 bg-transparent text-[14px] tracking-[0.01em] text-ink outline-none placeholder:text-mute;
475
+ }
476
+ .asta-password-toggle {
477
+ @apply flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-mute outline-none transition-colors duration-200 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50;
478
+ & > svg {
479
+ @apply h-[18px] w-[18px];
480
+ }
481
+ }
482
+ .asta-password-pupil {
483
+ @apply origin-center scale-[.55] transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)] [transform-box:fill-box] motion-reduce:transition-none;
484
+ [aria-pressed="true"] & {
485
+ @apply scale-100;
486
+ }
487
+ }
488
+ .asta-password-help {
489
+ @apply flex flex-col gap-3 pt-1;
490
+ }
491
+ .asta-password-meter {
492
+ @apply flex items-center gap-3;
493
+ }
494
+ .asta-password-bars {
495
+ @apply flex flex-1 gap-1.5;
496
+ }
497
+ .asta-password-bar {
498
+ @apply relative h-1 flex-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_10%,transparent)];
499
+ }
500
+ .asta-password-seg {
501
+ @apply absolute inset-0 origin-left scale-x-0 rounded-full bg-ink transition-[transform,background-color] duration-500 ease-[cubic-bezier(.16,1,.3,1)] data-[on]:scale-x-100 motion-reduce:transition-none;
502
+ .asta-password[data-strong] & {
503
+ @apply bg-brand;
504
+ }
505
+ }
506
+ .asta-password-word {
507
+ @apply w-12 text-right text-[12px] tabular-nums text-mute transition-colors duration-300;
508
+ .asta-password[data-strong] & {
509
+ @apply text-brand;
510
+ }
511
+ }
512
+ .asta-password-rules {
513
+ @apply grid gap-1.5 sm:grid-cols-2;
514
+ }
515
+ .asta-password-rule {
516
+ @apply flex items-center gap-2 text-[12.5px] text-mute transition-colors duration-300 data-[on]:text-ink;
517
+ }
518
+ .asta-password-tick {
519
+ @apply relative flex h-4 w-4 shrink-0 items-center justify-center rounded-full shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_20%,transparent)] transition-[background-color,box-shadow] duration-300;
520
+ [data-on] > & {
521
+ @apply bg-brand text-white shadow-none;
522
+ }
523
+ & > svg {
524
+ @apply h-2.5 w-2.5;
525
+ }
526
+ }
527
+
528
+ /* ---- Tag input (tag_input.templ) ----
529
+ * <div class="asta-tag-input" data-asta-tags data-name="tags" data-max="8" data-placeholder="Add a tag">
530
+ * <div class="asta-tag-input-head"><label class="asta-tag-input-label" for="tags">Tags</label><span class="asta-tag-input-count" data-asta-tags-count aria-live="polite">2/8</span></div>
531
+ * <div class="asta-tag-input-box" data-asta-tags-box><ul class="asta-tag-input-list" data-asta-tags-list>
532
+ * <li class="asta-tag-input-tag" data-asta-tag="go"><span data-asta-tag-text>go</span><button class="asta-tag-input-remove" data-asta-tag-remove aria-label="Remove go">svg</button>
533
+ * <input type="hidden" name="tags" value="go"></li></ul>
534
+ * <input class="asta-tag-input-field" id="tags" data-asta-tags-input autocomplete="off"></div>
535
+ * <p class="asta-tag-input-hint"><kbd>Enter</kbd> or <kbd>,</kbd> to add</p>
536
+ * <template data-asta-tags-tpl><li class="asta-tag-input-tag asta-tag-in" data-asta-tag>…same as above…</li></template>
537
+ * </div> */
538
+ .asta-tag-input {
539
+ @apply w-full;
540
+ }
541
+ .asta-tag-input-head {
542
+ @apply mb-2 flex items-baseline justify-between;
543
+ }
544
+ .asta-tag-input-label {
545
+ @apply text-[13px] font-medium text-ink;
546
+ }
547
+ .asta-tag-input-count {
548
+ @apply font-mono text-[11px] tabular-nums text-mute transition-colors;
549
+ }
550
+ .asta-tag-input-box {
551
+ @apply flex min-h-11 w-full cursor-text flex-wrap items-center gap-1.5 rounded-[9px] bg-paper p-1.5 transition-shadow duration-200;
552
+ @apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)];
553
+ @apply focus-within:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)];
554
+ }
555
+ .asta-tag-input-list {
556
+ @apply contents;
557
+ }
558
+ .asta-tag-input-tag {
559
+ @apply flex h-8 items-center gap-1 rounded-md bg-paper-2 pl-3 pr-1 text-[13px] text-ink transition-colors duration-200 data-[armed]:bg-[#e5484d] data-[armed]:text-white;
560
+ }
561
+ .asta-tag-input-remove {
562
+ @apply flex h-6 w-6 items-center justify-center rounded-[5px] text-mute outline-none transition-colors hover:bg-[color-mix(in_srgb,var(--ink)_8%,transparent)] hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50;
563
+ & > svg {
564
+ @apply h-3 w-3;
565
+ }
566
+ [data-armed] > & {
567
+ @apply text-white hover:bg-white/20;
568
+ }
569
+ }
570
+ .asta-tag-input-field {
571
+ @apply h-8 min-w-[4rem] flex-1 bg-transparent px-2 text-[14px] text-ink outline-none placeholder:text-mute disabled:cursor-not-allowed;
572
+ }
573
+ .asta-tag-input-hint {
574
+ @apply mt-2 text-[12px] text-mute;
575
+ & kbd {
576
+ @apply font-sans text-ink-2;
577
+ }
578
+ }
579
+
580
+ /* ---- Range slider (range_slider.templ) ----
581
+ * <div class="asta-range-slider" data-asta-range data-gap="10" data-prefix="$">
582
+ * <div class="asta-range-slider-body"><div class="asta-range-slider-track" data-asta-range-track>
583
+ * <span class="asta-range-slider-rail"></span>
584
+ * <span class="asta-range-slider-fill" data-asta-range-fill style="transform:translateX(20%) scaleX(0.5)"></span>
585
+ * <span class="asta-range-slider-at" data-asta-range-at="0" style="transform:translateX(20cqw)"><span class="asta-range-slider-bubble" data-asta-range-bubble>$200</span></span>
586
+ * <span class="asta-range-slider-at" data-asta-range-at="1" style="transform:translateX(70cqw)"><span class="asta-range-slider-bubble" data-asta-range-bubble>$700</span></span></div>
587
+ * <input class="asta-range-slider-input" type="range" name="min" min="0" max="1000" value="200" data-asta-range-input="0" aria-label="Minimum">
588
+ * <input class="asta-range-slider-input" type="range" name="max" min="0" max="1000" value="700" data-asta-range-input="1" aria-label="Maximum"></div>
589
+ * </div>
590
+ * The fill and handles are positioned with inline transforms; asta.js keeps them in step while dragging. */
591
+ .asta-range-slider {
592
+ @apply relative w-full select-none pb-1 pt-9;
593
+ &:has(input:disabled) {
594
+ @apply pointer-events-none opacity-50;
595
+ }
596
+ }
597
+ .asta-range-slider-body {
598
+ @apply relative h-5;
599
+ }
600
+ .asta-range-slider-track {
601
+ @apply absolute inset-y-0 left-[10px] right-[10px] flex cursor-pointer items-center [container-type:inline-size] [touch-action:none];
602
+ }
603
+ .asta-range-slider-rail {
604
+ @apply absolute inset-x-0 h-1 rounded-full bg-[color-mix(in_srgb,var(--ink)_12%,transparent)];
605
+ }
606
+ .asta-range-slider-fill {
607
+ @apply absolute inset-x-0 h-1 origin-left bg-brand;
608
+ }
609
+ .asta-range-slider-at {
610
+ @apply pointer-events-none absolute left-0 top-0 h-full w-0;
611
+ }
612
+ .asta-range-slider-bubble {
613
+ @apply pointer-events-none absolute bottom-full left-0 mb-2.5 -translate-x-1/2 translate-y-1 whitespace-nowrap rounded-[6px] bg-ink px-2 py-1 text-[12px] font-medium tabular-nums leading-none text-paper opacity-0;
614
+ @apply transition-[opacity,translate] duration-200 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
615
+ .asta-range-slider:has([data-asta-range-input="0"]:is(:hover, :active, :focus-visible)) [data-asta-range-at="0"] > &,
616
+ .asta-range-slider:has([data-asta-range-input="1"]:is(:hover, :active, :focus-visible)) [data-asta-range-at="1"] > & {
617
+ @apply translate-y-0 opacity-100;
618
+ }
619
+ }
620
+ .asta-range-slider-input {
621
+ @apply pointer-events-none absolute inset-0 h-5 w-full appearance-none bg-transparent outline-none disabled:cursor-not-allowed;
622
+ @apply [&::-webkit-slider-runnable-track]:h-5 [&::-webkit-slider-runnable-track]:bg-transparent;
623
+ @apply [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-paper;
624
+ @apply [&::-webkit-slider-thumb]:shadow-[0_0_0_1.5px_var(--brand),0_2px_6px_-1px_rgb(0_0_0/0.18)] [&::-webkit-slider-thumb]:transition-[scale,box-shadow] [&::-webkit-slider-thumb]:duration-200 [&::-webkit-slider-thumb]:ease-[cubic-bezier(.16,1,.3,1)];
625
+ @apply hover:[&::-webkit-slider-thumb]:scale-105 active:[&::-webkit-slider-thumb]:scale-110 active:[&::-webkit-slider-thumb]:cursor-grabbing;
626
+ @apply focus-visible:[&::-webkit-slider-thumb]:shadow-[0_0_0_1.5px_var(--brand),0_0_0_5px_color-mix(in_srgb,var(--brand)_22%,transparent)] motion-reduce:[&::-webkit-slider-thumb]:transition-none;
627
+ @apply [&::-moz-range-track]:bg-transparent [&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-paper;
628
+ @apply [&::-moz-range-thumb]:shadow-[0_0_0_1.5px_var(--brand),0_2px_6px_-1px_rgb(0_0_0/0.18)] [&::-moz-range-thumb]:transition-[scale,box-shadow] [&::-moz-range-thumb]:duration-200;
629
+ @apply hover:[&::-moz-range-thumb]:scale-105 active:[&::-moz-range-thumb]:scale-110;
630
+ @apply focus-visible:[&::-moz-range-thumb]:shadow-[0_0_0_1.5px_var(--brand),0_0_0_5px_color-mix(in_srgb,var(--brand)_22%,transparent)];
631
+ }
632
+ /* When both handles sit at the max, the low one goes on top so it can still be dragged back. */
633
+ .asta-range-slider-top {
634
+ @apply z-10;
635
+ }
636
+
637
+ /* ---- Rating (rating.templ) ----
638
+ * <div class="asta-rating" role="radiogroup" aria-label="Rating" data-asta-rating data-value="3" data-clear>
639
+ * <input type="radio" name="stars" value="0" aria-label="No rating">
640
+ * <span class="asta-rating-star" data-asta-star data-fill="full" style="width:24px;height:24px">
641
+ * <span class="asta-rating-pop" data-asta-star-pop><svg class="asta-rating-empty">…</svg><svg class="asta-rating-full">…</svg></span>
642
+ * <label class="asta-rating-hit"><input type="radio" name="stars" value="1" aria-label="1 stars"></label></span>…
643
+ * </div>
644
+ * Half stars: two labels per star, asta-rating-hit-left (value 0.5) and asta-rating-hit-right. Read only:
645
+ * <span class="asta-rating asta-rating-static" role="img" aria-label="Rating: 4 out of 5 stars"> with stars and no inputs.
646
+ * Small: asta-rating-sm on the root and 16px stars. */
647
+ .asta-rating {
648
+ @apply inline-flex select-none items-center gap-1 rounded-md outline-none [touch-action:manipulation];
649
+ @apply has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-brand/50 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-paper;
650
+ & input {
651
+ @apply sr-only;
652
+ }
653
+ }
654
+ .asta-rating-sm {
655
+ @apply gap-0.5;
656
+ }
657
+ .asta-rating-static {
658
+ @apply rounded-none has-[:focus-visible]:ring-0;
659
+ }
660
+ .asta-rating-star {
661
+ @apply relative block shrink-0;
662
+ }
663
+ .asta-rating-pop {
664
+ @apply pointer-events-none relative block h-full w-full;
665
+ }
666
+ .asta-rating-empty {
667
+ @apply absolute inset-0 h-full w-full text-[color-mix(in_srgb,var(--ink)_13%,transparent)];
668
+ }
669
+ .asta-rating-full {
670
+ @apply absolute inset-0 h-full w-full text-brand opacity-0 transition-opacity duration-200;
671
+ [data-fill="full"] > .asta-rating-pop > & {
672
+ @apply opacity-100;
673
+ }
674
+ [data-fill="half"] > .asta-rating-pop > & {
675
+ @apply opacity-100 [clip-path:inset(0_50%_0_0)];
676
+ }
677
+ [data-preview] > .asta-rating-pop > & {
678
+ @apply text-[color-mix(in_srgb,var(--brand)_62%,transparent)];
679
+ }
680
+ }
681
+ .asta-rating-hit {
682
+ @apply absolute inset-y-0 right-0 w-full cursor-pointer;
683
+ }
684
+ .asta-rating-hit-left {
685
+ @apply absolute inset-y-0 left-0 w-1/2 cursor-pointer;
686
+ }
687
+ .asta-rating-hit-right {
688
+ @apply absolute inset-y-0 right-0 w-1/2 cursor-pointer;
689
+ }
690
+
691
+ /* ---- File upload (file_upload.templ) ----
692
+ * <div class="asta-file-upload" data-asta-upload data-accept="image/*,.pdf" data-max-size="5242880" data-max-files="4">
693
+ * <label class="asta-file-upload-zone" data-asta-upload-zone><span class="asta-file-upload-icon">svg</span>
694
+ * <span class="asta-file-upload-text"><span class="asta-file-upload-title"><span class="asta-file-upload-idle">Drop files here or <span class="asta-file-upload-browse">browse</span></span>
695
+ * <span class="asta-file-upload-over">Drop to upload</span></span><span class="asta-file-upload-hint" id="f-hint">PNG, PDF · up to 5 MB</span></span>
696
+ * <input type="file" class="asta-sr-only" name="files" multiple data-asta-upload-input></label>
697
+ * <p class="asta-file-upload-error" role="alert" hidden data-asta-upload-error>svg<span data-asta-upload-error-text></span></p>
698
+ * <ul class="asta-file-upload-list" data-asta-upload-list></ul>
699
+ * <template data-asta-upload-tpl><li class="asta-file-upload-row asta-upload-row" data-status="done">
700
+ * <span class="asta-file-upload-ext" data-ext></span><div class="asta-file-upload-body"><div class="asta-file-upload-meta">
701
+ * <p class="asta-file-upload-name" data-file-name></p><p class="asta-file-upload-size" data-file-meta></p></div>
702
+ * <div class="asta-file-upload-progress" role="progressbar"><span class="asta-file-upload-bar" data-file-bar></span></div></div>
703
+ * <button class="asta-file-upload-remove" data-asta-upload-remove>svg</button></li></template>
704
+ * </div> */
705
+ .asta-file-upload {
706
+ @apply flex w-full flex-col;
707
+ }
708
+ .asta-file-upload-zone {
709
+ @apply relative flex cursor-pointer select-none flex-col items-center justify-center gap-3 rounded-xl px-6 py-9 text-center outline-none;
710
+ @apply transition-[transform,box-shadow,background-color] duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-brand/50;
711
+ @apply bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_18%,transparent)];
712
+ @apply data-[over]:-translate-y-1 data-[over]:bg-[color-mix(in_srgb,var(--brand)_6%,var(--paper))] data-[over]:shadow-[inset_0_0_0_1.5px_var(--brand),0_14px_30px_-14px_color-mix(in_srgb,var(--brand)_55%,transparent)];
713
+ &:has(input:disabled) {
714
+ @apply pointer-events-none opacity-45;
715
+ }
716
+ }
717
+ .asta-file-upload-icon {
718
+ @apply flex h-11 w-11 items-center justify-center rounded-[10px] bg-paper text-ink-2 shadow-[0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent),0_2px_6px_-2px_rgb(0_0_0/0.12)];
719
+ @apply transition-[transform,color,box-shadow] duration-300 ease-[cubic-bezier(.16,1,.3,1)];
720
+ & > svg {
721
+ @apply h-5 w-5;
722
+ }
723
+ .asta-file-upload-zone:hover > & {
724
+ @apply -translate-y-0.5;
725
+ }
726
+ .asta-file-upload-zone[data-over] > & {
727
+ @apply -translate-y-0.5 scale-105 text-brand;
728
+ }
729
+ }
730
+ .asta-file-upload-text {
731
+ @apply block;
732
+ }
733
+ .asta-file-upload-title {
734
+ @apply block text-[14px] font-medium tracking-[-0.01em] text-ink;
735
+ }
736
+ .asta-file-upload-idle {
737
+ [data-over] & {
738
+ @apply hidden;
739
+ }
740
+ }
741
+ .asta-file-upload-browse {
742
+ @apply text-brand;
743
+ }
744
+ .asta-file-upload-over {
745
+ @apply hidden;
746
+ [data-over] & {
747
+ @apply inline;
748
+ }
749
+ }
750
+ .asta-file-upload-hint {
751
+ @apply mt-1 block text-[12.5px] text-mute;
752
+ }
753
+ .asta-file-upload-error {
754
+ @apply mt-2 flex items-start gap-1.5 text-[12.5px] leading-snug text-ink;
755
+ & > svg {
756
+ @apply mt-px h-3.5 w-3.5 shrink-0;
757
+ }
758
+ }
759
+ .asta-file-upload-list {
760
+ @apply mt-3 flex flex-col gap-1.5 empty:hidden;
761
+ }
762
+ .asta-file-upload-row {
763
+ @apply flex items-center gap-3 rounded-[10px] bg-paper p-2.5 pr-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_9%,transparent)];
764
+ }
765
+ .asta-file-upload-ext {
766
+ @apply flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-paper-2 text-[9.5px] font-semibold tracking-[0.02em] text-ink-2 transition-colors duration-300;
767
+ [data-status="done"] > & {
768
+ @apply bg-[color-mix(in_srgb,var(--brand)_10%,transparent)] text-brand;
769
+ }
770
+ }
771
+ .asta-file-upload-body {
772
+ @apply min-w-0 flex-1;
773
+ }
774
+ .asta-file-upload-meta {
775
+ @apply flex items-baseline justify-between gap-3;
776
+ }
777
+ .asta-file-upload-name {
778
+ @apply truncate text-[13px] font-medium text-ink;
779
+ }
780
+ .asta-file-upload-size {
781
+ @apply shrink-0 text-[12px] tabular-nums text-mute;
782
+ }
783
+ .asta-file-upload-progress {
784
+ @apply relative mt-1.5 h-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--ink)_8%,transparent)] transition-opacity duration-500;
785
+ [data-status="done"] & {
786
+ @apply opacity-0;
787
+ }
788
+ }
789
+ .asta-file-upload-bar {
790
+ @apply absolute inset-0 origin-left rounded-full bg-brand transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
791
+ [data-status="error"] & {
792
+ @apply bg-ink-2;
793
+ }
794
+ }
795
+ .asta-file-upload-remove {
796
+ @apply flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-mute outline-none transition-[background-color,color,transform] duration-150 hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 active:scale-90;
797
+ & > svg {
798
+ @apply h-3.5 w-3.5;
799
+ }
800
+ }
801
+
802
+ /* ---- Inline edit (inline_edit.templ) ----
803
+ * <span class="asta-inline-edit" data-asta-inline>
804
+ * <button class="asta-inline-edit-view" data-asta-inline-view aria-label="Name: Astabyte. Edit"><span class="asta-inline-edit-text" data-asta-inline-text>Astabyte</span>
805
+ * <svg class="asta-inline-edit-pencil">…</svg></button>
806
+ * <span class="asta-inline-edit-editor"><span class="asta-inline-edit-sizer" data-asta-inline-sizer aria-hidden="true">Astabyte </span>
807
+ * <input class="asta-inline-edit-input" name="name" value="Astabyte" data-asta-inline-input data-saved="Astabyte" hx-post="/rename"></span>
808
+ * <svg class="asta-inline-edit-tick hidden" data-asta-inline-tick>…</svg>
809
+ * <span class="asta-inline-edit-failed">Couldn't save</span><span class="asta-sr-only" role="status" data-asta-inline-status></span>
810
+ * </span>
811
+ * Sizes: asta-inline-edit-sm, (md), asta-inline-edit-lg. An empty value: asta-inline-edit-empty on the view. Keep the
812
+ * plain "hidden" class on the tick: asta.js toggles it. */
813
+ .asta-inline-edit {
814
+ @apply relative inline-flex max-w-full items-center gap-1.5 text-[14.5px];
815
+ }
816
+ .asta-inline-edit-sm {
817
+ @apply text-[13px];
818
+ }
819
+ .asta-inline-edit-lg {
820
+ @apply text-[20px] font-medium tracking-[-0.02em];
821
+ }
822
+ .asta-inline-edit-view {
823
+ @apply -mx-2 inline-flex min-w-0 max-w-full items-center gap-2 rounded-[7px] px-2 py-1 text-left text-ink outline-none transition-colors duration-200 hover:bg-paper-2 focus-visible:ring-2 focus-visible:ring-brand/50 disabled:pointer-events-none;
824
+ .asta-inline-edit[data-editing] > & {
825
+ @apply hidden;
826
+ }
827
+ }
828
+ .asta-inline-edit-empty {
829
+ @apply text-mute;
830
+ }
831
+ .asta-inline-edit-text {
832
+ @apply truncate;
833
+ }
834
+ .asta-inline-edit-pencil {
835
+ @apply h-[0.85em] w-[0.85em] shrink-0 -translate-x-0.5 text-mute opacity-0 transition-[opacity,translate] duration-200 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
836
+ .asta-inline-edit-view:is(:hover, :focus-visible) > & {
837
+ @apply translate-x-0 opacity-100;
838
+ }
839
+ }
840
+ .asta-inline-edit-editor {
841
+ @apply hidden min-w-[6ch] max-w-full;
842
+ .asta-inline-edit[data-editing] > & {
843
+ @apply inline-grid;
844
+ }
845
+ }
846
+ .asta-inline-edit-sizer {
847
+ @apply invisible col-start-1 row-start-1 -mx-2 whitespace-pre rounded-[7px] px-2 py-1;
848
+ }
849
+ .asta-inline-edit-input {
850
+ @apply col-start-1 row-start-1 -mx-2 w-full min-w-0 rounded-[7px] bg-paper px-2 py-1 text-ink outline-none transition-[box-shadow,opacity] duration-200 placeholder:text-mute [&.htmx-request]:opacity-60;
851
+ @apply shadow-[inset_0_0_0_1.5px_var(--brand),0_0_0_4px_color-mix(in_srgb,var(--brand)_14%,transparent)];
852
+ }
853
+ .asta-inline-edit-tick {
854
+ @apply h-[0.9em] w-[0.9em] shrink-0 text-brand;
855
+ }
856
+ .asta-inline-edit-failed {
857
+ @apply hidden shrink-0 text-[12px] text-mute;
858
+ .asta-inline-edit[data-failed][data-editing] > & {
859
+ @apply inline;
860
+ }
861
+ }