@rabex-kit/rabex-ui 0.2.29 → 0.2.31
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/Button/index.d.ts +2 -2
- package/dist/LoadingButton/index.d.ts +1 -0
- package/dist/Theme/Modal/index.d.ts +0 -1
- package/dist/rabex-ui.cjs.development.js +127 -46
- package/dist/rabex-ui.cjs.development.js.map +1 -1
- package/dist/rabex-ui.cjs.production.min.js +1 -1
- package/dist/rabex-ui.cjs.production.min.js.map +1 -1
- package/dist/rabex-ui.esm.js +127 -46
- package/dist/rabex-ui.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/rabex-ui.esm.js
CHANGED
@@ -828,7 +828,7 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
828
828
|
return React.createElement(MuiBreadcrumbs, Object.assign({}, props));
|
829
829
|
};
|
830
830
|
|
831
|
-
var _excluded$2 = ["size", "
|
831
|
+
var _excluded$2 = ["size", "isIcon", "children"];
|
832
832
|
var typographySizes = {
|
833
833
|
xs: {
|
834
834
|
variant: 'smallButton',
|
@@ -858,43 +858,120 @@ var iconSizes = {
|
|
858
858
|
lg: 24,
|
859
859
|
xl: 24
|
860
860
|
};
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
861
|
+
// Styled button with shouldForwardProp to exclude 'isIcon' from DOM
|
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';
|
874
917
|
}
|
875
|
-
}
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
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);
|
884
938
|
return React.createElement(StyledButton, Object.assign({
|
885
|
-
ref: ref,
|
886
939
|
size: size,
|
887
|
-
|
888
|
-
},
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
}
|
940
|
+
isIcon: isIcon
|
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
|
+
// );
|
893
970
|
Button.defaultProps = {
|
894
971
|
variant: 'contained',
|
895
972
|
size: 'md',
|
896
973
|
color: 'primary',
|
897
|
-
|
974
|
+
isIcon: false,
|
898
975
|
disableRipple: true,
|
899
976
|
disableElevation: true,
|
900
977
|
disableFocusRipple: true
|
@@ -1702,7 +1779,10 @@ var ListSubHeader = function ListSubHeader(props) {
|
|
1702
1779
|
* @returns
|
1703
1780
|
*/
|
1704
1781
|
var LoadingButton = /*#__PURE__*/styled(MuiLoadingButton, {
|
1705
|
-
name: 'MuiLoadingButton'
|
1782
|
+
name: 'MuiLoadingButton',
|
1783
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
1784
|
+
return !['isIcon'].includes(prop);
|
1785
|
+
}
|
1706
1786
|
})(function () {
|
1707
1787
|
return {};
|
1708
1788
|
});
|
@@ -1710,6 +1790,7 @@ LoadingButton.defaultProps = {
|
|
1710
1790
|
variant: 'contained',
|
1711
1791
|
size: 'md',
|
1712
1792
|
color: 'primary',
|
1793
|
+
isIcon: false,
|
1713
1794
|
disableRipple: true,
|
1714
1795
|
disableElevation: true,
|
1715
1796
|
disableFocusRipple: true
|
@@ -2625,7 +2706,7 @@ var components = {
|
|
2625
2706
|
var palette = _ref3.theme.palette;
|
2626
2707
|
var secondaryColor = palette.secondary[500] || palette.secondary.A100;
|
2627
2708
|
var textColor = palette.textColor[900] || palette.textColor.A80;
|
2628
|
-
var hoverColor = palette.secondary[
|
2709
|
+
var hoverColor = palette.secondary[400] || darken(palette.secondary.A100, 0.05);
|
2629
2710
|
return {
|
2630
2711
|
backgroundColor: palette.mode === 'light' ? secondaryColor : palette.secondary.A60,
|
2631
2712
|
color: palette.mode === 'light' ? textColor : palette.textColor.A0,
|
@@ -2633,11 +2714,11 @@ var components = {
|
|
2633
2714
|
backgroundColor: palette.mode === 'light' ? hoverColor : palette.secondary.A60
|
2634
2715
|
},
|
2635
2716
|
'&:active': {
|
2636
|
-
backgroundColor: palette.mode === 'light' ? palette.secondary[
|
2717
|
+
backgroundColor: palette.mode === 'light' ? palette.secondary[400] || darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
|
2637
2718
|
boxShadow: '0px 0px 0px 4px #0000000D'
|
2638
2719
|
},
|
2639
2720
|
'&:focused': {
|
2640
|
-
backgroundColor: palette.mode === 'light' ? palette.secondary[
|
2721
|
+
backgroundColor: palette.mode === 'light' ? palette.secondary[400] || darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
|
2641
2722
|
boxShadow: '0px 0px 0px 4px #0000000D'
|
2642
2723
|
},
|
2643
2724
|
'&.Mui-disabled': {
|
@@ -2766,7 +2847,7 @@ var components = {
|
|
2766
2847
|
}, {
|
2767
2848
|
props: {
|
2768
2849
|
size: 'xs',
|
2769
|
-
|
2850
|
+
isIcon: true
|
2770
2851
|
},
|
2771
2852
|
style: function style(_ref11) {
|
2772
2853
|
var theme = _ref11.theme;
|
@@ -2782,7 +2863,7 @@ var components = {
|
|
2782
2863
|
}, {
|
2783
2864
|
props: {
|
2784
2865
|
size: 'sm',
|
2785
|
-
|
2866
|
+
isIcon: true
|
2786
2867
|
},
|
2787
2868
|
style: function style(_ref12) {
|
2788
2869
|
var theme = _ref12.theme;
|
@@ -2798,7 +2879,7 @@ var components = {
|
|
2798
2879
|
}, {
|
2799
2880
|
props: {
|
2800
2881
|
size: 'md',
|
2801
|
-
|
2882
|
+
isIcon: true
|
2802
2883
|
},
|
2803
2884
|
style: function style(_ref13) {
|
2804
2885
|
var theme = _ref13.theme;
|
@@ -2814,7 +2895,7 @@ var components = {
|
|
2814
2895
|
}, {
|
2815
2896
|
props: {
|
2816
2897
|
size: 'lg',
|
2817
|
-
|
2898
|
+
isIcon: true
|
2818
2899
|
},
|
2819
2900
|
style: function style(_ref14) {
|
2820
2901
|
var theme = _ref14.theme;
|
@@ -2829,7 +2910,7 @@ var components = {
|
|
2829
2910
|
}, {
|
2830
2911
|
props: {
|
2831
2912
|
size: 'xl',
|
2832
|
-
|
2913
|
+
isIcon: true
|
2833
2914
|
},
|
2834
2915
|
style: function style(_ref15) {
|
2835
2916
|
var theme = _ref15.theme;
|
@@ -2885,7 +2966,7 @@ var components = {
|
|
2885
2966
|
}, {
|
2886
2967
|
props: {
|
2887
2968
|
size: 'medium',
|
2888
|
-
|
2969
|
+
isIcon: true
|
2889
2970
|
},
|
2890
2971
|
style: function style(_ref19) {
|
2891
2972
|
var theme = _ref19.theme;
|
@@ -2897,7 +2978,7 @@ var components = {
|
|
2897
2978
|
}, {
|
2898
2979
|
props: {
|
2899
2980
|
size: 'small',
|
2900
|
-
|
2981
|
+
isIcon: true
|
2901
2982
|
},
|
2902
2983
|
style: function style(_ref20) {
|
2903
2984
|
var theme = _ref20.theme;
|
@@ -2909,7 +2990,7 @@ var components = {
|
|
2909
2990
|
}, {
|
2910
2991
|
props: {
|
2911
2992
|
size: 'xsmall',
|
2912
|
-
|
2993
|
+
isIcon: true
|
2913
2994
|
},
|
2914
2995
|
style: function style(_ref21) {
|
2915
2996
|
var theme = _ref21.theme;
|
@@ -4720,8 +4801,8 @@ var RabexModal = {
|
|
4720
4801
|
var theme = _ref.theme;
|
4721
4802
|
return {
|
4722
4803
|
'&:not(.MuiMenu-root, .MuiPopover-root) .MuiBackdrop-root': {
|
4723
|
-
backdropFilter: 'blur(2px)',
|
4724
|
-
backgroundColor: alpha(theme.palette.
|
4804
|
+
// backdropFilter: 'blur(2px)',
|
4805
|
+
backgroundColor: alpha(theme.palette.base[600] || '', 0.7)
|
4725
4806
|
}
|
4726
4807
|
};
|
4727
4808
|
}
|
@@ -5699,7 +5780,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
5699
5780
|
left: '-10px'
|
5700
5781
|
}, headerSx)
|
5701
5782
|
}, header), React.createElement(Button, Object.assign({
|
5702
|
-
|
5783
|
+
isIcon: true,
|
5703
5784
|
color: "secondary",
|
5704
5785
|
variant: 'text',
|
5705
5786
|
size: 'sm'
|