@ttoss/ui 5.5.9 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +218 -37
- package/dist/index.d.ts +17 -2
- package/package.json +4 -3
package/dist/esm/index.js
CHANGED
|
@@ -25,6 +25,9 @@ var Button = React.forwardRef((props, ref) => {
|
|
|
25
25
|
display: "inline-flex",
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: "4",
|
|
28
|
+
"&:disabled": {
|
|
29
|
+
cursor: "not-allowed"
|
|
30
|
+
},
|
|
28
31
|
...restProps.sx
|
|
29
32
|
},
|
|
30
33
|
children: [loading && /* @__PURE__ */jsx(Icon, {
|
|
@@ -362,7 +365,11 @@ var IconButton = props => {
|
|
|
362
365
|
type: "button",
|
|
363
366
|
...restProps,
|
|
364
367
|
sx: {
|
|
368
|
+
cursor: "pointer",
|
|
365
369
|
borderRadius: "sm",
|
|
370
|
+
"&:disabled": {
|
|
371
|
+
cursor: "not-allowed"
|
|
372
|
+
},
|
|
366
373
|
...restProps.sx
|
|
367
374
|
},
|
|
368
375
|
children: icon ? /* @__PURE__ */jsx9(Icon4, {
|
|
@@ -727,11 +734,185 @@ import { Paragraph } from "theme-ui";
|
|
|
727
734
|
// src/components/Radio.tsx
|
|
728
735
|
import { Radio } from "theme-ui";
|
|
729
736
|
|
|
737
|
+
// src/components/SegmentedControl.tsx
|
|
738
|
+
import * as React11 from "react";
|
|
739
|
+
import { Box as Box3, Flex as Flex2 } from "theme-ui";
|
|
740
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
741
|
+
var SegmentedControl = ({
|
|
742
|
+
options,
|
|
743
|
+
value: propValue,
|
|
744
|
+
defaultValue,
|
|
745
|
+
onChange,
|
|
746
|
+
disabled,
|
|
747
|
+
className,
|
|
748
|
+
sx,
|
|
749
|
+
...rest
|
|
750
|
+
}) => {
|
|
751
|
+
const [internalValue, setInternalValue] = React11.useState(propValue || defaultValue);
|
|
752
|
+
React11.useEffect(() => {
|
|
753
|
+
if (propValue !== void 0) {
|
|
754
|
+
setInternalValue(propValue);
|
|
755
|
+
}
|
|
756
|
+
}, [propValue]);
|
|
757
|
+
const handleChange = newValue => {
|
|
758
|
+
setInternalValue(newValue);
|
|
759
|
+
if (onChange) {
|
|
760
|
+
onChange(newValue);
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
const normalizedOptions = options.map(option => {
|
|
764
|
+
return typeof option === "string" || typeof option === "number" ? {
|
|
765
|
+
label: option,
|
|
766
|
+
value: option
|
|
767
|
+
} : option;
|
|
768
|
+
});
|
|
769
|
+
const currentValue = propValue !== void 0 ? propValue : internalValue;
|
|
770
|
+
return /* @__PURE__ */jsx16(Flex2, {
|
|
771
|
+
className,
|
|
772
|
+
sx: {
|
|
773
|
+
width: "100%",
|
|
774
|
+
borderRadius: "4xl",
|
|
775
|
+
border: "sm",
|
|
776
|
+
borderColor: "display.border.primary.default",
|
|
777
|
+
overflow: "hidden",
|
|
778
|
+
position: "relative",
|
|
779
|
+
".rc-segmented": {
|
|
780
|
+
width: "100%",
|
|
781
|
+
padding: "0",
|
|
782
|
+
backgroundColor: "display.background.primary.default",
|
|
783
|
+
position: "relative",
|
|
784
|
+
display: "flex",
|
|
785
|
+
flexGrow: 1
|
|
786
|
+
},
|
|
787
|
+
".rc-segmented-group, .custom-segmented-group": {
|
|
788
|
+
borderRadius: "4xl",
|
|
789
|
+
gap: "0",
|
|
790
|
+
display: "flex",
|
|
791
|
+
width: "100%",
|
|
792
|
+
position: "relative"
|
|
793
|
+
},
|
|
794
|
+
".rc-segmented-item": {
|
|
795
|
+
borderRadius: "4xl",
|
|
796
|
+
margin: 0,
|
|
797
|
+
paddingX: "5",
|
|
798
|
+
paddingY: "3",
|
|
799
|
+
fontSize: "lg",
|
|
800
|
+
display: "flex",
|
|
801
|
+
alignItems: "center",
|
|
802
|
+
justifyContent: "center",
|
|
803
|
+
color: "action.text.accent.default",
|
|
804
|
+
flex: "1 1 auto",
|
|
805
|
+
minWidth: "min-content",
|
|
806
|
+
whiteSpace: "nowrap",
|
|
807
|
+
overflow: "hidden",
|
|
808
|
+
textOverflow: "ellipsis",
|
|
809
|
+
zIndex: 2,
|
|
810
|
+
transition: "background-color 0.2s ease, color 0.2s ease",
|
|
811
|
+
cursor: "pointer",
|
|
812
|
+
"&:focus": {
|
|
813
|
+
outline: "2px solid",
|
|
814
|
+
outlineColor: "action.background.accent.default",
|
|
815
|
+
outlineOffset: "2px",
|
|
816
|
+
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.1)"
|
|
817
|
+
},
|
|
818
|
+
"&:focus-visible": {
|
|
819
|
+
outline: "2px solid",
|
|
820
|
+
outlineColor: "action.background.accent.default",
|
|
821
|
+
outlineOffset: "2px"
|
|
822
|
+
},
|
|
823
|
+
"&:hover:not(.rc-segmented-item-selected)": {
|
|
824
|
+
backgroundColor: "action.background.muted.default"
|
|
825
|
+
},
|
|
826
|
+
'input[type="radio"]': {
|
|
827
|
+
display: "none"
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
".rc-segmented-item-selected": {
|
|
831
|
+
backgroundColor: "action.background.accent.default",
|
|
832
|
+
color: "action.text.accent.active"
|
|
833
|
+
},
|
|
834
|
+
".rc-segmented-thumb": {
|
|
835
|
+
backgroundColor: "action.background.accent.default",
|
|
836
|
+
borderRadius: "4xl",
|
|
837
|
+
zIndex: -1,
|
|
838
|
+
margin: 0,
|
|
839
|
+
position: "absolute",
|
|
840
|
+
height: "100%",
|
|
841
|
+
width: "100%",
|
|
842
|
+
left: 0,
|
|
843
|
+
transition: "transform 0.2s ease, left 0.2s ease"
|
|
844
|
+
},
|
|
845
|
+
".rc-segmented-item-disabled": {
|
|
846
|
+
opacity: 0.5,
|
|
847
|
+
cursor: "not-allowed",
|
|
848
|
+
backgroundColor: "action.background.muted.disabled"
|
|
849
|
+
},
|
|
850
|
+
...sx
|
|
851
|
+
},
|
|
852
|
+
...rest,
|
|
853
|
+
children: /* @__PURE__ */jsx16("div", {
|
|
854
|
+
className: "rc-segmented",
|
|
855
|
+
children: /* @__PURE__ */jsxs7(Flex2, {
|
|
856
|
+
className: "rc-segmented-group custom-segmented-group",
|
|
857
|
+
children: [normalizedOptions.map((option, index) => {
|
|
858
|
+
const isSelected = option.value === currentValue;
|
|
859
|
+
const isLastItem = index === normalizedOptions.length - 1;
|
|
860
|
+
const isItemDisabled = disabled || option.disabled;
|
|
861
|
+
const showDivider = !isLastItem && option.value !== currentValue && normalizedOptions[index + 1].value !== currentValue;
|
|
862
|
+
return /* @__PURE__ */jsxs7(React11.Fragment, {
|
|
863
|
+
children: [/* @__PURE__ */jsxs7(Box3, {
|
|
864
|
+
as: "label",
|
|
865
|
+
className: `rc-segmented-item ${isSelected ? "rc-segmented-item-selected" : ""} ${isItemDisabled ? "rc-segmented-item-disabled" : ""}`,
|
|
866
|
+
onClick: () => {
|
|
867
|
+
if (!disabled && !option.disabled) {
|
|
868
|
+
handleChange(option.value);
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
children: [/* @__PURE__ */jsx16("input", {
|
|
872
|
+
type: "radio",
|
|
873
|
+
value: option.value,
|
|
874
|
+
checked: isSelected,
|
|
875
|
+
disabled: isItemDisabled,
|
|
876
|
+
onChange: e => {
|
|
877
|
+
if (!disabled && !option.disabled && e.target.checked) {
|
|
878
|
+
handleChange(option.value);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}), /* @__PURE__ */jsx16("div", {
|
|
882
|
+
className: "rc-segmented-item-label",
|
|
883
|
+
children: option.label
|
|
884
|
+
})]
|
|
885
|
+
}), showDivider && /* @__PURE__ */jsx16(Box3, {
|
|
886
|
+
className: "segmented-divider",
|
|
887
|
+
sx: {
|
|
888
|
+
height: "60%",
|
|
889
|
+
width: "1px",
|
|
890
|
+
backgroundColor: "action.text.accent.default",
|
|
891
|
+
opacity: 0.4,
|
|
892
|
+
alignSelf: "center",
|
|
893
|
+
zIndex: 3
|
|
894
|
+
}
|
|
895
|
+
})]
|
|
896
|
+
}, `${index}-${option.value}`);
|
|
897
|
+
}), currentValue !== void 0 && /* @__PURE__ */jsx16("div", {
|
|
898
|
+
className: "rc-segmented-thumb",
|
|
899
|
+
style: {
|
|
900
|
+
width: `${100 / normalizedOptions.length}%`,
|
|
901
|
+
transform: `translateX(${normalizedOptions.findIndex(option => {
|
|
902
|
+
return option.value === currentValue;
|
|
903
|
+
}) * 100}%)`
|
|
904
|
+
}
|
|
905
|
+
})]
|
|
906
|
+
})
|
|
907
|
+
})
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
|
|
730
911
|
// src/components/Select.tsx
|
|
731
912
|
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
732
|
-
import * as
|
|
913
|
+
import * as React12 from "react";
|
|
733
914
|
import ReactSelect, { components } from "react-select";
|
|
734
|
-
import { jsx as
|
|
915
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
735
916
|
var Control = props => {
|
|
736
917
|
const isDisabled = props.selectProps.isDisabled;
|
|
737
918
|
const hasError = props.selectProps["aria-invalid"] === "true";
|
|
@@ -750,7 +931,7 @@ var Control = props => {
|
|
|
750
931
|
}
|
|
751
932
|
return "display.background.secondary.default";
|
|
752
933
|
})();
|
|
753
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */jsx17(Box, {
|
|
754
935
|
sx: {
|
|
755
936
|
".react-select__control": {
|
|
756
937
|
borderColor,
|
|
@@ -759,7 +940,7 @@ var Control = props => {
|
|
|
759
940
|
paddingY: "3"
|
|
760
941
|
}
|
|
761
942
|
},
|
|
762
|
-
children: /* @__PURE__ */
|
|
943
|
+
children: /* @__PURE__ */jsx17(components.Control, {
|
|
763
944
|
...props
|
|
764
945
|
})
|
|
765
946
|
});
|
|
@@ -772,7 +953,7 @@ var DropdownIndicator = props => {
|
|
|
772
953
|
}
|
|
773
954
|
return "text";
|
|
774
955
|
})();
|
|
775
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */jsx17(Text, {
|
|
776
957
|
sx: {
|
|
777
958
|
fontSize: "md",
|
|
778
959
|
color,
|
|
@@ -780,7 +961,7 @@ var DropdownIndicator = props => {
|
|
|
780
961
|
display: "flex",
|
|
781
962
|
alignItems: "center"
|
|
782
963
|
},
|
|
783
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
784
965
|
icon: "picker-down"
|
|
785
966
|
})
|
|
786
967
|
});
|
|
@@ -788,7 +969,7 @@ var DropdownIndicator = props => {
|
|
|
788
969
|
var IndicatorsContainer = ({
|
|
789
970
|
children
|
|
790
971
|
}) => {
|
|
791
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */jsx17(Box, {
|
|
792
973
|
sx: {
|
|
793
974
|
marginLeft: "4",
|
|
794
975
|
border: "none"
|
|
@@ -799,7 +980,7 @@ var IndicatorsContainer = ({
|
|
|
799
980
|
var Placeholder = ({
|
|
800
981
|
children
|
|
801
982
|
}) => {
|
|
802
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */jsx17(Text, {
|
|
803
984
|
sx: {
|
|
804
985
|
color: "onMuted",
|
|
805
986
|
alignSelf: "center"
|
|
@@ -818,10 +999,10 @@ var SelectContainer = ({
|
|
|
818
999
|
return (
|
|
819
1000
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
820
1001
|
/* @__PURE__ */
|
|
821
|
-
|
|
1002
|
+
jsx17(Box, {
|
|
822
1003
|
sx,
|
|
823
1004
|
css: css2,
|
|
824
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */jsx17(components.SelectContainer, {
|
|
825
1006
|
...props,
|
|
826
1007
|
children
|
|
827
1008
|
})
|
|
@@ -851,28 +1032,28 @@ var ValueContainer = ({
|
|
|
851
1032
|
}
|
|
852
1033
|
return leadingIcon || "search";
|
|
853
1034
|
})();
|
|
854
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */jsxs8(Flex, {
|
|
855
1036
|
sx: {
|
|
856
1037
|
gap: "4",
|
|
857
1038
|
flex: 1
|
|
858
1039
|
},
|
|
859
|
-
children: [finalLeadingIcon && /* @__PURE__ */
|
|
1040
|
+
children: [finalLeadingIcon && /* @__PURE__ */jsx17(Text, {
|
|
860
1041
|
sx: {
|
|
861
1042
|
alignSelf: "center",
|
|
862
1043
|
pointerEvents: "none",
|
|
863
1044
|
lineHeight: 0,
|
|
864
1045
|
fontSize: "md"
|
|
865
1046
|
},
|
|
866
|
-
children: /* @__PURE__ */
|
|
1047
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
867
1048
|
icon: finalLeadingIcon
|
|
868
1049
|
})
|
|
869
|
-
}), /* @__PURE__ */
|
|
1050
|
+
}), /* @__PURE__ */jsx17(Flex, {
|
|
870
1051
|
sx: {
|
|
871
1052
|
flex: 1,
|
|
872
1053
|
alignItems: "center"
|
|
873
1054
|
},
|
|
874
1055
|
children
|
|
875
|
-
}), (trailingIcon || hasError) && /* @__PURE__ */
|
|
1056
|
+
}), (trailingIcon || hasError) && /* @__PURE__ */jsx17(Text, {
|
|
876
1057
|
className: hasError ? "error-icon" : "",
|
|
877
1058
|
sx: {
|
|
878
1059
|
alignSelf: "center",
|
|
@@ -881,13 +1062,13 @@ var ValueContainer = ({
|
|
|
881
1062
|
fontSize: "md",
|
|
882
1063
|
color: trailingIconColor
|
|
883
1064
|
},
|
|
884
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
885
1066
|
icon: hasError ? "warning-alt" : trailingIcon
|
|
886
1067
|
})
|
|
887
1068
|
})]
|
|
888
1069
|
});
|
|
889
1070
|
};
|
|
890
|
-
var Select =
|
|
1071
|
+
var Select = React12.forwardRef(({
|
|
891
1072
|
...props
|
|
892
1073
|
}, ref) => {
|
|
893
1074
|
const value = props.options?.find(option => {
|
|
@@ -896,7 +1077,7 @@ var Select = React11.forwardRef(({
|
|
|
896
1077
|
}
|
|
897
1078
|
return false;
|
|
898
1079
|
});
|
|
899
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */jsx17(ReactSelect, {
|
|
900
1081
|
ref,
|
|
901
1082
|
components: {
|
|
902
1083
|
Control,
|
|
@@ -932,9 +1113,9 @@ import { Slider } from "theme-ui";
|
|
|
932
1113
|
import { Spinner } from "theme-ui";
|
|
933
1114
|
|
|
934
1115
|
// src/components/Stack.tsx
|
|
935
|
-
import { jsx as
|
|
1116
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
936
1117
|
var Stack = props => {
|
|
937
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */jsx18(Flex, {
|
|
938
1119
|
...props,
|
|
939
1120
|
sx: {
|
|
940
1121
|
flexDirection: "column",
|
|
@@ -946,9 +1127,9 @@ var Stack = props => {
|
|
|
946
1127
|
|
|
947
1128
|
// src/components/Switch.tsx
|
|
948
1129
|
import { Switch as SwitchUi } from "theme-ui";
|
|
949
|
-
import { jsx as
|
|
1130
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
950
1131
|
var Switch = props => {
|
|
951
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */jsx19(SwitchUi, {
|
|
952
1133
|
...props,
|
|
953
1134
|
role: "switch",
|
|
954
1135
|
"aria-checked": props.checked || false,
|
|
@@ -974,16 +1155,16 @@ var Switch = props => {
|
|
|
974
1155
|
|
|
975
1156
|
// src/components/Textarea.tsx
|
|
976
1157
|
import { Icon as Icon9 } from "@ttoss/react-icons";
|
|
977
|
-
import * as
|
|
1158
|
+
import * as React13 from "react";
|
|
978
1159
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
979
|
-
import { jsx as
|
|
980
|
-
var Textarea =
|
|
1160
|
+
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1161
|
+
var Textarea = React13.forwardRef(({
|
|
981
1162
|
trailingIcon,
|
|
982
1163
|
className,
|
|
983
1164
|
sx,
|
|
984
1165
|
...textareaProps
|
|
985
1166
|
}, ref) => {
|
|
986
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */jsxs9(Flex, {
|
|
987
1168
|
className,
|
|
988
1169
|
sx: {
|
|
989
1170
|
...sx,
|
|
@@ -991,7 +1172,7 @@ var Textarea = React12.forwardRef(({
|
|
|
991
1172
|
padding: 0,
|
|
992
1173
|
border: "none"
|
|
993
1174
|
},
|
|
994
|
-
children: [/* @__PURE__ */
|
|
1175
|
+
children: [/* @__PURE__ */jsx20(TextareaUI, {
|
|
995
1176
|
ref,
|
|
996
1177
|
sx: {
|
|
997
1178
|
fontFamily: "body",
|
|
@@ -1003,13 +1184,13 @@ var Textarea = React12.forwardRef(({
|
|
|
1003
1184
|
},
|
|
1004
1185
|
className,
|
|
1005
1186
|
...textareaProps
|
|
1006
|
-
}), trailingIcon && /* @__PURE__ */
|
|
1187
|
+
}), trailingIcon && /* @__PURE__ */jsx20(Text, {
|
|
1007
1188
|
sx: {
|
|
1008
1189
|
position: "absolute",
|
|
1009
1190
|
right: "1.25rem",
|
|
1010
1191
|
top: "0.75rem"
|
|
1011
1192
|
},
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */jsx20(Icon9, {
|
|
1013
1194
|
inline: true,
|
|
1014
1195
|
icon: trailingIcon
|
|
1015
1196
|
})
|
|
@@ -1020,10 +1201,10 @@ Textarea.displayName = "Textarea";
|
|
|
1020
1201
|
|
|
1021
1202
|
// src/components/Tooltip.tsx
|
|
1022
1203
|
import { Tooltip as TooltipReact } from "react-tooltip";
|
|
1023
|
-
import { jsx as
|
|
1204
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1024
1205
|
var Tooltip = props => {
|
|
1025
1206
|
const className = "tooltip-component";
|
|
1026
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */jsx21(Box, {
|
|
1027
1208
|
sx: ({
|
|
1028
1209
|
fonts
|
|
1029
1210
|
}) => {
|
|
@@ -1050,7 +1231,7 @@ var Tooltip = props => {
|
|
|
1050
1231
|
}
|
|
1051
1232
|
};
|
|
1052
1233
|
},
|
|
1053
|
-
children: /* @__PURE__ */
|
|
1234
|
+
children: /* @__PURE__ */jsx21(TooltipReact, {
|
|
1054
1235
|
className,
|
|
1055
1236
|
...props,
|
|
1056
1237
|
children: props.children
|
|
@@ -1062,16 +1243,16 @@ var Tooltip = props => {
|
|
|
1062
1243
|
import { css, Global } from "@emotion/react";
|
|
1063
1244
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
1064
1245
|
import { ThemeUIProvider } from "theme-ui";
|
|
1065
|
-
import { Fragment, jsx as
|
|
1246
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1066
1247
|
var ThemeProvider = ({
|
|
1067
1248
|
children,
|
|
1068
1249
|
theme = BruttalTheme,
|
|
1069
1250
|
fonts = BruttalFonts
|
|
1070
1251
|
}) => {
|
|
1071
|
-
return /* @__PURE__ */
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */jsx22(Fragment2, {
|
|
1253
|
+
children: /* @__PURE__ */jsxs10(ThemeUIProvider, {
|
|
1073
1254
|
theme,
|
|
1074
|
-
children: [/* @__PURE__ */
|
|
1255
|
+
children: [/* @__PURE__ */jsx22(Global, {
|
|
1075
1256
|
styles: css`
|
|
1076
1257
|
${fonts.map(url => {
|
|
1077
1258
|
return `@import url('${url}');`;
|
|
@@ -1090,4 +1271,4 @@ var useTheme = useThemeUI;
|
|
|
1090
1271
|
import { keyframes } from "@emotion/react";
|
|
1091
1272
|
import { useBreakpointIndex, useResponsiveValue } from "@theme-ui/match-media";
|
|
1092
1273
|
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
1093
|
-
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, Select, Slider, Spinner, Stack, Switch, Text, Textarea, ThemeProvider, Tooltip, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
|
1274
|
+
export { ActionButton, Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, InputPassword, Label, Progress as LinearProgress, Link, Paragraph, Radio, SegmentedControl, Select, Slider, Spinner, Stack, Switch, Text, Textarea, ThemeProvider, Tooltip, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { IconType } from '@ttoss/react-icons';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as theme_ui from 'theme-ui';
|
|
5
|
-
import { ButtonProps as ButtonProps$1, BadgeProps as BadgeProps$1, CardProps, BoxProps, CheckboxProps as CheckboxProps$1, TextProps, IconButtonProps as IconButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1,
|
|
5
|
+
import { ButtonProps as ButtonProps$1, BadgeProps as BadgeProps$1, CardProps, BoxProps, CheckboxProps as CheckboxProps$1, TextProps, IconButtonProps as IconButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, FlexProps, SxProp, SwitchProps, TextareaProps as TextareaProps$1, Theme } from 'theme-ui';
|
|
6
6
|
export { BaseStyles, Box, BoxProps, CardProps, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Paragraph, ParagraphProps, Radio, RadioProps, Slider, SliderProps, Spinner, SpinnerProps, SwitchProps, SxProp, Text, TextProps, Theme, ThemeUIStyleObject } from 'theme-ui';
|
|
7
7
|
import { Props } from 'react-select';
|
|
8
8
|
import { ITooltip } from 'react-tooltip';
|
|
@@ -97,6 +97,21 @@ type LinkProps = LinkProps$1 & {
|
|
|
97
97
|
};
|
|
98
98
|
declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
99
99
|
|
|
100
|
+
interface SegmentedControlProps {
|
|
101
|
+
options: (string | number | {
|
|
102
|
+
label: React.ReactNode;
|
|
103
|
+
value: string | number;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
})[];
|
|
106
|
+
value?: string | number;
|
|
107
|
+
defaultValue?: string | number;
|
|
108
|
+
onChange?: (value: string | number) => void;
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
className?: string;
|
|
111
|
+
sx?: FlexProps['sx'];
|
|
112
|
+
}
|
|
113
|
+
declare const SegmentedControl: ({ options, value: propValue, defaultValue, onChange, disabled, className, sx, ...rest }: SegmentedControlProps) => react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
100
115
|
/**
|
|
101
116
|
* We're using React Select component to build ttoss Select.
|
|
102
117
|
* More info about React Select: https://react-select.com/home
|
|
@@ -158,4 +173,4 @@ declare const ThemeProvider: ({ children, theme, fonts, }: ThemeProviderProps) =
|
|
|
158
173
|
|
|
159
174
|
declare const useTheme: () => theme_ui.ThemeUIContextValue;
|
|
160
175
|
|
|
161
|
-
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, useTheme };
|
|
176
|
+
export { ActionButton, type ActionButtonProps, Badge, type BadgeProps, Button, type ButtonProps, Card, Checkbox, type CheckboxProps, CloseButton, type CloseButtonProps, Container, HelpText, type HelpTextProps, IconButton, type IconButtonProps, InfiniteLinearProgress, Input, InputNumber, type InputNumberProps, InputPassword, type InputPasswordProps, type InputProps, Label, type LabelProps, Link, type LinkProps, SegmentedControl, type SegmentedControlProps, Select, type SelectOption, type SelectOptions, type SelectProps, Stack, type StackProps, Switch, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, Tooltip, useTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@theme-ui/match-media": "^0.17.1",
|
|
28
|
+
"rc-segmented": "^2.7.0",
|
|
28
29
|
"react-select": "^5.9.0",
|
|
29
30
|
"react-tooltip": "^5.28.0",
|
|
30
31
|
"theme-ui": "^0.17.1",
|
|
@@ -44,8 +45,8 @@
|
|
|
44
45
|
"react": "^19.0.0",
|
|
45
46
|
"tsup": "^8.3.5",
|
|
46
47
|
"@ttoss/react-icons": "^0.4.11",
|
|
47
|
-
"@ttoss/
|
|
48
|
-
"@ttoss/
|
|
48
|
+
"@ttoss/test-utils": "^2.1.23",
|
|
49
|
+
"@ttoss/config": "^1.35.3"
|
|
49
50
|
},
|
|
50
51
|
"keywords": [
|
|
51
52
|
"React",
|