@carto/meridian-ds 1.4.4 → 1.4.5-alpha-external-link.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 (35) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{Alert-D8jI1sG4.js → Alert-BcaaL6lM.js} +20 -4
  3. package/dist/{Alert-zqtoWsBL.cjs → Alert-CVfTyHiz.cjs} +18 -2
  4. package/dist/{SwatchSquare-DDi0beUM.js → SwatchSquare-DhaaXt53.js} +1 -1
  5. package/dist/{SwatchSquare-w-U8-O-P.cjs → SwatchSquare-benaO55C.cjs} +1 -1
  6. package/dist/components/index.cjs +240 -1
  7. package/dist/components/index.js +243 -4
  8. package/dist/custom-icons/index.cjs +448 -310
  9. package/dist/custom-icons/index.js +448 -310
  10. package/dist/types/components/atoms/ExternalLink.d.ts +24 -0
  11. package/dist/types/components/atoms/ExternalLink.d.ts.map +1 -0
  12. package/dist/types/components/atoms/Link.d.ts +4 -0
  13. package/dist/types/components/atoms/Link.d.ts.map +1 -0
  14. package/dist/types/components/atoms/index.d.ts +4 -0
  15. package/dist/types/components/atoms/index.d.ts.map +1 -1
  16. package/dist/types/components/molecules/Tag.d.ts +31 -0
  17. package/dist/types/components/molecules/Tag.d.ts.map +1 -0
  18. package/dist/types/components/molecules/index.d.ts +2 -0
  19. package/dist/types/components/molecules/index.d.ts.map +1 -1
  20. package/dist/types/custom-icons/AiTool.d.ts +4 -0
  21. package/dist/types/custom-icons/AiTool.d.ts.map +1 -0
  22. package/dist/types/custom-icons/AsynchronousWait.d.ts +4 -0
  23. package/dist/types/custom-icons/AsynchronousWait.d.ts.map +1 -0
  24. package/dist/types/custom-icons/NoLayer.d.ts +4 -0
  25. package/dist/types/custom-icons/NoLayer.d.ts.map +1 -0
  26. package/dist/types/custom-icons/index.d.ts +3 -0
  27. package/dist/types/custom-icons/index.d.ts.map +1 -1
  28. package/dist/types/theme/types.d.ts +6 -0
  29. package/dist/types/theme/types.d.ts.map +1 -1
  30. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts +1 -1
  31. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts.map +1 -1
  32. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
  33. package/dist/widgets/index.cjs +5 -5
  34. package/dist/widgets/index.js +5 -5
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,8 +2,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - New Link and ExternalLink components [#202](https://github.com/CartoDB/meridian-ds/pull/202)
6
+
5
7
  ## 1.0
6
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
+
7
14
  ### 1.4.4
8
15
 
9
16
  - feat(widgets): Pie&Category widget acceps otherValues prop [#186](https://github.com/CartoDB/meridian-ds/pull/186)
@@ -1,7 +1,22 @@
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";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
4
2
  import { forwardRef, useState } from "react";
3
+ import { styled, Box, Link as Link$1, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
+ import { b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-KpTvhN4Y.js";
5
+ const Icon = styled(Box)(({ theme }) => ({
6
+ position: "relative",
7
+ display: "inline-block",
8
+ margin: theme.spacing(0, 0.25),
9
+ top: "calc(1em * 5.0/32)"
10
+ // heuristic to align icon with true perceived baseline
11
+ }));
12
+ function _Link({ children, startIcon, endIcon, ...otherProps }, ref) {
13
+ return /* @__PURE__ */ jsxs(Link$1, { ...otherProps, ref, children: [
14
+ startIcon && /* @__PURE__ */ jsx(Icon, { children: startIcon }),
15
+ children,
16
+ endIcon && /* @__PURE__ */ jsx(Icon, { children: endIcon })
17
+ ] });
18
+ }
19
+ const Link = forwardRef(_Link);
5
20
  const StyledAlert = styled(Alert$1, {
6
21
  shouldForwardProp: (prop) => ![
7
22
  "isNeutral",
@@ -130,5 +145,6 @@ function _Alert({
130
145
  }
131
146
  const Alert = forwardRef(_Alert);
132
147
  export {
133
- Alert as A
148
+ Alert as A,
149
+ Link as L
134
150
  };
@@ -1,8 +1,23 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
- const TablePaginationActions = require("./TablePaginationActions-CFGXm44W.cjs");
4
- const material = require("@mui/material");
5
3
  const React = require("react");
4
+ const material = require("@mui/material");
5
+ const TablePaginationActions = require("./TablePaginationActions-CFGXm44W.cjs");
6
+ const Icon = material.styled(material.Box)(({ theme }) => ({
7
+ position: "relative",
8
+ display: "inline-block",
9
+ margin: theme.spacing(0, 0.25),
10
+ top: "calc(1em * 5.0/32)"
11
+ // heuristic to align icon with true perceived baseline
12
+ }));
13
+ function _Link({ children, startIcon, endIcon, ...otherProps }, ref) {
14
+ return /* @__PURE__ */ jsxRuntime.jsxs(material.Link, { ...otherProps, ref, children: [
15
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: startIcon }),
16
+ children,
17
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: endIcon })
18
+ ] });
19
+ }
20
+ const Link = React.forwardRef(_Link);
6
21
  const StyledAlert = material.styled(material.Alert, {
7
22
  shouldForwardProp: (prop) => ![
8
23
  "isNeutral",
@@ -131,3 +146,4 @@ function _Alert({
131
146
  }
132
147
  const Alert = React.forwardRef(_Alert);
133
148
  exports.Alert = Alert;
149
+ exports.Link = Link;
@@ -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,7 +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 Alert$1 = require("../Alert-zqtoWsBL.cjs");
9
+ const styles = require("@mui/material/styles");
10
+ const Alert$1 = require("../Alert-CVfTyHiz.cjs");
10
11
  require("cartocolor");
11
12
  const MenuItem = require("../MenuItem-Br2jY2lt.cjs");
12
13
  const ArrowDown = require("../ArrowDown-8fLj23Ge.cjs");
@@ -439,6 +440,52 @@ function _IconButton({
439
440
  ) });
440
441
  }
441
442
  const IconButton = React.forwardRef(_IconButton);
443
+ const externalLinkProps = {
444
+ target: "_blank",
445
+ rel: "noopener noreferrer"
446
+ };
447
+ const IconOpenInNewOutlined = styles.styled(iconsMaterial.OpenInNewOutlined)(() => ({
448
+ fontSize: "1em",
449
+ // in some place, like alerts all svg/icon colors are overriden, so force color to link color
450
+ color: "inherit !important",
451
+ "> path": {
452
+ color: "inherit !important"
453
+ }
454
+ }));
455
+ function _ExternalLink({
456
+ children,
457
+ showIcon = true,
458
+ useButton = false,
459
+ icon = /* @__PURE__ */ jsxRuntime.jsx(IconOpenInNewOutlined, {}),
460
+ fontWeight = "medium",
461
+ ...props
462
+ }, ref) {
463
+ if (useButton) {
464
+ return /* @__PURE__ */ jsxRuntime.jsx(
465
+ Button,
466
+ {
467
+ ...externalLinkProps,
468
+ endIcon: showIcon && icon,
469
+ ...props,
470
+ ref,
471
+ children
472
+ }
473
+ );
474
+ } else {
475
+ return /* @__PURE__ */ jsxRuntime.jsx(
476
+ Alert$1.Link,
477
+ {
478
+ ...externalLinkProps,
479
+ endIcon: showIcon && icon,
480
+ fontWeight,
481
+ ...props,
482
+ ref,
483
+ children
484
+ }
485
+ );
486
+ }
487
+ }
488
+ const ExternalLink = React.forwardRef(_ExternalLink);
442
489
  const StyledMenu = material.styled(material.Menu, {
443
490
  shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
444
491
  })(({ theme, extended, width, height }) => ({
@@ -1755,6 +1802,195 @@ function Snackbar({
1755
1802
  }
1756
1803
  ) });
1757
1804
  }
1805
+ function colorProps(color, variant, theme, disabled) {
1806
+ if (disabled) {
1807
+ if (variant === "outlined") {
1808
+ return {
1809
+ color: theme.palette.text.disabled,
1810
+ backgroundColor: theme.palette.black[4],
1811
+ borderColor: theme.palette.action.focus
1812
+ };
1813
+ }
1814
+ return {
1815
+ color: theme.palette.text.disabled,
1816
+ backgroundColor: theme.palette.action.disabledBackground,
1817
+ borderColor: "transparent"
1818
+ };
1819
+ }
1820
+ switch (color) {
1821
+ case "default":
1822
+ if (variant === "outlined") {
1823
+ return {
1824
+ color: theme.palette.text.secondary,
1825
+ backgroundColor: theme.palette.black["4"],
1826
+ borderColor: theme.palette.divider
1827
+ };
1828
+ }
1829
+ return {
1830
+ color: theme.palette.text.primary,
1831
+ backgroundColor: theme.palette.default.main,
1832
+ borderColor: "transparent"
1833
+ };
1834
+ case "primary":
1835
+ if (variant === "outlined") {
1836
+ return {
1837
+ color: theme.palette.primary.main,
1838
+ backgroundColor: theme.palette.primary.relatedLight,
1839
+ borderColor: theme.palette.primary.main
1840
+ };
1841
+ }
1842
+ return {
1843
+ color: theme.palette.primary.contrastText,
1844
+ backgroundColor: theme.palette.primary.main,
1845
+ borderColor: "transparent"
1846
+ };
1847
+ case "secondary":
1848
+ if (variant === "outlined") {
1849
+ return {
1850
+ color: theme.palette.secondary.main,
1851
+ backgroundColor: theme.palette.secondary.relatedLight,
1852
+ borderColor: theme.palette.secondary.main
1853
+ };
1854
+ }
1855
+ return {
1856
+ color: theme.palette.text.primary,
1857
+ backgroundColor: theme.palette.secondary.main,
1858
+ borderColor: "transparent"
1859
+ };
1860
+ case "success":
1861
+ if (variant === "outlined") {
1862
+ return {
1863
+ color: theme.palette.success.main,
1864
+ backgroundColor: theme.palette.success.relatedLight,
1865
+ borderColor: theme.palette.success.main
1866
+ };
1867
+ }
1868
+ return {
1869
+ color: theme.palette.success.main,
1870
+ backgroundColor: theme.palette.success.relatedLight,
1871
+ borderColor: "transparent"
1872
+ };
1873
+ case "warning":
1874
+ if (variant === "outlined") {
1875
+ return {
1876
+ color: theme.palette.warning.main,
1877
+ backgroundColor: theme.palette.warning.relatedLight,
1878
+ borderColor: theme.palette.warning.main
1879
+ };
1880
+ }
1881
+ return {
1882
+ color: theme.palette.text.primary,
1883
+ backgroundColor: theme.palette.warning.main,
1884
+ borderColor: "transparent"
1885
+ };
1886
+ case "error":
1887
+ if (variant === "outlined") {
1888
+ return {
1889
+ color: theme.palette.error.main,
1890
+ backgroundColor: theme.palette.error.relatedLight,
1891
+ borderColor: theme.palette.error.main
1892
+ };
1893
+ }
1894
+ return {
1895
+ color: theme.palette.primary.contrastText,
1896
+ backgroundColor: theme.palette.error.main,
1897
+ borderColor: "transparent"
1898
+ };
1899
+ }
1900
+ }
1901
+ const TagRoot = material.styled("div", {
1902
+ shouldForwardProp: (prop) => !["color", "variant", "disabled"].includes(prop)
1903
+ })(({
1904
+ color,
1905
+ variant,
1906
+ disabled,
1907
+ theme
1908
+ }) => {
1909
+ return {
1910
+ display: "inline-flex",
1911
+ flexDirection: "row",
1912
+ flexWrap: "nowrap",
1913
+ alignItems: "center",
1914
+ padding: theme.spacing(0, 0.5),
1915
+ borderRadius: theme.spacing(0.25),
1916
+ gap: theme.spacing(0.5),
1917
+ height: theme.spacing(2),
1918
+ borderWidth: "1px",
1919
+ borderStyle: "solid",
1920
+ ...colorProps(color ?? "primary", variant ?? "filled", theme, disabled),
1921
+ '.Mui-selected &, [aria-selected="true"] &': {
1922
+ borderColor: theme.palette.primary.main,
1923
+ backgroundColor: theme.palette.primary.background,
1924
+ ".MuiTypography-root": {
1925
+ color: theme.palette.primary.main
1926
+ }
1927
+ }
1928
+ };
1929
+ });
1930
+ const TagIcon = material.styled("div")(({ theme }) => ({
1931
+ display: "flex",
1932
+ justifyContent: "center",
1933
+ alignItems: "center",
1934
+ "& svg": {
1935
+ width: theme.spacing(TablePaginationActions.ICON_SIZE_SMALL),
1936
+ height: theme.spacing(TablePaginationActions.ICON_SIZE_SMALL),
1937
+ "& g": {
1938
+ fill: "currentColor"
1939
+ }
1940
+ }
1941
+ }));
1942
+ const TagLabel = material.styled("div", {
1943
+ shouldForwardProp: (prop) => !["type"].includes(prop)
1944
+ })(({ type, theme }) => ({
1945
+ display: "flex",
1946
+ alignItems: "center",
1947
+ paddingTop: type === "code" ? theme.spacing(0.25) : void 0
1948
+ }));
1949
+ function _Tag({
1950
+ label,
1951
+ color = "primary",
1952
+ variant = "filled",
1953
+ icon,
1954
+ type = "default",
1955
+ typographyProps,
1956
+ noWrap = true,
1957
+ disabled,
1958
+ ...otherProps
1959
+ }, ref) {
1960
+ const typeCode = type === "code";
1961
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1962
+ TagRoot,
1963
+ {
1964
+ ref,
1965
+ className: "CartoTag-root",
1966
+ color,
1967
+ variant,
1968
+ disabled,
1969
+ "aria-disabled": disabled,
1970
+ "data-color": color,
1971
+ "data-variant": variant,
1972
+ "data-type": type,
1973
+ "data-name": "tag",
1974
+ ...otherProps,
1975
+ children: [
1976
+ icon && /* @__PURE__ */ jsxRuntime.jsx(TagIcon, { children: icon }),
1977
+ /* @__PURE__ */ jsxRuntime.jsx(TagLabel, { type, children: /* @__PURE__ */ jsxRuntime.jsx(
1978
+ TablePaginationActions.Typography,
1979
+ {
1980
+ component: "span",
1981
+ color: "inherit",
1982
+ variant: typeCode ? "code3" : "caption",
1983
+ weight: typeCode ? "strong" : "medium",
1984
+ noWrap,
1985
+ ...typographyProps,
1986
+ children: label
1987
+ }
1988
+ ) })
1989
+ ]
1990
+ }
1991
+ );
1992
+ }
1993
+ const Tag = React.forwardRef(_Tag);
1758
1994
  const Menu = material.styled("div")(({ theme }) => ({
1759
1995
  display: "flex",
1760
1996
  alignItems: "center",
@@ -4354,6 +4590,7 @@ function CodeAreaDialog({
4354
4590
  exports.TablePaginationActions = TablePaginationActions.TablePaginationActions;
4355
4591
  exports.Typography = TablePaginationActions.Typography;
4356
4592
  exports.Alert = Alert$1.Alert;
4593
+ exports.Link = Alert$1.Link;
4357
4594
  exports.MenuItem = MenuItem.MenuItem;
4358
4595
  exports.AccordionGroup = AccordionGroup;
4359
4596
  exports.AppBar = AppBar;
@@ -4383,6 +4620,7 @@ exports.DialogFooter = DialogFooter;
4383
4620
  exports.DialogHeader = DialogHeader;
4384
4621
  exports.DialogPaper = DialogPaper;
4385
4622
  exports.DialogStepper = DialogStepper;
4623
+ exports.ExternalLink = ExternalLink;
4386
4624
  exports.IconButton = IconButton;
4387
4625
  exports.LabelWithIndicator = LabelWithIndicator;
4388
4626
  exports.Menu = Menu$1;
@@ -4393,6 +4631,7 @@ exports.MultipleSelectField = MultipleSelectField;
4393
4631
  exports.PasswordField = PasswordField;
4394
4632
  exports.SelectField = SelectField;
4395
4633
  exports.Snackbar = Snackbar;
4634
+ exports.Tag = Tag;
4396
4635
  exports.TimePicker = TimePicker;
4397
4636
  exports.ToggleButtonGroup = ToggleButtonGroup;
4398
4637
  exports.TooltipData = TooltipData;
@@ -1,11 +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";
8
- import { A as Alert$1 } from "../Alert-D8jI1sG4.js";
7
+ import { VisibilityOffOutlined, VisibilityOutlined, OpenInNewOutlined, Cancel, AddCircleOutlineOutlined, ContentCopyOutlined, CloseOutlined, MenuOutlined, HelpOutline, TodayOutlined, MoreVertOutlined, ErrorOutline, Check } from "@mui/icons-material";
8
+ import { styled as styled$1 } from "@mui/material/styles";
9
+ import { L as Link, A as Alert$1 } from "../Alert-BcaaL6lM.js";
9
10
  import "cartocolor";
10
11
  import { M as MenuItem$1 } from "../MenuItem-CXnnE5lK.js";
11
12
  import { A as ArrowDown } from "../ArrowDown-CY_wMVJT.js";
@@ -438,6 +439,52 @@ function _IconButton({
438
439
  ) });
439
440
  }
440
441
  const IconButton = forwardRef(_IconButton);
442
+ const externalLinkProps = {
443
+ target: "_blank",
444
+ rel: "noopener noreferrer"
445
+ };
446
+ const IconOpenInNewOutlined = styled$1(OpenInNewOutlined)(() => ({
447
+ fontSize: "1em",
448
+ // in some place, like alerts all svg/icon colors are overriden, so force color to link color
449
+ color: "inherit !important",
450
+ "> path": {
451
+ color: "inherit !important"
452
+ }
453
+ }));
454
+ function _ExternalLink({
455
+ children,
456
+ showIcon = true,
457
+ useButton = false,
458
+ icon = /* @__PURE__ */ jsx(IconOpenInNewOutlined, {}),
459
+ fontWeight = "medium",
460
+ ...props
461
+ }, ref) {
462
+ if (useButton) {
463
+ return /* @__PURE__ */ jsx(
464
+ Button,
465
+ {
466
+ ...externalLinkProps,
467
+ endIcon: showIcon && icon,
468
+ ...props,
469
+ ref,
470
+ children
471
+ }
472
+ );
473
+ } else {
474
+ return /* @__PURE__ */ jsx(
475
+ Link,
476
+ {
477
+ ...externalLinkProps,
478
+ endIcon: showIcon && icon,
479
+ fontWeight,
480
+ ...props,
481
+ ref,
482
+ children
483
+ }
484
+ );
485
+ }
486
+ }
487
+ const ExternalLink = forwardRef(_ExternalLink);
441
488
  const StyledMenu = styled(Menu$2, {
442
489
  shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
443
490
  })(({ theme, extended, width, height }) => ({
@@ -519,7 +566,7 @@ const MenuList = forwardRef(_MenuList);
519
566
  const StyledMenuItem$1 = styled(MenuItem$1)(() => ({
520
567
  marginTop: "0 !important"
521
568
  }));
522
- const LinkFilter = styled(Link)(
569
+ const LinkFilter = styled(Link$1)(
523
570
  ({ disabled, theme }) => ({
524
571
  display: "flex",
525
572
  alignItems: "center",
@@ -1754,6 +1801,195 @@ function Snackbar({
1754
1801
  }
1755
1802
  ) });
1756
1803
  }
1804
+ function colorProps(color, variant, theme, disabled) {
1805
+ if (disabled) {
1806
+ if (variant === "outlined") {
1807
+ return {
1808
+ color: theme.palette.text.disabled,
1809
+ backgroundColor: theme.palette.black[4],
1810
+ borderColor: theme.palette.action.focus
1811
+ };
1812
+ }
1813
+ return {
1814
+ color: theme.palette.text.disabled,
1815
+ backgroundColor: theme.palette.action.disabledBackground,
1816
+ borderColor: "transparent"
1817
+ };
1818
+ }
1819
+ switch (color) {
1820
+ case "default":
1821
+ if (variant === "outlined") {
1822
+ return {
1823
+ color: theme.palette.text.secondary,
1824
+ backgroundColor: theme.palette.black["4"],
1825
+ borderColor: theme.palette.divider
1826
+ };
1827
+ }
1828
+ return {
1829
+ color: theme.palette.text.primary,
1830
+ backgroundColor: theme.palette.default.main,
1831
+ borderColor: "transparent"
1832
+ };
1833
+ case "primary":
1834
+ if (variant === "outlined") {
1835
+ return {
1836
+ color: theme.palette.primary.main,
1837
+ backgroundColor: theme.palette.primary.relatedLight,
1838
+ borderColor: theme.palette.primary.main
1839
+ };
1840
+ }
1841
+ return {
1842
+ color: theme.palette.primary.contrastText,
1843
+ backgroundColor: theme.palette.primary.main,
1844
+ borderColor: "transparent"
1845
+ };
1846
+ case "secondary":
1847
+ if (variant === "outlined") {
1848
+ return {
1849
+ color: theme.palette.secondary.main,
1850
+ backgroundColor: theme.palette.secondary.relatedLight,
1851
+ borderColor: theme.palette.secondary.main
1852
+ };
1853
+ }
1854
+ return {
1855
+ color: theme.palette.text.primary,
1856
+ backgroundColor: theme.palette.secondary.main,
1857
+ borderColor: "transparent"
1858
+ };
1859
+ case "success":
1860
+ if (variant === "outlined") {
1861
+ return {
1862
+ color: theme.palette.success.main,
1863
+ backgroundColor: theme.palette.success.relatedLight,
1864
+ borderColor: theme.palette.success.main
1865
+ };
1866
+ }
1867
+ return {
1868
+ color: theme.palette.success.main,
1869
+ backgroundColor: theme.palette.success.relatedLight,
1870
+ borderColor: "transparent"
1871
+ };
1872
+ case "warning":
1873
+ if (variant === "outlined") {
1874
+ return {
1875
+ color: theme.palette.warning.main,
1876
+ backgroundColor: theme.palette.warning.relatedLight,
1877
+ borderColor: theme.palette.warning.main
1878
+ };
1879
+ }
1880
+ return {
1881
+ color: theme.palette.text.primary,
1882
+ backgroundColor: theme.palette.warning.main,
1883
+ borderColor: "transparent"
1884
+ };
1885
+ case "error":
1886
+ if (variant === "outlined") {
1887
+ return {
1888
+ color: theme.palette.error.main,
1889
+ backgroundColor: theme.palette.error.relatedLight,
1890
+ borderColor: theme.palette.error.main
1891
+ };
1892
+ }
1893
+ return {
1894
+ color: theme.palette.primary.contrastText,
1895
+ backgroundColor: theme.palette.error.main,
1896
+ borderColor: "transparent"
1897
+ };
1898
+ }
1899
+ }
1900
+ const TagRoot = styled("div", {
1901
+ shouldForwardProp: (prop) => !["color", "variant", "disabled"].includes(prop)
1902
+ })(({
1903
+ color,
1904
+ variant,
1905
+ disabled,
1906
+ theme
1907
+ }) => {
1908
+ return {
1909
+ display: "inline-flex",
1910
+ flexDirection: "row",
1911
+ flexWrap: "nowrap",
1912
+ alignItems: "center",
1913
+ padding: theme.spacing(0, 0.5),
1914
+ borderRadius: theme.spacing(0.25),
1915
+ gap: theme.spacing(0.5),
1916
+ height: theme.spacing(2),
1917
+ borderWidth: "1px",
1918
+ borderStyle: "solid",
1919
+ ...colorProps(color ?? "primary", variant ?? "filled", theme, disabled),
1920
+ '.Mui-selected &, [aria-selected="true"] &': {
1921
+ borderColor: theme.palette.primary.main,
1922
+ backgroundColor: theme.palette.primary.background,
1923
+ ".MuiTypography-root": {
1924
+ color: theme.palette.primary.main
1925
+ }
1926
+ }
1927
+ };
1928
+ });
1929
+ const TagIcon = styled("div")(({ theme }) => ({
1930
+ display: "flex",
1931
+ justifyContent: "center",
1932
+ alignItems: "center",
1933
+ "& svg": {
1934
+ width: theme.spacing(ICON_SIZE_SMALL),
1935
+ height: theme.spacing(ICON_SIZE_SMALL),
1936
+ "& g": {
1937
+ fill: "currentColor"
1938
+ }
1939
+ }
1940
+ }));
1941
+ const TagLabel = styled("div", {
1942
+ shouldForwardProp: (prop) => !["type"].includes(prop)
1943
+ })(({ type, theme }) => ({
1944
+ display: "flex",
1945
+ alignItems: "center",
1946
+ paddingTop: type === "code" ? theme.spacing(0.25) : void 0
1947
+ }));
1948
+ function _Tag({
1949
+ label,
1950
+ color = "primary",
1951
+ variant = "filled",
1952
+ icon,
1953
+ type = "default",
1954
+ typographyProps,
1955
+ noWrap = true,
1956
+ disabled,
1957
+ ...otherProps
1958
+ }, ref) {
1959
+ const typeCode = type === "code";
1960
+ return /* @__PURE__ */ jsxs(
1961
+ TagRoot,
1962
+ {
1963
+ ref,
1964
+ className: "CartoTag-root",
1965
+ color,
1966
+ variant,
1967
+ disabled,
1968
+ "aria-disabled": disabled,
1969
+ "data-color": color,
1970
+ "data-variant": variant,
1971
+ "data-type": type,
1972
+ "data-name": "tag",
1973
+ ...otherProps,
1974
+ children: [
1975
+ icon && /* @__PURE__ */ jsx(TagIcon, { children: icon }),
1976
+ /* @__PURE__ */ jsx(TagLabel, { type, children: /* @__PURE__ */ jsx(
1977
+ Typography,
1978
+ {
1979
+ component: "span",
1980
+ color: "inherit",
1981
+ variant: typeCode ? "code3" : "caption",
1982
+ weight: typeCode ? "strong" : "medium",
1983
+ noWrap,
1984
+ ...typographyProps,
1985
+ children: label
1986
+ }
1987
+ ) })
1988
+ ]
1989
+ }
1990
+ );
1991
+ }
1992
+ const Tag = forwardRef(_Tag);
1757
1993
  const Menu = styled("div")(({ theme }) => ({
1758
1994
  display: "flex",
1759
1995
  alignItems: "center",
@@ -4380,8 +4616,10 @@ export {
4380
4616
  DialogHeader,
4381
4617
  DialogPaper,
4382
4618
  DialogStepper,
4619
+ ExternalLink,
4383
4620
  IconButton,
4384
4621
  LabelWithIndicator,
4622
+ Link,
4385
4623
  Menu$1 as Menu,
4386
4624
  MenuItem$1 as MenuItem,
4387
4625
  MenuItemFilter,
@@ -4392,6 +4630,7 @@ export {
4392
4630
  SelectField,
4393
4631
  Snackbar,
4394
4632
  a as TablePaginationActions,
4633
+ Tag,
4395
4634
  TimePicker,
4396
4635
  ToggleButtonGroup,
4397
4636
  TooltipData,