@carto/meridian-ds 2.0.2 → 2.1.0-alpha-copiable-input-text.1
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 +6 -0
- package/dist/{Alert-CnaTtNJd.js → Link-D5fKicEY.js} +171 -61
- package/dist/{Alert-BzEgeyQJ.cjs → Link-_lzRY1Ay.cjs} +170 -60
- package/dist/{MenuItem-C4bG5WHw.cjs → MenuItem-BY6fuF5U.cjs} +1 -1
- package/dist/{MenuItem-C1DvWMry.js → MenuItem-CKrhDizf.js} +1 -1
- package/dist/{TablePaginationActions-Cz5Hbi6N.js → TablePaginationActions-CCDi-BO-.js} +12 -9
- package/dist/{TablePaginationActions-mbbjzV6Y.cjs → TablePaginationActions-D2K26kdR.cjs} +12 -9
- package/dist/components/index.cjs +744 -631
- package/dist/components/index.js +750 -636
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.js +3 -3
- package/dist/types/components/atoms/Button.d.ts +11 -0
- package/dist/types/components/atoms/Button.d.ts.map +1 -1
- package/dist/types/components/atoms/Copy/CopiableComponent.d.ts +4 -0
- package/dist/types/components/atoms/Copy/CopiableComponent.d.ts.map +1 -0
- package/dist/types/components/atoms/Copy/CopiableInputText.d.ts +18 -0
- package/dist/types/components/atoms/Copy/CopiableInputText.d.ts.map +1 -0
- package/dist/types/components/atoms/Copy/copyString.d.ts.map +1 -0
- package/dist/types/components/{molecules → atoms}/Copy/index.d.ts +2 -1
- package/dist/types/components/atoms/Copy/index.d.ts.map +1 -0
- package/dist/types/components/{molecules/Copy/CopiableComponent.d.ts → atoms/Copy/types.d.ts} +11 -5
- package/dist/types/components/atoms/Copy/types.d.ts.map +1 -0
- package/dist/types/components/atoms/Copy/useCopyValue.d.ts.map +1 -0
- package/dist/types/components/atoms/Link.d.ts +39 -0
- package/dist/types/components/atoms/Link.d.ts.map +1 -0
- package/dist/types/components/atoms/ScreenReaderOnly.d.ts +3 -0
- package/dist/types/components/atoms/ScreenReaderOnly.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +5 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -1
- package/dist/types/components/molecules/index.d.ts +0 -2
- package/dist/types/components/molecules/index.d.ts.map +1 -1
- package/dist/types/components/organisms/CodeArea/CodeAreaHeader.d.ts.map +1 -1
- package/dist/types/localization/en.d.ts +3 -2
- package/dist/types/localization/en.d.ts.map +1 -1
- package/dist/types/localization/es.d.ts +3 -2
- package/dist/types/localization/es.d.ts.map +1 -1
- package/dist/types/localization/id.d.ts +3 -2
- package/dist/types/localization/id.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +9 -6
- package/dist/types/localization/index.d.ts.map +1 -1
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +8 -8
- package/dist/widgets/index.js +5 -5
- package/package.json +1 -1
- package/dist/types/components/molecules/Copy/CopiableComponent.d.ts.map +0 -1
- package/dist/types/components/molecules/Copy/copyString.d.ts.map +0 -1
- package/dist/types/components/molecules/Copy/index.d.ts.map +0 -1
- package/dist/types/components/molecules/Copy/useCopyValue.d.ts.map +0 -1
- /package/dist/types/components/{molecules → atoms}/Copy/copyString.d.ts +0 -0
- /package/dist/types/components/{molecules → atoms}/Copy/useCopyValue.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- New CopiableInputText component [#228](https://github.com/CartoDB/meridian-ds/pull/228)
|
|
6
|
+
|
|
5
7
|
## 2.0
|
|
6
8
|
|
|
9
|
+
### 2.1.0
|
|
10
|
+
|
|
11
|
+
- New Link components and Button with externalLink behavior [#202](https://github.com/CartoDB/meridian-ds/pull/202)
|
|
12
|
+
|
|
7
13
|
### 2.0.2
|
|
8
14
|
|
|
9
15
|
- fix(TimeSeriesWidgetUI): Fix TimeSeriesWidgetUI overflowing available height [#226](https://github.com/CartoDB/meridian-ds/pull/226)
|
|
@@ -1,65 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { b as ICON_SIZE_MEDIUM, T as Typography, c as ICON_SIZE_SMALL, I as ICON_SIZE_LARGE, u as useImperativeIntl } from "./TablePaginationActions-CCDi-BO-.js";
|
|
3
|
+
import { styled, Alert as Alert$1, Fade, AlertTitle, IconButton as IconButton$1, Tooltip, CircularProgress, Link as Link$1 } from "@mui/material";
|
|
2
4
|
import { forwardRef, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
position: "relative",
|
|
7
|
-
display: "inline-flex",
|
|
8
|
-
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
9
|
-
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
10
|
-
"& + &, & + .optionIconButton": {
|
|
11
|
-
marginLeft: theme.spacing(0.5)
|
|
12
|
-
}
|
|
13
|
-
}));
|
|
14
|
-
const StyledIconButton = styled(IconButton$1, {
|
|
15
|
-
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
16
|
-
})(({ active, theme }) => ({
|
|
17
|
-
...active && {
|
|
18
|
-
color: theme.palette.primary.main,
|
|
19
|
-
backgroundColor: theme.palette.primary.background,
|
|
20
|
-
"& svg:not(.doNotFillIcon) path": {
|
|
21
|
-
fill: theme.palette.primary.main
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
function _IconButton({
|
|
26
|
-
tooltip,
|
|
27
|
-
tooltipPlacement = "top",
|
|
28
|
-
icon,
|
|
29
|
-
size = "medium",
|
|
30
|
-
variant = "icon",
|
|
31
|
-
color = "default",
|
|
32
|
-
sx,
|
|
33
|
-
className,
|
|
34
|
-
loading,
|
|
35
|
-
disabled,
|
|
36
|
-
active,
|
|
37
|
-
...props
|
|
38
|
-
}, ref) {
|
|
39
|
-
return /* @__PURE__ */ jsx(Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsx(
|
|
40
|
-
Option,
|
|
41
|
-
{
|
|
42
|
-
className: `optionIconButton ${className ?? ""}`,
|
|
43
|
-
sx,
|
|
44
|
-
"data-testid": "icon-button",
|
|
45
|
-
children: /* @__PURE__ */ jsx(
|
|
46
|
-
StyledIconButton,
|
|
47
|
-
{
|
|
48
|
-
...props,
|
|
49
|
-
ref,
|
|
50
|
-
size,
|
|
51
|
-
variant,
|
|
52
|
-
color,
|
|
53
|
-
active,
|
|
54
|
-
disabled: disabled || loading,
|
|
55
|
-
role: "button",
|
|
56
|
-
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
) });
|
|
61
|
-
}
|
|
62
|
-
const IconButton = forwardRef(_IconButton);
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import { OpenInNewOutlined } from "@mui/icons-material";
|
|
7
|
+
import "cartocolor";
|
|
63
8
|
const StyledAlert = styled(Alert$1, {
|
|
64
9
|
shouldForwardProp: (prop) => ![
|
|
65
10
|
"isNeutral",
|
|
@@ -187,7 +132,172 @@ function _Alert({
|
|
|
187
132
|
) });
|
|
188
133
|
}
|
|
189
134
|
const Alert = forwardRef(_Alert);
|
|
135
|
+
const ScreenReaderOnly = styled("span")(() => ({
|
|
136
|
+
position: "absolute",
|
|
137
|
+
width: 1,
|
|
138
|
+
height: 1,
|
|
139
|
+
padding: 0,
|
|
140
|
+
margin: -1,
|
|
141
|
+
overflow: "hidden",
|
|
142
|
+
clip: "rect(0, 0, 0, 0)",
|
|
143
|
+
whiteSpace: "nowrap",
|
|
144
|
+
border: 0
|
|
145
|
+
}));
|
|
146
|
+
const Option = styled("div")(({ theme }) => ({
|
|
147
|
+
position: "relative",
|
|
148
|
+
display: "inline-flex",
|
|
149
|
+
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
150
|
+
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
151
|
+
"& + &, & + .optionIconButton": {
|
|
152
|
+
marginLeft: theme.spacing(0.5)
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
const StyledIconButton = styled(IconButton$1, {
|
|
156
|
+
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
157
|
+
})(({ active, theme }) => ({
|
|
158
|
+
...active && {
|
|
159
|
+
color: theme.palette.primary.main,
|
|
160
|
+
backgroundColor: theme.palette.primary.background,
|
|
161
|
+
"& svg:not(.doNotFillIcon) path": {
|
|
162
|
+
fill: theme.palette.primary.main
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
function _IconButton({
|
|
167
|
+
tooltip,
|
|
168
|
+
tooltipPlacement = "top",
|
|
169
|
+
icon,
|
|
170
|
+
size = "medium",
|
|
171
|
+
variant = "icon",
|
|
172
|
+
color = "default",
|
|
173
|
+
sx,
|
|
174
|
+
className,
|
|
175
|
+
loading,
|
|
176
|
+
disabled,
|
|
177
|
+
active,
|
|
178
|
+
...props
|
|
179
|
+
}, ref) {
|
|
180
|
+
return /* @__PURE__ */ jsx(Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsx(
|
|
181
|
+
Option,
|
|
182
|
+
{
|
|
183
|
+
className: `optionIconButton ${className ?? ""}`,
|
|
184
|
+
sx,
|
|
185
|
+
"data-testid": "icon-button",
|
|
186
|
+
children: /* @__PURE__ */ jsx(
|
|
187
|
+
StyledIconButton,
|
|
188
|
+
{
|
|
189
|
+
...props,
|
|
190
|
+
ref,
|
|
191
|
+
size,
|
|
192
|
+
variant,
|
|
193
|
+
color,
|
|
194
|
+
active,
|
|
195
|
+
disabled: disabled || loading,
|
|
196
|
+
role: "button",
|
|
197
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
) });
|
|
202
|
+
}
|
|
203
|
+
const IconButton = forwardRef(_IconButton);
|
|
204
|
+
const StyledLink = styled(Link$1)(() => ({
|
|
205
|
+
display: "inline-block"
|
|
206
|
+
}));
|
|
207
|
+
const Icon = styled("span", {
|
|
208
|
+
shouldForwardProp: (prop) => prop !== "variant" && prop !== "iconPosition"
|
|
209
|
+
})(
|
|
210
|
+
({ variant, iconPosition }) => ({
|
|
211
|
+
display: "inline-flex",
|
|
212
|
+
position: "relative",
|
|
213
|
+
top: "calc(1em * 5/32)",
|
|
214
|
+
// heuristic to align icon with true perceived baseline (25% offset ratio)
|
|
215
|
+
...iconPosition === "right" && {
|
|
216
|
+
marginLeft: "0.25em"
|
|
217
|
+
},
|
|
218
|
+
...iconPosition === "left" && {
|
|
219
|
+
marginRight: "0.25em"
|
|
220
|
+
},
|
|
221
|
+
svg: {
|
|
222
|
+
// Size adapts to the text size, but make sure the icon size is at least 12px
|
|
223
|
+
fontSize: `max(1em, ${ICON_SIZE_SMALL})`,
|
|
224
|
+
color: "inherit !important",
|
|
225
|
+
"> path": {
|
|
226
|
+
color: "inherit !important"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
// Caption and undefined variants use smaller offset and smaller icon
|
|
230
|
+
...variant === "caption" && {
|
|
231
|
+
top: "calc(1em * 1/5)",
|
|
232
|
+
// 20% offset ratio
|
|
233
|
+
svg: {
|
|
234
|
+
fontSize: ICON_SIZE_SMALL
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
// Button and body2 variants use medium-sized icons
|
|
238
|
+
...(variant === "button" || variant === "body2") && {
|
|
239
|
+
top: "calc(1em * 1/4)",
|
|
240
|
+
// 25% offset ratio
|
|
241
|
+
svg: {
|
|
242
|
+
fontSize: ICON_SIZE_MEDIUM
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
// Body1 variant uses large icons
|
|
246
|
+
...variant === "body1" && {
|
|
247
|
+
top: "calc(1em * 1/3)",
|
|
248
|
+
// 33% offset ratio
|
|
249
|
+
svg: {
|
|
250
|
+
fontSize: ICON_SIZE_LARGE
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
);
|
|
255
|
+
function _Link({
|
|
256
|
+
children,
|
|
257
|
+
variant,
|
|
258
|
+
startIcon,
|
|
259
|
+
endIcon,
|
|
260
|
+
color,
|
|
261
|
+
external,
|
|
262
|
+
showExternalIcon = true,
|
|
263
|
+
fontWeight = 500,
|
|
264
|
+
target,
|
|
265
|
+
rel,
|
|
266
|
+
"aria-describedby": ariaDescribedby,
|
|
267
|
+
...otherProps
|
|
268
|
+
}, ref) {
|
|
269
|
+
const intl = useIntl();
|
|
270
|
+
const intlConfig = useImperativeIntl(intl);
|
|
271
|
+
const isButtonLink = otherProps.component === "button";
|
|
272
|
+
return /* @__PURE__ */ jsxs(
|
|
273
|
+
StyledLink,
|
|
274
|
+
{
|
|
275
|
+
...otherProps,
|
|
276
|
+
variant,
|
|
277
|
+
fontWeight,
|
|
278
|
+
"data-color": color,
|
|
279
|
+
"data-name": isButtonLink ? "button-link" : "link",
|
|
280
|
+
role: isButtonLink ? "button" : "link",
|
|
281
|
+
color,
|
|
282
|
+
ref,
|
|
283
|
+
target: external ? "_blank" : target,
|
|
284
|
+
rel: external ? "noopener noreferrer" : rel,
|
|
285
|
+
"aria-describedby": external ? "external-hint" : ariaDescribedby,
|
|
286
|
+
children: [
|
|
287
|
+
startIcon && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
288
|
+
children,
|
|
289
|
+
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsx(OpenInNewOutlined, {}) }),
|
|
290
|
+
external && /* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children: ` (${intlConfig.formatMessage({
|
|
291
|
+
id: "c4r.button.opensInNewTab"
|
|
292
|
+
})})` })
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
const Link = forwardRef(_Link);
|
|
190
298
|
export {
|
|
191
299
|
Alert as A,
|
|
192
|
-
IconButton as I
|
|
300
|
+
IconButton as I,
|
|
301
|
+
Link as L,
|
|
302
|
+
ScreenReaderOnly as S
|
|
193
303
|
};
|
|
@@ -1,66 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const
|
|
3
|
+
const TablePaginationActions = require("./TablePaginationActions-D2K26kdR.cjs");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
10
|
-
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
11
|
-
"& + &, & + .optionIconButton": {
|
|
12
|
-
marginLeft: theme.spacing(0.5)
|
|
13
|
-
}
|
|
14
|
-
}));
|
|
15
|
-
const StyledIconButton = material.styled(material.IconButton, {
|
|
16
|
-
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
17
|
-
})(({ active, theme }) => ({
|
|
18
|
-
...active && {
|
|
19
|
-
color: theme.palette.primary.main,
|
|
20
|
-
backgroundColor: theme.palette.primary.background,
|
|
21
|
-
"& svg:not(.doNotFillIcon) path": {
|
|
22
|
-
fill: theme.palette.primary.main
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
26
|
-
function _IconButton({
|
|
27
|
-
tooltip,
|
|
28
|
-
tooltipPlacement = "top",
|
|
29
|
-
icon,
|
|
30
|
-
size = "medium",
|
|
31
|
-
variant = "icon",
|
|
32
|
-
color = "default",
|
|
33
|
-
sx,
|
|
34
|
-
className,
|
|
35
|
-
loading,
|
|
36
|
-
disabled,
|
|
37
|
-
active,
|
|
38
|
-
...props
|
|
39
|
-
}, ref) {
|
|
40
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
-
Option,
|
|
42
|
-
{
|
|
43
|
-
className: `optionIconButton ${className ?? ""}`,
|
|
44
|
-
sx,
|
|
45
|
-
"data-testid": "icon-button",
|
|
46
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
-
StyledIconButton,
|
|
48
|
-
{
|
|
49
|
-
...props,
|
|
50
|
-
ref,
|
|
51
|
-
size,
|
|
52
|
-
variant,
|
|
53
|
-
color,
|
|
54
|
-
active,
|
|
55
|
-
disabled: disabled || loading,
|
|
56
|
-
role: "button",
|
|
57
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
) });
|
|
62
|
-
}
|
|
63
|
-
const IconButton = React.forwardRef(_IconButton);
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const reactIntl = require("react-intl");
|
|
7
|
+
const iconsMaterial = require("@mui/icons-material");
|
|
8
|
+
require("cartocolor");
|
|
64
9
|
const StyledAlert = material.styled(material.Alert, {
|
|
65
10
|
shouldForwardProp: (prop) => ![
|
|
66
11
|
"isNeutral",
|
|
@@ -188,5 +133,170 @@ function _Alert({
|
|
|
188
133
|
) });
|
|
189
134
|
}
|
|
190
135
|
const Alert = React.forwardRef(_Alert);
|
|
136
|
+
const ScreenReaderOnly = material.styled("span")(() => ({
|
|
137
|
+
position: "absolute",
|
|
138
|
+
width: 1,
|
|
139
|
+
height: 1,
|
|
140
|
+
padding: 0,
|
|
141
|
+
margin: -1,
|
|
142
|
+
overflow: "hidden",
|
|
143
|
+
clip: "rect(0, 0, 0, 0)",
|
|
144
|
+
whiteSpace: "nowrap",
|
|
145
|
+
border: 0
|
|
146
|
+
}));
|
|
147
|
+
const Option = material.styled("div")(({ theme }) => ({
|
|
148
|
+
position: "relative",
|
|
149
|
+
display: "inline-flex",
|
|
150
|
+
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
151
|
+
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
152
|
+
"& + &, & + .optionIconButton": {
|
|
153
|
+
marginLeft: theme.spacing(0.5)
|
|
154
|
+
}
|
|
155
|
+
}));
|
|
156
|
+
const StyledIconButton = material.styled(material.IconButton, {
|
|
157
|
+
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
158
|
+
})(({ active, theme }) => ({
|
|
159
|
+
...active && {
|
|
160
|
+
color: theme.palette.primary.main,
|
|
161
|
+
backgroundColor: theme.palette.primary.background,
|
|
162
|
+
"& svg:not(.doNotFillIcon) path": {
|
|
163
|
+
fill: theme.palette.primary.main
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}));
|
|
167
|
+
function _IconButton({
|
|
168
|
+
tooltip,
|
|
169
|
+
tooltipPlacement = "top",
|
|
170
|
+
icon,
|
|
171
|
+
size = "medium",
|
|
172
|
+
variant = "icon",
|
|
173
|
+
color = "default",
|
|
174
|
+
sx,
|
|
175
|
+
className,
|
|
176
|
+
loading,
|
|
177
|
+
disabled,
|
|
178
|
+
active,
|
|
179
|
+
...props
|
|
180
|
+
}, ref) {
|
|
181
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
182
|
+
Option,
|
|
183
|
+
{
|
|
184
|
+
className: `optionIconButton ${className ?? ""}`,
|
|
185
|
+
sx,
|
|
186
|
+
"data-testid": "icon-button",
|
|
187
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
StyledIconButton,
|
|
189
|
+
{
|
|
190
|
+
...props,
|
|
191
|
+
ref,
|
|
192
|
+
size,
|
|
193
|
+
variant,
|
|
194
|
+
color,
|
|
195
|
+
active,
|
|
196
|
+
disabled: disabled || loading,
|
|
197
|
+
role: "button",
|
|
198
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
) });
|
|
203
|
+
}
|
|
204
|
+
const IconButton = React.forwardRef(_IconButton);
|
|
205
|
+
const StyledLink = material.styled(material.Link)(() => ({
|
|
206
|
+
display: "inline-block"
|
|
207
|
+
}));
|
|
208
|
+
const Icon = material.styled("span", {
|
|
209
|
+
shouldForwardProp: (prop) => prop !== "variant" && prop !== "iconPosition"
|
|
210
|
+
})(
|
|
211
|
+
({ variant, iconPosition }) => ({
|
|
212
|
+
display: "inline-flex",
|
|
213
|
+
position: "relative",
|
|
214
|
+
top: "calc(1em * 5/32)",
|
|
215
|
+
// heuristic to align icon with true perceived baseline (25% offset ratio)
|
|
216
|
+
...iconPosition === "right" && {
|
|
217
|
+
marginLeft: "0.25em"
|
|
218
|
+
},
|
|
219
|
+
...iconPosition === "left" && {
|
|
220
|
+
marginRight: "0.25em"
|
|
221
|
+
},
|
|
222
|
+
svg: {
|
|
223
|
+
// Size adapts to the text size, but make sure the icon size is at least 12px
|
|
224
|
+
fontSize: `max(1em, ${TablePaginationActions.ICON_SIZE_SMALL})`,
|
|
225
|
+
color: "inherit !important",
|
|
226
|
+
"> path": {
|
|
227
|
+
color: "inherit !important"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
// Caption and undefined variants use smaller offset and smaller icon
|
|
231
|
+
...variant === "caption" && {
|
|
232
|
+
top: "calc(1em * 1/5)",
|
|
233
|
+
// 20% offset ratio
|
|
234
|
+
svg: {
|
|
235
|
+
fontSize: TablePaginationActions.ICON_SIZE_SMALL
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
// Button and body2 variants use medium-sized icons
|
|
239
|
+
...(variant === "button" || variant === "body2") && {
|
|
240
|
+
top: "calc(1em * 1/4)",
|
|
241
|
+
// 25% offset ratio
|
|
242
|
+
svg: {
|
|
243
|
+
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
// Body1 variant uses large icons
|
|
247
|
+
...variant === "body1" && {
|
|
248
|
+
top: "calc(1em * 1/3)",
|
|
249
|
+
// 33% offset ratio
|
|
250
|
+
svg: {
|
|
251
|
+
fontSize: TablePaginationActions.ICON_SIZE_LARGE
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
);
|
|
256
|
+
function _Link({
|
|
257
|
+
children,
|
|
258
|
+
variant,
|
|
259
|
+
startIcon,
|
|
260
|
+
endIcon,
|
|
261
|
+
color,
|
|
262
|
+
external,
|
|
263
|
+
showExternalIcon = true,
|
|
264
|
+
fontWeight = 500,
|
|
265
|
+
target,
|
|
266
|
+
rel,
|
|
267
|
+
"aria-describedby": ariaDescribedby,
|
|
268
|
+
...otherProps
|
|
269
|
+
}, ref) {
|
|
270
|
+
const intl = reactIntl.useIntl();
|
|
271
|
+
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
272
|
+
const isButtonLink = otherProps.component === "button";
|
|
273
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
274
|
+
StyledLink,
|
|
275
|
+
{
|
|
276
|
+
...otherProps,
|
|
277
|
+
variant,
|
|
278
|
+
fontWeight,
|
|
279
|
+
"data-color": color,
|
|
280
|
+
"data-name": isButtonLink ? "button-link" : "link",
|
|
281
|
+
role: isButtonLink ? "button" : "link",
|
|
282
|
+
color,
|
|
283
|
+
ref,
|
|
284
|
+
target: external ? "_blank" : target,
|
|
285
|
+
rel: external ? "noopener noreferrer" : rel,
|
|
286
|
+
"aria-describedby": external ? "external-hint" : ariaDescribedby,
|
|
287
|
+
children: [
|
|
288
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
289
|
+
children,
|
|
290
|
+
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) }),
|
|
291
|
+
external && /* @__PURE__ */ jsxRuntime.jsx(ScreenReaderOnly, { id: "external-hint", children: ` (${intlConfig.formatMessage({
|
|
292
|
+
id: "c4r.button.opensInNewTab"
|
|
293
|
+
})})` })
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
const Link = React.forwardRef(_Link);
|
|
191
299
|
exports.Alert = Alert;
|
|
192
300
|
exports.IconButton = IconButton;
|
|
301
|
+
exports.Link = Link;
|
|
302
|
+
exports.ScreenReaderOnly = ScreenReaderOnly;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const TablePaginationActions = require("./TablePaginationActions-
|
|
5
|
+
const TablePaginationActions = require("./TablePaginationActions-D2K26kdR.cjs");
|
|
6
6
|
const StyledMenuItem = material.styled(material.MenuItem, {
|
|
7
7
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
8
8
|
prop
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { styled, MenuItem as MenuItem$1 } from "@mui/material";
|
|
4
|
-
import { e as MENU_ITEM_SIZE_DENSE, f as MENU_ITEM_SIZE_EXTENDED } from "./TablePaginationActions-
|
|
4
|
+
import { e as MENU_ITEM_SIZE_DENSE, f as MENU_ITEM_SIZE_EXTENDED } from "./TablePaginationActions-CCDi-BO-.js";
|
|
5
5
|
const StyledMenuItem = styled(MenuItem$1, {
|
|
6
6
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
7
7
|
prop
|
|
@@ -817,7 +817,10 @@ const en = {
|
|
|
817
817
|
copy: "Copy",
|
|
818
818
|
save: "Save",
|
|
819
819
|
add: "Add",
|
|
820
|
-
showOptions: "Show options"
|
|
820
|
+
showOptions: "Show options",
|
|
821
|
+
hide: "Hide",
|
|
822
|
+
show: "Show",
|
|
823
|
+
opensInNewTab: "Opens in new tab"
|
|
821
824
|
},
|
|
822
825
|
form: {
|
|
823
826
|
selectAll: "Select all",
|
|
@@ -880,8 +883,6 @@ const en = {
|
|
|
880
883
|
},
|
|
881
884
|
legend: {
|
|
882
885
|
layerOptions: "Layer options",
|
|
883
|
-
hide: "Hide",
|
|
884
|
-
show: "Show",
|
|
885
886
|
layer: "layer",
|
|
886
887
|
opacity: "Opacity",
|
|
887
888
|
hideLayer: "Hide layer",
|
|
@@ -965,7 +966,10 @@ const es = {
|
|
|
965
966
|
copy: "Copiar",
|
|
966
967
|
save: "Guardar",
|
|
967
968
|
add: "Añadir",
|
|
968
|
-
showOptions: "Mostrar opciones"
|
|
969
|
+
showOptions: "Mostrar opciones",
|
|
970
|
+
hide: "Ocultar",
|
|
971
|
+
show: "Mostrar",
|
|
972
|
+
opensInNewTab: "Abre en una nueva pestaña"
|
|
969
973
|
},
|
|
970
974
|
form: {
|
|
971
975
|
selectAll: "Seleccionar todos",
|
|
@@ -1028,8 +1032,6 @@ const es = {
|
|
|
1028
1032
|
},
|
|
1029
1033
|
legend: {
|
|
1030
1034
|
layerOptions: "Opciones de capa",
|
|
1031
|
-
hide: "Ocultar",
|
|
1032
|
-
show: "Mostrar",
|
|
1033
1035
|
layer: "capa",
|
|
1034
1036
|
opacity: "Opacidad",
|
|
1035
1037
|
hideLayer: "Ocultar capa",
|
|
@@ -1111,7 +1113,10 @@ const id = {
|
|
|
1111
1113
|
copy: "Salin",
|
|
1112
1114
|
save: "Simpan",
|
|
1113
1115
|
add: "Tambah",
|
|
1114
|
-
showOptions: "Tampilkan opsi"
|
|
1116
|
+
showOptions: "Tampilkan opsi",
|
|
1117
|
+
hide: "Sembunyikan",
|
|
1118
|
+
show: "Tampilkan",
|
|
1119
|
+
opensInNewTab: "Buka di tab baru"
|
|
1115
1120
|
},
|
|
1116
1121
|
form: {
|
|
1117
1122
|
selectAll: "Select all",
|
|
@@ -1174,8 +1179,6 @@ const id = {
|
|
|
1174
1179
|
},
|
|
1175
1180
|
legend: {
|
|
1176
1181
|
layerOptions: "Opsi Layer",
|
|
1177
|
-
hide: "Sembunyikan",
|
|
1178
|
-
show: "Tampilkan",
|
|
1179
1182
|
layer: "layer",
|
|
1180
1183
|
opacity: "Opasitas",
|
|
1181
1184
|
hideLayer: "Sembunyikan layer",
|
|
@@ -818,7 +818,10 @@ const en = {
|
|
|
818
818
|
copy: "Copy",
|
|
819
819
|
save: "Save",
|
|
820
820
|
add: "Add",
|
|
821
|
-
showOptions: "Show options"
|
|
821
|
+
showOptions: "Show options",
|
|
822
|
+
hide: "Hide",
|
|
823
|
+
show: "Show",
|
|
824
|
+
opensInNewTab: "Opens in new tab"
|
|
822
825
|
},
|
|
823
826
|
form: {
|
|
824
827
|
selectAll: "Select all",
|
|
@@ -881,8 +884,6 @@ const en = {
|
|
|
881
884
|
},
|
|
882
885
|
legend: {
|
|
883
886
|
layerOptions: "Layer options",
|
|
884
|
-
hide: "Hide",
|
|
885
|
-
show: "Show",
|
|
886
887
|
layer: "layer",
|
|
887
888
|
opacity: "Opacity",
|
|
888
889
|
hideLayer: "Hide layer",
|
|
@@ -966,7 +967,10 @@ const es = {
|
|
|
966
967
|
copy: "Copiar",
|
|
967
968
|
save: "Guardar",
|
|
968
969
|
add: "Añadir",
|
|
969
|
-
showOptions: "Mostrar opciones"
|
|
970
|
+
showOptions: "Mostrar opciones",
|
|
971
|
+
hide: "Ocultar",
|
|
972
|
+
show: "Mostrar",
|
|
973
|
+
opensInNewTab: "Abre en una nueva pestaña"
|
|
970
974
|
},
|
|
971
975
|
form: {
|
|
972
976
|
selectAll: "Seleccionar todos",
|
|
@@ -1029,8 +1033,6 @@ const es = {
|
|
|
1029
1033
|
},
|
|
1030
1034
|
legend: {
|
|
1031
1035
|
layerOptions: "Opciones de capa",
|
|
1032
|
-
hide: "Ocultar",
|
|
1033
|
-
show: "Mostrar",
|
|
1034
1036
|
layer: "capa",
|
|
1035
1037
|
opacity: "Opacidad",
|
|
1036
1038
|
hideLayer: "Ocultar capa",
|
|
@@ -1112,7 +1114,10 @@ const id = {
|
|
|
1112
1114
|
copy: "Salin",
|
|
1113
1115
|
save: "Simpan",
|
|
1114
1116
|
add: "Tambah",
|
|
1115
|
-
showOptions: "Tampilkan opsi"
|
|
1117
|
+
showOptions: "Tampilkan opsi",
|
|
1118
|
+
hide: "Sembunyikan",
|
|
1119
|
+
show: "Tampilkan",
|
|
1120
|
+
opensInNewTab: "Buka di tab baru"
|
|
1116
1121
|
},
|
|
1117
1122
|
form: {
|
|
1118
1123
|
selectAll: "Select all",
|
|
@@ -1175,8 +1180,6 @@ const id = {
|
|
|
1175
1180
|
},
|
|
1176
1181
|
legend: {
|
|
1177
1182
|
layerOptions: "Opsi Layer",
|
|
1178
|
-
hide: "Sembunyikan",
|
|
1179
|
-
show: "Tampilkan",
|
|
1180
1183
|
layer: "layer",
|
|
1181
1184
|
opacity: "Opasitas",
|
|
1182
1185
|
hideLayer: "Sembunyikan layer",
|