@duskmoon-dev/core 1.4.0 → 1.6.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.
@@ -35,6 +35,72 @@
35
35
  transform: scale(1);
36
36
  }
37
37
 
38
+ /* Direct popover structure (without .popover-content wrapper) */
39
+ .popover.popover-show,
40
+ .popover.show {
41
+ opacity: 1;
42
+ visibility: visible;
43
+ }
44
+
45
+ /* Popover as direct overlay (simpler structure) */
46
+ .popover[class*="popover-top"],
47
+ .popover[class*="popover-bottom"],
48
+ .popover[class*="popover-left"],
49
+ .popover[class*="popover-right"] {
50
+ position: absolute;
51
+ z-index: 1050;
52
+ min-width: 12rem;
53
+ max-width: 20rem;
54
+ padding: 1rem;
55
+ background-color: var(--color-surface);
56
+ border: 1px solid var(--color-outline-variant);
57
+ border-radius: 0.75rem;
58
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
59
+ opacity: 0;
60
+ visibility: hidden;
61
+ transition: opacity 150ms ease-out, visibility 150ms ease-out;
62
+ }
63
+
64
+ .popover[class*="popover-top"].popover-show,
65
+ .popover[class*="popover-bottom"].popover-show,
66
+ .popover[class*="popover-left"].popover-show,
67
+ .popover[class*="popover-right"].popover-show {
68
+ opacity: 1;
69
+ visibility: visible;
70
+ }
71
+
72
+ /* Direct position: Top */
73
+ .popover.popover-top:not(:has(.popover-content)) {
74
+ bottom: 100%;
75
+ left: 50%;
76
+ transform: translateX(-50%);
77
+ margin-bottom: 0.75rem;
78
+ }
79
+
80
+ /* Direct position: Bottom */
81
+ .popover.popover-bottom:not(:has(.popover-content)) {
82
+ top: 100%;
83
+ left: 50%;
84
+ transform: translateX(-50%);
85
+ margin-top: 0.75rem;
86
+ }
87
+
88
+ /* Direct position: Left */
89
+ .popover.popover-left:not(:has(.popover-content)) {
90
+ right: 100%;
91
+ top: 50%;
92
+ transform: translateY(-50%);
93
+ margin-right: 0.75rem;
94
+ }
95
+
96
+ /* Direct position: Right */
97
+ .popover.popover-right:not(:has(.popover-content)) {
98
+ left: 100%;
99
+ top: 50%;
100
+ transform: translateY(-50%);
101
+ margin-left: 0.75rem;
102
+ }
103
+
38
104
  /* Popover Arrow */
39
105
  .popover-arrow {
40
106
  position: absolute;
@@ -211,12 +277,33 @@
211
277
  }
212
278
 
213
279
  /* Color Variants */
280
+ /*
281
+ * Color intensity for themed popovers.
282
+ * Override this variable to adjust how strongly colors appear:
283
+ * - 20% = subtle tint
284
+ * - 30% = moderate (default)
285
+ * - 40% = bold/prominent
286
+ */
287
+ .popover {
288
+ --popover-color-intensity: 30%;
289
+ }
290
+
291
+ /* Dark variant */
214
292
  .popover-dark .popover-content {
215
293
  background-color: var(--color-on-surface);
216
294
  color: var(--color-surface);
217
295
  border-color: transparent;
218
296
  }
219
297
 
298
+ .popover-dark[class*="popover-top"],
299
+ .popover-dark[class*="popover-bottom"],
300
+ .popover-dark[class*="popover-left"],
301
+ .popover-dark[class*="popover-right"] {
302
+ background-color: var(--color-on-surface);
303
+ color: var(--color-surface);
304
+ border-color: transparent;
305
+ }
306
+
220
307
  .popover-dark .popover-arrow {
221
308
  background-color: var(--color-on-surface);
222
309
  border-color: transparent;
@@ -231,16 +318,106 @@
231
318
  opacity: 0.9;
232
319
  }
233
320
 
321
+ /* Primary variant */
234
322
  .popover-primary .popover-content {
235
- background-color: var(--color-primary-container);
323
+ background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
324
+ border-color: var(--color-primary);
325
+ }
326
+
327
+ .popover-primary[class*="popover-top"],
328
+ .popover-primary[class*="popover-bottom"],
329
+ .popover-primary[class*="popover-left"],
330
+ .popover-primary[class*="popover-right"] {
331
+ background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
236
332
  border-color: var(--color-primary);
237
333
  }
238
334
 
239
335
  .popover-primary .popover-arrow {
240
- background-color: var(--color-primary-container);
336
+ background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
241
337
  border-color: var(--color-primary);
242
338
  }
243
339
 
