@carto/meridian-ds 2.5.5-alpha-ellipsis.2 → 2.5.5-alpha-translations.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/{Alert-wE4A0ify.js → Alert-CRVceJ9N.js} +20 -77
  3. package/dist/{Alert-CaashKPj.cjs → Alert-Dyw7Z9wJ.cjs} +22 -79
  4. package/dist/{MenuItem-BUe4eJZH.js → MenuItem-h41wtQTz.js} +1 -1
  5. package/dist/{MenuItem-BZWWJptW.cjs → MenuItem-o51jnNjL.cjs} +6 -6
  6. package/dist/{css-utils-W9dzgcXq.cjs → TablePaginationActions-CMC_ZxDN.cjs} +117 -61
  7. package/dist/{css-utils-CTJjJR0x.js → TablePaginationActions-DIFPc_wQ.js} +119 -63
  8. package/dist/components/index.cjs +163 -258
  9. package/dist/components/index.js +103 -198
  10. package/dist/theme/index.cjs +114 -108
  11. package/dist/theme/index.js +13 -7
  12. package/dist/types/components/AccordionGroup/AccordionGroup.d.ts +4 -1
  13. package/dist/types/components/AccordionGroup/AccordionGroup.d.ts.map +1 -1
  14. package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts +39 -9
  15. package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts.map +1 -1
  16. package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts +2 -0
  17. package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts.map +1 -0
  18. package/dist/types/components/AppBar/AppBar.d.ts +3 -1
  19. package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
  20. package/dist/types/components/AppBar/AppBar.stories.d.ts +2 -2
  21. package/dist/types/components/AppBar/AppBar.stories.d.ts.map +1 -1
  22. package/dist/types/components/AppBar/AppBar.test.d.ts +2 -0
  23. package/dist/types/components/AppBar/AppBar.test.d.ts.map +1 -0
  24. package/dist/types/components/Avatar/Avatar.d.ts +4 -1
  25. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  26. package/dist/types/components/Avatar/Avatar.stories.d.ts +1 -2
  27. package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
  28. package/dist/types/components/Avatar/Avatar.test.d.ts +2 -0
  29. package/dist/types/components/Avatar/Avatar.test.d.ts.map +1 -0
  30. package/dist/types/components/Button/Button.d.ts +5 -0
  31. package/dist/types/components/Button/Button.d.ts.map +1 -1
  32. package/dist/types/components/Button/Button.stories.d.ts +3 -0
  33. package/dist/types/components/Button/Button.stories.d.ts.map +1 -1
  34. package/dist/types/components/Link/Link.d.ts +5 -0
  35. package/dist/types/components/Link/Link.d.ts.map +1 -1
  36. package/dist/types/components/Link/Link.stories.d.ts +16 -20
  37. package/dist/types/components/Link/Link.stories.d.ts.map +1 -1
  38. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +5 -2
  39. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
  40. package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts +72 -0
  41. package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts.map +1 -0
  42. package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts +2 -0
  43. package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts.map +1 -0
  44. package/dist/types/components/Tag/Tag.d.ts +4 -176
  45. package/dist/types/components/Tag/Tag.d.ts.map +1 -1
  46. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -2
  47. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
  48. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +2 -2
  49. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts.map +1 -1
  50. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts +2 -0
  51. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts.map +1 -0
  52. package/dist/types/components/TooltipData/TooltipData.d.ts.map +1 -1
  53. package/dist/types/components/TooltipData/TooltipData.stories.d.ts +34 -0
  54. package/dist/types/components/TooltipData/TooltipData.stories.d.ts.map +1 -0
  55. package/dist/types/components/TooltipData/TooltipData.test.d.ts +2 -0
  56. package/dist/types/components/TooltipData/TooltipData.test.d.ts.map +1 -0
  57. package/dist/types/components/index.d.ts +0 -2
  58. package/dist/types/components/index.d.ts.map +1 -1
  59. package/dist/types/theme/components/forms.d.ts.map +1 -1
  60. package/dist/types/theme/components/stories/Tooltip.stories.d.ts +0 -3
  61. package/dist/types/theme/components/stories/Tooltip.stories.d.ts.map +1 -1
  62. package/dist/types/utils/useTranslationFallback.d.ts +20 -0
  63. package/dist/types/utils/useTranslationFallback.d.ts.map +1 -0
  64. package/dist/types/utils/useTranslationFallback.test.d.ts +2 -0
  65. package/dist/types/utils/useTranslationFallback.test.d.ts.map +1 -0
  66. package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts.map +1 -1
  67. package/dist/types/widgets/WrapperWidgetUI/WrapperWidgetUI.d.ts.map +1 -1
  68. package/dist/widgets/index.cjs +119 -114
  69. package/dist/widgets/index.js +9 -4
  70. package/package.json +1 -1
  71. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +0 -117
  72. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts.map +0 -1
  73. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +0 -66
  74. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +0 -1
  75. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts +0 -2
  76. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts.map +0 -1
  77. package/dist/types/components/EllipsisWithTooltip/index.d.ts +0 -3
  78. package/dist/types/components/EllipsisWithTooltip/index.d.ts.map +0 -1
  79. package/dist/types/utils/css-utils.d.ts +0 -14
  80. package/dist/types/utils/css-utils.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import require$$0 from "react-is";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Typography as Typography$1, Tooltip, IconButton, styled, Box } from "@mui/material";
