@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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SwitchProps as MuiSwitchProps } from '@mui/material';
|
|
3
|
+
export declare type SwitchProps = MuiSwitchProps;
|
|
4
|
+
declare module '@mui/material/Switch' {
|
|
5
|
+
interface SwitchPropsSizeOverrides {
|
|
6
|
+
small: true;
|
|
7
|
+
medium: true;
|
|
8
|
+
sm: true;
|
|
9
|
+
xs: true;
|
|
10
|
+
'2xs': true;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Rabex Switch
|
|
15
|
+
*
|
|
16
|
+
* A thin wrapper around MUI Switch.
|
|
17
|
+
*
|
|
18
|
+
* Styling and behavior are controlled exclusively via theme overrides.
|
|
19
|
+
* This keeps the component lightweight, predictable, and consistent
|
|
20
|
+
* across the application.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { Switch } from '@rabex-kit/rabex-ui';
|
|
25
|
+
*
|
|
26
|
+
* <Switch checked={value} onChange={handleChange} />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* For labeling, always use `FormControlLabel`.
|
|
30
|
+
*/
|
|
31
|
+
declare const Switch: React.FC<SwitchProps>;
|
|
32
|
+
export default Switch;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
components: {
|
|
4
|
+
defaultProps?: Partial<import("@mui/material").SwitchProps> | undefined;
|
|
5
|
+
styleOverrides?: Partial<Record<"root" | "edgeStart" | "edgeEnd" | "switchBase" | "colorPrimary" | "colorSecondary" | "sizeSmall" | "sizeMedium" | "checked" | "disabled" | "input" | "thumb" | "track", string | number | boolean | import("@mui/styled-engine").CSSObject | import("@mui/styled-engine").ComponentSelector | import("@mui/styled-engine").Keyframes | import("@mui/styled-engine").SerializedStyles | import("@mui/styled-engine").ArrayCSSInterpolation | ((props: {
|
|
6
|
+
ownerState: import("@mui/material").SwitchProps & Record<string, unknown>;
|
|
7
|
+
} & {
|
|
8
|
+
theme: Pick<Theme, "unstable_sx" | "unstable_sxConfig" | "mixins" | "palette" | "shadows" | "transitions" | "typography" | "zIndex" | "unstable_strictMode" | "shape" | "breakpoints" | "direction" | "spacing">;
|
|
9
|
+
} & Record<string, unknown>) => import("@mui/styled-engine").CSSInterpolation) | null | undefined>> | undefined;
|
|
10
|
+
variants?: {
|
|
11
|
+
props: Partial<import("@mui/material").SwitchProps>;
|
|
12
|
+
style: import("@mui/styled-engine").Interpolation<{
|
|
13
|
+
theme: Theme;
|
|
14
|
+
}>;
|
|
15
|
+
}[] | undefined;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -117,5 +117,6 @@ import UploadButton, { UploadButtonProps } from './UploadButton';
|
|
|
117
117
|
import Zoom, { ZoomProps } from './Zoom';
|
|
118
118
|
import SegmentedControl, { SegmentedControlProps } from './SegmentedControl';
|
|
119
119
|
import SegmentedControlTab, { SegmentedControlTabProps } from './SegmentedControlTab';
|
|
120
|
-
|
|
121
|
-
export
|
|
120
|
+
import Switch, { SwitchProps } from './Switch';
|
|
121
|
+
export { theme, Typography, Button, LoadingButton, Tabs, Tab, Box, Grid, NoSsr, Skeleton, Stack, Chip, Paper, Divider, Checkbox, Radio, Tooltip, Avatar, Breadcrumbs, CurrencyPairsTitle, List, ListItem, ListItemButton, ListItemIcon, ListItemAvatar, ListItemSecondaryAction, ListSubHeader, ListItemText, SvgIcon, ToggleButton, ToggleButtonGroup, TabPanel, IconButton, Select, SelectItem, DynamicBackground, DynamicBackgroundContainer, Table, TableHead, TableBody, TableRow, TableCell, TableContainer, TablePagination, TableFooter, TableSortLabel, RTable, RTableHead, RTableRow, Input, InputLabel, RadioGroup, FormLabel, FormControl, FormGroup, FormControlLabel, FormHelperText, TabContext, TabList, Link, useTheme, useCopyToClipboard, useMediaQuery, useOnScreen, useScrollTrigger, useTime, useWindowSize, useResponsive, numberUtils, searchUtils, Slider, InputAdornment, Accordion, AccordionDetails, AccordionActions, AccordionSummary, Stepper, StepContent, StepConnector, StepButton, StepIcon, Step, StepLabel, MobileStepper, CssBaseline, Backdrop, Modal, ModalContent, Container, Alert, AlertAction, AlertTimer, AlertTitle, UploadButton, Snackbar, SnackbarContent, LinearProgress, CircularProgress, TextField, FormikTextField, FormikInput, FormikSelect, MenuItem, ThemeProvider, styled, MenuList, Menu, Popover, Popper, Fade, Autocomplete, Zoom, Collapse, Grow, Slide, Dialog, DialogActions, DialogContent, DialogTitle, SwipeableDrawer, SeeMore, ClickAwayListener, Pagination, PaginationItem, Drawer, SliderContent, SegmentedControl, SegmentedControlTab, Switch, };
|
|
122
|
+
export type { Theme, CSSObject, TypographyProps, ButtonProps, LoadingButtonProps, TabsProps, TabProps, BoxProps, GridProps, NoSsrProps, SkeletonProps, StackProps, ChipProps, PaperProps, DividerProps, CheckboxProps, RadioProps, TooltipProps, BreadcrumbsProps, ListProps, ListItemProps, ListItemAvatarProps, ListItemButtonProps, ListItemIconProps, ListItemTextProps, ListItemSecondaryActionProps, ListSubHeaderProps, SvgIconProps, ToggleButtonProps, ToggleButtonGroupProps, TabPanelProps, IconButtonProps, AvatarProps, CurrencyPairsTitleProps, SelectProps, SelectItemProps, DynamicBackgroundProps, DynamicBackgroundContainerProps, TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableCellProps, TableContainerProps, TablePaginationProps, TableFooterProps, TableSortLabelProps, RTableProps, RTableRowProps, RTableHeadProps, InputProps, InputLabelProps, RadioGroupProps, FormLabelProps, FormControlProps, FormGroupProps, FormControlLabelProps, FormHelperTextProps, TabContextProps, TabListProps, LinkProps, SliderProps, InputAdornmentProps, AccordionProps, AccordionDetailsProps, AccordionActionsProps, AccordionSummaryProps, StepperProps, StepContentProps, StepConnectorProps, StepButtonProps, StepIconProps, StepProps, StepLabelProps, MobileStepperProps, Palette, PaletteColor, BackdropProps, ModalProps, ModalContentProps, ContainerProps, AlertProps, AlertActionProps, AlertTimerProps, AlertTitleProps, UploadButtonProps, SnackbarProps, SnackbarContentProps, LinearProgressProps, CircularProgressProps, TextFieldProps, FormikTextFieldProps, FormikInputProps, FormikSelectProps, MenuItemProps, MenuListProps, MenuProps, PopoverProps, PopperProps, ZoomProps, CollapseProps, FadeProps, AutocompleteProps, GrowProps, SlideProps, DialogProps, DialogActionsProps, DialogContentProps, DialogTitleProps, SwipeableDrawerProps, SeeMoreProps, ClickAwayListenerProps, PaginationProps, PaginationItemProps, DrawerProps, SliderContentProps, SegmentedControlProps, SegmentedControlTabProps, SwitchProps, };
|
|
@@ -123,6 +123,7 @@ var MuiStepper = _interopDefault(require('@mui/material/Stepper/Stepper.js'));
|
|
|
123
123
|
var MuiSwipeableDrawer = _interopDefault(require('@mui/material/SwipeableDrawer/SwipeableDrawer.js'));
|
|
124
124
|
var ClickAwayListener$1 = require('@mui/base/ClickAwayListener');
|
|
125
125
|
var MuiZoom = _interopDefault(require('@mui/material/Zoom/Zoom.js'));
|
|
126
|
+
var MuiSwitch = _interopDefault(require('@mui/material/Switch/Switch.js'));
|
|
126
127
|
|
|
127
128
|
/**
|
|
128
129
|
* The accordion component allows the user to show and hide sections of related content on a page.
|
|
@@ -5971,6 +5972,108 @@ var RabexSkeleton = {
|
|
|
5971
5972
|
components: components$a
|
|
5972
5973
|
};
|
|
5973
5974
|
|
|
5975
|
+
var SIZE_MAP = {
|
|
5976
|
+
sm: {
|
|
5977
|
+
trackWidth: 60,
|
|
5978
|
+
trackHeight: 32,
|
|
5979
|
+
thumb: 24,
|
|
5980
|
+
translateX: 28,
|
|
5981
|
+
top: 2,
|
|
5982
|
+
left: 2
|
|
5983
|
+
},
|
|
5984
|
+
xs: {
|
|
5985
|
+
trackWidth: 44,
|
|
5986
|
+
trackHeight: 24,
|
|
5987
|
+
thumb: 16,
|
|
5988
|
+
translateX: 20,
|
|
5989
|
+
top: 2,
|
|
5990
|
+
left: 2
|
|
5991
|
+
},
|
|
5992
|
+
'2xs': {
|
|
5993
|
+
trackWidth: 32,
|
|
5994
|
+
trackHeight: 16,
|
|
5995
|
+
thumb: 12,
|
|
5996
|
+
translateX: 16,
|
|
5997
|
+
top: 0,
|
|
5998
|
+
left: 0
|
|
5999
|
+
}
|
|
6000
|
+
};
|
|
6001
|
+
var components$b = {
|
|
6002
|
+
styleOverrides: {
|
|
6003
|
+
root: function root(_ref) {
|
|
6004
|
+
var ownerState = _ref.ownerState,
|
|
6005
|
+
theme = _ref.theme;
|
|
6006
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6007
|
+
return {
|
|
6008
|
+
padding: 0,
|
|
6009
|
+
width: size.trackWidth,
|
|
6010
|
+
height: size.trackHeight,
|
|
6011
|
+
marginRight: 8,
|
|
6012
|
+
'&.Mui-disabled + .MuiFormControlLabel-label': {
|
|
6013
|
+
color: theme.palette.textColor[400],
|
|
6014
|
+
opacity: '32%'
|
|
6015
|
+
},
|
|
6016
|
+
'& + .MuiFormControlLabel-label': {
|
|
6017
|
+
color: theme.palette.textColor[900]
|
|
6018
|
+
}
|
|
6019
|
+
};
|
|
6020
|
+
},
|
|
6021
|
+
switchBase: function switchBase(_ref2) {
|
|
6022
|
+
var ownerState = _ref2.ownerState,
|
|
6023
|
+
theme = _ref2.theme;
|
|
6024
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6025
|
+
return {
|
|
6026
|
+
padding: 0,
|
|
6027
|
+
margin: 2,
|
|
6028
|
+
top: size.top,
|
|
6029
|
+
left: size.left,
|
|
6030
|
+
'&.Mui-checked': {
|
|
6031
|
+
transform: "translateX(" + size.translateX + "px)",
|
|
6032
|
+
color: theme.palette.base[50],
|
|
6033
|
+
'& + .MuiSwitch-track': {
|
|
6034
|
+
backgroundColor: theme.palette.primary[500],
|
|
6035
|
+
opacity: 1
|
|
6036
|
+
}
|
|
6037
|
+
},
|
|
6038
|
+
'&.Mui-disabled': {
|
|
6039
|
+
color: theme.palette.base[200],
|
|
6040
|
+
opacity: '32%',
|
|
6041
|
+
'& + .MuiSwitch-track': {
|
|
6042
|
+
backgroundColor: theme.palette.base[200],
|
|
6043
|
+
opacity: '32%'
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
};
|
|
6047
|
+
},
|
|
6048
|
+
thumb: function thumb(_ref3) {
|
|
6049
|
+
var ownerState = _ref3.ownerState,
|
|
6050
|
+
theme = _ref3.theme;
|
|
6051
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6052
|
+
return {
|
|
6053
|
+
width: size.thumb,
|
|
6054
|
+
height: size.thumb,
|
|
6055
|
+
backgroundColor: theme.palette.base[50],
|
|
6056
|
+
boxShadow: 'none'
|
|
6057
|
+
};
|
|
6058
|
+
},
|
|
6059
|
+
track: function track(_ref4) {
|
|
6060
|
+
var ownerState = _ref4.ownerState,
|
|
6061
|
+
theme = _ref4.theme;
|
|
6062
|
+
var size = SIZE_MAP[ownerState.size] || SIZE_MAP['2xs'];
|
|
6063
|
+
return {
|
|
6064
|
+
width: size.trackWidth,
|
|
6065
|
+
height: size.trackHeight,
|
|
6066
|
+
borderRadius: size.trackHeight / 2,
|
|
6067
|
+
backgroundColor: theme.palette.base[300],
|
|
6068
|
+
opacity: 1
|
|
6069
|
+
};
|
|
6070
|
+
}
|
|
6071
|
+
}
|
|
6072
|
+
};
|
|
6073
|
+
var RabexSwitch = {
|
|
6074
|
+
components: components$b
|
|
6075
|
+
};
|
|
6076
|
+
|
|
5974
6077
|
var getDesignTokens = function getDesignTokens(_ref) {
|
|
5975
6078
|
var deviceType = _ref.deviceType,
|
|
5976
6079
|
_ref$mode = _ref.mode,
|
|
@@ -6034,7 +6137,8 @@ var getDesignTokens = function getDesignTokens(_ref) {
|
|
|
6034
6137
|
MuiGrid: RabexGrid.components,
|
|
6035
6138
|
MuiLoadingButton: RabexLoadingButton.components,
|
|
6036
6139
|
MuiAutocomplete: RabexAutocomplete.components,
|
|
6037
|
-
MuiSkeleton: RabexSkeleton.components
|
|
6140
|
+
MuiSkeleton: RabexSkeleton.components,
|
|
6141
|
+
MuiSwitch: RabexSwitch.components
|
|
6038
6142
|
}),
|
|
6039
6143
|
palette: _extends({}, mode === 'light' ? createPalette(RabexLightPalette) : createPalette(RabexDarkPalette)),
|
|
6040
6144
|
typography: RabexTypography.typography,
|
|
@@ -7200,6 +7304,28 @@ var SegmentedControlTab = /*#__PURE__*/styled(function (props) {
|
|
|
7200
7304
|
});
|
|
7201
7305
|
SegmentedControlTab.defaultProps = {};
|
|
7202
7306
|
|
|
7307
|
+
/**
|
|
7308
|
+
* Rabex Switch
|
|
7309
|
+
*
|
|
7310
|
+
* A thin wrapper around MUI Switch.
|
|
7311
|
+
*
|
|
7312
|
+
* Styling and behavior are controlled exclusively via theme overrides.
|
|
7313
|
+
* This keeps the component lightweight, predictable, and consistent
|
|
7314
|
+
* across the application.
|
|
7315
|
+
*
|
|
7316
|
+
* @example
|
|
7317
|
+
* ```tsx
|
|
7318
|
+
* import { Switch } from '@rabex-kit/rabex-ui';
|
|
7319
|
+
*
|
|
7320
|
+
* <Switch checked={value} onChange={handleChange} />
|
|
7321
|
+
* ```
|
|
7322
|
+
*
|
|
7323
|
+
* For labeling, always use `FormControlLabel`.
|
|
7324
|
+
*/
|
|
7325
|
+
var Switch = function Switch(props) {
|
|
7326
|
+
return React__default.createElement(MuiSwitch, Object.assign({}, props));
|
|
7327
|
+
};
|
|
7328
|
+
|
|
7203
7329
|
exports.useMediaQuery = useMediaQuery;
|
|
7204
7330
|
exports.useScrollTrigger = useScrollTrigger_js;
|
|
7205
7331
|
exports.useTheme = useTheme$1;
|
|
@@ -7299,6 +7425,7 @@ exports.StepLabel = StepLabel;
|
|
|
7299
7425
|
exports.Stepper = Stepper;
|
|
7300
7426
|
exports.SvgIcon = SvgIcon;
|
|
7301
7427
|
exports.SwipeableDrawer = SwipeableDrawer;
|
|
7428
|
+
exports.Switch = Switch;
|
|
7302
7429
|
exports.Tab = Tab;
|
|
7303
7430
|
exports.TabContext = TabContext;
|
|
7304
7431
|
exports.TabList = TabList;
|