@rabex-kit/rabex-ui 0.2.28 → 0.2.30

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.
@@ -859,41 +859,114 @@ var iconSizes = {
859
859
  xl: 24
860
860
  };
861
861
  // Styled button with shouldForwardProp to exclude 'isIcon' from DOM
862
- var StyledButton = /*#__PURE__*/styled(MuiButton, {
863
- shouldForwardProp: function shouldForwardProp(prop) {
864
- return prop !== 'isIcon';
865
- }
866
- })(function (_ref) {
867
- var size = _ref.size;
868
- return {
869
- display: 'flex',
870
- alignItems: 'center',
871
- '& .MuiButton-startIcon': {
872
- margin: 0
873
- },
874
- '& .MuiButton-endIcon': {
875
- margin: 0
876
- },
877
- '& .MuiSvgIcon-root': {
878
- fontSize: iconSizes[size || 'md']
862
+ /* const StyledButton = styled(MuiButton, {
863
+ shouldForwardProp: (prop) => prop !== 'isIcon',
864
+ })<ButtonProps>(({ theme, size, isIcon }) => ({
865
+ display: 'flex',
866
+ alignItems: 'center',
867
+ // Handle icon styling directly here
868
+ // ...(isIcon && {
869
+ // minWidth: 'unset',
870
+ // ...(size === 'xs' && {
871
+ // width: '24px',
872
+ // height: '24px',
873
+ // padding: theme.spacing(0.5),
874
+ // }),
875
+ // ...(size === 'sm' && {
876
+ // width: '32px',
877
+ // height: '32px',
878
+ // padding: theme.spacing(1),
879
+ // }),
880
+ // ...(size === 'md' && {
881
+ // width: '40px',
882
+ // height: '40px',
883
+ // padding: theme.spacing(1),
884
+ // }),
885
+ // ...(size === 'lg' && {
886
+ // width: '48px',
887
+ // height: '48px',
888
+ // padding: theme.spacing(1.5),
889
+ // }),
890
+ // ...(size === 'xl' && {
891
+ // width: '56px',
892
+ // height: '56px',
893
+ // padding: theme.spacing(2),
894
+ // }),
895
+ // }),
896
+ '& .MuiButton-startIcon': {
897
+ margin: 0,
898
+ },
899
+ '& .MuiButton-endIcon': {
900
+ margin: 0,
901
+ },
902
+ '& .MuiSvgIcon-root': {
903
+ fontSize: iconSizes[size || 'md'],
904
+ },
905
+ })); */
906
+ var Button = function Button(_ref) {
907
+ var _ref$size = _ref.size,
908
+ size = _ref$size === void 0 ? 'md' : _ref$size,
909
+ _ref$isIcon = _ref.isIcon,
910
+ isIcon = _ref$isIcon === void 0 ? false : _ref$isIcon,
911
+ children = _ref.children,
912
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
913
+ var StyledButton = styled(MuiButton, {
914
+ name: 'MuiButton',
915
+ shouldForwardProp: function shouldForwardProp(prop) {
916
+ return prop !== 'isIcon';
879
917
  }
880
- };
881
- });
882
- var Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
883
- var _props$size = props.size,
884
- size = _props$size === void 0 ? 'md' : _props$size,
885
- isIcon = props.isIcon,
886
- children = props.children,
887
- rest = _objectWithoutPropertiesLoose(props, _excluded$2);
918
+ })(function (_ref2) {
919
+ return {
920
+ display: 'flex',
921
+ alignItems: 'center',
922
+ '& .MuiButton-startIcon': {
923
+ margin: 0
924
+ },
925
+ '& .MuiButton-endIcon': {
926
+ margin: 0
927
+ },
928
+ '& .MuiSvgIcon-root': {
929
+ fontSize: iconSizes[size]
930
+ }
931
+ };
932
+ });
933
+ var content = isIcon ? children : React.createElement(Typography, {
934
+ variant: typographySizes[size].variant,
935
+ weight: typographySizes[size].weight,
936
+ component: "span"
937
+ }, children);
888
938
  return React.createElement(StyledButton, Object.assign({
889
- ref: ref,
890
939
  size: size,
891
940
  isIcon: isIcon
892
- }, rest), isIcon ? children : React.createElement(Typography, {
893
- variant: typographySizes[size].variant,
894
- weight: typographySizes[size].weight
895
- }, children));
896
- });
941
+ }, props), content);
942
+ };
943
+ // const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
944
+ // (props, ref) => {
945
+ // const { size = 'md', isIcon = false, children, ...rest } = props;
946
+ //
947
+ // // Handle Typography at the component level, not in styled component
948
+ // const content = isIcon ? children : (
949
+ // <Typography
950
+ // variant={typographySizes[size].variant}
951
+ // weight={typographySizes[size].weight}
952
+ // component="span" // Important: use span to avoid nested block elements
953
+ // >
954
+ // {children}
955
+ // </Typography>
956
+ // );
957
+ //
958
+ // return (
959
+ // <StyledButton
960
+ // ref={ref}
961
+ // size={size}
962
+ // isIcon={isIcon} // This reaches styled component but not DOM
963
+ // {...rest}
964
+ // >
965
+ // {content}
966
+ // </StyledButton>
967
+ // );
968
+ // }
969
+ // );
897
970
  Button.defaultProps = {
898
971
  variant: 'contained',
899
972
  size: 'md',
@@ -2779,6 +2852,7 @@ var components = {
2779
2852
  style: function style(_ref11) {
2780
2853
  var theme = _ref11.theme;
2781
2854
  return {
2855
+ minWidth: '24px',
2782
2856
  width: '24px',
2783
2857
  height: '24px',
2784
2858
  // padding: theme.spacing(3.5, 3.5),
@@ -2794,6 +2868,7 @@ var components = {
2794
2868
  style: function style(_ref12) {
2795
2869
  var theme = _ref12.theme;
2796
2870
  return {
2871
+ minWidth: '32px',
2797
2872
  width: '32px',
2798
2873
  height: '32px',
2799
2874
  // padding: theme.spacing(3.5, 3.5),
@@ -2809,6 +2884,7 @@ var components = {
2809
2884
  style: function style(_ref13) {
2810
2885
  var theme = _ref13.theme;
2811
2886
  return {
2887
+ minWidth: '40px',
2812
2888
  width: '40px',
2813
2889
  height: '40px',
2814
2890
  // padding: theme.spacing(3.5, 3.5),
@@ -2824,6 +2900,7 @@ var components = {
2824
2900
  style: function style(_ref14) {
2825
2901
  var theme = _ref14.theme;
2826
2902
  return {
2903
+ minWidth: '48px',
2827
2904
  width: '48px',
2828
2905
  height: '48px',
2829
2906
  padding: theme.spacing(3),
@@ -2838,6 +2915,7 @@ var components = {
2838
2915
  style: function style(_ref15) {
2839
2916
  var theme = _ref15.theme;
2840
2917
  return {
2918
+ minWidth: '56px',
2841
2919
  width: '56px',
2842
2920
  height: '56px',
2843
2921
  padding: theme.spacing(4),