@carto/meridian-ds 2.7.0 → 2.8.0

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 (71) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{Alert-BfDnWlbD.js → Alert-BZPM5zpX.js} +1 -1
  3. package/dist/{Alert-CPvYAHO_.cjs → Alert-C4W0H_uN.cjs} +1 -1
  4. package/dist/{MenuItem-ZSYcQBtg.cjs → MenuItem-CgF4QdGi.cjs} +1 -1
  5. package/dist/{MenuItem-D90EfuGS.js → MenuItem-DRUK149i.js} +1 -1
  6. package/dist/components/index.cjs +130 -81
  7. package/dist/components/index.js +139 -90
  8. package/dist/{css-utils-DjvM17Vb.cjs → css-utils-CH7es90t.cjs} +15 -0
  9. package/dist/{css-utils-BHYA7By_.js → css-utils-CjUBRJVK.js} +15 -0
  10. package/dist/custom-icons/index.cjs +296 -226
  11. package/dist/custom-icons/index.js +296 -226
  12. package/dist/theme/index.cjs +80 -3
  13. package/dist/theme/index.js +81 -4
  14. package/dist/types/components/CircularProgress/CircularProgress.d.ts +19 -0
  15. package/dist/types/components/CircularProgress/CircularProgress.d.ts.map +1 -0
  16. package/dist/types/components/CircularProgress/CircularProgress.stories.d.ts +72 -0
  17. package/dist/types/components/CircularProgress/CircularProgress.stories.d.ts.map +1 -0
  18. package/dist/types/components/CircularProgress/CircularProgress.test.d.ts +2 -0
  19. package/dist/types/components/CircularProgress/CircularProgress.test.d.ts.map +1 -0
  20. package/dist/types/components/CircularProgress/index.d.ts +3 -0
  21. package/dist/types/components/CircularProgress/index.d.ts.map +1 -0
  22. package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.d.ts +1 -1
  23. package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.d.ts.map +1 -1
  24. package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.stories.d.ts +13 -0
  25. package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.stories.d.ts.map +1 -1
  26. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
  27. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
  28. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +31 -0
  29. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
  30. package/dist/types/components/Dialog/types.d.ts +7 -1
  31. package/dist/types/components/Dialog/types.d.ts.map +1 -1
  32. package/dist/types/components/Loader/Loader.d.ts +4 -0
  33. package/dist/types/components/Loader/Loader.d.ts.map +1 -0
  34. package/dist/types/components/Loader/Loader.stories.d.ts +130 -0
  35. package/dist/types/components/Loader/Loader.stories.d.ts.map +1 -0
  36. package/dist/types/components/Loader/Loader.test.d.ts +2 -0
  37. package/dist/types/components/Loader/Loader.test.d.ts.map +1 -0
  38. package/dist/types/components/Loader/index.d.ts +3 -0
  39. package/dist/types/components/Loader/index.d.ts.map +1 -0
  40. package/dist/types/components/Loader/types.d.ts +40 -0
  41. package/dist/types/components/Loader/types.d.ts.map +1 -0
  42. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -1
  43. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -4
  44. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
  45. package/dist/types/components/index.d.ts +4 -0
  46. package/dist/types/components/index.d.ts.map +1 -1
  47. package/dist/types/custom-icons/CreateFolder.d.ts +4 -0
  48. package/dist/types/custom-icons/CreateFolder.d.ts.map +1 -0
  49. package/dist/types/custom-icons/FolderEmpty.d.ts +4 -0
  50. package/dist/types/custom-icons/FolderEmpty.d.ts.map +1 -0
  51. package/dist/types/custom-icons/SelectFeature.d.ts.map +1 -1
  52. package/dist/types/custom-icons/index.d.ts +2 -0
  53. package/dist/types/custom-icons/index.d.ts.map +1 -1
  54. package/dist/types/localization/en.d.ts +5 -0
  55. package/dist/types/localization/en.d.ts.map +1 -1
  56. package/dist/types/localization/es.d.ts +5 -0
  57. package/dist/types/localization/es.d.ts.map +1 -1
  58. package/dist/types/localization/id.d.ts +5 -0
  59. package/dist/types/localization/id.d.ts.map +1 -1
  60. package/dist/types/localization/index.d.ts +15 -0
  61. package/dist/types/localization/index.d.ts.map +1 -1
  62. package/dist/types/theme/components/buttons.d.ts.map +1 -1
  63. package/dist/types/theme/components/forms.d.ts.map +1 -1
  64. package/dist/types/theme/components/stories/{Progress.stories.d.ts → LinearProgress.stories.d.ts} +12 -22
  65. package/dist/types/theme/components/stories/LinearProgress.stories.d.ts.map +1 -0
  66. package/dist/types/theme/types.d.ts +11 -0
  67. package/dist/types/theme/types.d.ts.map +1 -1
  68. package/dist/widgets/index.cjs +2 -2
  69. package/dist/widgets/index.js +2 -2
  70. package/package.json +2 -2
  71. package/dist/types/theme/components/stories/Progress.stories.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  ## 2.0
