@carto/meridian-ds 2.5.5-alpha-translations.1 → 2.6.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 (33) hide show
  1. package/CHANGELOG.md +5 -2
  2. package/dist/{Alert-CRVceJ9N.js → Alert-DHd9hCGz.js} +1 -1
  3. package/dist/{Alert-Dyw7Z9wJ.cjs → Alert-DOeOwxOe.cjs} +7 -7
  4. package/dist/{MenuItem-o51jnNjL.cjs → MenuItem-CYJN2OVU.cjs} +6 -6
  5. package/dist/{MenuItem-h41wtQTz.js → MenuItem-MUmADf3e.js} +1 -1
  6. package/dist/components/index.cjs +222 -76
  7. package/dist/components/index.js +161 -15
  8. package/dist/{TablePaginationActions-CMC_ZxDN.cjs → css-utils-CCi3p7os.cjs} +6 -0
  9. package/dist/{TablePaginationActions-DIFPc_wQ.js → css-utils-WejOmkiI.js} +10 -4
  10. package/dist/theme/index.cjs +108 -114
  11. package/dist/theme/index.js +7 -13
  12. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +117 -0
  13. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts.map +1 -0
  14. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +66 -0
  15. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +1 -0
  16. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts +2 -0
  17. package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts.map +1 -0
  18. package/dist/types/components/EllipsisWithTooltip/index.d.ts +3 -0
  19. package/dist/types/components/EllipsisWithTooltip/index.d.ts.map +1 -0
  20. package/dist/types/components/Link/Link.stories.d.ts +0 -7
  21. package/dist/types/components/Link/Link.stories.d.ts.map +1 -1
  22. package/dist/types/components/Tag/Tag.d.ts +176 -4
  23. package/dist/types/components/Tag/Tag.d.ts.map +1 -1
  24. package/dist/types/components/index.d.ts +2 -0
  25. package/dist/types/components/index.d.ts.map +1 -1
  26. package/dist/types/theme/components/forms.d.ts.map +1 -1
  27. package/dist/types/utils/css-utils.d.ts +14 -0
  28. package/dist/types/utils/css-utils.d.ts.map +1 -0
  29. package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts.map +1 -1
  30. package/dist/types/widgets/WrapperWidgetUI/WrapperWidgetUI.d.ts.map +1 -1
  31. package/dist/widgets/index.cjs +114 -119
  32. package/dist/widgets/index.js +4 -9
  33. package/package.json +1 -1
@@ -2,14 +2,14 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
3
3
  import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
4
4
  import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, Check, TodayOutlined } from "@mui/icons-material";
5
- import { u as useTranslationFallback, S as ScreenReaderOnly, A as Alert$1 } from "../Alert-CRVceJ9N.js";
6
- import { L } from "../Alert-CRVceJ9N.js";
7
- import { T as Typography, c as ICON_SIZE_SMALL, u as useImperativeIntl, h as IconButton, e as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, f as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, N as NOTIFICATION_DURATION_IN_MS } from "../TablePaginationActions-DIFPc_wQ.js";
8
- import { a } from "../TablePaginationActions-DIFPc_wQ.js";
5
+ import { u as useTranslationFallback, S as ScreenReaderOnly, A as Alert$1 } from "../Alert-DHd9hCGz.js";
6
+ import { L } from "../Alert-DHd9hCGz.js";
7
+ import { T as Typography, c as ICON_SIZE_SMALL, u as useImperativeIntl, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-WejOmkiI.js";
8
+ import { a } from "../css-utils-WejOmkiI.js";
9
9
  import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
10
10
  import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
11
11
  import { useIntl } from "react-intl";
12
- import { M as MenuItem$1 } from "../MenuItem-h41wtQTz.js";
12
+ import { M as MenuItem$1 } from "../MenuItem-MUmADf3e.js";
13
13
  import "cartocolor";
14
14
  import { FixedSizeList } from "react-window";
15
15
  import { Controlled, UnControlled } from "react-codemirror2";
@@ -1869,7 +1869,7 @@ const BrandElements = styled("div")(({ theme }) => ({
1869
1869
  minWidth: "192px"
1870
1870
  }
1871
1871
  }));
1872
- const Content$4 = styled("div")(({ theme }) => ({
1872
+ const Content$5 = styled("div")(({ theme }) => ({
1873
1873
  display: "flex",
1874
1874
  alignItems: "center",
1875
1875
  justifyContent: "space-between",
@@ -1892,7 +1892,7 @@ function _AppBar({
1892
1892
  brandText && /* @__PURE__ */ jsx(BrandText, { text: brandText }),
1893
1893
  secondaryText && /* @__PURE__ */ jsx(SecondaryText, { text: secondaryText })
1894
1894
  ] }),
1895
- /* @__PURE__ */ jsx(Content$4, { children })
1895
+ /* @__PURE__ */ jsx(Content$5, { children })
1896
1896
  ] }) });
