@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,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
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { useResponsiveProp } from "../props/ResponsiveProp.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
function computeFlexBasis(scale) {
|
|
7
|
+
return "".concat(scale * 100, "%");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function flexBasisMixin(width) {
|
|
11
|
+
switch (width) {
|
|
12
|
+
case '1/2':
|
|
13
|
+
return computeFlexBasis(1 / 2);
|
|
14
|
+
|
|
15
|
+
case '1/3':
|
|
16
|
+
return computeFlexBasis(1 / 3);
|
|
17
|
+
|
|
18
|
+
case '2/3':
|
|
19
|
+
return computeFlexBasis(2 / 3);
|
|
20
|
+
|
|
21
|
+
case '1/4':
|
|
22
|
+
return computeFlexBasis(1 / 4);
|
|
23
|
+
|
|
24
|
+
case '3/4':
|
|
25
|
+
return computeFlexBasis(3 / 4);
|
|
26
|
+
|
|
27
|
+
case '1/5':
|
|
28
|
+
return computeFlexBasis(1 / 5);
|
|
29
|
+
|
|
30
|
+
case '2/5':
|
|
31
|
+
return computeFlexBasis(2 / 5);
|
|
32
|
+
|
|
33
|
+
case '3/5':
|
|
34
|
+
return computeFlexBasis(3 / 5);
|
|
35
|
+
|
|
36
|
+
case '4/5':
|
|
37
|
+
return computeFlexBasis(4 / 5);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return 'auto';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function columnRootMixin(width) {
|
|
44
|
+
return css(["flex-grow:0;flex-basis:", ";width:", ";flex-shrink:", ";"], flexBasisMixin(width), width === 'fluid' ? '100%' : 'auto', width === 'fluid' || width === 'adaptive' ? 1 : 0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var ColumnRoot = /*#__PURE__*/styled.div.withConfig({
|
|
48
|
+
displayName: "Column__ColumnRoot",
|
|
49
|
+
componentId: "SD__sc-nqzztj-0"
|
|
50
|
+
})(_ref => {
|
|
51
|
+
var {
|
|
52
|
+
theme,
|
|
53
|
+
columnWidth
|
|
54
|
+
} = _ref;
|
|
55
|
+
return css(["min-width:0;", ";", "{", ";}", "{", ";}& > div{padding-top:var(--column-space-top);padding-left:var(--column-space-left);padding-bottom:var(--column-space-bottom);}&:last-child > div{padding-top:0;padding-bottom:0;}"], columnRootMixin(columnWidth[0]), theme.breakpoints.up('sm'), columnRootMixin(columnWidth[1]), theme.breakpoints.up('md'), columnRootMixin(columnWidth[2]));
|
|
56
|
+
});
|
|
57
|
+
export var Column = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
58
|
+
var {
|
|
59
|
+
children,
|
|
60
|
+
'aria-label': ariaLabel,
|
|
61
|
+
'aria-labelledby': ariaLabelledBy,
|
|
62
|
+
width = 'fluid'
|
|
63
|
+
} = _ref2;
|
|
64
|
+
var columnWidth = useResponsiveProp(width);
|
|
65
|
+
return /*#__PURE__*/_jsx(ColumnRoot, {
|
|
66
|
+
ref: ref,
|
|
67
|
+
columnWidth: columnWidth,
|
|
68
|
+
"aria-label": ariaLabel,
|
|
69
|
+
"aria-labelledby": ariaLabelledBy,
|
|
70
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
71
|
+
children: children
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
if (process.env.NODE_ENV !== "production") Column.displayName = "Column";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { parseAlignProp } from "../props/AlignProps.js";
|
|
3
|
+
import { parseCollapsedBelow } from "../props/CollapseProp.js";
|
|
4
|
+
import { parseResponsiveProp } from "../props/ResponsiveProp.js";
|
|
5
|
+
import { parseSpaceProp } from "../props/SpaceProp.js";
|
|
6
|
+
|
|
7
|
+
function columnsRootMixin(align, spaceProp, isReversed, isCollapsed) {
|
|
8
|
+
var space = parseSpaceProp(spaceProp);
|
|
9
|
+
return css(["--column-space-left:", "px;--column-space-top:", "px;--column-space-bottom:", "px;align-items:", ";margin-left:", "px;width:", ";flex-direction:", ";"], isCollapsed ? 0 : space, isCollapsed && isReversed ? space : 0, isCollapsed && !isReversed ? space : 0, parseAlignProp(align), isCollapsed ? 0 : "-".concat(space), isCollapsed ? '100%' : "calc(100% + ".concat(space, "px)"), isCollapsed ? !isReversed ? 'column' : 'column-reverse' : !isReversed ? 'row' : 'row-reverse');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export var Columns = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
+
displayName: "Columns",
|
|
14
|
+
componentId: "SD__sc-1uebhbi-0"
|
|
15
|
+
})(_ref => {
|
|
16
|
+
var {
|
|
17
|
+
theme,
|
|
18
|
+
collapseBelow,
|
|
19
|
+
align: alignProp = 'top',
|
|
20
|
+
space: spaceProp = 'none',
|
|
21
|
+
reverse: reverseProp = false
|
|
22
|
+
} = _ref;
|
|
23
|
+
var align = parseResponsiveProp(alignProp);
|
|
24
|
+
var space = parseResponsiveProp(spaceProp);
|
|
25
|
+
var reverse = parseResponsiveProp(reverseProp);
|
|
26
|
+
var collapsed = parseCollapsedBelow(collapseBelow);
|
|
27
|
+
return css(["width:100%;display:flex;", ";", "{", ";}", "{", ";}"], columnsRootMixin(align[0], space[0], reverse[0], collapsed[0]), theme.breakpoints.up('sm'), columnsRootMixin(align[1], space[1], reverse[1], collapsed[1]), theme.breakpoints.up('md'), columnsRootMixin(align[2], space[2], reverse[2], collapsed[2]));
|
|
28
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
var _excluded = ["size"];
|
|
4
|
+
import { styled, SvgIcon, Typography } from '@mui/material';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { OverflowText } from "../overflow-text/OverflowText.js";
|
|
7
|
+
import { Color } from "../theme/Color.js";
|
|
8
|
+
import { isEmptyReactNode } from "../utils/isEmptyReactNode.js";
|
|
9
|
+
import { useUID } from "../utils/useUID.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var DescriptionListItemRoot = /*#__PURE__*/styled('div', {
|
|
13
|
+
name: 'SD-DescriptionListItem',
|
|
14
|
+
slot: 'Root'
|
|
15
|
+
})({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center'
|
|
18
|
+
});
|
|
19
|
+
var DescriptionListItemIcon = /*#__PURE__*/styled('div')(_ref => {
|
|
20
|
+
var {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref;
|
|
23
|
+
return {
|
|
24
|
+
display: 'inline-flex',
|
|
25
|
+
marginRight: theme.spacing(1),
|
|
26
|
+
'& > .MuiSvgIcon-root': {
|
|
27
|
+
color: Color.Dark100,
|
|
28
|
+
fontSize: theme.spacing(3),
|
|
29
|
+
[theme.breakpoints.up('sm')]: {
|
|
30
|
+
fontSize: theme.spacing(2)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}); //
|
|
35
|
+
// DescriptionListItem
|
|
36
|
+
//
|
|
37
|
+
|
|
38
|
+
export var DescriptionListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
39
|
+
var _ref3, _contentTypographyPro, _contentTypographyPro2;
|
|
40
|
+
|
|
41
|
+
var {
|
|
42
|
+
inset,
|
|
43
|
+
icon = inset ? /*#__PURE__*/_jsx(SvgIcon, {}) : null,
|
|
44
|
+
label,
|
|
45
|
+
labelTypographyProps,
|
|
46
|
+
content,
|
|
47
|
+
contentTypographyProps,
|
|
48
|
+
fallback
|
|
49
|
+
} = _ref2;
|
|
50
|
+
var labelID = useUID(labelTypographyProps === null || labelTypographyProps === void 0 ? void 0 : labelTypographyProps.id);
|
|
51
|
+
var shouldRenderFallback = isEmptyReactNode(content);
|
|
52
|
+
return /*#__PURE__*/_jsxs(DescriptionListItemRoot, {
|
|
53
|
+
ref: ref,
|
|
54
|
+
"aria-labelledby": label != null ? labelID : undefined,
|
|
55
|
+
children: [!!icon && /*#__PURE__*/_jsx(DescriptionListItemIcon, {
|
|
56
|
+
children: icon
|
|
57
|
+
}), /*#__PURE__*/_jsxs(OverflowText, _objectSpread(_objectSpread({}, contentTypographyProps), {}, {
|
|
58
|
+
component: "span",
|
|
59
|
+
color: shouldRenderFallback && label == null ? 'textSecondary' : 'textPrimary',
|
|
60
|
+
TooltipProps: _objectSpread(_objectSpread({}, contentTypographyProps === null || contentTypographyProps === void 0 ? void 0 : contentTypographyProps.TooltipProps), {}, {
|
|
61
|
+
title: (_ref3 = (_contentTypographyPro = contentTypographyProps === null || contentTypographyProps === void 0 ? void 0 : (_contentTypographyPro2 = contentTypographyProps.TooltipProps) === null || _contentTypographyPro2 === void 0 ? void 0 : _contentTypographyPro2.title) !== null && _contentTypographyPro !== void 0 ? _contentTypographyPro : content) !== null && _ref3 !== void 0 ? _ref3 : undefined
|
|
62
|
+
}),
|
|
63
|
+
children: [label != null && /*#__PURE__*/_jsx(Typography, _objectSpread(_objectSpread({}, labelTypographyProps), {}, {
|
|
64
|
+
id: labelID,
|
|
65
|
+
variant: "body2",
|
|
66
|
+
component: "span",
|
|
67
|
+
color: "textSecondary",
|
|
68
|
+
children: label
|
|
69
|
+
})), label != null && ' ', !shouldRenderFallback ? content : fallback]
|
|
70
|
+
}))]
|
|
71
|
+
});
|
|
72
|
+
}); //
|
|
73
|
+
// DescriptionList
|
|
74
|
+
//
|
|
75
|
+
|
|
76
|
+
if (process.env.NODE_ENV !== "production") DescriptionListItem.displayName = "DescriptionListItem";
|
|
77
|
+
var DescriptionListRoot = /*#__PURE__*/styled('div', {
|
|
78
|
+
name: 'SD-DescriptionList',
|
|
79
|
+
slot: 'Root'
|
|
80
|
+
})(_ref4 => {
|
|
81
|
+
var {
|
|
82
|
+
theme
|
|
83
|
+
} = _ref4;
|
|
84
|
+
return _objectSpread(_objectSpread({}, sizeVariant(theme, 2, 1)), {}, {
|
|
85
|
+
'&[data-size="small"]': sizeVariant(theme, 1, 0.5),
|
|
86
|
+
'&[data-size="large"]': sizeVariant(theme, 3, 2)
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
function sizeVariant(theme, mobileSpacing, desktopSpacing) {
|
|
91
|
+
return {
|
|
92
|
+
["& > ".concat(DescriptionListRoot, ", & > ").concat(DescriptionListItemRoot)]: {
|
|
93
|
+
'&:not(:last-child)': {
|
|
94
|
+
paddingBottom: theme.spacing(mobileSpacing),
|
|
95
|
+
[theme.breakpoints.up('sm')]: {
|
|
96
|
+
paddingBottom: theme.spacing(desktopSpacing)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export var DescriptionList = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
104
|
+
var {
|
|
105
|
+
size
|
|
106
|
+
} = _ref5,
|
|
107
|
+
props = _objectWithoutProperties(_ref5, _excluded);
|
|
108
|
+
|
|
109
|
+
return /*#__PURE__*/_jsx(DescriptionListRoot, _objectSpread(_objectSpread({}, props), {}, {
|
|
110
|
+
ref: ref,
|
|
111
|
+
"data-size": size
|
|
112
|
+
}));
|
|
113
|
+
});
|
|
114
|
+
if (process.env.NODE_ENV !== "production") DescriptionList.displayName = "DescriptionList";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { dialogClasses } from '@mui/material';
|
|
2
|
+
export function overrideDialog(theme) {
|
|
3
|
+
theme.components.MuiDialog = {
|
|
4
|
+
styleOverrides: {
|
|
5
|
+
paper: {
|
|
6
|
+
margin: theme.spacing(3)
|
|
7
|
+
},
|
|
8
|
+
paperWidthXs: {
|
|
9
|
+
maxWidth: Math.max(theme.breakpoints.values.xs, 360),
|
|
10
|
+
["&.".concat(dialogClasses.paperScrollBody)]: {
|
|
11
|
+
[theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 360) + 32 * 2)]: {
|
|
12
|
+
maxWidth: 'calc(100% - 64px)'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
theme.components.MuiDialogTitle = {
|
|
19
|
+
defaultProps: {
|
|
20
|
+
// @ts-expect-error DialogTitleProps has missing type def
|
|
21
|
+
variant: 'h3'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
theme.components.MuiDialogContent = {
|
|
25
|
+
styleOverrides: {
|
|
26
|
+
root: {
|
|
27
|
+
padding: theme.spacing(0, 3)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
theme.components.MuiDialogActions = {
|
|
32
|
+
styleOverrides: {
|
|
33
|
+
root: {
|
|
34
|
+
padding: theme.spacing(3)
|
|
35
|
+
},
|
|
36
|
+
spacing: {
|
|
37
|
+
'& > :not(:first-child)': {
|
|
38
|
+
marginLeft: theme.spacing(2)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|