@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.
@@ -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
- mode?: 'icon' | 'button';
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.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "slot" | "style" | "title" | "className" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "translate" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "component" | "mode"> & React.RefAttributes<HTMLButtonElement>>;
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
  /**
@@ -6,7 +6,6 @@ declare const _default: {
6
6
  theme: Theme;
7
7
  }) => {
8
8
  '&:not(.MuiMenu-root, .MuiPopover-root) .MuiBackdrop-root': {
9
- backdropFilter: string;
10
9
  backgroundColor: string;
11
10
  };
12
11
  };
@@ -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", "mode", "children"];
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
- var StyledButton = /*#__PURE__*/styled(MuiButton, {})(function (_ref) {
866
- var size = _ref.size;
867
- return {
868
- display: 'flex',
869
- alignItems: 'center',
870
- '& .MuiButton-startIcon': {
871
- margin: 0
872
- },
873
- '& .MuiButton-endIcon': {
874
- margin: 0
875
- },
876
- '& .MuiSvgIcon-root': {
877
- fontSize: iconSizes[size || 'md']
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
- var Button = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
882
- var _props$size = props.size,
883
- size = _props$size === void 0 ? 'md' : _props$size,
884
- _props$mode = props.mode,
885
- mode = _props$mode === void 0 ? 'button' : _props$mode,
886
- children = props.children,
887
- rest = _objectWithoutPropertiesLoose(props, _excluded$2);
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
- mode: mode
892
- }, rest), mode === 'icon' ? children : React__default.createElement(Typography, {
893
- variant: typographySizes[size].variant,
894
- weight: typographySizes[size].weight
895
- }, children));
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
- mode: 'button',
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[600] || colorManipulator_js.darken(palette.secondary.A100, 0.05);
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[600] || colorManipulator_js.darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
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[600] || colorManipulator_js.darken(palette.secondary.A100, 0.05) : palette.secondary.A60,
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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
- mode: 'icon'
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.grayBackground.A100 || '', 0.4)
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
- mode: "icon",
5787
+ isIcon: true,
5707
5788
  color: "secondary",
5708
5789
  variant: 'text',
5709
5790
  size: 'sm'