@superdispatch/ui 0.21.5-alpha.4 → 0.21.8

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