@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/Button/index.d.ts
CHANGED
@@ -2,10 +2,10 @@ import React from 'react';
|
|
2
2
|
import { ButtonProps as MuiButtonProps } from '@mui/material';
|
3
3
|
export declare type ButtonProps = Omit<MuiButtonProps, 'size' | 'color' | 'component' | 'variant'> & {
|
4
4
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
5
|
-
|
5
|
+
isIcon?: boolean;
|
6
6
|
color?: 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
7
7
|
variant?: 'contained' | 'containedSecondary' | 'outlined' | 'text';
|
8
8
|
component?: React.ElementType;
|
9
9
|
};
|
10
|
-
declare const Button: React.
|
10
|
+
declare const Button: React.FC<ButtonProps>;
|
11
11
|
export default Button;
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import { LoadingButtonProps as MuiLoadingButtonProps } from '@mui/lab';
|
3
3
|
export declare type LoadingButtonProps = Omit<MuiLoadingButtonProps, 'size' | 'color'> & {
|
4
4
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
5
|
+
isIcon?: boolean;
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
6
7
|
};
|
7
8
|
/**
|
@@ -832,7 +832,7 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
832
832
|
return React__default.createElement(MuiBreadcrumbs, Object.assign({}, props));
|
833
833
|
};
|
834
834
|
|
835
|
-
var _excluded$2 = ["size", "
|
835
|
+
var _excluded$2 = ["size", "isIcon", "children"];
|
836
836
|
var typographySizes = {
|
837
837
|
xs: {
|
838
838
|
variant: 'smallButton',
|
@@ -862,43 +862,120 @@ var iconSizes = {
|
|
862
862
|
lg: 24,
|
863
863
|
xl: 24
|
864
864
|
};
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
865
|
+
// Styled button with shouldForwardProp to exclude 'isIcon' from DOM
|
866
|
+
/* const StyledButton = styled(MuiButton, {
|
867
|
+
shouldForwardProp: (prop) => prop !== 'isIcon',
|
868
|
+
})<ButtonProps>(({ theme, size, isIcon }) => ({
|
869
|
+
display: 'flex',
|
870
|
+
alignItems: 'center',
|
871
|
+
// Handle icon styling directly here
|
872
|
+
// ...(isIcon && {
|
873
|
+
// minWidth: 'unset',
|
874
|
+
// ...(size === 'xs' && {
|
875
|
+
// width: '24px',
|
876
|
+
// height: '24px',
|
877
|
+
// padding: theme.spacing(0.5),
|
878
|
+
// }),
|
879
|
+
// ...(size === 'sm' && {
|
880
|
+
// width: '32px',
|
881
|
+
// height: '32px',
|
882
|
+
// padding: theme.spacing(1),
|
883
|
+
// }),
|
884
|
+
// ...(size === 'md' && {
|
885
|
+
// width: '40px',
|
886
|
+
// height: '40px',
|
887
|
+
// padding: theme.spacing(1),
|
888
|
+
// }),
|
889
|
+
// ...(size === 'lg' && {
|
890
|
+
// width: '48px',
|
891
|
+
// height: '48px',
|
892
|
+
// padding: theme.spacing(1.5),
|
893
|
+
// }),
|
894
|
+
// ...(size === 'xl' && {
|
895
|
+
// width: '56px',
|
896
|
+
// height: '56px',
|
897
|
+
// padding: theme.spacing(2),
|
898
|
+
// }),
|
899
|
+
// }),
|
900
|
+
'& .MuiButton-startIcon': {
|
901
|
+
margin: 0,
|
902
|
+
},
|
903
|
+
'& .MuiButton-endIcon': {
|
904
|
+
margin: 0,
|
905
|
+
},
|
906
|
+
'& .MuiSvgIcon-root': {
|
907
|
+
fontSize: iconSizes[size || 'md'],
|
908
|
+
},
|
909
|
+
})); */
|
910
|
+
var Button = function Button(_ref) {
|
911
|
+
var _ref$size = _ref.size,
|
912
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
913
|
+
_ref$isIcon = _ref.isIcon,
|
914
|
+
isIcon = _ref$isIcon === void 0 ? false : _ref$isIcon,
|
915
|
+
children = _ref.children,
|
916
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
917
|
+
var StyledButton = styled(MuiButton, {
|
918
|
+
name: 'MuiButton',
|
919
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
920
|
+
return prop !== 'isIcon';
|
878
921
|
}
|
879
|
-
}
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
922
|
+
})(function (_ref2) {
|
923
|
+
return {
|
924
|
+
display: 'flex',
|
925
|
+
alignItems: 'center',
|
926
|
+
'& .MuiButton-startIcon': {
|
927
|
+
margin: 0
|
928
|
+
},
|
929
|
+
'& .MuiButton-endIcon': {
|
930
|
+
margin: 0
|
931
|
+
},
|
932
|
+
'& .MuiSvgIcon-root': {
|
933
|
+
fontSize: iconSizes[size]
|
934
|
+
}
|
935
|
+
};
|
936
|
+
});
|
937
|
+
var content = isIcon ? children : React__default.createElement(Typography, {
|
938
|
+
variant: typographySizes[size].variant,
|
939
|
+
weight: typographySizes[size].weight,
|
940
|
+
component: "span"
|
941
|
+
}, children);
|
888
942
|
return React__default.createElement(StyledButton, Object.assign({
|
889
|
-
ref: ref,
|
890
943
|
size: size,
|
891
|
-
|
892
|
-
},
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
}
|
944
|
+
isIcon: isIcon
|
945
|
+
}, props), content);
|
946
|
+
};
|
947
|
+
// const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
948
|
+
// (props, ref) => {
|
949
|
+
// const { size = 'md', isIcon = false, children, ...rest } = props;
|
950
|
+
//
|
951
|
+
// // Handle Typography at the component level, not in styled component
|
952
|
+
// const content = isIcon ? children : (
|
953
|
+
// <Typography
|
954
|
+
// variant={typographySizes[size].variant}
|
955
|
+
// weight={typographySizes[size].weight}
|
956
|
+
// component="span" // Important: use span to avoid nested block elements
|
957
|
+
// >
|
958
|
+
// {children}
|
959
|
+
// </Typography>
|
960
|
+
// );
|
961
|
+
//
|
962
|
+
// return (
|
963
|
+
// <StyledButton
|
964
|
+
// ref={ref}
|
965
|
+
// size={size}
|
966
|
+
// isIcon={isIcon} // This reaches styled component but not DOM
|
967
|
+
// {...rest}
|
968
|
+
// >
|
969
|
+
// {content}
|
970
|
+
// </StyledButton>
|
971
|
+
// );
|
972
|
+
// }
|
973
|
+
// );
|
897
974
|
Button.defaultProps = {
|
898
975
|
variant: 'contained',
|
899
976
|
size: 'md',
|
900
977
|
color: 'primary',
|
901
|
-
|
978
|
+
isIcon: false,
|
902
979
|
disableRipple: true,
|
903
980
|
disableElevation: true,
|
904
981
|
disableFocusRipple: true
|
@@ -1706,7 +1783,10 @@ var ListSubHeader = function ListSubHeader(props) {
|
|
1706
1783
|
* @returns
|
1707
1784
|
*/
|
1708
1785
|
var LoadingButton = /*#__PURE__*/styled(MuiLoadingButton, {
|
1709
|
-
name: 'MuiLoadingButton'
|
1786
|
+
name: 'MuiLoadingButton',
|
1787
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
1788
|
+
return !['isIcon'].includes(prop);
|
1789
|
+
}
|
1710
1790
|
})(function () {
|
1711
1791
|
return {};
|
1712
1792
|
});
|
@@ -1714,6 +1794,7 @@ LoadingButton.defaultProps = {
|
|
1714
1794
|
variant: 'contained',
|
1715
1795
|
size: 'md',
|
1716
1796
|
color: 'primary',
|
1797
|
+
isIcon: false,
|
1717
1798
|
disableRipple: true,
|
1718
1799
|
disableElevation: true,
|
1719
1800
|
disableFocusRipple: true
|
@@ -2629,7 +2710,7 @@ var components = {
|
|
2629
2710
|
var palette = _ref3.theme.palette;
|
2630
2711
|
var secondaryColor = palette.secondary[500] || palette.secondary.A100;
|
2631
2712
|
var textColor = palette.textColor[900] || palette.textColor.A80;
|
2632
|
-
var hoverColor = palette.secondary[
|
2713
|
+
var hoverColor = palette.secondary[400] || colorManipulator_js.darken(palette.secondary.A100, 0.05);
|
2633
2714
|
return {
|
2634
2715
|
backgroundColor: palette.mode === 'light' ? secondaryColor : palette.secondary.A60,
|
2635
2716
|
color: palette.mode === 'light' ? textColor : palette.textColor.A0,
|
@@ -2637,11 +2718,11 @@ var components = {
|
|
2637
2718
|
backgroundColor: palette.mode === 'light' ? hoverColor : palette.secondary.A60
|
2638
2719
|
},
|
2639
2720
|
'&:active': {
|
2640
|
-
backgroundColor: palette.mode === 'light' ? palette.secondary[
|
2721
|
+
backgroundColor: palette.mode === 'light' ? palette.secondary[400] || colorManipulator_js.darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
|
2641
2722
|
boxShadow: '0px 0px 0px 4px #0000000D'
|
2642
2723
|
},
|
2643
2724
|
'&:focused': {
|
2644
|
-
backgroundColor: palette.mode === 'light' ? palette.secondary[
|
2725
|
+
backgroundColor: palette.mode === 'light' ? palette.secondary[400] || colorManipulator_js.darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
|
2645
2726
|
boxShadow: '0px 0px 0px 4px #0000000D'
|
2646
2727
|
},
|
2647
2728
|
'&.Mui-disabled': {
|
@@ -2770,7 +2851,7 @@ var components = {
|
|
2770
2851
|
}, {
|
2771
2852
|
props: {
|
2772
2853
|
size: 'xs',
|
2773
|
-
|
2854
|
+
isIcon: true
|
2774
2855
|
},
|
2775
2856
|
style: function style(_ref11) {
|
2776
2857
|
var theme = _ref11.theme;
|
@@ -2786,7 +2867,7 @@ var components = {
|
|
2786
2867
|
}, {
|
2787
2868
|
props: {
|
2788
2869
|
size: 'sm',
|
2789
|
-
|
2870
|
+
isIcon: true
|
2790
2871
|
},
|
2791
2872
|
style: function style(_ref12) {
|
2792
2873
|
var theme = _ref12.theme;
|
@@ -2802,7 +2883,7 @@ var components = {
|
|
2802
2883
|
}, {
|
2803
2884
|
props: {
|
2804
2885
|
size: 'md',
|
2805
|
-
|
2886
|
+
isIcon: true
|
2806
2887
|
},
|
2807
2888
|
style: function style(_ref13) {
|
2808
2889
|
var theme = _ref13.theme;
|
@@ -2818,7 +2899,7 @@ var components = {
|
|
2818
2899
|
}, {
|
2819
2900
|
props: {
|
2820
2901
|
size: 'lg',
|
2821
|
-
|
2902
|
+
isIcon: true
|
2822
2903
|
},
|
2823
2904
|
style: function style(_ref14) {
|
2824
2905
|
var theme = _ref14.theme;
|
@@ -2833,7 +2914,7 @@ var components = {
|
|
2833
2914
|
}, {
|
2834
2915
|
props: {
|
2835
2916
|
size: 'xl',
|
2836
|
-
|
2917
|
+
isIcon: true
|
2837
2918
|
},
|
2838
2919
|
style: function style(_ref15) {
|
2839
2920
|
var theme = _ref15.theme;
|
@@ -2889,7 +2970,7 @@ var components = {
|
|
2889
2970
|
}, {
|
2890
2971
|
props: {
|
2891
2972
|
size: 'medium',
|
2892
|
-
|
2973
|
+
isIcon: true
|
2893
2974
|
},
|
2894
2975
|
style: function style(_ref19) {
|
2895
2976
|
var theme = _ref19.theme;
|
@@ -2901,7 +2982,7 @@ var components = {
|
|
2901
2982
|
}, {
|
2902
2983
|
props: {
|
2903
2984
|
size: 'small',
|
2904
|
-
|
2985
|
+
isIcon: true
|
2905
2986
|
},
|
2906
2987
|
style: function style(_ref20) {
|
2907
2988
|
var theme = _ref20.theme;
|
@@ -2913,7 +2994,7 @@ var components = {
|
|
2913
2994
|
}, {
|
2914
2995
|
props: {
|
2915
2996
|
size: 'xsmall',
|
2916
|
-
|
2997
|
+
isIcon: true
|
2917
2998
|
},
|
2918
2999
|
style: function style(_ref21) {
|
2919
3000
|
var theme = _ref21.theme;
|
@@ -4724,8 +4805,8 @@ var RabexModal = {
|
|
4724
4805
|
var theme = _ref.theme;
|
4725
4806
|
return {
|
4726
4807
|
'&:not(.MuiMenu-root, .MuiPopover-root) .MuiBackdrop-root': {
|
4727
|
-
backdropFilter: 'blur(2px)',
|
4728
|
-
backgroundColor: colorManipulator_js.alpha(theme.palette.
|
4808
|
+
// backdropFilter: 'blur(2px)',
|
4809
|
+
backgroundColor: colorManipulator_js.alpha(theme.palette.base[600] || '', 0.7)
|
4729
4810
|
}
|
4730
4811
|
};
|
4731
4812
|
}
|
@@ -5703,7 +5784,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
5703
5784
|
left: '-10px'
|
5704
5785
|
}, headerSx)
|
5705
5786
|
}, header), React__default.createElement(Button, Object.assign({
|
5706
|
-
|
5787
|
+
isIcon: true,
|
5707
5788
|
color: "secondary",
|
5708
5789
|
variant: 'text',
|
5709
5790
|
size: 'sm'
|