@rabex-kit/rabex-ui 0.2.74 → 0.2.76
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/Switch/index.d.ts +32 -0
- package/dist/Theme/Switch/index.d.ts +18 -0
- package/dist/index.d.ts +3 -2
- package/dist/rabex-ui.cjs.development.js +128 -1
- 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 +128 -2
- package/dist/rabex-ui.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/rabex-ui.esm.js
CHANGED
|
@@ -119,6 +119,7 @@ import MuiStepper from '@mui/material/Stepper/Stepper.js';
|
|
|
119
119
|
import MuiSwipeableDrawer from '@mui/material/SwipeableDrawer/SwipeableDrawer.js';
|
|
120
120
|
import { ClickAwayListener as ClickAwayListener$1 } from '@mui/base/ClickAwayListener';
|
|
121
121
|
import MuiZoom from '@mui/material/Zoom/Zoom.js';
|
|
122
|
+
import MuiSwitch from '@mui/material/Switch/Switch.js';
|
|
122
123
|
|
|
123
124
|
/**
|
|
124
125
|
* The accordion component allows the user to show and hide sections of related content on a page.
|
|
@@ -5967,6 +5968,108 @@ var RabexSkeleton = {
|
|
|
5967
5968
|
components: components$a
|
|
5968
5969
|
};
|
|
5969
5970
|
|
|
5971
|
+
var SIZE_MAP = {
|
|
5972
|
+
sm: {
|
|
5973
|
+
trackWidth: 60,
|
|
5974
|
+
trackHeight: 32,
|
|
5975
|
+
thumb: 24,
|
|
5976
|
+
translateX: 28,
|
|
5977
|
+
top: 2,
|
|
5978
|
+
left: 2
|
|
5979
|
+
},
|
|
5980
|
+
xs: {
|
|
5981
|
+
trackWidth: 44,
|
|
5982
|
+
trackHeight: 24,
|
|
5983
|
+
thumb: 16,
|
|
5984
|
+
translateX: 20,
|
|
5985
|
+
top: 2,
|
|
5986
|
+
left: 2
|
|
5987
|
+
},
|
|
5988
|
+
'2xs': {
|
|
5989
|
+
trackWidth: 32,
|
|
5990
|
+
trackHeight: 16,
|
|
5991
|
+
thumb: 12,
|
|
5992
|
+
translateX: 16,
|
|
5993
|
+
top: 0,
|
|
5994
|
+
left: 0
|
|
5995
|
+
}
|
|
5996
|
+
};
|
|
5997
|
+
var components$b = {
|
|
5998
|
+
styleOverrides: {
|
|
5999
|
+
root: function root(_ref) {
|
|
6000
|
+
var ownerState = _ref.ownerState,
|
|
6001
|
+
theme = _ref.theme;
|
|
6002
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6003
|
+
return {
|
|
6004
|
+
padding: 0,
|
|
6005
|
+
width: size.trackWidth,
|
|
6006
|
+
height: size.trackHeight,
|
|
6007
|
+
marginRight: 8,
|
|
6008
|
+
'&.Mui-disabled + .MuiFormControlLabel-label': {
|
|
6009
|
+
color: theme.palette.textColor[400],
|
|
6010
|
+
opacity: '32%'
|
|
6011
|
+
},
|
|
6012
|
+
'& + .MuiFormControlLabel-label': {
|
|
6013
|
+
color: theme.palette.textColor[900]
|
|
6014
|
+
}
|
|
6015
|
+
};
|
|
6016
|
+
},
|
|
6017
|
+
switchBase: function switchBase(_ref2) {
|
|
6018
|
+
var ownerState = _ref2.ownerState,
|
|
6019
|
+
theme = _ref2.theme;
|
|
6020
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6021
|
+
return {
|
|
6022
|
+
padding: 0,
|
|
6023
|
+
margin: 2,
|
|
6024
|
+
top: size.top,
|
|
6025
|
+
left: size.left,
|
|
6026
|
+
'&.Mui-checked': {
|
|
6027
|
+
transform: "translateX(" + size.translateX + "px)",
|
|
6028
|
+
color: theme.palette.base[50],
|
|
6029
|
+
'& + .MuiSwitch-track': {
|
|
6030
|
+
backgroundColor: theme.palette.primary[500],
|
|
6031
|
+
opacity: 1
|
|
6032
|
+
}
|
|
6033
|
+
},
|
|
6034
|
+
'&.Mui-disabled': {
|
|
6035
|
+
color: theme.palette.base[200],
|
|
6036
|
+
opacity: '32%',
|
|
6037
|
+
'& + .MuiSwitch-track': {
|
|
6038
|
+
backgroundColor: theme.palette.base[200],
|
|
6039
|
+
opacity: '32%'
|
|
6040
|
+
}
|
|
6041
|
+
}
|
|
6042
|
+
};
|
|
6043
|
+
},
|
|
6044
|
+
thumb: function thumb(_ref3) {
|
|
6045
|
+
var ownerState = _ref3.ownerState,
|
|
6046
|
+
theme = _ref3.theme;
|
|
6047
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6048
|
+
return {
|
|
6049
|
+
width: size.thumb,
|
|
6050
|
+
height: size.thumb,
|
|
6051
|
+
backgroundColor: theme.palette.base[50],
|
|
6052
|
+
boxShadow: 'none'
|
|
6053
|
+
};
|
|
6054
|
+
},
|
|
6055
|
+
track: function track(_ref4) {
|
|
6056
|
+
var ownerState = _ref4.ownerState,
|
|
6057
|
+
theme = _ref4.theme;
|
|
6058
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6059
|
+
return {
|
|
6060
|
+
width: size.trackWidth,
|
|
6061
|
+
height: size.trackHeight,
|
|
6062
|
+
borderRadius: size.trackHeight / 2,
|
|
6063
|
+
backgroundColor: theme.palette.base[300],
|
|
6064
|
+
opacity: 1
|
|
6065
|
+
};
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6068
|
+
};
|
|
6069
|
+
var RabexSwitch = {
|
|
6070
|
+
components: components$b
|
|
6071
|
+
};
|
|
6072
|
+
|
|
5970
6073
|
var getDesignTokens = function getDesignTokens(_ref) {
|
|
5971
6074
|
var deviceType = _ref.deviceType,
|
|
5972
6075
|
_ref$mode = _ref.mode,
|
|
@@ -6030,7 +6133,8 @@ var getDesignTokens = function getDesignTokens(_ref) {
|
|
|
6030
6133
|
MuiGrid: RabexGrid.components,
|
|
6031
6134
|
MuiLoadingButton: RabexLoadingButton.components,
|
|
6032
6135
|
MuiAutocomplete: RabexAutocomplete.components,
|
|
6033
|
-
MuiSkeleton: RabexSkeleton.components
|
|
6136
|
+
MuiSkeleton: RabexSkeleton.components,
|
|
6137
|
+
MuiSwitch: RabexSwitch.components
|
|
6034
6138
|
}),
|
|
6035
6139
|
palette: _extends({}, mode === 'light' ? createPalette(RabexLightPalette) : createPalette(RabexDarkPalette)),
|
|
6036
6140
|
typography: RabexTypography.typography,
|
|
@@ -7196,5 +7300,27 @@ var SegmentedControlTab = /*#__PURE__*/styled(function (props) {
|
|
|
7196
7300
|
});
|
|
7197
7301
|
SegmentedControlTab.defaultProps = {};
|
|
7198
7302
|
|
|
7199
|
-
|
|
7303
|
+
/**
|
|
7304
|
+
* Rabex Switch
|
|
7305
|
+
*
|
|
7306
|
+
* A thin wrapper around MUI Switch.
|
|
7307
|
+
*
|
|
7308
|
+
* Styling and behavior are controlled exclusively via theme overrides.
|
|
7309
|
+
* This keeps the component lightweight, predictable, and consistent
|
|
7310
|
+
* across the application.
|
|
7311
|
+
*
|
|
7312
|
+
* @example
|
|
7313
|
+
* ```tsx
|
|
7314
|
+
* import { Switch } from '@rabex-kit/rabex-ui';
|
|
7315
|
+
*
|
|
7316
|
+
* <Switch checked={value} onChange={handleChange} />
|
|
7317
|
+
* ```
|
|
7318
|
+
*
|
|
7319
|
+
* For labeling, always use `FormControlLabel`.
|
|
7320
|
+
*/
|
|
7321
|
+
var Switch = function Switch(props) {
|
|
7322
|
+
return React.createElement(MuiSwitch, Object.assign({}, props));
|
|
7323
|
+
};
|
|
7324
|
+
|
|
7325
|
+
export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertAction, AlertTimer, AlertTitle, Autocomplete, Avatar, Backdrop, Box, Breadcrumbs, Button, Checkbox, Chip, CircularProgress, ClickAwayListener, Collapse, Container, CurrencyPairsTitle, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Drawer, DynamicBackground, DynamicBackgroundContainer, Fade, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, FormikInput, FormikSelect, FormikTextField, Grid, Grow, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemSecondaryAction, listItemText as ListItemText, ListSubHeader, LoadingButton, Menu, MenuItem, MenuList, MobileStepper, Modal, ModalContent, NoSsr, Pagination, PaginationItem, Paper, Popover, Popper, RTable, RTableHead, RTableRow, Radio, RadioGroup, SeeMore, SegmentedControl, SegmentedControlTab, Select, SelectItem, Skeleton, Slide, Slider, SliderContent, Snackbar, SnackbarContent, Stack, Step, StepButton, StepConnector, StepContent, StepIcon, StepLabel, Stepper, SvgIcon, SwipeableDrawer, Switch, Tab, TabContext, TabList, TabPanel, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, TextField, ToggleButton, ToggleButtonGroup, Tooltip, Typography, UploadButton, Zoom, numberUtils, handleSearch as searchUtils, theme, useCopyToClipboard, useOnScreen, useResponsive, useTime, useWindowSize };
|
|
7200
7326
|
//# sourceMappingURL=rabex-ui.esm.js.map
|