@carto/meridian-ds 1.4.5-alpha-external-link.4 → 1.4.5
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.
- package/CHANGELOG.md +0 -3
- package/dist/Alert-D8jI1sG4.js +134 -0
- package/dist/{Alert-D01HgLe0.cjs → Alert-zqtoWsBL.cjs} +2 -125
- package/dist/{TablePaginationActions-CAmwcyTy.cjs → TablePaginationActions-CFGXm44W.cjs} +3 -6
- package/dist/{TablePaginationActions-b5wP_uRE.js → TablePaginationActions-KpTvhN4Y.js} +3 -6
- package/dist/components/index.cjs +62 -64
- package/dist/components/index.js +75 -77
- package/dist/theme/index.cjs +1 -1
- package/dist/theme/index.js +2 -2
- package/dist/types/components/atoms/Button.d.ts +0 -5
- package/dist/types/components/atoms/Button.d.ts.map +1 -1
- package/dist/types/components/atoms/index.d.ts +0 -4
- package/dist/types/components/atoms/index.d.ts.map +1 -1
- package/dist/types/localization/en.d.ts +0 -1
- package/dist/types/localization/en.d.ts.map +1 -1
- package/dist/types/localization/es.d.ts +0 -1
- package/dist/types/localization/es.d.ts.map +1 -1
- package/dist/types/localization/id.d.ts +0 -1
- package/dist/types/localization/id.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +0 -3
- package/dist/types/localization/index.d.ts.map +1 -1
- package/dist/types/theme/types.d.ts +0 -6
- package/dist/types/theme/types.d.ts.map +1 -1
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts +1 -1
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts.map +1 -1
- package/dist/types/widgets/ChartLegend.d.ts.map +1 -1
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +31 -23
- package/dist/widgets/index.js +42 -34
- package/package.json +1 -1
- package/dist/Alert-C0UdTQsO.js +0 -257
- package/dist/types/components/atoms/ExternalLink.d.ts +0 -22
- package/dist/types/components/atoms/ExternalLink.d.ts.map +0 -1
- package/dist/types/components/atoms/Link.d.ts +0 -14
- package/dist/types/components/atoms/Link.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -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
|
+
};
|
|
@@ -1,129 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
3
|
+
const TablePaginationActions = require("./TablePaginationActions-CFGXm44W.cjs");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const
|
|
6
|
-
const iconsMaterial = require("@mui/icons-material");
|
|
7
|
-
const TablePaginationActions = require("./TablePaginationActions-CAmwcyTy.cjs");
|
|
8
|
-
require("cartocolor");
|
|
9
|
-
const Option = material.styled("div")(({ theme }) => ({
|
|
10
|
-
position: "relative",
|
|
11
|
-
display: "inline-flex",
|
|
12
|
-
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
13
|
-
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
14
|
-
"& + &, & + .optionIconButton": {
|
|
15
|
-
marginLeft: theme.spacing(0.5)
|
|
16
|
-
}
|
|
17
|
-
}));
|
|
18
|
-
const StyledIconButton = material.styled(material.IconButton, {
|
|
19
|
-
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
20
|
-
})(({ active, theme }) => ({
|
|
21
|
-
...active && {
|
|
22
|
-
color: theme.palette.primary.main,
|
|
23
|
-
backgroundColor: theme.palette.primary.background,
|
|
24
|
-
"& svg:not(.doNotFillIcon) path": {
|
|
25
|
-
fill: theme.palette.primary.main
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
function _IconButton({
|
|
30
|
-
tooltip,
|
|
31
|
-
tooltipPlacement = "top",
|
|
32
|
-
icon,
|
|
33
|
-
size = "medium",
|
|
34
|
-
variant = "icon",
|
|
35
|
-
color = "default",
|
|
36
|
-
sx,
|
|
37
|
-
className,
|
|
38
|
-
loading,
|
|
39
|
-
disabled,
|
|
40
|
-
active,
|
|
41
|
-
...props
|
|
42
|
-
}, ref) {
|
|
43
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
-
Option,
|
|
45
|
-
{
|
|
46
|
-
className: `optionIconButton ${className ?? ""}`,
|
|
47
|
-
sx,
|
|
48
|
-
"data-testid": "icon-button",
|
|
49
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
-
StyledIconButton,
|
|
51
|
-
{
|
|
52
|
-
...props,
|
|
53
|
-
ref,
|
|
54
|
-
size,
|
|
55
|
-
variant,
|
|
56
|
-
color,
|
|
57
|
-
active,
|
|
58
|
-
disabled: disabled || loading,
|
|
59
|
-
role: "button",
|
|
60
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
) });
|
|
65
|
-
}
|
|
66
|
-
const IconButton = React.forwardRef(_IconButton);
|
|
67
|
-
const StyledLink = material.styled(material.Link)(({ theme }) => ({
|
|
68
|
-
display: "inline-flex",
|
|
69
|
-
alignItems: "center",
|
|
70
|
-
gap: theme.spacing(0.25)
|
|
71
|
-
}));
|
|
72
|
-
const Icon = material.styled(material.Box, {
|
|
73
|
-
shouldForwardProp: (prop) => prop !== "variant"
|
|
74
|
-
})(({ variant }) => ({
|
|
75
|
-
display: "flex",
|
|
76
|
-
svg: {
|
|
77
|
-
...variant === "caption" && {
|
|
78
|
-
fontSize: TablePaginationActions.ICON_SIZE_SMALL
|
|
79
|
-
},
|
|
80
|
-
...variant === "body2" && {
|
|
81
|
-
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
82
|
-
},
|
|
83
|
-
...variant === "body1" && {
|
|
84
|
-
fontSize: TablePaginationActions.ICON_SIZE_LARGE
|
|
85
|
-
},
|
|
86
|
-
...variant === "button" && {
|
|
87
|
-
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
91
|
-
function _Link({
|
|
92
|
-
children,
|
|
93
|
-
variant,
|
|
94
|
-
startIcon,
|
|
95
|
-
endIcon,
|
|
96
|
-
color,
|
|
97
|
-
external,
|
|
98
|
-
showExternalIcon = true,
|
|
99
|
-
...otherProps
|
|
100
|
-
}, ref) {
|
|
101
|
-
const intl = reactIntl.useIntl();
|
|
102
|
-
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
103
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
104
|
-
StyledLink,
|
|
105
|
-
{
|
|
106
|
-
...otherProps,
|
|
107
|
-
variant,
|
|
108
|
-
"data-color": color,
|
|
109
|
-
"data-name": "link",
|
|
110
|
-
role: "link",
|
|
111
|
-
color,
|
|
112
|
-
ref,
|
|
113
|
-
target: external ? "_blank" : void 0,
|
|
114
|
-
rel: external ? "noopener noreferrer" : void 0,
|
|
115
|
-
"aria-label": external ? `${children == null ? void 0 : children.toString()} (${intlConfig.formatMessage({
|
|
116
|
-
id: "c4r.button.opensInNewTab"
|
|
117
|
-
})})` : void 0,
|
|
118
|
-
children: [
|
|
119
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, children: startIcon }),
|
|
120
|
-
children,
|
|
121
|
-
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, children: endIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) })
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
const Link = React.forwardRef(_Link);
|
|
5
|
+
const React = require("react");
|
|
127
6
|
const StyledAlert = material.styled(material.Alert, {
|
|
128
7
|
shouldForwardProp: (prop) => ![
|
|
129
8
|
"isNeutral",
|
|
@@ -252,5 +131,3 @@ function _Alert({
|
|
|
252
131
|
}
|
|
253
132
|
const Alert = React.forwardRef(_Alert);
|
|
254
133
|
exports.Alert = Alert;
|
|
255
|
-
exports.IconButton = IconButton;
|
|
256
|
-
exports.Link = Link;
|
|
@@ -814,8 +814,7 @@ const en = {
|
|
|
814
814
|
copy: "Copy",
|
|
815
815
|
save: "Save",
|
|
816
816
|
add: "Add",
|
|
817
|
-
showOptions: "Show options"
|
|
818
|
-
opensInNewTab: "Opens in new tab"
|
|
817
|
+
showOptions: "Show options"
|
|
819
818
|
},
|
|
820
819
|
form: {
|
|
821
820
|
selectAll: "Select all",
|
|
@@ -963,8 +962,7 @@ const es = {
|
|
|
963
962
|
copy: "Copiar",
|
|
964
963
|
save: "Guardar",
|
|
965
964
|
add: "Añadir",
|
|
966
|
-
showOptions: "Mostrar opciones"
|
|
967
|
-
opensInNewTab: "Abre en una nueva pestaña"
|
|
965
|
+
showOptions: "Mostrar opciones"
|
|
968
966
|
},
|
|
969
967
|
form: {
|
|
970
968
|
selectAll: "Seleccionar todos",
|
|
@@ -1110,8 +1108,7 @@ const id = {
|
|
|
1110
1108
|
copy: "Salin",
|
|
1111
1109
|
save: "Simpan",
|
|
1112
1110
|
add: "Tambah",
|
|
1113
|
-
showOptions: "Tampilkan opsi"
|
|
1114
|
-
opensInNewTab: "Buka di tab baru"
|
|
1111
|
+
showOptions: "Tampilkan opsi"
|
|
1115
1112
|
},
|
|
1116
1113
|
form: {
|
|
1117
1114
|
selectAll: "Select all",
|
|
@@ -813,8 +813,7 @@ const en = {
|
|
|
813
813
|
copy: "Copy",
|
|
814
814
|
save: "Save",
|
|
815
815
|
add: "Add",
|
|
816
|
-
showOptions: "Show options"
|
|
817
|
-
opensInNewTab: "Opens in new tab"
|
|
816
|
+
showOptions: "Show options"
|
|
818
817
|
},
|
|
819
818
|
form: {
|
|
820
819
|
selectAll: "Select all",
|
|
@@ -962,8 +961,7 @@ const es = {
|
|
|
962
961
|
copy: "Copiar",
|
|
963
962
|
save: "Guardar",
|
|
964
963
|
add: "Añadir",
|
|
965
|
-
showOptions: "Mostrar opciones"
|
|
966
|
-
opensInNewTab: "Abre en una nueva pestaña"
|
|
964
|
+
showOptions: "Mostrar opciones"
|
|
967
965
|
},
|
|
968
966
|
form: {
|
|
969
967
|
selectAll: "Seleccionar todos",
|
|
@@ -1109,8 +1107,7 @@ const id = {
|
|
|
1109
1107
|
copy: "Salin",
|
|
1110
1108
|
save: "Simpan",
|
|
1111
1109
|
add: "Tambah",
|
|
1112
|
-
showOptions: "Tampilkan opsi"
|
|
1113
|
-
opensInNewTab: "Buka di tab baru"
|
|
1110
|
+
showOptions: "Tampilkan opsi"
|
|
1114
1111
|
},
|
|
1115
1112
|
form: {
|
|
1116
1113
|
selectAll: "Select all",
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const reactIntl = require("react-intl");
|
|
6
5
|
const material = require("@mui/material");
|
|
6
|
+
const TablePaginationActions = require("../TablePaginationActions-CFGXm44W.cjs");
|
|
7
|
+
const reactIntl = require("react-intl");
|
|
7
8
|
const iconsMaterial = require("@mui/icons-material");
|
|
8
|
-
const
|
|
9
|
-
const Alert$1 = require("../Alert-D01HgLe0.cjs");
|
|
10
|
-
const styles = require("@mui/material/styles");
|
|
9
|
+
const Alert$1 = require("../Alert-zqtoWsBL.cjs");
|
|
11
10
|
require("cartocolor");
|
|
12
11
|
const MenuItem = require("../MenuItem-Br2jY2lt.cjs");
|
|
13
12
|
const ArrowDown = require("../ArrowDown-8fLj23Ge.cjs");
|
|
@@ -62,11 +61,8 @@ function _Button({
|
|
|
62
61
|
startIcon,
|
|
63
62
|
endIcon,
|
|
64
63
|
loadingPosition,
|
|
65
|
-
external,
|
|
66
64
|
...otherProps
|
|
67
65
|
}, ref) {
|
|
68
|
-
const intl = reactIntl.useIntl();
|
|
69
|
-
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
70
66
|
const defaultIconLoader = /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" });
|
|
71
67
|
const isDefaultLoading = loading && loadingPosition === void 0;
|
|
72
68
|
const renderContent = () => {
|
|
@@ -88,11 +84,7 @@ function _Button({
|
|
|
88
84
|
}
|
|
89
85
|
return void 0;
|
|
90
86
|
}
|
|
91
|
-
|
|
92
|
-
return startIcon;
|
|
93
|
-
} else {
|
|
94
|
-
return endIcon || (external && otherProps.href ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) : void 0);
|
|
95
|
-
}
|
|
87
|
+
return position === "start" ? startIcon : endIcon;
|
|
96
88
|
};
|
|
97
89
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
90
|
material.Button,
|
|
@@ -102,13 +94,6 @@ function _Button({
|
|
|
102
94
|
endIcon: getIconForPosition("end"),
|
|
103
95
|
...otherProps,
|
|
104
96
|
role: otherProps.href ? "link" : "button",
|
|
105
|
-
...otherProps.href && external && {
|
|
106
|
-
target: "_blank",
|
|
107
|
-
rel: "noopener noreferrer"
|
|
108
|
-
},
|
|
109
|
-
"aria-label": external && otherProps.href ? `${children == null ? void 0 : children.toString()} (${intlConfig.formatMessage({
|
|
110
|
-
id: "c4r.button.opensInNewTab"
|
|
111
|
-
})})` : void 0,
|
|
112
97
|
ref,
|
|
113
98
|
children: /* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { variant: "inherit", color: "inherit", noWrap: true, component: "span", children: renderContent() })
|
|
114
99
|
}
|
|
@@ -396,49 +381,64 @@ function ToggleButtonGroup({
|
|
|
396
381
|
}
|
|
397
382
|
);
|
|
398
383
|
}
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
"> path": {
|
|
407
|
-
color: "inherit !important"
|
|
384
|
+
const Option = material.styled("div")(({ theme }) => ({
|
|
385
|
+
position: "relative",
|
|
386
|
+
display: "inline-flex",
|
|
387
|
+
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
388
|
+
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
389
|
+
"& + &, & + .optionIconButton": {
|
|
390
|
+
marginLeft: theme.spacing(0.5)
|
|
408
391
|
}
|
|
409
392
|
}));
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
393
|
+
const StyledIconButton = material.styled(material.IconButton, {
|
|
394
|
+
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
395
|
+
})(({ active, theme }) => ({
|
|
396
|
+
...active && {
|
|
397
|
+
color: theme.palette.primary.main,
|
|
398
|
+
backgroundColor: theme.palette.primary.background,
|
|
399
|
+
"& svg:not(.doNotFillIcon) path": {
|
|
400
|
+
fill: theme.palette.primary.main
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}));
|
|
404
|
+
function _IconButton({
|
|
405
|
+
tooltip,
|
|
406
|
+
tooltipPlacement = "top",
|
|
407
|
+
icon,
|
|
408
|
+
size = "medium",
|
|
409
|
+
variant = "icon",
|
|
410
|
+
color = "default",
|
|
411
|
+
sx,
|
|
412
|
+
className,
|
|
413
|
+
loading,
|
|
414
|
+
disabled,
|
|
415
|
+
active,
|
|
415
416
|
...props
|
|
416
417
|
}, ref) {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
418
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
419
|
+
Option,
|
|
420
|
+
{
|
|
421
|
+
className: `optionIconButton ${className ?? ""}`,
|
|
422
|
+
sx,
|
|
423
|
+
"data-testid": "icon-button",
|
|
424
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
425
|
+
StyledIconButton,
|
|
426
|
+
{
|
|
427
|
+
...props,
|
|
428
|
+
ref,
|
|
429
|
+
size,
|
|
430
|
+
variant,
|
|
431
|
+
color,
|
|
432
|
+
active,
|
|
433
|
+
disabled: disabled || loading,
|
|
434
|
+
role: "button",
|
|
435
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
}
|
|
439
|
+
) });
|
|
440
440
|
}
|
|
441
|
-
const
|
|
441
|
+
const IconButton = React.forwardRef(_IconButton);
|
|
442
442
|
const StyledMenu = material.styled(material.Menu, {
|
|
443
443
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
444
444
|
})(({ theme, extended, width, height }) => ({
|
|
@@ -1480,7 +1480,7 @@ const _CopiableComponent = ({
|
|
|
1480
1480
|
children: [
|
|
1481
1481
|
children,
|
|
1482
1482
|
button && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1483
|
-
|
|
1483
|
+
IconButton,
|
|
1484
1484
|
{
|
|
1485
1485
|
...buttonProps,
|
|
1486
1486
|
disabled,
|
|
@@ -1739,7 +1739,7 @@ function Snackbar({
|
|
|
1739
1739
|
}
|
|
1740
1740
|
),
|
|
1741
1741
|
closeable && /* @__PURE__ */ jsxRuntime.jsx(CloseButtonWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1742
|
-
|
|
1742
|
+
IconButton,
|
|
1743
1743
|
{
|
|
1744
1744
|
color: "default",
|
|
1745
1745
|
onClick: (e) => onClose(e, "timeout"),
|
|
@@ -2989,7 +2989,7 @@ function CodeAreaHeader({
|
|
|
2989
2989
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2990
2990
|
/* @__PURE__ */ jsxRuntime.jsxs(Header, { size, "data-size": size, "data-name": "code-area-header", children: [
|
|
2991
2991
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2992
|
-
|
|
2992
|
+
IconButton,
|
|
2993
2993
|
{
|
|
2994
2994
|
color: "default",
|
|
2995
2995
|
size,
|
|
@@ -3053,7 +3053,7 @@ function CodeAreaHeader({
|
|
|
3053
3053
|
}
|
|
3054
3054
|
),
|
|
3055
3055
|
showExpandButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3056
|
-
|
|
3056
|
+
IconButton,
|
|
3057
3057
|
{
|
|
3058
3058
|
color: "default",
|
|
3059
3059
|
size,
|
|
@@ -4543,8 +4543,6 @@ function CodeAreaDialog({
|
|
|
4543
4543
|
exports.TablePaginationActions = TablePaginationActions.TablePaginationActions;
|
|
4544
4544
|
exports.Typography = TablePaginationActions.Typography;
|
|
4545
4545
|
exports.Alert = Alert$1.Alert;
|
|
4546
|
-
exports.IconButton = Alert$1.IconButton;
|
|
4547
|
-
exports.Link = Alert$1.Link;
|
|
4548
4546
|
exports.MenuItem = MenuItem.MenuItem;
|
|
4549
4547
|
exports.AccordionGroup = AccordionGroup;
|
|
4550
4548
|
exports.AppBar = AppBar;
|
|
@@ -4574,7 +4572,7 @@ exports.DialogFooter = DialogFooter;
|
|
|
4574
4572
|
exports.DialogHeader = DialogHeader;
|
|
4575
4573
|
exports.DialogPaper = DialogPaper;
|
|
4576
4574
|
exports.DialogStepper = DialogStepper;
|
|
4577
|
-
exports.
|
|
4575
|
+
exports.IconButton = IconButton;
|
|
4578
4576
|
exports.LabelWithIndicator = LabelWithIndicator;
|
|
4579
4577
|
exports.Menu = Menu$1;
|
|
4580
4578
|
exports.MenuItemFilter = MenuItemFilter;
|