@superdispatch/ui 0.15.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 +4032 -490
- package/dist-node/index.js.map +1 -1
- package/dist-src/index.js +3 -1
- 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 +642 -37
- package/dist-web/index.js +4195 -654
- package/dist-web/index.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["onClose", "variant", "key", "id", "autoHideDuration"];
|
|
4
|
+
import { useDeepEqualMemo } from '@superdispatch/hooks';
|
|
5
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { Snackbar } from "./Snackbar.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
function warnContext() {
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.log('`useSnackbarStack` is used outside of `SnackbarStackProvider`.');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var Context = /*#__PURE__*/createContext({
|
|
16
|
+
clearStack: warnContext,
|
|
17
|
+
addSnackbar: () => {
|
|
18
|
+
warnContext();
|
|
19
|
+
return warnContext;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export function useSnackbarStack() {
|
|
23
|
+
return useContext(Context);
|
|
24
|
+
}
|
|
25
|
+
export function SnackbarStackConsumer(_ref) {
|
|
26
|
+
var {
|
|
27
|
+
children
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/_jsx(Context.Consumer, {
|
|
30
|
+
children: children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var TRANSIENT_KEY = '@@transient@@';
|
|
34
|
+
export function SnackbarStackProvider(_ref2) {
|
|
35
|
+
var {
|
|
36
|
+
children
|
|
37
|
+
} = _ref2;
|
|
38
|
+
var [stack, setStack] = useState(new Map());
|
|
39
|
+
var transientKeyRef = useRef(0);
|
|
40
|
+
var getNextTransientKey = useCallback(() => TRANSIENT_KEY + String(transientKeyRef.current += 1), []);
|
|
41
|
+
var clearStack = useCallback(() => {
|
|
42
|
+
setStack(x => x.size === 0 ? x : new Map());
|
|
43
|
+
}, []);
|
|
44
|
+
var addSnackbar = useCallback(function (message) {
|
|
45
|
+
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
46
|
+
{
|
|
47
|
+
onClose: _onClose,
|
|
48
|
+
variant,
|
|
49
|
+
key = variant !== 'error' ? // We don't want non error snackbars without key to pop back.
|
|
50
|
+
getNextTransientKey() : typeof message === 'string' ? message : Math.random(),
|
|
51
|
+
id = String(key),
|
|
52
|
+
autoHideDuration = 5000
|
|
53
|
+
} = _ref3,
|
|
54
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
55
|
+
|
|
56
|
+
function removeSnackbar() {
|
|
57
|
+
setStack(prev => {
|
|
58
|
+
if (prev.has(key)) {
|
|
59
|
+
var next = new Map(prev);
|
|
60
|
+
next.delete(key);
|
|
61
|
+
return next;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return prev;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setStack(prev => {
|
|
69
|
+
var next = new Map(prev);
|
|
70
|
+
|
|
71
|
+
for (var prevKey of prev.keys()) {
|
|
72
|
+
// Ensure that we insert value to the end of the map.
|
|
73
|
+
if (Object.is(key, prevKey)) {
|
|
74
|
+
next.delete(key);
|
|
75
|
+
} // Ensure that transient snackbar will not pop back.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if (typeof prevKey == 'string' && prevKey.startsWith(TRANSIENT_KEY)) {
|
|
79
|
+
next.delete(prevKey);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return next.set(key, _objectSpread(_objectSpread({}, props), {}, {
|
|
84
|
+
id,
|
|
85
|
+
key,
|
|
86
|
+
variant,
|
|
87
|
+
autoHideDuration,
|
|
88
|
+
children: message,
|
|
89
|
+
onClose: reason => {
|
|
90
|
+
removeSnackbar();
|
|
91
|
+
_onClose === null || _onClose === void 0 ? void 0 : _onClose(reason);
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
return removeSnackbar;
|
|
96
|
+
}, [getNextTransientKey]);
|
|
97
|
+
var snackbarProps = useDeepEqualMemo(prev => {
|
|
98
|
+
var next = Array.from(stack.values()).pop();
|
|
99
|
+
return next ? _objectSpread(_objectSpread({}, next), {}, {
|
|
100
|
+
open: true
|
|
101
|
+
}) : _objectSpread(_objectSpread({}, prev), {}, {
|
|
102
|
+
open: false
|
|
103
|
+
});
|
|
104
|
+
}, [stack]);
|
|
105
|
+
var api = useMemo(() => ({
|
|
106
|
+
clearStack,
|
|
107
|
+
addSnackbar
|
|
108
|
+
}), [clearStack, addSnackbar]);
|
|
109
|
+
return /*#__PURE__*/_jsxs(Context.Provider, {
|
|
110
|
+
value: api,
|
|
111
|
+
children: [children, /*#__PURE__*/_jsx(Snackbar, _objectSpread({}, snackbarProps))]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import flattenChildren from 'react-keyed-flatten-children';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { parseAlignProp } from "../props/AlignProps.js";
|
|
5
|
+
import { parseResponsiveProp } from "../props/ResponsiveProp.js";
|
|
6
|
+
import { parseSpaceProp } from "../props/SpaceProp.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
function stackItemMixin(space, align) {
|
|
10
|
+
return css(["flex-direction:column;align-items:", ";display:", ";&:empty{display:none;}&:not(:empty) ~ div{padding-top:", "px;}"], parseAlignProp(align), align === 'left' ? 'block' : 'flex', parseSpaceProp(space));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var StackRoot = /*#__PURE__*/styled.div.withConfig({
|
|
14
|
+
displayName: "Stack__StackRoot",
|
|
15
|
+
componentId: "SD__sc-dmzxni-0"
|
|
16
|
+
})(_ref => {
|
|
17
|
+
var {
|
|
18
|
+
theme,
|
|
19
|
+
space,
|
|
20
|
+
align
|
|
21
|
+
} = _ref;
|
|
22
|
+
return css(["width:100%;& > div{", ";", "{", ";}", "{", ";}}"], stackItemMixin(space[0], align[0]), theme.breakpoints.up('sm'), stackItemMixin(space[1], align[1]), theme.breakpoints.up('md'), stackItemMixin(space[2], align[2]));
|
|
23
|
+
});
|
|
24
|
+
export var Stack = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
25
|
+
var {
|
|
26
|
+
children,
|
|
27
|
+
'aria-label': ariaLabel,
|
|
28
|
+
'aria-labelledby': ariaLabelledBy,
|
|
29
|
+
space = 'xsmall',
|
|
30
|
+
align = 'left'
|
|
31
|
+
} = _ref2;
|
|
32
|
+
return /*#__PURE__*/_jsx(StackRoot, {
|
|
33
|
+
ref: ref,
|
|
34
|
+
align: parseResponsiveProp(align),
|
|
35
|
+
space: parseResponsiveProp(space),
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
"aria-labelledby": ariaLabelledBy,
|
|
38
|
+
children: flattenChildren(children).map((child, idx) => /*#__PURE__*/_jsx("div", {
|
|
39
|
+
children: child
|
|
40
|
+
}, idx))
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
if (process.env.NODE_ENV !== "production") Stack.displayName = "Stack";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Color } from "../theme/Color.js";
|
|
2
|
+
export function overrideSvgIcon(theme) {
|
|
3
|
+
var sm = theme.breakpoints.up('sm');
|
|
4
|
+
theme.components.MuiSvgIcon = {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
display: 'inherit',
|
|
8
|
+
fontSize: 'var(--mui-svg-icon-size, 32px)',
|
|
9
|
+
[sm]: {
|
|
10
|
+
fontSize: 'var(--mui-svg-icon-size, 24px)'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
fontSizeInherit: {
|
|
14
|
+
fontSize: 'inherit',
|
|
15
|
+
[sm]: {
|
|
16
|
+
fontSize: 'inherit'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
fontSizeSmall: {
|
|
20
|
+
fontSize: 'var(--mui-svg-icon-size, 24px)',
|
|
21
|
+
[sm]: {
|
|
22
|
+
fontSize: 'var(--mui-svg-icon-size, 16px)'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
fontSizeLarge: {
|
|
26
|
+
fontSize: 'var(--mui-svg-icon-size, 32px)'
|
|
27
|
+
},
|
|
28
|
+
colorAction: {
|
|
29
|
+
color: Color.Dark100
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { switchClasses } from '@mui/material';
|
|
2
|
+
import { Color } from "../theme/Color.js";
|
|
3
|
+
export function overrideSwitch(theme) {
|
|
4
|
+
var sm = theme.breakpoints.up('sm');
|
|
5
|
+
theme.components.MuiSwitch = {
|
|
6
|
+
defaultProps: {
|
|
7
|
+
color: 'primary',
|
|
8
|
+
disableRipple: true,
|
|
9
|
+
disableFocusRipple: true
|
|
10
|
+
},
|
|
11
|
+
styleOverrides: {
|
|
12
|
+
root: {
|
|
13
|
+
width: theme.spacing(9.5),
|
|
14
|
+
height: theme.spacing(5.5),
|
|
15
|
+
padding: theme.spacing(0.75, 1.5),
|
|
16
|
+
[sm]: {
|
|
17
|
+
width: theme.spacing(8),
|
|
18
|
+
height: theme.spacing(4),
|
|
19
|
+
padding: theme.spacing(0.5, 1.5)
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
track: {
|
|
23
|
+
opacity: 1,
|
|
24
|
+
boxShadow: "0 0 0 0 ".concat(Color.Transparent),
|
|
25
|
+
transition: theme.transitions.create(['box-shadow', 'background-color'], {
|
|
26
|
+
duration: theme.transitions.duration.shortest
|
|
27
|
+
}),
|
|
28
|
+
borderRadius: theme.spacing(2),
|
|
29
|
+
[sm]: {
|
|
30
|
+
borderRadius: theme.spacing(1.625)
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
thumb: {
|
|
34
|
+
color: Color.White,
|
|
35
|
+
boxShadow: 'none',
|
|
36
|
+
width: theme.spacing(3),
|
|
37
|
+
height: theme.spacing(3),
|
|
38
|
+
[sm]: {
|
|
39
|
+
width: theme.spacing(2),
|
|
40
|
+
height: theme.spacing(2)
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
switchBase: {
|
|
44
|
+
left: theme.spacing(1),
|
|
45
|
+
padding: theme.spacing(1.25, 1),
|
|
46
|
+
[sm]: {
|
|
47
|
+
padding: theme.spacing(1)
|
|
48
|
+
},
|
|
49
|
+
["&.".concat(switchClasses.checked)]: {
|
|
50
|
+
transform: "translateX(".concat(theme.spacing(2.5), ")"),
|
|
51
|
+
[sm]: {
|
|
52
|
+
transform: "translateX(".concat(theme.spacing(2), ")")
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
["&.".concat(switchClasses.checked, " + .").concat(switchClasses.track)]: {
|
|
56
|
+
opacity: 1
|
|
57
|
+
},
|
|
58
|
+
["&.".concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
|
|
59
|
+
opacity: 1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
colorPrimary: {
|
|
63
|
+
["&.".concat(switchClasses.checked)]: {
|
|
64
|
+
'&:hover': {
|
|
65
|
+
["& + .".concat(switchClasses.track)]: {
|
|
66
|
+
backgroundColor: Color.Blue400
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
["& + .".concat(switchClasses.track)]: {
|
|
71
|
+
backgroundColor: Color.Silver500
|
|
72
|
+
},
|
|
73
|
+
["&.".concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
|
|
74
|
+
backgroundColor: Color.Silver300
|
|
75
|
+
},
|
|
76
|
+
["&.".concat(switchClasses.checked, ".").concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
|
|
77
|
+
backgroundColor: Color.Blue100
|
|
78
|
+
},
|
|
79
|
+
["&:hover + .".concat(switchClasses.track)]: {
|
|
80
|
+
backgroundColor: Color.Dark100
|
|
81
|
+
},
|
|
82
|
+
["&.Mui-focusVisible + .".concat(switchClasses.track)]: {
|
|
83
|
+
boxShadow: "0 0 0 3px ".concat(Color.Blue100)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import { Color } from "../theme/Color.js";
|
|
3
|
+
export function overrideTabs(theme) {
|
|
4
|
+
theme.components.MuiTabs = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
variant: 'scrollable',
|
|
7
|
+
textColor: 'primary',
|
|
8
|
+
indicatorColor: 'primary'
|
|
9
|
+
},
|
|
10
|
+
styleOverrides: {
|
|
11
|
+
root: {
|
|
12
|
+
minHeight: theme.spacing(6)
|
|
13
|
+
},
|
|
14
|
+
scrollButtons: {
|
|
15
|
+
opacity: 1,
|
|
16
|
+
color: Color.Dark100,
|
|
17
|
+
width: theme.spacing(4),
|
|
18
|
+
transition: theme.transitions.create('opacity', {
|
|
19
|
+
duration: theme.transitions.duration.short
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
theme.components.MuiTab = {
|
|
25
|
+
styleOverrides: {
|
|
26
|
+
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
27
|
+
minHeight: theme.spacing(6),
|
|
28
|
+
transition: theme.transitions.create(['color'], {
|
|
29
|
+
duration: theme.transitions.duration.short
|
|
30
|
+
}),
|
|
31
|
+
[theme.breakpoints.up('sm')]: {
|
|
32
|
+
minWidth: 'unset',
|
|
33
|
+
fontSize: 'unset',
|
|
34
|
+
padding: theme.spacing(0.75, 3)
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
textColorPrimary: {
|
|
38
|
+
color: Color.Dark500,
|
|
39
|
+
'&:hover, &:focus': {
|
|
40
|
+
color: Color.Blue300
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
|
|
4
|
+
import { Typography } from '@mui/material';
|
|
5
|
+
import { makeStyles } from '@mui/styles';
|
|
6
|
+
import cx from 'clsx';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
import { Color } from "../theme/Color.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
11
|
+
root: {
|
|
12
|
+
maxWidth: '100%',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
display: 'inline-flex',
|
|
15
|
+
borderRadius: theme.spacing(0.5),
|
|
16
|
+
padding: theme.spacing(0, 0.5)
|
|
17
|
+
},
|
|
18
|
+
variantSubtle: {
|
|
19
|
+
'&$colorGrey': {
|
|
20
|
+
color: Color.Dark300,
|
|
21
|
+
backgroundColor: Color.Silver200
|
|
22
|
+
},
|
|
23
|
+
'&$colorBlue': {
|
|
24
|
+
color: Color.Blue500,
|
|
25
|
+
backgroundColor: Color.Blue50
|
|
26
|
+
},
|
|
27
|
+
'&$colorGreen': {
|
|
28
|
+
color: Color.Green500,
|
|
29
|
+
backgroundColor: Color.Green50
|
|
30
|
+
},
|
|
31
|
+
'&$colorPurple': {
|
|
32
|
+
color: Color.Purple500,
|
|
33
|
+
backgroundColor: Color.Purple50
|
|
34
|
+
},
|
|
35
|
+
'&$colorRed': {
|
|
36
|
+
color: Color.Red500,
|
|
37
|
+
backgroundColor: Color.Red50
|
|
38
|
+
},
|
|
39
|
+
'&$colorTeal': {
|
|
40
|
+
color: Color.Teal500,
|
|
41
|
+
backgroundColor: Color.Teal50
|
|
42
|
+
},
|
|
43
|
+
'&$colorYellow': {
|
|
44
|
+
color: Color.Yellow500,
|
|
45
|
+
backgroundColor: Color.Yellow50
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
variantBold: {
|
|
49
|
+
color: Color.White,
|
|
50
|
+
'&$colorGrey': {
|
|
51
|
+
backgroundColor: Color.Dark300
|
|
52
|
+
},
|
|
53
|
+
'&$colorBlue': {
|
|
54
|
+
backgroundColor: Color.Blue500
|
|
55
|
+
},
|
|
56
|
+
'&$colorGreen': {
|
|
57
|
+
backgroundColor: Color.Green500
|
|
58
|
+
},
|
|
59
|
+
'&$colorPurple': {
|
|
60
|
+
backgroundColor: Color.Purple500
|
|
61
|
+
},
|
|
62
|
+
'&$colorRed': {
|
|
63
|
+
backgroundColor: Color.Red500
|
|
64
|
+
},
|
|
65
|
+
'&$colorTeal': {
|
|
66
|
+
backgroundColor: Color.Teal500
|
|
67
|
+
},
|
|
68
|
+
'&$colorYellow': {
|
|
69
|
+
backgroundColor: Color.Yellow500
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
colorGrey: {},
|
|
73
|
+
colorBlue: {},
|
|
74
|
+
colorGreen: {},
|
|
75
|
+
colorPurple: {},
|
|
76
|
+
colorRed: {},
|
|
77
|
+
colorTeal: {},
|
|
78
|
+
colorYellow: {}
|
|
79
|
+
}), {
|
|
80
|
+
name: 'SD-Tag'
|
|
81
|
+
});
|
|
82
|
+
export var Tag = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
83
|
+
var {
|
|
84
|
+
color,
|
|
85
|
+
variant,
|
|
86
|
+
children,
|
|
87
|
+
classes,
|
|
88
|
+
className,
|
|
89
|
+
noWrap = true,
|
|
90
|
+
fontWeight = 'bold',
|
|
91
|
+
component = 'div'
|
|
92
|
+
} = _ref,
|
|
93
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
94
|
+
|
|
95
|
+
var styles = useStyles({
|
|
96
|
+
classes
|
|
97
|
+
});
|
|
98
|
+
return /*#__PURE__*/_jsx(Typography, _objectSpread(_objectSpread({}, props), {}, {
|
|
99
|
+
ref: ref,
|
|
100
|
+
noWrap: noWrap,
|
|
101
|
+
component: component,
|
|
102
|
+
variant: fontWeight === 'bold' ? 'body1' : 'body2',
|
|
103
|
+
className: cx(styles.root, className, {
|
|
104
|
+
'grey': styles.colorGrey,
|
|
105
|
+
'blue': styles.colorBlue,
|
|
106
|
+
'green': styles.colorGreen,
|
|
107
|
+
'purple': styles.colorPurple,
|
|
108
|
+
'red': styles.colorRed,
|
|
109
|
+
'teal': styles.colorTeal,
|
|
110
|
+
'yellow': styles.colorYellow
|
|
111
|
+
}[color], {
|
|
112
|
+
'subtle': styles.variantSubtle,
|
|
113
|
+
'bold': styles.variantBold
|
|
114
|
+
}[variant]),
|
|
115
|
+
children: children
|
|
116
|
+
}));
|
|
117
|
+
});
|
|
118
|
+
if (process.env.NODE_ENV !== "production") Tag.displayName = "Tag";
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import { formLabelClasses, inputBaseClasses, outlinedInputClasses, SvgIcon } from '@mui/material';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Color } from "../theme/Color.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
var SelectIcon = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(SvgIcon, _objectSpread(_objectSpread({
|
|
7
|
+
ref: ref
|
|
8
|
+
}, props), {}, {
|
|
9
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
10
|
+
d: "M12 16.5L6 9h12l-6 7.5z",
|
|
11
|
+
fill: "currentColor"
|
|
12
|
+
})
|
|
13
|
+
})));
|
|
14
|
+
if (process.env.NODE_ENV !== "production") SelectIcon.displayName = "SelectIcon";
|
|
15
|
+
export function overrideTextField(theme) {
|
|
16
|
+
var sm = theme.breakpoints.up('sm');
|
|
17
|
+
theme.components.MuiTextField = {
|
|
18
|
+
defaultProps: {
|
|
19
|
+
minRows: 4,
|
|
20
|
+
maxRows: 4,
|
|
21
|
+
variant: 'outlined'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
theme.components.MuiFormLabel = {
|
|
25
|
+
styleOverrides: {
|
|
26
|
+
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
27
|
+
color: Color.Dark400,
|
|
28
|
+
["&.".concat(formLabelClasses.error)]: {
|
|
29
|
+
color: Color.Dark400
|
|
30
|
+
},
|
|
31
|
+
["&.".concat(formLabelClasses.focused)]: {
|
|
32
|
+
color: Color.Dark400
|
|
33
|
+
},
|
|
34
|
+
["&.".concat(formLabelClasses.disabled)]: {
|
|
35
|
+
color: Color.Dark400
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
theme.components.MuiInputBase = {
|
|
41
|
+
styleOverrides: {
|
|
42
|
+
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
43
|
+
["&.".concat(inputBaseClasses.disabled)]: {
|
|
44
|
+
backgroundColor: Color.Silver100
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
input: {
|
|
48
|
+
textOverflow: 'ellipsis',
|
|
49
|
+
height: theme.spacing(3),
|
|
50
|
+
[sm]: {
|
|
51
|
+
height: theme.spacing(2.5)
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
inputMultiline: {
|
|
55
|
+
resize: 'vertical'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
theme.components.MuiInputLabel = {
|
|
60
|
+
defaultProps: {
|
|
61
|
+
shrink: true
|
|
62
|
+
},
|
|
63
|
+
styleOverrides: {
|
|
64
|
+
root: {
|
|
65
|
+
marginBottom: theme.spacing(0.5),
|
|
66
|
+
transformOrigin: 'unset'
|
|
67
|
+
},
|
|
68
|
+
formControl: {
|
|
69
|
+
top: 'unset',
|
|
70
|
+
left: 'unset',
|
|
71
|
+
position: 'unset',
|
|
72
|
+
transform: 'unset'
|
|
73
|
+
},
|
|
74
|
+
shrink: {
|
|
75
|
+
transform: 'unset',
|
|
76
|
+
transformOrigin: 'unset'
|
|
77
|
+
},
|
|
78
|
+
outlined: {
|
|
79
|
+
zIndex: 'unset',
|
|
80
|
+
transform: 'unset',
|
|
81
|
+
pointerEvents: 'unset'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
theme.components.MuiOutlinedInput = {
|
|
86
|
+
defaultProps: {
|
|
87
|
+
notched: false
|
|
88
|
+
},
|
|
89
|
+
styleOverrides: {
|
|
90
|
+
root: {
|
|
91
|
+
["&:hover .".concat(outlinedInputClasses.notchedOutline)]: {
|
|
92
|
+
borderColor: Color.Silver500
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
input: {
|
|
96
|
+
padding: theme.spacing(1.25, 1.5),
|
|
97
|
+
[sm]: {
|
|
98
|
+
padding: theme.spacing(0.75, 1)
|
|
99
|
+
},
|
|
100
|
+
'&.MuiInputBase-inputAdornedStart': {
|
|
101
|
+
paddingLeft: 0
|
|
102
|
+
},
|
|
103
|
+
'&.MuiInputBase-inputAdornedEnd': {
|
|
104
|
+
paddingRight: 0
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
inputMultiline: {
|
|
108
|
+
padding: 0,
|
|
109
|
+
[sm]: {
|
|
110
|
+
padding: 0
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
multiline: {
|
|
114
|
+
padding: theme.spacing(0.75, 1)
|
|
115
|
+
},
|
|
116
|
+
adornedStart: {
|
|
117
|
+
paddingLeft: theme.spacing(1)
|
|
118
|
+
},
|
|
119
|
+
adornedEnd: {
|
|
120
|
+
paddingRight: theme.spacing(1)
|
|
121
|
+
},
|
|
122
|
+
notchedOutline: {
|
|
123
|
+
top: 0,
|
|
124
|
+
borderColor: Color.Silver500,
|
|
125
|
+
'& legend': {
|
|
126
|
+
display: 'none'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
theme.components.MuiSelect = {
|
|
132
|
+
defaultProps: {
|
|
133
|
+
IconComponent: SelectIcon
|
|
134
|
+
},
|
|
135
|
+
styleOverrides: {
|
|
136
|
+
icon: {
|
|
137
|
+
top: 'calc(50% - 0.5em)',
|
|
138
|
+
'$disabled &': {
|
|
139
|
+
color: Color.Dark100
|
|
140
|
+
},
|
|
141
|
+
fontSize: theme.spacing(3),
|
|
142
|
+
[sm]: {
|
|
143
|
+
fontSize: theme.spacing(2)
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
iconOutlined: {
|
|
147
|
+
right: theme.spacing(1.5),
|
|
148
|
+
[sm]: {
|
|
149
|
+
right: theme.spacing(1)
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
select: {
|
|
153
|
+
paddingRight: theme.spacing(4.5),
|
|
154
|
+
[sm]: {
|
|
155
|
+
right: theme.spacing(4)
|
|
156
|
+
},
|
|
157
|
+
'&:focus': {
|
|
158
|
+
backgroundColor: 'unset'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
theme.components.MuiInputAdornment = {
|
|
164
|
+
styleOverrides: {
|
|
165
|
+
root: {
|
|
166
|
+
'& .MuiSvgIcon-root:not(.MuiSvgIcon-fontSizeSmall)': {
|
|
167
|
+
fontSize: theme.spacing(3),
|
|
168
|
+
[sm]: {
|
|
169
|
+
fontSize: theme.spacing(2.5)
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
'& .MuiIconButton-root': {
|
|
173
|
+
padding: theme.spacing(1)
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
positionStart: {
|
|
177
|
+
'& .MuiIconButton-root': {
|
|
178
|
+
marginLeft: theme.spacing(-0.5),
|
|
179
|
+
[sm]: {
|
|
180
|
+
marginLeft: theme.spacing(-0.75)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
positionEnd: {
|
|
185
|
+
'& .MuiIconButton-root': {
|
|
186
|
+
marginRight: theme.spacing(-0.5),
|
|
187
|
+
[sm]: {
|
|
188
|
+
marginRight: theme.spacing(-0.75)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
theme.components.MuiFormHelperText = {
|
|
195
|
+
styleOverrides: {
|
|
196
|
+
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
197
|
+
marginTop: theme.spacing(0.5)
|
|
198
|
+
}),
|
|
199
|
+
contained: {
|
|
200
|
+
marginLeft: 'unset',
|
|
201
|
+
marginRight: 'unset'
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|