@ttoss/ui 6.4.1 → 6.5.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 +28 -8
- package/dist/index.d.ts +9 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -761,16 +761,16 @@ var variantTokens = {
|
|
|
761
761
|
selectedColor: "action.text.primary.default",
|
|
762
762
|
unselectedColor: "display.text.primary.default",
|
|
763
763
|
hoverBg: "action.background.muted.default",
|
|
764
|
-
divider: "action.text.
|
|
764
|
+
divider: "action.text.muted.default",
|
|
765
765
|
thumb: "action.background.primary.default",
|
|
766
|
-
border: "display.border.
|
|
766
|
+
border: "display.border.muted.default"
|
|
767
767
|
},
|
|
768
768
|
secondary: {
|
|
769
769
|
selectedBg: "action.background.secondary.default",
|
|
770
770
|
selectedColor: "action.text.secondary.default",
|
|
771
771
|
unselectedColor: "display.text.secondary.default",
|
|
772
772
|
hoverBg: "action.background.muted.default",
|
|
773
|
-
divider: "action.text.
|
|
773
|
+
divider: "action.text.muted.default",
|
|
774
774
|
thumb: "action.background.secondary.default",
|
|
775
775
|
border: "display.border.muted.default"
|
|
776
776
|
},
|
|
@@ -779,9 +779,26 @@ var variantTokens = {
|
|
|
779
779
|
selectedColor: "action.text.accent.default",
|
|
780
780
|
unselectedColor: "action.text.accent.default",
|
|
781
781
|
hoverBg: "action.background.muted.default",
|
|
782
|
-
divider: "action.text.
|
|
782
|
+
divider: "action.text.muted.default",
|
|
783
783
|
thumb: "action.background.accent.default",
|
|
784
|
-
border: "display.border.
|
|
784
|
+
border: "display.border.muted.default"
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
var sizeTokens = {
|
|
788
|
+
sm: {
|
|
789
|
+
paddingX: "2",
|
|
790
|
+
paddingY: "1",
|
|
791
|
+
fontSize: "sm"
|
|
792
|
+
},
|
|
793
|
+
md: {
|
|
794
|
+
paddingX: "3",
|
|
795
|
+
paddingY: "2",
|
|
796
|
+
fontSize: "md"
|
|
797
|
+
},
|
|
798
|
+
lg: {
|
|
799
|
+
paddingX: "5",
|
|
800
|
+
paddingY: "3",
|
|
801
|
+
fontSize: "lg"
|
|
785
802
|
}
|
|
786
803
|
};
|
|
787
804
|
var SegmentedControl = /* @__PURE__ */__name(({
|
|
@@ -792,6 +809,7 @@ var SegmentedControl = /* @__PURE__ */__name(({
|
|
|
792
809
|
disabled,
|
|
793
810
|
className,
|
|
794
811
|
variant = "accent",
|
|
812
|
+
size = "md",
|
|
795
813
|
sx,
|
|
796
814
|
...rest
|
|
797
815
|
}) => {
|
|
@@ -815,9 +833,11 @@ var SegmentedControl = /* @__PURE__ */__name(({
|
|
|
815
833
|
});
|
|
816
834
|
const currentValue = propValue !== void 0 ? propValue : internalValue;
|
|
817
835
|
const tokens = variantTokens[variant];
|
|
836
|
+
const sizeStyles = sizeTokens[size];
|
|
818
837
|
return /* @__PURE__ */React11.createElement(Flex2, {
|
|
819
838
|
className,
|
|
820
839
|
"data-variant": variant,
|
|
840
|
+
"data-size": size,
|
|
821
841
|
sx: {
|
|
822
842
|
width: "100%",
|
|
823
843
|
borderRadius: "4xl",
|
|
@@ -843,9 +863,9 @@ var SegmentedControl = /* @__PURE__ */__name(({
|
|
|
843
863
|
".rc-segmented-item": {
|
|
844
864
|
borderRadius: "4xl",
|
|
845
865
|
margin: 0,
|
|
846
|
-
paddingX:
|
|
847
|
-
paddingY:
|
|
848
|
-
fontSize:
|
|
866
|
+
paddingX: sizeStyles.paddingX,
|
|
867
|
+
paddingY: sizeStyles.paddingY,
|
|
868
|
+
fontSize: sizeStyles.fontSize,
|
|
849
869
|
display: "flex",
|
|
850
870
|
alignItems: "center",
|
|
851
871
|
justifyContent: "center",
|
package/dist/index.d.ts
CHANGED
|
@@ -167,8 +167,16 @@ interface SegmentedControlProps {
|
|
|
167
167
|
sx?: FlexProps['sx'];
|
|
168
168
|
/** Visual variant that maps to theme color tokens */
|
|
169
169
|
variant?: 'primary' | 'secondary' | 'accent';
|
|
170
|
+
/**
|
|
171
|
+
* Size variant that controls padding and font size.
|
|
172
|
+
*
|
|
173
|
+
* - `sm`: Compact size with reduced padding and smaller text, suited for dense layouts.
|
|
174
|
+
* - `md`: Default size with balanced padding and typography for general use.
|
|
175
|
+
* - `lg`: Larger size with increased padding and larger text for emphasis.
|
|
176
|
+
*/
|
|
177
|
+
size?: 'sm' | 'md' | 'lg';
|
|
170
178
|
}
|
|
171
|
-
declare const SegmentedControl: ({ options, value: propValue, defaultValue, onChange, disabled, className, variant, sx, ...rest }: SegmentedControlProps) => react_jsx_runtime.JSX.Element;
|
|
179
|
+
declare const SegmentedControl: ({ options, value: propValue, defaultValue, onChange, disabled, className, variant, size, sx, ...rest }: SegmentedControlProps) => react_jsx_runtime.JSX.Element;
|
|
172
180
|
|
|
173
181
|
/**
|
|
174
182
|
* We're using React Select component to build ttoss Select.
|