340
+ .popover-primary .popover-body {
341
+ color: var(--color-on-surface);
342
+ }
343
+
344
+ .popover-primary .popover-title {
345
+ color: var(--color-on-surface);
346
+ }
347
+
348
+ /* Secondary variant */
349
+ .popover-secondary .popover-content {
350
+ background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
351
+ border-color: var(--color-secondary);
352
+ }
353
+
354
+ .popover-secondary[class*="popover-top"],
355
+ .popover-secondary[class*="popover-bottom"],
356
+ .popover-secondary[class*="popover-left"],
357
+ .popover-secondary[class*="popover-right"] {
358
+ background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
359
+ border-color: var(--color-secondary);
360
+ }
361
+
362
+ .popover-secondary .popover-arrow {
363
+ background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
364
+ border-color: var(--color-secondary);
365
+ }
366
+
367
+ .popover-secondary .popover-body {
368
+ color: var(--color-on-surface);
369
+ }
370
+
371
+ .popover-secondary .popover-title {
372
+ color: var(--color-on-surface);
373
+ }
374
+
375
+ /* Tertiary variant */
376
+ .popover-tertiary .popover-content {
377
+ background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
378
+ border-color: var(--color-tertiary);
379
+ }
380
+
381
+ .popover-tertiary[class*="popover-top"],
382
+ .popover-tertiary[class*="popover-bottom"],
383
+ .popover-tertiary[class*="popover-left"],
384
+ .popover-tertiary[class*="popover-right"] {
385
+ background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
386
+ border-color: var(--color-tertiary);
387
+ }
388
+
389
+ .popover-tertiary .popover-arrow {
390
+ background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
391
+ border-color: var(--color-tertiary);
392
+ }
393
+
394
+ .popover-tertiary .popover-body {
395
+ color: var(--color-on-surface);
396
+ }
397
+
398
+ .popover-tertiary .popover-title {
399
+ color: var(--color-on-surface);
400
+ }
401
+
402
+ /* Surface highest variant */
403
+ .popover-surface-highest .popover-content {
404
+ background-color: var(--color-surface-container-highest);
405
+ border-color: var(--color-outline-variant);
406
+ }
407
+
408
+ .popover-surface-highest[class*="popover-top"],
409
+ .popover-surface-highest[class*="popover-bottom"],
410
+ .popover-surface-highest[class*="popover-left"],
411
+ .popover-surface-highest[class*="popover-right"] {
412
+ background-color: var(--color-surface-container-highest);
413
+ border-color: var(--color-outline-variant);
414
+ }
415
+
416
+ .popover-surface-highest .popover-arrow {
417
+ background-color: var(--color-surface-container-highest);
418
+ border-color: var(--color-outline-variant);
419
+ }
420
+
244
421
  /* Hover Trigger */
245
422
  .popover-hover:hover .popover-content,
246
423
  .popover-hover:focus-within .popover-content {
@@ -315,11 +492,221 @@
315
492
  justify-content: center;
316
493
  }
317
494
 
