@superdispatch/ui 0.13.0 → 0.16.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist-node/index.js +4051 -508
  2. package/dist-node/index.js.map +1 -1
  3. package/dist-src/dialog/DialogOverrides.js +8 -0
  4. package/dist-src/index.js +3 -1
  5. package/dist-src/info-card/InfoCard.js +1 -11
  6. package/dist-src/utils/mergeRefs.js +10 -7
  7. package/dist-src/v5/adaptive-toolbar/AdaptiveToolbar.js +146 -0
  8. package/dist-src/v5/app-bar/AppBarOverrides.js +9 -0
  9. package/dist-src/v5/autocomplete/AutocompleteOverrides.js +63 -0
  10. package/dist-src/v5/avatar/AvatarOverrides.js +21 -0
  11. package/dist-src/v5/avatar-button/AvatarButton.js +146 -0
  12. package/dist-src/v5/button/Button.js +32 -0
  13. package/dist-src/v5/button/ButtonOverrides.js +238 -0
  14. package/dist-src/v5/card/CardOverrides.js +16 -0
  15. package/dist-src/v5/card-button/CardButton.js +135 -0
  16. package/dist-src/v5/checkbox/CheckboxField.js +37 -0
  17. package/dist-src/v5/checkbox/CheckboxGroudField.js +32 -0
  18. package/dist-src/v5/checkbox/CheckboxOverrides.js +71 -0
  19. package/dist-src/v5/chip/ChipOverrides.js +106 -0
  20. package/dist-src/v5/columns/Column.js +75 -0
  21. package/dist-src/v5/columns/Columns.js +28 -0
  22. package/dist-src/v5/description-list/DescriptionList.js +114 -0
  23. package/dist-src/v5/dialog/DialogOverrides.js +43 -0
  24. package/dist-src/v5/drawer/DrawerActions.js +69 -0
  25. package/dist-src/v5/drawer/DrawerContent.js +15 -0
  26. package/dist-src/v5/drawer/DrawerList.js +31 -0
  27. package/dist-src/v5/drawer/DrawerOverrides.js +17 -0
  28. package/dist-src/v5/drawer/DrawerTitle.js +119 -0
  29. package/dist-src/v5/grid/GridStack.js +33 -0
  30. package/dist-src/v5/grid/InlineGrid.js +34 -0
  31. package/dist-src/v5/icon-button/IconButtonOverrides.js +60 -0
  32. package/dist-src/v5/index.js +38 -0
  33. package/dist-src/v5/info-card/InfoCard.js +59 -0
  34. package/dist-src/v5/inline/Inline.js +56 -0
  35. package/dist-src/v5/link/LinkOverrides.js +46 -0
  36. package/dist-src/v5/list/ListOverrides.js +16 -0
  37. package/dist-src/v5/menu/MenuOverrides.js +34 -0
  38. package/dist-src/v5/overflow-text/OverflowText.js +84 -0
  39. package/dist-src/v5/pagination/PaginationOverrides.js +35 -0
  40. package/dist-src/v5/paper/PaperOverrides.js +13 -0
  41. package/dist-src/v5/props/AlignProps.js +15 -0
  42. package/dist-src/v5/props/CollapseProp.js +3 -0
  43. package/dist-src/v5/props/ResponsiveProp.js +42 -0
  44. package/dist-src/v5/props/SpaceProp.js +28 -0
  45. package/dist-src/v5/radio/RadioField.js +36 -0
  46. package/dist-src/v5/radio/RadioGroupField.js +38 -0
  47. package/dist-src/v5/radio/RadioOverrides.js +49 -0
  48. package/dist-src/v5/responsive/CollapseBreakpoint.js +15 -0
  49. package/dist-src/v5/responsive/ResponsiveContext.js +31 -0
  50. package/dist-src/v5/snackbar/Snackbar.js +53 -0
  51. package/dist-src/v5/snackbar/SnackbarContent.js +105 -0
  52. package/dist-src/v5/snackbar/SnackbarOverrides.js +35 -0
  53. package/dist-src/v5/snackbar/SnackbarStack.js +113 -0
  54. package/dist-src/v5/stack/Stack.js +43 -0
  55. package/dist-src/v5/svg-icon/SvgIconOverrides.js +33 -0
  56. package/dist-src/v5/switch/SwitchOverrides.js +88 -0
  57. package/dist-src/v5/tabs/TabsOverrides.js +45 -0
  58. package/dist-src/v5/tag/Tag.js +118 -0
  59. package/dist-src/v5/text-field/TextFieldOverrides.js +205 -0
  60. package/dist-src/v5/theme/Color.js +77 -0
  61. package/dist-src/v5/theme/CssBaselineOverrides.js +8 -0
  62. package/dist-src/v5/theme/SuperDispatchTheme.js +2 -0
  63. package/dist-src/v5/theme/ThemeProvider.js +142 -0
  64. package/dist-src/v5/tiles/Tiles.js +94 -0
  65. package/dist-src/v5/toolbar/ToolbarOverrides.js +15 -0
  66. package/dist-src/v5/tooltip/TooltipOverrides.js +42 -0
  67. package/dist-src/v5/typography/TypographyOverrides.js +121 -0
  68. package/dist-src/v5/utils/VisibilityObserver.js +53 -0
  69. package/dist-src/v5/utils/isEmptyReactNode.js +3 -0
  70. package/dist-src/v5/utils/mergeRefs.js +20 -0
  71. package/dist-src/v5/utils/renderChildren.js +8 -0
  72. package/dist-src/v5/utils/useUID.js +6 -0
  73. package/dist-types/index.d.ts +643 -37
  74. package/dist-web/index.js +4214 -673
  75. package/dist-web/index.js.map +1 -1
  76. package/package.json +9 -3
