@carto/meridian-ds 2.15.1-alpha.49c19bf.205 → 2.15.2-alpha.2b8c1ea.214
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 +12 -1
- package/dist/components/index.cjs +73 -33
- package/dist/components/index.js +74 -34
- package/dist/custom-icons/index.cjs +1854 -1414
- package/dist/custom-icons/index.js +1854 -1414
- package/dist/theme/index.cjs +23 -1
- package/dist/theme/index.js +23 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts +13 -0
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts.map +1 -1
- package/dist/types/components/Alert/Alert.stories.d.ts +26 -0
- package/dist/types/components/Alert/Alert.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/Autocomplete/Autocomplete.stories.d.ts +43 -0
- package/dist/types/components/Autocomplete/Autocomplete/Autocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +57 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +92 -2
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Button/Button.stories.d.ts +42 -40
- package/dist/types/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/components/ChipGroup/ChipGroup.stories.d.ts +82 -3
- package/dist/types/components/ChipGroup/ChipGroup.stories.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeArea.stories.d.ts +34 -53
- package/dist/types/components/CodeArea/CodeArea.stories.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.test.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaField/CodeAreaField.d.ts.map +1 -1
- package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts +4 -5
- package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts.map +1 -1
- package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts +75 -1
- package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateCalendar.stories.d.ts +49 -96
- package/dist/types/components/DatePickers/DateCalendar.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts +47 -89
- package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts +75 -54
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts +57 -84
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts +52 -65
- package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/shared/ClearButton.test.d.ts +2 -0
- package/dist/types/components/DatePickers/shared/ClearButton.test.d.ts.map +1 -0
- package/dist/types/components/DatePickers/utils.test.d.ts +2 -0
- package/dist/types/components/DatePickers/utils.test.d.ts.map +1 -0
- package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts +52 -1
- package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.stories.d.ts +19 -0
- package/dist/types/components/Dialog/DialogConfirmation/DialogConfirmation.stories.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts +12 -0
- package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogPaper/DialogPaper.test.d.ts +2 -0
- package/dist/types/components/Dialog/DialogPaper/DialogPaper.test.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +58 -2
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +1 -1
- package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +109 -97
- package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
- package/dist/types/components/IconButton/IconButton.stories.d.ts +119 -38
- package/dist/types/components/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/types/components/Link/Link.stories.d.ts +66 -0
- package/dist/types/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/components/List/List.stories.d.ts +29 -0
- package/dist/types/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/components/List/ListItem/ListItem.stories.d.ts +31 -0
- package/dist/types/components/List/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/types/components/Menu/Menu/Menu.stories.d.ts +48 -0
- package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
- package/dist/types/components/MessageField/MessageField.stories.d.ts +29 -0
- package/dist/types/components/MessageField/MessageField.stories.d.ts.map +1 -1
- package/dist/types/components/PasswordField/PasswordField.stories.d.ts +47 -0
- package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.stories.d.ts +26 -0
- package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -1
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.intl.test.d.ts +2 -0
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.intl.test.d.ts.map +1 -0
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +76 -0
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
- package/dist/types/components/SelectField/SelectField/SelectField.stories.d.ts +60 -0
- package/dist/types/components/SelectField/SelectField/SelectField.stories.d.ts.map +1 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts +8 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/types/components/Snackbar/Snackbar.stories.d.ts +50 -51
- package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
- package/dist/types/components/SplitButton/SplitButton.d.ts +13 -1
- package/dist/types/components/SplitButton/SplitButton.d.ts.map +1 -1
- package/dist/types/components/SplitButton/SplitButton.stories.d.ts +50 -49
- package/dist/types/components/SplitButton/SplitButton.stories.d.ts.map +1 -1
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts +26 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +56 -22
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts.map +1 -1
- package/dist/types/components/UploadField/UploadField.stories.d.ts +57 -1
- package/dist/types/components/UploadField/UploadField.stories.d.ts.map +1 -1
- package/dist/types/custom-icons/LayerTypeCluster.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypeCluster.d.ts.map +1 -0
- package/dist/types/custom-icons/LayerTypeH3.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypeH3.d.ts.map +1 -0
- package/dist/types/custom-icons/LayerTypeHeatmap.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypeHeatmap.d.ts.map +1 -0
- package/dist/types/custom-icons/LayerTypeLine.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypeLine.d.ts.map +1 -0
- package/dist/types/custom-icons/LayerTypePoint.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypePoint.d.ts.map +1 -0
- package/dist/types/custom-icons/LayerTypePolygon.d.ts +4 -0
- package/dist/types/custom-icons/LayerTypePolygon.d.ts.map +1 -0
- package/dist/types/custom-icons/LayersGroup.d.ts +4 -0
- package/dist/types/custom-icons/LayersGroup.d.ts.map +1 -0
- package/dist/types/custom-icons/SelectFeature.d.ts.map +1 -1
- package/dist/types/custom-icons/ShortcutMap.d.ts +4 -0
- package/dist/types/custom-icons/ShortcutMap.d.ts.map +1 -0
- package/dist/types/custom-icons/ShortcutWorkflow.d.ts +4 -0
- package/dist/types/custom-icons/ShortcutWorkflow.d.ts.map +1 -0
- package/dist/types/custom-icons/StarredLayer.d.ts +4 -0
- package/dist/types/custom-icons/StarredLayer.d.ts.map +1 -0
- package/dist/types/custom-icons/StrokeDot.d.ts +4 -0
- package/dist/types/custom-icons/StrokeDot.d.ts.map +1 -0
- package/dist/types/custom-icons/VisibilityOffByGroup.d.ts +4 -0
- package/dist/types/custom-icons/VisibilityOffByGroup.d.ts.map +1 -0
- package/dist/types/custom-icons/XLogo.d.ts +4 -0
- package/dist/types/custom-icons/XLogo.d.ts.map +1 -0
- package/dist/types/custom-icons/__docs__/CustomIcons.stories.d.ts +1 -1
- package/dist/types/custom-icons/index.d.ts +13 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -1
- package/dist/types/theme/components/Slider.test.d.ts +2 -0
- package/dist/types/theme/components/Slider.test.d.ts.map +1 -0
- package/dist/types/theme/components/date-pickers.d.ts.map +1 -1
- package/dist/types/theme/components/forms.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Breadcrumb.stories.d.ts +42 -0
- package/dist/types/theme/components/stories/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/ButtonGroup.stories.d.ts +23 -41
- package/dist/types/theme/components/stories/ButtonGroup.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Checkbox.stories.d.ts +72 -0
- package/dist/types/theme/components/stories/Checkbox.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Chip.stories.d.ts +54 -0
- package/dist/types/theme/components/stories/Chip.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/FAB.stories.d.ts +22 -20
- package/dist/types/theme/components/stories/FAB.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Radio.stories.d.ts +62 -0
- package/dist/types/theme/components/stories/Radio.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Slider.stories.d.ts +87 -3
- package/dist/types/theme/components/stories/Slider.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Switch.stories.d.ts +20 -8
- package/dist/types/theme/components/stories/Switch.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Table.stories.d.ts +20 -0
- package/dist/types/theme/components/stories/Table.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/TablePagination.stories.d.ts +19 -0
- package/dist/types/theme/components/stories/TablePagination.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Tabs.stories.d.ts +48 -27
- package/dist/types/theme/components/stories/Tabs.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/TextArea.stories.d.ts +33 -0
- package/dist/types/theme/components/stories/TextArea.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/TextField.stories.d.ts +33 -0
- package/dist/types/theme/components/stories/TextField.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/ToggleButton.stories.d.ts +42 -0
- package/dist/types/theme/components/stories/ToggleButton.stories.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts +31 -0
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.d.ts +1 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.stories.d.ts +11 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.stories.d.ts.map +1 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts +2 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts.map +1 -1
- package/dist/types/widgets/TimeSeriesWidgetUI/utils/time-series-utils.d.ts +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/utils/time-series-utils.d.ts.map +1 -1
- package/dist/widgets/index.cjs +37 -18
- package/dist/widgets/index.js +37 -18
- package/package.json +26 -21
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- feat(design system): restyle Slider marks as a thin vertical break in the rail (replacing the default MUI dot), so passing `marks={[{ value }]}` on a range slider acts as a "stop indicator" for a reference value (e.g. a "base size") — visible across both filled and unfilled portions of the track. Applies to all marks; labels still position correctly underneath
|
|
6
|
+
- Feat: add `markLine` prop to `TimeSeriesWidgetUI` for custom reference lines [#409](https://github.com/CartoDB/meridian-ds/pull/409)
|
|
7
|
+
- Chore: remove redundant prepublish lifecycle hook [#404](https://github.com/CartoDB/meridian-ds/pull/404)
|
|
8
|
+
- Test: fill unit testing gaps [#401](https://github.com/CartoDB/meridian-ds/pull/401)
|
|
9
|
+
- Storybook: add pseudo-states addon for CSS state testing and extend `PseudoHover`/`PseudoFocusVisible` coverage across components [#406](https://github.com/CartoDB/meridian-ds/pull/406)
|
|
10
|
+
- Fix: add missing padding on date picker calendar header `labelContainer` to match the design spec [#406](https://github.com/CartoDB/meridian-ds/pull/406)
|
|
11
|
+
- Storybook: add interaction tests via `@storybook/addon-vitest`[#407](https://github.com/CartoDB/meridian-ds/pull/407)
|
|
12
|
+
- Add new custom icons: LayerTypeCluster, LayerTypeH3, LayerTypeHeatmap, LayerTypeLine, LayerTypePoint, LayerTypePolygon, LayersGroup, ShortcutMap, ShortcutWorkflow, StarredLayer, StrokeDot, VisibilityOffByGroup, XLogo, and update SelectFeature [#413](https://github.com/CartoDB/meridian-ds/pull/413)
|
|
6
13
|
|
|
7
14
|
## 2.0
|
|
8
15
|
|
|
16
|
+
### 2.15.1
|
|
17
|
+
|
|
18
|
+
- Fix: preserve compiled messages in flattenMessages — fixes `buttonFooterLabelId` and similar intl-key props showing raw keys [#402](https://github.com/CartoDB/meridian-ds/pull/402)
|
|
19
|
+
|
|
9
20
|
### 2.15.0
|
|
10
21
|
|
|
11
22
|
- Fix: WCAG accessibility improvements — IconButton aria-label, text contrast, widget labels [#398](https://github.com/CartoDB/meridian-ds/pull/398)
|
|
@@ -144,6 +144,17 @@ function _Button({
|
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
146
|
const Button = React.forwardRef(_Button);
|
|
147
|
+
const idCounter = {};
|
|
148
|
+
function uniqueId(prefix = "$lodash$") {
|
|
149
|
+
if (!idCounter[prefix]) {
|
|
150
|
+
idCounter[prefix] = 0;
|
|
151
|
+
}
|
|
152
|
+
const id = ++idCounter[prefix];
|
|
153
|
+
if (prefix === "$lodash$") {
|
|
154
|
+
return `${id}`;
|
|
155
|
+
}
|
|
156
|
+
return `${prefix}${id}`;
|
|
157
|
+
}
|
|
147
158
|
const ButtonGroup = material.styled(material.ButtonGroup)(({ theme, size }) => ({
|
|
148
159
|
"& .MuiButton-root:last-child": {
|
|
149
160
|
padding: 0,
|
|
@@ -159,12 +170,22 @@ function SplitButton({
|
|
|
159
170
|
variant,
|
|
160
171
|
size,
|
|
161
172
|
color,
|
|
173
|
+
defaultOpen,
|
|
174
|
+
toggleAriaLabel,
|
|
162
175
|
...otherProps
|
|
163
176
|
}) {
|
|
164
177
|
var _a;
|
|
165
|
-
const
|
|
166
|
-
|
|
178
|
+
const toggleLabel = paletteUtils.useTranslationWithFallback(
|
|
179
|
+
"c4r.button.showOptions",
|
|
180
|
+
toggleAriaLabel
|
|
181
|
+
);
|
|
182
|
+
const [baseId] = React.useState(() => uniqueId("split-button-"));
|
|
183
|
+
const toggleId = `${baseId}-toggle`;
|
|
184
|
+
const menuId = `${baseId}-menu`;
|
|
185
|
+
const [open, setOpen] = React.useState(defaultOpen ?? false);
|
|
186
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
167
187
|
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
188
|
+
const [menuAutoFocus, setMenuAutoFocus] = React.useState(!defaultOpen);
|
|
168
189
|
const handleClick = () => {
|
|
169
190
|
onClick(options[selectedIndex]);
|
|
170
191
|
};
|
|
@@ -173,11 +194,11 @@ function SplitButton({
|
|
|
173
194
|
setOpen(false);
|
|
174
195
|
};
|
|
175
196
|
const handleToggle = () => {
|
|
197
|
+
setMenuAutoFocus(true);
|
|
176
198
|
setOpen((prevOpen) => !prevOpen);
|
|
177
199
|
};
|
|
178
200
|
const handleClose = (event) => {
|
|
179
|
-
|
|
180
|
-
if ((_a2 = anchorRef.current) == null ? void 0 : _a2.contains(event.target)) {
|
|
201
|
+
if (anchorEl == null ? void 0 : anchorEl.contains(event.target)) {
|
|
181
202
|
return;
|
|
182
203
|
}
|
|
183
204
|
setOpen(false);
|
|
@@ -187,7 +208,7 @@ function SplitButton({
|
|
|
187
208
|
ButtonGroup,
|
|
188
209
|
{
|
|
189
210
|
"data-name": "split-button",
|
|
190
|
-
ref:
|
|
211
|
+
ref: setAnchorEl,
|
|
191
212
|
variant,
|
|
192
213
|
size,
|
|
193
214
|
color,
|
|
@@ -203,7 +224,19 @@ function SplitButton({
|
|
|
203
224
|
children: (_a = options[selectedIndex]) == null ? void 0 : _a.label
|
|
204
225
|
}
|
|
205
226
|
),
|
|
206
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: toggleLabel, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
+
Button,
|
|
229
|
+
{
|
|
230
|
+
id: toggleId,
|
|
231
|
+
disabled: loading || disabled,
|
|
232
|
+
onClick: handleToggle,
|
|
233
|
+
"aria-label": toggleLabel,
|
|
234
|
+
"aria-haspopup": "menu",
|
|
235
|
+
"aria-expanded": open,
|
|
236
|
+
"aria-controls": open ? menuId : void 0,
|
|
237
|
+
children: open ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ForwardedComponent, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ForwardedComponent, {})
|
|
238
|
+
}
|
|
239
|
+
) }) })
|
|
207
240
|
]
|
|
208
241
|
}
|
|
209
242
|
),
|
|
@@ -211,8 +244,8 @@ function SplitButton({
|
|
|
211
244
|
material.Popper,
|
|
212
245
|
{
|
|
213
246
|
sx: { zIndex: 1 },
|
|
214
|
-
open,
|
|
215
|
-
anchorEl
|
|
247
|
+
open: open && Boolean(anchorEl),
|
|
248
|
+
anchorEl,
|
|
216
249
|
role: void 0,
|
|
217
250
|
transition: true,
|
|
218
251
|
disablePortal: true,
|
|
@@ -224,16 +257,25 @@ function SplitButton({
|
|
|
224
257
|
style: {
|
|
225
258
|
transformOrigin: placement === "bottom" ? "center top" : "center bottom"
|
|
226
259
|
},
|
|
227
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(material.Paper, { elevation: 8, children: /* @__PURE__ */ jsxRuntime.jsx(material.ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
-
material.
|
|
260
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(material.Paper, { elevation: 8, children: /* @__PURE__ */ jsxRuntime.jsx(material.ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
261
|
+
material.MenuList,
|
|
229
262
|
{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
263
|
+
id: menuId,
|
|
264
|
+
"aria-labelledby": toggleId,
|
|
265
|
+
autoFocusItem: menuAutoFocus,
|
|
266
|
+
sx: { paddingY: 1 },
|
|
267
|
+
children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
268
|
+
material.MenuItem,
|
|
269
|
+
{
|
|
270
|
+
disabled: option.disabled,
|
|
271
|
+
selected: index === selectedIndex,
|
|
272
|
+
onClick: (event) => handleMenuItemClick(event, index),
|
|
273
|
+
children: option.label
|
|
274
|
+
},
|
|
275
|
+
option.label
|
|
276
|
+
))
|
|
277
|
+
}
|
|
278
|
+
) }) })
|
|
237
279
|
}
|
|
238
280
|
)
|
|
239
281
|
}
|
|
@@ -351,17 +393,6 @@ function _PasswordField({
|
|
|
351
393
|
);
|
|
352
394
|
}
|
|
353
395
|
const PasswordField = React.forwardRef(_PasswordField);
|
|
354
|
-
const idCounter = {};
|
|
355
|
-
function uniqueId(prefix = "$lodash$") {
|
|
356
|
-
if (!idCounter[prefix]) {
|
|
357
|
-
idCounter[prefix] = 0;
|
|
358
|
-
}
|
|
359
|
-
const id = ++idCounter[prefix];
|
|
360
|
-
if (prefix === "$lodash$") {
|
|
361
|
-
return `${id}`;
|
|
362
|
-
}
|
|
363
|
-
return `${prefix}${id}`;
|
|
364
|
-
}
|
|
365
396
|
const StyledSelect = material.styled(material.Select)(({ theme }) => ({
|
|
366
397
|
"& .MuiInputAdornment-positionStart": {
|
|
367
398
|
paddingLeft: theme.spacing(2),
|
|
@@ -2903,6 +2934,7 @@ function CodeAreaField({
|
|
|
2903
2934
|
lineNumbers,
|
|
2904
2935
|
className: variant === "filled" ? "codeArea-filled" : "",
|
|
2905
2936
|
fullScreen,
|
|
2937
|
+
"aria-readonly": readOnly || void 0,
|
|
2906
2938
|
children: [
|
|
2907
2939
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2908
2940
|
CodeAreaHeader,
|
|
@@ -3319,6 +3351,14 @@ function DialogHeader({
|
|
|
3319
3351
|
children && /* @__PURE__ */ jsxRuntime.jsx(DividerBottom, {})
|
|
3320
3352
|
] });
|
|
3321
3353
|
}
|
|
3354
|
+
function computeScrollBorders(node, hasFooterAlert) {
|
|
3355
|
+
const atBottom = Math.abs(node.scrollHeight - node.clientHeight - node.scrollTop) < 1;
|
|
3356
|
+
const atTop = node.scrollTop === 0;
|
|
3357
|
+
return {
|
|
3358
|
+
showTop: !atTop,
|
|
3359
|
+
showBottom: !atBottom || Boolean(hasFooterAlert)
|
|
3360
|
+
};
|
|
3361
|
+
}
|
|
3322
3362
|
const Content$5 = material.styled(material.DialogContent, {
|
|
3323
3363
|
shouldForwardProp: (prop) => ![
|
|
3324
3364
|
"scrollableContent",
|
|
@@ -3382,11 +3422,10 @@ function _DialogContent({
|
|
|
3382
3422
|
);
|
|
3383
3423
|
const updateBorders = React.useCallback(
|
|
3384
3424
|
(node) => {
|
|
3385
|
-
const
|
|
3386
|
-
const top = node.scrollTop === 0;
|
|
3425
|
+
const { showTop, showBottom } = computeScrollBorders(node, hasFooterAlert);
|
|
3387
3426
|
const borderStyle = `1px solid ${theme.palette.divider}`;
|
|
3388
|
-
node.style.borderTop =
|
|
3389
|
-
node.style.borderBottom =
|
|
3427
|
+
node.style.borderTop = showTop ? borderStyle : "none";
|
|
3428
|
+
node.style.borderBottom = showBottom ? borderStyle : "none";
|
|
3390
3429
|
},
|
|
3391
3430
|
[theme.palette.divider, hasFooterAlert]
|
|
3392
3431
|
);
|
|
@@ -5931,6 +5970,7 @@ function Snackbar({
|
|
|
5931
5970
|
autoWidth,
|
|
5932
5971
|
icon,
|
|
5933
5972
|
closeTooltipText,
|
|
5973
|
+
disablePortal,
|
|
5934
5974
|
...rest
|
|
5935
5975
|
}) {
|
|
5936
5976
|
const closeTooltipLabel = paletteUtils.useTranslationWithFallback(
|
|
@@ -5941,7 +5981,7 @@ function Snackbar({
|
|
|
5941
5981
|
const disabledIcon = icon === false || isNeutral && !icon;
|
|
5942
5982
|
const disabledAutoHide = autoHideDuration === null;
|
|
5943
5983
|
const duration = disabledAutoHide ? null : autoHideDuration || paletteUtils.NOTIFICATION_DURATION_IN_MS;
|
|
5944
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5984
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Portal, { disablePortal, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5945
5985
|
SnackbarRoot,
|
|
5946
5986
|
{
|
|
5947
5987
|
...rest,
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 { styled, Box, Button as Button$1, CircularProgress as CircularProgress$1, 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 as ListItemText$1,
|
|
3
|
+
import { styled, Box, Button as Button$1, CircularProgress as CircularProgress$1, Tooltip, 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 as ListItemText$1, ToggleButtonGroup as ToggleButtonGroup$1, Stack, Autocomplete as Autocomplete$1, Divider, ListItemIcon as ListItemIcon$1, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip as Chip$1, 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, ListSubheader as ListSubheader$1, Typography as Typography$1, Popover } from "@mui/material";
|
|
4
4
|
import { ListItemAvatar, ListItemSecondaryAction } from "@mui/material";
|
|
5
5
|
import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, ArrowBackOutlined, Check, TodayOutlined, StopCircleOutlined, ArrowUpwardOutlined } from "@mui/icons-material";
|
|
6
6
|
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, o as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, l as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, p as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles, r as resolvePalettePath } from "../palette-utils-gZwK5wCD.js";
|
|
@@ -128,6 +128,17 @@ function _Button({
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
const Button = forwardRef(_Button);
|
|
131
|
+
const idCounter = {};
|
|
132
|
+
function uniqueId(prefix = "$lodash$") {
|
|
133
|
+
if (!idCounter[prefix]) {
|
|
134
|
+
idCounter[prefix] = 0;
|
|
135
|
+
}
|
|
136
|
+
const id = ++idCounter[prefix];
|
|
137
|
+
if (prefix === "$lodash$") {
|
|
138
|
+
return `${id}`;
|
|
139
|
+
}
|
|
140
|
+
return `${prefix}${id}`;
|
|
141
|
+
}
|
|
131
142
|
const ButtonGroup = styled(ButtonGroup$1)(({ theme, size }) => ({
|
|
132
143
|
"& .MuiButton-root:last-child": {
|
|
133
144
|
padding: 0,
|
|
@@ -143,12 +154,22 @@ function SplitButton({
|
|
|
143
154
|
variant,
|
|
144
155
|
size,
|
|
145
156
|
color,
|
|
157
|
+
defaultOpen,
|
|
158
|
+
toggleAriaLabel,
|
|
146
159
|
...otherProps
|
|
147
160
|
}) {
|
|
148
161
|
var _a;
|
|
149
|
-
const
|
|
150
|
-
|
|
162
|
+
const toggleLabel = useTranslationWithFallback(
|
|
163
|
+
"c4r.button.showOptions",
|
|
164
|
+
toggleAriaLabel
|
|
165
|
+
);
|
|
166
|
+
const [baseId] = useState(() => uniqueId("split-button-"));
|
|
167
|
+
const toggleId = `${baseId}-toggle`;
|
|
168
|
+
const menuId = `${baseId}-menu`;
|
|
169
|
+
const [open, setOpen] = useState(defaultOpen ?? false);
|
|
170
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
151
171
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
172
|
+
const [menuAutoFocus, setMenuAutoFocus] = useState(!defaultOpen);
|
|
152
173
|
const handleClick = () => {
|
|
153
174
|
onClick(options[selectedIndex]);
|
|
154
175
|
};
|
|
@@ -157,11 +178,11 @@ function SplitButton({
|
|
|
157
178
|
setOpen(false);
|
|
158
179
|
};
|
|
159
180
|
const handleToggle = () => {
|
|
181
|
+
setMenuAutoFocus(true);
|
|
160
182
|
setOpen((prevOpen) => !prevOpen);
|
|
161
183
|
};
|
|
162
184
|
const handleClose = (event) => {
|
|
163
|
-
|
|
164
|
-
if ((_a2 = anchorRef.current) == null ? void 0 : _a2.contains(event.target)) {
|
|
185
|
+
if (anchorEl == null ? void 0 : anchorEl.contains(event.target)) {
|
|
165
186
|
return;
|
|
166
187
|
}
|
|
167
188
|
setOpen(false);
|
|
@@ -171,7 +192,7 @@ function SplitButton({
|
|
|
171
192
|
ButtonGroup,
|
|
172
193
|
{
|
|
173
194
|
"data-name": "split-button",
|
|
174
|
-
ref:
|
|
195
|
+
ref: setAnchorEl,
|
|
175
196
|
variant,
|
|
176
197
|
size,
|
|
177
198
|
color,
|
|
@@ -187,7 +208,19 @@ function SplitButton({
|
|
|
187
208
|
children: (_a = options[selectedIndex]) == null ? void 0 : _a.label
|
|
188
209
|
}
|
|
189
210
|
),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
211
|
+
/* @__PURE__ */ jsx(Tooltip, { title: toggleLabel, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
212
|
+
Button,
|
|
213
|
+
{
|
|
214
|
+
id: toggleId,
|
|
215
|
+
disabled: loading || disabled,
|
|
216
|
+
onClick: handleToggle,
|
|
217
|
+
"aria-label": toggleLabel,
|
|
218
|
+
"aria-haspopup": "menu",
|
|
219
|
+
"aria-expanded": open,
|
|
220
|
+
"aria-controls": open ? menuId : void 0,
|
|
221
|
+
children: open ? /* @__PURE__ */ jsx(ForwardedComponent, {}) : /* @__PURE__ */ jsx(ForwardedComponent$1, {})
|
|
222
|
+
}
|
|
223
|
+
) }) })
|
|
191
224
|
]
|
|
192
225
|
}
|
|
193
226
|
),
|
|
@@ -195,8 +228,8 @@ function SplitButton({
|
|
|
195
228
|
Popper,
|
|
196
229
|
{
|
|
197
230
|
sx: { zIndex: 1 },
|
|
198
|
-
open,
|
|
199
|
-
anchorEl
|
|
231
|
+
open: open && Boolean(anchorEl),
|
|
232
|
+
anchorEl,
|
|
200
233
|
role: void 0,
|
|
201
234
|
transition: true,
|
|
202
235
|
disablePortal: true,
|
|
@@ -208,16 +241,25 @@ function SplitButton({
|
|
|
208
241
|
style: {
|
|
209
242
|
transformOrigin: placement === "bottom" ? "center top" : "center bottom"
|
|
210
243
|
},
|
|
211
|
-
children: /* @__PURE__ */ jsx(Paper, { elevation: 8, children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsx(
|
|
212
|
-
|
|
244
|
+
children: /* @__PURE__ */ jsx(Paper, { elevation: 8, children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsx(
|
|
245
|
+
MenuList$1,
|
|
213
246
|
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
247
|
+
id: menuId,
|
|
248
|
+
"aria-labelledby": toggleId,
|
|
249
|
+
autoFocusItem: menuAutoFocus,
|
|
250
|
+
sx: { paddingY: 1 },
|
|
251
|
+
children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
252
|
+
MenuItem,
|
|
253
|
+
{
|
|
254
|
+
disabled: option.disabled,
|
|
255
|
+
selected: index === selectedIndex,
|
|
256
|
+
onClick: (event) => handleMenuItemClick(event, index),
|
|
257
|
+
children: option.label
|
|
258
|
+
},
|
|
259
|
+
option.label
|
|
260
|
+
))
|
|
261
|
+
}
|
|
262
|
+
) }) })
|
|
221
263
|
}
|
|
222
264
|
)
|
|
223
265
|
}
|
|
@@ -335,17 +377,6 @@ function _PasswordField({
|
|
|
335
377
|
);
|
|
336
378
|
}
|
|
337
379
|
const PasswordField = forwardRef(_PasswordField);
|
|
338
|
-
const idCounter = {};
|
|
339
|
-
function uniqueId(prefix = "$lodash$") {
|
|
340
|
-
if (!idCounter[prefix]) {
|
|
341
|
-
idCounter[prefix] = 0;
|
|
342
|
-
}
|
|
343
|
-
const id = ++idCounter[prefix];
|
|
344
|
-
if (prefix === "$lodash$") {
|
|
345
|
-
return `${id}`;
|
|
346
|
-
}
|
|
347
|
-
return `${prefix}${id}`;
|
|
348
|
-
}
|
|
349
380
|
const StyledSelect = styled(Select)(({ theme }) => ({
|
|
350
381
|
"& .MuiInputAdornment-positionStart": {
|
|
351
382
|
paddingLeft: theme.spacing(2),
|
|
@@ -2887,6 +2918,7 @@ function CodeAreaField({
|
|
|
2887
2918
|
lineNumbers,
|
|
2888
2919
|
className: variant === "filled" ? "codeArea-filled" : "",
|
|
2889
2920
|
fullScreen,
|
|
2921
|
+
"aria-readonly": readOnly || void 0,
|
|
2890
2922
|
children: [
|
|
2891
2923
|
/* @__PURE__ */ jsx(
|
|
2892
2924
|
CodeAreaHeader,
|
|
@@ -3303,6 +3335,14 @@ function DialogHeader({
|
|
|
3303
3335
|
children && /* @__PURE__ */ jsx(DividerBottom, {})
|
|
3304
3336
|
] });
|
|
3305
3337
|
}
|
|
3338
|
+
function computeScrollBorders(node, hasFooterAlert) {
|
|
3339
|
+
const atBottom = Math.abs(node.scrollHeight - node.clientHeight - node.scrollTop) < 1;
|
|
3340
|
+
const atTop = node.scrollTop === 0;
|
|
3341
|
+
return {
|
|
3342
|
+
showTop: !atTop,
|
|
3343
|
+
showBottom: !atBottom || Boolean(hasFooterAlert)
|
|
3344
|
+
};
|
|
3345
|
+
}
|
|
3306
3346
|
const Content$5 = styled(DialogContent$1, {
|
|
3307
3347
|
shouldForwardProp: (prop) => ![
|
|
3308
3348
|
"scrollableContent",
|
|
@@ -3366,11 +3406,10 @@ function _DialogContent({
|
|
|
3366
3406
|
);
|
|
3367
3407
|
const updateBorders = useCallback(
|
|
3368
3408
|
(node) => {
|
|
3369
|
-
const
|
|
3370
|
-
const top = node.scrollTop === 0;
|
|
3409
|
+
const { showTop, showBottom } = computeScrollBorders(node, hasFooterAlert);
|
|
3371
3410
|
const borderStyle = `1px solid ${theme.palette.divider}`;
|
|
3372
|
-
node.style.borderTop =
|
|
3373
|
-
node.style.borderBottom =
|
|
3411
|
+
node.style.borderTop = showTop ? borderStyle : "none";
|
|
3412
|
+
node.style.borderBottom = showBottom ? borderStyle : "none";
|
|
3374
3413
|
},
|
|
3375
3414
|
[theme.palette.divider, hasFooterAlert]
|
|
3376
3415
|
);
|
|
@@ -5915,6 +5954,7 @@ function Snackbar({
|
|
|
5915
5954
|
autoWidth,
|
|
5916
5955
|
icon,
|
|
5917
5956
|
closeTooltipText,
|
|
5957
|
+
disablePortal,
|
|
5918
5958
|
...rest
|
|
5919
5959
|
}) {
|
|
5920
5960
|
const closeTooltipLabel = useTranslationWithFallback(
|
|
@@ -5925,7 +5965,7 @@ function Snackbar({
|
|
|
5925
5965
|
const disabledIcon = icon === false || isNeutral && !icon;
|
|
5926
5966
|
const disabledAutoHide = autoHideDuration === null;
|
|
5927
5967
|
const duration = disabledAutoHide ? null : autoHideDuration || NOTIFICATION_DURATION_IN_MS;
|
|
5928
|
-
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
5968
|
+
return /* @__PURE__ */ jsx(Portal, { disablePortal, children: /* @__PURE__ */ jsx(
|
|
5929
5969
|
SnackbarRoot,
|
|
5930
5970
|
{
|
|
5931
5971
|
...rest,
|