@carto/meridian-ds 1.4.4-alpha-others.1 → 1.4.4-alpha-others.2

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 (90) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Alert-D8jI1sG4.js +134 -0
  3. package/dist/Alert-zqtoWsBL.cjs +133 -0
  4. package/dist/ArrowDown-8fLj23Ge.cjs +31 -0
  5. package/dist/ArrowDown-CY_wMVJT.js +32 -0
  6. package/dist/MenuItem-Br2jY2lt.cjs +164 -0
  7. package/dist/MenuItem-CXnnE5lK.js +165 -0
  8. package/dist/OpenDiagonallyRight-5HZXh46V.js +59 -0
  9. package/dist/OpenDiagonallyRight-BrRyCV4Q.cjs +58 -0
  10. package/dist/SwatchSquare-DDi0beUM.js +51 -0
  11. package/dist/SwatchSquare-w-U8-O-P.cjs +50 -0
  12. package/dist/TablePaginationActions-CFGXm44W.cjs +5661 -0
  13. package/dist/{TablePaginationActions-WZ3P4O35.js → TablePaginationActions-KpTvhN4Y.js} +1086 -656
  14. package/dist/components/index.cjs +4403 -1
  15. package/dist/components/index.js +3235 -1857
  16. package/dist/custom-icons/index.cjs +5857 -1
  17. package/dist/custom-icons/index.js +2658 -2326
  18. package/dist/paletteUtils-B9ybmwiI.cjs +304 -0
  19. package/dist/paletteUtils-BHqJlHm9.js +288 -0
  20. package/dist/theme/index.cjs +3135 -1
  21. package/dist/theme/index.js +1050 -1011
  22. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts +16 -0
  23. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts.map +1 -0
  24. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogConfirmation.d.ts +16 -0
  25. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogConfirmation.d.ts.map +1 -0
  26. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogContent.d.ts +10 -0
  27. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogContent.d.ts.map +1 -0
  28. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogError.d.ts +8 -0
  29. package/dist/types/components/organisms/CodeArea/CodeAreaDialog/CodeAreaDialogError.d.ts.map +1 -0
  30. package/dist/types/components/organisms/CodeArea/CodeAreaField.d.ts +4 -0
  31. package/dist/types/components/organisms/CodeArea/CodeAreaField.d.ts.map +1 -0
  32. package/dist/types/components/organisms/CodeArea/CodeAreaFooter.d.ts +12 -0
  33. package/dist/types/components/organisms/CodeArea/CodeAreaFooter.d.ts.map +1 -0
  34. package/dist/types/components/organisms/CodeArea/CodeAreaHeader.d.ts +9 -0
  35. package/dist/types/components/organisms/CodeArea/CodeAreaHeader.d.ts.map +1 -0
  36. package/dist/types/components/organisms/CodeArea/CodeAreaInput.d.ts +28 -0
  37. package/dist/types/components/organisms/CodeArea/CodeAreaInput.d.ts.map +1 -0
  38. package/dist/types/components/organisms/CodeArea/CodeAreaTheme.d.ts +7 -0
  39. package/dist/types/components/organisms/CodeArea/CodeAreaTheme.d.ts.map +1 -0
  40. package/dist/types/components/organisms/CodeArea/index.d.ts +9 -0
  41. package/dist/types/components/organisms/CodeArea/index.d.ts.map +1 -0
  42. package/dist/types/components/organisms/CodeArea/types.d.ts +38 -0
  43. package/dist/types/components/organisms/CodeArea/types.d.ts.map +1 -0
  44. package/dist/types/components/organisms/CodeArea/utils.d.ts +5 -0
  45. package/dist/types/components/organisms/CodeArea/utils.d.ts.map +1 -0
  46. package/dist/types/components/organisms/index.d.ts +2 -0
  47. package/dist/types/components/organisms/index.d.ts.map +1 -1
  48. package/dist/types/localization/en.d.ts +6 -0
  49. package/dist/types/localization/en.d.ts.map +1 -1
  50. package/dist/types/localization/es.d.ts +6 -0
  51. package/dist/types/localization/es.d.ts.map +1 -1
  52. package/dist/types/localization/id.d.ts +6 -0
  53. package/dist/types/localization/id.d.ts.map +1 -1
  54. package/dist/types/localization/index.d.ts +18 -0
  55. package/dist/types/localization/index.d.ts.map +1 -1
  56. package/dist/types/utils/chartConstants.d.ts +3 -3
  57. package/dist/types/utils/chartConstants.d.ts.map +1 -1
  58. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts +2 -2
  59. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts.map +1 -1
  60. package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts +2 -2
  61. package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts.map +1 -1
  62. package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts +2 -2
  63. package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts.map +1 -1
  64. package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.d.ts.map +1 -1
  65. package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts +2 -5
  66. package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts.map +1 -1
  67. package/dist/types/widgets/TimeSeriesWidgetUI/timeSeriesUtils.d.ts +7 -0
  68. package/dist/types/widgets/TimeSeriesWidgetUI/timeSeriesUtils.d.ts.map +1 -1
  69. package/dist/types/widgets/TimeSeriesWidgetUI/types.d.ts +6 -0
  70. package/dist/types/widgets/TimeSeriesWidgetUI/types.d.ts.map +1 -0
  71. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts +2 -2
  72. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
  73. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts +2 -2
  74. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts.map +1 -1
  75. package/dist/types/widgets/index.d.ts +1 -0
  76. package/dist/types/widgets/index.d.ts.map +1 -1
  77. package/dist/widgets/index.cjs +7192 -21
  78. package/dist/widgets/index.js +5182 -3806
  79. package/package.json +6 -1
  80. package/dist/Alert-BAvr1f31.js +0 -130
  81. package/dist/Alert-DPGMxifE.cjs +0 -4
  82. package/dist/ArrowDown-BD0WmQR3.cjs +0 -1
  83. package/dist/ArrowDown-CMhYkZ2p.js +0 -31
  84. package/dist/MenuItem-Cd34y6F3.js +0 -165
  85. package/dist/MenuItem-Dbss-WG1.cjs +0 -1
  86. package/dist/SwatchSquare-C34ayL4L.cjs +0 -1
  87. package/dist/SwatchSquare-CVpwEFFV.js +0 -48
  88. package/dist/TablePaginationActions-Bp1DCaIE.cjs +0 -9
  89. package/dist/paletteUtils-BEwZhrLg.js +0 -262
  90. package/dist/paletteUtils-DLQVT9qo.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - TimeSeriesWidgetUI: handle empty categories [#195](https://github.com/CartoDB/meridian-ds/pull/195)
6
+ - feat(widgets): Pie&Category widget acceps otherValues prop [#186](https://github.com/CartoDB/meridian-ds/pull/186)
7
+ - New CodeAreaField & CodeAreaDialog components [#175](https://github.com/CartoDB/meridian-ds/pull/175)
8
+ - Expose OrderTypes enum in widgets [#192](https://github.com/CartoDB/meridian-ds/pull/192)
5
9
  - New CopiableComponent component [#187](https://github.com/CartoDB/meridian-ds/pull/187)
10
+ - Expose OrderTypes enum in widgets [#192](https://github.com/CartoDB/meridian-ds/pull/192)
11
+ - Disable minification in published builds [#190](https://github.com/CartoDB/meridian-ds/pull/190)
6
12
 
7
13
  ## 1.0
8
14
 
@@ -0,0 +1,134 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-KpTvhN4Y.js";
3
+ import { styled, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
+ import { forwardRef, useState } from "react";
5
+ const StyledAlert = styled(Alert$1, {
6
+ shouldForwardProp: (prop) => ![
7
+ "isNeutral",
8
+ "content",
9
+ "hasCloseButton",
10
+ "hasAction",
11
+ "hasTitle",
12
+ "isSticky"
13
+ ].includes(prop)
14
+ })(
15
+ ({
16
+ isNeutral,
17
+ content,
18
+ hasCloseButton,
19
+ hasAction,
20
+ hasTitle,
21
+ isSticky,
22
+ theme
23
+ }) => ({
24
+ columnGap: theme.spacing(1),
25
+ minHeight: theme.spacing(6),
26
+ ...hasAction && {
27
+ display: "grid",
28
+ gridTemplateAreas: content === "inline" || hasCloseButton ? `"icon message actions"` : `
29
+ "icon message"
30
+ "icon actions"
31
+ `,
32
+ gridTemplateColumns: hasCloseButton ? `${ICON_SIZE_MEDIUM} 1fr ${theme.spacing(3)}` : `${ICON_SIZE_MEDIUM}`
33
+ },
34
+ ...isNeutral && {
35
+ backgroundColor: theme.palette.default.background,
36
+ color: theme.palette.text.primary
37
+ },
38
+ ...isSticky && {
39
+ borderRadius: 0
40
+ },
41
+ ".MuiAlert-message": {
42
+ flex: 1,
43
+ paddingTop: hasTitle ? theme.spacing(0.25) : theme.spacing(0.5),
44
+ "& a": {
45
+ color: theme.palette.primary.main,
46
+ textDecoration: "none",
47
+ "&:hover": {
48
+ textDecoration: "underline"
49
+ }
50
+ },
51
+ ...hasAction && {
52
+ gridArea: "message"
53
+ },
54
+ ...isNeutral && {
55
+ "& :not(.MuiAlertTitle-root)": {
56
+ color: theme.palette.text.secondary
57
+ },
58
+ a: {
59
+ color: `${theme.palette.primary.main} !important`
60
+ }
61
+ }
62
+ },
63
+ ".MuiAlert-icon": {
64
+ height: hasTitle ? theme.spacing(2.5) : theme.spacing(3),
65
+ marginRight: 0,
66
+ ...hasAction && {
67
+ gridArea: "icon"
68
+ },
69
+ ...isNeutral && {
70
+ color: theme.palette.text.primary
71
+ }
72
+ },
73
+ ".MuiAlert-action": {
74
+ alignItems: content === "inline" && !hasCloseButton ? "center" : "flex-start",
75
+ margin: content === "block" && !hasCloseButton ? theme.spacing(1.5, 0, 0.5) : 0,
76
+ marginLeft: content === "inline" || hasCloseButton ? "auto" : 0,
77
+ padding: 0,
78
+ ...hasAction && {
79
+ gridArea: "actions"
80
+ },
81
+ ".MuiIconButton-root svg path": {
82
+ fill: hasCloseButton ? theme.palette.text.secondary : void 0
83
+ }
84
+ }
85
+ })
86
+ );
87
+ function _Alert({
88
+ title,
89
+ action,
90
+ severity = "neutral",
91
+ content = "inline",
92
+ variant = "standard",
93
+ children,
94
+ onClose,
95
+ open: controlledOpen,
96
+ isSticky,
97
+ ...otherProps
98
+ }, ref) {
99
+ const [open, setOpen] = useState(controlledOpen ?? true);
100
+ const handleClose = onClose ? (ev) => {
101
+ onClose(ev);
102
+ setOpen(false);
103
+ } : void 0;
104
+ const isNeutral = severity === "neutral";
105
+ const isOpen = controlledOpen ?? open;
106
+ return /* @__PURE__ */ jsx(Fade, { in: isOpen, appear: false, children: /* @__PURE__ */ jsxs(
107
+ StyledAlert,
108
+ {
109
+ ref,
110
+ severity: isNeutral ? "info" : severity,
111
+ isNeutral,
112
+ content,
113
+ action,
114
+ onClose: handleClose,
115
+ hasCloseButton: Boolean(onClose),
116
+ hasAction: Boolean(action),
117
+ hasTitle: Boolean(title),
118
+ isSticky,
119
+ variant,
120
+ "data-name": "alert",
121
+ "data-sticky": isSticky,
122
+ "data-content": content,
123
+ ...otherProps,
124
+ children: [
125
+ title && /* @__PURE__ */ jsx(AlertTitle, { children: title }),
126
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "inherit", component: "div", children })
127
+ ]
128
+ }
129
+ ) });
130
+ }
131
+ const Alert = forwardRef(_Alert);
132
+ export {
133
+ Alert as A
134
+ };
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const TablePaginationActions = require("./TablePaginationActions-CFGXm44W.cjs");
4
+ const material = require("@mui/material");
5
+ const React = require("react");
6
+ const StyledAlert = material.styled(material.Alert, {
7
+ shouldForwardProp: (prop) => ![
8
+ "isNeutral",
9
+ "content",
10
+ "hasCloseButton",
11
+ "hasAction",
12
+ "hasTitle",
13
+ "isSticky"
14
+ ].includes(prop)
15
+ })(
16
+ ({
17
+ isNeutral,
18
+ content,
19
+ hasCloseButton,
20
+ hasAction,
21
+ hasTitle,
22
+ isSticky,
23
+ theme
24
+ }) => ({
25
+ columnGap: theme.spacing(1),
26
+ minHeight: theme.spacing(6),
27
+ ...hasAction && {
28
+ display: "grid",
29
+ gridTemplateAreas: content === "inline" || hasCloseButton ? `"icon message actions"` : `
30
+ "icon message"
31
+ "icon actions"
32
+ `,
33
+ gridTemplateColumns: hasCloseButton ? `${TablePaginationActions.ICON_SIZE_MEDIUM} 1fr ${theme.spacing(3)}` : `${TablePaginationActions.ICON_SIZE_MEDIUM}`
34
+ },
35
+ ...isNeutral && {
36
+ backgroundColor: theme.palette.default.background,
37
+ color: theme.palette.text.primary
38
+ },
39
+ ...isSticky && {
40
+ borderRadius: 0
41
+ },
42
+ ".MuiAlert-message": {
43
+ flex: 1,
44
+ paddingTop: hasTitle ? theme.spacing(0.25) : theme.spacing(0.5),
45
+ "& a": {
46
+ color: theme.palette.primary.main,
47
+ textDecoration: "none",
48
+ "&:hover": {
49
+ textDecoration: "underline"
50
+ }
51
+ },
52
+ ...hasAction && {
53
+ gridArea: "message"
54
+ },
55
+ ...isNeutral && {
56
+ "& :not(.MuiAlertTitle-root)": {
57
+ color: theme.palette.text.secondary
58
+ },
59
+ a: {
60
+ color: `${theme.palette.primary.main} !important`
61
+ }
62
+ }
63
+ },
64
+ ".MuiAlert-icon": {
65
+ height: hasTitle ? theme.spacing(2.5) : theme.spacing(3),
66
+ marginRight: 0,
67
+ ...hasAction && {
68
+ gridArea: "icon"
69
+ },
70
+ ...isNeutral && {
71
+ color: theme.palette.text.primary
72
+ }
73
+ },
74
+ ".MuiAlert-action": {
75
+ alignItems: content === "inline" && !hasCloseButton ? "center" : "flex-start",
76
+ margin: content === "block" && !hasCloseButton ? theme.spacing(1.5, 0, 0.5) : 0,
77
+ marginLeft: content === "inline" || hasCloseButton ? "auto" : 0,
78
+ padding: 0,
79
+ ...hasAction && {
80
+ gridArea: "actions"
81
+ },
82
+ ".MuiIconButton-root svg path": {
83
+ fill: hasCloseButton ? theme.palette.text.secondary : void 0
84
+ }
85
+ }
86
+ })
87
+ );
88
+ function _Alert({
89
+ title,
90
+ action,
91
+ severity = "neutral",
92
+ content = "inline",
93
+ variant = "standard",
94
+ children,
95
+ onClose,
96
+ open: controlledOpen,
97
+ isSticky,
98
+ ...otherProps
99
+ }, ref) {
100
+ const [open, setOpen] = React.useState(controlledOpen ?? true);
101
+ const handleClose = onClose ? (ev) => {
102
+ onClose(ev);
103
+ setOpen(false);
104
+ } : void 0;
105
+ const isNeutral = severity === "neutral";
106
+ const isOpen = controlledOpen ?? open;
107
+ return /* @__PURE__ */ jsxRuntime.jsx(material.Fade, { in: isOpen, appear: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
108
+ StyledAlert,
109
+ {
110
+ ref,
111
+ severity: isNeutral ? "info" : severity,
112
+ isNeutral,
113
+ content,
114
+ action,
115
+ onClose: handleClose,
116
+ hasCloseButton: Boolean(onClose),
117
+ hasAction: Boolean(action),
118
+ hasTitle: Boolean(title),
119
+ isSticky,
120
+ variant,
121
+ "data-name": "alert",
122
+ "data-sticky": isSticky,
123
+ "data-content": content,
124
+ ...otherProps,
125
+ children: [
126
+ title && /* @__PURE__ */ jsxRuntime.jsx(material.AlertTitle, { children: title }),
127
+ /* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { variant: "caption", color: "inherit", component: "div", children })
128
+ ]
129
+ }
130
+ ) });
131
+ }
132
+ const Alert = React.forwardRef(_Alert);
133
+ exports.Alert = Alert;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const utils = require("@mui/material/utils");
5
+ const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
6
+ "path",
7
+ {
8
+ fill: "currentColor",
9
+ fillRule: "evenodd",
10
+ d: "M12 12.17 8.83 9l-1.41 1.41L12 15l4.59-4.59L15.17 9z",
11
+ clipRule: "evenodd"
12
+ }
13
+ ) });
14
+ const BaseSvgIcon = utils.createSvgIcon(Icon(), "ArrowDown");
15
+ function ArrowDown({ width, height, sx, ...props }, ref) {
16
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
+ BaseSvgIcon,
18
+ {
19
+ ref,
20
+ viewBox: "0 0 24 24",
21
+ sx: {
22
+ width,
23
+ height: height || width,
24
+ ...sx
25
+ },
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ const ArrowDown$1 = React.forwardRef(ArrowDown);
31
+ exports.ArrowDown = ArrowDown$1;
@@ -0,0 +1,32 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { createSvgIcon } from "@mui/material/utils";
4
+ const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
5
+ "path",
6
+ {
7
+ fill: "currentColor",
8
+ fillRule: "evenodd",
9
+ d: "M12 12.17 8.83 9l-1.41 1.41L12 15l4.59-4.59L15.17 9z",
10
+ clipRule: "evenodd"
11
+ }
12
+ ) });
13
+ const BaseSvgIcon = createSvgIcon(Icon(), "ArrowDown");
14
+ function ArrowDown({ width, height, sx, ...props }, ref) {
15
+ return /* @__PURE__ */ jsx(
16
+ BaseSvgIcon,
17
+ {
18
+ ref,
19
+ viewBox: "0 0 24 24",
20
+ sx: {
21
+ width,
22
+ height: height || width,
23
+ ...sx
24
+ },
25
+ ...props
26
+ }
27
+ );
28
+ }
29
+ const ArrowDown$1 = forwardRef(ArrowDown);
30
+ export {
31
+ ArrowDown$1 as A
32
+ };
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const material = require("@mui/material");
5
+ const StyledMenuItem = material.styled(material.MenuItem, {
6
+ shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
7
+ prop
8
+ )
9
+ })(
10
+ ({
11
+ theme,
12
+ dense,
13
+ subtitle,
14
+ destructive,
15
+ extended,
16
+ fixed,
17
+ iconColor = "primary"
18
+ }) => ({
19
+ ...subtitle && {
20
+ pointerEvents: "none",
21
+ columnGap: 0,
22
+ ...theme.typography.caption,
23
+ fontWeight: 500,
24
+ color: theme.palette.text.secondary,
25
+ ".MuiListItemText-root .MuiTypography-root": {
26
+ ...theme.typography.caption,
27
+ fontWeight: 500,
28
+ color: theme.palette.text.secondary
29
+ },
30
+ "&.MuiMenuItem-root": {
31
+ minHeight: theme.spacing(3),
32
+ paddingTop: 0,
33
+ paddingBottom: 0,
34
+ marginTop: theme.spacing(1),
35
+ "&:not(:first-of-type)": {
36
+ marginTop: theme.spacing(2),
37
+ "&::before": {
38
+ content: '""',
39
+ position: "absolute",
40
+ top: theme.spacing(-1),
41
+ left: 0,
42
+ right: 0,
43
+ height: 1,
44
+ backgroundColor: theme.palette.divider
45
+ }
46
+ }
47
+ }
48
+ },
49
+ ...iconColor === "primary" && {
50
+ ".MuiListItemIcon-root svg path": {
51
+ fill: theme.palette.text.primary
52
+ },
53
+ "&.Mui-selected .MuiListItemIcon-root svg path": {
54
+ fill: theme.palette.primary.main
55
+ },
56
+ '.MuiAutocomplete-listbox &[aria-selected="true"] svg path': {
57
+ fill: theme.palette.primary.main
58
+ }
59
+ },
60
+ ...destructive && {
61
+ color: theme.palette.error.main,
62
+ ".MuiTypography-root": {
63
+ color: theme.palette.error.main
64
+ },
65
+ "svg, & .MuiSvgIcon-root": {
66
+ color: theme.palette.error.main
67
+ },
68
+ ".MuiListItemIcon-root svg path": {
69
+ fill: theme.palette.error.main
70
+ },
71
+ "&.Mui-selected .MuiListItemIcon-root svg path": {
72
+ fill: theme.palette.error.main
73
+ },
74
+ "&:hover": {
75
+ backgroundColor: theme.palette.error.relatedLight
76
+ },
77
+ "&.Mui-selected": {
78
+ color: theme.palette.error.main,
79
+ ".MuiTypography-root": {
80
+ color: theme.palette.error.main
81
+ },
82
+ "svg, & .MuiSvgIcon-root": {
83
+ color: theme.palette.error.main
84
+ }
85
+ },
86
+ "&.Mui-disabled": {
87
+ color: theme.palette.text.disabled,
88
+ ".MuiTypography-root": {
89
+ color: theme.palette.text.disabled
90
+ },
91
+ svg: {
92
+ color: theme.palette.text.disabled
93
+ }
94
+ }
95
+ },
96
+ ...extended && {
97
+ "&.MuiButtonBase-root.MuiMenuItem-root": {
98
+ minHeight: theme.spacing(6)
99
+ }
100
+ },
101
+ ...fixed && {
102
+ "&.MuiMenuItem-root": {
103
+ position: "sticky",
104
+ top: 0,
105
+ left: 0,
106
+ bottom: 0,
107
+ right: 0,
108
+ zIndex: 2,
109
+ minHeight: theme.spacing(6),
110
+ marginBottom: theme.spacing(1),
111
+ padding: theme.spacing(0.5, 1.5),
112
+ backgroundColor: `${theme.palette.background.paper} !important`,
113
+ borderBottom: `1px solid ${theme.palette.divider}`
114
+ },
115
+ ".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
116
+ minHeight: theme.spacing(6),
117
+ marginTop: 0,
118
+ "&:hover": {
119
+ backgroundColor: theme.palette.background.paper
120
+ }
121
+ }
122
+ },
123
+ ...!fixed && {
124
+ ".MuiList-root &:first-of-type": {
125
+ marginTop: theme.spacing(1)
126
+ }
127
+ },
128
+ ...dense && {
129
+ "&.MuiButtonBase-root.MuiMenuItem-root": {
130
+ minHeight: theme.spacing(3),
131
+ padding: theme.spacing(0.25, 1.5)
132
+ }
133
+ }
134
+ })
135
+ );
136
+ function _MenuItem({
137
+ disabled,
138
+ subtitle,
139
+ destructive,
140
+ extended,
141
+ fixed,
142
+ iconColor = "primary",
143
+ ...props
144
+ }, ref) {
145
+ return /* @__PURE__ */ jsxRuntime.jsx(
146
+ StyledMenuItem,
147
+ {
148
+ "data-name": "menu-item",
149
+ ...props,
150
+ ref,
151
+ disabled: disabled || subtitle,
152
+ subtitle,
153
+ destructive,
154
+ extended,
155
+ fixed,
156
+ color: iconColor,
157
+ "data-destructive": destructive,
158
+ "data-extended": extended,
159
+ "data-fixed": fixed
160
+ }
161
+ );
162
+ }
163
+ const MenuItem = React.forwardRef(_MenuItem);
164
+ exports.MenuItem = MenuItem;
@@ -0,0 +1,165 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { styled, MenuItem as MenuItem$1 } from "@mui/material";
4
+ const StyledMenuItem = styled(MenuItem$1, {
5
+ shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
6
+ prop
7
+ )
8
+ })(
9
+ ({
10
+ theme,
11
+ dense,
12
+ subtitle,
13
+ destructive,
14
+ extended,
15
+ fixed,
16
+ iconColor = "primary"
17
+ }) => ({
18
+ ...subtitle && {
19
+ pointerEvents: "none",
20
+ columnGap: 0,
21
+ ...theme.typography.caption,
22
+ fontWeight: 500,
23
+ color: theme.palette.text.secondary,
24
+ ".MuiListItemText-root .MuiTypography-root": {
25
+ ...theme.typography.caption,
26
+ fontWeight: 500,
27
+ color: theme.palette.text.secondary
28
+ },
29
+ "&.MuiMenuItem-root": {
30
+ minHeight: theme.spacing(3),
31
+ paddingTop: 0,
32
+ paddingBottom: 0,
33
+ marginTop: theme.spacing(1),
34
+ "&:not(:first-of-type)": {
35
+ marginTop: theme.spacing(2),
36
+ "&::before": {
37
+ content: '""',
38
+ position: "absolute",
39
+ top: theme.spacing(-1),
40
+ left: 0,
41
+ right: 0,
42
+ height: 1,
43
+ backgroundColor: theme.palette.divider
44
+ }
45
+ }
46
+ }
47
+ },
48
+ ...iconColor === "primary" && {
49
+ ".MuiListItemIcon-root svg path": {
50
+ fill: theme.palette.text.primary
51
+ },
52
+ "&.Mui-selected .MuiListItemIcon-root svg path": {
53
+ fill: theme.palette.primary.main
54
+ },
55
+ '.MuiAutocomplete-listbox &[aria-selected="true"] svg path': {
56
+ fill: theme.palette.primary.main
57
+ }
58
+ },
59
+ ...destructive && {
60
+ color: theme.palette.error.main,
61
+ ".MuiTypography-root": {
62
+ color: theme.palette.error.main
63
+ },
64
+ "svg, & .MuiSvgIcon-root": {
65
+ color: theme.palette.error.main
66
+ },
67
+ ".MuiListItemIcon-root svg path": {
68
+ fill: theme.palette.error.main
69
+ },
70
+ "&.Mui-selected .MuiListItemIcon-root svg path": {
71
+ fill: theme.palette.error.main
72
+ },
73
+ "&:hover": {
74
+ backgroundColor: theme.palette.error.relatedLight
75
+ },
76
+ "&.Mui-selected": {
77
+ color: theme.palette.error.main,
78
+ ".MuiTypography-root": {
79
+ color: theme.palette.error.main
80
+ },
81
+ "svg, & .MuiSvgIcon-root": {
82
+ color: theme.palette.error.main
83
+ }
84
+ },
85
+ "&.Mui-disabled": {
86
+ color: theme.palette.text.disabled,
87
+ ".MuiTypography-root": {
88
+ color: theme.palette.text.disabled
89
+ },
90
+ svg: {
91
+ color: theme.palette.text.disabled
92
+ }
93
+ }
94
+ },
95
+ ...extended && {
96
+ "&.MuiButtonBase-root.MuiMenuItem-root": {
97
+ minHeight: theme.spacing(6)
98
+ }
99
+ },
100
+ ...fixed && {
101
+ "&.MuiMenuItem-root": {
102
+ position: "sticky",
103
+ top: 0,
104
+ left: 0,
105
+ bottom: 0,
106
+ right: 0,
107
+ zIndex: 2,
108
+ minHeight: theme.spacing(6),
109
+ marginBottom: theme.spacing(1),
110
+ padding: theme.spacing(0.5, 1.5),
111
+ backgroundColor: `${theme.palette.background.paper} !important`,
112
+ borderBottom: `1px solid ${theme.palette.divider}`
113
+ },
114
+ ".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
115
+ minHeight: theme.spacing(6),
116
+ marginTop: 0,
117
+ "&:hover": {
118
+ backgroundColor: theme.palette.background.paper
119
+ }
120
+ }
121
+ },
122
+ ...!fixed && {
123
+ ".MuiList-root &:first-of-type": {
124
+ marginTop: theme.spacing(1)
125
+ }
126
+ },
127
+ ...dense && {
128
+ "&.MuiButtonBase-root.MuiMenuItem-root": {
129
+ minHeight: theme.spacing(3),
130
+ padding: theme.spacing(0.25, 1.5)
131
+ }
132
+ }
133
+ })
134
+ );
135
+ function _MenuItem({
136
+ disabled,
137
+ subtitle,
138
+ destructive,
139
+ extended,
140
+ fixed,
141
+ iconColor = "primary",
142
+ ...props
143
+ }, ref) {
144
+ return /* @__PURE__ */ jsx(
145
+ StyledMenuItem,
146
+ {
147
+ "data-name": "menu-item",
148
+ ...props,
149
+ ref,
150
+ disabled: disabled || subtitle,
151
+ subtitle,
152
+ destructive,
153
+ extended,
154
+ fixed,
155
+ color: iconColor,
156
+ "data-destructive": destructive,
157
+ "data-extended": extended,
158
+ "data-fixed": fixed
159
+ }
160
+ );
161
+ }
162
+ const MenuItem = forwardRef(_MenuItem);
163
+ export {
164
+ MenuItem as M
165
+ };