@superdispatch/ui 0.21.0 → 0.21.5-alpha.1

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