1897
1897
  }
1898
1898
  const AppBar = forwardRef(_AppBar);
@@ -3172,7 +3172,7 @@ function DialogHeader({
3172
3172
  children && /* @__PURE__ */ jsx(DividerBottom, {})
3173
3173
  ] });
3174
3174
  }
3175
- const Content$3 = styled(DialogContent$1, {
3175
+ const Content$4 = styled(DialogContent$1, {
3176
3176
  shouldForwardProp: (prop) => !["scrollableContent", "withGutter", "withBottomGutter"].includes(prop)
3177
3177
  })(({ theme, scrollableContent, withGutter, withBottomGutter }) => ({
3178
3178
  display: "flex",
@@ -3249,7 +3249,7 @@ function _DialogContent({
3249
3249
  return () => resizeObserver.disconnect();
3250
3250
  }, [contentRef, updateBorders]);
3251
3251
  return /* @__PURE__ */ jsx(
3252
- Content$3,
3252
+ Content$4,
3253
3253
  {
3254
3254
  ref: setContentRef,
3255
3255
  onScroll: handleScroll,
@@ -3548,7 +3548,7 @@ function DialogStepper({
3548
3548
  );
3549
3549
  }) }) });
3550
3550
  }
3551
- const Content$2 = styled(DialogContent, {
3551
+ const Content$3 = styled(DialogContent, {
3552
3552
  shouldForwardProp: (prop) => !["error", "withBorder"].includes(prop)
3553
3553
  })(
3554
3554
  ({ error, withBorder, theme }) => ({
@@ -3577,7 +3577,7 @@ function CodeAreaDialogContent({
3577
3577
  withGutter = false
3578
3578
  }) {
3579
3579
  if (!children) return null;
3580
- return /* @__PURE__ */ jsx(Content$2, { withGutter, error, withBorder, children });
3580
+ return /* @__PURE__ */ jsx(Content$3, { withGutter, error, withBorder, children });
3581
3581
  }
3582
3582
  function CodeAreaDialogConfirmation({
3583
3583
  onClose,
@@ -4517,7 +4517,7 @@ function DateTimePicker({
4517
4517
  );
4518
4518
  }
4519
4519
  const DEFAULT_ITEMS = [{ outlinedBullet: false, value: "" }];
4520
- const Content$1 = styled("ul")(({ theme }) => ({
4520
+ const Content$2 = styled("ul")(({ theme }) => ({
4521
4521
  listStyle: "none",
4522
4522
  paddingLeft: 0,
4523
4523
  margin: theme.spacing(0.5, 0, 0, 0)
@@ -4548,7 +4548,7 @@ function TooltipData({
4548
4548
  }) {
4549
4549
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4550
4550
  title && /* @__PURE__ */ jsx(Typography, { color: "inherit", variant: "caption", weight: "medium", children: title }),
4551
- /* @__PURE__ */ jsx(Content$1, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Entry, { children: [
4551
+ /* @__PURE__ */ jsx(Content$2, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Entry, { children: [
4552
4552
  /* @__PURE__ */ jsx(
4553
4553
  Bullet,
4554
4554
  {
@@ -4959,7 +4959,7 @@ const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
4959
4959
  maxWidth: `${MAX_WIDTH}px`
4960
4960
  }
4961
4961
  }));
4962
- const Content = styled(Box, {
4962
+ const Content$1 = styled(Box, {
4963
4963
  shouldForwardProp: (prop) => prop !== "autoWidth"
4964
4964
  })(({ autoWidth, theme }) => ({
4965
4965
  minWidth: "100%",
@@ -5068,7 +5068,7 @@ function Snackbar({
5068
5068
  TransitionComponent: autoWidth ? Fade : Slide,
5069
5069
  "data-auto-width": autoWidth,
5070
5070
  children: /* @__PURE__ */ jsxs(
5071
- Content,
5071
+ Content$1,
5072
5072
  {
5073
5073
  sx: {
5074
5074
  position: "relative"
@@ -5217,6 +5217,7 @@ const TagRoot = styled("div", {
5217
5217
  padding: theme.spacing(0, 0.5),
5218
5218
  borderRadius: theme.spacing(0.25),
5219
5219
  gap: theme.spacing(0.5),
5220
+ maxWidth: "100%",
5220
5221
  height: theme.spacing(2),
5221
5222
  borderWidth: "1px",
5222
5223
  borderStyle: "solid",
@@ -5247,6 +5248,7 @@ const TagLabel = styled("div", {
5247
5248
  })(({ type, theme }) => ({
5248
5249
  display: "flex",
5249
5250
  alignItems: "center",
5251
+ ...ellipsisStyles,
5250
5252
  paddingTop: type === "code" ? theme.spacing(0.25) : void 0
5251
5253
  }));
5252
5254
  function _Tag({
@@ -5575,6 +5577,149 @@ function _UploadField({
5575
5577
  ] });
5576
5578
  }
5577
5579
  const UploadField = forwardRef(_UploadField);
5580
+ const TooltipRoot = styled(Tooltip)(() => ({
5581
+ whiteSpace: "nowrap",
5582
+ maxWidth: 999,
5583
+ pointerEvents: "auto"
5584
+ }));
5585
+ const Content = styled("span", {
5586
+ shouldForwardProp: (prop) => !["ellipsisTarget", "lines", "content"].includes(prop)
5587
+ })(({ ellipsisTarget = "all", lines = 1, content = "block" }) => {
5588
+ if (lines > 1) {
5589
+ return {
5590
+ display: "-webkit-box",
5591
+ ...ellipsisStyles,
5592
+ whiteSpace: "initial !important",
5593
+ WebkitLineClamp: lines,
5594
+ WebkitBoxOrient: "vertical",
5595
+ "& > *": { display: "block" }
5596
+ };
5597
+ }
5598
+ if (ellipsisTarget === "first-child") {
5599
+ return {
5600
+ display: "flex",
5601
+ flex: "1",
5602
+ overflow: "hidden",
5603
+ "& > *:nth-of-type(1)": {
5604
+ display: "block",
5605
+ ...ellipsisStyles,
5606
+ marginRight: "-0.15em"
5607
+ // Prevent ellipsis separation
5608
+ }
5609
+ };
5610
+ }
5611
+ if (content === "flex") {
5612
+ return {
5613
+ display: "flex",
5614
+ flex: "1",
5615
+ "& > *": {
5616
+ display: "block",
5617
+ ...ellipsisStyles
5618
+ }
5619
+ };
5620
+ }
5621
+ return {
5622
+ display: "block",
5623
+ ...ellipsisStyles,
5624
+ fontWeight: "inherit",
5625
+ "& > *": { display: "inline" }
5626
+ };
5627
+ });
5628
+ function _EllipsisWithTooltip({
5629
+ children,
5630
+ tooltipText,
5631
+ alwaysShowTooltip,
5632
+ content = "block",
5633
+ textRef: inputTextRef,
5634
+ ellipsisTarget = "all",
5635
+ lines = 1,
5636
+ "aria-label": ariaLabel,
5637
+ contentProps,
5638
+ ...otherProps
5639
+ }, ref) {
5640
+ var _a;
5641
+ const textElementRef = useRef(null);
5642
+ const [overflowing, setOverflowing] = useState(false);
5643
+ const textRef = useMemo(
5644
+ () => inputTextRef || textElementRef,
5645
+ [inputTextRef, textElementRef]
5646
+ );
5647
+ const getTextContent = (node) => {
5648
+ if (typeof node === "string") return node;
5649
+ if (typeof node === "number") return String(node);
5650
+ if (React.isValidElement(node)) {
5651
+ const props = node.props;
5652
+ if (props.children) {
5653
+ return getTextContent(props.children);
5654
+ }
5655
+ }
5656
+ return "";
5657
+ };
5658
+ const elementTitle = tooltipText || ((_a = textElementRef.current) == null ? void 0 : _a.innerText) || (alwaysShowTooltip || overflowing ? getTextContent(children) : "");
5659
+ useEffect(() => {
5660
+ const container = textRef.current;
5661
+ if (!container || !children) return;
5662
+ if (alwaysShowTooltip) {
5663
+ setOverflowing(true);
5664
+ return;
5665
+ }
5666
+ let isOverflowing = false;
5667
+ if (lines > 1) {
5668
+ isOverflowing = container.scrollHeight > container.clientHeight;
5669
+ } else if (ellipsisTarget === "first-child") {
5670
+ const children2 = Array.from(container.children);
5671
+ const totalWidth = children2.reduce(
5672
+ (sum, child) => sum + ((child == null ? void 0 : child.scrollWidth) || 0),
5673
+ 0
5674
+ );
5675
+ isOverflowing = totalWidth > container.clientWidth;
5676
+ } else {
5677
+ const hasContainerOverflow = container.scrollWidth > container.clientWidth;
5678
+ const children2 = Array.from(container.children);
5679
+ const hasChildOverflow = children2.some(
5680
+ (child) => child.scrollWidth > child.clientWidth
5681
+ );
5682
+ isOverflowing = hasContainerOverflow || hasChildOverflow;
5683
+ }
5684
+ setOverflowing(isOverflowing);
5685
+ }, [textRef, alwaysShowTooltip, children, ellipsisTarget, lines, content]);
5686
+ useEffect(() => {
5687
+ if (typeof ref === "function") {
5688
+ ref(textElementRef.current);
5689
+ } else if (ref) {
5690
+ ref.current = textElementRef.current;
5691
+ }
5692
+ }, [ref]);
5693
+ return /* @__PURE__ */ jsx(
5694
+ TooltipRoot,
5695
+ {
5696
+ disableFocusListener: !overflowing && !alwaysShowTooltip,
5697
+ disableHoverListener: !overflowing && !alwaysShowTooltip,
5698
+ disableTouchListener: !overflowing && !alwaysShowTooltip,
5699
+ title: elementTitle,
5700
+ describeChild: true,
5701
+ ...otherProps,
5702
+ children: /* @__PURE__ */ jsx(
5703
+ Content,
5704
+ {
5705
+ "aria-label": ariaLabel ?? elementTitle,
5706
+ ref: textElementRef,
5707
+ ellipsisTarget,
5708
+ lines,
5709
+ content,
5710
+ "data-name": "ellipsis-with-tooltip",
5711
+ "data-overflowing": overflowing,
5712
+ "data-lines": lines,
5713
+ "data-content": content,
5714
+ "data-ellipsis-target": ellipsisTarget,
5715
+ ...contentProps,
5716
+ children
5717
+ }
5718
+ )
5719
+ }
5720
+ );
5721
+ }
5722
+ const EllipsisWithTooltip = forwardRef(_EllipsisWithTooltip);
5578
5723
  export {
5579
5724
  AUTOCOMPLETE_GROUP_HEADER_PROPERTY,
5580
5725
  AccordionGroup,
@@ -5609,6 +5754,7 @@ export {
5609
5754
  DialogHeader,
5610
5755
  DialogPaper,
5611
5756
  DialogStepper,
5757
+ EllipsisWithTooltip,
5612
5758
  FilterDropdown,
5613
5759
  FilterDropdownMenuItem,
5614
5760
  IconButton,
@@ -5715,6 +5715,11 @@ function _TablePaginationActions({
5715
5715
  );
5716
5716
  }
5717
5717
  const TablePaginationActions = React.forwardRef(_TablePaginationActions);
5718
+ const ellipsisStyles = {
5719
+ textOverflow: "ellipsis",
5720
+ overflow: "hidden",
5721
+ whiteSpace: "nowrap"
5722
+ };
5718
5723
  exports.APPBAR_SIZE = APPBAR_SIZE;
5719
5724
  exports.BREAKPOINTS = BREAKPOINTS;
5720
5725
  exports.ICON_SIZE_LARGE = ICON_SIZE_LARGE;
@@ -5729,6 +5734,7 @@ exports.NOTIFICATION_DURATION_IN_MS = NOTIFICATION_DURATION_IN_MS;
5729
5734
  exports.SPACING = SPACING;
5730
5735
  exports.TablePaginationActions = TablePaginationActions;
5731
5736
  exports.Typography = Typography;
5737
+ exports.ellipsisStyles = ellipsisStyles;
5732
5738
  exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
5733
5739
  exports.getSpacing = getSpacing;
5734
5740
  exports.useImperativeIntl = useImperativeIntl;
@@ -5714,6 +5714,11 @@ function _TablePaginationActions({
5714
5714
  );
5715
5715
  }
5716
5716
  const TablePaginationActions = forwardRef(_TablePaginationActions);
5717
+ const ellipsisStyles = {
5718
+ textOverflow: "ellipsis",
5719
+ overflow: "hidden",
5720
+ whiteSpace: "nowrap"
5721
+ };
5717
5722
  export {
5718
5723
  APPBAR_SIZE as A,
5719
5724
  BREAKPOINTS as B,
@@ -5726,10 +5731,11 @@ export {
5726
5731
  ICON_SIZE_MEDIUM as b,
5727
5732
  ICON_SIZE_SMALL as c,
5728
5733
  MENU_LIST_MAX_SIZE as d,
5729
- MENU_ITEM_SIZE_DENSE as e,
5730
- MENU_ITEM_SIZE_EXTENDED as f,
5734
+ ellipsisStyles as e,
5735
+ MENU_ITEM_SIZE_DENSE as f,
5731
5736
  getSpacing as g,
5732
- IconButton as h,
5733
- getDefaultExportFromCjs as i,
5737
+ MENU_ITEM_SIZE_EXTENDED as h,
5738
+ IconButton as i,
5739
+ getDefaultExportFromCjs as j,
5734
5740
  useImperativeIntl as u
5735
5741
  };