@superdispatch/ui 0.11.0 → 0.15.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.
@@ -12,7 +12,7 @@ export function overrideAvatar(theme) {
12
12
  }
13
13
  }),
14
14
  colorDefault: {
15
- color: Color.Grey300,
15
+ color: Color.Dark300,
16
16
  backgroundColor: Color.Silver300
17
17
  }
18
18
  };
@@ -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.Grey500, Color.Silver500, Color.Silver500, Color.Silver400, Color.Blue300, Color.Blue300, Color.Blue100, Color.Blue50, Color.Grey200, Color.White),
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.Grey200,
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.Grey100,
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.Grey100
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.Grey100
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.Grey200,
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.Grey100,
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.Grey100,
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 = {
@@ -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.Grey100,
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.Grey500
14
+ color: Color.Dark500
15
15
  },
16
16
  '&:hover ': {
17
- color: Color.Grey300
17
+ color: Color.Dark300
18
18
  },
19
19
  '&:focus': {
20
20
  backgroundColor: Color.Silver400
@@ -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.Grey400
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.Grey100,
23
+ color: Color.Dark100,
24
24
  backgroundColor: Color.Silver400
25
25
  }
26
26
  },
27
27
  '&$disabled': {
28
28
  opacity: undefined,
29
- color: Color.Grey100
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.Grey100,
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.Grey100
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.Grey500,
17
+ backgroundColor: Color.Dark500,
18
18
  '&$variantError': {
19
19
  color: Color.White,
20
20
  backgroundColor: Color.Red500
@@ -19,7 +19,7 @@ export function overrideSvgIcon(theme) {
19
19
  fontSize: 'var(--mui-svg-icon-size, 32px)'
20
20
  },
21
21
  colorAction: {
22
- color: Color.Grey100
22
+ color: Color.Dark100
23
23
  }
24
24
  };
25
25
  }
@@ -77,7 +77,7 @@ export function overrideSwitch(theme) {
77
77
  backgroundColor: Color.Blue100
78
78
  },
79
79
  '&:hover + $track': {
80
- backgroundColor: Color.Grey100
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.Grey100,
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.Grey500,
35
+ color: Color.Dark500,
36
36
  '&:hover, &:focus': {
37
37
  color: Color.Blue300
38
38
  }
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["color", "variant", "children", "classes", "className", "noWrap", "component"];
3
+ var _excluded = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
4
4
  import { Typography } from '@material-ui/core';
5
5
  import { makeStyles } from '@material-ui/styles';
6
6
  import cx from 'clsx';
@@ -17,7 +17,7 @@ var useStyles = /*#__PURE__*/makeStyles(theme => ({
17
17
  },
18
18
  variantSubtle: {
19
19
  '&$colorGrey': {
20
- color: Color.Grey300,
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.Grey300
51
+ backgroundColor: Color.Dark300
52
52
  },
53
53
  '&$colorBlue': {
54
54
  backgroundColor: Color.Blue500
@@ -87,6 +87,7 @@ export var Tag = /*#__PURE__*/forwardRef((_ref, ref) => {
87
87
  classes,
88
88
  className,
89
89
  noWrap = true,
90
+ fontWeight = 'bold',
90
91
  component = 'div'
91
92
  } = _ref,
92
93
  props = _objectWithoutProperties(_ref, _excluded);
@@ -96,9 +97,9 @@ export var Tag = /*#__PURE__*/forwardRef((_ref, ref) => {
96
97
  });
97
98
  return /*#__PURE__*/_jsx(Typography, _objectSpread(_objectSpread({}, props), {}, {
98
99
  ref: ref,
99
- variant: "body1",
100
100
  noWrap: noWrap,
101
101
  component: component,
102
+ variant: fontWeight === 'bold' ? 'body1' : 'body2',
102
103
  className: cx(styles.root, className, {
103
104
  'grey': styles.colorGrey,
104
105
  'blue': styles.colorBlue,
@@ -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.Grey400,
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.Grey100
119
+ color: Color.Dark100
120
120
  },
121
121
  fontSize: theme.spacing(3),
122
122
  [sm]: {
@@ -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.Grey500,
54
- secondary: Color.Grey200,
55
- hint: Color.Grey100,
56
- disabled: Color.Grey100
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.Grey400
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.Grey400,
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
- if (ref) {
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
  }
@@ -277,6 +277,7 @@ interface TagProps extends RefAttributes<unknown>, Omit<TypographyProps, 'ref' |
277
277
  component?: ElementType;
278
278
  color: 'grey' | 'blue' | 'green' | 'purple' | 'red' | 'teal' | 'yellow';
279
279
  variant: 'subtle' | 'bold';
280
+ fontWeight?: 'regular' | 'bold';
280
281
  }
281
282
  declare const Tag: ForwardRefExoticComponent<TagProps>;
282
283
 
@@ -292,12 +293,24 @@ declare enum Color {
292
293
  Black = "#000",
293
294
  Black50 = "rgba(0, 0, 0, 0.5)",
294
295
  Black20 = "rgba(0, 0, 0, 0.2)",
296
+ /**@deprecated Use Dark100 */
295
297
  Grey100 = "#8F949E",
298
+ /**@deprecated Use Dark200 */
296
299
  Grey200 = "#6A707C",
300
+ /**@deprecated Use Dark300 */
297
301
  Grey300 = "#5B6371",
302
+ /**@deprecated Use Dark400 */
298
303
  Grey400 = "#323C4E",
304
+ /**@deprecated Use Dark450 */
299
305
  Grey450 = "#222F44",
306
+ /**@deprecated Use Dark500 */
300
307
  Grey500 = "#192334",
308
+ Dark100 = "#8F949E",
309
+ Dark200 = "#6A707C",
310
+ Dark300 = "#5B6371",
311
+ Dark400 = "#323C4E",
312
+ Dark450 = "#222F44",
313
+ Dark500 = "#192334",
301
314
  Silver100 = "#F6F7F8",
302
315
  Silver200 = "#F3F5F8",
303
316
  Silver300 = "#E8ECF0",
@@ -370,6 +383,7 @@ declare const Tiles: ForwardRefExoticComponent<TilesProps & RefAttributes<HTMLDi
370
383
  declare function isEmptyReactNode(node: ReactNode): node is null | undefined | boolean | string;
371
384
 
372
385
  declare function mergeRefs<T>(...refs: Array<null | undefined | Ref<T>>): (node: T) => void;
386
+ declare function assignRef<T>(ref: Ref<T> | undefined, value: T): void;
373
387
 
374
388
  declare function renderChildren(node: ReactNode): null | ReactElement;
375
389
 
@@ -394,4 +408,4 @@ interface VisibilityObserverProps extends VisibilityObserverOptions {
394
408
  }
395
409
  declare function VisibilityObserver({ render, onChange, ...options }: VisibilityObserverProps): null | ReactElement;
396
410
 
397
- 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 };
411
+ 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, assignRef, isColorProp, isEmptyReactNode, mergeRefs, parseAlignProp, parseCollapsedBelow, parseResponsiveProp, parseSpaceProp, renderChildren, useCollapseBreakpoint, useResponsiveContext, useResponsiveProp, useResponsivePropRecord, useResponsiveValue, useSnackbarStack, useUID, useVisibilityObserver };