@carto/meridian-ds 2.5.5 → 2.6.0-alpha-searchfield.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.
- package/CHANGELOG.md +9 -0
- package/dist/{Alert-lLA0z7fX.js → Alert-C1VgP3N1.js} +20 -77
- package/dist/{Alert-BdmDjcVc.cjs → Alert-F8G9P271.cjs} +22 -79
- package/dist/{MenuItem-nokUtiks.cjs → MenuItem-Bssr5qGq.cjs} +6 -6
- package/dist/{MenuItem-ZNdBUBvt.js → MenuItem-COajCLkS.js} +1 -1
- package/dist/{SwatchSquare-CaaLsjAC.js → Search-C7wkXu3f.js} +4 -23
- package/dist/{SwatchSquare-B8PIY3Rd.cjs → Search-CMWbM9nD.cjs} +3 -22
- package/dist/SwatchSquare-B6KYVoqV.js +24 -0
- package/dist/SwatchSquare-DuXPIL7t.cjs +23 -0
- package/dist/components/index.cjs +457 -112
- package/dist/components/index.js +397 -52
- package/dist/{TablePaginationActions-DAMGtIub.cjs → css-utils-CqIN_t7x.cjs} +126 -55
- package/dist/{TablePaginationActions-C6TVGJM-.js → css-utils-hxI-qUxK.js} +129 -58
- package/dist/custom-icons/index.cjs +3 -2
- package/dist/custom-icons/index.js +3 -2
- package/dist/theme/index.cjs +108 -114
- package/dist/theme/index.js +7 -13
- package/dist/types/components/AccordionGroup/AccordionGroup.d.ts +4 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.d.ts.map +1 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts +39 -9
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts.map +1 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts +2 -0
- package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts.map +1 -0
- package/dist/types/components/AppBar/AppBar.d.ts +3 -1
- package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
- package/dist/types/components/AppBar/AppBar.stories.d.ts +2 -2
- package/dist/types/components/AppBar/AppBar.stories.d.ts.map +1 -1
- package/dist/types/components/AppBar/AppBar.test.d.ts +2 -0
- package/dist/types/components/AppBar/AppBar.test.d.ts.map +1 -0
- package/dist/types/components/Avatar/Avatar.d.ts +4 -1
- package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.stories.d.ts +1 -2
- package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.test.d.ts +2 -0
- package/dist/types/components/Avatar/Avatar.test.d.ts.map +1 -0
- package/dist/types/components/Button/Button.d.ts +5 -0
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Button/Button.stories.d.ts +3 -0
- package/dist/types/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +117 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +66 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts +2 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/index.d.ts +3 -0
- package/dist/types/components/EllipsisWithTooltip/index.d.ts.map +1 -0
- package/dist/types/components/Link/Link.d.ts +5 -0
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/Link/Link.stories.d.ts +9 -27
- package/dist/types/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.d.ts +32 -0
- package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
- package/dist/types/components/SearchField/SearchField.stories.d.ts +123 -0
- package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
- package/dist/types/components/SearchField/index.d.ts +3 -0
- package/dist/types/components/SearchField/index.d.ts.map +1 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +5 -2
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts +72 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts.map +1 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts +2 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts.map +1 -0
- package/dist/types/components/Tag/Tag.d.ts +176 -4
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -2
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +2 -2
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts +2 -0
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts.map +1 -0
- package/dist/types/components/TooltipData/TooltipData.d.ts.map +1 -1
- package/dist/types/components/TooltipData/TooltipData.stories.d.ts +34 -0
- package/dist/types/components/TooltipData/TooltipData.stories.d.ts.map +1 -0
- package/dist/types/components/TooltipData/TooltipData.test.d.ts +2 -0
- package/dist/types/components/TooltipData/TooltipData.test.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/localization/en.d.ts +1 -0
- package/dist/types/localization/en.d.ts.map +1 -1
- package/dist/types/localization/es.d.ts +1 -0
- package/dist/types/localization/es.d.ts.map +1 -1
- package/dist/types/localization/id.d.ts +1 -0
- package/dist/types/localization/id.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +3 -0
- package/dist/types/localization/index.d.ts.map +1 -1
- package/dist/types/theme/components/forms.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts +0 -3
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/utils/css-utils.d.ts +14 -0
- package/dist/types/utils/css-utils.d.ts.map +1 -0
- package/dist/types/utils/useTranslationFallback.d.ts +20 -0
- package/dist/types/utils/useTranslationFallback.d.ts.map +1 -0
- package/dist/types/utils/useTranslationFallback.test.d.ts +2 -0
- package/dist/types/utils/useTranslationFallback.test.d.ts.map +1 -0
- package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/WrapperWidgetUI/WrapperWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +120 -124
- package/dist/widgets/index.js +6 -10
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
-
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, Toolbar, AppBar as AppBar$1, 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";
|
|
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";
|
|
5
4
|
import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, Check, TodayOutlined } from "@mui/icons-material";
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { u as useTranslationFallback, S as ScreenReaderOnly, A as Alert$1 } from "../Alert-C1VgP3N1.js";
|
|
6
|
+
import { L } from "../Alert-C1VgP3N1.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, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-hxI-qUxK.js";
|
|
8
|
+
import { a } from "../css-utils-hxI-qUxK.js";
|
|
10
9
|
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
11
10
|
import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
|
|
12
|
-
import {
|
|
11
|
+
import { useIntl } from "react-intl";
|
|
12
|
+
import { M as MenuItem$1 } from "../MenuItem-COajCLkS.js";
|
|
13
13
|
import "cartocolor";
|
|
14
14
|
import { FixedSizeList } from "react-window";
|
|
15
15
|
import { Controlled, UnControlled } from "react-codemirror2";
|
|
@@ -41,6 +41,7 @@ import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
|
|
|
41
41
|
import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
|
|
42
42
|
import { TimePicker as TimePicker$1 } from "@mui/x-date-pickers/TimePicker";
|
|
43
43
|
import { DateTimePicker as DateTimePicker$1 } from "@mui/x-date-pickers/DateTimePicker";
|
|
44
|
+
import { S as Search } from "../Search-C7wkXu3f.js";
|
|
44
45
|
import DOMPurify from "dompurify";
|
|
45
46
|
const IndicatorIcon = styled(Box)({
|
|
46
47
|
position: "absolute",
|
|
@@ -65,11 +66,14 @@ function _Button({
|
|
|
65
66
|
loadingPosition,
|
|
66
67
|
external,
|
|
67
68
|
showExternalIcon = true,
|
|
69
|
+
screenReaderText,
|
|
68
70
|
"aria-describedby": ariaDescribedby,
|
|
69
71
|
...otherProps
|
|
70
72
|
}, ref) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
+
const screenReaderTextValue = useTranslationFallback(
|
|
74
|
+
"c4r.button.opensInNewTab",
|
|
75
|
+
screenReaderText
|
|
76
|
+
);
|
|
73
77
|
const defaultIconLoader = /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" });
|
|
74
78
|
const isDefaultLoading = loading && loadingPosition === void 0;
|
|
75
79
|
const isExternalLink = otherProps.href && external;
|
|
@@ -83,9 +87,7 @@ function _Button({
|
|
|
83
87
|
if (isExternalLink) {
|
|
84
88
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
89
|
children,
|
|
86
|
-
/* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children:
|
|
87
|
-
id: "c4r.button.opensInNewTab"
|
|
88
|
-
})})` })
|
|
90
|
+
/* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children: screenReaderTextValue })
|
|
89
91
|
] });
|
|
90
92
|
}
|
|
91
93
|
return children;
|
|
@@ -816,24 +818,36 @@ const StyledToggleButtonGroup = styled(ToggleButtonGroup$1, {
|
|
|
816
818
|
backgroundColor: "transparent"
|
|
817
819
|
}
|
|
818
820
|
}));
|
|
819
|
-
function
|
|
821
|
+
function _ToggleButtonGroup({
|
|
820
822
|
children,
|
|
821
823
|
variant = "floating",
|
|
822
824
|
backgroundColor,
|
|
825
|
+
orientation,
|
|
826
|
+
size,
|
|
823
827
|
...rest
|
|
824
|
-
}) {
|
|
828
|
+
}, ref) {
|
|
825
829
|
const isUnbounded = variant === "unbounded";
|
|
826
830
|
const defaultColor = isUnbounded ? "transparent" : "primary";
|
|
831
|
+
const resolvedBackgroundColor = backgroundColor ?? defaultColor;
|
|
827
832
|
return /* @__PURE__ */ jsx(
|
|
828
833
|
StyledToggleButtonGroup,
|
|
829
834
|
{
|
|
830
835
|
...rest,
|
|
831
836
|
variant,
|
|
832
|
-
backgroundColor:
|
|
837
|
+
backgroundColor: resolvedBackgroundColor,
|
|
838
|
+
orientation,
|
|
839
|
+
size,
|
|
840
|
+
"data-orientation": orientation,
|
|
841
|
+
"data-variant": variant,
|
|
842
|
+
"data-size": size,
|
|
843
|
+
"data-background-color": resolvedBackgroundColor,
|
|
844
|
+
"data-name": "toggle-button-group",
|
|
845
|
+
ref,
|
|
833
846
|
children
|
|
834
847
|
}
|
|
835
848
|
);
|
|
836
849
|
}
|
|
850
|
+
const ToggleButtonGroup = forwardRef(_ToggleButtonGroup);
|
|
837
851
|
async function copyString(value) {
|
|
838
852
|
return await navigator.clipboard.writeText(value);
|
|
839
853
|
}
|
|
@@ -1856,14 +1870,14 @@ const BrandElements = styled("div")(({ theme }) => ({
|
|
|
1856
1870
|
minWidth: "192px"
|
|
1857
1871
|
}
|
|
1858
1872
|
}));
|
|
1859
|
-
const Content$
|
|
1873
|
+
const Content$5 = styled("div")(({ theme }) => ({
|
|
1860
1874
|
display: "flex",
|
|
1861
1875
|
alignItems: "center",
|
|
1862
1876
|
justifyContent: "space-between",
|
|
1863
1877
|
flex: 1,
|
|
1864
1878
|
marginLeft: theme.spacing(1)
|
|
1865
1879
|
}));
|
|
1866
|
-
function
|
|
1880
|
+
function _AppBar({
|
|
1867
1881
|
children,
|
|
1868
1882
|
brandLogo,
|
|
1869
1883
|
brandText,
|
|
@@ -1871,17 +1885,18 @@ function AppBar({
|
|
|
1871
1885
|
showBurgerMenu = false,
|
|
1872
1886
|
onClickMenu,
|
|
1873
1887
|
...otherProps
|
|
1874
|
-
}) {
|
|
1875
|
-
return /* @__PURE__ */ jsx(Root$4, { ...otherProps, children: /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
1888
|
+
}, ref) {
|
|
1889
|
+
return /* @__PURE__ */ jsx(Root$4, { ...otherProps, ref, "data-name": "app-bar", children: /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
1876
1890
|
/* @__PURE__ */ jsxs(BrandElements, { children: [
|
|
1877
1891
|
showBurgerMenu && /* @__PURE__ */ jsx(BurgerMenu, { onClickMenu }),
|
|
1878
1892
|
brandLogo && /* @__PURE__ */ jsx(BrandLogo, { logo: brandLogo }),
|
|
1879
1893
|
brandText && /* @__PURE__ */ jsx(BrandText, { text: brandText }),
|
|
1880
1894
|
secondaryText && /* @__PURE__ */ jsx(SecondaryText, { text: secondaryText })
|
|
1881
1895
|
] }),
|
|
1882
|
-
/* @__PURE__ */ jsx(Content$
|
|
1896
|
+
/* @__PURE__ */ jsx(Content$5, { children })
|
|
1883
1897
|
] }) });
|
|
1884
1898
|
}
|
|
1899
|
+
const AppBar = forwardRef(_AppBar);
|
|
1885
1900
|
const Footer = styled(Box, {
|
|
1886
1901
|
shouldForwardProp: (prop) => !["withGutter", "disabled"].includes(prop)
|
|
1887
1902
|
})(
|
|
@@ -3158,7 +3173,7 @@ function DialogHeader({
|
|
|
3158
3173
|
children && /* @__PURE__ */ jsx(DividerBottom, {})
|
|
3159
3174
|
] });
|
|
3160
3175
|
}
|
|
3161
|
-
const Content$
|
|
3176
|
+
const Content$4 = styled(DialogContent$1, {
|
|
3162
3177
|
shouldForwardProp: (prop) => !["scrollableContent", "withGutter", "withBottomGutter"].includes(prop)
|
|
3163
3178
|
})(({ theme, scrollableContent, withGutter, withBottomGutter }) => ({
|
|
3164
3179
|
display: "flex",
|
|
@@ -3235,7 +3250,7 @@ function _DialogContent({
|
|
|
3235
3250
|
return () => resizeObserver.disconnect();
|
|
3236
3251
|
}, [contentRef, updateBorders]);
|
|
3237
3252
|
return /* @__PURE__ */ jsx(
|
|
3238
|
-
Content$
|
|
3253
|
+
Content$4,
|
|
3239
3254
|
{
|
|
3240
3255
|
ref: setContentRef,
|
|
3241
3256
|
onScroll: handleScroll,
|
|
@@ -3534,7 +3549,7 @@ function DialogStepper({
|
|
|
3534
3549
|
);
|
|
3535
3550
|
}) }) });
|
|
3536
3551
|
}
|
|
3537
|
-
const Content$
|
|
3552
|
+
const Content$3 = styled(DialogContent, {
|
|
3538
3553
|
shouldForwardProp: (prop) => !["error", "withBorder"].includes(prop)
|
|
3539
3554
|
})(
|
|
3540
3555
|
({ error, withBorder, theme }) => ({
|
|
@@ -3563,7 +3578,7 @@ function CodeAreaDialogContent({
|
|
|
3563
3578
|
withGutter = false
|
|
3564
3579
|
}) {
|
|
3565
3580
|
if (!children) return null;
|
|
3566
|
-
return /* @__PURE__ */ jsx(Content$
|
|
3581
|
+
return /* @__PURE__ */ jsx(Content$3, { withGutter, error, withBorder, children });
|
|
3567
3582
|
}
|
|
3568
3583
|
function CodeAreaDialogConfirmation({
|
|
3569
3584
|
onClose,
|
|
@@ -4503,7 +4518,7 @@ function DateTimePicker({
|
|
|
4503
4518
|
);
|
|
4504
4519
|
}
|
|
4505
4520
|
const DEFAULT_ITEMS = [{ outlinedBullet: false, value: "" }];
|
|
4506
|
-
const Content$
|
|
4521
|
+
const Content$2 = styled("ul")(({ theme }) => ({
|
|
4507
4522
|
listStyle: "none",
|
|
4508
4523
|
paddingLeft: 0,
|
|
4509
4524
|
margin: theme.spacing(0.5, 0, 0, 0)
|
|
@@ -4534,14 +4549,16 @@ function TooltipData({
|
|
|
4534
4549
|
}) {
|
|
4535
4550
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4536
4551
|
title && /* @__PURE__ */ jsx(Typography, { color: "inherit", variant: "caption", weight: "medium", children: title }),
|
|
4537
|
-
/* @__PURE__ */ jsx(Content$
|
|
4552
|
+
/* @__PURE__ */ jsx(Content$2, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Entry, { children: [
|
|
4538
4553
|
/* @__PURE__ */ jsx(
|
|
4539
4554
|
Bullet,
|
|
4540
4555
|
{
|
|
4541
4556
|
style: {
|
|
4542
4557
|
backgroundColor: `${item.outlinedBullet ? "transparent" : item.color}`,
|
|
4543
4558
|
borderColor: item.color
|
|
4544
|
-
}
|
|
4559
|
+
},
|
|
4560
|
+
role: "presentation",
|
|
4561
|
+
"data-bullet": item.outlinedBullet ? "outlined" : "filled"
|
|
4545
4562
|
}
|
|
4546
4563
|
),
|
|
4547
4564
|
item.category && /* @__PURE__ */ jsx(Category, { color: "inherit", variant: "caption", children: item.category }),
|
|
@@ -4559,32 +4576,47 @@ const AccordionContainer = styled("div", {
|
|
|
4559
4576
|
boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`
|
|
4560
4577
|
}
|
|
4561
4578
|
}));
|
|
4562
|
-
function
|
|
4579
|
+
function _AccordionGroup({
|
|
4563
4580
|
variant = "standard",
|
|
4564
4581
|
items,
|
|
4582
|
+
"aria-label": ariaLabel,
|
|
4583
|
+
"data-testid": dataTestId,
|
|
4565
4584
|
...otherProps
|
|
4566
|
-
}) {
|
|
4567
|
-
return /* @__PURE__ */ jsx(
|
|
4568
|
-
|
|
4585
|
+
}, ref) {
|
|
4586
|
+
return /* @__PURE__ */ jsx(
|
|
4587
|
+
AccordionContainer,
|
|
4569
4588
|
{
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4589
|
+
...otherProps,
|
|
4590
|
+
variant,
|
|
4591
|
+
"aria-label": ariaLabel,
|
|
4592
|
+
"data-testid": dataTestId,
|
|
4593
|
+
"data-variant": variant,
|
|
4594
|
+
"data-name": "accordion-group",
|
|
4595
|
+
ref,
|
|
4596
|
+
children: items.map((item, index) => /* @__PURE__ */ jsxs(
|
|
4597
|
+
Accordion,
|
|
4598
|
+
{
|
|
4599
|
+
disabled: item.disabled,
|
|
4600
|
+
defaultExpanded: item.defaultExpanded,
|
|
4601
|
+
onChange: item.onChange,
|
|
4602
|
+
children: [
|
|
4603
|
+
/* @__PURE__ */ jsx(
|
|
4604
|
+
AccordionSummary,
|
|
4605
|
+
{
|
|
4606
|
+
"aria-controls": `${index}-content`,
|
|
4607
|
+
id: `${index}-header`,
|
|
4608
|
+
children: item.summary
|
|
4609
|
+
}
|
|
4610
|
+
),
|
|
4611
|
+
/* @__PURE__ */ jsx(AccordionDetails, { children: item.content })
|
|
4612
|
+
]
|
|
4613
|
+
},
|
|
4614
|
+
index
|
|
4615
|
+
))
|
|
4616
|
+
}
|
|
4617
|
+
);
|
|
4587
4618
|
}
|
|
4619
|
+
const AccordionGroup = forwardRef(_AccordionGroup);
|
|
4588
4620
|
const sizes = {
|
|
4589
4621
|
large: 5,
|
|
4590
4622
|
medium: 4,
|
|
@@ -4616,9 +4648,29 @@ const StyledAvatar = styled(Avatar$1, {
|
|
|
4616
4648
|
opacity: 0.6
|
|
4617
4649
|
}
|
|
4618
4650
|
}));
|
|
4619
|
-
function
|
|
4620
|
-
|
|
4651
|
+
function _Avatar({
|
|
4652
|
+
size,
|
|
4653
|
+
disabled,
|
|
4654
|
+
"aria-label": ariaLabel,
|
|
4655
|
+
"data-testid": dataTestId,
|
|
4656
|
+
...otherProps
|
|
4657
|
+
}, ref) {
|
|
4658
|
+
return /* @__PURE__ */ jsx(
|
|
4659
|
+
StyledAvatar,
|
|
4660
|
+
{
|
|
4661
|
+
...otherProps,
|
|
4662
|
+
ref,
|
|
4663
|
+
size,
|
|
4664
|
+
"aria-disabled": disabled,
|
|
4665
|
+
disabled,
|
|
4666
|
+
"aria-label": ariaLabel,
|
|
4667
|
+
"data-testid": dataTestId,
|
|
4668
|
+
"data-size": size,
|
|
4669
|
+
"data-name": "avatar"
|
|
4670
|
+
}
|
|
4671
|
+
);
|
|
4621
4672
|
}
|
|
4673
|
+
const Avatar = forwardRef(_Avatar);
|
|
4622
4674
|
const StyledMenu = styled(Menu$2, {
|
|
4623
4675
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
4624
4676
|
})(({ extended, width, height }) => ({
|
|
@@ -4895,6 +4947,152 @@ function _FilterDropdown({
|
|
|
4895
4947
|
const FilterDropdown = forwardRef(
|
|
4896
4948
|
_FilterDropdown
|
|
4897
4949
|
);
|
|
4950
|
+
const SearchIcon = styled(Search, {
|
|
4951
|
+
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
|
|
4952
|
+
})(
|
|
4953
|
+
({ theme, minimized, disabled }) => ({
|
|
4954
|
+
cursor: !disabled && minimized ? "pointer" : "inherit",
|
|
4955
|
+
width: ICON_SIZE_MEDIUM,
|
|
4956
|
+
height: ICON_SIZE_MEDIUM,
|
|
4957
|
+
path: {
|
|
4958
|
+
fillOpacity: 1,
|
|
4959
|
+
fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
|
|
4960
|
+
}
|
|
4961
|
+
})
|
|
4962
|
+
);
|
|
4963
|
+
const CancelIcon = styled(Cancel)(({ theme }) => ({
|
|
4964
|
+
fill: theme.palette.text.hint,
|
|
4965
|
+
cursor: "pointer"
|
|
4966
|
+
}));
|
|
4967
|
+
const CircularProgressIcon = styled(CircularProgress)(({ theme }) => ({
|
|
4968
|
+
svg: {
|
|
4969
|
+
color: theme.palette.primary.main
|
|
4970
|
+
}
|
|
4971
|
+
}));
|
|
4972
|
+
const SearchFieldBase = styled(TextField, {
|
|
4973
|
+
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused"
|
|
4974
|
+
})(
|
|
4975
|
+
({ theme, disabled, minimized, isInputFocused }) => ({
|
|
4976
|
+
"& .MuiInputBase-input": {
|
|
4977
|
+
cursor: disabled ? "not-allowed" : "text",
|
|
4978
|
+
pointerEvents: isInputFocused ? "auto" : "none"
|
|
4979
|
+
// Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
|
|
4980
|
+
},
|
|
4981
|
+
"&.MuiTextField-root .MuiInputBase-root": {
|
|
4982
|
+
paddingRight: theme.spacing(1),
|
|
4983
|
+
"&.MuiInputBase-sizeSmall": {
|
|
4984
|
+
paddingRight: theme.spacing(0.5)
|
|
4985
|
+
},
|
|
4986
|
+
"&:before": {
|
|
4987
|
+
border: `none !important`,
|
|
4988
|
+
"&:hover": {
|
|
4989
|
+
border: `none !important`
|
|
4990
|
+
}
|
|
4991
|
+
},
|
|
4992
|
+
width: minimized ? theme.spacing(4) : "100%",
|
|
4993
|
+
transition: theme.transitions.create("width", {
|
|
4994
|
+
easing: theme.transitions.easing.easeInOut,
|
|
4995
|
+
duration: theme.transitions.duration.shortest
|
|
4996
|
+
})
|
|
4997
|
+
},
|
|
4998
|
+
// Input Adornment
|
|
4999
|
+
"& .MuiInputAdornment-positionStart": {
|
|
5000
|
+
marginLeft: minimized ? theme.spacing(0.125) : void 0
|
|
5001
|
+
},
|
|
5002
|
+
"& .MuiInputAdornment-positionEnd": {
|
|
5003
|
+
minWidth: theme.spacing(4),
|
|
5004
|
+
"&.MuiInputAdornment-sizeSmall": {
|
|
5005
|
+
minWidth: theme.spacing(3)
|
|
5006
|
+
}
|
|
5007
|
+
},
|
|
5008
|
+
// Variants
|
|
5009
|
+
"& .MuiFilledInput-root": {
|
|
5010
|
+
transition: theme.transitions.create("background-color", {
|
|
5011
|
+
easing: theme.transitions.easing.easeInOut,
|
|
5012
|
+
duration: theme.transitions.duration.shortest
|
|
5013
|
+
}),
|
|
5014
|
+
backgroundColor: `${minimized ? "inherit" : theme.palette.default.background} !important`,
|
|
5015
|
+
"&:hover": {
|
|
5016
|
+
backgroundColor: `${disabled ? "inherit" : theme.palette.action.hover} !important`
|
|
5017
|
+
}
|
|
5018
|
+
}
|
|
5019
|
+
})
|
|
5020
|
+
);
|
|
5021
|
+
function _SearchField({
|
|
5022
|
+
value,
|
|
5023
|
+
defaultValue,
|
|
5024
|
+
placeholder,
|
|
5025
|
+
onChange,
|
|
5026
|
+
onClick,
|
|
5027
|
+
onResetSearch,
|
|
5028
|
+
disabled,
|
|
5029
|
+
minimized = false,
|
|
5030
|
+
loading = false,
|
|
5031
|
+
variant = "filled",
|
|
5032
|
+
size = "small",
|
|
5033
|
+
InputProps,
|
|
5034
|
+
startAdornment,
|
|
5035
|
+
endAdornment,
|
|
5036
|
+
onFocus,
|
|
5037
|
+
onBlur,
|
|
5038
|
+
clearTextLabel,
|
|
5039
|
+
...otherProps
|
|
5040
|
+
}, ref) {
|
|
5041
|
+
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
5042
|
+
const clearTextLabelValue = useTranslationFallback(
|
|
5043
|
+
"c4r.button.clear",
|
|
5044
|
+
clearTextLabel
|
|
5045
|
+
);
|
|
5046
|
+
const handleFocus = (event) => {
|
|
5047
|
+
setIsInputFocused(true);
|
|
5048
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
5049
|
+
};
|
|
5050
|
+
const handleBlur = (event) => {
|
|
5051
|
+
setIsInputFocused(false);
|
|
5052
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
5053
|
+
};
|
|
5054
|
+
const handleClearText = () => {
|
|
5055
|
+
onResetSearch == null ? void 0 : onResetSearch();
|
|
5056
|
+
onChange == null ? void 0 : onChange({ target: { value: "" } });
|
|
5057
|
+
};
|
|
5058
|
+
return /* @__PURE__ */ jsx(
|
|
5059
|
+
SearchFieldBase,
|
|
5060
|
+
{
|
|
5061
|
+
value: minimized ? "" : value,
|
|
5062
|
+
defaultValue,
|
|
5063
|
+
placeholder: minimized ? "" : placeholder,
|
|
5064
|
+
onChange,
|
|
5065
|
+
onClick,
|
|
5066
|
+
variant,
|
|
5067
|
+
size,
|
|
5068
|
+
focused: false,
|
|
5069
|
+
isInputFocused,
|
|
5070
|
+
disabled,
|
|
5071
|
+
minimized,
|
|
5072
|
+
InputProps: {
|
|
5073
|
+
onFocus: handleFocus,
|
|
5074
|
+
onBlur: handleBlur,
|
|
5075
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(Box, { sx: { display: "inline-flex", ml: minimized ? -0.75 : 0 }, children: loading && minimized ? /* @__PURE__ */ jsx(CircularProgressIcon, { size: ICON_SIZE_MEDIUM }) : startAdornment || /* @__PURE__ */ jsx(SearchIcon, { disabled, minimized }) }) }),
|
|
5076
|
+
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: loading ? /* @__PURE__ */ jsx(CircularProgressIcon, { size: ICON_SIZE_MEDIUM }) : !disabled && !minimized && (value ?? defaultValue) ? endAdornment || /* @__PURE__ */ jsx(
|
|
5077
|
+
IconButton,
|
|
5078
|
+
{
|
|
5079
|
+
icon: /* @__PURE__ */ jsx(CancelIcon, {}),
|
|
5080
|
+
onClick: handleClearText,
|
|
5081
|
+
size,
|
|
5082
|
+
color: "default",
|
|
5083
|
+
disabled,
|
|
5084
|
+
tooltip: clearTextLabelValue
|
|
5085
|
+
}
|
|
5086
|
+
) : void 0 }),
|
|
5087
|
+
...InputProps
|
|
5088
|
+
},
|
|
5089
|
+
"data-name": "search-field",
|
|
5090
|
+
ref,
|
|
5091
|
+
...otherProps
|
|
5092
|
+
}
|
|
5093
|
+
);
|
|
5094
|
+
}
|
|
5095
|
+
const SearchField = forwardRef(_SearchField);
|
|
4898
5096
|
const MAX_WIDTH = 480;
|
|
4899
5097
|
const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
|
|
4900
5098
|
bottom: theme.spacing(2),
|
|
@@ -4908,7 +5106,7 @@ const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
|
|
|
4908
5106
|
maxWidth: `${MAX_WIDTH}px`
|
|
4909
5107
|
}
|
|
4910
5108
|
}));
|
|
4911
|
-
const Content = styled(Box, {
|
|
5109
|
+
const Content$1 = styled(Box, {
|
|
4912
5110
|
shouldForwardProp: (prop) => prop !== "autoWidth"
|
|
4913
5111
|
})(({ autoWidth, theme }) => ({
|
|
4914
5112
|
minWidth: "100%",
|
|
@@ -5017,7 +5215,7 @@ function Snackbar({
|
|
|
5017
5215
|
TransitionComponent: autoWidth ? Fade : Slide,
|
|
5018
5216
|
"data-auto-width": autoWidth,
|
|
5019
5217
|
children: /* @__PURE__ */ jsxs(
|
|
5020
|
-
Content,
|
|
5218
|
+
Content$1,
|
|
5021
5219
|
{
|
|
5022
5220
|
sx: {
|
|
5023
5221
|
position: "relative"
|
|
@@ -5166,6 +5364,7 @@ const TagRoot = styled("div", {
|
|
|
5166
5364
|
padding: theme.spacing(0, 0.5),
|
|
5167
5365
|
borderRadius: theme.spacing(0.25),
|
|
5168
5366
|
gap: theme.spacing(0.5),
|
|
5367
|
+
maxWidth: "100%",
|
|
5169
5368
|
height: theme.spacing(2),
|
|
5170
5369
|
borderWidth: "1px",
|
|
5171
5370
|
borderStyle: "solid",
|
|
@@ -5196,6 +5395,7 @@ const TagLabel = styled("div", {
|
|
|
5196
5395
|
})(({ type, theme }) => ({
|
|
5197
5396
|
display: "flex",
|
|
5198
5397
|
alignItems: "center",
|
|
5398
|
+
...ellipsisStyles,
|
|
5199
5399
|
paddingTop: type === "code" ? theme.spacing(0.25) : void 0
|
|
5200
5400
|
}));
|
|
5201
5401
|
function _Tag({
|
|
@@ -5524,6 +5724,149 @@ function _UploadField({
|
|
|
5524
5724
|
] });
|
|
5525
5725
|
}
|
|
5526
5726
|
const UploadField = forwardRef(_UploadField);
|
|
5727
|
+
const TooltipRoot = styled(Tooltip)(() => ({
|
|
5728
|
+
whiteSpace: "nowrap",
|
|
5729
|
+
maxWidth: 999,
|
|
5730
|
+
pointerEvents: "auto"
|
|
5731
|
+
}));
|
|
5732
|
+
const Content = styled("span", {
|
|
5733
|
+
shouldForwardProp: (prop) => !["ellipsisTarget", "lines", "content"].includes(prop)
|
|
5734
|
+
})(({ ellipsisTarget = "all", lines = 1, content = "block" }) => {
|
|
5735
|
+
if (lines > 1) {
|
|
5736
|
+
return {
|
|
5737
|
+
display: "-webkit-box",
|
|
5738
|
+
...ellipsisStyles,
|
|
5739
|
+
whiteSpace: "initial !important",
|
|
5740
|
+
WebkitLineClamp: lines,
|
|
5741
|
+
WebkitBoxOrient: "vertical",
|
|
5742
|
+
"& > *": { display: "block" }
|
|
5743
|
+
};
|
|
5744
|
+
}
|
|
5745
|
+
if (ellipsisTarget === "first-child") {
|
|
5746
|
+
return {
|
|
5747
|
+
display: "flex",
|
|
5748
|
+
flex: "1",
|
|
5749
|
+
overflow: "hidden",
|
|
5750
|
+
"& > *:nth-of-type(1)": {
|
|
5751
|
+
display: "block",
|
|
5752
|
+
...ellipsisStyles,
|
|
5753
|
+
marginRight: "-0.15em"
|
|
5754
|
+
// Prevent ellipsis separation
|
|
5755
|
+
}
|
|
5756
|
+
};
|
|
5757
|
+
}
|
|
5758
|
+
if (content === "flex") {
|
|
5759
|
+
return {
|
|
5760
|
+
display: "flex",
|
|
5761
|
+
flex: "1",
|
|
5762
|
+
"& > *": {
|
|
5763
|
+
display: "block",
|
|
5764
|
+
...ellipsisStyles
|
|
5765
|
+
}
|
|
5766
|
+
};
|
|
5767
|
+
}
|
|
5768
|
+
return {
|
|
5769
|
+
display: "block",
|
|
5770
|
+
...ellipsisStyles,
|
|
5771
|
+
fontWeight: "inherit",
|
|
5772
|
+
"& > *": { display: "inline" }
|
|
5773
|
+
};
|
|
5774
|
+
});
|
|
5775
|
+
function _EllipsisWithTooltip({
|
|
5776
|
+
children,
|
|
5777
|
+
tooltipText,
|
|
5778
|
+
alwaysShowTooltip,
|
|
5779
|
+
content = "block",
|
|
5780
|
+
textRef: inputTextRef,
|
|
5781
|
+
ellipsisTarget = "all",
|
|
5782
|
+
lines = 1,
|
|
5783
|
+
"aria-label": ariaLabel,
|
|
5784
|
+
contentProps,
|
|
5785
|
+
...otherProps
|
|
5786
|
+
}, ref) {
|
|
5787
|
+
var _a;
|
|
5788
|
+
const textElementRef = useRef(null);
|
|
5789
|
+
const [overflowing, setOverflowing] = useState(false);
|
|
5790
|
+
const textRef = useMemo(
|
|
5791
|
+
() => inputTextRef || textElementRef,
|
|
5792
|
+
[inputTextRef, textElementRef]
|
|
5793
|
+
);
|
|
5794
|
+
const getTextContent = (node) => {
|
|
5795
|
+
if (typeof node === "string") return node;
|
|
5796
|
+
if (typeof node === "number") return String(node);
|
|
5797
|
+
if (React.isValidElement(node)) {
|
|
5798
|
+
const props = node.props;
|
|
5799
|
+
if (props.children) {
|
|
5800
|
+
return getTextContent(props.children);
|
|
5801
|
+
}
|
|
5802
|
+
}
|
|
5803
|
+
return "";
|
|
5804
|
+
};
|
|
5805
|
+
const elementTitle = tooltipText || ((_a = textElementRef.current) == null ? void 0 : _a.innerText) || (alwaysShowTooltip || overflowing ? getTextContent(children) : "");
|
|
5806
|
+
useEffect(() => {
|
|
5807
|
+
const container = textRef.current;
|
|
5808
|
+
if (!container || !children) return;
|
|
5809
|
+
if (alwaysShowTooltip) {
|
|
5810
|
+
setOverflowing(true);
|
|
5811
|
+
return;
|
|
5812
|
+
}
|
|
5813
|
+
let isOverflowing = false;
|
|
5814
|
+
if (lines > 1) {
|
|
5815
|
+
isOverflowing = container.scrollHeight > container.clientHeight;
|
|
5816
|
+
} else if (ellipsisTarget === "first-child") {
|
|
5817
|
+
const children2 = Array.from(container.children);
|
|
5818
|
+
const totalWidth = children2.reduce(
|
|
5819
|
+
(sum, child) => sum + ((child == null ? void 0 : child.scrollWidth) || 0),
|
|
5820
|
+
0
|
|
5821
|
+
);
|
|
5822
|
+
isOverflowing = totalWidth > container.clientWidth;
|
|
5823
|
+
} else {
|
|
5824
|
+
const hasContainerOverflow = container.scrollWidth > container.clientWidth;
|
|
5825
|
+
const children2 = Array.from(container.children);
|
|
5826
|
+
const hasChildOverflow = children2.some(
|
|
5827
|
+
(child) => child.scrollWidth > child.clientWidth
|
|
5828
|
+
);
|
|
5829
|
+
isOverflowing = hasContainerOverflow || hasChildOverflow;
|
|
5830
|
+
}
|
|
5831
|
+
setOverflowing(isOverflowing);
|
|
5832
|
+
}, [textRef, alwaysShowTooltip, children, ellipsisTarget, lines, content]);
|
|
5833
|
+
useEffect(() => {
|
|
5834
|
+
if (typeof ref === "function") {
|
|
5835
|
+
ref(textElementRef.current);
|
|
5836
|
+
} else if (ref) {
|
|
5837
|
+
ref.current = textElementRef.current;
|
|
5838
|
+
}
|
|
5839
|
+
}, [ref]);
|
|
5840
|
+
return /* @__PURE__ */ jsx(
|
|
5841
|
+
TooltipRoot,
|
|
5842
|
+
{
|
|
5843
|
+
disableFocusListener: !overflowing && !alwaysShowTooltip,
|
|
5844
|
+
disableHoverListener: !overflowing && !alwaysShowTooltip,
|
|
5845
|
+
disableTouchListener: !overflowing && !alwaysShowTooltip,
|
|
5846
|
+
title: elementTitle,
|
|
5847
|
+
describeChild: true,
|
|
5848
|
+
...otherProps,
|
|
5849
|
+
children: /* @__PURE__ */ jsx(
|
|
5850
|
+
Content,
|
|
5851
|
+
{
|
|
5852
|
+
"aria-label": ariaLabel ?? elementTitle,
|
|
5853
|
+
ref: textElementRef,
|
|
5854
|
+
ellipsisTarget,
|
|
5855
|
+
lines,
|
|
5856
|
+
content,
|
|
5857
|
+
"data-name": "ellipsis-with-tooltip",
|
|
5858
|
+
"data-overflowing": overflowing,
|
|
5859
|
+
"data-lines": lines,
|
|
5860
|
+
"data-content": content,
|
|
5861
|
+
"data-ellipsis-target": ellipsisTarget,
|
|
5862
|
+
...contentProps,
|
|
5863
|
+
children
|
|
5864
|
+
}
|
|
5865
|
+
)
|
|
5866
|
+
}
|
|
5867
|
+
);
|
|
5868
|
+
}
|
|
5869
|
+
const EllipsisWithTooltip = forwardRef(_EllipsisWithTooltip);
|
|
5527
5870
|
export {
|
|
5528
5871
|
AUTOCOMPLETE_GROUP_HEADER_PROPERTY,
|
|
5529
5872
|
AccordionGroup,
|
|
@@ -5558,6 +5901,7 @@ export {
|
|
|
5558
5901
|
DialogHeader,
|
|
5559
5902
|
DialogPaper,
|
|
5560
5903
|
DialogStepper,
|
|
5904
|
+
EllipsisWithTooltip,
|
|
5561
5905
|
FilterDropdown,
|
|
5562
5906
|
FilterDropdownMenuItem,
|
|
5563
5907
|
IconButton,
|
|
@@ -5571,6 +5915,7 @@ export {
|
|
|
5571
5915
|
MultipleSelectField,
|
|
5572
5916
|
PasswordField,
|
|
5573
5917
|
ScreenReaderOnly,
|
|
5918
|
+
SearchField,
|
|
5574
5919
|
SelectField,
|
|
5575
5920
|
Snackbar,
|
|
5576
5921
|
SplitButton,
|