@duskmoon-dev/core 1.19.11 → 1.20.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.
@@ -4,33 +4,39 @@
4
4
  */
5
5
 
6
6
  @layer components {
7
- /* Modal Container */
8
- .modal {
7
+ /* Native HTML dialog owns visibility and modal behavior. */
8
+ dialog.modal {
9
9
  position: fixed;
10
10
  inset: 0;
11
- z-index: 999;
12
- display: flex;
13
- align-items: center;
14
- justify-content: center;
15
- padding: 1rem;
16
- visibility: hidden;
11
+ margin: auto;
12
+ padding: 0;
13
+ border: none;
14
+ width: calc(100% - 2rem);
15
+ max-width: 32rem;
16
+ max-height: calc(100dvh - 2rem);
17
+ box-sizing: border-box;
18
+ background-color: transparent;
19
+ color: var(--color-on-surface);
20
+ border-radius: var(--radius-lg);
21
+ overflow: visible;
17
22
  opacity: 0;
18
- transition: visibility 200ms ease-out, opacity 200ms ease-out;
23
+ transition: opacity 200ms ease-out, display 200ms allow-discrete, overlay 200ms allow-discrete;
19
24
  }
20
25
 
21
- /* Modal Open State */
22
- .modal.modal-open,
23
- .modal:target {
24
- visibility: visible;
26
+ dialog.modal[open] {
25
27
  opacity: 1;
26
28
  }
27
29
 
30
+ dialog.modal:not([open]) {
31
+ display: none;
32
+ }
33
+
28
34
  /* Modal Box */
29
35
  .modal-box {
30
36
  position: relative;
31
- z-index: 1;
32
- max-width: 32rem;
33
- max-height: calc(100dvh - 5rem);
37
+ width: 100%;
38
+ box-sizing: border-box;
39
+ max-height: calc(100dvh - 2rem);
34
40
  padding: 1.5rem;
35
41
  background-color: var(--color-surface);
36
42
  color: var(--color-on-surface);
@@ -41,24 +47,19 @@
41
47
  transition: transform 200ms ease-out;
42
48
  }
43
49
 
44
- .modal.modal-open .modal-box,
45
- .modal:target .modal-box {
50
+ dialog.modal[open] .modal-box {
46
51
  transform: scale(1);
47
52
  }
48
53
 
49
- /* Modal Backdrop */
50
- .modal-backdrop {
51
- position: fixed;
52
- inset: 0;
53
- z-index: -1;
54
+ /* The browser renders the backdrop in the top layer. */
55
+ dialog.modal::backdrop {
54
56
  background-color: color-mix(in srgb, var(--color-scrim) 50%, transparent);
55
- cursor: pointer;
57
+ opacity: 0;
58
+ transition: opacity 200ms ease-out, display 200ms allow-discrete, overlay 200ms allow-discrete;
56
59
  }
57
60
 
58
- .modal-backdrop::before {
59
- content: '';
60
- position: absolute;
61
- inset: 0;
61
+ dialog.modal[open]::backdrop {
62
+ opacity: 1;
62
63
  }
63
64
 
64
65
  /* Modal Action */
@@ -72,61 +73,47 @@
72
73
  padding-top: 1rem;
73
74
  }
74
75
 
75
- /* Modal Toggle (CSS-only) */
76
- .modal-toggle {
77
- position: fixed;
78
- width: 0;
79
- height: 0;
80
- appearance: none;
81
- opacity: 0;
82
- }
83
-
84
- .modal-toggle:checked + .modal {
85
- visibility: visible;
86
- opacity: 1;
87
- }
88
-
89
- .modal-toggle:checked + .modal .modal-box {
90
- transform: scale(1);
91
- }
92
-
93
76
  /* Modal Sizes */
94
- .modal-sm .modal-box {
77
+ dialog.modal.modal-sm {
95
78
  max-width: 20rem;
96
79
  }
97
80
 
98
- .modal-md .modal-box {
81
+ dialog.modal.modal-md {
99
82
  max-width: 32rem;
100
83
  }
101
84
 
102
- .modal-lg .modal-box {
85
+ dialog.modal.modal-lg {
103
86
  max-width: 48rem;
104
87
  }
105
88
 
106
- .modal-xl .modal-box {
89
+ dialog.modal.modal-xl {
107
90
  max-width: 64rem;
108
91
  }
109
92
 
110
- .modal-full .modal-box {
93
+ dialog.modal.modal-full {
111
94
  max-width: calc(100vw - 2rem);
112
- max-height: calc(100vh - 2rem);
113
- width: 100%;
95
+ max-height: calc(100dvh - 2rem);
96
+ width: calc(100% - 2rem);
97
+ height: calc(100dvh - 2rem);
98
+ }
99
+
100
+ dialog.modal.modal-full .modal-box {
114
101
  height: 100%;
115
102
  }
116
103
 
117
104
  /* Modal Positions */
118
- .modal-top {
119
- align-items: flex-start;
120
- padding-top: 2rem;
105
+ dialog.modal.modal-top {
106
+ margin-top: 2rem;
107
+ margin-bottom: auto;
121
108
  }
122
109
 
123
- .modal-bottom {
124
- align-items: flex-end;
125
- padding-bottom: 2rem;
110
+ dialog.modal.modal-bottom {
111
+ margin-top: auto;
112
+ margin-bottom: 2rem;
126
113
  }
127
114
 
128
- .modal-middle {
129
- align-items: center;
115
+ dialog.modal.modal-middle {
116
+ margin: auto;
130
117
  }
131
118
 
132
119
  /* Animation Variants */
@@ -142,22 +129,21 @@
142
129
  transform: scale(0.75);
143
130
  }
144
131
 
145
- :is(.modal-slide-up, .modal-slide-down, .modal-zoom).modal-open .modal-box,
146
- :is(.modal-slide-up, .modal-slide-down, .modal-zoom):target .modal-box {
132
+ dialog.modal:is(.modal-slide-up, .modal-slide-down, .modal-zoom)[open] .modal-box {
147
133
  transform: translateY(0) scale(1);
148
134
  }
149
135
 
150
136
  /* Backdrop Variants */
151
- .modal-backdrop-light {
137
+ dialog.modal.modal-backdrop-light::backdrop {
152
138
  background-color: color-mix(in srgb, white 80%, transparent);
153
139
  }
154
140
 
155
- .modal-backdrop-blur {
141
+ dialog.modal.modal-backdrop-blur::backdrop {
156
142
  background-color: color-mix(in srgb, var(--color-scrim) 30%, transparent);
157
143
  backdrop-filter: blur(8px);
158
144
  }
159
145
 
160
- .modal-no-backdrop {
146
+ dialog.modal.modal-no-backdrop::backdrop {
161
147
  background-color: transparent;
162
148
  }
163
149
 
@@ -227,55 +213,50 @@
227
213
 
228
214
  /* Responsive Modal */
229
215
  @media (max-width: 640px) {
230
- .modal-box {
231
- max-width: calc(100vw - 2rem);
232
- margin: 1rem;
233
- }
234
-
235
- .modal-responsive {
236
- align-items: flex-end;
237
- padding: 0;
216
+ dialog.modal.modal-responsive {
217
+ width: 100%;
218
+ max-width: 100%;
219
+ max-height: 90dvh;
220
+ margin: auto 0 0;
221
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
238
222
  }
239
223
 
240
224
  .modal-responsive .modal-box {
241
- max-width: 100%;
242
225
  max-height: 90dvh;
243
- margin: 0;
244
226
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
245
227
  }
246
228
  }
247
229
 
248
230
  /* Drawer Modal */
249
- .drawer-modal {
250
- align-items: stretch;
251
- justify-content: flex-end;
252
- padding: 0;
231
+ dialog.modal.drawer-modal {
232
+ width: min(20rem, 100%);
233
+ max-width: 20rem;
234
+ max-height: 100dvh;
235
+ height: 100dvh;
236
+ margin: 0 0 0 auto;
237
+ border-radius: 0;
253
238
  }
254
239
 
255
240
  .drawer-modal .modal-box {
256
- max-width: 20rem;
257
241
  max-height: 100dvh;
258
242
  height: 100%;
259
- margin: 0;
260
243
  border-radius: 0;
261
244
  transform: translateX(100%);
262
245
  }
263
246
 
264
- .drawer-modal.modal-open .modal-box,
265
- .drawer-modal:target .modal-box {
247
+ dialog.modal.drawer-modal[open] .modal-box {
266
248
  transform: translateX(0);
267
249
  }
268
250
 
269
- .drawer-modal-left {
270
- justify-content: flex-start;
251
+ dialog.modal.drawer-modal-left {
252
+ margin: 0 auto 0 0;
271
253
  }
272
254
 
273
255
  .drawer-modal-left .modal-box {
274
256
  transform: translateX(-100%);
275
257
  }
276
258
 
277
- .drawer-modal-left.modal-open .modal-box,
278
- .drawer-modal-left:target .modal-box {
259
+ dialog.modal.drawer-modal-left[open] .modal-box {
279
260
  transform: translateX(0);
280
261
  }
281
262
 
@@ -284,7 +265,7 @@
284
265
  text-align: center;
285
266
  }
286
267
 
287
- .alert-dialog .modal-box {
268
+ dialog.modal.alert-dialog {
288
269
  max-width: 24rem;
289
270
  }
290
271
 
@@ -323,31 +304,44 @@
323
304
  justify-content: center;
324
305
  }
325
306
 
326
- /* Reduce Motion */
327
- @media (prefers-reduced-motion: reduce) {
328
- .modal {
329
- transition: visibility 0ms, opacity 0ms;
307
+ /* Entry styles retain motion without changing native visibility. */
308
+ @starting-style {
309
+ dialog.modal[open],
310
+ dialog.modal[open]::backdrop {
311
+ opacity: 0;
330
312
  }
331
313
 
332
- .modal-box {
333
- transition: transform 0ms;
314
+ dialog.modal[open] .modal-box {
315
+ transform: scale(0.95);
334
316
  }
335
- }
336
317
 
337
- /* Focus Trap Helper */
338
- .modal-focus-trap {
339
- position: absolute;
340
- width: 1px;
341
- height: 1px;
342
- padding: 0;
343
- margin: -1px;
344
- overflow: hidden;
345
- clip: rect(0, 0, 0, 0);
346
- white-space: nowrap;
347
- border: 0;
318
+ dialog.modal.modal-slide-up[open] .modal-box {
319
+ transform: translateY(6rem) scale(0.95);
320
+ }
321
+
322
+ dialog.modal.modal-slide-down[open] .modal-box {
323
+ transform: translateY(-6rem) scale(0.95);
324
+ }
325
+
326
+ dialog.modal.modal-zoom[open] .modal-box {
327
+ transform: scale(0.75);
328
+ }
329
+
330
+ dialog.modal.drawer-modal[open] .modal-box {
331
+ transform: translateX(100%);
332
+ }
333
+
334
+ dialog.modal.drawer-modal-left[open] .modal-box {
335
+ transform: translateX(-100%);
336
+ }
348
337
  }
349
338
 
350
- body.modal-open {
351
- overflow: hidden;
339
+ /* Reduce Motion */
340
+ @media (prefers-reduced-motion: reduce) {
341
+ dialog.modal,
342
+ dialog.modal::backdrop,
343
+ .modal-box {
344
+ transition: none;
345
+ }
352
346
  }
353
347
  }
@@ -59,7 +59,7 @@ export const css = `@layer components {
59
59
  flex-direction: column;
60
60
  justify-content: center;
61
61
  align-items: center;
62
- gap: var(--chat-scroll-indicator-gap);
62
+ gap: 0;
63
63
  width: calc(
64
64
  var(--chat-scroll-indicator-active-size) * var(--chat-scroll-indicator-hover-scale)
65
65
  );
@@ -78,21 +78,33 @@ export const css = `@layer components {
78
78
  }
79
79
 
80
80
  .chat-scroll-indicator {
81
- display: block;
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
82
84
  flex-shrink: 0;
83
- width: var(--chat-scroll-indicator-size);
84
- height: var(--chat-scroll-indicator-thickness);
85
+ width: 100%;
86
+ height: calc(var(--chat-scroll-indicator-thickness) + var(--chat-scroll-indicator-gap));
85
87
  border: 0;
86
- border-radius: 999px;
87
88
  padding: 0;
89
+ margin: 0;
90
+ box-sizing: border-box;
88
91
  appearance: none;
89
- background-color: color-mix(in oklch, var(--color-on-surface) 28%, transparent);
92
+ background-color: transparent;
90
93
  color: inherit;
91
94
  font: inherit;
92
- opacity: 0.45;
93
95
  pointer-events: auto;
94
96
  text-decoration: none;
95
97
  cursor: pointer;
98
+ }
99
+
100
+ .chat-scroll-indicator::before {
101
+ content: "";
102
+ width: var(--chat-scroll-indicator-size);
103
+ height: var(--chat-scroll-indicator-thickness);
104
+ border-radius: 999px;
105
+ background-color: color-mix(in oklch, var(--color-on-surface) 28%, transparent);
106
+ opacity: 0.45;
107
+ pointer-events: none;
96
108
  transform: scaleX(1);
97
109
  transform-origin: center;
98
110
  transition:
@@ -101,15 +113,17 @@ export const css = `@layer components {
101
113
  background-color 140ms ease;
102
114
  }
103
115
 
104
- .chat-scroll-indicator:hover,
105
- .chat-scroll-indicator:focus-visible {
116
+ .chat-scroll-indicator:hover::before,
117
+ .chat-scroll-indicator:focus-visible::before {
118
+ animation: none;
106
119
  transform: scaleX(var(--chat-scroll-indicator-hover-scale)) scaleY(1.35);
107
120
  background-color: var(--color-on-surface);
108
121
  opacity: 1;
109
122
  }
110
123
 
111
- .chat-scroll-indicator:hover + .chat-scroll-indicator,
112
- .chat-scroll-indicator:has(+ .chat-scroll-indicator:hover) {
124
+ .chat-scroll-indicator:hover + .chat-scroll-indicator::before,
125
+ .chat-scroll-indicator:has(+ .chat-scroll-indicator:hover)::before {
126
+ animation: none;
113
127
  transform: scaleX(var(--chat-scroll-indicator-neighbor-scale)) scaleY(1.15);
114
128
  background-color: color-mix(in oklch, var(--color-on-surface) 55%, transparent);
115
129
  opacity: 0.75;
@@ -125,7 +139,7 @@ export const css = `@layer components {
125
139
  }
126
140
 
127
141
  @supports (animation-timeline: --chat-1) {
128
- .chat-scroll-indicator {
142
+ .chat-scroll-indicator::before {
129
143
  animation-name: chat-scroll-indicator-activate;
130
144
  animation-duration: 1ms;
131
145
  animation-timing-function: linear;
@@ -254,99 +268,99 @@ export const css = `@layer components {
254
268
  view-timeline-axis: block;
255
269
  }
256
270
 
257
- .chat-scroll-indicator[data-chat-tl="1"] {
271
+ .chat-scroll-indicator[data-chat-tl="1"]::before {
258
272
  animation-timeline: --chat-1;
259
273
  }
260
274
 
261
- .chat-scroll-indicator[data-chat-tl="2"] {
275
+ .chat-scroll-indicator[data-chat-tl="2"]::before {
262
276
  animation-timeline: --chat-2;
263
277
  }
264
278
 
265
- .chat-scroll-indicator[data-chat-tl="3"] {
279
+ .chat-scroll-indicator[data-chat-tl="3"]::before {
266
280
  animation-timeline: --chat-3;
267
281
  }
268
282
 
269
- .chat-scroll-indicator[data-chat-tl="4"] {
283
+ .chat-scroll-indicator[data-chat-tl="4"]::before {
270
284
  animation-timeline: --chat-4;
271
285
  }
272
286
 
273
- .chat-scroll-indicator[data-chat-tl="5"] {
287
+ .chat-scroll-indicator[data-chat-tl="5"]::before {
274
288
  animation-timeline: --chat-5;
275
289
  }
276
290
 
277
- .chat-scroll-indicator[data-chat-tl="6"] {
291
+ .chat-scroll-indicator[data-chat-tl="6"]::before {
278
292
  animation-timeline: --chat-6;
279
293
  }
280
294
 
281
- .chat-scroll-indicator[data-chat-tl="7"] {
295
+ .chat-scroll-indicator[data-chat-tl="7"]::before {
282
296
  animation-timeline: --chat-7;
283
297
  }
284
298
 
285
- .chat-scroll-indicator[data-chat-tl="8"] {
299
+ .chat-scroll-indicator[data-chat-tl="8"]::before {
286
300
  animation-timeline: --chat-8;
287
301
  }
288
302
 
289
- .chat-scroll-indicator[data-chat-tl="9"] {
303
+ .chat-scroll-indicator[data-chat-tl="9"]::before {
290
304
  animation-timeline: --chat-9;
291
305
  }
292
306
 
293
- .chat-scroll-indicator[data-chat-tl="10"] {
307
+ .chat-scroll-indicator[data-chat-tl="10"]::before {
294
308
  animation-timeline: --chat-10;
295
309
  }
296
310
 
297
- .chat-scroll-indicator[data-chat-tl="11"] {
311
+ .chat-scroll-indicator[data-chat-tl="11"]::before {
298
312
  animation-timeline: --chat-11;
299
313
  }
300
314
 
301
- .chat-scroll-indicator[data-chat-tl="12"] {
315
+ .chat-scroll-indicator[data-chat-tl="12"]::before {
302
316
  animation-timeline: --chat-12;
303
317
  }
304
318
 
305
- .chat-scroll-indicator[data-chat-tl="13"] {
319
+ .chat-scroll-indicator[data-chat-tl="13"]::before {
306
320
  animation-timeline: --chat-13;
307
321
  }
308
322
 
309
- .chat-scroll-indicator[data-chat-tl="14"] {
323
+ .chat-scroll-indicator[data-chat-tl="14"]::before {
310
324
  animation-timeline: --chat-14;
311
325
  }
312
326
 
313
- .chat-scroll-indicator[data-chat-tl="15"] {
327
+ .chat-scroll-indicator[data-chat-tl="15"]::before {
314
328
  animation-timeline: --chat-15;
315
329
  }
316
330
 
317
- .chat-scroll-indicator[data-chat-tl="16"] {
331
+ .chat-scroll-indicator[data-chat-tl="16"]::before {
318
332
  animation-timeline: --chat-16;
319
333
  }
320
334
 
321
- .chat-scroll-indicator[data-chat-tl="17"] {
335
+ .chat-scroll-indicator[data-chat-tl="17"]::before {
322
336
  animation-timeline: --chat-17;
323
337
  }
324
338
 
325
- .chat-scroll-indicator[data-chat-tl="18"] {
339
+ .chat-scroll-indicator[data-chat-tl="18"]::before {
326
340
  animation-timeline: --chat-18;
327
341
  }
328
342
 
329
- .chat-scroll-indicator[data-chat-tl="19"] {
343
+ .chat-scroll-indicator[data-chat-tl="19"]::before {
330
344
  animation-timeline: --chat-19;
331
345
  }
332
346
 
333
- .chat-scroll-indicator[data-chat-tl="20"] {
347
+ .chat-scroll-indicator[data-chat-tl="20"]::before {
334
348
  animation-timeline: --chat-20;
335
349
  }
336
350
 
337
- .chat-scroll-indicator[data-chat-tl="21"] {
351
+ .chat-scroll-indicator[data-chat-tl="21"]::before {
338
352
  animation-timeline: --chat-21;
339
353
  }
340
354
 
341
- .chat-scroll-indicator[data-chat-tl="22"] {
355
+ .chat-scroll-indicator[data-chat-tl="22"]::before {
342
356
  animation-timeline: --chat-22;
343
357
  }
344
358
 
345
- .chat-scroll-indicator[data-chat-tl="23"] {
359
+ .chat-scroll-indicator[data-chat-tl="23"]::before {
346
360
  animation-timeline: --chat-23;
347
361
  }
348
362
 
349
- .chat-scroll-indicator[data-chat-tl="24"] {
363
+ .chat-scroll-indicator[data-chat-tl="24"]::before {
350
364
  animation-timeline: --chat-24;
351
365
  }
352
366
 
@@ -422,6 +436,54 @@ export const css = `@layer components {
422
436
  margin-bottom: 0;
423
437
  }
424
438
 
439
+ .chat-status {
440
+ display: flex;
441
+ flex-wrap: wrap;
442
+ align-items: center;
443
+ gap: 0.25rem 0.75rem;
444
+ color: var(--color-on-surface-variant);
445
+ font-size: 0.75rem;
446
+ line-height: 1rem;
447
+ font-variant-numeric: tabular-nums;
448
+ }
449
+
450
+ .chat-status-item {
451
+ display: inline-flex;
452
+ align-items: baseline;
453
+ gap: 0.25rem;
454
+ }
455
+
456
+ .chat-status-value {
457
+ color: var(--color-on-surface);
458
+ font-weight: 500;
459
+ }
460
+
461
+ .chat-actions {
462
+ display: flex;
463
+ flex-wrap: wrap;
464
+ align-items: center;
465
+ gap: 0.25rem;
466
+ }
467
+
468
+ .chat-actions-hover {
469
+ opacity: 0;
470
+ pointer-events: none;
471
+ transition: opacity 140ms ease;
472
+ }
473
+
474
+ .chat:hover .chat-actions-hover,
475
+ .chat:focus-within .chat-actions-hover {
476
+ opacity: 1;
477
+ pointer-events: auto;
478
+ }
479
+
480
+ @media (hover: none) {
481
+ .chat-actions-hover {
482
+ opacity: 1;
483
+ pointer-events: auto;
484
+ }
485
+ }
486
+
425
487
  .chat-bubble {
426
488
  --chat-bubble-bg: var(--color-surface-container-highest);
427
489
  --chat-bubble-fg: var(--color-on-surface);
@@ -438,7 +500,6 @@ export const css = `@layer components {
438
500
  border-radius: 1rem;
439
501
  background-color: var(--chat-bubble-bg);
440
502
  color: var(--chat-bubble-fg);
441
- box-shadow: inset 0 0 0 1px var(--color-outline-variant);
442
503
  font-size: 0.875rem;
443
504
  line-height: 1.45;
444
505
  overflow-wrap: anywhere;
@@ -455,11 +516,11 @@ export const css = `@layer components {
455
516
  .chat-end .chat-bubble::before {
456
517
  content: "";
457
518
  position: absolute;
458
- inset-block-start: 0;
519
+ inset-block-end: 0;
459
520
  inline-size: 0.75rem;
460
- block-size: 1rem;
521
+ block-size: 0.75rem;
461
522
  background-color: var(--chat-bubble-bg);
462
- mask-image: radial-gradient(ellipse at 0 100%, transparent 68%, black 72%);
523
+ mask-image: radial-gradient(ellipse at 0 0, transparent 68%, black 72%);
463
524
  pointer-events: none;
464
525
  }
465
526
 
@@ -468,7 +529,7 @@ export const css = `@layer components {
468
529
  }
469
530
 
470
531
  .chat-start .chat-bubble {
471
- border-start-start-radius: 0;
532
+ border-end-start-radius: 0;
472
533
  }
473
534
 
474
535
  .chat-end .chat-bubble::before {
@@ -477,7 +538,7 @@ export const css = `@layer components {
477
538
  }
478
539
 
479
540
  .chat-end .chat-bubble {
480
- border-start-end-radius: 0;
541
+ border-end-end-radius: 0;
481
542
  }
482
543
 
483
544
  .chat-start:dir(rtl) .chat-bubble::before { transform: scaleX(-1); }
@@ -818,11 +879,15 @@ export const css = `@layer components {
818
879
  scroll-behavior: auto;
819
880
  }
820
881
 
821
- .chat-scroll-indicator {
882
+ .chat-scroll-indicator::before {
822
883
  animation: none;
823
884
  transition: none;
824
885
  }
825
886
 
887
+ .chat-actions-hover {
888
+ transition: none;
889
+ }
890
+
826
891
  .chat-typing::before,
827
892
  .chat-typing::after,
828
893
  .chat-typing span,