@carto/meridian-ds 1.4.7 → 1.4.8-alpha-external-link.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/{Alert-CywtIMOj.js → Alert-2L0Hy8lT.js} +74 -3
  3. package/dist/{Alert-BiOR9aar.cjs → Alert-CmDToT57.cjs} +72 -1
  4. package/dist/{OpenDiagonallyRight-BrRyCV4Q.cjs → OpenDiagonallyRight-CM1tojUq.cjs} +27 -0
  5. package/dist/{OpenDiagonallyRight-5HZXh46V.js → OpenDiagonallyRight-CSm5GYYJ.js} +27 -0
  6. package/dist/{TablePaginationActions-CFGXm44W.cjs → TablePaginationActions-CAmwcyTy.cjs} +6 -3
  7. package/dist/{TablePaginationActions-KpTvhN4Y.js → TablePaginationActions-b5wP_uRE.js} +6 -3
  8. package/dist/components/index.cjs +239 -21
  9. package/dist/components/index.js +246 -27
  10. package/dist/custom-icons/index.cjs +29 -55
  11. package/dist/custom-icons/index.js +29 -55
  12. package/dist/theme/index.cjs +1 -1
  13. package/dist/theme/index.js +2 -2
  14. package/dist/types/components/atoms/Button.d.ts +11 -0
  15. package/dist/types/components/atoms/Button.d.ts.map +1 -1
  16. package/dist/types/components/atoms/Link.d.ts +14 -0
  17. package/dist/types/components/atoms/Link.d.ts.map +1 -0
  18. package/dist/types/components/atoms/SplitButton.d.ts +17 -0
  19. package/dist/types/components/atoms/SplitButton.d.ts.map +1 -0
  20. package/dist/types/components/atoms/index.d.ts +4 -0
  21. package/dist/types/components/atoms/index.d.ts.map +1 -1
  22. package/dist/types/components/organisms/CodeArea/CodeAreaInput.d.ts.map +1 -1
  23. package/dist/types/components/organisms/CodeArea/CodeAreaTheme.d.ts.map +1 -1
  24. package/dist/types/components/organisms/CodeArea/index.d.ts +1 -0
  25. package/dist/types/components/organisms/CodeArea/index.d.ts.map +1 -1
  26. package/dist/types/components/organisms/CodeArea/types.d.ts +4 -0
  27. package/dist/types/components/organisms/CodeArea/types.d.ts.map +1 -1
  28. package/dist/types/components/organisms/CodeArea/utils.d.ts +34 -0
  29. package/dist/types/components/organisms/CodeArea/utils.d.ts.map +1 -1
  30. package/dist/types/localization/en.d.ts +1 -0
  31. package/dist/types/localization/en.d.ts.map +1 -1
  32. package/dist/types/localization/es.d.ts +1 -0
  33. package/dist/types/localization/es.d.ts.map +1 -1
  34. package/dist/types/localization/id.d.ts +1 -0
  35. package/dist/types/localization/id.d.ts.map +1 -1
  36. package/dist/types/localization/index.d.ts +3 -0
  37. package/dist/types/localization/index.d.ts.map +1 -1
  38. package/dist/types/theme/types.d.ts +6 -0
  39. package/dist/types/theme/types.d.ts.map +1 -1
  40. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts.map +1 -1
  41. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts +1 -1
  42. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts.map +1 -1
  43. package/dist/types/widgets/ChartLegend.d.ts +2 -1
  44. package/dist/types/widgets/ChartLegend.d.ts.map +1 -1
  45. package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts.map +1 -1
  46. package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
  47. package/dist/widgets/index.cjs +14 -13
  48. package/dist/widgets/index.js +15 -14
  49. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,16 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - New Link components and Button with externalLink behavior [#202](https://github.com/CartoDB/meridian-ds/pull/202)
6
+ - Fix tooltips in ChartLegend pagination buttons [201](https://github.com/CartoDB/meridian-ds/pull/201)
7
+ - Add `SplitButton` [#212](https://github.com/CartoDB/meridian-ds/pull/212)
8
+ - CodeArea: Add automatic text marking for markdown [#209](https://github.com/CartoDB/meridian-ds/pull/209)
9
+
5
10
  ## 1.0
6
11
 
12
+ ### 1.4.8
13
+
14
+ - Fix Category Widget Blanks [#210](https://github.com/CartoDB/meridian-ds/pull/210)
15
+ - Add support for labels in Pie widget legend and ChartLegend [#208](https://github.com/CartoDB/meridian-ds/pull/208)
16
+
7
17
  ### 1.4.7
8
18
 
9
19
  - Fix Category Widget max value calculation [#206](https://github.com/CartoDB/meridian-ds/pull/206)
10
20
 
11
21
  ### 1.4.6
12
22
 
13
- - Fix tooltips in ChartLegend pagination buttons [201](https://github.com/CartoDB/meridian-ds/pull/201)
14
- - Remove `scrollIntoView` from Category Widget [203](https://github.com/CartoDB/meridian-ds/pull/203)
23
+ - Fix tooltips in ChartLegend pagination buttons [#201](https://github.com/CartoDB/meridian-ds/pull/201)
24
+ - Remove `scrollIntoView` from Category Widget [#203](https://github.com/CartoDB/meridian-ds/pull/203)
15
25
 
16
26
  ### 1.4.5
17
27
 
@@ -1,7 +1,10 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useState } from "react";
3
- import { styled, IconButton as IconButton$1, Tooltip, CircularProgress, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
- import { b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-KpTvhN4Y.js";
3
+ import { styled, IconButton as IconButton$1, Tooltip, CircularProgress, Link as Link$1, Box, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
+ import { useIntl } from "react-intl";
5
+ import { OpenInNewOutlined } from "@mui/icons-material";
6
+ import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, I as ICON_SIZE_LARGE, u as useImperativeIntl, T as Typography } from "./TablePaginationActions-b5wP_uRE.js";
7
+ import "cartocolor";
5
8
  const Option = styled("div")(({ theme }) => ({
6
9
  position: "relative",
7
10
  display: "inline-flex",
@@ -60,6 +63,73 @@ function _IconButton({
60
63
  ) });
61
64
  }
62
65
  const IconButton = forwardRef(_IconButton);
66
+ const StyledLink = styled(Link$1)(({ theme }) => ({
67
+ display: "inline-flex",
68
+ alignItems: "center",
69
+ gap: theme.spacing(0.25)
70
+ }));
71
+ const Icon = styled(Box, {
72
+ shouldForwardProp: (prop) => prop !== "variant"
73
+ })(({ variant }) => ({
74
+ display: "flex",
75
+ svg: {
76
+ // Size adapts to the text size, but make sure the icon size is at least 12px
77
+ fontSize: `max(1em, ${ICON_SIZE_SMALL})`,
78
+ color: "inherit !important",
79
+ "> path": {
80
+ color: "inherit !important"
81
+ },
82
+ // Defined sizes in design specs
83
+ ...variant === "caption" && {
84
+ fontSize: ICON_SIZE_SMALL
85
+ },
86
+ ...variant === "button" && {
87
+ fontSize: ICON_SIZE_MEDIUM
88
+ },
89
+ ...variant === "body2" && {
90
+ fontSize: ICON_SIZE_MEDIUM
91
+ },
92
+ ...variant === "body1" && {
93
+ fontSize: ICON_SIZE_LARGE
94
+ }
95
+ }
96
+ }));
97
+ function _Link({
98
+ children,
99
+ variant,
100
+ startIcon,
101
+ endIcon,
102
+ color,
103
+ external,
104
+ showExternalIcon = true,
105
+ ...otherProps
106
+ }, ref) {
107
+ const intl = useIntl();
108
+ const intlConfig = useImperativeIntl(intl);
109
+ return /* @__PURE__ */ jsxs(
110
+ StyledLink,
111
+ {
112
+ ...otherProps,
113
+ variant,
114
+ "data-color": color,
115
+ "data-name": "link",
116
+ role: "link",
117
+ color,
118
+ ref,
119
+ target: external ? "_blank" : void 0,
120
+ rel: external ? "noopener noreferrer" : void 0,
121
+ "aria-label": external ? `${children == null ? void 0 : children.toString()} (${intlConfig.formatMessage({
122
+ id: "c4r.button.opensInNewTab"
123
+ })})` : void 0,
124
+ children: [
125
+ startIcon && /* @__PURE__ */ jsx(Icon, { variant, children: startIcon }),
126
+ children,
127
+ (endIcon || external && showExternalIcon) && /* @__PURE__ */ jsx(Icon, { variant, children: endIcon || /* @__PURE__ */ jsx(OpenInNewOutlined, {}) })
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ const Link = forwardRef(_Link);
63
133
  const StyledAlert = styled(Alert$1, {
64
134
  shouldForwardProp: (prop) => ![
65
135
  "isNeutral",
@@ -189,5 +259,6 @@ function _Alert({
189
259
  const Alert = forwardRef(_Alert);
190
260
  export {
191
261
  Alert as A,
192
- IconButton as I
262
+ IconButton as I,
263
+ Link as L
193
264
  };
@@ -2,7 +2,10 @@
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-CFGXm44W.cjs");
5
+ const reactIntl = require("react-intl");
6
+ const iconsMaterial = require("@mui/icons-material");
7
+ const TablePaginationActions = require("./TablePaginationActions-CAmwcyTy.cjs");
8
+ require("cartocolor");
6
9
  const Option = material.styled("div")(({ theme }) => ({
7
10
  position: "relative",
8
11
  display: "inline-flex",
@@ -61,6 +64,73 @@ function _IconButton({
61
64
  ) });
62
65
  }
63
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
+ // Size adapts to the text size, but make sure the icon size is at least 12px
78
+ fontSize: `max(1em, ${TablePaginationActions.ICON_SIZE_SMALL})`,
79
+ color: "inherit !important",
80
+ "> path": {
81
+ color: "inherit !important"
82
+ },
83
+ // Defined sizes in design specs
84
+ ...variant === "caption" && {
85
+ fontSize: TablePaginationActions.ICON_SIZE_SMALL
86
+ },
87
+ ...variant === "button" && {
88
+ fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
89
+ },
90
+ ...variant === "body2" && {
91
+ fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
92
+ },
93
+ ...variant === "body1" && {
94
+ fontSize: TablePaginationActions.ICON_SIZE_LARGE
95
+ }
96
+ }
97
+ }));
98
+ function _Link({
99
+ children,
100
+ variant,
101
+ startIcon,
102
+ endIcon,
103
+ color,
104
+ external,
105
+ showExternalIcon = true,
106
+ ...otherProps
107
+ }, ref) {
108
+ const intl = reactIntl.useIntl();
109
+ const intlConfig = TablePaginationActions.useImperativeIntl(intl);
110
+ return /* @__PURE__ */ jsxRuntime.jsxs(
111
+ StyledLink,
112
+ {
113
+ ...otherProps,
114
+ variant,
115
+ "data-color": color,
116
+ "data-name": "link",
117
+ role: "link",
118
+ color,
119
+ ref,
120
+ target: external ? "_blank" : void 0,
121
+ rel: external ? "noopener noreferrer" : void 0,
122
+ "aria-label": external ? `${children == null ? void 0 : children.toString()} (${intlConfig.formatMessage({
123
+ id: "c4r.button.opensInNewTab"
124
+ })})` : void 0,
125
+ children: [
126
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, children: startIcon }),
127
+ children,
128
+ (endIcon || external && showExternalIcon) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, children: endIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) })
129
+ ]
130
+ }
131
+ );
132
+ }
133
+ const Link = React.forwardRef(_Link);
64
134
  const StyledAlert = material.styled(material.Alert, {
65
135
  shouldForwardProp: (prop) => ![
66
136
  "isNeutral",
@@ -190,3 +260,4 @@ function _Alert({
190
260
  const Alert = React.forwardRef(_Alert);
191
261
  exports.Alert = Alert;
192
262
  exports.IconButton = IconButton;
263
+ exports.Link = Link;
@@ -2,6 +2,32 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const React = require("react");
4
4
  const utils = require("@mui/material/utils");
5
+ const Icon$2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
6
+ "path",
7
+ {
8
+ fill: "currentColor",
9
+ fillRule: "evenodd",
10
+ d: "M12.01 11.83 15.18 15l1.41-1.41L12.01 9l-4.59 4.59L8.84 15z",
11
+ clipRule: "evenodd"
12
+ }
13
+ ) });
14
+ const BaseSvgIcon$2 = utils.createSvgIcon(Icon$2(), "ArrowUp");
15
+ function ArrowUp({ width, height, sx, ...props }, ref) {
16
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
+ BaseSvgIcon$2,
18
+ {
19
+ ref,
20
+ viewBox: "0 0 24 24",
21
+ sx: {
22
+ width,
23
+ height: height || width,
24
+ ...sx
25
+ },
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ const ArrowUp$1 = React.forwardRef(ArrowUp);
5
31
  const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
6
32
  "path",
7
33
  {
@@ -54,5 +80,6 @@ function OpenDiagonallyRight({ width, height, sx, ...props }, ref) {
54
80
  );
55
81
  }
56
82
  const OpenDiagonallyRight$1 = React.forwardRef(OpenDiagonallyRight);
83
+ exports.ArrowUp = ArrowUp$1;
57
84
  exports.CloseDiagonallyRight = CloseDiagonallyRight$1;
58
85
  exports.OpenDiagonallyRight = OpenDiagonallyRight$1;
@@ -1,6 +1,32 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { createSvgIcon } from "@mui/material/utils";
4
+ const Icon$2 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
5
+ "path",
6
+ {
7
+ fill: "currentColor",
8
+ fillRule: "evenodd",
9
+ d: "M12.01 11.83 15.18 15l1.41-1.41L12.01 9l-4.59 4.59L8.84 15z",
10
+ clipRule: "evenodd"
11
+ }
12
+ ) });
13
+ const BaseSvgIcon$2 = createSvgIcon(Icon$2(), "ArrowUp");
14
+ function ArrowUp({ width, height, sx, ...props }, ref) {
15
+ return /* @__PURE__ */ jsx(
16
+ BaseSvgIcon$2,
17
+ {
18
+ ref,
19
+ viewBox: "0 0 24 24",
20
+ sx: {
21
+ width,
22
+ height: height || width,
23
+ ...sx
24
+ },
25
+ ...props
26
+ }
27
+ );
28
+ }
29
+ const ArrowUp$1 = forwardRef(ArrowUp);
4
30
  const Icon$1 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
5
31
  "path",
6
32
  {
@@ -54,6 +80,7 @@ function OpenDiagonallyRight({ width, height, sx, ...props }, ref) {
54
80
  }
55
81
  const OpenDiagonallyRight$1 = forwardRef(OpenDiagonallyRight);
56
82
  export {
83
+ ArrowUp$1 as A,
57
84
  CloseDiagonallyRight$1 as C,
58
85
  OpenDiagonallyRight$1 as O
59
86
  };
@@ -814,7 +814,8 @@ const en = {
814
814
  copy: "Copy",
815
815
  save: "Save",
816
816
  add: "Add",
817
- showOptions: "Show options"
817
+ showOptions: "Show options",
818
+ opensInNewTab: "Opens in new tab"
818
819
  },
819
820
  form: {
820
821
  selectAll: "Select all",
@@ -962,7 +963,8 @@ const es = {
962
963
  copy: "Copiar",
963
964
  save: "Guardar",
964
965
  add: "Añadir",
965
- showOptions: "Mostrar opciones"
966
+ showOptions: "Mostrar opciones",
967
+ opensInNewTab: "Abre en una nueva pestaña"
966
968
  },
967
969
  form: {
968
970
  selectAll: "Seleccionar todos",
@@ -1108,7 +1110,8 @@ const id = {
1108
1110
  copy: "Salin",
1109
1111
  save: "Simpan",
1110
1112
  add: "Tambah",
1111
- showOptions: "Tampilkan opsi"
1113
+ showOptions: "Tampilkan opsi",
1114
+ opensInNewTab: "Buka di tab baru"
1112
1115
  },
1113
1116
  form: {
1114
1117
  selectAll: "Select all",
@@ -813,7 +813,8 @@ const en = {
813
813
  copy: "Copy",
814
814
  save: "Save",
815
815
  add: "Add",
816
- showOptions: "Show options"
816
+ showOptions: "Show options",
817
+ opensInNewTab: "Opens in new tab"
817
818
  },
818
819
  form: {
819
820
  selectAll: "Select all",
@@ -961,7 +962,8 @@ const es = {
961
962
  copy: "Copiar",
962
963
  save: "Guardar",
963
964
  add: "Añadir",
964
- showOptions: "Mostrar opciones"
965
+ showOptions: "Mostrar opciones",
966
+ opensInNewTab: "Abre en una nueva pestaña"
965
967
  },
966
968
  form: {
967
969
  selectAll: "Seleccionar todos",
@@ -1107,7 +1109,8 @@ const id = {
1107
1109
  copy: "Salin",
1108
1110
  save: "Simpan",
1109
1111
  add: "Tambah",
1110
- showOptions: "Tampilkan opsi"
1112
+ showOptions: "Tampilkan opsi",
1113
+ opensInNewTab: "Buka di tab baru"
1111
1114
  },
1112
1115
  form: {
1113
1116
  selectAll: "Select all",