@slotted/styles 0.1.0-beta.39 → 0.1.0-beta.40

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.
@@ -1,6 +1,6 @@
1
1
  @layer slotted.components {
2
2
  /**
3
- * ── A one-line frame, and behind it one end at a time ──
3
+ * ── A one-line frame, and the day behind it ────────────────────────────
4
4
  *
5
5
  * ┌─ root ──────────────────────────────────────────────────────────────┐
6
6
  * │ ┌─ control ── the frame ─────────────────────────────────────────┐ │
@@ -9,35 +9,15 @@
9
9
  * │ │ └───────────────────────────────────────────┴───────┴───────┘ │ │
10
10
  * │ └────────────────────────────────────────────────────────────────┘ │
11
11
  * └─────────────────────────────────────────────────────────────────────┘
12
- * ┌─ positioner ─ the layer ───────────────────────────────────┐
13
- * │ ┌─ content ─ the surface ─────────────────────────────┐ │
14
- * │ │ head: tabs [ START · 14:00 ] [ END · — ] │ │
15
- * │ │ field [time-field] now │ │
16
- * │ │ hint Choose the end length · limit │ │
17
- * │ │ presets: chip chip chip │ │
18
- * │ │ panel (the current end): list │ │
19
- * │ │ footer done │ │
20
- * │ └─────────────────────────────────────────────────────┘ │
21
- * └───────────────────────────────────────────────────────────┘
22
- *
23
- * The field inside keeps its own `data-ui`. Nothing here selects a
24
- * segment: this stylesheet owns the frame, the layer, the band the field
25
- * stands in, and the list.
12
+ * the panel is `picker-panel`'s, the hours in it `clock`'s and the
13
+ * ends typed in it `time-field`'s
26
14
  *
27
15
  * **The frame is one line at any width.** Two segmented fields stood in it
28
16
  * first — the shape `date-range-picker` has — and were withdrawn at the
29
17
  * visual gate: a segment cannot shrink, and two fields broke the frame into
30
18
  * two lines in any form column narrower than they are, against the height
31
- * every control shares. The frame keeps the value in words.
32
- *
33
- * **The band speaks to the field through its tokens and never through its
34
- * parts** — the rule `date-range-picker` records.
35
- *
36
- * **One end at a time.** Two lists side by side, under two fields, were
37
- * refused at the release gate as too much interface at once for a lay
38
- * reader and for a phone. The tab says which end, the panel shows only
39
- * that end, and choosing one end moves to the other — the end list
40
- * appears already striking what the chosen start refuses.
19
+ * every control shares. The frame keeps the value in words, and the fields
20
+ * live in the head of the panel.
41
21
  */
42
22
  [data-ui-time-range-picker][data-part-root] {
43
23
  display: block;
@@ -462,854 +442,4 @@
462
442
  [data-ui-time-range-picker][data-part-root][data-disabled] [data-part-trigger] > [data-ui-icon] {
463
443
  color: var(--slotted-disabled-foreground);
464
444
  }
465
-
466
- /* ── The layer ────────────────────────────────────────────────────────
467
- *
468
- * What `packages/core/src/positioner` writes `position`, `left` and `top`
469
- * onto. The painted surface is one element in, as every overlay is built.
470
- */
471
- [data-ui-time-range-picker][data-part-positioner] {
472
- /* Only the block inset: the positioner writes `left` and never `right`,
473
- and `inset-inline-start` would resolve to `right` in a right-to-left
474
- document and win over the measured value. */
475
- position: absolute;
476
- inset-block-start: 0;
477
-
478
- box-sizing: border-box;
479
- isolation: isolate;
480
- pointer-events: none;
481
- z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
482
-
483
- /* The layer arrives along the axis it opens on and never along the inline
484
- one, which is the rule `select` records. */
485
- --_enter-distance: var(--slotted-space-2, 0.25rem);
486
- opacity: 0;
487
- translate: 0 calc(-1 * var(--_enter-distance));
488
- transition:
489
- opacity var(--slotted-duration-short) var(--slotted-easing-exit),
490
- translate var(--slotted-duration-short) var(--slotted-easing-exit);
491
- }
492
-
493
- [data-ui-time-range-picker][data-part-positioner][data-side='top'] {
494
- translate: 0 var(--_enter-distance);
495
- }
496
-
497
- [data-ui-time-range-picker][data-part-positioner]:is([data-side='left'], [data-side='right']) {
498
- translate: 0 0;
499
- }
500
-
501
- [data-ui-time-range-picker][data-part-positioner][data-open] {
502
- opacity: 1;
503
- translate: 0 0;
504
- transition: none;
505
- }
506
-
507
- /* The entrance is a keyframe animation and not a transition, for the reason
508
- `select` records: only a layer the positioner placed arrives. */
509
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned] {
510
- animation: slotted-time-range-picker-enter-down var(--slotted-duration-medium)
511
- var(--slotted-easing-enter);
512
- }
513
-
514
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned][data-side='top'] {
515
- animation-name: slotted-time-range-picker-enter-up;
516
- }
517
-
518
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned]:is(
519
- [data-side='left'],
520
- [data-side='right']
521
- ) {
522
- animation-name: slotted-time-range-picker-fade;
523
- }
524
-
525
- @keyframes slotted-time-range-picker-enter-down {
526
- from {
527
- opacity: 0;
528
- translate: 0 calc(-1 * var(--_enter-distance));
529
- }
530
- }
531
-
532
- @keyframes slotted-time-range-picker-enter-up {
533
- from {
534
- opacity: 0;
535
- translate: 0 var(--_enter-distance);
536
- }
537
- }
538
-
539
- @keyframes slotted-time-range-picker-fade {
540
- from {
541
- opacity: 0;
542
- }
543
- }
544
-
545
- /* Stillness keeps the fade and drops the movement. */
546
- @media (prefers-reduced-motion: reduce) {
547
- [data-ui-time-range-picker][data-part-positioner],
548
- [data-ui-time-range-picker][data-part-positioner][data-side='top'],
549
- [data-ui-time-range-picker][data-part-positioner][data-side='left'],
550
- [data-ui-time-range-picker][data-part-positioner][data-side='right'] {
551
- translate: 0 0;
552
- transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
553
- }
554
-
555
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned],
556
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned][data-side='top'],
557
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned][data-side='left'],
558
- [data-ui-time-range-picker][data-part-positioner][data-open][data-positioned][data-side='right'] {
559
- animation-name: slotted-time-range-picker-fade;
560
- }
561
- }
562
-
563
- /* The anchor scrolled out of its own clipper. */
564
- [data-ui-time-range-picker][data-part-positioner][data-detached] {
565
- visibility: hidden;
566
- }
567
-
568
- /**
569
- * The surface. One list has no intrinsic width, so the surface takes the
570
- * anchor's, floored so a column is never too tight to read a time and its
571
- * duration in, and capped so a wide form does not stretch one column
572
- * across a page — the rule `time-picker` states, with a wider floor for
573
- * the duration beside each time.
574
- *
575
- * The fallback is the floor rather than `auto`: the anchor width is written
576
- * by the positioner and absent wherever the surface is drawn without one,
577
- * and `min(auto, …)` is not a value.
578
- */
579
- [data-ui-time-range-picker] [data-part-content] {
580
- background-color: var(
581
- --slotted-time-range-picker-surface,
582
- var(--slotted-surface-raised, Canvas)
583
- );
584
- border: var(--slotted-border-width-thin, 1px) solid
585
- var(
586
- --slotted-time-range-picker-content-border-color,
587
- var(--slotted-border-subtle, ButtonBorder)
588
- );
589
- border-radius: var(--slotted-time-range-picker-content-radius, var(--slotted-radius-lg, 8px));
590
- box-shadow: var(--slotted-time-range-picker-content-shadow, var(--slotted-shadow-md));
591
- box-sizing: border-box;
592
- color: var(--slotted-time-range-picker-content-color, var(--slotted-text, CanvasText));
593
- /* The type of the surface follows density with the control scale, as the
594
- calendar's does: a list at the page's size beside a grid at the
595
- control's read as two sizes in dense. */
596
- font-family: var(--slotted-control-font-family, system-ui, sans-serif);
597
- font-size: var(--slotted-control-font-size-md, 13px);
598
- /**
599
- * One row's height, stated once, because the list's cap is counted in
600
- * rows — eight and a half of them at every density, the arithmetic
601
- * `time-picker` records. The pitch is the row plus the air under it.
602
- */
603
- --_row: max(var(--slotted-target-min, 24px), var(--slotted-control-height-sm, 30px));
604
- --_row-pitch: calc(var(--_row) + var(--slotted-space-1, 0.125rem));
605
-
606
- display: grid;
607
- /* The bands breathe by the step the dialogs of the date chain use: a
608
- surface holding a field and a list is a dialog, not a menu. */
609
- gap: var(--slotted-space-5, 0.75rem);
610
- grid-template-areas: 'head' 'presets' 'panel' 'footer';
611
- grid-template-columns: minmax(0, 1fr);
612
- inline-size: max(
613
- var(--slotted-time-range-picker-content-min-inline-size, 16rem),
614
- min(var(--slotted-positioner-anchor-width, 16rem), 22rem)
615
- );
616
- max-inline-size: var(--slotted-positioner-available-width, 100vw);
617
- padding: var(--slotted-time-range-picker-content-padding, var(--slotted-space-5, 0.75rem));
618
- /* The layer above gave up the pointer; the surface takes it back. */
619
- pointer-events: auto;
620
- }
621
-
622
- /* ── The band ─────────────────────────────────────────────────────────
623
- *
624
- * Three rows: which end is being chosen, where the reader types it, and
625
- * what to do next. It renders at the panel's width and contributes nothing
626
- * to it, by the pair `datetime-picker` records.
627
- */
628
- [data-ui-time-range-picker] [data-part-head] {
629
- box-sizing: border-box;
630
- inline-size: 0;
631
- min-inline-size: 100%;
632
-
633
- /* A grid, so the field and now, and the hint and the length, share a
634
- row without a wrapper the anatomy would have to name. */
635
- column-gap: var(--slotted-space-2, 0.25rem);
636
- display: grid;
637
- grid-area: head;
638
- grid-template-areas: 'tabs tabs' 'field now' 'hint length' 'limit limit';
639
- grid-template-columns: minmax(0, 1fr) auto;
640
- row-gap: var(--slotted-space-2, 0.25rem);
641
- }
642
-
643
- [data-ui-time-range-picker] [data-part-tabs] {
644
- grid-area: tabs;
645
- }
646
-
647
- [data-ui-time-range-picker] [data-part-field] {
648
- grid-area: field;
649
- }
650
-
651
- [data-ui-time-range-picker] [data-part-head] > [data-part-now] {
652
- align-self: center;
653
- grid-area: now;
654
- }
655
-
656
- [data-ui-time-range-picker] [data-part-hint] {
657
- align-self: center;
658
- grid-area: hint;
659
- }
660
-
661
- [data-ui-time-range-picker] [data-part-length] {
662
- align-self: center;
663
- grid-area: length;
664
- }
665
-
666
- [data-ui-time-range-picker] [data-part-limit] {
667
- grid-area: limit;
668
- }
669
-
670
- /* ── The two ends, as tabs ────────────────────────────────────────────
671
- *
672
- * One end at a time. Two equal halves, the label over the value; the
673
- * current one carries the underline `date-range-picker` draws under its
674
- * current field, in the accent, and the other reads as the step to come.
675
- * The row is the whole width so the two are the same size whatever their
676
- * values, and a thumb finds them without aiming.
677
- */
678
- [data-ui-time-range-picker] [data-part-tabs] {
679
- border-block-end: var(--slotted-border-width-thin, 1px) solid
680
- var(
681
- --slotted-time-range-picker-content-border-color,
682
- var(--slotted-border-subtle, ButtonBorder)
683
- );
684
- display: grid;
685
- gap: var(--slotted-space-2, 0.25rem);
686
- grid-template-columns: repeat(2, minmax(0, 1fr));
687
- }
688
-
689
- [data-ui-time-range-picker] [data-part-tab] {
690
- appearance: none;
691
- background-color: transparent;
692
- border: 0;
693
- border-start-end-radius: var(
694
- --slotted-time-range-picker-option-radius,
695
- var(--slotted-radius-sm, 4px)
696
- );
697
- border-start-start-radius: var(
698
- --slotted-time-range-picker-option-radius,
699
- var(--slotted-radius-sm, 4px)
700
- );
701
- color: var(--slotted-time-range-picker-content-color, var(--slotted-text, CanvasText));
702
- cursor: pointer;
703
- display: flex;
704
- flex-direction: column;
705
- font: inherit;
706
- gap: var(--slotted-space-1, 0.125rem);
707
- min-block-size: var(--slotted-time-range-picker-tab-block-size, calc(var(--_row) * 1.5));
708
- min-inline-size: 0;
709
- padding-block: var(--slotted-space-2, 0.25rem) var(--slotted-space-3, 0.375rem);
710
- padding-inline: var(--slotted-space-3, 0.375rem);
711
- position: relative;
712
- text-align: start;
713
- touch-action: manipulation;
714
- transition: background-color var(--slotted-control-transition-duration)
715
- var(--slotted-control-transition-easing);
716
- -webkit-tap-highlight-color: transparent;
717
- }
718
-
719
- [data-ui-time-range-picker] [data-part-tab]::after {
720
- background-color: var(
721
- --slotted-time-range-picker-current-color,
722
- var(--slotted-tone-accent-solid)
723
- );
724
- block-size: var(--slotted-time-range-picker-current-size, 2px);
725
- border-start-end-radius: var(--slotted-radius-xs, 2px);
726
- border-start-start-radius: var(--slotted-radius-xs, 2px);
727
- content: '';
728
- /* Over the row's own hairline, so the current tab's mark and the rule
729
- are one line. */
730
- inset-block-end: calc(-1 * var(--slotted-border-width-thin, 1px));
731
- inset-inline: 0;
732
- opacity: 0;
733
- position: absolute;
734
- transition: opacity var(--slotted-control-transition-duration)
735
- var(--slotted-control-transition-easing);
736
- }
737
-
738
- [data-ui-time-range-picker] [data-part-tab][data-current]::after {
739
- opacity: 1;
740
- }
741
-
742
- [data-ui-time-range-picker] [data-part-tab]:hover:not(:disabled):not([data-current]) {
743
- background-color: var(
744
- --slotted-time-range-picker-option-hover-background,
745
- var(--slotted-tone-secondary-subtle-hover)
746
- );
747
- }
748
-
749
- [data-ui-time-range-picker] [data-part-tab]:focus-visible {
750
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
751
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
752
- }
753
-
754
- [data-ui-time-range-picker] [data-part-tab]:disabled {
755
- color: var(--slotted-disabled-foreground);
756
- cursor: not-allowed;
757
- }
758
-
759
- /* The label, in the muted ink for both ends alike: which end is current
760
- is said once, by the underline. */
761
- [data-ui-time-range-picker] [data-part-tab-label] {
762
- color: var(--slotted-time-range-picker-label-color, var(--slotted-text-muted, GrayText));
763
- font-size: var(--slotted-font-size-xs, 11px);
764
- font-weight: var(--slotted-font-weight-medium, 500);
765
- letter-spacing: var(--slotted-letter-spacing-wide, 0.02em);
766
- text-transform: uppercase;
767
- white-space: nowrap;
768
- }
769
-
770
- [data-ui-time-range-picker] [data-part-tab-value] {
771
- font-size: var(--slotted-font-size-sm, 13px);
772
- font-variant-numeric: tabular-nums;
773
- font-weight: var(--slotted-font-weight-medium, 500);
774
- overflow: hidden;
775
- text-overflow: ellipsis;
776
- unicode-bidi: plaintext;
777
- white-space: nowrap;
778
- }
779
-
780
- [data-ui-time-range-picker] [data-part-tab][data-placeholder] [data-part-tab-value] {
781
- color: var(--slotted-time-range-picker-label-color, var(--slotted-text-muted, GrayText));
782
- font-weight: var(--slotted-font-weight-regular, 400);
783
- }
784
-
785
- /* ── The field row ────────────────────────────────────────────────────
786
- *
787
- * The current end's field in `plain`, spoken to in the only language this
788
- * stylesheet is allowed: the tokens the field reads. Its border, inline
789
- * padding, hover wash, invalid edge and lift are zeroed; its own focus ring
790
- * stays, because in the band the field is the control the reader is in.
791
- * `now` sits at the reading end of the same row. On a coarse pointer the
792
- * row is `now` alone: a segment is a spinbutton and raises no keyboard.
793
- */
794
- [data-ui-time-range-picker] [data-part-field] {
795
- --slotted-control-border-width: 0px;
796
- --slotted-control-padding-inline-sm: var(--slotted-space-2, 0.25rem);
797
- --slotted-control-padding-inline-md: var(--slotted-space-2, 0.25rem);
798
- --slotted-control-padding-inline-lg: var(--slotted-space-2, 0.25rem);
799
- --slotted-time-field-plain-hover-background: transparent;
800
- --slotted-time-field-invalid-border-color: transparent;
801
- --slotted-time-field-shadow: none;
802
- --slotted-control-shadow-focus-geometry: 0 0 0 0;
803
-
804
- display: flex;
805
- flex: 0 1 auto;
806
- min-inline-size: 0;
807
- }
808
-
809
- /* ── What to do next ──────────────────────────────────────────────────
810
- *
811
- * The hint at the start, the duration at the reading end; the limit on a
812
- * line of its own under them. The hint is the difference between a panel
813
- * that refuses and a panel that explains.
814
- */
815
- [data-ui-time-range-picker] [data-part-hint] {
816
- color: var(--slotted-time-range-picker-hint-color, var(--slotted-text-muted, GrayText));
817
- font-size: var(--slotted-font-size-sm, 13px);
818
- min-inline-size: 0;
819
- padding-inline-start: var(--slotted-space-2, 0.25rem);
820
- text-wrap: balance;
821
- unicode-bidi: plaintext;
822
- }
823
-
824
- [data-ui-time-range-picker] [data-part-hint][data-invalid] {
825
- color: var(--slotted-time-range-picker-invalid-color, var(--slotted-tone-danger-text));
826
- }
827
-
828
- /* The duration, at the reading end, in the accent's text tone: it is the
829
- number the band exists to say. Pending, it drops a step of weight. */
830
- [data-ui-time-range-picker] [data-part-length] {
831
- color: var(--slotted-time-range-picker-length-color, var(--slotted-tone-accent-text));
832
- font-size: var(--slotted-font-size-sm, 13px);
833
- font-variant-numeric: tabular-nums;
834
- font-weight: var(--slotted-font-weight-semibold, 600);
835
- padding-inline: var(--slotted-space-4, 0.5rem) var(--slotted-space-2, 0.25rem);
836
- unicode-bidi: plaintext;
837
- white-space: nowrap;
838
- }
839
-
840
- [data-ui-time-range-picker] [data-part-length][data-pending] {
841
- font-weight: var(--slotted-font-weight-medium, 500);
842
- }
843
-
844
- /* An empty length still holds its line, so the band does not grow a row
845
- when the first end is chosen. */
846
- [data-ui-time-range-picker] [data-part-length]:empty::before {
847
- content: '\200B';
848
- }
849
-
850
- [data-ui-time-range-picker] [data-part-limit] {
851
- color: var(--slotted-time-range-picker-limit-color, var(--slotted-text-muted, GrayText));
852
- font-size: var(--slotted-font-size-xs, 11px);
853
- padding-inline-start: var(--slotted-space-2, 0.25rem);
854
- unicode-bidi: plaintext;
855
- }
856
-
857
- /* ── The panel ────────────────────────────────────────────────────────
858
- *
859
- * The current end, one at a time: its list. `data-position` says which.
860
- */
861
- [data-ui-time-range-picker] [data-part-panel] {
862
- display: flex;
863
- flex-direction: column;
864
- gap: var(--slotted-space-2, 0.25rem);
865
- grid-area: panel;
866
- min-inline-size: 0;
867
- }
868
-
869
- [data-ui-time-range-picker] [data-part-now] {
870
- appearance: none;
871
- background-color: transparent;
872
- border: 0;
873
- border-radius: var(--slotted-time-range-picker-option-radius, var(--slotted-radius-sm, 4px));
874
- color: var(--slotted-time-range-picker-now-color, var(--slotted-tone-accent-text));
875
- cursor: pointer;
876
- flex: 0 0 auto;
877
- font: inherit;
878
- font-size: var(--slotted-font-size-sm, 13px);
879
- min-block-size: var(--_row);
880
- padding-block: var(--slotted-space-1, 0.125rem);
881
- padding-inline: var(--slotted-space-3, 0.375rem);
882
- touch-action: manipulation;
883
- transition: background-color var(--slotted-control-transition-duration)
884
- var(--slotted-control-transition-easing);
885
- }
886
-
887
- [data-ui-time-range-picker] [data-part-now]:hover:not(:disabled):not([data-disabled]) {
888
- background-color: var(
889
- --slotted-time-range-picker-option-hover-background,
890
- var(--slotted-tone-secondary-subtle-hover)
891
- );
892
- }
893
-
894
- [data-ui-time-range-picker] [data-part-now]:focus-visible {
895
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
896
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
897
- }
898
-
899
- [data-ui-time-range-picker] [data-part-now]:disabled {
900
- color: var(--slotted-disabled-foreground);
901
- cursor: not-allowed;
902
- }
903
-
904
- /* ── The shortcuts ────────────────────────────────────────────────────
905
- *
906
- * This family ships no list of them: "the morning shift" is a business
907
- * clock. It ships the row they stand in and the chip each one is, between
908
- * the band and the panel, wrapping when they do not fit.
909
- */
910
- [data-ui-time-range-picker] [data-part-presets] {
911
- display: flex;
912
- flex-wrap: wrap;
913
- gap: var(--slotted-space-2, 0.25rem);
914
- grid-area: presets;
915
- min-inline-size: 0;
916
- }
917
-
918
- [data-ui-time-range-picker] [data-part-preset] {
919
- appearance: none;
920
- background-color: var(
921
- --slotted-time-range-picker-preset-background,
922
- var(--slotted-tone-secondary-subtle)
923
- );
924
- border: 0;
925
- border-radius: var(
926
- --slotted-time-range-picker-preset-radius,
927
- var(--slotted-radius-pill, 999px)
928
- );
929
- color: var(--slotted-time-range-picker-content-color, var(--slotted-text, CanvasText));
930
- cursor: pointer;
931
- font-family: var(--slotted-control-font-family, system-ui, sans-serif);
932
- font-size: var(--slotted-font-size-sm, 13px);
933
- line-height: var(--slotted-line-height-sm, 1.4);
934
- min-block-size: var(--_row);
935
- padding-block: var(--slotted-space-1, 0.125rem);
936
- padding-inline: var(--slotted-space-4, 0.5rem);
937
- text-align: start;
938
- touch-action: manipulation;
939
- transition:
940
- background-color var(--slotted-control-transition-duration)
941
- var(--slotted-control-transition-easing),
942
- color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
943
- white-space: nowrap;
944
- -webkit-tap-highlight-color: transparent;
945
- }
946
-
947
- [data-ui-time-range-picker] [data-part-preset]:hover:not(:disabled):not([data-selected]) {
948
- background-color: var(
949
- --slotted-time-range-picker-preset-hover-background,
950
- var(--slotted-tone-secondary-subtle-hover)
951
- );
952
- }
953
-
954
- [data-ui-time-range-picker] [data-part-preset]:active:not(:disabled):not([data-selected]) {
955
- background-color: var(
956
- --slotted-time-range-picker-preset-active-background,
957
- var(--slotted-tone-secondary-subtle-active)
958
- );
959
- }
960
-
961
- [data-ui-time-range-picker] [data-part-preset][data-selected] {
962
- background-color: var(
963
- --slotted-time-range-picker-preset-selected-background,
964
- var(--slotted-tone-accent-subtle-hover)
965
- );
966
- color: var(--slotted-time-range-picker-preset-selected-color, var(--slotted-tone-accent-text));
967
- font-weight: var(--slotted-font-weight-medium, 500);
968
- }
969
-
970
- [data-ui-time-range-picker] [data-part-preset]:focus-visible {
971
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
972
- outline-offset: var(--slotted-focus-ring-offset, 2px);
973
- }
974
-
975
- [data-ui-time-range-picker] [data-part-preset]:disabled {
976
- color: var(--slotted-disabled-foreground);
977
- cursor: not-allowed;
978
- }
979
-
980
- /* ── The list ─────────────────────────────────────────────────────────
981
- *
982
- * One column of times, the current end's, capped in control heights so the
983
- * cap holds at every density, and scrolled rather than truncated —
984
- * `time-picker`'s list.
985
- */
986
- [data-ui-time-range-picker] [data-part-list] {
987
- display: flex;
988
- flex-direction: column;
989
- /* One step of air between rows, so the chosen row's painted ground and
990
- the focused row's inset ring never share an edge. */
991
- gap: var(--slotted-space-1, 0.125rem);
992
- /* Eight rows and half of the ninth: a list cut on a row boundary looks
993
- like the whole list. */
994
- max-block-size: var(--slotted-time-range-picker-list-block-size, calc(var(--_row-pitch) * 8.5));
995
- min-inline-size: 0;
996
- overflow-y: auto;
997
- /* A highlight moved by a key lands whole rather than half under the edge. */
998
- scroll-padding-block: var(--slotted-space-2, 0.25rem);
999
- }
1000
-
1001
- [data-ui-time-range-picker] [data-part-option] {
1002
- /* The time and its duration share a baseline, and the line box is the
1003
- row: baseline alignment alone would seat both at the top of a row
1004
- taller than one line, and a length line-height centers them in it. */
1005
- align-items: baseline;
1006
- background-color: transparent;
1007
- border-radius: var(--slotted-time-range-picker-option-radius, var(--slotted-radius-sm, 4px));
1008
- color: inherit;
1009
- cursor: pointer;
1010
- display: flex;
1011
- flex: 0 0 auto;
1012
- font-variant-numeric: tabular-nums;
1013
- gap: var(--slotted-space-3, 0.375rem);
1014
- justify-content: space-between;
1015
- line-height: var(--_row);
1016
- /* The row *is* `--_row`: no block padding on top of it, so eight rows are
1017
- eight rows and the cap that counts them is arithmetic. */
1018
- min-block-size: var(--_row);
1019
- padding-inline: var(--slotted-space-3, 0.375rem);
1020
- transition:
1021
- background-color var(--slotted-control-transition-duration)
1022
- var(--slotted-control-transition-easing),
1023
- color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
1024
- user-select: none;
1025
- -webkit-tap-highlight-color: transparent;
1026
- }
1027
-
1028
- /**
1029
- * The duration this option would make, beside it: "15:00 · 1 hr", the way
1030
- * a calendar application lists the end times of an event. It is the answer
1031
- * to the question the reader is actually asking while choosing an end, read
1032
- * row by row rather than one option at a time from the band. In the list of
1033
- * the other end it is the duration to the end already chosen. Muted, so the
1034
- * time stays what the row is; on the chosen row it takes the row's own ink.
1035
- */
1036
- [data-ui-time-range-picker] [data-part-option-duration] {
1037
- color: var(--slotted-time-range-picker-label-color, var(--slotted-text-muted, GrayText));
1038
- flex: 0 1 auto;
1039
- font-size: var(--slotted-font-size-xs, 11px);
1040
- min-inline-size: 0;
1041
- overflow: hidden;
1042
- text-overflow: ellipsis;
1043
- unicode-bidi: plaintext;
1044
- white-space: nowrap;
1045
- }
1046
-
1047
- [data-ui-time-range-picker] [data-part-option][data-selected] [data-part-option-duration],
1048
- [data-ui-time-range-picker] [data-part-option][data-disabled] [data-part-option-duration] {
1049
- color: inherit;
1050
- }
1051
-
1052
- /* ── Option states ────────────────────────────────────────────────────
1053
- *
1054
- * Written strongest last, and each weaker one guarded against every stronger
1055
- * one it can meet: the chosen time outranks the highlight, and the highlight
1056
- * outranks the pointer. Specificity is what makes this a rule rather than an
1057
- * ordering — the defect `time-picker` records from its visual gate.
1058
- */
1059
- [data-ui-time-range-picker]
1060
- [data-part-option]:hover:not([data-disabled]):not([data-selected]):not([data-current]) {
1061
- background-color: var(
1062
- --slotted-time-range-picker-option-hover-background,
1063
- var(--slotted-tone-secondary-subtle-hover)
1064
- );
1065
- }
1066
-
1067
- [data-ui-time-range-picker] [data-part-option][data-current]:not([data-selected]) {
1068
- background-color: var(
1069
- --slotted-time-range-picker-option-current-background,
1070
- var(--slotted-tone-secondary-subtle-active)
1071
- );
1072
- }
1073
-
1074
- [data-ui-time-range-picker] [data-part-option]:focus-visible {
1075
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1076
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
1077
- }
1078
-
1079
- [data-ui-time-range-picker] [data-part-option][data-selected] {
1080
- background-color: var(
1081
- --slotted-time-range-picker-option-selected-background,
1082
- var(--slotted-tone-accent-solid)
1083
- );
1084
- color: var(
1085
- --slotted-time-range-picker-option-selected-color,
1086
- var(--slotted-tone-accent-on-solid)
1087
- );
1088
- }
1089
-
1090
- /* The chosen row still answers the pointer, one step along its own tone. */
1091
- [data-ui-time-range-picker] [data-part-option][data-selected]:hover:not([data-disabled]) {
1092
- background-color: var(
1093
- --slotted-time-range-picker-option-selected-hover-background,
1094
- var(--slotted-tone-accent-solid-hover)
1095
- );
1096
- }
1097
-
1098
- /**
1099
- * A time a bound, the predicate or the other end refuses. It stays in the
1100
- * list by default, because a list that silently drops rows is a list whose
1101
- * step the reader cannot infer — and it is muted to the color the theme
1102
- * measures rather than faded by opacity, so it stays readable.
1103
- */
1104
- [data-ui-time-range-picker] [data-part-option][data-disabled] {
1105
- background-color: transparent;
1106
- color: var(--slotted-disabled-foreground);
1107
- cursor: not-allowed;
1108
- }
1109
-
1110
- /* Nothing available for this end at all. A sentence rather than an empty
1111
- box, the reason `time-picker` records. */
1112
- [data-ui-time-range-picker] [data-part-empty] {
1113
- align-items: center;
1114
- color: var(--slotted-time-range-picker-label-color, var(--slotted-text-muted, GrayText));
1115
- display: flex;
1116
- font-size: var(--slotted-font-size-sm, 13px);
1117
- justify-content: center;
1118
- min-block-size: calc(var(--_row) * 2);
1119
- padding: var(--slotted-space-4, 0.5rem);
1120
- text-align: center;
1121
- text-wrap: balance;
1122
- /* A sentence laid out by its own first strong character, so a full stop
1123
- does not lead it in a right-to-left document. */
1124
- unicode-bidi: plaintext;
1125
- }
1126
-
1127
- /* The consumer's own actions and, at the reading end, `done`: the way out
1128
- of a sheet that fills the screen and of an edit left half way. */
1129
- [data-ui-time-range-picker] [data-part-footer] {
1130
- box-sizing: border-box;
1131
- inline-size: 0;
1132
- min-inline-size: 100%;
1133
-
1134
- align-items: center;
1135
- border-block-start: var(--slotted-border-width-thin, 1px) solid
1136
- var(
1137
- --slotted-time-range-picker-content-border-color,
1138
- var(--slotted-border-subtle, ButtonBorder)
1139
- );
1140
- display: flex;
1141
- gap: var(--slotted-space-2, 0.25rem);
1142
- grid-area: footer;
1143
- justify-content: flex-end;
1144
- padding-block-start: var(--slotted-space-3, 0.375rem);
1145
- }
1146
-
1147
- [data-ui-time-range-picker] [data-part-done] {
1148
- appearance: none;
1149
- background-color: var(
1150
- --slotted-time-range-picker-done-background,
1151
- var(--slotted-tone-accent-solid)
1152
- );
1153
- border: 0;
1154
- border-radius: var(--slotted-time-range-picker-radius, var(--slotted-control-radius, 4px));
1155
- color: var(--slotted-time-range-picker-done-color, var(--slotted-tone-accent-on-solid, Canvas));
1156
- cursor: pointer;
1157
- font-family: var(--slotted-control-font-family, system-ui, sans-serif);
1158
- font-size: var(--slotted-font-size-sm, 13px);
1159
- font-weight: var(--slotted-font-weight-medium, 500);
1160
- line-height: var(--slotted-line-height-sm, 1.4);
1161
- margin-inline-start: auto;
1162
- min-block-size: var(--_row);
1163
- padding-block: var(--slotted-space-1, 0.125rem);
1164
- padding-inline: var(--slotted-space-5, 0.75rem);
1165
- touch-action: manipulation;
1166
- transition: background-color var(--slotted-control-transition-duration)
1167
- var(--slotted-control-transition-easing);
1168
- -webkit-tap-highlight-color: transparent;
1169
- }
1170
-
1171
- [data-ui-time-range-picker] [data-part-done]:hover:not(:disabled) {
1172
- background-color: var(
1173
- --slotted-time-range-picker-done-hover-background,
1174
- var(--slotted-tone-accent-solid-hover)
1175
- );
1176
- }
1177
-
1178
- [data-ui-time-range-picker] [data-part-done]:active:not(:disabled) {
1179
- background-color: var(
1180
- --slotted-time-range-picker-done-active-background,
1181
- var(--slotted-tone-accent-solid-active)
1182
- );
1183
- }
1184
-
1185
- [data-ui-time-range-picker] [data-part-done]:focus-visible {
1186
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1187
- outline-offset: var(--slotted-focus-ring-offset, 2px);
1188
- }
1189
-
1190
- /* ── On a finger ──────────────────────────────────────────────────────
1191
- *
1192
- * The row is the touch target: the theme raises the control heights to
1193
- * `--slotted-target-comfortable` under a coarse pointer, and the row is
1194
- * counted in them. The field is not drawn — a segment is a spinbutton and
1195
- * raises no keyboard — and the list is the way to a time.
1196
- */
1197
- @media (pointer: coarse) {
1198
- [data-ui-time-range-picker] [data-part-field] {
1199
- display: none;
1200
- }
1201
- }
1202
-
1203
- /* ── Narrow, on a finger ──────────────────────────────────────────────
1204
- *
1205
- * §2.7 of `docs/component-features.md` asks for it by name: a popover on the
1206
- * desktop and a sheet in a narrow viewport. The DOM does not change.
1207
- */
1208
- @media (max-width: 480px) and (pointer: coarse) {
1209
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet'] {
1210
- inset: auto 0 0;
1211
- position: fixed;
1212
- translate: 0 var(--slotted-space-9, 2rem);
1213
- }
1214
-
1215
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet'][data-open] {
1216
- translate: 0 0;
1217
- }
1218
-
1219
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet']
1220
- [data-part-content] {
1221
- border-end-end-radius: 0;
1222
- border-end-start-radius: 0;
1223
- border-inline: 0;
1224
- border-block-end: 0;
1225
- inline-size: var(--slotted-time-range-picker-sheet-inline-size, 100%);
1226
- max-inline-size: none;
1227
- /* A sheet taller than the screen — a grid and a list on a short phone,
1228
- a list on a phone held sideways — scrolls as one, so the tabs stay
1229
- reachable rather than above the top edge. `dvh` follows the
1230
- browser's own bars; `vh` is the fallback. */
1231
- max-block-size: 100vh;
1232
- max-block-size: 100dvh;
1233
- overflow-y: auto;
1234
- overscroll-behavior: contain;
1235
- padding-block-end: max(
1236
- var(--slotted-time-range-picker-content-padding, var(--slotted-space-5, 0.75rem)),
1237
- env(safe-area-inset-bottom, 0px)
1238
- );
1239
- }
1240
-
1241
- /* Six rows and a half on a phone, at the touch height: the sheet stays
1242
- under two thirds of the screen and done stays reachable. */
1243
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet'] [data-part-list] {
1244
- max-block-size: calc(var(--_row-pitch) * 6.5);
1245
- }
1246
-
1247
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet'] [data-part-tab] {
1248
- min-block-size: var(
1249
- --slotted-time-range-picker-tab-block-size,
1250
- var(--slotted-target-comfortable, 44px)
1251
- );
1252
- }
1253
-
1254
- /**
1255
- * The grip every bottom sheet carries, in the drawer's geometry and line
1256
- * color: a pill three rem by a quarter, centerd in a row one target tall
1257
- * that the content keeps clear at its top. A pull down on it dismisses the
1258
- * sheet; Escape and the press outside stay the accessible ways out.
1259
- */
1260
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet']
1261
- > [data-part-content] {
1262
- padding-block-start: var(--slotted-target-min, 24px);
1263
- position: relative;
1264
- }
1265
-
1266
- [data-ui-time-range-picker][data-part-positioner][data-presentation='sheet']
1267
- > [data-part-content]
1268
- > [data-part-grip] {
1269
- background-clip: content-box;
1270
- background-color: var(
1271
- --slotted-drawer-resizer-line-color,
1272
- var(--slotted-border-strong, ButtonBorder)
1273
- );
1274
- block-size: var(--slotted-space-2, 0.25rem);
1275
- border-radius: var(--slotted-radius-full, 9999px);
1276
- box-sizing: content-box;
1277
- cursor: grab;
1278
- inline-size: var(--slotted-space-11, 3rem);
1279
- inset-block-start: 0;
1280
- inset-inline: 0;
1281
- margin-inline: auto;
1282
- padding-block: calc((var(--slotted-target-min, 24px) - var(--slotted-space-2, 0.25rem)) / 2);
1283
- position: absolute;
1284
- touch-action: none;
1285
- }
1286
- }
1287
-
1288
- @media (forced-colors: active) {
1289
- [data-ui-time-range-picker][data-part-root][data-variant='plain'] [data-part-control] {
1290
- border-color: ButtonBorder;
1291
- }
1292
-
1293
- /* The tab's underline is painted with a background, and forced colors
1294
- replace a background that is not one of the system's own. */
1295
- [data-ui-time-range-picker] [data-part-tab]::after {
1296
- forced-color-adjust: none;
1297
- }
1298
-
1299
- [data-ui-time-range-picker] [data-part-tab]::after {
1300
- background-color: currentcolor;
1301
- }
1302
-
1303
- [data-ui-time-range-picker] [data-part-preset][data-selected],
1304
- [data-ui-time-range-picker] [data-part-option][data-selected] {
1305
- background-color: Highlight;
1306
- color: HighlightText;
1307
- forced-color-adjust: none;
1308
- }
1309
-
1310
- [data-ui-time-range-picker] [data-part-option][data-current]:not([data-selected]) {
1311
- outline: var(--slotted-focus-ring-width, 2px) solid Highlight;
1312
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
1313
- }
1314
- }
1315
445
  }