@rockshin/tao-ui 0.0.1 → 0.0.3
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/dist/components/breadcrumb/breadcrumb.css +1091 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +268 -0
- package/dist/components/button/button.css +46 -21
- package/dist/components/checkbox/checkbox.css +33 -12
- package/dist/components/collapsible/collapsible.css +1026 -0
- package/dist/components/collapsible/collapsible.d.ts +39 -0
- package/dist/components/collapsible/collapsible.js +168 -0
- package/dist/components/context-menu/context-menu.css +1149 -0
- package/dist/components/context-menu/context-menu.d.ts +19 -0
- package/dist/components/context-menu/context-menu.js +106 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +1 -1
- package/dist/components/date-picker/calendar/time-panel.d.ts +1 -1
- package/dist/components/date-picker/calendar/year-grid.d.ts +1 -1
- package/dist/components/date-picker/date-picker.css +87 -17
- package/dist/components/date-picker/date-picker.js +9 -7
- package/dist/components/date-picker/range-picker.js +9 -7
- package/dist/components/drawer/drawer.css +128 -15
- package/dist/components/drawer/drawer.d.ts +36 -3
- package/dist/components/drawer/drawer.js +323 -121
- package/dist/components/dropdown/dropdown.css +999 -0
- package/dist/components/dropdown/dropdown.d.ts +45 -0
- package/dist/components/dropdown/dropdown.js +383 -0
- package/dist/components/form-field/form.css +33 -12
- package/dist/components/input/input.css +86 -14
- package/dist/components/menu/menu-render.d.ts +89 -0
- package/dist/components/menu/menu-render.js +379 -0
- package/dist/components/menu/menu.css +1145 -0
- package/dist/components/modal/confirm-dialog.d.ts +37 -0
- package/dist/components/modal/confirm-dialog.js +193 -0
- package/dist/components/modal/confirm.d.ts +13 -0
- package/dist/components/modal/confirm.js +56 -0
- package/dist/components/modal/index.d.ts +21 -0
- package/dist/components/modal/index.js +18 -0
- package/dist/components/modal/modal.css +1169 -0
- package/dist/components/modal/modal.d.ts +50 -0
- package/dist/components/modal/modal.js +362 -0
- package/dist/components/modal/use-modal.d.ts +21 -0
- package/dist/components/modal/use-modal.js +83 -0
- package/dist/components/pagination/pagination.css +33 -12
- package/dist/components/pagination/pagination.js +3 -1
- package/dist/components/radio/radio.css +33 -12
- package/dist/components/scroll-area/scroll-area.css +33 -12
- package/dist/components/select/mobile-select.css +75 -13
- package/dist/components/select/mobile-select.d.ts +4 -1
- package/dist/components/select/mobile-select.js +103 -107
- package/dist/components/select/select.css +167 -26
- package/dist/components/select/select.d.ts +62 -4
- package/dist/components/select/select.js +359 -377
- package/dist/components/spinner/spinner.css +1084 -0
- package/dist/components/spinner/spinner.d.ts +26 -0
- package/dist/components/spinner/spinner.js +229 -0
- package/dist/components/splitter/splitter.css +33 -12
- package/dist/components/switch/switch.css +33 -12
- package/dist/components/table/table.css +57 -18
- package/dist/components/table/table.d.ts +17 -2
- package/dist/components/table/table.js +214 -206
- package/dist/components/tabs/tabs.css +36 -17
- package/dist/components/tag/tag.css +33 -12
- package/dist/components/textarea/textarea.css +1246 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +181 -0
- package/dist/index.d.ts +25 -18
- package/dist/index.js +22 -15
- package/dist/layouts/stack/layout.css +33 -12
- package/dist/provider/tao-provider.d.ts +17 -1
- package/dist/provider/tao-provider.js +53 -15
- package/dist/theme/control.css +86 -13
- package/dist/theme/theme.css +33 -12
- package/llms.txt +7 -6
- package/package.json +18 -13
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
--tao-color-fill-quaternary: color-mix(in oklch, var(--tao-color-text-base) 3%, var(--tao-color-bg-base));
|
|
88
88
|
--tao-color-bg-layout: color-mix(in oklch, var(--tao-color-text-base) 4%, var(--tao-color-bg-base));
|
|
89
89
|
--tao-color-border: color-mix(in oklch, var(--tao-color-text-base) 18%, var(--tao-color-bg-base));
|
|
90
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
91
90
|
--tao-control-outline: color-mix(in oklch, var(--tao-color-primary) 10%, transparent);
|
|
92
91
|
--tao-color-error-outline: color-mix(in oklch, var(--tao-color-error) 10%, transparent);
|
|
93
92
|
--tao-color-warning-outline: color-mix(in oklch, var(--tao-color-warning) 10%, transparent);
|
|
@@ -350,11 +349,16 @@
|
|
|
350
349
|
--tao-radius: 6px;
|
|
351
350
|
--tao-font-size: 14px;
|
|
352
351
|
--tao-control-height: 36px;
|
|
352
|
+
--tao-control-width: 200px;
|
|
353
|
+
--tao-control-range-width: 360px;
|
|
353
354
|
--tao-size-unit: 4px;
|
|
354
355
|
--tao-line-width: 1px;
|
|
355
356
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
356
357
|
--tao-font-family-code: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
357
358
|
--tao-motion-unit: .1s;
|
|
359
|
+
--tao-z-index-drawer: 1000;
|
|
360
|
+
--tao-z-index-modal: 1000;
|
|
361
|
+
--tao-z-index-popup: 1100;
|
|
358
362
|
--tao-primary: var(--tao-color-primary);
|
|
359
363
|
--tao-primary-hover: var(--tao-color-primary);
|
|
360
364
|
}
|
|
@@ -572,8 +576,8 @@
|
|
|
572
576
|
}
|
|
573
577
|
|
|
574
578
|
:root, [data-tao-provider] {
|
|
575
|
-
--tao-color-bg-container:
|
|
576
|
-
--tao-color-bg-elevated:
|
|
579
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
580
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
577
581
|
--tao-color-border: var(--tao-color-text-base);
|
|
578
582
|
}
|
|
579
583
|
|
|
@@ -584,16 +588,7 @@
|
|
|
584
588
|
}
|
|
585
589
|
|
|
586
590
|
:root, [data-tao-provider] {
|
|
587
|
-
--tao-color-border-secondary:
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
591
|
-
:root, [data-tao-provider] {
|
|
592
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
:root, [data-tao-provider] {
|
|
591
|
+
--tao-color-border-secondary: #0000170b;
|
|
597
592
|
--tao-radius-xs: 2px;
|
|
598
593
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
599
594
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -676,6 +671,10 @@
|
|
|
676
671
|
visibility: collapse;
|
|
677
672
|
}
|
|
678
673
|
|
|
674
|
+
.visible {
|
|
675
|
+
visibility: visible;
|
|
676
|
+
}
|
|
677
|
+
|
|
679
678
|
.absolute {
|
|
680
679
|
position: absolute;
|
|
681
680
|
}
|
|
@@ -758,6 +757,10 @@
|
|
|
758
757
|
display: inline;
|
|
759
758
|
}
|
|
760
759
|
|
|
760
|
+
.inline-flex {
|
|
761
|
+
display: inline-flex;
|
|
762
|
+
}
|
|
763
|
+
|
|
761
764
|
.table {
|
|
762
765
|
display: table;
|
|
763
766
|
}
|
|
@@ -770,6 +773,10 @@
|
|
|
770
773
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
771
774
|
}
|
|
772
775
|
|
|
776
|
+
.resize {
|
|
777
|
+
resize: both;
|
|
778
|
+
}
|
|
779
|
+
|
|
773
780
|
.flex-wrap {
|
|
774
781
|
flex-wrap: wrap;
|
|
775
782
|
}
|
|
@@ -785,6 +792,14 @@
|
|
|
785
792
|
border-width: 1px;
|
|
786
793
|
}
|
|
787
794
|
|
|
795
|
+
.italic {
|
|
796
|
+
font-style: italic;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.underline {
|
|
800
|
+
text-decoration-line: underline;
|
|
801
|
+
}
|
|
802
|
+
|
|
788
803
|
.shadow {
|
|
789
804
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
790
805
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -814,6 +829,24 @@
|
|
|
814
829
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
815
830
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
816
831
|
}
|
|
832
|
+
|
|
833
|
+
.select-all {
|
|
834
|
+
-webkit-user-select: all;
|
|
835
|
+
user-select: all;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
[data-tao-control] {
|
|
840
|
+
box-sizing: border-box;
|
|
841
|
+
width: var(--tao-control-width);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
[data-tao-control][data-tao-range-trigger] {
|
|
845
|
+
width: var(--tao-control-range-width);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
[data-tao-form-field] [data-tao-control] {
|
|
849
|
+
width: 100%;
|
|
817
850
|
}
|
|
818
851
|
|
|
819
852
|
[data-tao-control] {
|
|
@@ -821,8 +854,8 @@
|
|
|
821
854
|
}
|
|
822
855
|
|
|
823
856
|
[data-tao-control][data-tao-variant="outlined"] {
|
|
824
|
-
background: var(--tao-color-bg-container);
|
|
825
857
|
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
858
|
+
background: none;
|
|
826
859
|
}
|
|
827
860
|
|
|
828
861
|
[data-tao-control][data-tao-variant="outlined"]:hover:not([data-disabled]):not(:focus-within):not([data-state="open"]) {
|
|
@@ -848,6 +881,25 @@
|
|
|
848
881
|
box-shadow: 0 0 0 2px var(--tao-color-error-outline);
|
|
849
882
|
}
|
|
850
883
|
|
|
884
|
+
[data-tao-control][data-tao-variant="outlined"][data-tao-warning] {
|
|
885
|
+
border-color: var(--tao-warning);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
[data-tao-control][data-tao-variant="outlined"][data-tao-warning]:hover:not([data-disabled]):not(:focus-within) {
|
|
889
|
+
border-color: var(--tao-color-warning);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
893
|
+
[data-tao-control][data-tao-variant="outlined"][data-tao-warning]:hover:not([data-disabled]):not(:focus-within) {
|
|
894
|
+
border-color: color-mix(in oklch, var(--tao-color-warning) 80%, white);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
[data-tao-control][data-tao-variant="outlined"][data-tao-warning]:focus-within, [data-tao-control][data-tao-variant="outlined"][data-tao-warning][data-state="open"] {
|
|
899
|
+
border-color: var(--tao-warning);
|
|
900
|
+
box-shadow: 0 0 0 2px var(--tao-color-warning-outline);
|
|
901
|
+
}
|
|
902
|
+
|
|
851
903
|
[data-tao-control][data-tao-variant="outlined"][data-disabled], [data-tao-control][data-tao-variant="outlined"]:has(input:disabled) {
|
|
852
904
|
background: var(--tao-color-bg-disabled);
|
|
853
905
|
border-color: var(--tao-color-border);
|
|
@@ -892,6 +944,26 @@
|
|
|
892
944
|
box-shadow: 0 0 0 2px var(--tao-color-error-outline);
|
|
893
945
|
}
|
|
894
946
|
|
|
947
|
+
[data-tao-control][data-tao-variant="filled"][data-tao-warning] {
|
|
948
|
+
background: var(--tao-warning-bg);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
[data-tao-control][data-tao-variant="filled"][data-tao-warning]:hover:not([data-disabled]):not(:focus-within) {
|
|
952
|
+
background: var(--tao-color-warning);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
956
|
+
[data-tao-control][data-tao-variant="filled"][data-tao-warning]:hover:not([data-disabled]):not(:focus-within) {
|
|
957
|
+
background: color-mix(in oklch, var(--tao-color-warning) 10%, var(--tao-color-bg-base));
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
[data-tao-control][data-tao-variant="filled"][data-tao-warning]:focus-within, [data-tao-control][data-tao-variant="filled"][data-tao-warning][data-state="open"] {
|
|
962
|
+
background: var(--tao-color-bg-container);
|
|
963
|
+
border-color: var(--tao-warning);
|
|
964
|
+
box-shadow: 0 0 0 2px var(--tao-color-warning-outline);
|
|
965
|
+
}
|
|
966
|
+
|
|
895
967
|
[data-tao-control][data-tao-variant="filled"][data-disabled], [data-tao-control][data-tao-variant="filled"]:has(input:disabled) {
|
|
896
968
|
background: var(--tao-color-bg-disabled);
|
|
897
969
|
border-color: var(--tao-color-border);
|
|
@@ -923,7 +995,6 @@
|
|
|
923
995
|
[data-tao-select] {
|
|
924
996
|
align-items: center;
|
|
925
997
|
gap: var(--tao-padding-xs);
|
|
926
|
-
width: 100%;
|
|
927
998
|
font-family: var(--tao-font-family);
|
|
928
999
|
cursor: pointer;
|
|
929
1000
|
outline: none;
|
|
@@ -969,15 +1040,6 @@ button[data-tao-select] {
|
|
|
969
1040
|
border-radius: var(--tao-radius-md);
|
|
970
1041
|
}
|
|
971
1042
|
|
|
972
|
-
[data-tao-select] > span:first-of-type {
|
|
973
|
-
text-align: start;
|
|
974
|
-
text-overflow: ellipsis;
|
|
975
|
-
white-space: nowrap;
|
|
976
|
-
flex: 1;
|
|
977
|
-
min-width: 0;
|
|
978
|
-
overflow: hidden;
|
|
979
|
-
}
|
|
980
|
-
|
|
981
1043
|
[data-tao-select-prefix] {
|
|
982
1044
|
color: var(--tao-color-text-tertiary);
|
|
983
1045
|
flex-shrink: 0;
|
|
@@ -985,6 +1047,23 @@ button[data-tao-select] {
|
|
|
985
1047
|
display: flex;
|
|
986
1048
|
}
|
|
987
1049
|
|
|
1050
|
+
[data-tao-select] > span[data-tao-select-value-icon] {
|
|
1051
|
+
border-radius: var(--tao-radius-sm);
|
|
1052
|
+
flex: none;
|
|
1053
|
+
justify-content: center;
|
|
1054
|
+
align-items: center;
|
|
1055
|
+
width: 1.25rem;
|
|
1056
|
+
height: 1.25rem;
|
|
1057
|
+
display: inline-flex;
|
|
1058
|
+
overflow: hidden;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
[data-tao-select-value-icon] > * {
|
|
1062
|
+
object-fit: cover;
|
|
1063
|
+
width: 100%;
|
|
1064
|
+
height: 100%;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
988
1067
|
[data-tao-select-icons] {
|
|
989
1068
|
flex-shrink: 0;
|
|
990
1069
|
align-items: center;
|
|
@@ -1012,6 +1091,10 @@ button[data-tao-select] {
|
|
|
1012
1091
|
transform: rotate(180deg);
|
|
1013
1092
|
}
|
|
1014
1093
|
|
|
1094
|
+
[data-tao-select][data-state="open"] [data-tao-select-icon][data-tao-custom-suffix], [data-tao-select][data-state="open"] [data-tao-select-icon][data-tao-select-loading-slot] {
|
|
1095
|
+
transform: none;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1015
1098
|
[data-tao-select-clear] {
|
|
1016
1099
|
color: var(--tao-color-text-quaternary);
|
|
1017
1100
|
cursor: pointer;
|
|
@@ -1023,7 +1106,7 @@ button[data-tao-select] {
|
|
|
1023
1106
|
}
|
|
1024
1107
|
|
|
1025
1108
|
[data-tao-select-loading] {
|
|
1026
|
-
color: var(--tao-color-text-
|
|
1109
|
+
color: var(--tao-color-text-tertiary);
|
|
1027
1110
|
animation: .8s linear infinite tao-spin;
|
|
1028
1111
|
}
|
|
1029
1112
|
|
|
@@ -1046,7 +1129,7 @@ button[data-tao-select] {
|
|
|
1046
1129
|
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
1047
1130
|
border-radius: var(--tao-radius-lg);
|
|
1048
1131
|
box-shadow: var(--tao-box-shadow-secondary);
|
|
1049
|
-
z-index:
|
|
1132
|
+
z-index: var(--tao-z-index-popup);
|
|
1050
1133
|
min-width: var(--radix-select-trigger-width);
|
|
1051
1134
|
animation-duration: var(--tao-motion-duration-fast);
|
|
1052
1135
|
animation-timing-function: var(--tao-motion-ease-out-quint);
|
|
@@ -1057,6 +1140,10 @@ button[data-tao-select] {
|
|
|
1057
1140
|
animation-name: tao-select-in;
|
|
1058
1141
|
}
|
|
1059
1142
|
|
|
1143
|
+
[data-tao-select-content][data-tao-popup-width="content"] {
|
|
1144
|
+
min-width: max-content;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1060
1147
|
@keyframes tao-select-in {
|
|
1061
1148
|
0% {
|
|
1062
1149
|
opacity: 0;
|
|
@@ -1098,6 +1185,19 @@ button[data-tao-select] {
|
|
|
1098
1185
|
max-height: 256px;
|
|
1099
1186
|
}
|
|
1100
1187
|
|
|
1188
|
+
[data-tao-select-group]:not(:first-child) {
|
|
1189
|
+
margin-block-start: var(--tao-padding-xxs);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
[data-tao-select-group-label] {
|
|
1193
|
+
padding: var(--tao-padding-xs) var(--tao-padding-sm) var(--tao-padding-xxs);
|
|
1194
|
+
font-size: var(--tao-font-size-xs);
|
|
1195
|
+
font-weight: var(--tao-font-weight-medium);
|
|
1196
|
+
color: var(--tao-color-text-tertiary);
|
|
1197
|
+
-webkit-user-select: none;
|
|
1198
|
+
user-select: none;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1101
1201
|
[data-tao-select-item] {
|
|
1102
1202
|
min-height: var(--tao-control-height);
|
|
1103
1203
|
padding-inline: var(--tao-padding-sm);
|
|
@@ -1128,6 +1228,47 @@ button[data-tao-select] {
|
|
|
1128
1228
|
cursor: not-allowed;
|
|
1129
1229
|
}
|
|
1130
1230
|
|
|
1231
|
+
[data-tao-select-item][data-tao-has-desc] {
|
|
1232
|
+
min-height: auto;
|
|
1233
|
+
padding-block: var(--tao-padding-xs);
|
|
1234
|
+
align-items: center;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
[data-tao-select-item-icon] {
|
|
1238
|
+
border-radius: var(--tao-radius-md);
|
|
1239
|
+
width: 2rem;
|
|
1240
|
+
height: 2rem;
|
|
1241
|
+
flex-shrink: 0;
|
|
1242
|
+
justify-content: center;
|
|
1243
|
+
align-items: center;
|
|
1244
|
+
margin-inline-end: var(--tao-padding-xs);
|
|
1245
|
+
display: inline-flex;
|
|
1246
|
+
overflow: hidden;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
[data-tao-select-item-icon] > * {
|
|
1250
|
+
object-fit: cover;
|
|
1251
|
+
width: 100%;
|
|
1252
|
+
height: 100%;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
[data-tao-select-item-main] {
|
|
1256
|
+
flex-direction: column;
|
|
1257
|
+
flex: 1;
|
|
1258
|
+
min-width: 0;
|
|
1259
|
+
display: flex;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
[data-tao-select-item-desc] {
|
|
1263
|
+
font-size: var(--tao-font-size-sm);
|
|
1264
|
+
line-height: var(--tao-line-height-sm);
|
|
1265
|
+
color: var(--tao-color-text-tertiary);
|
|
1266
|
+
text-overflow: ellipsis;
|
|
1267
|
+
white-space: nowrap;
|
|
1268
|
+
margin-block-start: 2px;
|
|
1269
|
+
overflow: hidden;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1131
1272
|
[data-tao-select-check] {
|
|
1132
1273
|
color: var(--tao-primary);
|
|
1133
1274
|
align-items: center;
|
|
@@ -1,32 +1,90 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
3
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
4
|
import './select.css';
|
|
4
5
|
export interface SelectOption {
|
|
5
6
|
label: ReactNode;
|
|
6
7
|
value: string;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
/** Leading icon/avatar shown in the option row and in the trigger when selected. */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Secondary description line shown under the label in the option row. */
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** Nested options turn this entry into a group; `label` becomes the group title. */
|
|
14
|
+
options?: SelectOption[];
|
|
8
15
|
}
|
|
16
|
+
export type SelectSemanticPart = 'root' | 'prefix' | 'suffix' | 'placeholder' | 'clear' | 'popup' | 'search' | 'group' | 'groupLabel' | 'item' | 'itemIcon' | 'itemLabel' | 'itemDesc' | 'empty';
|
|
17
|
+
export type SelectPlacement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
9
18
|
export interface SelectProps {
|
|
10
19
|
options: SelectOption[];
|
|
11
20
|
value?: string;
|
|
12
|
-
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
/** Fired on selection or clear. `option` is undefined when cleared. */
|
|
23
|
+
onChange?: (value: string, option?: SelectOption) => void;
|
|
24
|
+
/** Fired only when an option is picked (not on clear). */
|
|
25
|
+
onSelect?: (value: string, option: SelectOption) => void;
|
|
26
|
+
/** Fired when the value is cleared via the clear button. */
|
|
27
|
+
onClear?: () => void;
|
|
13
28
|
placeholder?: string;
|
|
14
29
|
size?: TaoSize;
|
|
15
30
|
variant?: TaoVariant;
|
|
16
31
|
disabled?: boolean;
|
|
32
|
+
/** Validation status. */
|
|
33
|
+
status?: 'error' | 'warning';
|
|
17
34
|
/** Show search input in dropdown */
|
|
18
35
|
showSearch?: boolean;
|
|
19
36
|
/** Custom filter function, default matches label string */
|
|
20
37
|
filterOption?: (input: string, option: SelectOption) => boolean;
|
|
21
|
-
/**
|
|
22
|
-
|
|
38
|
+
/** Controlled search text. */
|
|
39
|
+
searchValue?: string;
|
|
40
|
+
/** Fired when the search text changes. */
|
|
41
|
+
onSearch?: (value: string) => void;
|
|
42
|
+
/** Allow clearing the value; pass an object to customize the clear icon. */
|
|
43
|
+
allowClear?: boolean | {
|
|
44
|
+
clearIcon?: ReactNode;
|
|
45
|
+
};
|
|
23
46
|
/** Show loading spinner */
|
|
24
47
|
loading?: boolean;
|
|
48
|
+
/** Custom loading icon. */
|
|
49
|
+
loadingIcon?: ReactNode;
|
|
25
50
|
/** Content when no options match */
|
|
26
51
|
notFoundContent?: ReactNode;
|
|
27
52
|
/** Prefix icon/element */
|
|
28
53
|
prefix?: ReactNode;
|
|
54
|
+
/** Custom suffix (arrow) icon. */
|
|
55
|
+
suffixIcon?: ReactNode;
|
|
56
|
+
autoFocus?: boolean;
|
|
57
|
+
id?: string;
|
|
58
|
+
/** Name for hidden form field. */
|
|
59
|
+
name?: string;
|
|
60
|
+
/** Controlled open state of the dropdown. */
|
|
61
|
+
open?: boolean;
|
|
62
|
+
defaultOpen?: boolean;
|
|
63
|
+
onOpenChange?: (open: boolean) => void;
|
|
64
|
+
/** Dropdown position. Defaults to `bottomLeft`. */
|
|
65
|
+
placement?: SelectPlacement;
|
|
66
|
+
/** Match popup width to trigger (true), a fixed px width (number), or fit content (false). */
|
|
67
|
+
popupMatchSelectWidth?: boolean | number;
|
|
68
|
+
/** Max height of the option list. Defaults to 256. */
|
|
69
|
+
listHeight?: number;
|
|
70
|
+
/** Parent node the popup renders into. Defaults to body. */
|
|
71
|
+
getPopupContainer?: (trigger: HTMLElement) => HTMLElement;
|
|
72
|
+
/** Customize the rendering of each dropdown option. */
|
|
73
|
+
optionRender?: (option: SelectOption, info: {
|
|
74
|
+
index: number;
|
|
75
|
+
}) => ReactNode;
|
|
76
|
+
/** Customize the selected label shown in the trigger. */
|
|
77
|
+
labelRender?: (option: SelectOption) => ReactNode;
|
|
78
|
+
/** Wrap/customize the dropdown content. */
|
|
79
|
+
popupRender?: (menu: ReactNode) => ReactNode;
|
|
29
80
|
/** Force mobile mode (bottom sheet) regardless of screen size */
|
|
30
81
|
mobile?: boolean;
|
|
82
|
+
/** Merged onto the trigger root; use to override width etc. */
|
|
83
|
+
className?: string;
|
|
84
|
+
style?: CSSProperties;
|
|
85
|
+
classNames?: SemanticClassNames<SelectSemanticPart>;
|
|
86
|
+
styles?: SemanticStyles<SelectSemanticPart>;
|
|
31
87
|
}
|
|
32
88
|
export declare function Select(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
/** Double chevron (↕) for a switcher-style trigger. Pass to `suffixIcon`. */
|
|
90
|
+
export declare function ChevronsUpDownIcon(): import("react/jsx-runtime").JSX.Element;
|