6
6
 
7
+ ### 2.8.0
8
+
9
+ - New Loader and CircularProgress components [#329](https://github.com/CartoDB/meridian-ds/pull/329)
10
+ - Dialog: improve customization [#313](https://github.com/CartoDB/meridian-ds/pull/313)
11
+ - ToggleButtonGroup: move styles to the theme [#319](https://github.com/CartoDB/meridian-ds/pull/319)
12
+ - Custom Icons: CreateFolder,FolderEmpty [#331](https://github.com/CartoDB/meridian-ds/pull/331)
13
+
7
14
  ### 2.7.0
8
15
 
9
16
  - New SearchField component [#308](https://github.com/CartoDB/meridian-ds/pull/308)
@@ -3,7 +3,7 @@ import { forwardRef, useState } from "react";
3
3
  import { styled, Link as Link$1, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
4
  import { OpenInNewOutlined } from "@mui/icons-material";
5
5
  import "cartocolor";
6
- import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-BHYA7By_.js";
6
+ import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-CjUBRJVK.js";
7
7
  const ScreenReaderOnly = styled("span")(() => ({
8
8
  position: "absolute",
9
9
  width: 1,
@@ -4,7 +4,7 @@ const React = require("react");
4
4
  const material = require("@mui/material");
5
5
  const iconsMaterial = require("@mui/icons-material");
6
6
  require("cartocolor");
7
- const cssUtils = require("./css-utils-DjvM17Vb.cjs");
7
+ const cssUtils = require("./css-utils-CH7es90t.cjs");
8
8
  const ScreenReaderOnly = material.styled("span")(() => ({
9
9
  position: "absolute",
10
10
  width: 1,
@@ -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 cssUtils = require("./css-utils-DjvM17Vb.cjs");
5
+ const cssUtils = require("./css-utils-CH7es90t.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 { f as MENU_ITEM_SIZE_DENSE, h as MENU_ITEM_SIZE_EXTENDED } from "./css-utils-BHYA7By_.js";
4
+ import { f as MENU_ITEM_SIZE_DENSE, h as MENU_ITEM_SIZE_EXTENDED } from "./css-utils-CjUBRJVK.js";
5
5
  const StyledMenuItem = styled(MenuItem$1, {
6
6
  shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
7
7
  prop
@@ -4,11 +4,11 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const material = require("@mui/material");
6
6
  const iconsMaterial = require("@mui/icons-material");
7
- const cssUtils = require("../css-utils-DjvM17Vb.cjs");
8
- const Alert$1 = require("../Alert-CPvYAHO_.cjs");
7
+ const cssUtils = require("../css-utils-CH7es90t.cjs");
8
+ const Alert$1 = require("../Alert-C4W0H_uN.cjs");
9
9
  const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
10
10
  const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
11
- const MenuItem = require("../MenuItem-ZSYcQBtg.cjs");
11
+ const MenuItem = require("../MenuItem-CgF4QdGi.cjs");
12
12
  require("cartocolor");
13
13
  const reactWindow = require("react-window");
14
14
  const reactCodemirror2 = require("react-codemirror2");
@@ -775,77 +775,8 @@ function _MultipleSelectField({
775
775
  }
776
776
  const MultipleSelectField = React.forwardRef(_MultipleSelectField);
777
777
  const StyledToggleButtonGroup = material.styled(material.ToggleButtonGroup, {
778
- shouldForwardProp: (prop) => prop !== "variant" && prop !== "backgroundColor"
779
- })(({ variant, backgroundColor, theme }) => ({
780
- // Variants
781
- ...variant === "contained" && {
782
- boxShadow: "none"
783
- },
784
- ...variant === "unbounded" && {
785
- boxShadow: "none",
786
- borderRadius: theme.spacing(0.5),
787
- "& .MuiDivider-root": {
788
- height: theme.spacing(4),
789
- "&.MuiToggleButtonGroup-groupedHorizontal": {
790
- height: theme.spacing(4)
791
- },
792
- "&.MuiToggleButtonGroup-groupedVertical": {
793
- height: "auto",
794
- width: theme.spacing(4),
795
- margin: `${theme.spacing(0.5, 0, 1)} !important`,
796
- borderRadius: "0 !important"
797
- }
798
- },
799
- "& .MuiToggleButton-sizeSmall": {
800
- margin: 0,
801
- "&.MuiToggleButtonGroup-grouped:not(.MuiDivider-root)": {
802
- margin: 0
803
- },
804
- "& + .MuiDivider-root.MuiToggleButtonGroup-groupedHorizontal": {
805
- height: theme.spacing(3)
806
- },
807
- "& + .MuiDivider-root.MuiToggleButtonGroup-groupedVertical": {
808
- height: "auto",
809
- width: theme.spacing(3)
810
- }
811
- },
812
- ".MuiToggleButtonGroup-grouped:not(.MuiDivider-root)": {
813
- margin: 0,
814
- "&:first-of-type": {
815
- marginLeft: 0
816
- },
817
- "&:not(:last-of-type)": {
818
- marginRight: theme.spacing(0.5)
819
- }
820
- },
821
- "&.MuiToggleButtonGroup-horizontal:not(.MuiDivider-root)": {
822
- ".MuiToggleButtonGroup-grouped": {
823
- margin: theme.spacing(0, 0.5)
824
- }
825
- },
826
- "&.MuiToggleButtonGroup-vertical:not(.MuiDivider-root)": {
827
- ".MuiToggleButtonGroup-grouped": {
828
- margin: theme.spacing(0, 0, 0.5),
829
- "&:not(:last-of-type)": {
830
- marginRight: 0
831
- },
832
- "&:last-of-type": {
833
- marginBottom: 0
834
- }
835
- }
836
- }
837
- },
838
- // Colors
839
- ...backgroundColor === "primary" && {
840
- backgroundColor: theme.palette.background.paper
841
- },
842
- ...backgroundColor === "secondary" && {
843
- backgroundColor: theme.palette.background.default
844
- },
845
- ...backgroundColor === "transparent" && {
846
- backgroundColor: "transparent"
847
- }
848
- }));
778
+ shouldForwardProp: (prop) => prop !== "backgroundColor"
779
+ })();
849
780
  function _ToggleButtonGroup({
850
781
  children,
851
782
  variant = "floating",
@@ -861,6 +792,7 @@ function _ToggleButtonGroup({
861
792
  StyledToggleButtonGroup,
862
793
  {
863
794
  ...rest,
795
+ ref,
864
796
  variant,
865
797
  backgroundColor: resolvedBackgroundColor,
866
798
  orientation,
@@ -870,12 +802,107 @@ function _ToggleButtonGroup({
870
802
  "data-size": size,
871
803
  "data-background-color": resolvedBackgroundColor,
872
804
  "data-name": "toggle-button-group",
873
- ref,
874
805
  children
875
806
  }
876
807
  );
877
808
  }
878
809
  const ToggleButtonGroup = React.forwardRef(_ToggleButtonGroup);
810
+ function _CircularProgress({
811
+ color = "primary",
812
+ size = 40,
813
+ thickness = 4,
814
+ ...otherProps
815
+ }, ref) {
816
+ const muiColor = color === "neutral" ? void 0 : color;
817
+ return /* @__PURE__ */ jsxRuntime.jsx(
818
+ material.CircularProgress,
819
+ {
820
+ ...otherProps,
821
+ ref,
822
+ size,
823
+ thickness,
824
+ color: muiColor,
825
+ "data-name": "circular-progress",
826
+ "data-color": color,
827
+ "data-thickness": thickness
828
+ }
829
+ );
830
+ }
831
+ const CircularProgress = React.forwardRef(
832
+ _CircularProgress
833
+ );
834
+ const Wrapper = material.styled(material.Stack, {
835
+ shouldForwardProp: (prop) => prop !== "contentHeight"
836
+ })(({ contentHeight, theme }) => ({
837
+ alignItems: "center",
838
+ justifyContent: "center",
839
+ gap: theme.spacing(1.5),
840
+ width: "100%",
841
+ ...contentHeight && {
842
+ flex: 1,
843
+ height: contentHeight,
844
+ minHeight: contentHeight
845
+ }
846
+ }));
847
+ function _Loader({
848
+ label,
849
+ secondLabel,
850
+ contentHeight,
851
+ labelProps,
852
+ secondLabelProps,
853
+ iconProps,
854
+ sx,
855
+ ...otherProps
856
+ }, ref) {
857
+ const labelText = cssUtils.useTranslationWithFallback("c4r.utils.loader.label", label);
858
+ const hasAnyLabel = labelText || secondLabel;
859
+ return /* @__PURE__ */ jsxRuntime.jsxs(
860
+ Wrapper,
861
+ {
862
+ contentHeight,
863
+ sx,
864
+ ...otherProps,
865
+ ref,
866
+ "aria-busy": true,
867
+ "data-name": "loader",
868
+ "data-content-height": contentHeight,
869
+ children: [
870
+ /* @__PURE__ */ jsxRuntime.jsx(
871
+ CircularProgress,
872
+ {
873
+ color: "primary",
874
+ size: 40,
875
+ ...iconProps,
876
+ "aria-labelledby": hasAnyLabel ? "loader-label" : void 0
877
+ }
878
+ ),
879
+ hasAnyLabel && /* @__PURE__ */ jsxRuntime.jsxs(material.Stack, { direction: "column", alignItems: "center", children: [
880
+ labelText && /* @__PURE__ */ jsxRuntime.jsx(
881
+ cssUtils.Typography,
882
+ {
883
+ variant: "body2",
884
+ color: "textSecondary",
885
+ ...labelProps,
886
+ id: "loader-label",
887
+ children: labelText
888
+ }
889
+ ),
890
+ secondLabel && /* @__PURE__ */ jsxRuntime.jsx(
891
+ cssUtils.Typography,
892
+ {
893
+ variant: "body2",
894
+ color: "textSecondary",
895
+ ...secondLabelProps,
896
+ id: labelText ? void 0 : "loader-label",
897
+ children: secondLabel
898
+ }
899
+ )
900
+ ] })
901
+ ]
902
+ }
903
+ );
904
+ }
905
+ const Loader = React.forwardRef(_Loader);
879
906
  async function copyString(value) {
880
907
  return await navigator.clipboard.writeText(value);
881
908
  }
@@ -3206,6 +3233,8 @@ function DialogHeader({
3206
3233
  "aria-label": ariaLabel,
3207
3234
  closeIcon,
3208
3235
  closeTooltipText,
3236
+ tooltipProps,
3237
+ iconButtonProps,
3209
3238
  ...otherProps
3210
3239
  }) {
3211
3240
  const closeTooltipLabel = cssUtils.useTranslationWithFallback(
@@ -3231,7 +3260,15 @@ function DialogHeader({
3231
3260
  ] }),
3232
3261
  /* @__PURE__ */ jsxRuntime.jsxs(ItemsWrapper$1, { children: [
3233
3262
  secondaryActions,
3234
- onClose && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: closeTooltipLabel, placement: "left", children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { "data-testid": "CloseIcon" }) }) })
3263
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(
3264
+ material.Tooltip,
3265
+ {
3266
+ title: closeTooltipLabel,
3267
+ placement: "left",
3268
+ ...tooltipProps,
3269
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: onClose, ...iconButtonProps, children: closeIcon || /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { "data-testid": "CloseIcon" }) })
3270
+ }
3271
+ )
3235
3272
  ] })
3236
3273
  ] }),
3237
3274
  children
@@ -3495,10 +3532,13 @@ function DialogConfirmation({
3495
3532
  opened,
3496
3533
  "data-testid": dataTestId,
3497
3534
  "aria-label": ariaLabel,
3535
+ slideProps,
3498
3536
  ...alertProps
3499
3537
  }) {
3500
3538
  const containerRef = React.useRef(null);
3501
3539
  const theme = material.useTheme();
3540
+ const timeout = (slideProps == null ? void 0 : slideProps.timeout) ?? 350;
3541
+ const direction = (slideProps == null ? void 0 : slideProps.direction) ?? "up";
3502
3542
  const handleClickAway = () => {
3503
3543
  if (onClickAway) {
3504
3544
  onClickAway();
@@ -3515,13 +3555,17 @@ function DialogConfirmation({
3515
3555
  children: /* @__PURE__ */ jsxRuntime.jsx(ClickAwayListener, { onClickAway: handleClickAway, children: /* @__PURE__ */ jsxRuntime.jsx(
3516
3556
  material.Slide,
3517
3557
  {
3518
- direction: "up",
3519
- in: opened,
3520
- container: containerRef.current,
3521
3558
  mountOnEnter: true,
3522
3559
  unmountOnExit: true,
3523
3560
  easing: theme.transitions.easing.easeOut,
3524
- timeout: 350,
3561
+ direction,
3562
+ timeout,
3563
+ ...slideProps,
3564
+ in: opened,
3565
+ container: containerRef.current,
3566
+ "data-name": "dialog-confirmation-slide",
3567
+ "data-direction": direction,
3568
+ "data-timeout": timeout,
3525
3569
  children: /* @__PURE__ */ jsxRuntime.jsx(AnimationWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(BackdropContent, { children: [
3526
3570
  /* @__PURE__ */ jsxRuntime.jsx(DialogAlert, { severity, ...alertProps, children }),
3527
3571
  /* @__PURE__ */ jsxRuntime.jsx(DialogActions, { children: actions })
@@ -5071,7 +5115,10 @@ const SearchInputAdornment = material.styled(material.InputAdornment, {
5071
5115
  duration: theme.transitions.duration.short
5072
5116
  }),
5073
5117
  "&.MuiInputAdornment-positionStart": {
5074
- marginLeft: minimized ? theme.spacing(1) : void 0
5118
+ marginLeft: minimized ? theme.spacing(2) : void 0,
5119
+ "&.MuiInputAdornment-sizeSmall": {
5120
+ marginLeft: minimized ? theme.spacing(1) : void 0
5121
+ }
5075
5122
  },
5076
5123
  // End adornment
5077
5124
  "&.MuiInputAdornment-positionEnd": {
@@ -6114,6 +6161,7 @@ exports.Autocomplete = Autocomplete;
6114
6161
  exports.AutocompleteList = AutocompleteList;
6115
6162
  exports.Avatar = Avatar;
6116
6163
  exports.Button = Button;
6164
+ exports.CircularProgress = CircularProgress;
6117
6165
  exports.CodeAreaDialog = CodeAreaDialog;
6118
6166
  exports.CodeAreaDialogConfirmation = CodeAreaDialogConfirmation;
6119
6167
  exports.CodeAreaDialogContent = CodeAreaDialogContent;
@@ -6143,6 +6191,7 @@ exports.EllipsisWithTooltip = EllipsisWithTooltip;
6143
6191
  exports.FilterDropdown = FilterDropdown;
6144
6192
  exports.FilterDropdownMenuItem = FilterDropdownMenuItem;
6145
6193
  exports.LabelWithIndicator = LabelWithIndicator;
6194
+ exports.Loader = Loader;
6146
6195
  exports.Menu = Menu;
6147
6196
  exports.MenuItemFilter = MenuItemFilter;
6148
6197
  exports.MenuList = MenuList;