@atelier-ui/styles 0.3.5

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,516 @@
1
+ /* Geometry contract: every size this component states is a border-box size.
2
+ * Declared with the component rather than as a global reset, so it ships in the
3
+ * same file as the sizes it governs and no consuming app has to supply one.
4
+ * Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
5
+ * See ADR-0043. */
6
+ :is(
7
+ .atl-chat,
8
+ .atl-chat-header,
9
+ .atl-chat-input,
10
+ .atl-chat-message,
11
+ .atl-chat-messages,
12
+ .atl-chat-suggestion,
13
+ .atl-chat-typing
14
+ ),
15
+ :is(
16
+ .atl-chat,
17
+ .atl-chat-header,
18
+ .atl-chat-input,
19
+ .atl-chat-message,
20
+ .atl-chat-messages,
21
+ .atl-chat-suggestion,
22
+ .atl-chat-typing
23
+ )
24
+ * {
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ /* ── Host wrapper ──────────────────────────────────────────────────────────── */
29
+ .atl-chat {
30
+ /* The library states its own typeface (ADR-0035). Without this the component
31
+ * renders in the consuming app's font while its neighbours render Instrument
32
+ * Sans — measured: a card next to a button showed two typefaces. Declared once
33
+ * per component root, never on a descendant (ADR-0049). */
34
+ font-family: var(--ui-font-family);
35
+ /* The leading every descendant inherits. Stated here so the component keeps
36
+ its own vertical rhythm instead of adopting the consuming app's prose
37
+ leading — the defect that made the row boxes measure differently in a
38
+ Storybook page and in a docs page (ADR-0052). This one carries prose, so normal. */
39
+ line-height: var(--ui-line-height-normal);
40
+ display: contents;
41
+ }
42
+
43
+ /* ── Shared surface (header / messages / input column) ─────────────────────── */
44
+ .atl-chat > .surface,
45
+ .atl-chat > dialog > .surface {
46
+ display: flex;
47
+ flex-direction: column;
48
+ background: var(--ui-color-surface);
49
+ color: var(--ui-color-text);
50
+ overflow: hidden;
51
+ }
52
+
53
+ /* ═══════════════════════════════════════════════════════════════════════════ */
54
+ /* DRAWER variant */
55
+ /* ═══════════════════════════════════════════════════════════════════════════ */
56
+ .atl-chat.variant-drawer > dialog {
57
+ all: unset;
58
+ /* Restated after `all: unset`, which resets the box model too — the component's
59
+ * geometry contract has the same specificity and loses on source order, so this
60
+ * element was content-box and 2px taller than its own CSS said (ADR-0051). */
61
+ box-sizing: border-box;
62
+ /* After `all: unset`, which would otherwise reset it (ADR-0049). */
63
+ font-family: var(--ui-font-family);
64
+ position: fixed;
65
+ inset: 0 0 0 auto;
66
+ height: 100dvh;
67
+ width: 28rem;
68
+ display: none;
69
+ flex-direction: column;
70
+ background: var(--ui-color-surface);
71
+ box-shadow: var(--ui-shadow-xl, -8px 0 32px rgba(0, 0, 0, 0.12));
72
+ color: var(--ui-color-text);
73
+ overflow: hidden;
74
+ transform: translateX(100%);
75
+ transition:
76
+ transform var(--ui-duration-slow) var(--ui-ease-out, ease-out),
77
+ display var(--ui-duration-slow) allow-discrete,
78
+ overlay var(--ui-duration-slow) allow-discrete;
79
+ }
80
+
81
+ .atl-chat.variant-drawer > dialog[open] {
82
+ display: flex;
83
+ transform: translateX(0);
84
+ }
85
+
86
+ @starting-style {
87
+ .atl-chat.variant-drawer > dialog[open] {
88
+ transform: translateX(100%);
89
+ }
90
+ }
91
+
92
+ .atl-chat.variant-drawer > dialog::backdrop {
93
+ background: var(--ui-color-overlay);
94
+ backdrop-filter: blur(2px);
95
+ transition:
96
+ opacity var(--ui-duration-slow) var(--ui-ease-out, ease-out),
97
+ display var(--ui-duration-slow) allow-discrete,
98
+ overlay var(--ui-duration-slow) allow-discrete;
99
+ }
100
+
101
+ .atl-chat.variant-drawer > dialog > .drawer-surface {
102
+ width: 100%;
103
+ height: 100%;
104
+ }
105
+
106
+ /* ═══════════════════════════════════════════════════════════════════════════ */
107
+ /* POPUP variant */
108
+ /* ═══════════════════════════════════════════════════════════════════════════ */
109
+ .atl-chat.variant-popup > .popup-surface {
110
+ position: fixed;
111
+ bottom: calc(var(--ui-spacing-6) + 3.5rem + var(--ui-spacing-4));
112
+ right: var(--ui-spacing-6);
113
+ width: 23.75rem;
114
+ height: 35rem;
115
+ border-radius: var(--ui-radius-xl);
116
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
117
+ z-index: var(--ui-z-dropdown);
118
+ }
119
+
120
+ .atl-chat.variant-popup > .fab-bubble {
121
+ position: fixed;
122
+ bottom: var(--ui-spacing-6);
123
+ right: var(--ui-spacing-6);
124
+ width: 3.5rem;
125
+ height: 3.5rem;
126
+ border-radius: var(--ui-radius-full);
127
+ background: var(--ui-color-brand-ai, #b5e61c);
128
+ color: var(--ui-color-text);
129
+ border: none;
130
+ font-size: var(--ui-font-size-lg);
131
+ font-weight: var(--ui-font-weight-semibold);
132
+ cursor: pointer;
133
+ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
134
+ transition:
135
+ transform var(--ui-transition-fast),
136
+ box-shadow var(--ui-transition-fast);
137
+ z-index: 101;
138
+ }
139
+
140
+ .atl-chat.variant-popup > .fab-bubble:hover {
141
+ transform: scale(1.05);
142
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
143
+ }
144
+
145
+ .atl-chat.variant-popup > .fab-bubble:focus-visible {
146
+ outline: none;
147
+ box-shadow:
148
+ var(--ui-focus-ring),
149
+ 0 6px 16px rgba(0, 0, 0, 0.18);
150
+ }
151
+
152
+ /* ═══════════════════════════════════════════════════════════════════════════ */
153
+ /* INLINE variant */
154
+ /* ═══════════════════════════════════════════════════════════════════════════ */
155
+ .atl-chat.variant-inline > .inline-surface {
156
+ width: 100%;
157
+ height: 100%;
158
+ min-height: 24rem;
159
+ border: var(--ui-border-width) solid var(--ui-color-border);
160
+ border-radius: var(--ui-radius-xl);
161
+ }
162
+
163
+ .atl-chat.variant-inline .atl-chat-header > .close-btn {
164
+ display: none;
165
+ }
166
+
167
+ /* ═══════════════════════════════════════════════════════════════════════════ */
168
+ /* SUB-COMPONENT: header */
169
+ /* ═══════════════════════════════════════════════════════════════════════════ */
170
+ .atl-chat-header {
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: space-between;
174
+ gap: var(--ui-spacing-3);
175
+ padding: var(--ui-spacing-3) var(--ui-spacing-4);
176
+ border-bottom: var(--ui-border-width) solid var(--ui-color-border);
177
+ flex-shrink: 0;
178
+ }
179
+
180
+ .atl-chat-header > .title-block {
181
+ display: flex;
182
+ align-items: center;
183
+ gap: var(--ui-spacing-3);
184
+ font-size: var(--ui-font-size-md);
185
+ font-weight: var(--ui-font-weight-semibold);
186
+ color: var(--ui-color-text);
187
+ letter-spacing: var(--ui-letter-spacing-tight);
188
+ flex: 1;
189
+ min-width: 0;
190
+ }
191
+
192
+ .atl-chat-header > .close-btn {
193
+ display: inline-flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ flex-shrink: 0;
197
+ width: var(--ui-control-height-sm);
198
+ height: var(--ui-control-height-sm);
199
+ padding: 0;
200
+ /* Stated, not left to the cascade. The header spaces its children with `gap`,
201
+ * so the button has no margin of its own and no leading override. React and Vue
202
+ * used to pick up `margin-left: var(--ui-spacing-3)` and `line-height: 1` from
203
+ * the global `.close-btn` of drawer's stylesheet (and dialog's, before it was
204
+ * rooted); this rule beats it on specificity and keeps chat identical whether or
205
+ * not that leak is still there. Every other declaration the leak carried (the
206
+ * hover background, the focus outline and ring) is stated below. */
207
+ margin-left: 0;
208
+ line-height: normal;
209
+ background: transparent;
210
+ border: var(--ui-border-width) solid var(--ui-color-border);
211
+ border-radius: var(--ui-radius-sm);
212
+ cursor: pointer;
213
+ color: var(--ui-color-text-muted);
214
+ transition:
215
+ background-color var(--ui-transition-fast),
216
+ color var(--ui-transition-fast);
217
+ }
218
+
219
+ .atl-chat-header > .close-btn:hover {
220
+ background-color: var(--ui-color-surface-sunken);
221
+ color: var(--ui-color-text);
222
+ }
223
+
224
+ .atl-chat-header > .close-btn:focus-visible {
225
+ outline: none;
226
+ box-shadow: var(--ui-focus-ring);
227
+ }
228
+
229
+ /* ═══════════════════════════════════════════════════════════════════════════ */
230
+ /* SUB-COMPONENT: messages */
231
+ /* ═══════════════════════════════════════════════════════════════════════════ */
232
+ .atl-chat-messages {
233
+ display: flex;
234
+ flex-direction: column;
235
+ gap: var(--ui-spacing-3);
236
+ padding: var(--ui-spacing-4);
237
+ overflow-y: auto;
238
+ overflow-anchor: auto;
239
+ scroll-behavior: smooth;
240
+ flex: 1;
241
+ background: var(--ui-color-surface);
242
+ }
243
+
244
+ /* The role="list" wrapper the log's listitems need (a node has one role, so it
245
+ can't be the log root itself) — display:contents keeps it invisible to the
246
+ flex/gap layout above, so the messages still lay out as if it were absent. */
247
+ .atl-chat-messages > .messages-list {
248
+ display: contents;
249
+ }
250
+
251
+ /* ═══════════════════════════════════════════════════════════════════════════ */
252
+ /* SUB-COMPONENT: message bubble */
253
+ /* ═══════════════════════════════════════════════════════════════════════════ */
254
+ .atl-chat-message {
255
+ display: block;
256
+ max-width: 85%;
257
+ padding: var(--ui-spacing-3) var(--ui-spacing-4);
258
+ border-radius: var(--ui-radius-lg);
259
+ font-size: var(--ui-font-size-sm);
260
+ line-height: var(--ui-line-height-normal);
261
+ word-wrap: break-word;
262
+ }
263
+
264
+ .atl-chat-message.role-assistant,
265
+ .atl-chat-message.role-system {
266
+ background: var(--ui-color-surface-sunken);
267
+ color: var(--ui-color-text);
268
+ align-self: flex-start;
269
+ }
270
+
271
+ .atl-chat-message.role-user {
272
+ background: var(--ui-color-primary);
273
+ color: var(--ui-color-text-on-primary);
274
+ align-self: flex-end;
275
+ }
276
+
277
+ .atl-chat-message.role-system {
278
+ font-style: italic;
279
+ color: var(--ui-color-text-muted);
280
+ }
281
+
282
+ .atl-chat-message.is-failed {
283
+ background: var(--ui-color-surface-sunken);
284
+ border: var(--ui-border-width) dashed var(--ui-color-danger);
285
+ color: var(--ui-color-text);
286
+ }
287
+
288
+ /* ═══════════════════════════════════════════════════════════════════════════ */
289
+ /* SUB-COMPONENT: typing indicator */
290
+ /* ═══════════════════════════════════════════════════════════════════════════ */
291
+ .atl-chat-typing {
292
+ display: inline-flex;
293
+ align-items: center;
294
+ gap: var(--ui-spacing-1);
295
+ padding: var(--ui-spacing-2) var(--ui-spacing-3);
296
+ background: var(--ui-color-surface-sunken);
297
+ border-radius: var(--ui-radius-lg);
298
+ align-self: flex-start;
299
+ }
300
+
301
+ .atl-chat-typing > .dot {
302
+ width: 0.375rem;
303
+ height: 0.375rem;
304
+ border-radius: 50%;
305
+ background: var(--ui-color-text-muted);
306
+ animation: atl-chat-typing 1.4s infinite ease-in-out;
307
+ }
308
+
309
+ .atl-chat-typing > .dot:nth-child(2) {
310
+ animation-delay: 0.16s;
311
+ }
312
+
313
+ .atl-chat-typing > .dot:nth-child(3) {
314
+ animation-delay: 0.32s;
315
+ }
316
+
317
+ /* Inline cursor variant — drops the bubble chrome so the dots can sit at the
318
+ end of a streaming assistant message. */
319
+ .atl-chat-typing.is-inline {
320
+ display: inline-flex;
321
+ padding: 0;
322
+ margin-left: var(--ui-spacing-1);
323
+ background: transparent;
324
+ border-radius: 0;
325
+ vertical-align: baseline;
326
+ align-self: auto;
327
+ }
328
+
329
+ .atl-chat-typing.is-inline > .dot {
330
+ width: 0.25rem;
331
+ height: 0.25rem;
332
+ }
333
+
334
+ @keyframes atl-chat-typing {
335
+ 0%,
336
+ 60%,
337
+ 100% {
338
+ opacity: 0.3;
339
+ transform: translateY(0);
340
+ }
341
+ 30% {
342
+ opacity: 1;
343
+ transform: translateY(-2px);
344
+ }
345
+ }
346
+
347
+ @media (prefers-reduced-motion: reduce) {
348
+ .atl-chat-typing > .dot {
349
+ animation: none;
350
+ opacity: 0.6;
351
+ }
352
+ }
353
+
354
+ .atl-chat-typing > .sr-only {
355
+ position: absolute;
356
+ width: 1px;
357
+ height: 1px;
358
+ padding: 0;
359
+ margin: -1px;
360
+ overflow: hidden;
361
+ clip: rect(0, 0, 0, 0);
362
+ white-space: nowrap;
363
+ border: 0;
364
+ }
365
+
366
+ /* ═══════════════════════════════════════════════════════════════════════════ */
367
+ /* SUB-COMPONENT: suggestion chip */
368
+ /* ═══════════════════════════════════════════════════════════════════════════ */
369
+ .atl-chat-suggestion {
370
+ display: block;
371
+ }
372
+
373
+ .atl-chat-suggestion > .chip {
374
+ display: flex;
375
+ flex-direction: column;
376
+ align-items: flex-start;
377
+ gap: var(--ui-spacing-1);
378
+ width: 100%;
379
+ padding: var(--ui-spacing-3) var(--ui-spacing-4);
380
+ background: var(--ui-color-surface);
381
+ color: var(--ui-color-text);
382
+ border: var(--ui-border-width) solid var(--ui-color-border);
383
+ border-radius: var(--ui-radius-lg);
384
+ text-align: left;
385
+ cursor: pointer;
386
+ transition:
387
+ background-color var(--ui-transition-fast),
388
+ border-color var(--ui-transition-fast);
389
+ }
390
+
391
+ .atl-chat-suggestion > .chip:hover {
392
+ background-color: var(--ui-color-surface-sunken);
393
+ border-color: var(--ui-color-border-hover);
394
+ }
395
+
396
+ .atl-chat-suggestion > .chip:focus-visible {
397
+ outline: none;
398
+ box-shadow: var(--ui-focus-ring);
399
+ }
400
+
401
+ .atl-chat-suggestion > .chip > .chip-label {
402
+ font-size: var(--ui-font-size-sm);
403
+ font-weight: var(--ui-font-weight-medium);
404
+ color: var(--ui-color-text);
405
+ }
406
+
407
+ .atl-chat-suggestion > .chip > .chip-hint {
408
+ font-size: var(--ui-font-size-xs);
409
+ color: var(--ui-color-text-muted);
410
+ }
411
+
412
+ /* ═══════════════════════════════════════════════════════════════════════════ */
413
+ /* SUB-COMPONENT: input footer */
414
+ /* ═══════════════════════════════════════════════════════════════════════════ */
415
+ .atl-chat-input {
416
+ display: flex;
417
+ align-items: flex-end;
418
+ gap: var(--ui-spacing-2);
419
+ padding: var(--ui-spacing-3) var(--ui-spacing-4);
420
+ border-top: var(--ui-border-width) solid var(--ui-color-border);
421
+ background: var(--ui-color-surface);
422
+ flex-shrink: 0;
423
+ }
424
+
425
+ .atl-chat-input > .field {
426
+ flex: 1;
427
+ min-width: 0;
428
+ padding: var(--ui-spacing-2) var(--ui-spacing-3);
429
+ border: var(--ui-border-width) solid
430
+ var(--ui-color-input-border, var(--ui-color-border));
431
+ border-radius: var(--ui-radius-md);
432
+ background: var(--ui-color-surface-sunken);
433
+ color: var(--ui-color-text);
434
+ font-size: var(--ui-font-size-sm);
435
+ line-height: var(--ui-line-height-normal);
436
+ resize: none;
437
+ transition: border-color var(--ui-transition-fast);
438
+ }
439
+
440
+ .atl-chat-input > .field::placeholder {
441
+ color: var(--ui-color-text-muted);
442
+ }
443
+
444
+ .atl-chat-input > .field:hover:not(:disabled) {
445
+ border-color: var(
446
+ --ui-color-input-border-hover,
447
+ var(--ui-color-border-hover)
448
+ );
449
+ }
450
+
451
+ .atl-chat-input > .field:focus-visible {
452
+ outline: none;
453
+ border-color: var(--ui-color-primary);
454
+ box-shadow: var(--ui-focus-ring);
455
+ }
456
+
457
+ .atl-chat-input > .field:disabled {
458
+ opacity: var(--ui-opacity-disabled);
459
+ cursor: not-allowed;
460
+ }
461
+
462
+ .atl-chat-input > .action-btn {
463
+ display: inline-flex;
464
+ align-items: center;
465
+ justify-content: center;
466
+ flex-shrink: 0;
467
+ padding: var(--ui-spacing-2) var(--ui-spacing-4);
468
+ border: var(--ui-border-width) solid transparent;
469
+ border-radius: var(--ui-radius-md);
470
+ font-size: var(--ui-font-size-sm);
471
+ font-weight: var(--ui-font-weight-medium);
472
+ cursor: pointer;
473
+ transition:
474
+ background-color var(--ui-transition-fast),
475
+ border-color var(--ui-transition-fast),
476
+ transform var(--ui-transition-fast);
477
+ }
478
+
479
+ .atl-chat-input > .action-btn.variant-primary {
480
+ background: var(--ui-color-primary);
481
+ color: var(--ui-color-text-on-primary);
482
+ border-color: var(--ui-color-primary);
483
+ }
484
+
485
+ .atl-chat-input > .action-btn.variant-primary:hover:not(:disabled) {
486
+ background: var(--ui-color-primary-hover);
487
+ border-color: var(--ui-color-primary-hover);
488
+ }
489
+
490
+ .atl-chat-input > .action-btn.variant-danger {
491
+ background: var(--ui-color-danger);
492
+ color: var(--ui-color-text-on-danger);
493
+ border-color: var(--ui-color-danger);
494
+ }
495
+
496
+ .atl-chat-input > .action-btn.variant-danger:hover {
497
+ background: var(--ui-color-danger-hover);
498
+ border-color: var(--ui-color-danger-hover);
499
+ }
500
+
501
+ .atl-chat-input > .action-btn:disabled {
502
+ opacity: var(--ui-opacity-disabled);
503
+ cursor: not-allowed;
504
+ }
505
+
506
+ .atl-chat-input > .action-btn:focus-visible {
507
+ outline: none;
508
+ box-shadow: var(--ui-focus-ring);
509
+ }
510
+
511
+ /* ═══════════════════════════════════════════════════════════════════════════ */
512
+ /* STATUS-aware tweaks */
513
+ /* ═══════════════════════════════════════════════════════════════════════════ */
514
+ .atl-chat.status-streaming .atl-chat-input > .field {
515
+ cursor: wait;
516
+ }
@@ -0,0 +1,160 @@
1
+ /* Geometry contract: every size this component states is a border-box size.
2
+ * Declared with the component rather than as a global reset, so it ships in the
3
+ * same file as the sizes it governs and no consuming app has to supply one.
4
+ * Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
5
+ * See ADR-0043. */
6
+ .atl-checkbox,
7
+ .atl-checkbox * {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .atl-checkbox {
12
+ display: block;
13
+ font-family: var(--ui-font-family);
14
+ font-size: var(--ui-font-size-md);
15
+ /* The root is a block wrapping an inline-flex row, so it opens a line box and
16
+ its strut is sized by whatever leading it inherits. Without this the row is
17
+ 40px here and 48px inside an app with roomy prose leading. */
18
+ line-height: var(--ui-line-height-tight);
19
+ }
20
+
21
+ .atl-checkbox > label {
22
+ display: inline-flex;
23
+ align-items: center;
24
+ gap: var(--ui-spacing-3);
25
+ cursor: pointer;
26
+ user-select: none;
27
+ color: var(--ui-color-text);
28
+ /* Row recipe (ADR-0052): the clickable line is a row — it states its height
29
+ and centres the control + text, rather than being sized by whichever of
30
+ the two happens to be taller. */
31
+ min-height: var(--ui-row-height-sm);
32
+ padding-block: 0;
33
+ line-height: var(--ui-line-height-tight);
34
+ }
35
+
36
+ .atl-checkbox > label > input[type='checkbox'] {
37
+ appearance: none;
38
+ -webkit-appearance: none;
39
+ flex-shrink: 0;
40
+ /* The UA ships margin: 3px 3px 3px 4px on a native checkbox. Left in, it
41
+ adds 6px to the row and offsets the box from the label text. */
42
+ margin: 0;
43
+ width: 1.25rem;
44
+ height: 1.25rem;
45
+ border: var(--ui-border-width-thick) solid var(--ui-color-border-strong);
46
+ border-radius: var(--ui-radius-sm);
47
+ background-color: var(--ui-color-input-bg);
48
+ cursor: pointer;
49
+ position: relative;
50
+ transition:
51
+ border-color var(--ui-transition-fast),
52
+ background-color var(--ui-transition-fast),
53
+ box-shadow var(--ui-transition-fast);
54
+ outline: none;
55
+ }
56
+
57
+ .atl-checkbox > label > input[type='checkbox']:hover:not(:disabled) {
58
+ border-color: var(--ui-color-primary);
59
+ background-color: var(--ui-color-primary-light);
60
+ }
61
+
62
+ .atl-checkbox > label > input[type='checkbox']:focus-visible {
63
+ box-shadow: var(--ui-focus-ring);
64
+ border-color: var(--ui-color-primary);
65
+ }
66
+
67
+ /* Checked state */
68
+ .atl-checkbox > label > input[type='checkbox']:checked {
69
+ background-color: var(--ui-color-primary);
70
+ border-color: var(--ui-color-primary);
71
+ }
72
+
73
+ .atl-checkbox > label > input[type='checkbox']:checked::after {
74
+ content: '';
75
+ position: absolute;
76
+ inset: 0;
77
+ margin: auto;
78
+ width: 0.35rem;
79
+ height: 0.6rem;
80
+ border: var(--ui-border-width-thick) solid var(--ui-color-text-on-primary);
81
+ border-top: none;
82
+ border-left: none;
83
+ transform: rotate(45deg) translate(-1px, -1px);
84
+ animation: atl-checkbox-check-pop var(--ui-duration-normal)
85
+ var(--ui-ease-spring);
86
+ }
87
+
88
+ /* Indeterminate state */
89
+ .atl-checkbox > label > input[type='checkbox']:indeterminate {
90
+ background-color: var(--ui-color-primary);
91
+ border-color: var(--ui-color-primary);
92
+ }
93
+
94
+ .atl-checkbox > label > input[type='checkbox']:indeterminate::after {
95
+ content: '';
96
+ position: absolute;
97
+ inset: 0;
98
+ margin: auto;
99
+ width: 0.5rem;
100
+ height: 2px;
101
+ background-color: var(--ui-color-text-on-primary);
102
+ animation: atl-checkbox-check-pop var(--ui-duration-normal)
103
+ var(--ui-ease-spring);
104
+ }
105
+
106
+ /* Invalid state */
107
+ .atl-checkbox.is-invalid > label > input[type='checkbox'] {
108
+ border-color: var(--ui-color-input-border-invalid);
109
+ }
110
+
111
+ /* Hover must not repaint an invalid border. The hover rule above out-ranks the
112
+ invalid rule on specificity (it carries :hover and :not()), so without this
113
+ a hovered invalid checkbox would turn primary. */
114
+ .atl-checkbox.is-invalid > label > input[type='checkbox']:hover:not(:disabled) {
115
+ border-color: var(--ui-color-input-border-invalid);
116
+ }
117
+
118
+ .atl-checkbox.is-invalid > label > input[type='checkbox']:focus-visible {
119
+ border-color: var(--ui-color-input-border-invalid);
120
+ box-shadow: var(--ui-focus-ring-danger);
121
+ }
122
+
123
+ /* Disabled state */
124
+ .atl-checkbox.is-disabled {
125
+ opacity: var(--ui-opacity-disabled);
126
+ cursor: not-allowed;
127
+ }
128
+
129
+ .atl-checkbox.is-disabled > label {
130
+ cursor: not-allowed;
131
+ }
132
+
133
+ .atl-checkbox.is-disabled > label > input[type='checkbox'] {
134
+ cursor: not-allowed;
135
+ }
136
+
137
+ /* Error messages */
138
+ .atl-checkbox > .errors {
139
+ margin-top: var(--ui-spacing-2);
140
+ }
141
+
142
+ .atl-checkbox > .errors > .error-message {
143
+ margin: 0;
144
+ font-size: var(--ui-font-size-sm);
145
+ color: var(--ui-color-error-text);
146
+ line-height: var(--ui-line-height-normal);
147
+ }
148
+
149
+ /* Animation */
150
+ @keyframes atl-checkbox-check-pop {
151
+ 0% {
152
+ transform: rotate(45deg) translate(-1px, -1px) scale(0);
153
+ }
154
+ 60% {
155
+ transform: rotate(45deg) translate(-1px, -1px) scale(1.15);
156
+ }
157
+ 100% {
158
+ transform: rotate(45deg) translate(-1px, -1px) scale(1);
159
+ }
160
+ }