@rabex-kit/rabex-ui 0.1.4 → 0.1.6
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 +1 -1
- package/dist/rabex-ui.cjs.development.js +9 -19
- 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 +9 -19
- package/dist/rabex-ui.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/rabex-ui.esm.js
CHANGED
@@ -808,7 +808,6 @@ var typographySizes = {
|
|
808
808
|
weight: 'semiBold'
|
809
809
|
}
|
810
810
|
};
|
811
|
-
// Define icon sizes for different button sizes
|
812
811
|
var iconSizes = {
|
813
812
|
xs: 16,
|
814
813
|
sm: 16,
|
@@ -816,22 +815,12 @@ var iconSizes = {
|
|
816
815
|
lg: 24,
|
817
816
|
xl: 24
|
818
817
|
};
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
*
|
826
|
-
* ```typescript
|
827
|
-
* import { Button } from '@rabex-kit/core';
|
828
|
-
* ```
|
829
|
-
*
|
830
|
-
*
|
831
|
-
* @param props
|
832
|
-
* @returns
|
833
|
-
*/
|
834
|
-
var StyledButton = /*#__PURE__*/styled(MuiButton)(function (_ref) {
|
818
|
+
// Styled button with shouldForwardProp to exclude 'isIcon' from DOM
|
819
|
+
var StyledButton = /*#__PURE__*/styled(MuiButton, {
|
820
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
821
|
+
return prop !== 'isIcon';
|
822
|
+
}
|
823
|
+
})(function (_ref) {
|
835
824
|
var size = _ref.size;
|
836
825
|
return {
|
837
826
|
display: 'flex',
|
@@ -847,20 +836,21 @@ var StyledButton = /*#__PURE__*/styled(MuiButton)(function (_ref) {
|
|
847
836
|
}
|
848
837
|
};
|
849
838
|
});
|
850
|
-
var Button = function
|
839
|
+
var Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
851
840
|
var _props$size = props.size,
|
852
841
|
size = _props$size === void 0 ? 'md' : _props$size,
|
853
842
|
isIcon = props.isIcon,
|
854
843
|
children = props.children,
|
855
844
|
rest = _objectWithoutPropertiesLoose(props, _excluded$2);
|
856
845
|
return React.createElement(StyledButton, Object.assign({
|
846
|
+
ref: ref,
|
857
847
|
size: size,
|
858
848
|
isIcon: isIcon
|
859
849
|
}, rest), isIcon ? children : React.createElement(Typography, {
|
860
850
|
variant: typographySizes[size].variant,
|
861
851
|
weight: typographySizes[size].weight
|
862
852
|
}, children));
|
863
|
-
};
|
853
|
+
});
|
864
854
|
Button.defaultProps = {
|
865
855
|
variant: 'contained',
|
866
856
|
size: 'md',
|