@superdispatch/ui 0.13.0 → 0.16.0-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 +4051 -508
- package/dist-node/index.js.map +1 -1
- package/dist-src/dialog/DialogOverrides.js +8 -0
- package/dist-src/index.js +3 -1
- package/dist-src/info-card/InfoCard.js +1 -11
- package/dist-src/utils/mergeRefs.js +10 -7
- package/dist-src/v5/adaptive-toolbar/AdaptiveToolbar.js +146 -0
- package/dist-src/v5/app-bar/AppBarOverrides.js +9 -0
- package/dist-src/v5/autocomplete/AutocompleteOverrides.js +63 -0
- package/dist-src/v5/avatar/AvatarOverrides.js +21 -0
- package/dist-src/v5/avatar-button/AvatarButton.js +146 -0
- package/dist-src/v5/button/Button.js +32 -0
- package/dist-src/v5/button/ButtonOverrides.js +238 -0
- package/dist-src/v5/card/CardOverrides.js +16 -0
- package/dist-src/v5/card-button/CardButton.js +135 -0
- package/dist-src/v5/checkbox/CheckboxField.js +37 -0
- package/dist-src/v5/checkbox/CheckboxGroudField.js +32 -0
- package/dist-src/v5/checkbox/CheckboxOverrides.js +71 -0
- package/dist-src/v5/chip/ChipOverrides.js +106 -0
- package/dist-src/v5/columns/Column.js +75 -0
- package/dist-src/v5/columns/Columns.js +28 -0
- package/dist-src/v5/description-list/DescriptionList.js +114 -0
- package/dist-src/v5/dialog/DialogOverrides.js +43 -0
- package/dist-src/v5/drawer/DrawerActions.js +69 -0
- package/dist-src/v5/drawer/DrawerContent.js +15 -0
- package/dist-src/v5/drawer/DrawerList.js +31 -0
- package/dist-src/v5/drawer/DrawerOverrides.js +17 -0
- package/dist-src/v5/drawer/DrawerTitle.js +119 -0
- package/dist-src/v5/grid/GridStack.js +33 -0
- package/dist-src/v5/grid/InlineGrid.js +34 -0
- package/dist-src/v5/icon-button/IconButtonOverrides.js +60 -0
- package/dist-src/v5/index.js +38 -0
- package/dist-src/v5/info-card/InfoCard.js +59 -0
- package/dist-src/v5/inline/Inline.js +56 -0
- package/dist-src/v5/link/LinkOverrides.js +46 -0
- package/dist-src/v5/list/ListOverrides.js +16 -0
- package/dist-src/v5/menu/MenuOverrides.js +34 -0
- package/dist-src/v5/overflow-text/OverflowText.js +84 -0
- package/dist-src/v5/pagination/PaginationOverrides.js +35 -0
- package/dist-src/v5/paper/PaperOverrides.js +13 -0
- package/dist-src/v5/props/AlignProps.js +15 -0
- package/dist-src/v5/props/CollapseProp.js +3 -0
- package/dist-src/v5/props/ResponsiveProp.js +42 -0
- package/dist-src/v5/props/SpaceProp.js +28 -0
- package/dist-src/v5/radio/RadioField.js +36 -0
- package/dist-src/v5/radio/RadioGroupField.js +38 -0
- package/dist-src/v5/radio/RadioOverrides.js +49 -0
- package/dist-src/v5/responsive/CollapseBreakpoint.js +15 -0
- package/dist-src/v5/responsive/ResponsiveContext.js +31 -0
- package/dist-src/v5/snackbar/Snackbar.js +53 -0
- package/dist-src/v5/snackbar/SnackbarContent.js +105 -0
- package/dist-src/v5/snackbar/SnackbarOverrides.js +35 -0
- package/dist-src/v5/snackbar/SnackbarStack.js +113 -0
- package/dist-src/v5/stack/Stack.js +43 -0
- package/dist-src/v5/svg-icon/SvgIconOverrides.js +33 -0
- package/dist-src/v5/switch/SwitchOverrides.js +88 -0
- package/dist-src/v5/tabs/TabsOverrides.js +45 -0
- package/dist-src/v5/tag/Tag.js +118 -0
- package/dist-src/v5/text-field/TextFieldOverrides.js +205 -0
- package/dist-src/v5/theme/Color.js +77 -0
- package/dist-src/v5/theme/CssBaselineOverrides.js +8 -0
- package/dist-src/v5/theme/SuperDispatchTheme.js +2 -0
- package/dist-src/v5/theme/ThemeProvider.js +142 -0
- package/dist-src/v5/tiles/Tiles.js +94 -0
- package/dist-src/v5/toolbar/ToolbarOverrides.js +15 -0
- package/dist-src/v5/tooltip/TooltipOverrides.js +42 -0
- package/dist-src/v5/typography/TypographyOverrides.js +121 -0
- package/dist-src/v5/utils/VisibilityObserver.js +53 -0
- package/dist-src/v5/utils/isEmptyReactNode.js +3 -0
- package/dist-src/v5/utils/mergeRefs.js +20 -0
- package/dist-src/v5/utils/renderChildren.js +8 -0
- package/dist-src/v5/utils/useUID.js +6 -0
- package/dist-types/index.d.ts +643 -37
- package/dist-web/index.js +4214 -673
- package/dist-web/index.js.map +1 -1
- package/package.json +9 -3
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import { loadingButtonClasses } from '@mui/lab';
|
|
3
|
+
import { buttonClasses } from '@mui/material';
|
|
4
|
+
import { Color } from "../theme/Color.js";
|
|
5
|
+
|
|
6
|
+
function outlineShadow() {
|
|
7
|
+
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8
|
+
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Color.Transparent;
|
|
9
|
+
return "0 0 0 ".concat(size, "px ").concat(color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function textVariant(text, outline, background, progress) {
|
|
13
|
+
return {
|
|
14
|
+
'&': {
|
|
15
|
+
color: text,
|
|
16
|
+
boxShadow: outlineShadow(),
|
|
17
|
+
backgroundColor: Color.Transparent
|
|
18
|
+
},
|
|
19
|
+
'&:hover': {
|
|
20
|
+
backgroundColor: background
|
|
21
|
+
},
|
|
22
|
+
'&[aria-expanded="true"]': {
|
|
23
|
+
backgroundColor: background
|
|
24
|
+
},
|
|
25
|
+
'&:focus': {
|
|
26
|
+
backgroundColor: background,
|
|
27
|
+
boxShadow: outlineShadow(2, outline)
|
|
28
|
+
},
|
|
29
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
30
|
+
color: outline,
|
|
31
|
+
boxShadow: outlineShadow(),
|
|
32
|
+
backgroundColor: Color.Transparent,
|
|
33
|
+
["& .".concat(loadingButtonClasses.loadingIndicator)]: {
|
|
34
|
+
color: progress
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function outlinedBorder(borderColor) {
|
|
41
|
+
var outlineColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Color.Transparent;
|
|
42
|
+
return "inset 0 0 0 1px ".concat(borderColor, ", 0 0 0 2px ").concat(outlineColor);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function outlinedVariant(staleText, staleBorder, disabledText, disabledBorder, activeText, activeBorder, activeOutline, activeBackground, progress, backgroundColor) {
|
|
46
|
+
return {
|
|
47
|
+
backgroundColor,
|
|
48
|
+
color: staleText,
|
|
49
|
+
border: 0,
|
|
50
|
+
boxShadow: outlinedBorder(staleBorder),
|
|
51
|
+
'&:hover': {
|
|
52
|
+
color: activeText,
|
|
53
|
+
border: 0,
|
|
54
|
+
backgroundColor: activeBackground,
|
|
55
|
+
boxShadow: outlinedBorder(activeBorder)
|
|
56
|
+
},
|
|
57
|
+
'&[aria-expanded="true"]': {
|
|
58
|
+
color: activeText,
|
|
59
|
+
backgroundColor: activeBackground,
|
|
60
|
+
boxShadow: outlinedBorder(activeBorder)
|
|
61
|
+
},
|
|
62
|
+
'&:focus': {
|
|
63
|
+
boxShadow: outlinedBorder(activeBorder, activeOutline)
|
|
64
|
+
},
|
|
65
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
66
|
+
backgroundColor,
|
|
67
|
+
color: disabledText,
|
|
68
|
+
boxShadow: outlinedBorder(disabledBorder),
|
|
69
|
+
["& .".concat(loadingButtonClasses.loadingIndicator)]: {
|
|
70
|
+
color: progress
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function containedVariant(text, backgroundColor, outline, active, disabledText, disabledBackground) {
|
|
77
|
+
return {
|
|
78
|
+
color: text,
|
|
79
|
+
backgroundColor,
|
|
80
|
+
boxShadow: outlineShadow(),
|
|
81
|
+
'&:hover': {
|
|
82
|
+
backgroundColor: active
|
|
83
|
+
},
|
|
84
|
+
'&[aria-expanded="true"]': {
|
|
85
|
+
backgroundColor: active
|
|
86
|
+
},
|
|
87
|
+
'&:focus': {
|
|
88
|
+
boxShadow: outlineShadow(3, outline)
|
|
89
|
+
},
|
|
90
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
91
|
+
color: disabledText,
|
|
92
|
+
boxShadow: outlineShadow(),
|
|
93
|
+
backgroundColor: disabledBackground,
|
|
94
|
+
["& .".concat(loadingButtonClasses.loadingIndicator)]: {
|
|
95
|
+
color: disabledText
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function sizeSmall(theme) {
|
|
102
|
+
var sm = theme.breakpoints.up('sm');
|
|
103
|
+
return _objectSpread(_objectSpread({}, theme.typography.button), {}, {
|
|
104
|
+
padding: theme.spacing(0.5, 3),
|
|
105
|
+
[sm]: {
|
|
106
|
+
padding: theme.spacing(0.25, 2)
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function sizeLarge(theme) {
|
|
112
|
+
var sm = theme.breakpoints.up('sm');
|
|
113
|
+
return _objectSpread(_objectSpread({}, theme.typography.button), {}, {
|
|
114
|
+
fontSize: '18px',
|
|
115
|
+
lineHeight: '28px',
|
|
116
|
+
padding: theme.spacing(1.75, 8),
|
|
117
|
+
[sm]: {
|
|
118
|
+
fontSize: '16px',
|
|
119
|
+
lineHeight: '24px',
|
|
120
|
+
padding: theme.spacing(1, 4)
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function overrideButton(theme) {
|
|
126
|
+
var sm = theme.breakpoints.up('sm');
|
|
127
|
+
theme.components.MuiLoadingButton = {
|
|
128
|
+
defaultProps: {
|
|
129
|
+
variant: 'outlined'
|
|
130
|
+
},
|
|
131
|
+
styleOverrides: {
|
|
132
|
+
loadingIndicator: {
|
|
133
|
+
color: 'inherit',
|
|
134
|
+
fontSize: theme.spacing(2),
|
|
135
|
+
[".".concat(buttonClasses.sizeLarge, " &")]: {
|
|
136
|
+
fontSize: theme.spacing(3)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
theme.components.MuiButton = {
|
|
142
|
+
defaultProps: {
|
|
143
|
+
color: 'primary',
|
|
144
|
+
variant: 'outlined',
|
|
145
|
+
disableFocusRipple: true
|
|
146
|
+
},
|
|
147
|
+
styleOverrides: {
|
|
148
|
+
root: {
|
|
149
|
+
minWidth: theme.spacing(6),
|
|
150
|
+
transition: theme.transitions.create(['color', 'border', 'box-shadow', 'background-color']),
|
|
151
|
+
padding: theme.spacing(1.25, 3),
|
|
152
|
+
[sm]: {
|
|
153
|
+
padding: theme.spacing(0.75, 2)
|
|
154
|
+
},
|
|
155
|
+
'&:hover': {
|
|
156
|
+
backgroundColor: 'initial',
|
|
157
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
158
|
+
backgroundColor: 'initial'
|
|
159
|
+
},
|
|
160
|
+
'@media (hover: none)': {
|
|
161
|
+
backgroundColor: 'initial'
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
165
|
+
color: 'initial'
|
|
166
|
+
},
|
|
167
|
+
'& > .MuiSvgIcon-root': {
|
|
168
|
+
fontSize: '24px',
|
|
169
|
+
[sm]: {
|
|
170
|
+
fontSize: '20px'
|
|
171
|
+
},
|
|
172
|
+
[".".concat(buttonClasses.sizeLarge, "&")]: {
|
|
173
|
+
fontSize: '28px',
|
|
174
|
+
[sm]: {
|
|
175
|
+
fontSize: '24px'
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
sizeSmall: sizeSmall(theme),
|
|
181
|
+
sizeLarge: sizeLarge(theme),
|
|
182
|
+
text: {
|
|
183
|
+
padding: 'initial',
|
|
184
|
+
'&[data-color="error"]': textVariant(Color.Red300, Color.Red100, Color.Red50, Color.Red200),
|
|
185
|
+
'&[data-color="success"]': textVariant(Color.Green300, Color.Green100, Color.Green50, Color.Green200),
|
|
186
|
+
'&[data-color="white"]': textVariant(Color.White, Color.White50, Color.White10, Color.White50)
|
|
187
|
+
},
|
|
188
|
+
textPrimary: textVariant(Color.Blue300, Color.Blue100, Color.Blue50, Color.Blue200),
|
|
189
|
+
textSizeSmall: sizeSmall(theme),
|
|
190
|
+
textSizeLarge: sizeLarge(theme),
|
|
191
|
+
outlined: {
|
|
192
|
+
border: 'none',
|
|
193
|
+
padding: 'initial',
|
|
194
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
195
|
+
border: 'none'
|
|
196
|
+
},
|
|
197
|
+
'&[data-color="error"]': outlinedVariant(Color.Red300, Color.Red300, Color.Red100, Color.Red100, Color.Red300, Color.Red300, Color.Red100, Color.Red50, Color.Red300, Color.White),
|
|
198
|
+
'&[data-color="success"]': outlinedVariant(Color.Green300, Color.Green300, Color.Green100, Color.Green100, Color.Green300, Color.Green300, Color.Green100, Color.Green50, Color.Green300, Color.White),
|
|
199
|
+
'&[data-color="white"]': outlinedVariant(Color.White, Color.White50, Color.White50, Color.White40, Color.White, Color.White50, Color.White40, Color.White10, Color.White50, Color.Transparent)
|
|
200
|
+
},
|
|
201
|
+
outlinedPrimary: outlinedVariant(Color.Dark500, Color.Silver500, Color.Silver500, Color.Silver400, Color.Blue300, Color.Blue300, Color.Blue100, Color.Blue50, Color.Dark200, Color.White),
|
|
202
|
+
outlinedSizeSmall: sizeSmall(theme),
|
|
203
|
+
outlinedSizeLarge: sizeLarge(theme),
|
|
204
|
+
contained: {
|
|
205
|
+
boxShadow: 'none',
|
|
206
|
+
backgroundColor: 'initial',
|
|
207
|
+
'&:hover': {
|
|
208
|
+
boxShadow: 'none',
|
|
209
|
+
backgroundColor: 'initial',
|
|
210
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
211
|
+
backgroundColor: 'none'
|
|
212
|
+
},
|
|
213
|
+
'@media (hover: none)': {
|
|
214
|
+
boxShadow: 'none',
|
|
215
|
+
backgroundColor: 'none'
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
'&:active': {
|
|
219
|
+
boxShadow: 'none'
|
|
220
|
+
},
|
|
221
|
+
["&.".concat(buttonClasses.focusVisible)]: {
|
|
222
|
+
boxShadow: 'none'
|
|
223
|
+
},
|
|
224
|
+
["&.".concat(buttonClasses.disabled)]: {
|
|
225
|
+
color: 'initial',
|
|
226
|
+
boxShadow: 'none',
|
|
227
|
+
backgroundColor: 'initial'
|
|
228
|
+
},
|
|
229
|
+
'&[data-color="error"]': containedVariant(Color.White, Color.Red300, Color.Red100, Color.Red500, Color.White, Color.Red100),
|
|
230
|
+
'&[data-color="success"]': containedVariant(Color.White, Color.Green300, Color.Green100, Color.Green500, Color.White, Color.Green100),
|
|
231
|
+
'&[data-color="white"]': containedVariant(Color.White, Color.White20, Color.White40, Color.White40, Color.White50, Color.White08)
|
|
232
|
+
},
|
|
233
|
+
containedPrimary: containedVariant(Color.White, Color.Blue300, Color.Blue100, Color.Blue500, Color.White, Color.Blue100),
|
|
234
|
+
containedSizeSmall: sizeSmall(theme),
|
|
235
|
+
containedSizeLarge: sizeLarge(theme)
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function overrideCard(theme) {
|
|
2
|
+
theme.components.MuiCard = {
|
|
3
|
+
defaultProps: {
|
|
4
|
+
variant: 'outlined'
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
theme.components.MuiCardContent = {
|
|
8
|
+
styleOverrides: {
|
|
9
|
+
root: {
|
|
10
|
+
'&:last-child': {
|
|
11
|
+
paddingBottom: '16px'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["hint", "size", "error", "classes", "className", "children", "endIcon", "startIcon", "disabled"];
|
|
4
|
+
import { ButtonBase, styled, Typography } from '@mui/material';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { Color } from "../theme/Color.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
var StyledButton = /*#__PURE__*/styled(ButtonBase)(_ref => {
|
|
11
|
+
var {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
14
|
+
return {
|
|
15
|
+
width: '100%',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
backgroundColor: Color.White,
|
|
21
|
+
border: '1px dashed',
|
|
22
|
+
borderRadius: theme.spacing(0.5),
|
|
23
|
+
padding: theme.spacing(1.5),
|
|
24
|
+
minHeight: theme.spacing(13),
|
|
25
|
+
transition: theme.transitions.create(['color', 'box-shadow', 'border-color', 'background-color']),
|
|
26
|
+
'&[data-disabled="true"]': {
|
|
27
|
+
color: Color.Dark200,
|
|
28
|
+
borderColor: Color.Silver500,
|
|
29
|
+
backgroundColor: Color.Silver100
|
|
30
|
+
},
|
|
31
|
+
'&[data-primary="true"]': {
|
|
32
|
+
color: Color.Blue300,
|
|
33
|
+
borderColor: Color.Silver500,
|
|
34
|
+
'&:focus': {
|
|
35
|
+
backgroundColor: Color.Blue50
|
|
36
|
+
},
|
|
37
|
+
'&:hover, &:active': {
|
|
38
|
+
borderColor: Color.Blue300,
|
|
39
|
+
backgroundColor: Color.Blue50
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
'&[data-error="true"]': {
|
|
43
|
+
color: Color.Red300,
|
|
44
|
+
borderColor: Color.Red300,
|
|
45
|
+
backgroundColor: Color.Red50,
|
|
46
|
+
'&:focus': {
|
|
47
|
+
backgroundColor: Color.Red75
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
'&[data-size="small"]': {
|
|
51
|
+
minHeight: theme.spacing(6)
|
|
52
|
+
},
|
|
53
|
+
'&[data-size="large"]': {
|
|
54
|
+
minHeight: theme.spacing(17.5)
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
var Label = /*#__PURE__*/styled(Typography)({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center'
|
|
61
|
+
});
|
|
62
|
+
var Hint = /*#__PURE__*/styled(Typography)(_ref2 => {
|
|
63
|
+
var {
|
|
64
|
+
theme
|
|
65
|
+
} = _ref2;
|
|
66
|
+
return {
|
|
67
|
+
marginTop: theme.spacing(0.5)
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
var Icon = /*#__PURE__*/styled('span')(_ref3 => {
|
|
71
|
+
var {
|
|
72
|
+
theme
|
|
73
|
+
} = _ref3;
|
|
74
|
+
return {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
'& svg': {
|
|
77
|
+
fontSize: theme.spacing(3),
|
|
78
|
+
[theme.breakpoints.up('sm')]: {
|
|
79
|
+
fontSize: theme.spacing(2.5)
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
'&[data-placement="start"]': {
|
|
83
|
+
marginRight: theme.spacing(1),
|
|
84
|
+
marginLeft: theme.spacing(-0.5)
|
|
85
|
+
},
|
|
86
|
+
'&[data-placement="end"]': {
|
|
87
|
+
marginLeft: theme.spacing(1),
|
|
88
|
+
marginRight: theme.spacing(-0.5)
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
export var CardButton = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
93
|
+
var {
|
|
94
|
+
hint,
|
|
95
|
+
size,
|
|
96
|
+
error,
|
|
97
|
+
classes,
|
|
98
|
+
className,
|
|
99
|
+
children,
|
|
100
|
+
endIcon,
|
|
101
|
+
startIcon,
|
|
102
|
+
disabled
|
|
103
|
+
} = _ref4,
|
|
104
|
+
props = _objectWithoutProperties(_ref4, _excluded);
|
|
105
|
+
|
|
106
|
+
return /*#__PURE__*/_jsx(StyledButton, _objectSpread(_objectSpread({}, props), {}, {
|
|
107
|
+
ref: ref,
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
"data-size": size,
|
|
110
|
+
"data-disabled": !!disabled,
|
|
111
|
+
"data-error": !disabled && !!error,
|
|
112
|
+
"data-primary": !disabled && !error,
|
|
113
|
+
children: error ? /*#__PURE__*/_jsx(Label, {
|
|
114
|
+
variant: "h4",
|
|
115
|
+
color: "inherit",
|
|
116
|
+
children: error
|
|
117
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
118
|
+
children: [/*#__PURE__*/_jsxs(Label, {
|
|
119
|
+
variant: "h4",
|
|
120
|
+
color: "inherit",
|
|
121
|
+
children: [!!startIcon && /*#__PURE__*/_jsx(Icon, {
|
|
122
|
+
"data-placement": "start",
|
|
123
|
+
children: startIcon
|
|
124
|
+
}), children, !!endIcon && /*#__PURE__*/_jsx(Icon, {
|
|
125
|
+
"data-placement": "end",
|
|
126
|
+
children: endIcon
|
|
127
|
+
})]
|
|
128
|
+
}), !!hint && /*#__PURE__*/_jsx(Hint, {
|
|
129
|
+
color: "textSecondary",
|
|
130
|
+
children: hint
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
}));
|
|
134
|
+
});
|
|
135
|
+
if (process.env.NODE_ENV !== "production") CardButton.displayName = "CardButton";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["label", "error", "checked", "onBlur", "onChange", "helperText", "FormControlLabelProps"];
|
|
4
|
+
import { Checkbox, FormControl, FormControlLabel, FormHelperText } from '@mui/material';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export var CheckboxField = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
9
|
+
var {
|
|
10
|
+
label,
|
|
11
|
+
error,
|
|
12
|
+
checked,
|
|
13
|
+
onBlur,
|
|
14
|
+
onChange,
|
|
15
|
+
helperText,
|
|
16
|
+
FormControlLabelProps: formControlLabelProps
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/_jsxs(FormControl, {
|
|
21
|
+
error: error,
|
|
22
|
+
children: [/*#__PURE__*/_jsx(FormControlLabel, _objectSpread(_objectSpread({}, formControlLabelProps), {}, {
|
|
23
|
+
label: label,
|
|
24
|
+
checked: checked,
|
|
25
|
+
onBlur: onBlur,
|
|
26
|
+
onChange: onChange,
|
|
27
|
+
control: /*#__PURE__*/_jsx(Checkbox, _objectSpread({
|
|
28
|
+
ref: ref,
|
|
29
|
+
color: "primary",
|
|
30
|
+
disableRipple: true
|
|
31
|
+
}, props))
|
|
32
|
+
})), helperText && /*#__PURE__*/_jsx(FormHelperText, {
|
|
33
|
+
children: helperText
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
if (process.env.NODE_ENV !== "production") CheckboxField.displayName = "CheckboxField";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["FormGroupProps", "label", "FormLabelProps", "helperText", "FormHelperTextProps", "children"];
|
|
4
|
+
import { FormControl, FormGroup, FormHelperText, FormLabel } from '@mui/material';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export var CheckboxGroupField = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
9
|
+
var {
|
|
10
|
+
FormGroupProps: formGroupProps,
|
|
11
|
+
label,
|
|
12
|
+
FormLabelProps: formLabelProps,
|
|
13
|
+
helperText,
|
|
14
|
+
FormHelperTextProps: formHelperTextProps,
|
|
15
|
+
children
|
|
16
|
+
} = _ref,
|
|
17
|
+
formControlProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/_jsxs(FormControl, _objectSpread(_objectSpread({}, formControlProps), {}, {
|
|
20
|
+
hiddenLabel: !label,
|
|
21
|
+
children: [!!label && /*#__PURE__*/_jsx(FormLabel, _objectSpread(_objectSpread({}, formLabelProps), {}, {
|
|
22
|
+
children: label
|
|
23
|
+
})), /*#__PURE__*/_jsx(FormGroup, _objectSpread(_objectSpread({
|
|
24
|
+
ref: ref
|
|
25
|
+
}, formGroupProps), {}, {
|
|
26
|
+
children: children
|
|
27
|
+
})), !!helperText && /*#__PURE__*/_jsx(FormHelperText, _objectSpread(_objectSpread({}, formHelperTextProps), {}, {
|
|
28
|
+
children: helperText
|
|
29
|
+
}))]
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
if (process.env.NODE_ENV !== "production") CheckboxGroupField.displayName = "CheckboxGroupField";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { checkboxClasses, SvgIcon } from '@mui/material';
|
|
2
|
+
import { Color } from "../theme/Color.js";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export function overrideCheckbox(theme) {
|
|
6
|
+
theme.components.MuiCheckbox = {
|
|
7
|
+
defaultProps: {
|
|
8
|
+
color: 'primary',
|
|
9
|
+
icon: /*#__PURE__*/_jsx(SvgIcon, {
|
|
10
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
11
|
+
width: "17",
|
|
12
|
+
height: "17",
|
|
13
|
+
x: "3.5",
|
|
14
|
+
y: "3.5",
|
|
15
|
+
fill: Color.White,
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
rx: "1.5"
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
checkedIcon: /*#__PURE__*/_jsxs(SvgIcon, {
|
|
21
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
22
|
+
width: "18",
|
|
23
|
+
height: "18",
|
|
24
|
+
x: "3",
|
|
25
|
+
y: "3",
|
|
26
|
+
fill: "currentColor",
|
|
27
|
+
rx: "2"
|
|
28
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
29
|
+
fill: Color.White,
|
|
30
|
+
d: "M15.73 8l-.63.63c-1.43 1.43-2.94 3.05-4.37 4.5l-1.9-1.57-.7-.57L7 12.38l.7.57 2.53 2.09.63.52.58-.58c1.6-1.62 3.35-3.5 4.93-5.08l.63-.63L15.73 8z"
|
|
31
|
+
})]
|
|
32
|
+
}),
|
|
33
|
+
indeterminateIcon: /*#__PURE__*/_jsxs(SvgIcon, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
35
|
+
width: "18",
|
|
36
|
+
height: "18",
|
|
37
|
+
x: "3",
|
|
38
|
+
y: "3",
|
|
39
|
+
fill: "currentIcon",
|
|
40
|
+
rx: "2"
|
|
41
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
42
|
+
fill: Color.White,
|
|
43
|
+
d: "M7 11h10v2H7v-2z"
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
styleOverrides: {
|
|
48
|
+
root: {
|
|
49
|
+
color: Color.Dark100,
|
|
50
|
+
marginTop: theme.spacing(-0.625),
|
|
51
|
+
marginBottom: theme.spacing(-0.625)
|
|
52
|
+
},
|
|
53
|
+
indeterminate: {
|
|
54
|
+
["&:not(.".concat(checkboxClasses.checked, ")")]: {
|
|
55
|
+
color: Color.Dark100
|
|
56
|
+
},
|
|
57
|
+
["&.".concat(checkboxClasses.disabled)]: {
|
|
58
|
+
color: Color.Silver400
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
colorPrimary: {
|
|
62
|
+
["&.".concat(checkboxClasses.checked, ".").concat(checkboxClasses.disabled)]: {
|
|
63
|
+
color: Color.Silver500
|
|
64
|
+
},
|
|
65
|
+
["&:hover:not(.".concat(checkboxClasses.checked, ")")]: {
|
|
66
|
+
color: Color.Dark100
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import { chipClasses, SvgIcon } from '@mui/material';
|
|
3
|
+
import { Color } from "../theme/Color.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export function overrideChip(theme) {
|
|
6
|
+
var sm = theme.breakpoints.up('sm');
|
|
7
|
+
theme.components.MuiChip = {
|
|
8
|
+
defaultProps: {
|
|
9
|
+
size: 'small',
|
|
10
|
+
deleteIcon: /*#__PURE__*/_jsx("div", {
|
|
11
|
+
children: /*#__PURE__*/_jsx(SvgIcon, {
|
|
12
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
clipRule: "evenodd",
|
|
15
|
+
d: "M13.239 12L17 8.239 15.761 7 12 10.761 8.239 7 7 8.239 10.761 12 7 15.761 8.239 17 12 13.239 15.761 17 17 15.761 13.239 12z",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
styleOverrides: {
|
|
22
|
+
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
23
|
+
color: 'unset',
|
|
24
|
+
height: 'unset',
|
|
25
|
+
borderRadius: 4,
|
|
26
|
+
backgroundColor: Color.Silver200,
|
|
27
|
+
["&.".concat(chipClasses.disabled)]: {
|
|
28
|
+
opacity: 1,
|
|
29
|
+
color: Color.Dark100
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
sizeSmall: {
|
|
33
|
+
height: 'unset'
|
|
34
|
+
},
|
|
35
|
+
labelSmall: {
|
|
36
|
+
paddingLeft: 6,
|
|
37
|
+
paddingRight: 6,
|
|
38
|
+
[sm]: {
|
|
39
|
+
paddingLeft: 4,
|
|
40
|
+
paddingRight: 4
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
clickable: {
|
|
44
|
+
'&:hover, &:focus': {
|
|
45
|
+
backgroundColor: Color.Silver200
|
|
46
|
+
},
|
|
47
|
+
'&:active': {
|
|
48
|
+
boxShadow: 'unset'
|
|
49
|
+
},
|
|
50
|
+
'&:focus': {
|
|
51
|
+
boxShadow: "0 0 0 2px ".concat(Color.Silver300)
|
|
52
|
+
},
|
|
53
|
+
'&:active, &:hover': {
|
|
54
|
+
backgroundColor: Color.Silver300
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
deletable: {
|
|
58
|
+
'&:focus': {
|
|
59
|
+
backgroundColor: Color.Silver200,
|
|
60
|
+
boxShadow: "0 0 0 2px ".concat(Color.Silver300)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
deleteIcon: {
|
|
64
|
+
width: 'unset',
|
|
65
|
+
height: 'unset',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
fontSize: 14,
|
|
68
|
+
transition: theme.transitions.create('background-color'),
|
|
69
|
+
'&:active, &:hover, &:focus': {
|
|
70
|
+
'& > svg': {
|
|
71
|
+
backgroundColor: Color.Silver400
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
'& > svg': {
|
|
75
|
+
borderRadius: '50%',
|
|
76
|
+
color: Color.Dark200,
|
|
77
|
+
fontSize: '1em'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
deleteIconSmall: {
|
|
81
|
+
width: 'unset',
|
|
82
|
+
height: 'unset',
|
|
83
|
+
padding: theme.spacing(0.5),
|
|
84
|
+
marginLeft: theme.spacing(-0.5),
|
|
85
|
+
marginRight: theme.spacing(0.25),
|
|
86
|
+
[sm]: {
|
|
87
|
+
marginRight: 0
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
icon: {
|
|
91
|
+
color: Color.Dark100,
|
|
92
|
+
fontSize: '1em',
|
|
93
|
+
marginRight: 'unset'
|
|
94
|
+
},
|
|
95
|
+
iconSmall: {
|
|
96
|
+
width: 'unset',
|
|
97
|
+
height: 'unset',
|
|
98
|
+
marginLeft: 8,
|
|
99
|
+
marginRight: 'unset',
|
|
100
|
+
[sm]: {
|
|
101
|
+
marginLeft: 4
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|