@superdispatch/ui 0.21.0 → 0.21.5-alpha.0
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-node/index.js +1434 -1349
- package/dist-node/index.js.map +1 -1
- package/dist-src/adaptive-toolbar/AdaptiveToolbar.js +14 -12
- package/dist-src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.js +3 -3
- package/dist-src/app-bar/AppBarOverrides.js +6 -4
- package/dist-src/autocomplete/AutocompleteOverrides.js +14 -18
- package/dist-src/avatar/AvatarOverrides.js +14 -12
- package/dist-src/avatar-button/AvatarButton.js +80 -92
- package/dist-src/button/Button.js +11 -15
- package/dist-src/button/ButtonOverrides.js +147 -149
- package/dist-src/card/CardOverrides.js +10 -6
- package/dist-src/card-button/CardButton.js +78 -75
- package/dist-src/checkbox/CheckboxField.js +1 -1
- package/dist-src/checkbox/CheckboxGroudField.js +1 -1
- package/dist-src/checkbox/CheckboxOverrides.js +60 -50
- package/dist-src/chip/ChipOverrides.js +88 -85
- package/dist-src/description-list/DescriptionList.js +58 -55
- package/dist-src/dialog/DialogOverrides.js +31 -25
- package/dist-src/drawer/DrawerActions.js +32 -34
- package/dist-src/drawer/DrawerContent.js +10 -26
- package/dist-src/drawer/DrawerList.js +8 -27
- package/dist-src/drawer/DrawerOverrides.js +12 -10
- package/dist-src/drawer/DrawerTitle.js +46 -40
- package/dist-src/grid/GridStack.js +1 -1
- package/dist-src/grid/InlineGrid.js +2 -2
- package/dist-src/icon-button/IconButtonOverrides.js +48 -32
- package/dist-src/info-card/InfoCard.js +27 -37
- package/dist-src/link/LinkOverrides.js +29 -26
- package/dist-src/list/ListOverrides.js +10 -7
- package/dist-src/menu/MenuOverrides.js +28 -14
- package/dist-src/overflow-text/OverflowText.js +35 -34
- package/dist-src/pagination/PaginationOverrides.js +27 -32
- package/dist-src/paper/PaperOverrides.js +8 -6
- package/dist-src/radio/RadioField.js +1 -1
- package/dist-src/radio/RadioGroupField.js +1 -1
- package/dist-src/radio/RadioOverrides.js +38 -36
- package/dist-src/responsive/ResponsiveContext.js +1 -1
- package/dist-src/snackbar/Snackbar.js +1 -1
- package/dist-src/snackbar/SnackbarContent.js +3 -3
- package/dist-src/snackbar/SnackbarOverrides.js +28 -18
- package/dist-src/svg-icon/SvgIconOverrides.js +28 -18
- package/dist-src/switch/SwitchOverrides.js +72 -71
- package/dist-src/tabs/TabsOverrides.js +34 -30
- package/dist-src/tag/Tag.js +2 -2
- package/dist-src/text-field/TextFieldOverrides.js +158 -137
- package/dist-src/theme/CssBaselineOverrides.js +8 -0
- package/dist-src/theme/ThemeProvider.js +25 -28
- package/dist-src/tiles/Tiles.js +4 -3
- package/dist-src/toolbar/ToolbarOverrides.js +10 -8
- package/dist-src/tooltip/TooltipOverrides.js +33 -30
- package/dist-src/typography/TypographyOverrides.js +12 -2
- package/dist-types/index.d.ts +31 -26
- package/dist-web/index.js +1371 -1286
- package/dist-web/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["items"];
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { makeStyles } from '@material-ui/styles';
|
|
4
|
+
import { MoreHoriz } from '@mui/icons-material';
|
|
5
|
+
import { Divider, Grid, Menu, MenuItem, styled, Toolbar, Typography } from '@mui/material';
|
|
7
6
|
import { forwardRef, useRef, useState } from 'react';
|
|
8
7
|
import { Button } from "../button/Button.js";
|
|
9
8
|
import { DropdownButton } from "../dropdown-button/DropdownButton.js";
|
|
10
|
-
import { useResizeObserver } from "../utils/ResizeObserver.js";
|
|
9
|
+
import { useResizeObserver } from "../utils/ResizeObserver.js"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
15
|
-
actions: {
|
|
16
|
-
overflow: 'hidden'
|
|
17
|
-
}
|
|
18
|
-
}, {
|
|
15
|
+
var GridActionsItem = /*#__PURE__*/styled(Grid, {
|
|
19
16
|
name: 'SD-AdaptiveToolbar'
|
|
17
|
+
})(() => {
|
|
18
|
+
return {
|
|
19
|
+
overflow: 'hidden'
|
|
20
|
+
};
|
|
20
21
|
});
|
|
21
22
|
export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
22
23
|
var {
|
|
@@ -24,7 +25,6 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
24
25
|
} = _ref,
|
|
25
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
27
|
|
|
27
|
-
var styles = useStyles();
|
|
28
28
|
var itemNodes = useRef([]);
|
|
29
29
|
var optionsButtonRef = useRef(null);
|
|
30
30
|
var [firstHiddenIdx, setFirstHiddenIdx] = useState(-1);
|
|
@@ -66,9 +66,8 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
66
66
|
container: true,
|
|
67
67
|
spacing: 1,
|
|
68
68
|
ref: setRootNode,
|
|
69
|
-
children: [/*#__PURE__*/_jsx(
|
|
69
|
+
children: [/*#__PURE__*/_jsx(GridActionsItem, {
|
|
70
70
|
item: true,
|
|
71
|
-
className: styles.actions,
|
|
72
71
|
children: /*#__PURE__*/_jsx(Grid, {
|
|
73
72
|
container: true,
|
|
74
73
|
spacing: 1,
|
|
@@ -90,6 +89,8 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
90
89
|
}, dropdownItem.key))
|
|
91
90
|
})) : /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
92
91
|
type: "button",
|
|
92
|
+
color: "primary",
|
|
93
|
+
variant: "outlined",
|
|
93
94
|
onClick: item.onClick
|
|
94
95
|
}, item.ButtonProps), {}, {
|
|
95
96
|
children: /*#__PURE__*/_jsx(Typography, {
|
|
@@ -106,6 +107,7 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
106
107
|
component: "div",
|
|
107
108
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
108
109
|
type: "button",
|
|
110
|
+
variant: "outlined",
|
|
109
111
|
onClick: _ref2 => {
|
|
110
112
|
var {
|
|
111
113
|
currentTarget
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { makeStyles } from '@
|
|
1
|
+
import { MoreHoriz } from '@mui/icons-material';
|
|
2
|
+
import { Divider, Grid, Menu, MenuItem } from '@mui/material';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
4
|
import { cloneElement, forwardRef, useRef, useState } from 'react';
|
|
5
5
|
import { Button } from "../button/Button.js";
|
|
6
6
|
import { mergeRefs } from "../utils/mergeRefs.js";
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SvgIcon } from '@material-ui/core';
|
|
1
|
+
import { autocompleteClasses, SvgIcon } from '@mui/material';
|
|
3
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
export function overrideAutocomplete(theme) {
|
|
5
|
-
var sm = theme.breakpoints.up('sm');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
MuiAutocomplete: {
|
|
4
|
+
var sm = theme.breakpoints.up('sm');
|
|
5
|
+
theme.components.MuiAutocomplete = {
|
|
6
|
+
defaultProps: {
|
|
9
7
|
popupIcon: /*#__PURE__*/_jsx(SvgIcon, {
|
|
10
8
|
children: /*#__PURE__*/_jsx("path", {
|
|
11
9
|
d: "M12 16.5L6 9h12l-6 7.5z",
|
|
12
10
|
fill: "currentColor"
|
|
13
11
|
})
|
|
14
12
|
})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
MuiAutocomplete: {
|
|
19
|
-
paper: _objectSpread({}, theme.typography.body2),
|
|
13
|
+
},
|
|
14
|
+
styleOverrides: {
|
|
15
|
+
// paper: { ...theme.typography.body2 },
|
|
20
16
|
tag: {
|
|
21
17
|
margin: '4px',
|
|
22
18
|
[sm]: {
|
|
@@ -40,27 +36,27 @@ export function overrideAutocomplete(theme) {
|
|
|
40
36
|
inputRoot: {
|
|
41
37
|
'&[class*="MuiOutlinedInput-root"]': {
|
|
42
38
|
padding: '6px 8px',
|
|
43
|
-
|
|
39
|
+
["& .".concat(autocompleteClasses.input)]: {
|
|
44
40
|
width: '144px',
|
|
45
41
|
padding: '4px'
|
|
46
42
|
},
|
|
47
|
-
|
|
48
|
-
paddingLeft:
|
|
43
|
+
["& .".concat(autocompleteClasses.input, ":first-child")]: {
|
|
44
|
+
paddingLeft: 'unset'
|
|
49
45
|
},
|
|
50
|
-
|
|
46
|
+
["& .".concat(autocompleteClasses.endAdornment)]: {
|
|
51
47
|
right: '12px'
|
|
52
48
|
},
|
|
53
49
|
[sm]: {
|
|
54
50
|
padding: theme.spacing(0.5, 0.75),
|
|
55
|
-
|
|
51
|
+
["& .".concat(autocompleteClasses.input)]: {
|
|
56
52
|
padding: '2px'
|
|
57
53
|
},
|
|
58
|
-
|
|
54
|
+
["& .".concat(autocompleteClasses.endAdornment)]: {
|
|
59
55
|
right: '8px'
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
|
-
}
|
|
61
|
+
};
|
|
66
62
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import { Color } from "../theme/Color.js";
|
|
3
3
|
export function overrideAvatar(theme) {
|
|
4
|
-
theme.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
theme.components.MuiAvatar = {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: _objectSpread(_objectSpread({}, theme.typography.h5), {}, {
|
|
7
|
+
textTransform: 'uppercase',
|
|
8
|
+
width: theme.spacing(5),
|
|
9
|
+
height: theme.spacing(5),
|
|
10
|
+
[theme.breakpoints.up('sm')]: {
|
|
11
|
+
width: theme.spacing(4),
|
|
12
|
+
height: theme.spacing(4)
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
colorDefault: {
|
|
16
|
+
color: Color.Dark300,
|
|
17
|
+
backgroundColor: Color.Silver300
|
|
12
18
|
}
|
|
13
|
-
}),
|
|
14
|
-
colorDefault: {
|
|
15
|
-
color: Color.Dark300,
|
|
16
|
-
backgroundColor: Color.Silver300
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
21
|
}
|
|
@@ -1,72 +1,85 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
-
var _excluded = ["size", "icon", "isLoading", "
|
|
4
|
-
|
|
5
|
-
import { Avatar, ButtonBase, CircularProgress } from '@material-ui/core';
|
|
6
|
-
import { makeStyles } from '@material-ui/styles';
|
|
7
|
-
import clsx from 'clsx';
|
|
3
|
+
var _excluded = ["size", "icon", "isLoading", "disabled", "avatarRef", "alt", "imgProps", "sizes", "src", "srcSet", "variant", "children"];
|
|
4
|
+
import { Avatar, ButtonBase, CircularProgress, styled } from '@mui/material';
|
|
8
5
|
import { forwardRef } from 'react';
|
|
9
6
|
import { Color } from "../theme/Color.js";
|
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var
|
|
9
|
+
var Overlay = /*#__PURE__*/styled('div')(_ref => {
|
|
10
|
+
var {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
13
13
|
var sm = theme.breakpoints.up('sm');
|
|
14
14
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
right: 0,
|
|
18
|
+
bottom: 0,
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
borderRadius: '50%',
|
|
24
|
+
backgroundColor: Color.Transparent,
|
|
25
|
+
transition: theme.transitions.create('background-color'),
|
|
26
|
+
'& > svg': {
|
|
27
|
+
opacity: 0,
|
|
28
|
+
color: Color.White,
|
|
29
|
+
transition: theme.transitions.create('opacity'),
|
|
30
|
+
fontSize: theme.spacing(3),
|
|
31
|
+
[sm]: {
|
|
32
|
+
fontSize: theme.spacing(2)
|
|
34
33
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
var StyledProgress = /*#__PURE__*/styled(CircularProgress)(props => {
|
|
38
|
+
var {
|
|
39
|
+
theme
|
|
40
|
+
} = props;
|
|
41
|
+
var sm = theme.breakpoints.up('sm');
|
|
42
|
+
return {
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
fontSize: theme.spacing(5),
|
|
47
|
+
[sm]: {
|
|
48
|
+
fontSize: theme.spacing(4)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
|
|
54
|
+
var StyledButton = /*#__PURE__*/styled(ButtonBase, {
|
|
55
|
+
name: 'SD-AvatarButton'
|
|
56
|
+
})(_ref2 => {
|
|
57
|
+
var {
|
|
58
|
+
theme
|
|
59
|
+
} = _ref2;
|
|
60
|
+
var sm = theme.breakpoints.up('sm');
|
|
61
|
+
return {
|
|
62
|
+
borderRadius: '50%',
|
|
63
|
+
'&[disabled], &[aria-busy="true"]': {
|
|
64
|
+
["& > ".concat(Overlay.toString())]: {
|
|
65
|
+
backgroundColor: Color.White50
|
|
56
66
|
}
|
|
57
67
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
'&:not([disabled])[aria-busy="false"]': {
|
|
69
|
+
'&:hover, &:focus': {
|
|
70
|
+
["&[data-with-icon=\"true\"] > ".concat(Overlay.toString())]: {
|
|
71
|
+
backgroundColor: Color.Black50,
|
|
72
|
+
'& > svg': {
|
|
73
|
+
opacity: 1
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
["&:not([data-with-icon=\"true\"]) > ".concat(Overlay.toString())]: {
|
|
77
|
+
backgroundColor: Color.Black20
|
|
78
|
+
}
|
|
65
79
|
}
|
|
66
80
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'& > $root': _objectSpread(_objectSpread({}, theme.typography.h2), {}, {
|
|
81
|
+
'&[data-size-large="true"]': {
|
|
82
|
+
'& > .MuiAvatar-root': _objectSpread(_objectSpread({}, theme.typography.h2), {}, {
|
|
70
83
|
width: theme.spacing(7),
|
|
71
84
|
height: theme.spacing(7),
|
|
72
85
|
[sm]: {
|
|
@@ -74,8 +87,8 @@ var useStyles = /*#__PURE__*/makeStyles(theme => {
|
|
|
74
87
|
height: theme.spacing(8)
|
|
75
88
|
}
|
|
76
89
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
["& > ".concat(Overlay.toString())]: {
|
|
91
|
+
["& > ".concat(StyledProgress.toString())]: {
|
|
79
92
|
fontSize: theme.spacing(7),
|
|
80
93
|
[sm]: {
|
|
81
94
|
fontSize: theme.spacing(8)
|
|
@@ -88,27 +101,16 @@ var useStyles = /*#__PURE__*/makeStyles(theme => {
|
|
|
88
101
|
}
|
|
89
102
|
}
|
|
90
103
|
}
|
|
91
|
-
}
|
|
92
|
-
root: {},
|
|
93
|
-
colorDefault: {},
|
|
94
|
-
circular: {},
|
|
95
|
-
rounded: {},
|
|
96
|
-
square: {},
|
|
97
|
-
img: {},
|
|
98
|
-
fallback: {}
|
|
104
|
+
}
|
|
99
105
|
};
|
|
100
|
-
}, {
|
|
101
|
-
name: 'SD-AvatarButton'
|
|
102
106
|
});
|
|
103
|
-
export var AvatarButton = /*#__PURE__*/forwardRef((
|
|
107
|
+
export var AvatarButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
104
108
|
var {
|
|
105
109
|
size,
|
|
106
110
|
icon,
|
|
107
111
|
isLoading = false,
|
|
108
|
-
classes,
|
|
109
112
|
disabled = false,
|
|
110
113
|
avatarRef,
|
|
111
|
-
className,
|
|
112
114
|
alt,
|
|
113
115
|
imgProps,
|
|
114
116
|
sizes,
|
|
@@ -116,30 +118,18 @@ export var AvatarButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
116
118
|
srcSet,
|
|
117
119
|
variant,
|
|
118
120
|
children
|
|
119
|
-
} =
|
|
120
|
-
props = _objectWithoutProperties(
|
|
121
|
-
|
|
122
|
-
var _useStyles = useStyles({
|
|
123
|
-
classes
|
|
124
|
-
}),
|
|
125
|
-
{
|
|
126
|
-
button: buttonClassName,
|
|
127
|
-
overlay: overlayClassName,
|
|
128
|
-
progress: progressClassName,
|
|
129
|
-
withIcon: withIconClassName,
|
|
130
|
-
sizeLarge: sizeLargeClassName
|
|
131
|
-
} = _useStyles,
|
|
132
|
-
avatarClasses = _objectWithoutProperties(_useStyles, _excluded2);
|
|
121
|
+
} = _ref3,
|
|
122
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
133
123
|
|
|
134
|
-
return /*#__PURE__*/_jsxs(
|
|
124
|
+
return /*#__PURE__*/_jsxs(StyledButton, _objectSpread(_objectSpread({}, props), {}, {
|
|
135
125
|
ref: ref,
|
|
136
126
|
"aria-busy": isLoading,
|
|
137
127
|
"aria-disabled": disabled,
|
|
138
128
|
disabled: disabled || isLoading,
|
|
139
|
-
|
|
129
|
+
"data-with-icon": !!icon,
|
|
130
|
+
"data-size-large": size === 'large',
|
|
140
131
|
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
141
132
|
ref: avatarRef,
|
|
142
|
-
classes: avatarClasses,
|
|
143
133
|
variant: variant,
|
|
144
134
|
alt: alt,
|
|
145
135
|
src: src,
|
|
@@ -147,11 +137,9 @@ export var AvatarButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
147
137
|
srcSet: srcSet,
|
|
148
138
|
imgProps: imgProps,
|
|
149
139
|
children: children
|
|
150
|
-
}), /*#__PURE__*/_jsxs(
|
|
151
|
-
|
|
152
|
-
children: [icon, isLoading && /*#__PURE__*/_jsx(CircularProgress, {
|
|
140
|
+
}), /*#__PURE__*/_jsxs(Overlay, {
|
|
141
|
+
children: [icon, isLoading && /*#__PURE__*/_jsx(StyledProgress, {
|
|
153
142
|
size: "1em",
|
|
154
|
-
className: progressClassName,
|
|
155
143
|
thickness: size === 'large' ? 2.5 : 1.5
|
|
156
144
|
})]
|
|
157
145
|
})]
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "children", "
|
|
4
|
-
import {
|
|
3
|
+
var _excluded = ["size", "children", "isActive", "isLoading", "color"];
|
|
4
|
+
import { LoadingButton } from '@mui/lab';
|
|
5
|
+
import { CircularProgress } from '@mui/material';
|
|
5
6
|
import { forwardRef } from 'react';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
export var Button = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
9
|
var {
|
|
11
10
|
size,
|
|
12
11
|
children,
|
|
13
|
-
disabled,
|
|
14
12
|
isActive,
|
|
15
13
|
isLoading,
|
|
16
14
|
color = 'primary'
|
|
17
15
|
} = _ref,
|
|
18
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
17
|
|
|
20
|
-
return /*#__PURE__*/_jsx(
|
|
18
|
+
return /*#__PURE__*/_jsx(LoadingButton, _objectSpread(_objectSpread({}, props), {}, {
|
|
21
19
|
ref: ref,
|
|
22
20
|
size: size,
|
|
23
21
|
"data-color": color,
|
|
24
|
-
|
|
22
|
+
loading: isLoading,
|
|
25
23
|
"aria-expanded": isActive,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})]
|
|
33
|
-
})
|
|
24
|
+
color: color === 'primary' ? color : 'inherit',
|
|
25
|
+
loadingIndicator: /*#__PURE__*/_jsx(CircularProgress, {
|
|
26
|
+
size: "1em",
|
|
27
|
+
color: "inherit"
|
|
28
|
+
}),
|
|
29
|
+
children: children
|
|
34
30
|
}));
|
|
35
31
|
});
|
|
36
32
|
if (process.env.NODE_ENV !== "production") Button.displayName = "Button";
|