@carto/meridian-ds 1.4.4-alpha-icons-shapes.2 → 1.4.5-alpha-external-link.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 -1
- package/dist/{SwatchSquare-DDi0beUM.js → SwatchSquare-DhaaXt53.js} +1 -1
- package/dist/{SwatchSquare-w-U8-O-P.cjs → SwatchSquare-benaO55C.cjs} +1 -1
- package/dist/components/index.cjs +264 -0
- package/dist/components/index.js +267 -3
- package/dist/custom-icons/index.cjs +448 -310
- package/dist/custom-icons/index.js +448 -310
- package/dist/theme/index.cjs +2 -7
- package/dist/theme/index.js +2 -7
- package/dist/types/components/atoms/ExternalLink.d.ts +21 -0
- package/dist/types/components/atoms/ExternalLink.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +2 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -1
- package/dist/types/components/molecules/Tag.d.ts +31 -0
- package/dist/types/components/molecules/Tag.d.ts.map +1 -0
- package/dist/types/components/molecules/index.d.ts +2 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -1
- package/dist/types/custom-icons/AiTool.d.ts +4 -0
- package/dist/types/custom-icons/AiTool.d.ts.map +1 -0
- package/dist/types/custom-icons/AsynchronousWait.d.ts +4 -0
- package/dist/types/custom-icons/AsynchronousWait.d.ts.map +1 -0
- package/dist/types/custom-icons/NoLayer.d.ts +4 -0
- package/dist/types/custom-icons/NoLayer.d.ts.map +1 -0
- package/dist/types/custom-icons/index.d.ts +3 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -1
- package/dist/types/theme/sections/components/data-display.d.ts.map +1 -1
- package/dist/widgets/index.cjs +1 -1
- package/dist/widgets/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- New Link and ExternalLink components [#202](https://github.com/CartoDB/meridian-ds/pull/202)
|
|
6
6
|
|
|
7
7
|
## 1.0
|
|
8
8
|
|
|
9
|
+
### 1.4.5
|
|
10
|
+
|
|
11
|
+
- Fix Icon shapes size [#194](https://github.com/CartoDB/meridian-ds/pull/194)
|
|
12
|
+
- New Tag component [#191](https://github.com/CartoDB/meridian-ds/pull/191)
|
|
13
|
+
|
|
9
14
|
### 1.4.4
|
|
10
15
|
|
|
11
16
|
- feat(widgets): Pie&Category widget acceps otherValues prop [#186](https://github.com/CartoDB/meridian-ds/pull/186)
|
|
@@ -27,7 +27,7 @@ function Search({ width, height, sx, ...props }, ref) {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
const Search$1 = forwardRef(Search);
|
|
30
|
-
const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx("rect", { x: 4, y: 4, fill: "currentColor", rx: 2 }) });
|
|
30
|
+
const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
|
|
31
31
|
const BaseSvgIcon = createSvgIcon(Icon(), "SwatchSquare");
|
|
32
32
|
function SwatchSquare({ width, height, sx, ...props }, ref) {
|
|
33
33
|
return /* @__PURE__ */ jsx(
|
|
@@ -28,7 +28,7 @@ function Search({ width, height, sx, ...props }, ref) {
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
const Search$1 = React.forwardRef(Search);
|
|
31
|
-
const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 4, y: 4, fill: "currentColor", rx: 2 }) });
|
|
31
|
+
const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
|
|
32
32
|
const BaseSvgIcon = utils.createSvgIcon(Icon(), "SwatchSquare");
|
|
33
33
|
function SwatchSquare({ width, height, sx, ...props }, ref) {
|
|
34
34
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6,6 +6,8 @@ const material = require("@mui/material");
|
|
|
6
6
|
const TablePaginationActions = require("../TablePaginationActions-CFGXm44W.cjs");
|
|
7
7
|
const reactIntl = require("react-intl");
|
|
8
8
|
const iconsMaterial = require("@mui/icons-material");
|
|
9
|
+
const Link = require("@mui/material/Link");
|
|
10
|
+
const styles = require("@mui/material/styles");
|
|
9
11
|
const Alert$1 = require("../Alert-zqtoWsBL.cjs");
|
|
10
12
|
require("cartocolor");
|
|
11
13
|
const MenuItem = require("../MenuItem-Br2jY2lt.cjs");
|
|
@@ -439,6 +441,77 @@ function _IconButton({
|
|
|
439
441
|
) });
|
|
440
442
|
}
|
|
441
443
|
const IconButton = React.forwardRef(_IconButton);
|
|
444
|
+
const externalLinkProps = {
|
|
445
|
+
target: "_blank",
|
|
446
|
+
rel: "noopener noreferrer"
|
|
447
|
+
};
|
|
448
|
+
const InlineLink = styles.styled(Link)(
|
|
449
|
+
({ fontWeight = 500 }) => ({
|
|
450
|
+
display: "inline",
|
|
451
|
+
fontWeight
|
|
452
|
+
})
|
|
453
|
+
);
|
|
454
|
+
const IconOpenInNewOutlined = styles.styled(iconsMaterial.OpenInNewOutlined)(() => ({
|
|
455
|
+
display: "inline",
|
|
456
|
+
fontSize: "1em",
|
|
457
|
+
// in some place, like alerts all svg/icon colors are overriden, so force color to link color
|
|
458
|
+
color: `inherit !important`,
|
|
459
|
+
"> path": {
|
|
460
|
+
color: "inherit !important"
|
|
461
|
+
}
|
|
462
|
+
}));
|
|
463
|
+
const IconWrapperInline = styles.styled("span")(() => ({
|
|
464
|
+
marginLeft: "0.25em",
|
|
465
|
+
position: "relative",
|
|
466
|
+
top: "calc(1em * 5.0/32)"
|
|
467
|
+
// heuristic to align icon with true perceived baseline
|
|
468
|
+
}));
|
|
469
|
+
const StyledButton = styles.styled(Button)(({ size, theme }) => ({
|
|
470
|
+
"& > span": {
|
|
471
|
+
display: "inline-flex",
|
|
472
|
+
alignItems: "center"
|
|
473
|
+
},
|
|
474
|
+
...size === "small" && {
|
|
475
|
+
svg: {
|
|
476
|
+
width: `${theme.spacing(2)} !important`,
|
|
477
|
+
height: `${theme.spacing(2)} !important`
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}));
|
|
481
|
+
function _ExternalLink({
|
|
482
|
+
children,
|
|
483
|
+
showIcon = true,
|
|
484
|
+
useButton = false,
|
|
485
|
+
icon = /* @__PURE__ */ jsxRuntime.jsx(IconOpenInNewOutlined, {}),
|
|
486
|
+
...props
|
|
487
|
+
}, ref) {
|
|
488
|
+
if (useButton) {
|
|
489
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
490
|
+
StyledButton,
|
|
491
|
+
{
|
|
492
|
+
...externalLinkProps,
|
|
493
|
+
endIcon: showIcon && icon,
|
|
494
|
+
...props,
|
|
495
|
+
ref,
|
|
496
|
+
children
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
} else {
|
|
500
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
501
|
+
InlineLink,
|
|
502
|
+
{
|
|
503
|
+
...externalLinkProps,
|
|
504
|
+
...props,
|
|
505
|
+
ref,
|
|
506
|
+
children: [
|
|
507
|
+
children,
|
|
508
|
+
showIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapperInline, { children: icon })
|
|
509
|
+
]
|
|
510
|
+
}
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
const ExternalLink = React.forwardRef(_ExternalLink);
|
|
442
515
|
const StyledMenu = material.styled(material.Menu, {
|
|
443
516
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
444
517
|
})(({ theme, extended, width, height }) => ({
|
|
@@ -1755,6 +1828,195 @@ function Snackbar({
|
|
|
1755
1828
|
}
|
|
1756
1829
|
) });
|
|
1757
1830
|
}
|
|
1831
|
+
function colorProps(color, variant, theme, disabled) {
|
|
1832
|
+
if (disabled) {
|
|
1833
|
+
if (variant === "outlined") {
|
|
1834
|
+
return {
|
|
1835
|
+
color: theme.palette.text.disabled,
|
|
1836
|
+
backgroundColor: theme.palette.black[4],
|
|
1837
|
+
borderColor: theme.palette.action.focus
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
return {
|
|
1841
|
+
color: theme.palette.text.disabled,
|
|
1842
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
1843
|
+
borderColor: "transparent"
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
switch (color) {
|
|
1847
|
+
case "default":
|
|
1848
|
+
if (variant === "outlined") {
|
|
1849
|
+
return {
|
|
1850
|
+
color: theme.palette.text.secondary,
|
|
1851
|
+
backgroundColor: theme.palette.black["4"],
|
|
1852
|
+
borderColor: theme.palette.divider
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
return {
|
|
1856
|
+
color: theme.palette.text.primary,
|
|
1857
|
+
backgroundColor: theme.palette.default.main,
|
|
1858
|
+
borderColor: "transparent"
|
|
1859
|
+
};
|
|
1860
|
+
case "primary":
|
|
1861
|
+
if (variant === "outlined") {
|
|
1862
|
+
return {
|
|
1863
|
+
color: theme.palette.primary.main,
|
|
1864
|
+
backgroundColor: theme.palette.primary.relatedLight,
|
|
1865
|
+
borderColor: theme.palette.primary.main
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
return {
|
|
1869
|
+
color: theme.palette.primary.contrastText,
|
|
1870
|
+
backgroundColor: theme.palette.primary.main,
|
|
1871
|
+
borderColor: "transparent"
|
|
1872
|
+
};
|
|
1873
|
+
case "secondary":
|
|
1874
|
+
if (variant === "outlined") {
|
|
1875
|
+
return {
|
|
1876
|
+
color: theme.palette.secondary.main,
|
|
1877
|
+
backgroundColor: theme.palette.secondary.relatedLight,
|
|
1878
|
+
borderColor: theme.palette.secondary.main
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
return {
|
|
1882
|
+
color: theme.palette.text.primary,
|
|
1883
|
+
backgroundColor: theme.palette.secondary.main,
|
|
1884
|
+
borderColor: "transparent"
|
|
1885
|
+
};
|
|
1886
|
+
case "success":
|
|
1887
|
+
if (variant === "outlined") {
|
|
1888
|
+
return {
|
|
1889
|
+
color: theme.palette.success.main,
|
|
1890
|
+
backgroundColor: theme.palette.success.relatedLight,
|
|
1891
|
+
borderColor: theme.palette.success.main
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
return {
|
|
1895
|
+
color: theme.palette.success.main,
|
|
1896
|
+
backgroundColor: theme.palette.success.relatedLight,
|
|
1897
|
+
borderColor: "transparent"
|
|
1898
|
+
};
|
|
1899
|
+
case "warning":
|
|
1900
|
+
if (variant === "outlined") {
|
|
1901
|
+
return {
|
|
1902
|
+
color: theme.palette.warning.main,
|
|
1903
|
+
backgroundColor: theme.palette.warning.relatedLight,
|
|
1904
|
+
borderColor: theme.palette.warning.main
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
return {
|
|
1908
|
+
color: theme.palette.text.primary,
|
|
1909
|
+
backgroundColor: theme.palette.warning.main,
|
|
1910
|
+
borderColor: "transparent"
|
|
1911
|
+
};
|
|
1912
|
+
case "error":
|
|
1913
|
+
if (variant === "outlined") {
|
|
1914
|
+
return {
|
|
1915
|
+
color: theme.palette.error.main,
|
|
1916
|
+
backgroundColor: theme.palette.error.relatedLight,
|
|
1917
|
+
borderColor: theme.palette.error.main
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
return {
|
|
1921
|
+
color: theme.palette.primary.contrastText,
|
|
1922
|
+
backgroundColor: theme.palette.error.main,
|
|
1923
|
+
borderColor: "transparent"
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
const TagRoot = material.styled("div", {
|
|
1928
|
+
shouldForwardProp: (prop) => !["color", "variant", "disabled"].includes(prop)
|
|
1929
|
+
})(({
|
|
1930
|
+
color,
|
|
1931
|
+
variant,
|
|
1932
|
+
disabled,
|
|
1933
|
+
theme
|
|
1934
|
+
}) => {
|
|
1935
|
+
return {
|
|
1936
|
+
display: "inline-flex",
|
|
1937
|
+
flexDirection: "row",
|
|
1938
|
+
flexWrap: "nowrap",
|
|
1939
|
+
alignItems: "center",
|
|
1940
|
+
padding: theme.spacing(0, 0.5),
|
|
1941
|
+
borderRadius: theme.spacing(0.25),
|
|
1942
|
+
gap: theme.spacing(0.5),
|
|
1943
|
+
height: theme.spacing(2),
|
|
1944
|
+
borderWidth: "1px",
|
|
1945
|
+
borderStyle: "solid",
|
|
1946
|
+
...colorProps(color ?? "primary", variant ?? "filled", theme, disabled),
|
|
1947
|
+
'.Mui-selected &, [aria-selected="true"] &': {
|
|
1948
|
+
borderColor: theme.palette.primary.main,
|
|
1949
|
+
backgroundColor: theme.palette.primary.background,
|
|
1950
|
+
".MuiTypography-root": {
|
|
1951
|
+
color: theme.palette.primary.main
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
});
|
|
1956
|
+
const TagIcon = material.styled("div")(({ theme }) => ({
|
|
1957
|
+
display: "flex",
|
|
1958
|
+
justifyContent: "center",
|
|
1959
|
+
alignItems: "center",
|
|
1960
|
+
"& svg": {
|
|
1961
|
+
width: theme.spacing(TablePaginationActions.ICON_SIZE_SMALL),
|
|
1962
|
+
height: theme.spacing(TablePaginationActions.ICON_SIZE_SMALL),
|
|
1963
|
+
"& g": {
|
|
1964
|
+
fill: "currentColor"
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}));
|
|
1968
|
+
const TagLabel = material.styled("div", {
|
|
1969
|
+
shouldForwardProp: (prop) => !["type"].includes(prop)
|
|
1970
|
+
})(({ type, theme }) => ({
|
|
1971
|
+
display: "flex",
|
|
1972
|
+
alignItems: "center",
|
|
1973
|
+
paddingTop: type === "code" ? theme.spacing(0.25) : void 0
|
|
1974
|
+
}));
|
|
1975
|
+
function _Tag({
|
|
1976
|
+
label,
|
|
1977
|
+
color = "primary",
|
|
1978
|
+
variant = "filled",
|
|
1979
|
+
icon,
|
|
1980
|
+
type = "default",
|
|
1981
|
+
typographyProps,
|
|
1982
|
+
noWrap = true,
|
|
1983
|
+
disabled,
|
|
1984
|
+
...otherProps
|
|
1985
|
+
}, ref) {
|
|
1986
|
+
const typeCode = type === "code";
|
|
1987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1988
|
+
TagRoot,
|
|
1989
|
+
{
|
|
1990
|
+
ref,
|
|
1991
|
+
className: "CartoTag-root",
|
|
1992
|
+
color,
|
|
1993
|
+
variant,
|
|
1994
|
+
disabled,
|
|
1995
|
+
"aria-disabled": disabled,
|
|
1996
|
+
"data-color": color,
|
|
1997
|
+
"data-variant": variant,
|
|
1998
|
+
"data-type": type,
|
|
1999
|
+
"data-name": "tag",
|
|
2000
|
+
...otherProps,
|
|
2001
|
+
children: [
|
|
2002
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(TagIcon, { children: icon }),
|
|
2003
|
+
/* @__PURE__ */ jsxRuntime.jsx(TagLabel, { type, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2004
|
+
TablePaginationActions.Typography,
|
|
2005
|
+
{
|
|
2006
|
+
component: "span",
|
|
2007
|
+
color: "inherit",
|
|
2008
|
+
variant: typeCode ? "code3" : "caption",
|
|
2009
|
+
weight: typeCode ? "strong" : "medium",
|
|
2010
|
+
noWrap,
|
|
2011
|
+
...typographyProps,
|
|
2012
|
+
children: label
|
|
2013
|
+
}
|
|
2014
|
+
) })
|
|
2015
|
+
]
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
const Tag = React.forwardRef(_Tag);
|
|
1758
2020
|
const Menu = material.styled("div")(({ theme }) => ({
|
|
1759
2021
|
display: "flex",
|
|
1760
2022
|
alignItems: "center",
|
|
@@ -4383,6 +4645,7 @@ exports.DialogFooter = DialogFooter;
|
|
|
4383
4645
|
exports.DialogHeader = DialogHeader;
|
|
4384
4646
|
exports.DialogPaper = DialogPaper;
|
|
4385
4647
|
exports.DialogStepper = DialogStepper;
|
|
4648
|
+
exports.ExternalLink = ExternalLink;
|
|
4386
4649
|
exports.IconButton = IconButton;
|
|
4387
4650
|
exports.LabelWithIndicator = LabelWithIndicator;
|
|
4388
4651
|
exports.Menu = Menu$1;
|
|
@@ -4393,6 +4656,7 @@ exports.MultipleSelectField = MultipleSelectField;
|
|
|
4393
4656
|
exports.PasswordField = PasswordField;
|
|
4394
4657
|
exports.SelectField = SelectField;
|
|
4395
4658
|
exports.Snackbar = Snackbar;
|
|
4659
|
+
exports.Tag = Tag;
|
|
4396
4660
|
exports.TimePicker = TimePicker;
|
|
4397
4661
|
exports.ToggleButtonGroup = ToggleButtonGroup;
|
|
4398
4662
|
exports.TooltipData = TooltipData;
|
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useEffect, useMemo, useRef, Fragment as Fragment$1, useImperativeHandle, useCallback } from "react";
|
|
3
|
-
import { styled, Box, Button as Button$1, CircularProgress, TextField, InputAdornment, IconButton as IconButton$1, Tooltip, Select, MenuItem, FormControl, InputLabel, FormHelperText, ToggleButtonGroup as ToggleButtonGroup$1, Menu as Menu$2, MenuList as MenuList$1, Link, Checkbox, ListItemText, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, alpha, useTheme, Toolbar, AppBar as AppBar$1, Paper, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
3
|
+
import { styled, Box, Button as Button$1, CircularProgress, TextField, InputAdornment, IconButton as IconButton$1, Tooltip, Select, MenuItem, FormControl, InputLabel, FormHelperText, ToggleButtonGroup as ToggleButtonGroup$1, Menu as Menu$2, MenuList as MenuList$1, Link as Link$1, Checkbox, ListItemText, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, alpha, useTheme, Toolbar, AppBar as AppBar$1, Paper, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
4
4
|
import { T as Typography, c as ICON_SIZE_SMALL, u as useImperativeIntl, N as NOTIFICATION_DURATION_IN_MS, A as APPBAR_SIZE } from "../TablePaginationActions-KpTvhN4Y.js";
|
|
5
5
|
import { a } from "../TablePaginationActions-KpTvhN4Y.js";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
|
-
import { VisibilityOffOutlined, VisibilityOutlined, Cancel, AddCircleOutlineOutlined, ContentCopyOutlined, CloseOutlined, MenuOutlined, HelpOutline, TodayOutlined, MoreVertOutlined, ErrorOutline, Check } from "@mui/icons-material";
|
|
7
|
+
import { VisibilityOffOutlined, VisibilityOutlined, OpenInNewOutlined, Cancel, AddCircleOutlineOutlined, ContentCopyOutlined, CloseOutlined, MenuOutlined, HelpOutline, TodayOutlined, MoreVertOutlined, ErrorOutline, Check } from "@mui/icons-material";
|
|
8
|
+
import Link from "@mui/material/Link";
|
|
9
|
+
import { styled as styled$1 } from "@mui/material/styles";
|
|
8
10
|
import { A as Alert$1 } from "../Alert-D8jI1sG4.js";
|
|
9
11
|
import "cartocolor";
|
|
10
12
|
import { M as MenuItem$1 } from "../MenuItem-CXnnE5lK.js";
|
|
@@ -438,6 +440,77 @@ function _IconButton({
|
|
|
438
440
|
) });
|
|
439
441
|
}
|
|
440
442
|
const IconButton = forwardRef(_IconButton);
|
|
443
|
+
const externalLinkProps = {
|
|
444
|
+
target: "_blank",
|
|
445
|
+
rel: "noopener noreferrer"
|
|
446
|
+
};
|
|
447
|
+
const InlineLink = styled$1(Link)(
|
|
448
|
+
({ fontWeight = 500 }) => ({
|
|
449
|
+
display: "inline",
|
|
450
|
+
fontWeight
|
|
451
|
+
})
|
|
452
|
+
);
|
|
453
|
+
const IconOpenInNewOutlined = styled$1(OpenInNewOutlined)(() => ({
|
|
454
|
+
display: "inline",
|
|
455
|
+
fontSize: "1em",
|
|
456
|
+
// in some place, like alerts all svg/icon colors are overriden, so force color to link color
|
|
457
|
+
color: `inherit !important`,
|
|
458
|
+
"> path": {
|
|
459
|
+
color: "inherit !important"
|
|
460
|
+
}
|
|
461
|
+
}));
|
|
462
|
+
const IconWrapperInline = styled$1("span")(() => ({
|
|
463
|
+
marginLeft: "0.25em",
|
|
464
|
+
position: "relative",
|
|
465
|
+
top: "calc(1em * 5.0/32)"
|
|
466
|
+
// heuristic to align icon with true perceived baseline
|
|
467
|
+
}));
|
|
468
|
+
const StyledButton = styled$1(Button)(({ size, theme }) => ({
|
|
469
|
+
"& > span": {
|
|
470
|
+
display: "inline-flex",
|
|
471
|
+
alignItems: "center"
|
|
472
|
+
},
|
|
473
|
+
...size === "small" && {
|
|
474
|
+
svg: {
|
|
475
|
+
width: `${theme.spacing(2)} !important`,
|
|
476
|
+
height: `${theme.spacing(2)} !important`
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}));
|
|
480
|
+
function _ExternalLink({
|
|
481
|
+
children,
|
|
482
|
+
showIcon = true,
|
|
483
|
+
useButton = false,
|
|
484
|
+
icon = /* @__PURE__ */ jsx(IconOpenInNewOutlined, {}),
|
|
485
|
+
...props
|
|
486
|
+
}, ref) {
|
|
487
|
+
if (useButton) {
|
|
488
|
+
return /* @__PURE__ */ jsx(
|
|
489
|
+
StyledButton,
|
|
490
|
+
{
|
|
491
|
+
...externalLinkProps,
|
|
492
|
+
endIcon: showIcon && icon,
|
|
493
|
+
...props,
|
|
494
|
+
ref,
|
|
495
|
+
children
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
} else {
|
|
499
|
+
return /* @__PURE__ */ jsxs(
|
|
500
|
+
InlineLink,
|
|
501
|
+
{
|
|
502
|
+
...externalLinkProps,
|
|
503
|
+
...props,
|
|
504
|
+
ref,
|
|
505
|
+
children: [
|
|
506
|
+
children,
|
|
507
|
+
showIcon && /* @__PURE__ */ jsx(IconWrapperInline, { children: icon })
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
const ExternalLink = forwardRef(_ExternalLink);
|
|
441
514
|
const StyledMenu = styled(Menu$2, {
|
|
442
515
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
443
516
|
})(({ theme, extended, width, height }) => ({
|
|
@@ -519,7 +592,7 @@ const MenuList = forwardRef(_MenuList);
|
|
|
519
592
|
const StyledMenuItem$1 = styled(MenuItem$1)(() => ({
|
|
520
593
|
marginTop: "0 !important"
|
|
521
594
|
}));
|
|
522
|
-
const LinkFilter = styled(Link)(
|
|
595
|
+
const LinkFilter = styled(Link$1)(
|
|
523
596
|
({ disabled, theme }) => ({
|
|
524
597
|
display: "flex",
|
|
525
598
|
alignItems: "center",
|
|
@@ -1754,6 +1827,195 @@ function Snackbar({
|
|
|
1754
1827
|
}
|
|
1755
1828
|
) });
|
|
1756
1829
|
}
|
|
1830
|
+
function colorProps(color, variant, theme, disabled) {
|
|
1831
|
+
if (disabled) {
|
|
1832
|
+
if (variant === "outlined") {
|
|
1833
|
+
return {
|
|
1834
|
+
color: theme.palette.text.disabled,
|
|
1835
|
+
backgroundColor: theme.palette.black[4],
|
|
1836
|
+
borderColor: theme.palette.action.focus
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
return {
|
|
1840
|
+
color: theme.palette.text.disabled,
|
|
1841
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
1842
|
+
borderColor: "transparent"
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
switch (color) {
|
|
1846
|
+
case "default":
|
|
1847
|
+
if (variant === "outlined") {
|
|
1848
|
+
return {
|
|
1849
|
+
color: theme.palette.text.secondary,
|
|
1850
|
+
backgroundColor: theme.palette.black["4"],
|
|
1851
|
+
borderColor: theme.palette.divider
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
return {
|
|
1855
|
+
color: theme.palette.text.primary,
|
|
1856
|
+
backgroundColor: theme.palette.default.main,
|
|
1857
|
+
borderColor: "transparent"
|
|
1858
|
+
};
|
|
1859
|
+
case "primary":
|
|
1860
|
+
if (variant === "outlined") {
|
|
1861
|
+
return {
|
|
1862
|
+
color: theme.palette.primary.main,
|
|
1863
|
+
backgroundColor: theme.palette.primary.relatedLight,
|
|
1864
|
+
borderColor: theme.palette.primary.main
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
return {
|
|
1868
|
+
color: theme.palette.primary.contrastText,
|
|
1869
|
+
backgroundColor: theme.palette.primary.main,
|
|
1870
|
+
borderColor: "transparent"
|
|
1871
|
+
};
|
|
1872
|
+
case "secondary":
|
|
1873
|
+
if (variant === "outlined") {
|
|
1874
|
+
return {
|
|
1875
|
+
color: theme.palette.secondary.main,
|
|
1876
|
+
backgroundColor: theme.palette.secondary.relatedLight,
|
|
1877
|
+
borderColor: theme.palette.secondary.main
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
return {
|
|
1881
|
+
color: theme.palette.text.primary,
|
|
1882
|
+
backgroundColor: theme.palette.secondary.main,
|
|
1883
|
+
borderColor: "transparent"
|
|
1884
|
+
};
|
|
1885
|
+
case "success":
|
|
1886
|
+
if (variant === "outlined") {
|
|
1887
|
+
return {
|
|
1888
|
+
color: theme.palette.success.main,
|
|
1889
|
+
backgroundColor: theme.palette.success.relatedLight,
|
|
1890
|
+
borderColor: theme.palette.success.main
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
return {
|
|
1894
|
+
color: theme.palette.success.main,
|
|
1895
|
+
backgroundColor: theme.palette.success.relatedLight,
|
|
1896
|
+
borderColor: "transparent"
|
|
1897
|
+
};
|
|
1898
|
+
case "warning":
|
|
1899
|
+
if (variant === "outlined") {
|
|
1900
|
+
return {
|
|
1901
|
+
color: theme.palette.warning.main,
|
|
1902
|
+
backgroundColor: theme.palette.warning.relatedLight,
|
|
1903
|
+
borderColor: theme.palette.warning.main
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
return {
|
|
1907
|
+
color: theme.palette.text.primary,
|
|
1908
|
+
backgroundColor: theme.palette.warning.main,
|
|
1909
|
+
borderColor: "transparent"
|
|
1910
|
+
};
|
|
1911
|
+
case "error":
|
|
1912
|
+
if (variant === "outlined") {
|
|
1913
|
+
return {
|
|
1914
|
+
color: theme.palette.error.main,
|
|
1915
|
+
backgroundColor: theme.palette.error.relatedLight,
|
|
1916
|
+
borderColor: theme.palette.error.main
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
return {
|
|
1920
|
+
color: theme.palette.primary.contrastText,
|
|
1921
|
+
backgroundColor: theme.palette.error.main,
|
|
1922
|
+
borderColor: "transparent"
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
const TagRoot = styled("div", {
|
|
1927
|
+
shouldForwardProp: (prop) => !["color", "variant", "disabled"].includes(prop)
|
|
1928
|
+
})(({
|
|
1929
|
+
color,
|
|
1930
|
+
variant,
|
|
1931
|
+
disabled,
|
|
1932
|
+
theme
|
|
1933
|
+
}) => {
|
|
1934
|
+
return {
|
|
1935
|
+
display: "inline-flex",
|
|
1936
|
+
flexDirection: "row",
|
|
1937
|
+
flexWrap: "nowrap",
|
|
1938
|
+
alignItems: "center",
|
|
1939
|
+
padding: theme.spacing(0, 0.5),
|
|
1940
|
+
borderRadius: theme.spacing(0.25),
|
|
1941
|
+
gap: theme.spacing(0.5),
|
|
1942
|
+
height: theme.spacing(2),
|
|
1943
|
+
borderWidth: "1px",
|
|
1944
|
+
borderStyle: "solid",
|
|
1945
|
+
...colorProps(color ?? "primary", variant ?? "filled", theme, disabled),
|
|
1946
|
+
'.Mui-selected &, [aria-selected="true"] &': {
|
|
1947
|
+
borderColor: theme.palette.primary.main,
|
|
1948
|
+
backgroundColor: theme.palette.primary.background,
|
|
1949
|
+
".MuiTypography-root": {
|
|
1950
|
+
color: theme.palette.primary.main
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
};
|
|
1954
|
+
});
|
|
1955
|
+
const TagIcon = styled("div")(({ theme }) => ({
|
|
1956
|
+
display: "flex",
|
|
1957
|
+
justifyContent: "center",
|
|
1958
|
+
alignItems: "center",
|
|
1959
|
+
"& svg": {
|
|
1960
|
+
width: theme.spacing(ICON_SIZE_SMALL),
|
|
1961
|
+
height: theme.spacing(ICON_SIZE_SMALL),
|
|
1962
|
+
"& g": {
|
|
1963
|
+
fill: "currentColor"
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}));
|
|
1967
|
+
const TagLabel = styled("div", {
|
|
1968
|
+
shouldForwardProp: (prop) => !["type"].includes(prop)
|
|
1969
|
+
})(({ type, theme }) => ({
|
|
1970
|
+
display: "flex",
|
|
1971
|
+
alignItems: "center",
|
|
1972
|
+
paddingTop: type === "code" ? theme.spacing(0.25) : void 0
|
|
1973
|
+
}));
|
|
1974
|
+
function _Tag({
|
|
1975
|
+
label,
|
|
1976
|
+
color = "primary",
|
|
1977
|
+
variant = "filled",
|
|
1978
|
+
icon,
|
|
1979
|
+
type = "default",
|
|
1980
|
+
typographyProps,
|
|
1981
|
+
noWrap = true,
|
|
1982
|
+
disabled,
|
|
1983
|
+
...otherProps
|
|
1984
|
+
}, ref) {
|
|
1985
|
+
const typeCode = type === "code";
|
|
1986
|
+
return /* @__PURE__ */ jsxs(
|
|
1987
|
+
TagRoot,
|
|
1988
|
+
{
|
|
1989
|
+
ref,
|
|
1990
|
+
className: "CartoTag-root",
|
|
1991
|
+
color,
|
|
1992
|
+
variant,
|
|
1993
|
+
disabled,
|
|
1994
|
+
"aria-disabled": disabled,
|
|
1995
|
+
"data-color": color,
|
|
1996
|
+
"data-variant": variant,
|
|
1997
|
+
"data-type": type,
|
|
1998
|
+
"data-name": "tag",
|
|
1999
|
+
...otherProps,
|
|
2000
|
+
children: [
|
|
2001
|
+
icon && /* @__PURE__ */ jsx(TagIcon, { children: icon }),
|
|
2002
|
+
/* @__PURE__ */ jsx(TagLabel, { type, children: /* @__PURE__ */ jsx(
|
|
2003
|
+
Typography,
|
|
2004
|
+
{
|
|
2005
|
+
component: "span",
|
|
2006
|
+
color: "inherit",
|
|
2007
|
+
variant: typeCode ? "code3" : "caption",
|
|
2008
|
+
weight: typeCode ? "strong" : "medium",
|
|
2009
|
+
noWrap,
|
|
2010
|
+
...typographyProps,
|
|
2011
|
+
children: label
|
|
2012
|
+
}
|
|
2013
|
+
) })
|
|
2014
|
+
]
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
}
|
|
2018
|
+
const Tag = forwardRef(_Tag);
|
|
1757
2019
|
const Menu = styled("div")(({ theme }) => ({
|
|
1758
2020
|
display: "flex",
|
|
1759
2021
|
alignItems: "center",
|
|
@@ -4380,6 +4642,7 @@ export {
|
|
|
4380
4642
|
DialogHeader,
|
|
4381
4643
|
DialogPaper,
|
|
4382
4644
|
DialogStepper,
|
|
4645
|
+
ExternalLink,
|
|
4383
4646
|
IconButton,
|
|
4384
4647
|
LabelWithIndicator,
|
|
4385
4648
|
Menu$1 as Menu,
|
|
@@ -4392,6 +4655,7 @@ export {
|
|
|
4392
4655
|
SelectField,
|
|
4393
4656
|
Snackbar,
|
|
4394
4657
|
a as TablePaginationActions,
|
|
4658
|
+
Tag,
|
|
4395
4659
|
TimePicker,
|
|
4396
4660
|
ToggleButtonGroup,
|
|
4397
4661
|
TooltipData,
|