@rabex-kit/rabex-ui 0.2.4 → 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.
- package/dist/Grid/index.d.ts +1 -1
- package/dist/IconButton/index.d.ts +12 -2
- package/dist/Theme/IconButton/index.d.ts +10 -3
- package/dist/rabex-ui.cjs.development.js +111 -18
- 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 +112 -18
- package/dist/rabex-ui.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/rabex-ui.esm.js
CHANGED
@@ -14,6 +14,7 @@ import _includes from 'lodash-es/includes';
|
|
14
14
|
import bigDecimal from 'js-big-decimal';
|
15
15
|
import _filter from 'lodash-es/filter';
|
16
16
|
import _isUndefined from 'lodash-es/isUndefined';
|
17
|
+
import useTheme$1 from '@mui/material/styles/useTheme';
|
17
18
|
export { default as useTheme } from '@mui/material/styles/useTheme';
|
18
19
|
import MuiAlertTitle from '@mui/material/AlertTitle/AlertTitle.js';
|
19
20
|
import MuiAvatar from '@mui/material/Avatar/Avatar.js';
|
@@ -1252,7 +1253,7 @@ var FormLabel = function FormLabel(_ref) {
|
|
1252
1253
|
* You can read Material-UI Button Documentation [here](https://mui.com/material-ui/react-grid2/).
|
1253
1254
|
*
|
1254
1255
|
* ```typescript
|
1255
|
-
* import { Grid } from '@rabex-kit/
|
1256
|
+
* import { Grid } from '@rabex-kit/rabex-ui';
|
1256
1257
|
* ```
|
1257
1258
|
*
|
1258
1259
|
*
|
@@ -1265,12 +1266,11 @@ var Grid = function Grid(_ref) {
|
|
1265
1266
|
};
|
1266
1267
|
|
1267
1268
|
/**
|
1268
|
-
*
|
1269
1269
|
* Icon buttons are commonly found in app bars and toolbars.
|
1270
1270
|
* Icons are also appropriate for toggle buttons that allow a single choice to be selected or deselected,
|
1271
1271
|
* such as adding or removing a star to an item.
|
1272
1272
|
*
|
1273
|
-
* You can read Material-UI
|
1273
|
+
* You can read Material-UI IconButton Documentation [here](https://mui.com/material-ui/api/icon-button/).
|
1274
1274
|
*
|
1275
1275
|
* ```typescript
|
1276
1276
|
* import { IconButton } from '@rabex-kit/rabex-ui';
|
@@ -1282,15 +1282,61 @@ var Grid = function Grid(_ref) {
|
|
1282
1282
|
var IconButton = /*#__PURE__*/styled(MuiIconButton, {
|
1283
1283
|
name: 'MuiIconButton',
|
1284
1284
|
shouldForwardProp: function shouldForwardProp(prop) {
|
1285
|
-
return !['hasBg', 'disableOpacity', 'bgColor'].includes(prop.toString());
|
1285
|
+
return !['hasBg', 'disableOpacity', 'bgColor', 'variant'].includes(prop.toString());
|
1286
1286
|
}
|
1287
|
-
})(function () {
|
1288
|
-
|
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
|
+
});
|
1289
1332
|
});
|
1333
|
+
// Set default props
|
1290
1334
|
IconButton.defaultProps = {
|
1291
1335
|
variant: 'circular',
|
1292
1336
|
hasBg: false,
|
1293
|
-
disableOpacity: false
|
1337
|
+
disableOpacity: false,
|
1338
|
+
size: 'md',
|
1339
|
+
disableRipple: true
|
1294
1340
|
};
|
1295
1341
|
|
1296
1342
|
function _handleHelperColor(props, key) {
|
@@ -1798,7 +1844,11 @@ var SelectItem = function SelectItem(props) {
|
|
1798
1844
|
*/
|
1799
1845
|
var Skeleton = function Skeleton(_ref) {
|
1800
1846
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
1801
|
-
|
1847
|
+
var _useTheme = useTheme$1(),
|
1848
|
+
palette = _useTheme.palette;
|
1849
|
+
return React.createElement(MuiSkeleton, Object.assign({
|
1850
|
+
color: palette.base[200]
|
1851
|
+
}, props));
|
1802
1852
|
};
|
1803
1853
|
|
1804
1854
|
/**
|
@@ -3880,12 +3930,11 @@ var RabexIconButton = {
|
|
3880
3930
|
styleOverrides: {
|
3881
3931
|
root: function root(_ref) {
|
3882
3932
|
var ownerState = _ref.ownerState;
|
3883
|
-
return _extends({}, ownerState.
|
3884
|
-
|
3885
|
-
|
3886
|
-
|
3887
|
-
|
3888
|
-
borderRadius: 0
|
3933
|
+
return _extends({}, ownerState.disableOpacity && {
|
3934
|
+
color: 'inherit',
|
3935
|
+
'&:hover': {
|
3936
|
+
backgroundColor: 'transparent'
|
3937
|
+
}
|
3889
3938
|
});
|
3890
3939
|
}
|
3891
3940
|
},
|
@@ -3897,18 +3946,63 @@ var RabexIconButton = {
|
|
3897
3946
|
var theme = _ref2.theme,
|
3898
3947
|
ownerState = _ref2.ownerState;
|
3899
3948
|
return {
|
3949
|
+
backgroundColor: (ownerState === null || ownerState === void 0 ? void 0 : ownerState.bgColor) || theme.palette.secondary.A100,
|
3900
3950
|
'&:hover': {
|
3901
|
-
backgroundColor:
|
3951
|
+
backgroundColor: ownerState !== null && ownerState !== void 0 && ownerState.bgColor ? ownerState.bgColor + "CC" // Add opacity to custom color
|
3952
|
+
: theme.palette.secondary.A60
|
3902
3953
|
}
|
3903
3954
|
};
|
3904
3955
|
}
|
3905
3956
|
}, {
|
3906
3957
|
props: {
|
3907
|
-
|
3958
|
+
color: 'primary'
|
3908
3959
|
},
|
3909
|
-
style: function style() {
|
3960
|
+
style: function style(_ref3) {
|
3961
|
+
var theme = _ref3.theme;
|
3910
3962
|
return {
|
3911
|
-
color:
|
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
|
+
}
|
3912
4006
|
};
|
3913
4007
|
}
|
3914
4008
|
}]
|