@still-void/ui 2.0.1 → 3.0.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.
- package/CHANGELOG.md +63 -0
- package/README.md +41 -7
- package/dist/react/client/index.cjs +310 -197
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +63 -9
- package/dist/react/client/index.d.ts +63 -9
- package/dist/react/client/index.js +315 -197
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +363 -93
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +133 -3
- package/dist/react/index.d.ts +133 -3
- package/dist/react/index.js +359 -92
- package/dist/react/index.js.map +1 -1
- package/dist/shadcn-overrides.css +98 -0
- package/dist/style.css +815 -0
- package/dist/tailwind.css +72 -0
- package/dist/theme.css +33 -11
- package/package.json +13 -3
package/dist/style.css
CHANGED
|
@@ -595,3 +595,818 @@ body.sv-body {
|
|
|
595
595
|
color: var(--sv-text);
|
|
596
596
|
font-style: italic;
|
|
597
597
|
}
|
|
598
|
+
|
|
599
|
+
/* ---------- Forms ---------- */
|
|
600
|
+
/* Single source of truth for the field frame. Input, Textarea, NativeSelect
|
|
601
|
+
and FileInput all render .sv-field, so border, radius, surface, typography
|
|
602
|
+
and focus ring are defined once and follow [data-theme] with zero consumer
|
|
603
|
+
configuration. */
|
|
604
|
+
.sv-field {
|
|
605
|
+
display: block;
|
|
606
|
+
width: 100%;
|
|
607
|
+
height: var(--sv-space-10);
|
|
608
|
+
padding: var(--sv-space-2) var(--sv-space-3);
|
|
609
|
+
border: 1px solid var(--sv-border);
|
|
610
|
+
border-radius: var(--sv-radius-sm);
|
|
611
|
+
background: var(--sv-surface);
|
|
612
|
+
color: var(--sv-text);
|
|
613
|
+
font-family: var(--sv-font-body);
|
|
614
|
+
font-size: var(--sv-text-base);
|
|
615
|
+
line-height: 1.5;
|
|
616
|
+
}
|
|
617
|
+
.sv-field::placeholder {
|
|
618
|
+
color: var(--sv-text-2);
|
|
619
|
+
}
|
|
620
|
+
/* Tailwind's ring-* is box-shadow based and its `accent` color is not declared
|
|
621
|
+
in this package's config, so fields had no visible focus at all. Outline is
|
|
622
|
+
the system's focus state — never box-shadow. */
|
|
623
|
+
.sv-field:focus-visible {
|
|
624
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
625
|
+
outline-offset: 2px;
|
|
626
|
+
}
|
|
627
|
+
.sv-field:disabled {
|
|
628
|
+
cursor: not-allowed;
|
|
629
|
+
opacity: 0.5;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.sv-field--textarea {
|
|
633
|
+
height: auto;
|
|
634
|
+
min-height: calc(var(--sv-space-10) * 2);
|
|
635
|
+
resize: vertical;
|
|
636
|
+
}
|
|
637
|
+
/* A multi-select list box has to grow past the single-row field height. */
|
|
638
|
+
.sv-field--select[multiple] {
|
|
639
|
+
height: auto;
|
|
640
|
+
}
|
|
641
|
+
.sv-field--file {
|
|
642
|
+
height: auto;
|
|
643
|
+
padding: var(--sv-space-1) var(--sv-space-2);
|
|
644
|
+
}
|
|
645
|
+
/* Two rules, not one selector list: an unsupported pseudo-element in a group
|
|
646
|
+
invalidates the whole rule, so the standard and the -webkit- fallback are
|
|
647
|
+
declared separately. */
|
|
648
|
+
.sv-field--file::file-selector-button {
|
|
649
|
+
margin-inline-end: var(--sv-space-3);
|
|
650
|
+
padding: var(--sv-space-1) var(--sv-space-3);
|
|
651
|
+
border: 1px solid var(--sv-border);
|
|
652
|
+
border-radius: var(--sv-radius-sm);
|
|
653
|
+
background: var(--sv-surface-2);
|
|
654
|
+
color: var(--sv-text);
|
|
655
|
+
font: inherit;
|
|
656
|
+
cursor: pointer;
|
|
657
|
+
}
|
|
658
|
+
.sv-field--file::-webkit-file-upload-button {
|
|
659
|
+
margin-inline-end: var(--sv-space-3);
|
|
660
|
+
padding: var(--sv-space-1) var(--sv-space-3);
|
|
661
|
+
border: 1px solid var(--sv-border);
|
|
662
|
+
border-radius: var(--sv-radius-sm);
|
|
663
|
+
background: var(--sv-surface-2);
|
|
664
|
+
color: var(--sv-text);
|
|
665
|
+
font: inherit;
|
|
666
|
+
cursor: pointer;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/* No appearance:none — the native check/radio chrome follows color-scheme
|
|
670
|
+
from theme.css, and accent-color tints it with the system accent. */
|
|
671
|
+
.sv-check,
|
|
672
|
+
.sv-radio {
|
|
673
|
+
width: var(--sv-space-4);
|
|
674
|
+
height: var(--sv-space-4);
|
|
675
|
+
accent-color: var(--sv-accent-ink);
|
|
676
|
+
margin: 0;
|
|
677
|
+
cursor: pointer;
|
|
678
|
+
}
|
|
679
|
+
.sv-check:focus-visible,
|
|
680
|
+
.sv-radio:focus-visible {
|
|
681
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
682
|
+
outline-offset: 2px;
|
|
683
|
+
}
|
|
684
|
+
.sv-check:disabled,
|
|
685
|
+
.sv-radio:disabled {
|
|
686
|
+
cursor: not-allowed;
|
|
687
|
+
opacity: 0.5;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.sv-choice {
|
|
691
|
+
display: inline-flex;
|
|
692
|
+
align-items: center;
|
|
693
|
+
gap: var(--sv-space-2);
|
|
694
|
+
cursor: pointer;
|
|
695
|
+
color: var(--sv-text);
|
|
696
|
+
}
|
|
697
|
+
.sv-radio-group {
|
|
698
|
+
border: 0;
|
|
699
|
+
margin: 0;
|
|
700
|
+
padding: 0;
|
|
701
|
+
display: flex;
|
|
702
|
+
flex-direction: column;
|
|
703
|
+
gap: var(--sv-space-2);
|
|
704
|
+
}
|
|
705
|
+
.sv-radio-group--horizontal {
|
|
706
|
+
flex-direction: row;
|
|
707
|
+
flex-wrap: wrap;
|
|
708
|
+
gap: var(--sv-space-4);
|
|
709
|
+
}
|
|
710
|
+
.sv-radio-group__legend {
|
|
711
|
+
padding: 0;
|
|
712
|
+
margin-bottom: var(--sv-space-2);
|
|
713
|
+
color: var(--sv-text-2);
|
|
714
|
+
font-size: var(--sv-text-sm);
|
|
715
|
+
}
|
|
716
|
+
/* Visually hidden, still announced. Never display:none or visibility:hidden —
|
|
717
|
+
both remove the element from the accessibility tree. */
|
|
718
|
+
.sv-sr-only {
|
|
719
|
+
position: absolute;
|
|
720
|
+
width: 1px;
|
|
721
|
+
height: 1px;
|
|
722
|
+
padding: 0;
|
|
723
|
+
margin: -1px;
|
|
724
|
+
overflow: hidden;
|
|
725
|
+
clip-path: inset(50%);
|
|
726
|
+
white-space: nowrap;
|
|
727
|
+
border: 0;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/* ---------- Table ---------- */
|
|
731
|
+
/* Presentational only — sorting, paging and selection are a data-table
|
|
732
|
+
concern with a different API surface. The header decoration here is the
|
|
733
|
+
one consumers were repeating by hand on every table screen. */
|
|
734
|
+
.sv-table-container {
|
|
735
|
+
width: 100%;
|
|
736
|
+
overflow-x: auto;
|
|
737
|
+
}
|
|
738
|
+
.sv-table {
|
|
739
|
+
width: 100%;
|
|
740
|
+
border-collapse: collapse;
|
|
741
|
+
caption-side: bottom;
|
|
742
|
+
font-size: var(--sv-text-sm);
|
|
743
|
+
color: var(--sv-text);
|
|
744
|
+
}
|
|
745
|
+
.sv-table__head {
|
|
746
|
+
background: var(--sv-bg);
|
|
747
|
+
}
|
|
748
|
+
.sv-table__th {
|
|
749
|
+
height: var(--sv-space-10);
|
|
750
|
+
padding: 0 var(--sv-space-3);
|
|
751
|
+
text-align: start;
|
|
752
|
+
font-size: var(--sv-text-xs);
|
|
753
|
+
text-transform: uppercase;
|
|
754
|
+
letter-spacing: 0.04em;
|
|
755
|
+
color: var(--sv-text-3);
|
|
756
|
+
font-weight: 600;
|
|
757
|
+
border-bottom: 1px solid var(--sv-border);
|
|
758
|
+
}
|
|
759
|
+
.sv-table__td {
|
|
760
|
+
padding: var(--sv-space-3);
|
|
761
|
+
vertical-align: middle;
|
|
762
|
+
}
|
|
763
|
+
.sv-table__row {
|
|
764
|
+
border-bottom: 1px solid var(--sv-border);
|
|
765
|
+
transition: background var(--sv-duration-fast) var(--sv-ease-hover);
|
|
766
|
+
}
|
|
767
|
+
.sv-table__body .sv-table__row:last-child {
|
|
768
|
+
border-bottom: 0;
|
|
769
|
+
}
|
|
770
|
+
.sv-table__row:hover {
|
|
771
|
+
background: var(--sv-surface-2);
|
|
772
|
+
}
|
|
773
|
+
.sv-table__foot {
|
|
774
|
+
border-top: 1px solid var(--sv-border);
|
|
775
|
+
background: var(--sv-surface);
|
|
776
|
+
font-weight: 600;
|
|
777
|
+
}
|
|
778
|
+
.sv-table__caption {
|
|
779
|
+
margin-top: var(--sv-space-4);
|
|
780
|
+
color: var(--sv-text-2);
|
|
781
|
+
font-size: var(--sv-text-sm);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/* ---------- Button ---------- */
|
|
785
|
+
/* Default variant/size need no modifier class — .sv-btn alone is a complete,
|
|
786
|
+
Tailwind-independent button, the same pattern .sv-field uses for its
|
|
787
|
+
default 'input' variant. Modifiers only override what a variant/size
|
|
788
|
+
changes. */
|
|
789
|
+
.sv-btn {
|
|
790
|
+
appearance: none;
|
|
791
|
+
display: inline-flex;
|
|
792
|
+
align-items: center;
|
|
793
|
+
justify-content: center;
|
|
794
|
+
gap: var(--sv-space-2);
|
|
795
|
+
height: var(--sv-space-10);
|
|
796
|
+
padding: 0 var(--sv-space-4);
|
|
797
|
+
margin: 0;
|
|
798
|
+
border: 1px solid transparent;
|
|
799
|
+
border-radius: var(--sv-radius-sm);
|
|
800
|
+
background: var(--sv-surface);
|
|
801
|
+
color: var(--sv-text);
|
|
802
|
+
font: inherit;
|
|
803
|
+
font-family: var(--sv-font-body);
|
|
804
|
+
font-weight: 500;
|
|
805
|
+
white-space: nowrap;
|
|
806
|
+
cursor: pointer;
|
|
807
|
+
transition:
|
|
808
|
+
background var(--sv-duration-fast) var(--sv-ease-hover),
|
|
809
|
+
color var(--sv-duration-fast) var(--sv-ease-hover),
|
|
810
|
+
border-color var(--sv-duration-fast) var(--sv-ease-hover);
|
|
811
|
+
}
|
|
812
|
+
.sv-btn:hover {
|
|
813
|
+
background: var(--sv-surface-2);
|
|
814
|
+
}
|
|
815
|
+
.sv-btn:focus-visible {
|
|
816
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
817
|
+
outline-offset: 2px;
|
|
818
|
+
}
|
|
819
|
+
.sv-btn:disabled {
|
|
820
|
+
cursor: not-allowed;
|
|
821
|
+
opacity: 0.5;
|
|
822
|
+
pointer-events: none;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.sv-btn--destructive {
|
|
826
|
+
background: var(--sv-danger);
|
|
827
|
+
color: var(--sv-bg);
|
|
828
|
+
}
|
|
829
|
+
.sv-btn--destructive:hover {
|
|
830
|
+
background: color-mix(in srgb, var(--sv-danger) 90%, transparent);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.sv-btn--outline {
|
|
834
|
+
border-color: var(--sv-border);
|
|
835
|
+
background: var(--sv-bg);
|
|
836
|
+
color: var(--sv-text);
|
|
837
|
+
}
|
|
838
|
+
.sv-btn--outline:hover {
|
|
839
|
+
background: var(--sv-surface);
|
|
840
|
+
color: var(--sv-accent-ink);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.sv-btn--secondary {
|
|
844
|
+
background: var(--sv-surface-2);
|
|
845
|
+
color: var(--sv-text);
|
|
846
|
+
}
|
|
847
|
+
.sv-btn--secondary:hover {
|
|
848
|
+
background: var(--sv-surface);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.sv-btn--ghost {
|
|
852
|
+
background: transparent;
|
|
853
|
+
color: var(--sv-text);
|
|
854
|
+
}
|
|
855
|
+
.sv-btn--ghost:hover {
|
|
856
|
+
background: var(--sv-surface);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.sv-btn--link {
|
|
860
|
+
background: transparent;
|
|
861
|
+
color: var(--sv-accent-ink);
|
|
862
|
+
text-underline-offset: 4px;
|
|
863
|
+
}
|
|
864
|
+
.sv-btn--link:hover {
|
|
865
|
+
text-decoration: underline;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.sv-btn--accent {
|
|
869
|
+
background: var(--sv-accent-ink);
|
|
870
|
+
color: var(--sv-bg);
|
|
871
|
+
}
|
|
872
|
+
.sv-btn--accent:hover {
|
|
873
|
+
background: color-mix(in srgb, var(--sv-accent-ink) 90%, transparent);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.sv-btn--sm {
|
|
877
|
+
height: calc(var(--sv-space-8) + var(--sv-space-1));
|
|
878
|
+
padding: 0 var(--sv-space-3);
|
|
879
|
+
font-size: var(--sv-text-sm);
|
|
880
|
+
}
|
|
881
|
+
.sv-btn--lg {
|
|
882
|
+
height: calc(var(--sv-space-10) + var(--sv-space-1));
|
|
883
|
+
padding: 0 var(--sv-space-8);
|
|
884
|
+
}
|
|
885
|
+
.sv-btn--icon {
|
|
886
|
+
width: var(--sv-space-10);
|
|
887
|
+
padding: 0;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/* ---------- Card ---------- */
|
|
891
|
+
.sv-card {
|
|
892
|
+
border: 1px solid var(--sv-border);
|
|
893
|
+
border-radius: var(--sv-radius-md);
|
|
894
|
+
background: var(--sv-surface);
|
|
895
|
+
color: var(--sv-text);
|
|
896
|
+
}
|
|
897
|
+
.sv-card__header {
|
|
898
|
+
display: flex;
|
|
899
|
+
flex-direction: column;
|
|
900
|
+
gap: var(--sv-space-2);
|
|
901
|
+
padding: var(--sv-space-6);
|
|
902
|
+
}
|
|
903
|
+
.sv-card__title {
|
|
904
|
+
margin: 0;
|
|
905
|
+
font-size: var(--sv-text-2xl);
|
|
906
|
+
font-weight: 600;
|
|
907
|
+
line-height: 1;
|
|
908
|
+
letter-spacing: -0.025em;
|
|
909
|
+
}
|
|
910
|
+
.sv-card__description {
|
|
911
|
+
margin: 0;
|
|
912
|
+
font-size: var(--sv-text-sm);
|
|
913
|
+
color: var(--sv-text-2);
|
|
914
|
+
}
|
|
915
|
+
.sv-card__content {
|
|
916
|
+
padding: var(--sv-space-6);
|
|
917
|
+
padding-top: 0;
|
|
918
|
+
}
|
|
919
|
+
.sv-card__footer {
|
|
920
|
+
display: flex;
|
|
921
|
+
align-items: center;
|
|
922
|
+
padding: var(--sv-space-6);
|
|
923
|
+
padding-top: 0;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/* ---------- Alert ---------- */
|
|
927
|
+
.sv-alert {
|
|
928
|
+
position: relative;
|
|
929
|
+
width: 100%;
|
|
930
|
+
padding: var(--sv-space-4);
|
|
931
|
+
border: 1px solid var(--sv-border);
|
|
932
|
+
border-radius: var(--sv-radius-md);
|
|
933
|
+
background: var(--sv-surface);
|
|
934
|
+
color: var(--sv-text);
|
|
935
|
+
}
|
|
936
|
+
.sv-alert > svg {
|
|
937
|
+
position: absolute;
|
|
938
|
+
top: var(--sv-space-4);
|
|
939
|
+
left: var(--sv-space-4);
|
|
940
|
+
color: var(--sv-text);
|
|
941
|
+
}
|
|
942
|
+
.sv-alert > svg ~ * {
|
|
943
|
+
padding-left: calc(var(--sv-space-6) + var(--sv-space-1));
|
|
944
|
+
}
|
|
945
|
+
.sv-alert__title {
|
|
946
|
+
margin: 0 0 var(--sv-space-1);
|
|
947
|
+
font-weight: 500;
|
|
948
|
+
line-height: 1.25;
|
|
949
|
+
letter-spacing: -0.025em;
|
|
950
|
+
}
|
|
951
|
+
.sv-alert__description {
|
|
952
|
+
font-size: var(--sv-text-sm);
|
|
953
|
+
color: var(--sv-text-2);
|
|
954
|
+
}
|
|
955
|
+
.sv-alert__description p {
|
|
956
|
+
line-height: 1.625;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/* ---------- Badge ---------- */
|
|
960
|
+
/* Default variant uses var(--sv-accent) rather than a fixed hue, so the
|
|
961
|
+
badge follows [data-accent] instead of locking to cyan (One-Accent Rule —
|
|
962
|
+
orchestrator audit, tasks.md pre-T17). The destructive text color is
|
|
963
|
+
var(--sv-bg) rather than var(--sv-danger-ink): --sv-danger-ink equals
|
|
964
|
+
--sv-danger in dark mode, which would render invisible text on the
|
|
965
|
+
danger fill — var(--sv-bg) mirrors the contrast approach the default
|
|
966
|
+
variant already used (text-sv-bg on a colored fill) and stays legible in
|
|
967
|
+
both themes. */
|
|
968
|
+
.sv-badge {
|
|
969
|
+
display: inline-flex;
|
|
970
|
+
align-items: center;
|
|
971
|
+
padding: var(--sv-space-1) var(--sv-space-2);
|
|
972
|
+
border: 1px solid transparent;
|
|
973
|
+
border-radius: var(--sv-radius-full);
|
|
974
|
+
background: var(--sv-accent);
|
|
975
|
+
color: var(--sv-bg);
|
|
976
|
+
font-size: var(--sv-text-xs);
|
|
977
|
+
font-weight: 600;
|
|
978
|
+
transition:
|
|
979
|
+
background var(--sv-duration-fast) var(--sv-ease-hover),
|
|
980
|
+
color var(--sv-duration-fast) var(--sv-ease-hover),
|
|
981
|
+
border-color var(--sv-duration-fast) var(--sv-ease-hover);
|
|
982
|
+
}
|
|
983
|
+
.sv-badge:focus-visible {
|
|
984
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
985
|
+
outline-offset: 2px;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.sv-badge--secondary {
|
|
989
|
+
background: var(--sv-surface-2);
|
|
990
|
+
color: var(--sv-text);
|
|
991
|
+
}
|
|
992
|
+
.sv-badge--secondary:hover {
|
|
993
|
+
background: var(--sv-surface);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.sv-badge--destructive {
|
|
997
|
+
background: var(--sv-danger);
|
|
998
|
+
color: var(--sv-bg);
|
|
999
|
+
}
|
|
1000
|
+
.sv-badge--destructive:hover {
|
|
1001
|
+
background: color-mix(in srgb, var(--sv-danger) 90%, transparent);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.sv-badge--outline {
|
|
1005
|
+
background: transparent;
|
|
1006
|
+
border-color: var(--sv-border);
|
|
1007
|
+
color: var(--sv-text);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/* ---------- Icons ---------- */
|
|
1011
|
+
/* Heroicons render on the 24 grid with no width/height attribute and no size
|
|
1012
|
+
prop, so CSS is the only thing that sizes them. `md` is the default and is
|
|
1013
|
+
carried by the base rule, which is why it has no modifier. Each step is a
|
|
1014
|
+
spacing token so an icon lines up with the control it sits inside. */
|
|
1015
|
+
.sv-icon {
|
|
1016
|
+
width: var(--sv-space-5);
|
|
1017
|
+
height: var(--sv-space-5);
|
|
1018
|
+
color: currentcolor;
|
|
1019
|
+
flex-shrink: 0;
|
|
1020
|
+
}
|
|
1021
|
+
.sv-icon--sm {
|
|
1022
|
+
width: var(--sv-space-4);
|
|
1023
|
+
height: var(--sv-space-4);
|
|
1024
|
+
}
|
|
1025
|
+
.sv-icon--lg {
|
|
1026
|
+
width: var(--sv-space-6);
|
|
1027
|
+
height: var(--sv-space-6);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/* ---------- Overlays ---------- */
|
|
1031
|
+
/* Shared fade for every portal surface (overlay, dialog panel, popover panel).
|
|
1032
|
+
Driven by `animation`, not `transition` — Radix's Presence decides whether
|
|
1033
|
+
to keep a closing element mounted long enough to animate out by reading the
|
|
1034
|
+
node's computed `animation-name`, and a `transition` never sets it, so
|
|
1035
|
+
Presence would unmount before a frame renders. The `sv-fade-in`/
|
|
1036
|
+
`sv-fade-out` keyframes themselves live in theme.css, next to
|
|
1037
|
+
`sv-skeleton-shimmer` — this section's own selector-body parser (in the CSS
|
|
1038
|
+
contract tests) is flat and cannot handle a rule with nested braces. */
|
|
1039
|
+
|
|
1040
|
+
/* The shared backdrop behind Dialog and AlertDialog. The class this replaces
|
|
1041
|
+
named `bg-background/80`, a color no config in this package ever declared, so
|
|
1042
|
+
the overlay rendered fully transparent and the page behind a modal stayed at
|
|
1043
|
+
full contrast. Mixing over --sv-bg follows [data-theme] with zero consumer
|
|
1044
|
+
configuration, and the layer comes from the named z scale rather than the
|
|
1045
|
+
literal `z-50` that made a dialog and a tooltip stack by accident. */
|
|
1046
|
+
.sv-overlay {
|
|
1047
|
+
position: fixed;
|
|
1048
|
+
inset: 0;
|
|
1049
|
+
z-index: var(--sv-z-backdrop);
|
|
1050
|
+
background: color-mix(in srgb, var(--sv-bg) 80%, transparent);
|
|
1051
|
+
backdrop-filter: blur(var(--sv-space-1));
|
|
1052
|
+
-webkit-backdrop-filter: blur(var(--sv-space-1));
|
|
1053
|
+
}
|
|
1054
|
+
/* AD-009: fade only -- no zoom, no slide. The selector is always anchored to
|
|
1055
|
+
the system class, because a bare [data-state='open'] would reach into the
|
|
1056
|
+
consumer's own markup. */
|
|
1057
|
+
.sv-overlay[data-state='open'] {
|
|
1058
|
+
animation: sv-fade-in var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1059
|
+
}
|
|
1060
|
+
.sv-overlay[data-state='closed'] {
|
|
1061
|
+
animation: sv-fade-out var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/* ---------- Dialog ---------- */
|
|
1065
|
+
/* Centred panel on the modal layer. `shadow-lg` is gone: depth in this system
|
|
1066
|
+
comes from the surface step and the border, never from a shadow. The max
|
|
1067
|
+
width is the old max-w-lg (32rem) expressed on the spacing scale so it stays
|
|
1068
|
+
in step with the rest of the sheet. */
|
|
1069
|
+
.sv-dialog {
|
|
1070
|
+
position: fixed;
|
|
1071
|
+
left: 50%;
|
|
1072
|
+
top: 50%;
|
|
1073
|
+
transform: translate(-50%, -50%);
|
|
1074
|
+
z-index: var(--sv-z-modal);
|
|
1075
|
+
display: grid;
|
|
1076
|
+
gap: var(--sv-space-4);
|
|
1077
|
+
width: 100%;
|
|
1078
|
+
max-width: calc(var(--sv-space-16) * 8);
|
|
1079
|
+
padding: var(--sv-space-6);
|
|
1080
|
+
border: 1px solid var(--sv-border);
|
|
1081
|
+
border-radius: var(--sv-radius-lg);
|
|
1082
|
+
background: var(--sv-surface);
|
|
1083
|
+
color: var(--sv-text);
|
|
1084
|
+
}
|
|
1085
|
+
.sv-dialog[data-state='open'] {
|
|
1086
|
+
animation: sv-fade-in var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1087
|
+
}
|
|
1088
|
+
.sv-dialog[data-state='closed'] {
|
|
1089
|
+
animation: sv-fade-out var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.sv-dialog__header {
|
|
1093
|
+
display: flex;
|
|
1094
|
+
flex-direction: column;
|
|
1095
|
+
gap: var(--sv-space-1);
|
|
1096
|
+
}
|
|
1097
|
+
.sv-dialog__footer {
|
|
1098
|
+
display: flex;
|
|
1099
|
+
flex-direction: row;
|
|
1100
|
+
justify-content: flex-end;
|
|
1101
|
+
gap: var(--sv-space-2);
|
|
1102
|
+
}
|
|
1103
|
+
.sv-dialog__title {
|
|
1104
|
+
font-family: var(--sv-font-display);
|
|
1105
|
+
font-size: var(--sv-text-lg);
|
|
1106
|
+
font-weight: 600;
|
|
1107
|
+
line-height: 1.2;
|
|
1108
|
+
color: var(--sv-text);
|
|
1109
|
+
}
|
|
1110
|
+
.sv-dialog__description {
|
|
1111
|
+
font-size: var(--sv-text-sm);
|
|
1112
|
+
line-height: 1.5;
|
|
1113
|
+
color: var(--sv-text-2);
|
|
1114
|
+
}
|
|
1115
|
+
/* The close button is a bare control: no border, no fill, and a hit target the
|
|
1116
|
+
icon alone would not give it. Focus is an outline (AD-005) -- the ring-* the
|
|
1117
|
+
shadcn layer used is box-shadow based and named a color that did not exist,
|
|
1118
|
+
so this button had no visible focus at all. */
|
|
1119
|
+
.sv-dialog__close {
|
|
1120
|
+
position: absolute;
|
|
1121
|
+
top: var(--sv-space-4);
|
|
1122
|
+
right: var(--sv-space-4);
|
|
1123
|
+
display: inline-flex;
|
|
1124
|
+
align-items: center;
|
|
1125
|
+
justify-content: center;
|
|
1126
|
+
padding: var(--sv-space-1);
|
|
1127
|
+
border: none;
|
|
1128
|
+
border-radius: var(--sv-radius-sm);
|
|
1129
|
+
background: none;
|
|
1130
|
+
color: var(--sv-text-2);
|
|
1131
|
+
cursor: pointer;
|
|
1132
|
+
transition: color var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1133
|
+
}
|
|
1134
|
+
.sv-dialog__close:hover {
|
|
1135
|
+
color: var(--sv-text);
|
|
1136
|
+
}
|
|
1137
|
+
.sv-dialog__close:focus-visible {
|
|
1138
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
1139
|
+
outline-offset: 2px;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/* ---------- Popovers ---------- */
|
|
1143
|
+
/* One floating surface for the SelectContent, the DropdownMenuContent and the
|
|
1144
|
+
TooltipContent. They were three near-identical utility strings before, which
|
|
1145
|
+
is how SelectContent kept a `shadow-md` that Flat-By-Default forbids while
|
|
1146
|
+
the other two had already lost theirs. min-width is the old 8rem expressed on
|
|
1147
|
+
the spacing scale, so the panel stays in step with the rest of the sheet. */
|
|
1148
|
+
.sv-pop {
|
|
1149
|
+
z-index: var(--sv-z-dropdown);
|
|
1150
|
+
min-width: calc(var(--sv-space-16) * 2);
|
|
1151
|
+
overflow: hidden;
|
|
1152
|
+
padding: var(--sv-space-1);
|
|
1153
|
+
border: 1px solid var(--sv-border);
|
|
1154
|
+
border-radius: var(--sv-radius-md);
|
|
1155
|
+
background: var(--sv-surface);
|
|
1156
|
+
color: var(--sv-text);
|
|
1157
|
+
font-family: var(--sv-font-body);
|
|
1158
|
+
font-size: var(--sv-text-base);
|
|
1159
|
+
}
|
|
1160
|
+
.sv-pop[data-state='open'] {
|
|
1161
|
+
animation: sv-fade-in var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1162
|
+
}
|
|
1163
|
+
.sv-pop[data-state='closed'] {
|
|
1164
|
+
animation: sv-fade-out var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/* The scrollable window inside a Select. The cap is the old max-h-96 (24rem)
|
|
1168
|
+
on the spacing scale; without it a long option list runs off the viewport. */
|
|
1169
|
+
.sv-pop__viewport {
|
|
1170
|
+
max-height: calc(var(--sv-space-16) * 6);
|
|
1171
|
+
overflow-y: auto;
|
|
1172
|
+
}
|
|
1173
|
+
/* Select's scroll-up / scroll-down affordances. */
|
|
1174
|
+
.sv-pop__scroll {
|
|
1175
|
+
display: flex;
|
|
1176
|
+
align-items: center;
|
|
1177
|
+
justify-content: center;
|
|
1178
|
+
height: var(--sv-space-5);
|
|
1179
|
+
color: var(--sv-text-2);
|
|
1180
|
+
cursor: default;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/* In "popper" mode Radix anchors SelectContent to the trigger and writes
|
|
1184
|
+
data-side once it resolves which side it flipped to; --sv-space-1 (4px) is
|
|
1185
|
+
the same nudge the old build wrote as Tailwind's `translate-y-1`, now a
|
|
1186
|
+
real declaration instead of four arbitrary-variant utilities. */
|
|
1187
|
+
.sv-pop--popper[data-side='bottom'] {
|
|
1188
|
+
transform: translateY(var(--sv-space-1));
|
|
1189
|
+
}
|
|
1190
|
+
.sv-pop--popper[data-side='top'] {
|
|
1191
|
+
transform: translateY(calc(var(--sv-space-1) * -1));
|
|
1192
|
+
}
|
|
1193
|
+
.sv-pop--popper[data-side='right'] {
|
|
1194
|
+
transform: translateX(var(--sv-space-1));
|
|
1195
|
+
}
|
|
1196
|
+
.sv-pop--popper[data-side='left'] {
|
|
1197
|
+
transform: translateX(calc(var(--sv-space-1) * -1));
|
|
1198
|
+
}
|
|
1199
|
+
/* Matches the panel to the trigger's own footprint so it never renders
|
|
1200
|
+
narrower or wider than the control that opened it. The custom properties
|
|
1201
|
+
are Radix's own — set on the DOM node regardless of build tooling — not a
|
|
1202
|
+
Tailwind arbitrary value, so this needs no bracket syntax to read them. */
|
|
1203
|
+
.sv-pop__viewport--popper {
|
|
1204
|
+
width: 100%;
|
|
1205
|
+
min-width: var(--radix-select-trigger-width);
|
|
1206
|
+
height: var(--radix-select-trigger-height);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/* ---------- Tooltip ---------- */
|
|
1210
|
+
/* Declares only what differs from .sv-pop: a tooltip floats above every other
|
|
1211
|
+
layer, holds one line of text rather than a list, and needs no min-width. */
|
|
1212
|
+
.sv-tooltip {
|
|
1213
|
+
z-index: var(--sv-z-tooltip);
|
|
1214
|
+
min-width: 0;
|
|
1215
|
+
padding: var(--sv-space-1) var(--sv-space-3);
|
|
1216
|
+
font-size: var(--sv-text-sm);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/* ---------- Menu items ---------- */
|
|
1220
|
+
/* The shared list row for Select and DropdownMenu, plus the labels, separators
|
|
1221
|
+
and shortcuts that sit beside it. The indicator gets a real slot in the flex
|
|
1222
|
+
row instead of the `pl-8` these items used to carry: that padding reserved
|
|
1223
|
+
room for an indicator neither component ever rendered, so every option sat
|
|
1224
|
+
indented against nothing. */
|
|
1225
|
+
.sv-menu-item {
|
|
1226
|
+
position: relative;
|
|
1227
|
+
display: flex;
|
|
1228
|
+
align-items: center;
|
|
1229
|
+
gap: var(--sv-space-2);
|
|
1230
|
+
width: 100%;
|
|
1231
|
+
padding: var(--sv-space-1) var(--sv-space-2);
|
|
1232
|
+
border-radius: var(--sv-radius-sm);
|
|
1233
|
+
color: var(--sv-text);
|
|
1234
|
+
font-family: var(--sv-font-body);
|
|
1235
|
+
font-size: var(--sv-text-base);
|
|
1236
|
+
line-height: 1.5;
|
|
1237
|
+
text-align: start;
|
|
1238
|
+
cursor: pointer;
|
|
1239
|
+
user-select: none;
|
|
1240
|
+
transition: background var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1241
|
+
}
|
|
1242
|
+
/* Radix moves [data-highlighted] with the keyboard as well as the pointer, so
|
|
1243
|
+
hover and roving focus have to look identical or the two input modes drift. */
|
|
1244
|
+
.sv-menu-item:hover,
|
|
1245
|
+
.sv-menu-item[data-highlighted] {
|
|
1246
|
+
background: var(--sv-surface-2);
|
|
1247
|
+
color: var(--sv-text);
|
|
1248
|
+
}
|
|
1249
|
+
.sv-menu-item:focus-visible {
|
|
1250
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
1251
|
+
outline-offset: 2px;
|
|
1252
|
+
}
|
|
1253
|
+
.sv-menu-item[data-disabled] {
|
|
1254
|
+
pointer-events: none;
|
|
1255
|
+
opacity: 0.5;
|
|
1256
|
+
}
|
|
1257
|
+
/* An inset row lines up with the rows that do carry an indicator. */
|
|
1258
|
+
.sv-menu-item--inset {
|
|
1259
|
+
padding-left: var(--sv-space-8);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.sv-menu-item__indicator {
|
|
1263
|
+
display: inline-flex;
|
|
1264
|
+
align-items: center;
|
|
1265
|
+
justify-content: center;
|
|
1266
|
+
flex-shrink: 0;
|
|
1267
|
+
width: var(--sv-space-4);
|
|
1268
|
+
height: var(--sv-space-4);
|
|
1269
|
+
}
|
|
1270
|
+
/* An indicator that renders nothing must take no room. A reserved-but-empty
|
|
1271
|
+
slot is exactly the defect this section replaces, and `icon={null}` has to
|
|
1272
|
+
collapse it rather than reintroduce it under a new name. */
|
|
1273
|
+
.sv-menu-item__indicator:empty {
|
|
1274
|
+
display: none;
|
|
1275
|
+
}
|
|
1276
|
+
/* The radio mark is a circle in CSS: the curated heroicons set has no dot on
|
|
1277
|
+
the 24 grid, and currentColor keeps it in step with the row's text. */
|
|
1278
|
+
.sv-menu-item__dot {
|
|
1279
|
+
width: var(--sv-space-2);
|
|
1280
|
+
height: var(--sv-space-2);
|
|
1281
|
+
border-radius: var(--sv-radius-full);
|
|
1282
|
+
background: currentcolor;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.sv-menu-label {
|
|
1286
|
+
padding: var(--sv-space-1) var(--sv-space-2);
|
|
1287
|
+
color: var(--sv-text-2);
|
|
1288
|
+
font-size: var(--sv-text-sm);
|
|
1289
|
+
font-weight: 600;
|
|
1290
|
+
}
|
|
1291
|
+
/* A border rather than a filled box: the hairline is a length the spacing scale
|
|
1292
|
+
does not carry, and border-width is where a literal 1px belongs. */
|
|
1293
|
+
.sv-menu-separator {
|
|
1294
|
+
height: 0;
|
|
1295
|
+
margin: var(--sv-space-1) 0;
|
|
1296
|
+
border: none;
|
|
1297
|
+
border-top: 1px solid var(--sv-border);
|
|
1298
|
+
}
|
|
1299
|
+
.sv-menu-shortcut {
|
|
1300
|
+
margin-inline-start: auto;
|
|
1301
|
+
color: var(--sv-text-3);
|
|
1302
|
+
font-family: var(--sv-font-mono);
|
|
1303
|
+
font-size: var(--sv-text-xs);
|
|
1304
|
+
letter-spacing: 0.05em;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/* ---------- Tabs ---------- */
|
|
1308
|
+
/* The list is a raised strip and the active trigger sits on the base surface,
|
|
1309
|
+
one tonal step above it. That step is the whole affordance: the shadcn
|
|
1310
|
+
original stacked a `shadow-sm` on top, which Flat-By-Default forbids and
|
|
1311
|
+
which this system reads as depth the border already carries. */
|
|
1312
|
+
.sv-tabs {
|
|
1313
|
+
display: flex;
|
|
1314
|
+
flex-direction: column;
|
|
1315
|
+
/* align-items defaults to stretch, which would force .sv-tabs__list — an
|
|
1316
|
+
inline-flex element — to the container's full width, contradicting its
|
|
1317
|
+
own display. flex-start keeps the list sized to its content. */
|
|
1318
|
+
align-items: flex-start;
|
|
1319
|
+
}
|
|
1320
|
+
.sv-tabs__list {
|
|
1321
|
+
display: inline-flex;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
justify-content: center;
|
|
1324
|
+
gap: var(--sv-space-1);
|
|
1325
|
+
height: var(--sv-space-10);
|
|
1326
|
+
padding: var(--sv-space-1);
|
|
1327
|
+
border-radius: var(--sv-radius-md);
|
|
1328
|
+
background: var(--sv-surface-2);
|
|
1329
|
+
color: var(--sv-text-2);
|
|
1330
|
+
}
|
|
1331
|
+
.sv-tabs__trigger {
|
|
1332
|
+
display: inline-flex;
|
|
1333
|
+
align-items: center;
|
|
1334
|
+
justify-content: center;
|
|
1335
|
+
padding: var(--sv-space-1) var(--sv-space-3);
|
|
1336
|
+
border: none;
|
|
1337
|
+
border-radius: var(--sv-radius-sm);
|
|
1338
|
+
background: none;
|
|
1339
|
+
color: inherit;
|
|
1340
|
+
font-family: var(--sv-font-body);
|
|
1341
|
+
font-size: var(--sv-text-base);
|
|
1342
|
+
font-weight: 500;
|
|
1343
|
+
white-space: nowrap;
|
|
1344
|
+
cursor: pointer;
|
|
1345
|
+
transition:
|
|
1346
|
+
background var(--sv-duration-fast) var(--sv-ease-hover),
|
|
1347
|
+
color var(--sv-duration-fast) var(--sv-ease-hover);
|
|
1348
|
+
}
|
|
1349
|
+
/* AD-005: the ring-* utilities this replaces are box-shadow based and named a
|
|
1350
|
+
ring color the package never declared, so a keyboard user tabbing through
|
|
1351
|
+
the strip saw nothing at all. */
|
|
1352
|
+
.sv-tabs__trigger:focus-visible {
|
|
1353
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
1354
|
+
outline-offset: 2px;
|
|
1355
|
+
}
|
|
1356
|
+
.sv-tabs__trigger:disabled {
|
|
1357
|
+
pointer-events: none;
|
|
1358
|
+
opacity: 0.5;
|
|
1359
|
+
}
|
|
1360
|
+
.sv-tabs__trigger[data-state='active'] {
|
|
1361
|
+
background: var(--sv-surface);
|
|
1362
|
+
color: var(--sv-text);
|
|
1363
|
+
}
|
|
1364
|
+
.sv-tabs__content {
|
|
1365
|
+
margin-top: var(--sv-space-2);
|
|
1366
|
+
}
|
|
1367
|
+
.sv-tabs__content:focus-visible {
|
|
1368
|
+
outline: 2px solid var(--sv-accent-ink);
|
|
1369
|
+
outline-offset: 2px;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
/* ---------- Reduced motion ---------- */
|
|
1373
|
+
/* This block lives here, at the end of style.css, and not in theme.css, for a
|
|
1374
|
+
cascade reason: `@media` adds no specificity, and README documents the
|
|
1375
|
+
import order as theme.css then style.css. A `transition: none` written in
|
|
1376
|
+
theme.css therefore loses to the base rule in this file — same specificity,
|
|
1377
|
+
later document order — and the override silently never applies. Five classes
|
|
1378
|
+
shipped in v2 exactly that way. tests/reduced-motion-contract.test.ts pins
|
|
1379
|
+
the property: the reduce rule for a class must sit in the same sheet as its
|
|
1380
|
+
base rule, and after it. */
|
|
1381
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1382
|
+
/* Hover and active colour fades across nav, pills, buttons, badges, table
|
|
1383
|
+
rows and menu chrome are non-essential motion — instant is the
|
|
1384
|
+
reduced-motion default. The reading progress bar is deliberately absent:
|
|
1385
|
+
its transition tracks the user's own scroll input 1:1, so it is not
|
|
1386
|
+
decoration. */
|
|
1387
|
+
.sv-header__link,
|
|
1388
|
+
.sv-footer__link,
|
|
1389
|
+
.sv-pill--interactive,
|
|
1390
|
+
.sv-code-block__copy,
|
|
1391
|
+
.sv-toc__link,
|
|
1392
|
+
.sv-table__row,
|
|
1393
|
+
.sv-btn,
|
|
1394
|
+
.sv-badge,
|
|
1395
|
+
.sv-dialog__close,
|
|
1396
|
+
.sv-menu-item,
|
|
1397
|
+
.sv-tabs__trigger {
|
|
1398
|
+
transition: none;
|
|
1399
|
+
}
|
|
1400
|
+
/* AD-009 lets the portal family fade because open/closed carries state, but
|
|
1401
|
+
the fade is still an enhancement — under reduced motion the panel simply
|
|
1402
|
+
appears/disappears. `animation: none` (not `transition: none` — the fade
|
|
1403
|
+
is driven by @keyframes so Presence's animationend-based unmount timing
|
|
1404
|
+
detects it) means Presence sees no animation and unmounts on close the
|
|
1405
|
+
same instant it would if the browser had no reduced-motion support at
|
|
1406
|
+
all — the closed panel never has a chance to snap into view. */
|
|
1407
|
+
.sv-overlay,
|
|
1408
|
+
.sv-dialog,
|
|
1409
|
+
.sv-pop {
|
|
1410
|
+
animation: none;
|
|
1411
|
+
}
|
|
1412
|
+
}
|