3
+ import { Typography as Typography$1, styled, IconButton as IconButton$1, Tooltip, CircularProgress, Box } from "@mui/material";
4
4
  import { forwardRef } from "react";
5
5
  import { KeyboardArrowLeftOutlined, KeyboardArrowRightOutlined } from "@mui/icons-material";
6
6
  import { createIntlCache, createIntl, useIntl } from "react-intl";
@@ -781,6 +781,31 @@ const MENU_LIST_MAX_SIZE = 312;
781
781
  const MENU_ITEM_SIZE_DENSE = 24;
782
782
  const MENU_ITEM_SIZE_DEFAULT = 32;
783
783
  const MENU_ITEM_SIZE_EXTENDED = 48;
784
+ const FontWeight = {
785
+ regular: 400,
786
+ medium: 500,
787
+ strong: 600
788
+ };
789
+ function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
790
+ const fontConfiguration = {
791
+ fontWeight: FontWeight[weight],
792
+ fontStyle: italic ? "italic" : void 0
793
+ };
794
+ return /* @__PURE__ */ jsx(
795
+ Typography$1,
796
+ {
797
+ ...otherProps,
798
+ ref,
799
+ style: {
800
+ ...fontConfiguration,
801
+ ...style
802
+ },
803
+ "data-name": "typography",
804
+ children
805
+ }
806
+ );
807
+ }
808
+ const Typography = forwardRef(_Typography);
784
809
  const en = {
785
810
  c4r: {
786
811
  button: {
@@ -795,7 +820,7 @@ const en = {
795
820
  showOptions: "Show options",
796
821
  hide: "Hide",
797
822
  show: "Show",
798
- opensInNewTab: "Opens in new tab"
823
+ opensInNewTab: "(Opens in new tab)"
799
824
  },
800
825
  form: {
801
826
  selectAll: "Select all",
@@ -944,7 +969,7 @@ const es = {
944
969
  showOptions: "Mostrar opciones",
945
970
  hide: "Ocultar",
946
971
  show: "Mostrar",
947
- opensInNewTab: "Abre en una nueva pestaña"
972
+ opensInNewTab: "(Abre en una nueva pestaña)"
948
973
  },
949
974
  form: {
950
975
  selectAll: "Seleccionar todos",
@@ -1091,7 +1116,7 @@ const id = {
1091
1116
  showOptions: "Tampilkan opsi",
1092
1117
  hide: "Sembunyikan",
1093
1118
  show: "Tampilkan",
1094
- opensInNewTab: "Buka di tab baru"
1119
+ opensInNewTab: "(Buka di tab baru)"
1095
1120
  },
1096
1121
  form: {
1097
1122
  selectAll: "Select all",
@@ -5565,48 +5590,78 @@ const getGloballyCachedIntl = (intlConfig) => {
5565
5590
  function useImperativeIntl(intlConfig) {
5566
5591
  return getGloballyCachedIntl(intlConfig);
5567
5592
  }
5568
- const FontWeight = {
5569
- regular: 400,
5570
- medium: 500,
5571
- strong: 600
5572
- };
5573
- function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
5574
- const fontConfiguration = {
5575
- fontWeight: FontWeight[weight],
5576
- fontStyle: italic ? "italic" : void 0
5577
- };
5578
- return /* @__PURE__ */ jsx(
5579
- Typography$1,
5593
+ const Option = styled("div")(({ theme }) => ({
5594
+ position: "relative",
5595
+ display: "inline-flex",
5596
+ // TODO: Remove this once we have a better way to handle the spacing between icon buttons:
5597
+ // https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
5598
+ "& + &, & + .optionIconButton": {
5599
+ marginLeft: theme.spacing(0.5)
5600
+ }
5601
+ }));
5602
+ const StyledIconButton = styled(IconButton$1, {
5603
+ shouldForwardProp: (prop) => !["active"].includes(prop)
5604
+ })(({ active, theme }) => ({
5605
+ ...active && {
5606
+ color: theme.palette.primary.main,
5607
+ backgroundColor: theme.palette.primary.background,
5608
+ "& svg:not(.doNotFillIcon) path": {
5609
+ fill: theme.palette.primary.main
5610
+ }
5611
+ }
5612
+ }));
5613
+ function _IconButton({
5614
+ tooltip,
5615
+ tooltipPlacement = "top",
5616
+ icon,
5617
+ size = "medium",
5618
+ variant = "icon",
5619
+ color = "default",
5620
+ sx,
5621
+ className,
5622
+ loading,
5623
+ disabled,
5624
+ active,
5625
+ ...props
5626
+ }, ref) {
5627
+ return /* @__PURE__ */ jsx(Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsx(
5628
+ Option,
5580
5629
  {
5581
- ...otherProps,
5582
- ref,
5583
- style: {
5584
- ...fontConfiguration,
5585
- ...style
5586
- },
5587
- "data-name": "typography",
5588
- children
5630
+ className: `optionIconButton ${className ?? ""}`,
5631
+ sx,
5632
+ "data-testid": "icon-button",
5633
+ children: /* @__PURE__ */ jsx(
5634
+ StyledIconButton,
5635
+ {
5636
+ ...props,
5637
+ ref,
5638
+ size,
5639
+ variant,
5640
+ color,
5641
+ active,
5642
+ disabled: disabled || loading,
5643
+ role: "button",
5644
+ children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" }) : icon
5645
+ }
5646
+ )
5589
5647
  }
5590
- );
5648
+ ) });
5591
5649
  }
5592
- const Typography = forwardRef(_Typography);
5650
+ const IconButton = forwardRef(_IconButton);
5593
5651
  const Root = styled(Box)(({ theme }) => ({
5594
5652
  display: "flex",
5595
5653
  gap: theme.spacing(0.5),
5596
5654
  marginLeft: theme.spacing(1)
5597
5655
  }));
5598
- const Button = styled("div")(({ theme }) => ({
5599
- "& .MuiIconButton-root:not(.Mui-disabled)": {
5600
- color: theme.palette.text.secondary
5601
- }
5602
- }));
5603
- function TablePaginationActions({
5656
+ function _TablePaginationActions({
5604
5657
  count,
5605
5658
  page,
5606
5659
  rowsPerPage = 10,
5607
5660
  onPageChange,
5608
- lastPageTooltip
5609
- }) {
5661
+ lastPageTooltip,
5662
+ "aria-label": ariaLabel,
5663
+ "data-testid": dataTestId
5664
+ }, ref) {
5610
5665
  const intl = useIntl();
5611
5666
  const intlConfig = useImperativeIntl(intl);
5612
5667
  const handleBackButtonClick = (event) => {
@@ -5626,38 +5681,39 @@ function TablePaginationActions({
5626
5681
  const noMorePagesText = intlConfig.formatMessage({
5627
5682
  id: "c4r.form.pagination.noMorePages"
5628
5683
  });
5629
- return /* @__PURE__ */ jsxs(Root, { children: [
5630
- /* @__PURE__ */ jsx(Tooltip, { title: isFirstPage ? noMorePagesText : prevLabel, children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
5631
- IconButton,
5632
- {
5633
- onClick: handleBackButtonClick,
5634
- disabled: page === 0,
5635
- "aria-label": prevLabel,
5636
- children: /* @__PURE__ */ jsx(KeyboardArrowLeftOutlined, {})
5637
- }
5638
- ) }) }),
5639
- /* @__PURE__ */ jsx(
5640
- Tooltip,
5641
- {
5642
- title: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel,
5643
- children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
5684
+ return /* @__PURE__ */ jsxs(
5685
+ Root,
5686
+ {
5687
+ ref,
5688
+ "data-testid": dataTestId,
5689
+ "aria-label": ariaLabel,
5690
+ "data-name": "table-pagination-actions",
5691
+ children: [
5692
+ /* @__PURE__ */ jsx(
5693
+ IconButton,
5694
+ {
5695
+ onClick: handleBackButtonClick,
5696
+ disabled: page === 0,
5697
+ "aria-label": prevLabel,
5698
+ icon: /* @__PURE__ */ jsx(KeyboardArrowLeftOutlined, {}),
5699
+ tooltip: isFirstPage ? noMorePagesText : prevLabel
5700
+ }
5701
+ ),
5702
+ /* @__PURE__ */ jsx(
5644
5703
  IconButton,
5645
5704
  {
5646
5705
  onClick: handleNextButtonClick,
5647
5706
  disabled: page >= Math.ceil(count / rowsPerPage) - 1,
5648
- "aria-label": nextLabel.toLocaleLowerCase(),
5649
- children: /* @__PURE__ */ jsx(KeyboardArrowRightOutlined, {})
5707
+ "aria-label": nextLabel,
5708
+ icon: /* @__PURE__ */ jsx(KeyboardArrowRightOutlined, {}),
5709
+ tooltip: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel
5650
5710
  }
5651
- ) })
5652
- }
5653
- )
5654
- ] });
5711
+ )
5712
+ ]
5713
+ }
5714
+ );
5655
5715
  }
5656
- const ellipsisStyles = {
5657
- textOverflow: "ellipsis",
5658
- overflow: "hidden",
5659
- whiteSpace: "nowrap"
5660
- };
5716
+ const TablePaginationActions = forwardRef(_TablePaginationActions);
5661
5717
  export {
5662
5718
  APPBAR_SIZE as A,
5663
5719
  BREAKPOINTS as B,
@@ -5670,10 +5726,10 @@ export {
5670
5726
  ICON_SIZE_MEDIUM as b,
5671
5727
  ICON_SIZE_SMALL as c,
5672
5728
  MENU_LIST_MAX_SIZE as d,
5673
- ellipsisStyles as e,
5674
- MENU_ITEM_SIZE_DENSE as f,
5729
+ MENU_ITEM_SIZE_DENSE as e,
5730
+ MENU_ITEM_SIZE_EXTENDED as f,
5675
5731
  getSpacing as g,
5676
- MENU_ITEM_SIZE_EXTENDED as h,
5732
+ IconButton as h,
5677
5733
  getDefaultExportFromCjs as i,
5678
5734
  useImperativeIntl as u
5679
5735
  };