@@ -0,0 +1,105 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["action", "children", "onClose", "className", "classes", "variant"],
4
+ _excluded2 = ["icon", "closeButton", "variantError", "variantSuccess"];
5
+ import { CheckCircle, Close, Warning } from '@mui/icons-material';
6
+ import { Grid, IconButton, SnackbarContent as MuiSnackbarContent } from '@mui/material';
7
+ import { makeStyles } from '@mui/styles';
8
+ import clsx from 'clsx';
9
+ import { forwardRef } from 'react';
10
+ import { Color } from "../theme/Color.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { Fragment as _Fragment } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ var useStyles = /*#__PURE__*/makeStyles(theme => ({
15
+ root: {
16
+ color: Color.White,
17
+ backgroundColor: Color.Dark500,
18
+ '&$variantError': {
19
+ color: Color.White,
20
+ backgroundColor: Color.Red500
21
+ }
22
+ },
23
+ action: {
24
+ paddingLeft: theme.spacing(1)
25
+ },
26
+ message: {
27
+ alignItems: 'center',
28
+ [theme.breakpoints.down('xs')]: {
29
+ fontSize: theme.spacing(2)
30
+ }
31
+ },
32
+ icon: {
33
+ marginRight: theme.spacing(1),
34
+ fontSize: theme.spacing(3)
35
+ },
36
+ closeButton: {
37
+ color: Color.White40,
38
+ '&:hover, &:focus': {
39
+ backgroundColor: Color.White08,
40
+ color: Color.White40
41
+ }
42
+ },
43
+ variantError: {},
44
+ variantSuccess: {}
45
+ }), {
46
+ name: 'SD-SnackbarContent'
47
+ });
48
+ export var SnackbarContent = /*#__PURE__*/forwardRef((_ref, ref) => {
49
+ var {
50
+ action,
51
+ children,
52
+ onClose,
53
+ className,
54
+ classes,
55
+ variant = 'default'
56
+ } = _ref,
57
+ props = _objectWithoutProperties(_ref, _excluded);
58
+
59
+ var _useStyles = useStyles({
60
+ classes
61
+ }),
62
+ {
63
+ icon,
64
+ closeButton,
65
+ variantError,
66
+ variantSuccess
67
+ } = _useStyles,
68
+ styles = _objectWithoutProperties(_useStyles, _excluded2);
69
+
70
+ var Icon = variant === 'error' ? Warning : variant === 'success' ? CheckCircle : undefined;
71
+ return /*#__PURE__*/_jsx(MuiSnackbarContent, _objectSpread(_objectSpread({}, props), {}, {
72
+ ref: ref,
73
+ classes: styles,
74
+ className: clsx(className, {
75
+ 'error': variantError,
76
+ 'success': variantSuccess
77
+ }[variant]),
78
+ message: /*#__PURE__*/_jsxs(_Fragment, {
79
+ children: [Icon && /*#__PURE__*/_jsx(Icon, {
80
+ className: icon
81
+ }), children]
82
+ }),
83
+ action: !action && !onClose ? null : /*#__PURE__*/_jsxs(Grid, {
84
+ container: true,
85
+ spacing: 1,
86
+ alignItems: "center",
87
+ wrap: "nowrap",
88
+ children: [!!action && /*#__PURE__*/_jsx(Grid, {
89
+ item: true,
90
+ children: action
91
+ }), onClose && /*#__PURE__*/_jsx(Grid, {
92
+ item: true,
93
+ children: /*#__PURE__*/_jsx(IconButton, {
94
+ "aria-label": "close",
95
+ onClick: onClose,
96
+ className: closeButton,
97
+ children: /*#__PURE__*/_jsx(Close, {
98
+ fontSize: "small"
99
+ })
100
+ })
101
+ })]
102
+ })
103
+ }));
104
+ });
105
+ if (process.env.NODE_ENV !== "production") SnackbarContent.displayName = "SnackbarContent";
@@ -0,0 +1,35 @@
1
+ export function overrideSnackbar(theme) {
2
+ theme.components.MuiSnackbar = {
3
+ defaultProps: {
4
+ anchorOrigin: {
5
+ vertical: 'bottom',
6
+ horizontal: 'center'
7
+ }
8
+ },
9
+ styleOverrides: {
10
+ anchorOriginBottomCenter: {
11
+ left: 0,
12
+ right: 0,
13
+ bottom: 0
14
+ }
15
+ }
16
+ };
17
+ theme.components.MuiSnackbarContent = {
18
+ styleOverrides: {
19
+ root: {
20
+ width: '100%',
21
+ borderRadius: 0,
22
+ minHeight: theme.spacing(7.5),
23
+ [theme.breakpoints.up('sm')]: {
24
+ width: theme.spacing(54),
25
+ maxWidth: theme.spacing(54),
26
+ borderRadius: theme.spacing(0.5)
27
+ }
28
+ },
29
+ message: {
30
+ flex: 1,
31
+ display: 'flex'
32
+ }
33
+ }
34
+ };
35
+ }
@@ -0,0 +1,113 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["onClose", "variant", "key", "id", "autoHideDuration"];
4
+ import { useDeepEqualMemo } from '@superdispatch/hooks';
5
+ import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
6
+ import { Snackbar } from "./Snackbar.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+
10
+ function warnContext() {
11
+ // eslint-disable-next-line no-console
12
+ console.log('`useSnackbarStack` is used outside of `SnackbarStackProvider`.');
13
+ }
14
+
15
+ var Context = /*#__PURE__*/createContext({
16
+ clearStack: warnContext,
17
+ addSnackbar: () => {
18
+ warnContext();
19
+ return warnContext;
20
+ }
21
+ });
22
+ export function useSnackbarStack() {
23
+ return useContext(Context);
24
+ }
25
+ export function SnackbarStackConsumer(_ref) {
26
+ var {
27
+ children
28
+ } = _ref;
29
+ return /*#__PURE__*/_jsx(Context.Consumer, {
30
+ children: children
31
+ });
32
+ }
33
+ var TRANSIENT_KEY = '@@transient@@';
34
+ export function SnackbarStackProvider(_ref2) {
35
+ var {
36
+ children
37
+ } = _ref2;
38
+ var [stack, setStack] = useState(new Map());
39
+ var transientKeyRef = useRef(0);
40
+ var getNextTransientKey = useCallback(() => TRANSIENT_KEY + String(transientKeyRef.current += 1), []);
41
+ var clearStack = useCallback(() => {
42
+ setStack(x => x.size === 0 ? x : new Map());
43
+ }, []);
44
+ var addSnackbar = useCallback(function (message) {
45
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
46
+ {
47
+ onClose: _onClose,
48
+ variant,
49
+ key = variant !== 'error' ? // We don't want non error snackbars without key to pop back.
50
+ getNextTransientKey() : typeof message === 'string' ? message : Math.random(),
51
+ id = String(key),
52
+ autoHideDuration = 5000
53
+ } = _ref3,
54
+ props = _objectWithoutProperties(_ref3, _excluded);
55
+
56
+ function removeSnackbar() {
57
+ setStack(prev => {
58
+ if (prev.has(key)) {
59
+ var next = new Map(prev);
60
+ next.delete(key);
61
+ return next;
62
+ }
63
+
64
+ return prev;
65
+ });
66
+ }
67
+
68
+ setStack(prev => {
69
+ var next = new Map(prev);
70
+
71
+ for (var prevKey of prev.keys()) {
72
+ // Ensure that we insert value to the end of the map.
73
+ if (Object.is(key, prevKey)) {
74
+ next.delete(key);
75
+ } // Ensure that transient snackbar will not pop back.
76
+
77
+
78
+ if (typeof prevKey == 'string' && prevKey.startsWith(TRANSIENT_KEY)) {
79
+ next.delete(prevKey);
80
+ }
81
+ }
82
+
83
+ return next.set(key, _objectSpread(_objectSpread({}, props), {}, {
84
+ id,
85
+ key,
86
+ variant,
87
+ autoHideDuration,
88
+ children: message,
89
+ onClose: reason => {
90
+ removeSnackbar();
91
+ _onClose === null || _onClose === void 0 ? void 0 : _onClose(reason);
92
+ }
93
+ }));
94
+ });
95
+ return removeSnackbar;
96
+ }, [getNextTransientKey]);
97
+ var snackbarProps = useDeepEqualMemo(prev => {
98
+ var next = Array.from(stack.values()).pop();
99
+ return next ? _objectSpread(_objectSpread({}, next), {}, {
100
+ open: true
101
+ }) : _objectSpread(_objectSpread({}, prev), {}, {
102
+ open: false
103
+ });
104
+ }, [stack]);
105
+ var api = useMemo(() => ({
106
+ clearStack,
107
+ addSnackbar
108
+ }), [clearStack, addSnackbar]);
109
+ return /*#__PURE__*/_jsxs(Context.Provider, {
110
+ value: api,
111
+ children: [children, /*#__PURE__*/_jsx(Snackbar, _objectSpread({}, snackbarProps))]
112
+ });
113
+ }
@@ -0,0 +1,43 @@
1
+ import { forwardRef } from 'react';
2
+ import flattenChildren from 'react-keyed-flatten-children';
3
+ import styled, { css } from 'styled-components';
4
+ import { parseAlignProp } from "../props/AlignProps.js";
5
+ import { parseResponsiveProp } from "../props/ResponsiveProp.js";
6
+ import { parseSpaceProp } from "../props/SpaceProp.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+
9
+ function stackItemMixin(space, align) {
10
+ return css(["flex-direction:column;align-items:", ";display:", ";&:empty{display:none;}&:not(:empty) ~ div{padding-top:", "px;}"], parseAlignProp(align), align === 'left' ? 'block' : 'flex', parseSpaceProp(space));
11
+ }
12
+
13
+ var StackRoot = /*#__PURE__*/styled.div.withConfig({
14
+ displayName: "Stack__StackRoot",
15
+ componentId: "SD__sc-dmzxni-0"
16
+ })(_ref => {
17
+ var {
18
+ theme,
19
+ space,
20
+ align
21
+ } = _ref;
22
+ return css(["width:100%;& > div{", ";", "{", ";}", "{", ";}}"], stackItemMixin(space[0], align[0]), theme.breakpoints.up('sm'), stackItemMixin(space[1], align[1]), theme.breakpoints.up('md'), stackItemMixin(space[2], align[2]));
23
+ });
24
+ export var Stack = /*#__PURE__*/forwardRef((_ref2, ref) => {
25
+ var {
26
+ children,
27
+ 'aria-label': ariaLabel,
28
+ 'aria-labelledby': ariaLabelledBy,
29
+ space = 'xsmall',
30
+ align = 'left'
31
+ } = _ref2;
32
+ return /*#__PURE__*/_jsx(StackRoot, {
33
+ ref: ref,
34
+ align: parseResponsiveProp(align),
35
+ space: parseResponsiveProp(space),
36
+ "aria-label": ariaLabel,
37
+ "aria-labelledby": ariaLabelledBy,
38
+ children: flattenChildren(children).map((child, idx) => /*#__PURE__*/_jsx("div", {
39
+ children: child
40
+ }, idx))
41
+ });
42
+ });
43
+ if (process.env.NODE_ENV !== "production") Stack.displayName = "Stack";
@@ -0,0 +1,33 @@
1
+ import { Color } from "../theme/Color.js";
2
+ export function overrideSvgIcon(theme) {
3
+ var sm = theme.breakpoints.up('sm');
4
+ theme.components.MuiSvgIcon = {
5
+ styleOverrides: {
6
+ root: {
7
+ display: 'inherit',
8
+ fontSize: 'var(--mui-svg-icon-size, 32px)',
9
+ [sm]: {
10
+ fontSize: 'var(--mui-svg-icon-size, 24px)'
11
+ }
12
+ },
13
+ fontSizeInherit: {
14
+ fontSize: 'inherit',
15
+ [sm]: {
16
+ fontSize: 'inherit'
17
+ }
18
+ },
19
+ fontSizeSmall: {
20
+ fontSize: 'var(--mui-svg-icon-size, 24px)',
21
+ [sm]: {
22
+ fontSize: 'var(--mui-svg-icon-size, 16px)'
23
+ }
24
+ },
25
+ fontSizeLarge: {
26
+ fontSize: 'var(--mui-svg-icon-size, 32px)'
27
+ },
28
+ colorAction: {
29
+ color: Color.Dark100
30
+ }
31
+ }
32
+ };
33
+ }
@@ -0,0 +1,88 @@
1
+ import { switchClasses } from '@mui/material';
2
+ import { Color } from "../theme/Color.js";
3
+ export function overrideSwitch(theme) {
4
+ var sm = theme.breakpoints.up('sm');
5
+ theme.components.MuiSwitch = {
6
+ defaultProps: {
7
+ color: 'primary',
8
+ disableRipple: true,
9
+ disableFocusRipple: true
10
+ },
11
+ styleOverrides: {
12
+ root: {
13
+ width: theme.spacing(9.5),
14
+ height: theme.spacing(5.5),
15
+ padding: theme.spacing(0.75, 1.5),
16
+ [sm]: {
17
+ width: theme.spacing(8),
18
+ height: theme.spacing(4),
19
+ padding: theme.spacing(0.5, 1.5)
20
+ }
21
+ },
22
+ track: {
23
+ opacity: 1,
24
+ boxShadow: "0 0 0 0 ".concat(Color.Transparent),
25
+ transition: theme.transitions.create(['box-shadow', 'background-color'], {
26
+ duration: theme.transitions.duration.shortest
27
+ }),
28
+ borderRadius: theme.spacing(2),
29
+ [sm]: {
30
+ borderRadius: theme.spacing(1.625)
31
+ }
32
+ },
33
+ thumb: {
34
+ color: Color.White,
35
+ boxShadow: 'none',
36
+ width: theme.spacing(3),
37
+ height: theme.spacing(3),
38
+ [sm]: {
39
+ width: theme.spacing(2),
40
+ height: theme.spacing(2)
41
+ }
42
+ },
43
+ switchBase: {
44
+ left: theme.spacing(1),
45
+ padding: theme.spacing(1.25, 1),
46
+ [sm]: {
47
+ padding: theme.spacing(1)
48
+ },
49
+ ["&.".concat(switchClasses.checked)]: {
50
+ transform: "translateX(".concat(theme.spacing(2.5), ")"),
51
+ [sm]: {
52
+ transform: "translateX(".concat(theme.spacing(2), ")")
53
+ }
54
+ },
55
+ ["&.".concat(switchClasses.checked, " + .").concat(switchClasses.track)]: {
56
+ opacity: 1
57
+ },
58
+ ["&.".concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
59
+ opacity: 1
60
+ }
61
+ },
62
+ colorPrimary: {
63
+ ["&.".concat(switchClasses.checked)]: {
64
+ '&:hover': {
65
+ ["& + .".concat(switchClasses.track)]: {
66
+ backgroundColor: Color.Blue400
67
+ }
68
+ }
69
+ },
70
+ ["& + .".concat(switchClasses.track)]: {
71
+ backgroundColor: Color.Silver500
72
+ },
73
+ ["&.".concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
74
+ backgroundColor: Color.Silver300
75
+ },
76
+ ["&.".concat(switchClasses.checked, ".").concat(switchClasses.disabled, " + .").concat(switchClasses.track)]: {
77
+ backgroundColor: Color.Blue100
78
+ },
79
+ ["&:hover + .".concat(switchClasses.track)]: {
80
+ backgroundColor: Color.Dark100
81
+ },
82
+ ["&.Mui-focusVisible + .".concat(switchClasses.track)]: {
83
+ boxShadow: "0 0 0 3px ".concat(Color.Blue100)
84
+ }
85
+ }
86
+ }
87
+ };
88
+ }
@@ -0,0 +1,45 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { Color } from "../theme/Color.js";
3
+ export function overrideTabs(theme) {
4
+ theme.components.MuiTabs = {
5
+ defaultProps: {
6
+ variant: 'scrollable',
7
+ textColor: 'primary',
8
+ indicatorColor: 'primary'
9
+ },
10
+ styleOverrides: {
11
+ root: {
12
+ minHeight: theme.spacing(6)
13
+ },
14
+ scrollButtons: {
15
+ opacity: 1,
16
+ color: Color.Dark100,
17
+ width: theme.spacing(4),
18
+ transition: theme.transitions.create('opacity', {
19
+ duration: theme.transitions.duration.short
20
+ })
21
+ }
22
+ }
23
+ };
24
+ theme.components.MuiTab = {
25
+ styleOverrides: {
26
+ root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
27
+ minHeight: theme.spacing(6),
28
+ transition: theme.transitions.create(['color'], {
29
+ duration: theme.transitions.duration.short
30
+ }),
31
+ [theme.breakpoints.up('sm')]: {
32
+ minWidth: 'unset',
33
+ fontSize: 'unset',
34
+ padding: theme.spacing(0.75, 3)
35
+ }
36
+ }),
37
+ textColorPrimary: {
38
+ color: Color.Dark500,
39
+ '&:hover, &:focus': {
40
+ color: Color.Blue300
41
+ }
42
+ }
43
+ }
44
+ };
45
+ }
@@ -0,0 +1,118 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
4
+ import { Typography } from '@mui/material';
5
+ import { makeStyles } from '@mui/styles';
6
+ import cx from 'clsx';
7
+ import { forwardRef } from 'react';
8
+ import { Color } from "../theme/Color.js";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ var useStyles = /*#__PURE__*/makeStyles(theme => ({
11
+ root: {
12
+ maxWidth: '100%',
13
+ alignItems: 'center',
14
+ display: 'inline-flex',
15
+ borderRadius: theme.spacing(0.5),
16
+ padding: theme.spacing(0, 0.5)
17
+ },
18
+ variantSubtle: {
19
+ '&$colorGrey': {
20
+ color: Color.Dark300,
21
+ backgroundColor: Color.Silver200
22
+ },
23
+ '&$colorBlue': {
24
+ color: Color.Blue500,
25
+ backgroundColor: Color.Blue50
26
+ },
27
+ '&$colorGreen': {
28
+ color: Color.Green500,
29
+ backgroundColor: Color.Green50
30
+ },
31
+ '&$colorPurple': {
32
+ color: Color.Purple500,
33
+ backgroundColor: Color.Purple50
34
+ },
35
+ '&$colorRed': {
36
+ color: Color.Red500,
37
+ backgroundColor: Color.Red50
38
+ },
39
+ '&$colorTeal': {
40
+ color: Color.Teal500,
41
+ backgroundColor: Color.Teal50
42
+ },
43
+ '&$colorYellow': {
44
+ color: Color.Yellow500,
45
+ backgroundColor: Color.Yellow50
46
+ }
47
+ },
48
+ variantBold: {
49
+ color: Color.White,
50
+ '&$colorGrey': {
51
+ backgroundColor: Color.Dark300
52
+ },
53
+ '&$colorBlue': {
54
+ backgroundColor: Color.Blue500
55
+ },
56
+ '&$colorGreen': {
57
+ backgroundColor: Color.Green500
58
+ },
59
+ '&$colorPurple': {
60
+ backgroundColor: Color.Purple500
61
+ },
62
+ '&$colorRed': {
63
+ backgroundColor: Color.Red500
64
+ },
65
+ '&$colorTeal': {
66
+ backgroundColor: Color.Teal500
67
+ },
68
+ '&$colorYellow': {
69
+ backgroundColor: Color.Yellow500
70
+ }
71
+ },
72
+ colorGrey: {},
73
+ colorBlue: {},
74
+ colorGreen: {},
75
+ colorPurple: {},
76
+ colorRed: {},
77
+ colorTeal: {},
78
+ colorYellow: {}
79
+ }), {
80
+ name: 'SD-Tag'
81
+ });
82
+ export var Tag = /*#__PURE__*/forwardRef((_ref, ref) => {
83
+ var {
84
+ color,
85
+ variant,
86
+ children,
87
+ classes,
88
+ className,
89
+ noWrap = true,
90
+ fontWeight = 'bold',
91
+ component = 'div'
92
+ } = _ref,
93
+ props = _objectWithoutProperties(_ref, _excluded);
94
+
95
+ var styles = useStyles({
96
+ classes
97
+ });
98
+ return /*#__PURE__*/_jsx(Typography, _objectSpread(_objectSpread({}, props), {}, {
99
+ ref: ref,
100
+ noWrap: noWrap,
101
+ component: component,
102
+ variant: fontWeight === 'bold' ? 'body1' : 'body2',
103
+ className: cx(styles.root, className, {
104
+ 'grey': styles.colorGrey,
105
+ 'blue': styles.colorBlue,
106
+ 'green': styles.colorGreen,
107
+ 'purple': styles.colorPurple,
108
+ 'red': styles.colorRed,
109
+ 'teal': styles.colorTeal,
110
+ 'yellow': styles.colorYellow
111
+ }[color], {
112
+ 'subtle': styles.variantSubtle,
113
+ 'bold': styles.variantBold
114
+ }[variant]),
115
+ children: children
116
+ }));
117
+ });
118
+ if (process.env.NODE_ENV !== "production") Tag.displayName = "Tag";