@rabex-kit/rabex-ui 0.2.5 → 0.2.7

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.
@@ -1253,7 +1253,7 @@ var FormLabel = function FormLabel(_ref) {
1253
1253
  * You can read Material-UI Button Documentation [here](https://mui.com/material-ui/react-grid2/).
1254
1254
  *
1255
1255
  * ```typescript
1256
- * import { Grid } from '@rabex-kit/core';
1256
+ * import { Grid } from '@rabex-kit/rabex-ui';
1257
1257
  * ```
1258
1258
  *
1259
1259
  *
@@ -1266,12 +1266,11 @@ var Grid = function Grid(_ref) {
1266
1266
  };
1267
1267
 
1268
1268
  /**
1269
- *
1270
1269
  * Icon buttons are commonly found in app bars and toolbars.
1271
1270
  * Icons are also appropriate for toggle buttons that allow a single choice to be selected or deselected,
1272
1271
  * such as adding or removing a star to an item.
1273
1272
  *
1274
- * You can read Material-UI Button Documentation [here](https://mui.com/material-ui/api/icon-button/).
1273
+ * You can read Material-UI IconButton Documentation [here](https://mui.com/material-ui/api/icon-button/).
1275
1274
  *
1276
1275
  * ```typescript
1277
1276
  * import { IconButton } from '@rabex-kit/rabex-ui';
@@ -1283,15 +1282,61 @@ var Grid = function Grid(_ref) {
1283
1282
  var IconButton = /*#__PURE__*/styled(MuiIconButton, {
1284
1283
  name: 'MuiIconButton',
1285
1284
  shouldForwardProp: function shouldForwardProp(prop) {
1286
- return !['hasBg', 'disableOpacity', 'bgColor'].includes(prop.toString());
1285
+ return !['hasBg', 'disableOpacity', 'bgColor', 'variant'].includes(prop.toString());
1287
1286
  }
1288
- })(function () {
1289
- return {};
1287
+ })(function (_ref) {
1288
+ var theme = _ref.theme,
1289
+ _ref$size = _ref.size,
1290
+ size = _ref$size === void 0 ? 'md' : _ref$size,
1291
+ _ref$variant = _ref.variant,
1292
+ variant = _ref$variant === void 0 ? 'circular' : _ref$variant;
1293
+ // Size configurations
1294
+ var sizeConfig = {
1295
+ xs: {
1296
+ button: 24,
1297
+ icon: 16,
1298
+ padding: 4
1299
+ },
1300
+ sm: {
1301
+ button: 32,
1302
+ icon: 16,
1303
+ padding: 8
1304
+ },
1305
+ md: {
1306
+ button: 40,
1307
+ icon: 24,
1308
+ padding: 8
1309
+ },
1310
+ lg: {
1311
+ button: 48,
1312
+ icon: 24,
1313
+ padding: 12
1314
+ }
1315
+ };
1316
+ var config = sizeConfig[size];
1317
+ return _extends({
1318
+ width: config.button,
1319
+ height: config.button,
1320
+ padding: theme.spacing(config.padding / 4),
1321
+ // Icon size
1322
+ '& .MuiSvgIcon-root': {
1323
+ fontSize: config.icon
1324
+ }
1325
+ }, variant === 'circular' && {
1326
+ borderRadius: '50%'
1327
+ }, variant === 'rounded' && {
1328
+ borderRadius: theme.spacing(1)
1329
+ }, variant === 'square' && {
1330
+ borderRadius: 0
1331
+ });
1290
1332
  });
1333
+ // Set default props
1291
1334
  IconButton.defaultProps = {
1292
1335
  variant: 'circular',
1293
1336
  hasBg: false,
1294
- disableOpacity: false
1337
+ disableOpacity: false,
1338
+ size: 'md',
1339
+ disableRipple: true
1295
1340
  };
1296
1341
 
1297
1342
  function _handleHelperColor(props, key) {
@@ -3885,12 +3930,11 @@ var RabexIconButton = {
3885
3930
  styleOverrides: {
3886
3931
  root: function root(_ref) {
3887
3932
  var ownerState = _ref.ownerState;
3888
- return _extends({}, ownerState.variant === 'circular' && {
3889
- borderRadius: '50%'
3890
- }, ownerState.variant === 'rounded' && {
3891
- borderRadius: 8
3892
- }, ownerState.variant === 'square' && {
3893
- borderRadius: 0
3933
+ return _extends({}, ownerState.disableOpacity && {
3934
+ color: 'inherit',
3935
+ '&:hover': {
3936
+ backgroundColor: 'transparent'
3937
+ }
3894
3938
  });
3895
3939
  }
3896
3940
  },
@@ -3902,18 +3946,63 @@ var RabexIconButton = {
3902
3946
  var theme = _ref2.theme,
3903
3947
  ownerState = _ref2.ownerState;
3904
3948
  return {
3949
+ backgroundColor: (ownerState === null || ownerState === void 0 ? void 0 : ownerState.bgColor) || theme.palette.secondary.A100,
3905
3950
  '&:hover': {
3906
- backgroundColor: (ownerState === null || ownerState === void 0 ? void 0 : ownerState.bgColor) || theme.palette.secondary.main
3951
+ backgroundColor: ownerState !== null && ownerState !== void 0 && ownerState.bgColor ? ownerState.bgColor + "CC" // Add opacity to custom color
3952
+ : theme.palette.secondary.A60
3907
3953
  }
3908
3954
  };
3909
3955
  }
3910
3956
  }, {
3911
3957
  props: {
3912
- disableOpacity: true
3958
+ color: 'primary'
3913
3959
  },
3914
- style: function style() {
3960
+ style: function style(_ref3) {
3961
+ var theme = _ref3.theme;
3915
3962
  return {
3916
- color: 'inherit'
3963
+ color: theme.palette.primary.A100,
3964
+ '&:hover': {
3965
+ backgroundColor: theme.palette.mode === 'light' ? theme.palette.primary.A10 : theme.palette.primary.A60
3966
+ }
3967
+ };
3968
+ }
3969
+ }, {
3970
+ props: {
3971
+ color: 'secondary'
3972
+ },
3973
+ style: function style(_ref4) {
3974
+ var theme = _ref4.theme;
3975
+ return {
3976
+ color: theme.palette.secondary.A100,
3977
+ '&:hover': {
3978
+ backgroundColor: theme.palette.mode === 'light' ? theme.palette.secondary.A10 : theme.palette.secondary.A60
3979
+ }
3980
+ };
3981
+ }
3982
+ }, {
3983
+ props: {
3984
+ color: 'error'
3985
+ },
3986
+ style: function style(_ref5) {
3987
+ var theme = _ref5.theme;
3988
+ return {
3989
+ color: theme.palette.error.A100,
3990
+ '&:hover': {
3991
+ backgroundColor: theme.palette.mode === 'light' ? theme.palette.error.A10 : theme.palette.error.A60
3992
+ }
3993
+ };
3994
+ }
3995
+ }, {
3996
+ props: {
3997
+ color: 'success'
3998
+ },
3999
+ style: function style(_ref6) {
4000
+ var theme = _ref6.theme;
4001
+ return {
4002
+ color: theme.palette.success.A100,
4003
+ '&:hover': {
4004
+ backgroundColor: theme.palette.mode === 'light' ? theme.palette.success.A10 : theme.palette.success.A60
4005
+ }
3917
4006
  };
3918
4007
  }
3919
4008
  }]