@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,59 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["size", "square", "classes", "children", "className", "CardContentProps"];
4
+ import { Card, CardContent, styled } from '@mui/material';
5
+ import { forwardRef, useState } from 'react';
6
+ import { assignRef } from "../utils/mergeRefs.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ var StyledCardContent = /*#__PURE__*/styled(CardContent)(_ref => {
9
+ var {
10
+ theme
11
+ } = _ref;
12
+ return {
13
+ padding: theme.spacing(2)
14
+ };
15
+ });
16
+ var StyledCard = /*#__PURE__*/styled(Card)(_ref2 => {
17
+ var {
18
+ theme
19
+ } = _ref2;
20
+ return {
21
+ '&[data-full-width="true"]': {
22
+ borderRadius: 0,
23
+ borderLeftWidth: 0,
24
+ borderRightWidth: 0
25
+ },
26
+ ["&[data-size=\"large\"] > ".concat(StyledCardContent)]: {
27
+ [theme.breakpoints.up('sm')]: {
28
+ padding: theme.spacing(3)
29
+ }
30
+ }
31
+ };
32
+ });
33
+ export var InfoCard = /*#__PURE__*/forwardRef((_ref3, _ref4) => {
34
+ var {
35
+ size,
36
+ square,
37
+ classes,
38
+ children,
39
+ className,
40
+ CardContentProps: cardContentProps = {}
41
+ } = _ref3,
42
+ props = _objectWithoutProperties(_ref3, _excluded);
43
+
44
+ var [rootNode, setRootNode] = useState(null);
45
+ var clientRect = rootNode === null || rootNode === void 0 ? void 0 : rootNode.getBoundingClientRect();
46
+ var isFullWidth = (clientRect === null || clientRect === void 0 ? void 0 : clientRect.width) === window.innerWidth;
47
+ return /*#__PURE__*/_jsx(StyledCard, _objectSpread(_objectSpread({}, props), {}, {
48
+ ref: node => {
49
+ assignRef(_ref4, node);
50
+ setRootNode(node);
51
+ },
52
+ "data-size": size,
53
+ "data-full-width": isFullWidth,
54
+ children: /*#__PURE__*/_jsx(StyledCardContent, _objectSpread(_objectSpread({}, cardContentProps), {}, {
55
+ children: children
56
+ }))
57
+ }));
58
+ });
59
+ if (process.env.NODE_ENV !== "production") InfoCard.displayName = "InfoCard";
@@ -0,0 +1,56 @@
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 { useResponsiveProp } from "../props/ResponsiveProp.js";
6
+ import { parseSpaceProp } from "../props/SpaceProp.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+
9
+ function inlineRootMixin(spaceProp, noWrap, verticalAlign, horizontalAlign) {
10
+ var space = parseSpaceProp(spaceProp);
11
+ return css(["&:before{margin-top:", "px;}& > div{display:flex;margin-left:-", "px;flex-wrap:", ";align-items:", ";justify-content:", ";& > div{&:empty{display:none;}min-width:0;flex-shrink:0;max-width:100%;margin-top:", "px;margin-left:", "px;}}"], -space - 1, space, noWrap ? 'nowrap' : 'wrap', parseAlignProp(verticalAlign), parseAlignProp(horizontalAlign), space, space);
12
+ }
13
+
14
+ var InlineRoot = /*#__PURE__*/styled.div.withConfig({
15
+ displayName: "Inline__InlineRoot",
16
+ componentId: "SD__sc-1tgkwtt-0"
17
+ })(_ref => {
18
+ var {
19
+ theme,
20
+ space,
21
+ noWrap,
22
+ verticalAlign,
23
+ horizontalAlign
24
+ } = _ref;
25
+ return css(["padding-top:1px;&:before{content:'';display:block;}", " ", "{", "}", "{", "}"], inlineRootMixin(space[0], noWrap[0], verticalAlign[0], horizontalAlign[0]), theme.breakpoints.up('sm'), inlineRootMixin(space[1], noWrap[1], verticalAlign[1], horizontalAlign[1]), theme.breakpoints.up('md'), inlineRootMixin(space[2], noWrap[2], verticalAlign[2], horizontalAlign[2]));
26
+ });
27
+ export var Inline = /*#__PURE__*/forwardRef((_ref2, ref) => {
28
+ var {
29
+ children,
30
+ 'aria-label': ariaLabel,
31
+ 'aria-labelledby': ariaLabelledBy,
32
+ noWrap: noWrapProp = false,
33
+ space: spaceProp = 'xsmall',
34
+ verticalAlign: verticalAlignProp = 'top',
35
+ horizontalAlign: horizontalAlignProp = 'left'
36
+ } = _ref2;
37
+ var space = useResponsiveProp(spaceProp);
38
+ var noWrap = useResponsiveProp(noWrapProp);
39
+ var verticalAlign = useResponsiveProp(verticalAlignProp);
40
+ var horizontalAlign = useResponsiveProp(horizontalAlignProp);
41
+ return /*#__PURE__*/_jsx(InlineRoot, {
42
+ ref: ref,
43
+ space: space,
44
+ noWrap: noWrap,
45
+ verticalAlign: verticalAlign,
46
+ horizontalAlign: horizontalAlign,
47
+ "aria-label": ariaLabel,
48
+ "aria-labelledby": ariaLabelledBy,
49
+ children: /*#__PURE__*/_jsx("div", {
50
+ children: flattenChildren(children).map((child, idx) => /*#__PURE__*/_jsx("div", {
51
+ children: child
52
+ }, idx))
53
+ })
54
+ });
55
+ });
56
+ if (process.env.NODE_ENV !== "production") Inline.displayName = "Inline";
@@ -0,0 +1,46 @@
1
+ import { Color } from "../theme/Color.js";
2
+
3
+ function line(color) {
4
+ return "linear-gradient(to right, ".concat(color, " 0%, ").concat(color, " 100%)");
5
+ }
6
+
7
+ export function overrideLink(theme) {
8
+ theme.components.MuiLink = {
9
+ defaultProps: {
10
+ underline: 'none',
11
+ color: 'textPrimary'
12
+ },
13
+ styleOverrides: {
14
+ root: {
15
+ backgroundSize: '100% 1px',
16
+ backgroundRepeat: 'repeat-x',
17
+ backgroundPosition: '0 100%',
18
+ backgroundColor: Color.Transparent,
19
+ '&:focus': {
20
+ outline: 'none'
21
+ },
22
+ '&:hover, &:active': {
23
+ backgroundImage: line('currentColor')
24
+ }
25
+ },
26
+ // @ts-expect-error type def need in patch-package
27
+ colorTextPrimary: {
28
+ backgroundImage: line(Color.Silver500),
29
+ '&:focus, &:hover, &:active': {
30
+ color: Color.Blue300,
31
+ backgroundImage: line(Color.Blue300)
32
+ }
33
+ },
34
+ button: {
35
+ // Reset button styles.
36
+ backgroundColor: 'unset',
37
+ // Override browser defaults.
38
+ fontSize: 'inherit',
39
+ textAlign: 'inherit',
40
+ lineHeight: 'inherit',
41
+ userSelect: 'inherit',
42
+ verticalAlign: 'inherit'
43
+ }
44
+ }
45
+ };
46
+ }
@@ -0,0 +1,16 @@
1
+ import { listItemClasses } from '@mui/material';
2
+ import { Color } from "../theme/Color.js";
3
+ export function overrideList(theme) {
4
+ theme.components.MuiListItem = {
5
+ styleOverrides: {
6
+ root: {
7
+ ["&.".concat(listItemClasses.selected, ", &.").concat(listItemClasses.selected, ":hover")]: {
8
+ backgroundColor: Color.Blue50
9
+ },
10
+ '& .MuiTouchRipple-root': {
11
+ color: Color.Blue100
12
+ }
13
+ }
14
+ }
15
+ };
16
+ }
@@ -0,0 +1,34 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { menuItemClasses } from '@mui/material';
3
+ import { Color } from "../../theme/Color.js";
4
+ export function overrideMenu(theme) {
5
+ theme.components.MuiMenu = {
6
+ defaultProps: {
7
+ anchorOrigin: {
8
+ vertical: 'bottom',
9
+ horizontal: 'left'
10
+ },
11
+ transformOrigin: {
12
+ vertical: 'top',
13
+ horizontal: 'left'
14
+ }
15
+ }
16
+ };
17
+ theme.components.MuiMenuItem = {
18
+ styleOverrides: {
19
+ root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
20
+ paddingTop: theme.spacing(1),
21
+ paddingBottom: theme.spacing(1),
22
+ '& .MuiTouchRipple-root': {
23
+ color: Color.Blue100
24
+ },
25
+ ["&.".concat(menuItemClasses.selected, ", &.").concat(menuItemClasses.selected, ":hover")]: {
26
+ backgroundColor: Color.Blue50,
27
+ ["&.".concat(menuItemClasses.focusVisible)]: {
28
+ backgroundColor: Color.Blue50
29
+ }
30
+ }
31
+ })
32
+ }
33
+ };
34
+ }
@@ -0,0 +1,84 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
+ var _excluded = ["title", "enterDelay"],
4
+ _excluded2 = ["onClick", "children", "disableUnderline", "TooltipProps"];
5
+ import { styled, Tooltip, Typography } from '@mui/material';
6
+ import { forwardRef, useState } from 'react';
7
+ import { Color } from "../theme/Color.js";
8
+ import { VisibilityObserver } from "../utils/VisibilityObserver.js";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ var Root = /*#__PURE__*/styled(Typography, {
12
+ name: 'SD-OverflowText',
13
+ shouldForwardProp: prop => prop !== 'truncated'
14
+ })(_ref => {
15
+ var {
16
+ truncated,
17
+ theme
18
+ } = _ref;
19
+ return _objectSpread({
20
+ marginBottom: -1,
21
+ borderBottom: '1px dashed transparent',
22
+ transition: theme.transitions.create('border')
23
+ }, truncated && {
24
+ cursor: 'pointer',
25
+ borderBottomColor: Color.Silver500
26
+ });
27
+ });
28
+ var Sential = /*#__PURE__*/styled('span', {
29
+ name: 'SD-OverflowText',
30
+ slot: 'Sential'
31
+ })({
32
+ width: 1,
33
+ height: '100%',
34
+ display: 'inline-block'
35
+ });
36
+ export var OverflowText = /*#__PURE__*/forwardRef((_ref2, rootRef) => {
37
+ var {
38
+ onClick: _onClick,
39
+ children,
40
+ disableUnderline,
41
+ TooltipProps: {
42
+ title = children,
43
+ enterDelay = 1000
44
+ } = {}
45
+ } = _ref2,
46
+ tooltipProps = _objectWithoutProperties(_ref2.TooltipProps, _excluded),
47
+ props = _objectWithoutProperties(_ref2, _excluded2);
48
+
49
+ var [isOpen, setIsOpen] = useState(false);
50
+ return /*#__PURE__*/_jsx(VisibilityObserver, {
51
+ render: _ref3 => {
52
+ var {
53
+ ref,
54
+ visibility
55
+ } = _ref3;
56
+ var isTooltipEnabled = !!children && visibility === 'invisible';
57
+ return /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
58
+ enterDelay: 1000,
59
+ title: title || '',
60
+ disableFocusListener: true,
61
+ open: isOpen && isTooltipEnabled,
62
+ onOpen: () => {
63
+ setIsOpen(true);
64
+ },
65
+ onClose: () => {
66
+ setIsOpen(false);
67
+ },
68
+ children: /*#__PURE__*/_jsxs(Root, _objectSpread(_objectSpread({}, props), {}, {
69
+ ref: rootRef,
70
+ noWrap: true,
71
+ truncated: !disableUnderline && visibility === 'invisible',
72
+ onClick: event => {
73
+ setIsOpen(true);
74
+ _onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
75
+ },
76
+ children: [children, !!children && /*#__PURE__*/_jsx(Sential, {
77
+ ref: ref
78
+ })]
79
+ }))
80
+ }));
81
+ }
82
+ });
83
+ });
84
+ if (process.env.NODE_ENV !== "production") OverflowText.displayName = "OverflowText";
@@ -0,0 +1,35 @@
1
+ import { paginationItemClasses } from '@mui/material';
2
+ import { Color } from "../theme/Color.js";
3
+ export function overridePagination(theme) {
4
+ theme.components.MuiPaginationItem = {
5
+ styleOverrides: {
6
+ root: {
7
+ color: Color.Dark400
8
+ },
9
+ page: {
10
+ '&:hover': {
11
+ backgroundColor: Color.Silver200
12
+ },
13
+ ["&.".concat(paginationItemClasses.focusVisible)]: {
14
+ borderRadius: 4,
15
+ backgroundColor: Color.White,
16
+ border: "1px solid ".concat(Color.Blue100)
17
+ },
18
+ ["&.".concat(paginationItemClasses.selected)]: {
19
+ backgroundColor: Color.Silver400,
20
+ ["&:hover, &.".concat(paginationItemClasses.focusVisible)]: {
21
+ backgroundColor: Color.Silver400
22
+ },
23
+ ["&.".concat(paginationItemClasses.disabled)]: {
24
+ color: Color.Dark100,
25
+ backgroundColor: Color.Silver400
26
+ }
27
+ },
28
+ ["&.".concat(paginationItemClasses.disabled)]: {
29
+ opacity: 1,
30
+ color: Color.Dark100
31
+ }
32
+ }
33
+ }
34
+ };
35
+ }
@@ -0,0 +1,13 @@
1
+ import { Color } from "../theme/Color.js";
2
+ export function overridePaper(theme) {
3
+ theme.components.MuiPaper = {
4
+ defaultProps: {
5
+ elevation: 0
6
+ },
7
+ styleOverrides: {
8
+ elevation0: {
9
+ border: "1px solid ".concat(Color.Silver400)
10
+ }
11
+ }
12
+ };
13
+ }
@@ -0,0 +1,15 @@
1
+ export function parseAlignProp(align) {
2
+ switch (align) {
3
+ case 'top':
4
+ case 'left':
5
+ default:
6
+ return 'initial';
7
+
8
+ case 'center':
9
+ return 'center';
10
+
11
+ case 'right':
12
+ case 'bottom':
13
+ return 'flex-end';
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ export function parseCollapsedBelow(collapsedBelow) {
2
+ return [collapsedBelow === 'tablet' || collapsedBelow === 'desktop', collapsedBelow === 'desktop', false];
3
+ }
@@ -0,0 +1,42 @@
1
+ import { useDeepEqualValue } from '@superdispatch/hooks';
2
+ import { useResponsiveContext } from "../responsive/ResponsiveContext.js";
3
+ export function parseResponsiveProp(prop) {
4
+ var _tablet, _desktop;
5
+
6
+ if (typeof prop != 'object') return [prop, prop, prop];
7
+ var [mobile, tablet, desktop] = prop;
8
+ (_tablet = tablet) !== null && _tablet !== void 0 ? _tablet : tablet = mobile;
9
+ (_desktop = desktop) !== null && _desktop !== void 0 ? _desktop : desktop = tablet;
10
+ return [mobile, tablet, desktop];
11
+ }
12
+ export function useResponsiveProp(prop) {
13
+ return useDeepEqualValue(parseResponsiveProp(prop));
14
+ }
15
+ export function useResponsiveValue(xs, sm) {
16
+ var md = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : sm;
17
+ var lg = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : md;
18
+ var xl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : lg;
19
+ var {
20
+ breakpoint = 'xs'
21
+ } = useResponsiveContext();
22
+ return {
23
+ xs,
24
+ sm,
25
+ md,
26
+ lg,
27
+ xl
28
+ }[breakpoint];
29
+ }
30
+ export function useResponsivePropRecord(prop) {
31
+ if (typeof prop != 'object') prop = {
32
+ xs: prop
33
+ };
34
+ var {
35
+ xs,
36
+ sm,
37
+ md,
38
+ lg,
39
+ xl
40
+ } = prop;
41
+ return useResponsiveValue(xs, sm !== null && sm !== void 0 ? sm : xs, md, lg, xl);
42
+ }
@@ -0,0 +1,28 @@
1
+ export function parseSpaceProp(prop) {
2
+ switch (prop) {
3
+ case 'none':
4
+ default:
5
+ return 0;
6
+
7
+ case 'xxsmall':
8
+ return 4;
9
+
10
+ case 'xsmall':
11
+ return 8;
12
+
13
+ case 'small':
14
+ return 16;
15
+
16
+ case 'medium':
17
+ return 24;
18
+
19
+ case 'large':
20
+ return 32;
21
+
22
+ case 'xlarge':
23
+ return 40;
24
+
25
+ case 'xxlarge':
26
+ return 48;
27
+ }
28
+ }
@@ -0,0 +1,36 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["label", "error", "checked", "onBlur", "onChange", "helperText", "FormControlLabelProps"];
4
+ import { FormControl, FormControlLabel, FormHelperText, Radio } from '@mui/material';
5
+ import { forwardRef } from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ export var RadioField = /*#__PURE__*/forwardRef((_ref, ref) => {
9
+ var {
10
+ label,
11
+ error,
12
+ checked,
13
+ onBlur,
14
+ onChange,
15
+ helperText,
16
+ FormControlLabelProps: formControlLabelProps
17
+ } = _ref,
18
+ props = _objectWithoutProperties(_ref, _excluded);
19
+
20
+ return /*#__PURE__*/_jsxs(FormControl, {
21
+ error: error,
22
+ children: [/*#__PURE__*/_jsx(FormControlLabel, _objectSpread(_objectSpread({}, formControlLabelProps), {}, {
23
+ label: label,
24
+ checked: checked,
25
+ onBlur: onBlur,
26
+ onChange: onChange,
27
+ control: /*#__PURE__*/_jsx(Radio, _objectSpread({
28
+ ref: ref,
29
+ color: "primary"
30
+ }, props))
31
+ })), helperText && /*#__PURE__*/_jsx(FormHelperText, {
32
+ children: helperText
33
+ })]
34
+ });
35
+ });
36
+ if (process.env.NODE_ENV !== "production") RadioField.displayName = "RadioField";
@@ -0,0 +1,38 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["name", "value", "onChange", "RadioGroupProps", "label", "FormLabelProps", "helperText", "FormHelperTextProps", "children"];
4
+ import { FormControl, FormHelperText, FormLabel, RadioGroup } from '@mui/material';
5
+ import { forwardRef } from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ export var RadioGroupField = /*#__PURE__*/forwardRef((_ref, ref) => {
9
+ var {
10
+ name,
11
+ value = '',
12
+ onChange,
13
+ RadioGroupProps: radioGroupProps,
14
+ label,
15
+ FormLabelProps: formLabelProps,
16
+ helperText,
17
+ FormHelperTextProps: formHelperTextProps,
18
+ children
19
+ } = _ref,
20
+ formControlProps = _objectWithoutProperties(_ref, _excluded);
21
+
22
+ return /*#__PURE__*/_jsxs(FormControl, _objectSpread(_objectSpread({}, formControlProps), {}, {
23
+ hiddenLabel: !label,
24
+ children: [!!label && /*#__PURE__*/_jsx(FormLabel, _objectSpread(_objectSpread({}, formLabelProps), {}, {
25
+ children: label
26
+ })), /*#__PURE__*/_jsx(RadioGroup, _objectSpread(_objectSpread({
27
+ ref: ref
28
+ }, radioGroupProps), {}, {
29
+ name: name,
30
+ value: value,
31
+ onChange: onChange,
32
+ children: children
33
+ })), !!helperText && /*#__PURE__*/_jsx(FormHelperText, _objectSpread(_objectSpread({}, formHelperTextProps), {}, {
34
+ children: helperText
35
+ }))]
36
+ }));
37
+ });
38
+ if (process.env.NODE_ENV !== "production") RadioGroupField.displayName = "RadioGroupField";
@@ -0,0 +1,49 @@
1
+ import { radioClasses, SvgIcon } from '@mui/material';
2
+ import { Color } from "../theme/Color.js";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ export function overrideRadio(theme) {
6
+ theme.components.MuiRadio = {
7
+ defaultProps: {
8
+ color: 'primary',
9
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
10
+ children: /*#__PURE__*/_jsx("circle", {
11
+ cx: "12",
12
+ cy: "12",
13
+ r: "8.5",
14
+ fill: Color.White,
15
+ stroke: "currentColor"
16
+ })
17
+ }),
18
+ checkedIcon: /*#__PURE__*/_jsxs(SvgIcon, {
19
+ children: [/*#__PURE__*/_jsx("circle", {
20
+ cx: "12",
21
+ cy: "12",
22
+ r: "8.5",
23
+ fill: "currentColor",
24
+ stroke: "currentColor"
25
+ }), /*#__PURE__*/_jsx("circle", {
26
+ cx: "12",
27
+ cy: "12",
28
+ r: "4",
29
+ fill: Color.White
30
+ })]
31
+ })
32
+ },
33
+ styleOverrides: {
34
+ root: {
35
+ color: Color.Dark100,
36
+ marginTop: theme.spacing(-0.625),
37
+ marginBottom: theme.spacing(-0.625)
38
+ },
39
+ colorPrimary: {
40
+ ["&.".concat(radioClasses.disabled, ".").concat(radioClasses.checked)]: {
41
+ color: Color.Silver500
42
+ },
43
+ ["&:hover:not(.".concat(radioClasses.checked, ")")]: {
44
+ color: Color.Dark100
45
+ }
46
+ }
47
+ }
48
+ };
49
+ }
@@ -0,0 +1,15 @@
1
+ import { useResponsiveContext } from "./ResponsiveContext.js";
2
+ var BREAKPOINTS = ['xs', 'sm', 'md', 'lg', 'xl'];
3
+ export function useCollapseBreakpoint(collapseBreakpoint) {
4
+ var {
5
+ breakpoint = 'xs'
6
+ } = useResponsiveContext();
7
+
8
+ if (collapseBreakpoint == null) {
9
+ return false;
10
+ }
11
+
12
+ var breakpointIDX = BREAKPOINTS.indexOf(breakpoint);
13
+ var collapseBreakpointIDX = BREAKPOINTS.indexOf(collapseBreakpoint);
14
+ return breakpointIDX < collapseBreakpointIDX;
15
+ }
@@ -0,0 +1,31 @@
1
+ import { useMediaQuery } from '@mui/material';
2
+ import { createContext, useContext, useMemo } from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ var Context = /*#__PURE__*/createContext({});
5
+
6
+ function useBreakpoint(breakpoint) {
7
+ return useMediaQuery(theme => theme.breakpoints.only(breakpoint));
8
+ }
9
+
10
+ export function ResponsiveContextProvider(_ref) {
11
+ var {
12
+ children,
13
+ defaultBreakpoint
14
+ } = _ref;
15
+ var isXS = useBreakpoint('xs');
16
+ var isSM = useBreakpoint('sm');
17
+ var isMD = useBreakpoint('md');
18
+ var isLG = useBreakpoint('lg');
19
+ var isXL = useBreakpoint('xl');
20
+ var breakpoint = isXS ? 'xs' : isSM ? 'sm' : isMD ? 'md' : isLG ? 'lg' : isXL ? 'xl' : defaultBreakpoint;
21
+ var ctx = useMemo(() => ({
22
+ breakpoint
23
+ }), [breakpoint]);
24
+ return /*#__PURE__*/_jsx(Context.Provider, {
25
+ value: ctx,
26
+ children: children
27
+ });
28
+ }
29
+ export function useResponsiveContext() {
30
+ return useContext(Context);
31
+ }
@@ -0,0 +1,53 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
+ var _excluded = ["open", "action", "variant", "onClose", "children", "ContentProps", "hasCloseButton", "TransitionComponent"];
4
+ import { Portal, Slide, Snackbar as MaterialSnackbar } from '@mui/material';
5
+ import { forwardRef } from 'react';
6
+ import { SnackbarContent } from "./SnackbarContent.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+
9
+ function SlideTransition(props) {
10
+ return /*#__PURE__*/_jsx(Slide, _objectSpread(_objectSpread({}, props), {}, {
11
+ direction: "up"
12
+ }));
13
+ }
14
+
15
+ export var Snackbar = /*#__PURE__*/forwardRef((_ref, ref) => {
16
+ var {
17
+ open,
18
+ action,
19
+ variant,
20
+ onClose,
21
+ children,
22
+ ContentProps,
23
+ hasCloseButton = onClose != null,
24
+ TransitionComponent = SlideTransition
25
+ } = _ref,
26
+ props = _objectWithoutProperties(_ref, _excluded);
27
+
28
+ function handleClose(reason) {
29
+ if (reason !== 'clickaway') {
30
+ onClose === null || onClose === void 0 ? void 0 : onClose(reason === 'timeout' ? 'timeout' : 'explicit');
31
+ }
32
+ }
33
+
34
+ return /*#__PURE__*/_jsx(Portal, {
35
+ children: /*#__PURE__*/_jsx(MaterialSnackbar, _objectSpread(_objectSpread({}, props), {}, {
36
+ ref: ref,
37
+ open: open,
38
+ TransitionComponent: TransitionComponent,
39
+ onClose: (_, reason) => {
40
+ handleClose(reason);
41
+ },
42
+ children: /*#__PURE__*/_jsx(SnackbarContent, _objectSpread(_objectSpread({}, ContentProps), {}, {
43
+ action: action,
44
+ variant: variant,
45
+ onClose: !hasCloseButton ? undefined : () => {
46
+ handleClose('explicit');
47
+ },
48
+ children: children
49
+ }))
50
+ }))
51
+ });
52
+ });
53
+ if (process.env.NODE_ENV !== "production") Snackbar.displayName = "Snackbar";