@superdispatch/ui 0.12.0 → 0.16.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 +294 -160
- package/dist-node/index.js.map +1 -1
- package/dist-src/adaptive-toolbar/AdaptiveToolbar.js +36 -11
- package/dist-src/avatar/AvatarOverrides.js +1 -1
- package/dist-src/button/ButtonOverrides.js +1 -1
- package/dist-src/card-button/CardButton.js +1 -1
- package/dist-src/checkbox/CheckboxOverrides.js +2 -2
- package/dist-src/chip/ChipOverrides.js +3 -3
- package/dist-src/description-list/DescriptionList.js +1 -1
- package/dist-src/dialog/DialogOverrides.js +8 -0
- package/dist-src/dropdown-button/DropdownButton.js +114 -0
- package/dist-src/icon-button/IconButtonOverrides.js +3 -3
- package/dist-src/index.js +1 -0
- package/dist-src/info-card/InfoCard.js +1 -11
- package/dist-src/pagination/PaginationOverrides.js +3 -3
- package/dist-src/radio/RadioOverrides.js +2 -2
- package/dist-src/snackbar/SnackbarContent.js +1 -1
- package/dist-src/svg-icon/SvgIconOverrides.js +1 -1
- package/dist-src/switch/SwitchOverrides.js +1 -1
- package/dist-src/tabs/TabsOverrides.js +2 -2
- package/dist-src/tag/Tag.js +2 -2
- package/dist-src/text-field/TextFieldOverrides.js +2 -2
- package/dist-src/theme/Color.js +6 -0
- package/dist-src/theme/ThemeProvider.js +4 -4
- package/dist-src/tooltip/TooltipOverrides.js +2 -2
- package/dist-src/utils/mergeRefs.js +10 -7
- package/dist-types/index.d.ts +30 -2
- package/dist-web/index.js +243 -111
- package/dist-web/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,13 +2,15 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["items"];
|
|
4
4
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
5
|
-
import { Grid, Menu, MenuItem, Toolbar, Typography } from '@material-ui/core';
|
|
5
|
+
import { Divider, Grid, Menu, MenuItem, Toolbar, Typography } from '@material-ui/core';
|
|
6
6
|
import { MoreHoriz } from '@material-ui/icons';
|
|
7
7
|
import { makeStyles } from '@material-ui/styles';
|
|
8
8
|
import { useEventHandler } from '@superdispatch/hooks';
|
|
9
9
|
import { forwardRef, useLayoutEffect, useRef, useState } from 'react';
|
|
10
10
|
import { Button } from "../button/Button.js";
|
|
11
|
+
import { DropdownButton } from "../dropdown-button/DropdownButton.js";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
15
|
|
|
14
16
|
function useResizeObserver(node, observer) {
|
|
@@ -83,7 +85,6 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
83
85
|
children: /*#__PURE__*/_jsxs(Grid, {
|
|
84
86
|
container: true,
|
|
85
87
|
spacing: 1,
|
|
86
|
-
wrap: "nowrap",
|
|
87
88
|
ref: setRootNode,
|
|
88
89
|
children: [/*#__PURE__*/_jsx(Grid, {
|
|
89
90
|
item: true,
|
|
@@ -98,7 +99,16 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
98
99
|
ref: node => {
|
|
99
100
|
itemNodes.current[idx] = node;
|
|
100
101
|
},
|
|
101
|
-
children: /*#__PURE__*/_jsx(
|
|
102
|
+
children: item.dropdown ? /*#__PURE__*/_jsx(DropdownButton, _objectSpread(_objectSpread({
|
|
103
|
+
type: "button",
|
|
104
|
+
onClick: item.onClick,
|
|
105
|
+
label: item.label
|
|
106
|
+
}, item.ButtonProps), {}, {
|
|
107
|
+
children: item.dropdown.map(dropdownItem => /*#__PURE__*/_jsx(MenuItem, {
|
|
108
|
+
onClick: dropdownItem.onClick,
|
|
109
|
+
children: dropdownItem.label
|
|
110
|
+
}, dropdownItem.key))
|
|
111
|
+
})) : /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
102
112
|
type: "button",
|
|
103
113
|
onClick: item.onClick
|
|
104
114
|
}, item.ButtonProps), {}, {
|
|
@@ -129,15 +139,30 @@ export var AdaptiveToolbar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
129
139
|
onClose: () => {
|
|
130
140
|
setMenuButtonRef(undefined);
|
|
131
141
|
},
|
|
132
|
-
children: menuItems.map(item =>
|
|
133
|
-
|
|
134
|
-
var _item$onClick;
|
|
142
|
+
children: menuItems.map((item, index, arr) => {
|
|
143
|
+
var _item$dropdown;
|
|
135
144
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
var next = arr[index + 1];
|
|
146
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
147
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
148
|
+
onClick: event => {
|
|
149
|
+
var _item$onClick;
|
|
150
|
+
|
|
151
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
|
|
152
|
+
setMenuButtonRef(undefined);
|
|
153
|
+
},
|
|
154
|
+
children: item.label
|
|
155
|
+
}, item.key), (_item$dropdown = item.dropdown) === null || _item$dropdown === void 0 ? void 0 : _item$dropdown.map(dropdownItem => /*#__PURE__*/_jsx(MenuItem, {
|
|
156
|
+
onClick: event => {
|
|
157
|
+
var _dropdownItem$onClick;
|
|
158
|
+
|
|
159
|
+
(_dropdownItem$onClick = dropdownItem.onClick) === null || _dropdownItem$onClick === void 0 ? void 0 : _dropdownItem$onClick.call(dropdownItem, event);
|
|
160
|
+
setMenuButtonRef(undefined);
|
|
161
|
+
},
|
|
162
|
+
children: dropdownItem.label
|
|
163
|
+
}, dropdownItem.key)), next && item.groupKey !== next.groupKey && /*#__PURE__*/_jsx(Divider, {})]
|
|
164
|
+
});
|
|
165
|
+
})
|
|
141
166
|
})]
|
|
142
167
|
})]
|
|
143
168
|
})
|
|
@@ -189,7 +189,7 @@ export function overrideButton(theme) {
|
|
|
189
189
|
'&[data-color="success"]': outlinedVariant(Color.Green300, Color.Green300, Color.Green100, Color.Green100, Color.Green300, Color.Green300, Color.Green100, Color.Green50, Color.Green300, Color.White),
|
|
190
190
|
'&[data-color="white"]': outlinedVariant(Color.White, Color.White50, Color.White50, Color.White40, Color.White, Color.White50, Color.White40, Color.White10, Color.White50, Color.Transparent)
|
|
191
191
|
},
|
|
192
|
-
outlinedPrimary: outlinedVariant(Color.
|
|
192
|
+
outlinedPrimary: outlinedVariant(Color.Dark500, Color.Silver500, Color.Silver500, Color.Silver400, Color.Blue300, Color.Blue300, Color.Blue100, Color.Blue50, Color.Dark200, Color.White),
|
|
193
193
|
outlinedSizeSmall: {
|
|
194
194
|
padding: undefined,
|
|
195
195
|
fontSize: undefined
|
|
@@ -24,7 +24,7 @@ var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
|
24
24
|
transition: theme.transitions.create(['color', 'box-shadow', 'border-color', 'background-color'])
|
|
25
25
|
},
|
|
26
26
|
disabled: {
|
|
27
|
-
color: Color.
|
|
27
|
+
color: Color.Dark200,
|
|
28
28
|
borderColor: Color.Silver500,
|
|
29
29
|
backgroundColor: Color.Silver100
|
|
30
30
|
},
|
|
@@ -45,7 +45,7 @@ export function overrideCheckbox(theme) {
|
|
|
45
45
|
};
|
|
46
46
|
theme.overrides.MuiCheckbox = {
|
|
47
47
|
root: {
|
|
48
|
-
color: Color.
|
|
48
|
+
color: Color.Dark100,
|
|
49
49
|
marginTop: theme.spacing(-0.625),
|
|
50
50
|
marginBottom: theme.spacing(-0.625)
|
|
51
51
|
},
|
|
@@ -54,7 +54,7 @@ export function overrideCheckbox(theme) {
|
|
|
54
54
|
color: Color.Silver500
|
|
55
55
|
},
|
|
56
56
|
'&:hover:not($checked)': {
|
|
57
|
-
color: Color.
|
|
57
|
+
color: Color.Dark100
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -25,7 +25,7 @@ export function overrideChip(theme) {
|
|
|
25
25
|
backgroundColor: Color.Silver200,
|
|
26
26
|
'&$disabled': {
|
|
27
27
|
opacity: undefined,
|
|
28
|
-
color: Color.
|
|
28
|
+
color: Color.Dark100
|
|
29
29
|
}
|
|
30
30
|
}),
|
|
31
31
|
sizeSmall: {
|
|
@@ -71,7 +71,7 @@ export function overrideChip(theme) {
|
|
|
71
71
|
},
|
|
72
72
|
'& > svg': {
|
|
73
73
|
borderRadius: '50%',
|
|
74
|
-
color: Color.
|
|
74
|
+
color: Color.Dark200,
|
|
75
75
|
fontSize: '1em'
|
|
76
76
|
}
|
|
77
77
|
},
|
|
@@ -86,7 +86,7 @@ export function overrideChip(theme) {
|
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
icon: {
|
|
89
|
-
color: Color.
|
|
89
|
+
color: Color.Dark100,
|
|
90
90
|
fontSize: '1em',
|
|
91
91
|
marginRight: undefined
|
|
92
92
|
},
|
|
@@ -37,7 +37,7 @@ var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
|
37
37
|
display: 'inline-flex',
|
|
38
38
|
marginRight: theme.spacing(1),
|
|
39
39
|
'& > .MuiSvgIcon-root': {
|
|
40
|
-
color: Color.
|
|
40
|
+
color: Color.Dark100,
|
|
41
41
|
fontSize: theme.spacing(3),
|
|
42
42
|
[theme.breakpoints.up('sm')]: {
|
|
43
43
|
fontSize: theme.spacing(2)
|
|
@@ -6,6 +6,14 @@ export function overrideDialog(theme) {
|
|
|
6
6
|
theme.overrides.MuiDialog = {
|
|
7
7
|
paper: {
|
|
8
8
|
margin: theme.spacing(3)
|
|
9
|
+
},
|
|
10
|
+
paperWidthXs: {
|
|
11
|
+
maxWidth: Math.max(theme.breakpoints.values.xs, 360),
|
|
12
|
+
'&$paperScrollBody': {
|
|
13
|
+
[theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 360) + 32 * 2)]: {
|
|
14
|
+
maxWidth: 'calc(100% - 64px)'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
9
17
|
}
|
|
10
18
|
};
|
|
11
19
|
theme.overrides.MuiDialogTitle = {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["MenuListProps", "ButtonGroupProps", "children", "isLoading", "onClick", "label"];
|
|
4
|
+
import { ButtonGroup, MenuList, Popover } from '@material-ui/core';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { Color, mergeRefs, useUID } from "../index.js";
|
|
9
|
+
import { Button } from "../button/Button.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
function CaretDownIcon() {
|
|
15
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
16
|
+
viewBox: "0 0 8 4",
|
|
17
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
d: "M0.666687 0.666656L4.00002 3.99999L7.33335 0.666656H0.666687Z"
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var CaretButton = /*#__PURE__*/styled(Button).withConfig({
|
|
25
|
+
displayName: "DropdownButton__CaretButton",
|
|
26
|
+
componentId: "SD__sc-8l84jm-0"
|
|
27
|
+
})(["width:auto;", ";"], _ref => {
|
|
28
|
+
var {
|
|
29
|
+
variant
|
|
30
|
+
} = _ref;
|
|
31
|
+
return variant === 'contained' && "border-left: 1px solid ".concat(Color.Blue500);
|
|
32
|
+
});
|
|
33
|
+
export var DropdownButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
34
|
+
var _anchorRef$current2;
|
|
35
|
+
|
|
36
|
+
var {
|
|
37
|
+
MenuListProps,
|
|
38
|
+
ButtonGroupProps,
|
|
39
|
+
children,
|
|
40
|
+
isLoading,
|
|
41
|
+
onClick,
|
|
42
|
+
label
|
|
43
|
+
} = _ref2,
|
|
44
|
+
buttonProps = _objectWithoutProperties(_ref2, _excluded);
|
|
45
|
+
|
|
46
|
+
var uid = useUID();
|
|
47
|
+
var [open, setOpen] = React.useState(false);
|
|
48
|
+
var anchorRef = React.useRef(null);
|
|
49
|
+
|
|
50
|
+
function handleClick(event) {
|
|
51
|
+
setOpen(false);
|
|
52
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function handleToggle() {
|
|
56
|
+
setOpen(prevOpen => !prevOpen);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleClose(event) {
|
|
60
|
+
var _anchorRef$current;
|
|
61
|
+
|
|
62
|
+
if ((_anchorRef$current = anchorRef.current) !== null && _anchorRef$current !== void 0 && _anchorRef$current.contains(event.currentTarget)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
setOpen(false);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
70
|
+
children: [/*#__PURE__*/_jsxs(ButtonGroup, _objectSpread(_objectSpread({}, ButtonGroupProps), {}, {
|
|
71
|
+
ref: mergeRefs(ButtonGroupProps === null || ButtonGroupProps === void 0 ? void 0 : ButtonGroupProps.ref, anchorRef),
|
|
72
|
+
fullWidth: (ButtonGroupProps === null || ButtonGroupProps === void 0 ? void 0 : ButtonGroupProps.fullWidth) || buttonProps.fullWidth,
|
|
73
|
+
children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
74
|
+
ref: ref,
|
|
75
|
+
onClick: handleClick,
|
|
76
|
+
disabled: isLoading,
|
|
77
|
+
isLoading: isLoading
|
|
78
|
+
}, buttonProps), {}, {
|
|
79
|
+
children: label
|
|
80
|
+
})), /*#__PURE__*/_jsx(CaretButton, {
|
|
81
|
+
onClick: handleToggle,
|
|
82
|
+
disabled: isLoading,
|
|
83
|
+
color: buttonProps.color,
|
|
84
|
+
variant: buttonProps.variant,
|
|
85
|
+
"aria-haspopup": "menu",
|
|
86
|
+
"aria-controls": open ? uid : undefined,
|
|
87
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
88
|
+
children: /*#__PURE__*/_jsx(CaretDownIcon, {})
|
|
89
|
+
})]
|
|
90
|
+
})), /*#__PURE__*/_jsx(Popover, {
|
|
91
|
+
open: open,
|
|
92
|
+
onClose: handleClose,
|
|
93
|
+
anchorEl: anchorRef.current,
|
|
94
|
+
anchorOrigin: {
|
|
95
|
+
vertical: 'bottom',
|
|
96
|
+
horizontal: 'left'
|
|
97
|
+
},
|
|
98
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
99
|
+
style: {
|
|
100
|
+
minWidth: (_anchorRef$current2 = anchorRef.current) === null || _anchorRef$current2 === void 0 ? void 0 : _anchorRef$current2.clientWidth
|
|
101
|
+
},
|
|
102
|
+
children: /*#__PURE__*/_jsx(MenuList, _objectSpread(_objectSpread({}, MenuListProps), {}, {
|
|
103
|
+
id: uid,
|
|
104
|
+
onClick: () => {
|
|
105
|
+
setOpen(false);
|
|
106
|
+
},
|
|
107
|
+
children: children
|
|
108
|
+
}))
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
if (process.env.NODE_ENV !== "production") DropdownButton.displayName = "DropdownButton";
|
|
114
|
+
export default DropdownButton;
|
|
@@ -2,7 +2,7 @@ import { Color } from "../theme/Color.js";
|
|
|
2
2
|
export function overrideIconButton(theme) {
|
|
3
3
|
theme.overrides.MuiIconButton = {
|
|
4
4
|
root: {
|
|
5
|
-
color: Color.
|
|
5
|
+
color: Color.Dark100,
|
|
6
6
|
backgroundColor: Color.Transparent,
|
|
7
7
|
transition: theme.transitions.create(['color', 'background-color'], {
|
|
8
8
|
duration: theme.transitions.duration.short
|
|
@@ -11,10 +11,10 @@ export function overrideIconButton(theme) {
|
|
|
11
11
|
backgroundColor: Color.Transparent
|
|
12
12
|
},
|
|
13
13
|
'&:active': {
|
|
14
|
-
color: Color.
|
|
14
|
+
color: Color.Dark500
|
|
15
15
|
},
|
|
16
16
|
'&:hover ': {
|
|
17
|
-
color: Color.
|
|
17
|
+
color: Color.Dark300
|
|
18
18
|
},
|
|
19
19
|
'&:focus': {
|
|
20
20
|
backgroundColor: Color.Silver400
|
package/dist-src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./drawer/DrawerActions.js";
|
|
|
11
11
|
export * from "./drawer/DrawerContent.js";
|
|
12
12
|
export * from "./drawer/DrawerList.js";
|
|
13
13
|
export * from "./drawer/DrawerTitle.js";
|
|
14
|
+
export * from "./dropdown-button/DropdownButton.js";
|
|
14
15
|
export * from "./grid/GridStack.js";
|
|
15
16
|
export * from "./grid/InlineGrid.js";
|
|
16
17
|
export * from "./info-card/InfoCard.js";
|
|
@@ -6,18 +6,8 @@ import { Card, CardContent } from '@material-ui/core';
|
|
|
6
6
|
import { makeStyles } from '@material-ui/styles';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { forwardRef, useState } from 'react';
|
|
9
|
+
import { assignRef } from "../utils/mergeRefs.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
function assignRef(ref, value) {
|
|
12
|
-
if (ref) {
|
|
13
|
-
if (typeof ref === 'object') {
|
|
14
|
-
ref.current = value;
|
|
15
|
-
} else {
|
|
16
|
-
ref(value);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
11
|
var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
22
12
|
root: {
|
|
23
13
|
'&$fullWidth': {
|
|
@@ -3,7 +3,7 @@ export function overridePagination(theme) {
|
|
|
3
3
|
var props = {};
|
|
4
4
|
var overrides = {
|
|
5
5
|
root: {
|
|
6
|
-
color: Color.
|
|
6
|
+
color: Color.Dark400
|
|
7
7
|
},
|
|
8
8
|
page: {
|
|
9
9
|
'&:hover': {
|
|
@@ -20,13 +20,13 @@ export function overridePagination(theme) {
|
|
|
20
20
|
backgroundColor: Color.Silver400
|
|
21
21
|
},
|
|
22
22
|
'&$disabled': {
|
|
23
|
-
color: Color.
|
|
23
|
+
color: Color.Dark100,
|
|
24
24
|
backgroundColor: Color.Silver400
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
'&$disabled': {
|
|
28
28
|
opacity: undefined,
|
|
29
|
-
color: Color.
|
|
29
|
+
color: Color.Dark100
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}; // Remove `Object.assign` after official release of `PaginationItem`.
|
|
@@ -31,7 +31,7 @@ export function overrideRadio(theme) {
|
|
|
31
31
|
};
|
|
32
32
|
theme.overrides.MuiRadio = {
|
|
33
33
|
root: {
|
|
34
|
-
color: Color.
|
|
34
|
+
color: Color.Dark100,
|
|
35
35
|
marginTop: theme.spacing(-0.625),
|
|
36
36
|
marginBottom: theme.spacing(-0.625)
|
|
37
37
|
},
|
|
@@ -40,7 +40,7 @@ export function overrideRadio(theme) {
|
|
|
40
40
|
color: Color.Silver500
|
|
41
41
|
},
|
|
42
42
|
'&:hover:not($checked)': {
|
|
43
|
-
color: Color.
|
|
43
|
+
color: Color.Dark100
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
};
|
|
@@ -14,7 +14,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
15
15
|
root: {
|
|
16
16
|
color: Color.White,
|
|
17
|
-
backgroundColor: Color.
|
|
17
|
+
backgroundColor: Color.Dark500,
|
|
18
18
|
'&$variantError': {
|
|
19
19
|
color: Color.White,
|
|
20
20
|
backgroundColor: Color.Red500
|
|
@@ -77,7 +77,7 @@ export function overrideSwitch(theme) {
|
|
|
77
77
|
backgroundColor: Color.Blue100
|
|
78
78
|
},
|
|
79
79
|
'&:hover + $track': {
|
|
80
|
-
backgroundColor: Color.
|
|
80
|
+
backgroundColor: Color.Dark100
|
|
81
81
|
},
|
|
82
82
|
'&.Mui-focusVisible + $track': {
|
|
83
83
|
boxShadow: "0 0 0 3px ".concat(Color.Blue100)
|
|
@@ -12,7 +12,7 @@ export function overrideTabs(theme) {
|
|
|
12
12
|
},
|
|
13
13
|
scrollButtons: {
|
|
14
14
|
opacity: 1,
|
|
15
|
-
color: Color.
|
|
15
|
+
color: Color.Dark100,
|
|
16
16
|
width: theme.spacing(4),
|
|
17
17
|
transition: theme.transitions.create('opacity', {
|
|
18
18
|
duration: theme.transitions.duration.short
|
|
@@ -32,7 +32,7 @@ export function overrideTabs(theme) {
|
|
|
32
32
|
}
|
|
33
33
|
}),
|
|
34
34
|
textColorPrimary: {
|
|
35
|
-
color: Color.
|
|
35
|
+
color: Color.Dark500,
|
|
36
36
|
'&:hover, &:focus': {
|
|
37
37
|
color: Color.Blue300
|
|
38
38
|
}
|
package/dist-src/tag/Tag.js
CHANGED
|
@@ -17,7 +17,7 @@ var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
|
17
17
|
},
|
|
18
18
|
variantSubtle: {
|
|
19
19
|
'&$colorGrey': {
|
|
20
|
-
color: Color.
|
|
20
|
+
color: Color.Dark300,
|
|
21
21
|
backgroundColor: Color.Silver200
|
|
22
22
|
},
|
|
23
23
|
'&$colorBlue': {
|
|
@@ -48,7 +48,7 @@ var useStyles = /*#__PURE__*/makeStyles(theme => ({
|
|
|
48
48
|
variantBold: {
|
|
49
49
|
color: Color.White,
|
|
50
50
|
'&$colorGrey': {
|
|
51
|
-
backgroundColor: Color.
|
|
51
|
+
backgroundColor: Color.Dark300
|
|
52
52
|
},
|
|
53
53
|
'&$colorBlue': {
|
|
54
54
|
backgroundColor: Color.Blue500
|
|
@@ -21,7 +21,7 @@ export function overrideTextField(theme) {
|
|
|
21
21
|
};
|
|
22
22
|
theme.overrides.MuiFormLabel = {
|
|
23
23
|
root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
24
|
-
color: Color.
|
|
24
|
+
color: Color.Dark400,
|
|
25
25
|
'&$error': {
|
|
26
26
|
color: undefined
|
|
27
27
|
},
|
|
@@ -116,7 +116,7 @@ export function overrideTextField(theme) {
|
|
|
116
116
|
icon: {
|
|
117
117
|
top: 'calc(50% - 0.5em)',
|
|
118
118
|
'$disabled &': {
|
|
119
|
-
color: Color.
|
|
119
|
+
color: Color.Dark100
|
|
120
120
|
},
|
|
121
121
|
fontSize: theme.spacing(3),
|
|
122
122
|
[sm]: {
|
package/dist-src/theme/Color.js
CHANGED
|
@@ -17,6 +17,12 @@ export var Color;
|
|
|
17
17
|
Color["Grey400"] = "#323C4E";
|
|
18
18
|
Color["Grey450"] = "#222F44";
|
|
19
19
|
Color["Grey500"] = "#192334";
|
|
20
|
+
Color["Dark100"] = "#8F949E";
|
|
21
|
+
Color["Dark200"] = "#6A707C";
|
|
22
|
+
Color["Dark300"] = "#5B6371";
|
|
23
|
+
Color["Dark400"] = "#323C4E";
|
|
24
|
+
Color["Dark450"] = "#222F44";
|
|
25
|
+
Color["Dark500"] = "#192334";
|
|
20
26
|
Color["Silver100"] = "#F6F7F8";
|
|
21
27
|
Color["Silver200"] = "#F3F5F8";
|
|
22
28
|
Color["Silver300"] = "#E8ECF0";
|
|
@@ -50,10 +50,10 @@ function createSuperDispatchTheme() {
|
|
|
50
50
|
disabled: Color.Silver400
|
|
51
51
|
},
|
|
52
52
|
text: {
|
|
53
|
-
primary: Color.
|
|
54
|
-
secondary: Color.
|
|
55
|
-
hint: Color.
|
|
56
|
-
disabled: Color.
|
|
53
|
+
primary: Color.Dark500,
|
|
54
|
+
secondary: Color.Dark200,
|
|
55
|
+
hint: Color.Dark100,
|
|
56
|
+
disabled: Color.Dark100
|
|
57
57
|
},
|
|
58
58
|
divider: Color.Silver400
|
|
59
59
|
},
|
|
@@ -7,7 +7,7 @@ export function overrideTooltip(theme) {
|
|
|
7
7
|
theme.overrides.MuiTooltip = {
|
|
8
8
|
tooltip: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
|
|
9
9
|
padding: theme.spacing(1, 1.5),
|
|
10
|
-
backgroundColor: Color.
|
|
10
|
+
backgroundColor: Color.Dark400
|
|
11
11
|
}),
|
|
12
12
|
popperArrow: {
|
|
13
13
|
'&[x-placement*="top"] $arrow': {
|
|
@@ -32,7 +32,7 @@ export function overrideTooltip(theme) {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
arrow: {
|
|
35
|
-
color: Color.
|
|
35
|
+
color: Color.Dark400,
|
|
36
36
|
fontSize: theme.spacing(1)
|
|
37
37
|
}
|
|
38
38
|
};
|
|
@@ -5,13 +5,16 @@ export function mergeRefs() {
|
|
|
5
5
|
|
|
6
6
|
return node => {
|
|
7
7
|
refs.forEach(ref => {
|
|
8
|
-
|
|
9
|
-
if (typeof ref === 'function') {
|
|
10
|
-
ref(node);
|
|
11
|
-
} else {
|
|
12
|
-
ref.current = node;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
8
|
+
assignRef(ref, node);
|
|
15
9
|
});
|
|
16
10
|
};
|
|
11
|
+
}
|
|
12
|
+
export function assignRef(ref, value) {
|
|
13
|
+
if (ref) {
|
|
14
|
+
if (typeof ref === 'function') {
|
|
15
|
+
ref(value);
|
|
16
|
+
} else {
|
|
17
|
+
ref.current = value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
17
20
|
}
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ButtonProps as ButtonProps$1, ToolbarProps, AvatarClassKey, AvatarTypeMap, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormControlProps, FormGroupProps, FormLabelProps, FormHelperTextProps, TypographyProps, TooltipProps, ListProps, ListTypeMap, GridProps, CardClassKey, CardProps, CardContentProps, RadioProps, RadioGroupProps, SnackbarContentProps as SnackbarContentProps$1, SnackbarContentClassKey as SnackbarContentClassKey$1, SnackbarProps as SnackbarProps$1, Theme } from '@material-ui/core';
|
|
2
|
+
import { ButtonProps as ButtonProps$1, ToolbarProps, AvatarClassKey, AvatarTypeMap, ButtonBaseProps, CheckboxProps, FormControlLabelProps, FormControlProps, FormGroupProps, FormLabelProps, FormHelperTextProps, TypographyProps, TooltipProps, ListProps, ListTypeMap, MenuListProps, ButtonGroupProps, GridProps, CardClassKey, CardProps, CardContentProps, RadioProps, RadioGroupProps, SnackbarContentProps as SnackbarContentProps$1, SnackbarContentClassKey as SnackbarContentClassKey$1, SnackbarProps as SnackbarProps$1, Theme } from '@material-ui/core';
|
|
3
3
|
import { RefAttributes, ForwardRefExoticComponent, Key, ReactNode, MouseEvent, ButtonHTMLAttributes, Ref, ElementType, HTMLAttributes, ReactElement, ConsumerProps } from 'react';
|
|
4
4
|
import { ClassNameMap } from '@material-ui/styles';
|
|
5
5
|
import { Property } from 'csstype';
|
|
@@ -15,9 +15,16 @@ interface ButtonProps extends RefAttributes<HTMLButtonElement>, Omit<ButtonProps
|
|
|
15
15
|
}
|
|
16
16
|
declare const Button: ForwardRefExoticComponent<ButtonProps>;
|
|
17
17
|
|
|
18
|
+
interface AdaptiveToolbarDropdownItem {
|
|
19
|
+
key: Key;
|
|
20
|
+
label: ReactNode;
|
|
21
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
22
|
+
}
|
|
18
23
|
interface AdaptiveToolbarItem {
|
|
19
24
|
key: Key;
|
|
25
|
+
groupKey?: Key;
|
|
20
26
|
label: ReactNode;
|
|
27
|
+
dropdown?: AdaptiveToolbarDropdownItem[];
|
|
21
28
|
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
22
29
|
ButtonProps?: Omit<ButtonProps, 'type' | 'onClick'>;
|
|
23
30
|
}
|
|
@@ -168,6 +175,14 @@ interface DrawerTitleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'
|
|
|
168
175
|
}
|
|
169
176
|
declare const DrawerTitle: ForwardRefExoticComponent<DrawerTitleProps & RefAttributes<HTMLDivElement>>;
|
|
170
177
|
|
|
178
|
+
interface DropdownButtonProps extends Omit<ButtonProps, 'children'> {
|
|
179
|
+
label?: ReactNode;
|
|
180
|
+
children: ReactNode;
|
|
181
|
+
MenuListProps?: Omit<MenuListProps, 'id'>;
|
|
182
|
+
ButtonGroupProps?: ButtonGroupProps;
|
|
183
|
+
}
|
|
184
|
+
declare const DropdownButton: ForwardRefExoticComponent<Pick<DropdownButtonProps, "className" | "style" | "classes" | "innerRef" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "label" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "disableElevation" | "fullWidth" | "startIcon" | "endIcon" | "disableFocusRipple" | "href" | "size" | "variant" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "rel" | "target" | "isActive" | "isLoading" | "MenuListProps" | "ButtonGroupProps"> & RefAttributes<HTMLButtonElement>>;
|
|
185
|
+
|
|
171
186
|
interface GridStackProps extends RefAttributes<HTMLDivElement>, Pick<GridProps, 'style' | 'className' | 'children' | 'spacing' | 'alignItems'> {
|
|
172
187
|
}
|
|
173
188
|
/**
|
|
@@ -293,12 +308,24 @@ declare enum Color {
|
|
|
293
308
|
Black = "#000",
|
|
294
309
|
Black50 = "rgba(0, 0, 0, 0.5)",
|
|
295
310
|
Black20 = "rgba(0, 0, 0, 0.2)",
|
|
311
|
+
/**@deprecated Use Dark100 */
|
|
296
312
|
Grey100 = "#8F949E",
|
|
313
|
+
/**@deprecated Use Dark200 */
|
|
297
314
|
Grey200 = "#6A707C",
|
|
315
|
+
/**@deprecated Use Dark300 */
|
|
298
316
|
Grey300 = "#5B6371",
|
|
317
|
+
/**@deprecated Use Dark400 */
|
|
299
318
|
Grey400 = "#323C4E",
|
|
319
|
+
/**@deprecated Use Dark450 */
|
|
300
320
|
Grey450 = "#222F44",
|
|
321
|
+
/**@deprecated Use Dark500 */
|
|
301
322
|
Grey500 = "#192334",
|
|
323
|
+
Dark100 = "#8F949E",
|
|
324
|
+
Dark200 = "#6A707C",
|
|
325
|
+
Dark300 = "#5B6371",
|
|
326
|
+
Dark400 = "#323C4E",
|
|
327
|
+
Dark450 = "#222F44",
|
|
328
|
+
Dark500 = "#192334",
|
|
302
329
|
Silver100 = "#F6F7F8",
|
|
303
330
|
Silver200 = "#F3F5F8",
|
|
304
331
|
Silver300 = "#E8ECF0",
|
|
@@ -371,6 +398,7 @@ declare const Tiles: ForwardRefExoticComponent<TilesProps & RefAttributes<HTMLDi
|
|
|
371
398
|
declare function isEmptyReactNode(node: ReactNode): node is null | undefined | boolean | string;
|
|
372
399
|
|
|
373
400
|
declare function mergeRefs<T>(...refs: Array<null | undefined | Ref<T>>): (node: T) => void;
|
|
401
|
+
declare function assignRef<T>(ref: Ref<T> | undefined, value: T): void;
|
|
374
402
|
|
|
375
403
|
declare function renderChildren(node: ReactNode): null | ReactElement;
|
|
376
404
|
|
|
@@ -395,4 +423,4 @@ interface VisibilityObserverProps extends VisibilityObserverOptions {
|
|
|
395
423
|
}
|
|
396
424
|
declare function VisibilityObserver({ render, onChange, ...options }: VisibilityObserverProps): null | ReactElement;
|
|
397
425
|
|
|
398
|
-
export { AdaptiveToolbar, AdaptiveToolbarItem, AdaptiveToolbarProps, AvatarButton, AvatarButtonClassKey, AvatarButtonProps, Button, ButtonProps, CardButton, CardButtonClassKey, CardButtonProps, CheckboxField, CheckboxFieldProps, CheckboxGroupField, CheckboxGroupFieldProps, CollapseBreakpoint, CollapseProp, Color, ColorProp, ColorVariant, Column, ColumnProps, ColumnWidth, Columns, ColumnsProps, DescriptionList, DescriptionListItem, DescriptionListItemProps, DescriptionListProps, DrawerActions, DrawerActionsProps, DrawerContent, DrawerContentProps, DrawerList, DrawerListProps, DrawerTitle, DrawerTitleProps, ElementVisibility, GridStack, GridStackProps, HorizontalAlign, InfoCard, InfoCardClassKey, InfoCardProps, Inline, InlineGrid, InlineGridProps, InlineProps, NegativeSpaceProp, OverflowText, OverflowTextProps, PartialResponsivePropRecord, RadioField, RadioFieldProps, RadioGroupField, RadioGroupFieldProps, ResponsiveContext, ResponsiveContextProvider, ResponsiveContextProviderProps, ResponsiveProp, ResponsivePropPrimitive, ResponsivePropRecord, ResponsivePropTuple, ResponsivePropTupleInit, Snackbar, SnackbarCloseReason, SnackbarContent, SnackbarContentProps, SnackbarProps, SnackbarStack, SnackbarStackConsumer, SnackbarStackOptions, SnackbarStackProvider, SnackbarStackProviderProps, SnackbarVariant, SpaceProp, Stack, StackProps, SuperDispatchTheme, Tag, TagClassKey, TagProps, ThemeProvider, ThemeProviderProps, Tiles, TilesColumns, TilesProps, TilesSpace, VerticalAlign, VisibilityObserver, VisibilityObserverOptions, VisibilityObserverProps, VisibilityObserverRenderProps, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
|
|
426
|
+
export { AdaptiveToolbar, AdaptiveToolbarDropdownItem, AdaptiveToolbarItem, AdaptiveToolbarProps, AvatarButton, AvatarButtonClassKey, AvatarButtonProps, Button, ButtonProps, CardButton, CardButtonClassKey, CardButtonProps, CheckboxField, CheckboxFieldProps, CheckboxGroupField, CheckboxGroupFieldProps, CollapseBreakpoint, CollapseProp, Color, ColorProp, ColorVariant, Column, ColumnProps, ColumnWidth, Columns, ColumnsProps, DescriptionList, DescriptionListItem, DescriptionListItemProps, DescriptionListProps, DrawerActions, DrawerActionsProps, DrawerContent, DrawerContentProps, DrawerList, DrawerListProps, DrawerTitle, DrawerTitleProps, DropdownButton, ElementVisibility, GridStack, GridStackProps, HorizontalAlign, InfoCard, InfoCardClassKey, InfoCardProps, Inline, InlineGrid, InlineGridProps, InlineProps, NegativeSpaceProp, OverflowText, OverflowTextProps, PartialResponsivePropRecord, RadioField, RadioFieldProps, RadioGroupField, RadioGroupFieldProps, ResponsiveContext, ResponsiveContextProvider, ResponsiveContextProviderProps, ResponsiveProp, ResponsivePropPrimitive, ResponsivePropRecord, ResponsivePropTuple, ResponsivePropTupleInit, Snackbar, SnackbarCloseReason, SnackbarContent, SnackbarContentProps, SnackbarProps, SnackbarStack, SnackbarStackConsumer, SnackbarStackOptions, SnackbarStackProvider, SnackbarStackProviderProps, SnackbarVariant, SpaceProp, Stack, StackProps, SuperDispatchTheme, Tag, TagClassKey, TagProps, ThemeProvider, ThemeProviderProps, Tiles, TilesColumns, TilesProps, TilesSpace, VerticalAlign, VisibilityObserver, VisibilityObserverOptions, VisibilityObserverProps, VisibilityObserverRenderProps, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };
|