@ttoss/ui 5.5.10 → 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 +211 -37
- package/dist/index.d.ts +17 -2
- package/package.json +4 -3
package/dist/esm/index.js
CHANGED
|
@@ -734,11 +734,185 @@ import { Paragraph } from "theme-ui";
|
|
|
734
734
|
// src/components/Radio.tsx
|
|
735
735
|
import { Radio } from "theme-ui";
|
|
736
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
|
+
|
|
737
911
|
// src/components/Select.tsx
|
|
738
912
|
import { Icon as Icon8 } from "@ttoss/react-icons";
|
|
739
|
-
import * as
|
|
913
|
+
import * as React12 from "react";
|
|
740
914
|
import ReactSelect, { components } from "react-select";
|
|
741
|
-
import { jsx as
|
|
915
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
742
916
|
var Control = props => {
|
|
743
917
|
const isDisabled = props.selectProps.isDisabled;
|
|
744
918
|
const hasError = props.selectProps["aria-invalid"] === "true";
|
|
@@ -757,7 +931,7 @@ var Control = props => {
|
|
|
757
931
|
}
|
|
758
932
|
return "display.background.secondary.default";
|
|
759
933
|
})();
|
|
760
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */jsx17(Box, {
|
|
761
935
|
sx: {
|
|
762
936
|
".react-select__control": {
|
|
763
937
|
borderColor,
|
|
@@ -766,7 +940,7 @@ var Control = props => {
|
|
|
766
940
|
paddingY: "3"
|
|
767
941
|
}
|
|
768
942
|
},
|
|
769
|
-
children: /* @__PURE__ */
|
|
943
|
+
children: /* @__PURE__ */jsx17(components.Control, {
|
|
770
944
|
...props
|
|
771
945
|
})
|
|
772
946
|
});
|
|
@@ -779,7 +953,7 @@ var DropdownIndicator = props => {
|
|
|
779
953
|
}
|
|
780
954
|
return "text";
|
|
781
955
|
})();
|
|
782
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */jsx17(Text, {
|
|
783
957
|
sx: {
|
|
784
958
|
fontSize: "md",
|
|
785
959
|
color,
|
|
@@ -787,7 +961,7 @@ var DropdownIndicator = props => {
|
|
|
787
961
|
display: "flex",
|
|
788
962
|
alignItems: "center"
|
|
789
963
|
},
|
|
790
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
791
965
|
icon: "picker-down"
|
|
792
966
|
})
|
|
793
967
|
});
|
|
@@ -795,7 +969,7 @@ var DropdownIndicator = props => {
|
|
|
795
969
|
var IndicatorsContainer = ({
|
|
796
970
|
children
|
|
797
971
|
}) => {
|
|
798
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */jsx17(Box, {
|
|
799
973
|
sx: {
|
|
800
974
|
marginLeft: "4",
|
|
801
975
|
border: "none"
|
|
@@ -806,7 +980,7 @@ var IndicatorsContainer = ({
|
|
|
806
980
|
var Placeholder = ({
|
|
807
981
|
children
|
|
808
982
|
}) => {
|
|
809
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */jsx17(Text, {
|
|
810
984
|
sx: {
|
|
811
985
|
color: "onMuted",
|
|
812
986
|
alignSelf: "center"
|
|
@@ -825,10 +999,10 @@ var SelectContainer = ({
|
|
|
825
999
|
return (
|
|
826
1000
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
827
1001
|
/* @__PURE__ */
|
|
828
|
-
|
|
1002
|
+
jsx17(Box, {
|
|
829
1003
|
sx,
|
|
830
1004
|
css: css2,
|
|
831
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */jsx17(components.SelectContainer, {
|
|
832
1006
|
...props,
|
|
833
1007
|
children
|
|
834
1008
|
})
|
|
@@ -858,28 +1032,28 @@ var ValueContainer = ({
|
|
|
858
1032
|
}
|
|
859
1033
|
return leadingIcon || "search";
|
|
860
1034
|
})();
|
|
861
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */jsxs8(Flex, {
|
|
862
1036
|
sx: {
|
|
863
1037
|
gap: "4",
|
|
864
1038
|
flex: 1
|
|
865
1039
|
},
|
|
866
|
-
children: [finalLeadingIcon && /* @__PURE__ */
|
|
1040
|
+
children: [finalLeadingIcon && /* @__PURE__ */jsx17(Text, {
|
|
867
1041
|
sx: {
|
|
868
1042
|
alignSelf: "center",
|
|
869
1043
|
pointerEvents: "none",
|
|
870
1044
|
lineHeight: 0,
|
|
871
1045
|
fontSize: "md"
|
|
872
1046
|
},
|
|
873
|
-
children: /* @__PURE__ */
|
|
1047
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
874
1048
|
icon: finalLeadingIcon
|
|
875
1049
|
})
|
|
876
|
-
}), /* @__PURE__ */
|
|
1050
|
+
}), /* @__PURE__ */jsx17(Flex, {
|
|
877
1051
|
sx: {
|
|
878
1052
|
flex: 1,
|
|
879
1053
|
alignItems: "center"
|
|
880
1054
|
},
|
|
881
1055
|
children
|
|
882
|
-
}), (trailingIcon || hasError) && /* @__PURE__ */
|
|
1056
|
+
}), (trailingIcon || hasError) && /* @__PURE__ */jsx17(Text, {
|
|
883
1057
|
className: hasError ? "error-icon" : "",
|
|
884
1058
|
sx: {
|
|
885
1059
|
alignSelf: "center",
|
|
@@ -888,13 +1062,13 @@ var ValueContainer = ({
|
|
|
888
1062
|
fontSize: "md",
|
|
889
1063
|
color: trailingIconColor
|
|
890
1064
|
},
|
|
891
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */jsx17(Icon8, {
|
|
892
1066
|
icon: hasError ? "warning-alt" : trailingIcon
|
|
893
1067
|
})
|
|
894
1068
|
})]
|
|
895
1069
|
});
|
|
896
1070
|
};
|
|
897
|
-
var Select =
|
|
1071
|
+
var Select = React12.forwardRef(({
|
|
898
1072
|
...props
|
|
899
1073
|
}, ref) => {
|
|
900
1074
|
const value = props.options?.find(option => {
|
|
@@ -903,7 +1077,7 @@ var Select = React11.forwardRef(({
|
|
|
903
1077
|
}
|
|
904
1078
|
return false;
|
|
905
1079
|
});
|
|
906
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */jsx17(ReactSelect, {
|
|
907
1081
|
ref,
|
|
908
1082
|
components: {
|
|
909
1083
|
Control,
|
|
@@ -939,9 +1113,9 @@ import { Slider } from "theme-ui";
|
|
|
939
1113
|
import { Spinner } from "theme-ui";
|
|
940
1114
|
|
|
941
1115
|
// src/components/Stack.tsx
|
|
942
|
-
import { jsx as
|
|
1116
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
943
1117
|
var Stack = props => {
|
|
944
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */jsx18(Flex, {
|
|
945
1119
|
...props,
|
|
946
1120
|
sx: {
|
|
947
1121
|
flexDirection: "column",
|
|
@@ -953,9 +1127,9 @@ var Stack = props => {
|
|
|
953
1127
|
|
|
954
1128
|
// src/components/Switch.tsx
|
|
955
1129
|
import { Switch as SwitchUi } from "theme-ui";
|
|
956
|
-
import { jsx as
|
|
1130
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
957
1131
|
var Switch = props => {
|
|
958
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */jsx19(SwitchUi, {
|
|
959
1133
|
...props,
|
|
960
1134
|
role: "switch",
|
|
961
1135
|
"aria-checked": props.checked || false,
|
|
@@ -981,16 +1155,16 @@ var Switch = props => {
|
|
|
981
1155
|
|
|
982
1156
|
// src/components/Textarea.tsx
|
|
983
1157
|
import { Icon as Icon9 } from "@ttoss/react-icons";
|
|
984
|
-
import * as
|
|
1158
|
+
import * as React13 from "react";
|
|
985
1159
|
import { Textarea as TextareaUI } from "theme-ui";
|
|
986
|
-
import { jsx as
|
|
987
|
-
var Textarea =
|
|
1160
|
+
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1161
|
+
var Textarea = React13.forwardRef(({
|
|
988
1162
|
trailingIcon,
|
|
989
1163
|
className,
|
|
990
1164
|
sx,
|
|
991
1165
|
...textareaProps
|
|
992
1166
|
}, ref) => {
|
|
993
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */jsxs9(Flex, {
|
|
994
1168
|
className,
|
|
995
1169
|
sx: {
|
|
996
1170
|
...sx,
|
|
@@ -998,7 +1172,7 @@ var Textarea = React12.forwardRef(({
|
|
|
998
1172
|
padding: 0,
|
|
999
1173
|
border: "none"
|
|
1000
1174
|
},
|
|
1001
|
-
children: [/* @__PURE__ */
|
|
1175
|
+
children: [/* @__PURE__ */jsx20(TextareaUI, {
|
|
1002
1176
|
ref,
|
|
1003
1177
|
sx: {
|
|
1004
1178
|
fontFamily: "body",
|
|
@@ -1010,13 +1184,13 @@ var Textarea = React12.forwardRef(({
|
|
|
1010
1184
|
},
|
|
1011
1185
|
className,
|
|
1012
1186
|
...textareaProps
|
|
1013
|
-
}), trailingIcon && /* @__PURE__ */
|
|
1187
|
+
}), trailingIcon && /* @__PURE__ */jsx20(Text, {
|
|
1014
1188
|
sx: {
|
|
1015
1189
|
position: "absolute",
|
|
1016
1190
|
right: "1.25rem",
|
|
1017
1191
|
top: "0.75rem"
|
|
1018
1192
|
},
|
|
1019
|
-
children: /* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */jsx20(Icon9, {
|
|
1020
1194
|
inline: true,
|
|
1021
1195
|
icon: trailingIcon
|
|
1022
1196
|
})
|
|
@@ -1027,10 +1201,10 @@ Textarea.displayName = "Textarea";
|
|
|
1027
1201
|
|
|
1028
1202
|
// src/components/Tooltip.tsx
|
|
1029
1203
|
import { Tooltip as TooltipReact } from "react-tooltip";
|
|
1030
|
-
import { jsx as
|
|
1204
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1031
1205
|
var Tooltip = props => {
|
|
1032
1206
|
const className = "tooltip-component";
|
|
1033
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */jsx21(Box, {
|
|
1034
1208
|
sx: ({
|
|
1035
1209
|
fonts
|
|
1036
1210
|
}) => {
|
|
@@ -1057,7 +1231,7 @@ var Tooltip = props => {
|
|
|
1057
1231
|
}
|
|
1058
1232
|
};
|
|
1059
1233
|
},
|
|
1060
|
-
children: /* @__PURE__ */
|
|
1234
|
+
children: /* @__PURE__ */jsx21(TooltipReact, {
|
|
1061
1235
|
className,
|
|
1062
1236
|
...props,
|
|
1063
1237
|
children: props.children
|
|
@@ -1069,16 +1243,16 @@ var Tooltip = props => {
|
|
|
1069
1243
|
import { css, Global } from "@emotion/react";
|
|
1070
1244
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
1071
1245
|
import { ThemeUIProvider } from "theme-ui";
|
|
1072
|
-
import { Fragment, jsx as
|
|
1246
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1073
1247
|
var ThemeProvider = ({
|
|
1074
1248
|
children,
|
|
1075
1249
|
theme = BruttalTheme,
|
|
1076
1250
|
fonts = BruttalFonts
|
|
1077
1251
|
}) => {
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */jsx22(Fragment2, {
|
|
1253
|
+
children: /* @__PURE__ */jsxs10(ThemeUIProvider, {
|
|
1080
1254
|
theme,
|
|
1081
|
-
children: [/* @__PURE__ */
|
|
1255
|
+
children: [/* @__PURE__ */jsx22(Global, {
|
|
1082
1256
|
styles: css`
|
|
1083
1257
|
${fonts.map(url => {
|
|
1084
1258
|
return `@import url('${url}');`;
|
|
@@ -1097,4 +1271,4 @@ var useTheme = useThemeUI;
|
|
|
1097
1271
|
import { keyframes } from "@emotion/react";
|
|
1098
1272
|
import { useBreakpointIndex, useResponsiveValue } from "@theme-ui/match-media";
|
|
1099
1273
|
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
1100
|
-
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",
|
|
@@ -43,9 +44,9 @@
|
|
|
43
44
|
"jest": "^29.7.0",
|
|
44
45
|
"react": "^19.0.0",
|
|
45
46
|
"tsup": "^8.3.5",
|
|
46
|
-
"@ttoss/
|
|
47
|
+
"@ttoss/react-icons": "^0.4.11",
|
|
47
48
|
"@ttoss/test-utils": "^2.1.23",
|
|
48
|
-
"@ttoss/
|
|
49
|
+
"@ttoss/config": "^1.35.3"
|
|
49
50
|
},
|
|
50
51
|
"keywords": [
|
|
51
52
|
"React",
|