495
+ /* ========================================
496
+ * HTML Popover API Support
497
+ * Uses native [popover] attribute with :popover-open pseudo-class
498
+ * ======================================== */
499
+
500
+ /* Native popover base styles */
501
+ .popover[popover] {
502
+ position: fixed;
503
+ inset: unset;
504
+ z-index: 1050;
505
+ min-width: 12rem;
506
+ max-width: 20rem;
507
+ padding: 1rem;
508
+ margin: 0;
509
+ background-color: var(--color-surface);
510
+ border: 1px solid var(--color-outline-variant);
511
+ border-radius: 0.75rem;
512
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
513
+ opacity: 0;
514
+ transform: scale(0.95);
515
+ transition: opacity 150ms ease-out, transform 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
516
+ }
517
+
518
+ /* Popover open state */
519
+ .popover[popover]:popover-open {
520
+ opacity: 1;
521
+ transform: scale(1);
522
+ }
523
+
524
+ /* Starting state for entry animation */
525
+ @starting-style {
526
+ .popover[popover]:popover-open {
527
+ opacity: 0;
528
+ transform: scale(0.95);
529
+ }
530
+ }
531
+
532
+ /* Native popover backdrop */
533
+ .popover[popover]::backdrop {
534
+ background-color: rgb(0 0 0 / 0);
535
+ transition: background-color 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
536
+ }
537
+
538
+ .popover[popover]:popover-open::backdrop {
539
+ background-color: rgb(0 0 0 / 0.1);
540
+ }
541
+
542
+ @starting-style {
543
+ .popover[popover]:popover-open::backdrop {
544
+ background-color: rgb(0 0 0 / 0);
545
+ }
546
+ }
547
+
548
+ /* Native popover with modal backdrop */
549
+ .popover-modal[popover]::backdrop {
550
+ background-color: rgb(0 0 0 / 0);
551
+ transition: background-color 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
552
+ }
553
+
554
+ .popover-modal[popover]:popover-open::backdrop {
555
+ background-color: rgb(0 0 0 / 0.3);
556
+ }
557
+
558
+ @starting-style {
559
+ .popover-modal[popover]:popover-open::backdrop {
560
+ background-color: rgb(0 0 0 / 0);
561
+ }
562
+ }
563
+
564
+ /* Native popover color variants */
565
+ .popover-primary[popover] {
566
+ background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
567
+ border-color: var(--color-primary);
568
+ }
569
+
570
+ .popover-primary[popover] .popover-body {
571
+ color: var(--color-on-surface);
572
+ }
573
+
574
+ .popover-primary[popover] .popover-title {
575
+ color: var(--color-on-surface);
576
+ }
577
+
578
+ .popover-secondary[popover] {
579
+ background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
580
+ border-color: var(--color-secondary);
581
+ }
582
+
583
+ .popover-secondary[popover] .popover-body {
584
+ color: var(--color-on-surface);
585
+ }
586
+
587
+ .popover-secondary[popover] .popover-title {
588
+ color: var(--color-on-surface);
589
+ }
590
+
591
+ .popover-tertiary[popover] {
592
+ background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
593
+ border-color: var(--color-tertiary);
594
+ }
595
+
596
+ .popover-tertiary[popover] .popover-body {
597
+ color: var(--color-on-surface);
598
+ }
599
+
600
+ .popover-tertiary[popover] .popover-title {
601
+ color: var(--color-on-surface);
602
+ }
603
+
604
+ .popover-dark[popover] {
605
+ background-color: var(--color-on-surface);
606
+ border-color: transparent;
607
+ }
608
+
609
+ .popover-dark[popover] .popover-body {
610
+ color: var(--color-surface);
611
+ opacity: 0.9;
612
+ }
613
+
614
+ .popover-dark[popover] .popover-title {
615
+ color: var(--color-surface);
616
+ }
617
+
618
+ .popover-surface-highest[popover] {
619
+ background-color: var(--color-surface-container-highest);
620
+ border-color: var(--color-outline-variant);
621
+ }
622
+
623
+ /* Native popover size variants */
624
+ .popover-sm[popover] {
625
+ min-width: 8rem;
626
+ max-width: 14rem;
627
+ padding: 0.75rem;
628
+ }
629
+
630
+ .popover-lg[popover] {
631
+ min-width: 16rem;
632
+ max-width: 28rem;
633
+ padding: 1.25rem;
634
+ }
635
+
636
+ .popover-full[popover] {
637
+ min-width: 0;
638
+ max-width: none;
639
+ width: max-content;
640
+ }
641
+
642
+ /* ========================================
643
+ * CSS Anchor Positioning
644
+ * Enables popovers to track their trigger element on scroll
645
+ * Usage: Add anchor-name CSS property to trigger, position-anchor to popover
646
+ * ======================================== */
647
+
648
+ /* Popover trigger anchor - use inline style or custom class to set anchor-name */
649
+ [popovertarget] {
650
+ /* Each trigger needs unique anchor-name, set via inline style:
651
+ style="anchor-name: --my-popover" */
652
+ }
653
+
654
+ /* Anchored popover positioning */
655
+ .popover[popover][style*="position-anchor"] {
656
+ position: absolute;
657
+ position-area: bottom;
658
+ margin-top: 0.5rem;
659
+ }
660
+
661
+ /* Position variants for anchored popovers */
662
+ .popover-top[popover][style*="position-anchor"] {
663
+ position-area: top;
664
+ margin-top: 0;
665
+ margin-bottom: 0.5rem;
666
+ }
667
+
668
+ .popover-bottom[popover][style*="position-anchor"] {
669
+ position-area: bottom;
670
+ margin-top: 0.5rem;
671
+ margin-bottom: 0;
672
+ }
673
+
674
+ .popover-left[popover][style*="position-anchor"] {
675
+ position-area: left;
676
+ margin-top: 0;
677
+ margin-right: 0.5rem;
678
+ }
679
+
680
+ .popover-right[popover][style*="position-anchor"] {
681
+ position-area: right;
682
+ margin-top: 0;
683
+ margin-left: 0.5rem;
684
+ }
685
+
686
+ /* Anchored popover alignment variants */
687
+ .popover-start[popover][style*="position-anchor"] {
688
+ position-area: bottom start;
689
+ }
690
+
691
+ .popover-end[popover][style*="position-anchor"] {
692
+ position-area: bottom end;
693
+ }
694
+
695
+ .popover-top.popover-start[popover][style*="position-anchor"] {
696
+ position-area: top start;
697
+ }
698
+
699
+ .popover-top.popover-end[popover][style*="position-anchor"] {
700
+ position-area: top end;
701
+ }
702
+
318
703
  /* Reduce Motion */
319
704
  @media (prefers-reduced-motion: reduce) {
320
705
  .popover-content,
321
706
  .popover-close,
322
- .popover-menu-item {
707
+ .popover-menu-item,
708
+ .popover[popover],
709
+ .popover[popover]::backdrop {
323
710
  transition: none;
324
711
  }
325
712
  }