@eightshift/ui-components 1.6.0 → 1.7.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.
- package/dist/Button-VbCAu4hd.js +185 -0
- package/dist/{intlStrings-BxJIrC6b.js → Color-BpLubxWI.js} +2394 -2394
- package/dist/{ColorSwatch-BNX2quma.js → ColorSwatch-CinC14s3.js} +4 -4
- package/dist/{Dialog-BdtBguys.js → Dialog-BN5EE7UH.js} +9 -9
- package/dist/{FieldError-ClB3-XvF.js → FieldError-BttM1Nxd.js} +2 -2
- package/dist/{FocusScope-B5L3qI3N.js → FocusScope-CtCX0OGo.js} +2 -2
- package/dist/{Group-ubPTwji_.js → Group-XzWUooix.js} +3 -3
- package/dist/{Heading-DGnF6JDc.js → Heading-DZelepHV.js} +1 -1
- package/dist/{Hidden-CupIZhlF.js → Hidden-CcFqOzrp.js} +1 -1
- package/dist/{Input-BoNEjaXM.js → Input-CV1qVS6t.js} +8 -8
- package/dist/{Label-BqW0M3HN.js → Label-BwqMVkuV.js} +2 -2
- package/dist/{ListBox-civ86c_v.js → ListBox-DuZPdnkk.js} +16 -12
- package/dist/{SelectionManager-Ctbzoj1E.js → SelectionManager-x27KqnAT.js} +67 -34
- package/dist/{Separator-CDhAddZc.js → Separator-BM58t3PP.js} +24 -26
- package/dist/{Slider-Dkj8Slw3.js → Slider-D9Cs6yKr.js} +162 -162
- package/dist/{Text-CdwRBXol.js → Text-BVIXT8qq.js} +1 -1
- package/dist/{VisuallyHidden-DsMLX-RC.js → VisuallyHidden-WhC7vZaL.js} +2 -2
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +92 -129
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +6 -6
- package/dist/components/checkbox/checkbox.js +7 -7
- package/dist/components/color-pickers/color-picker.js +2 -2
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +64 -64
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +7 -4
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +6 -3
- package/dist/components/expandable/expandable.js +3 -3
- package/dist/components/index.js +3 -1
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/item-collection/item-collection.js +6 -1
- package/dist/components/link-input/link-input.js +40 -36
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +2 -2
- package/dist/components/menu/menu.js +15 -15
- package/dist/components/modal/modal.js +6 -6
- package/dist/components/number-picker/number-picker.js +10 -10
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/options-panel/options-panel.js +17 -5
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/placeholders/media-placeholder.js +6 -5
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +6 -3
- package/dist/components/responsive/mini-responsive.js +495 -0
- package/dist/components/responsive/responsive-legacy.js +2 -2
- package/dist/components/responsive/responsive.js +7 -3
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/select/async-multi-select.js +1 -0
- package/dist/components/select/async-single-select.js +4 -1
- package/dist/components/select/multi-select.js +1 -0
- package/dist/components/select/single-select.js +4 -1
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/spacer/spacer.js +3 -4
- package/dist/components/tabs/tabs.js +23 -18
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +6 -6
- package/dist/components/tooltip/tooltip.js +3 -3
- package/dist/{context-kCEA3M_y.js → context-Cs-ZD1nu.js} +1 -1
- package/dist/{default-i18n-BqWys-1G.js → default-i18n-DRnM8y4w.js} +45 -21
- package/dist/{focusSafely-xMzk3syC.js → focusSafely-CgFLw4FA.js} +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +3 -1
- package/dist/{number-CHmNj-oR.js → number-GajL10e1.js} +2 -2
- package/dist/{react-jsx-parser.min-sPC96O_U.js → react-jsx-parser.min-B5HVwW_W.js} +103 -53
- package/dist/{textSelection-D5Bit8i8.js → textSelection-CvK0YHTZ.js} +1 -1
- package/dist/{tooltip-srrt1p-b.js → tooltip-eKaARDoV.js} +5 -5
- package/dist/{useButton-6H5k2W5N.js → useButton-Cy9eEev7.js} +3 -3
- package/dist/{useEvent-BY-3vfxa.js → useEvent-LZebwyrb.js} +1 -1
- package/dist/{useFocusRing-rz8eyzby.js → useFocusRing-BMOTWmOx.js} +1 -1
- package/dist/{useFocusable-Bu2Ovohk.js → useFocusable-ByyKSVQv.js} +2 -2
- package/dist/{useFormReset-fUHUaaR6.js → useFormReset-B8m1uz1J.js} +1 -1
- package/dist/{useFormValidationState-DAan_XbC.js → useFormValidationState-BjMhz_VI.js} +2 -2
- package/dist/{useLabel-Bk7iP__W.js → useLabel-B6uO0wVK.js} +2 -2
- package/dist/{useLabels-DmsOywGg.js → useLabels-5dFkeiXx.js} +1 -1
- package/dist/{useListState-GXSJsAgz.js → useListState-eKxv7HPC.js} +28 -16
- package/dist/{useLocalizedStringFormatter-m03yY3xi.js → useLocalizedStringFormatter-BaKmjFNp.js} +1 -1
- package/dist/{useMenuTrigger-CT2-BFLo.js → useMenuTrigger-4fwEmto8.js} +4 -4
- package/dist/{useNumberFieldState-CpmU88xz.js → useNumberField-DMMUTZ-h.js} +169 -169
- package/dist/{useNumberFormatter-B-20GQ2u.js → useNumberFormatter-Cyx5Dxkf.js} +1 -1
- package/dist/{usePress-Cs8K7gKw.js → usePress-D8nPoIQm.js} +22 -10
- package/dist/{useSingleSelectListState-C1ddMCq3.js → useSingleSelectListState-CABciySJ.js} +3 -2
- package/dist/{useToggle-Cn2nQUNS.js → useToggle-BmltE9Zr.js} +4 -4
- package/dist/{useToggleState-Dj0JhD9W.js → useToggleState-DZXLEnA_.js} +1 -1
- package/dist/{utils-Du2x3YVu.js → utils-BCJajCwh.js} +15 -7
- package/package.json +18 -18
- package/dist/Button-CYX0D6At.js +0 -55
- package/dist/LiveAnnouncer-D8h-3GrG.js +0 -63
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { forwardRef, useRef, createContext, useState, cloneElement } from "react";
|
|
3
|
-
import { _ as __ } from "../../default-i18n-
|
|
4
|
-
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-
|
|
5
|
-
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
6
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
7
|
-
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
8
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-
|
|
9
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
3
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
4
|
+
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-XzWUooix.js";
|
|
5
|
+
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CV1qVS6t.js";
|
|
6
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BwqMVkuV.js";
|
|
7
|
+
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-VbCAu4hd.js";
|
|
8
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-BCJajCwh.js";
|
|
9
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-BttM1Nxd.js";
|
|
10
10
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
11
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
11
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-BVIXT8qq.js";
|
|
12
12
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
13
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
14
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../
|
|
13
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Cs-ZD1nu.js";
|
|
14
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-DMMUTZ-h.js";
|
|
15
15
|
import { Button } from "../button/button.js";
|
|
16
16
|
import { icons } from "../../icons/icons.js";
|
|
17
17
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -7,7 +7,7 @@ import { Menu, MenuSeparator, MenuItem } from "../menu/menu.js";
|
|
|
7
7
|
import { RadioButtonGroup, RadioButton } from "../radio/radio.js";
|
|
8
8
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
9
9
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
10
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that allows the user to select an option from a list of options.
|
|
13
13
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
|
-
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-
|
|
4
|
+
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-DZelepHV.js";
|
|
5
5
|
/**
|
|
6
6
|
* Component that provides a container panel for options, with an optional title.
|
|
7
7
|
* Best used within the Gutenberg sidebar, instead of the default `PanelBody` component.
|
|
@@ -14,6 +14,7 @@ import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-DG
|
|
|
14
14
|
* @param {JSX.Element} [props.icon] - Icon to display on the top of the panel.
|
|
15
15
|
* @param {string} [props.subtitle] - Subtitle to display on the top of the panel.
|
|
16
16
|
* @param {string} [props.help] - Help text to show below the panel.
|
|
17
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
17
18
|
*
|
|
18
19
|
* @returns {JSX.Element} The OptionsPanel component.
|
|
19
20
|
*
|
|
@@ -25,7 +26,10 @@ import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-DG
|
|
|
25
26
|
* @preserve
|
|
26
27
|
*/
|
|
27
28
|
const OptionsPanel = (props) => {
|
|
28
|
-
const { children, className, title, icon, subtitle, help } = props;
|
|
29
|
+
const { children, className, title, icon, subtitle, help, hidden } = props;
|
|
30
|
+
if (hidden) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
29
33
|
return /* @__PURE__ */ jsxs("div", { className: clsx("es-uic-max-w-md", className), children: [
|
|
30
34
|
title && /* @__PURE__ */ jsx(
|
|
31
35
|
RichLabel,
|
|
@@ -46,6 +50,7 @@ const OptionsPanel = (props) => {
|
|
|
46
50
|
* @component
|
|
47
51
|
* @param {Object} props - Component props.
|
|
48
52
|
* @param {string} [props.className] - Classes to pass to the container.
|
|
53
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
49
54
|
*
|
|
50
55
|
* @returns {JSX.Element} The OptionsPanelSection component.
|
|
51
56
|
*
|
|
@@ -56,7 +61,10 @@ const OptionsPanel = (props) => {
|
|
|
56
61
|
*
|
|
57
62
|
* @preserve
|
|
58
63
|
*/
|
|
59
|
-
const OptionsPanelSection = ({ children, className }) => {
|
|
64
|
+
const OptionsPanelSection = ({ children, className, hidden }) => {
|
|
65
|
+
if (hidden) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
60
68
|
return /* @__PURE__ */ jsx(
|
|
61
69
|
"div",
|
|
62
70
|
{
|
|
@@ -78,6 +86,7 @@ const OptionsPanelSection = ({ children, className }) => {
|
|
|
78
86
|
* @param {Number} [props.level=2] - Heading level of the title.
|
|
79
87
|
* @param {string} [props.className] - Classes to pass to the container.
|
|
80
88
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Controls to show on the right side of the header.
|
|
89
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
81
90
|
*
|
|
82
91
|
* @returns {JSX.Element} The OptionsPanelHeader component.
|
|
83
92
|
*
|
|
@@ -88,13 +97,16 @@ const OptionsPanelSection = ({ children, className }) => {
|
|
|
88
97
|
*
|
|
89
98
|
* @preserve
|
|
90
99
|
*/
|
|
91
|
-
const OptionsPanelHeader = ({ children, sticky, title, className, actions, level = 2 }) => {
|
|
100
|
+
const OptionsPanelHeader = ({ children, sticky, title, className, actions, level = 2, hidden }) => {
|
|
101
|
+
if (hidden) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
92
104
|
return /* @__PURE__ */ jsxs("div", { className: clsx("es-uic-max-w-md es-uic-space-y-2.5", sticky && "es-uic-sticky es-uic-top-0 es-uic-z-10", className), children: [
|
|
93
105
|
/* @__PURE__ */ jsxs("div", { className: "es-uic-flex es-uic-flex-wrap es-uic-items-center es-uic-justify-between es-uic-gap-x-8 es-uic-gap-y-4", children: [
|
|
94
106
|
/* @__PURE__ */ jsx(
|
|
95
107
|
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
96
108
|
{
|
|
97
|
-
className: "es-uic-text-
|
|
109
|
+
className: "es-uic-text-2xl es-uic-font-medium es-uic-tracking-tight",
|
|
98
110
|
level,
|
|
99
111
|
children: title
|
|
100
112
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -24,13 +24,13 @@ import { icons } from "../../icons/icons.js";
|
|
|
24
24
|
* @preserve
|
|
25
25
|
*/
|
|
26
26
|
const MediaPlaceholder = (props) => {
|
|
27
|
-
const { style = "default", size = "default", className, icon, helpText, hidden } = props;
|
|
27
|
+
const { style = "default", size = "default", className, icon, helpText, children, hidden } = props;
|
|
28
28
|
if (hidden) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
31
|
const styleClassName = {
|
|
32
|
-
default: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-text-gray-
|
|
33
|
-
simple: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-border-dashed es-uic-text-gray-
|
|
32
|
+
default: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-text-gray-400 es-uic-shadow",
|
|
33
|
+
simple: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-border-dashed es-uic-text-gray-400"
|
|
34
34
|
};
|
|
35
35
|
const sizeClassName = {
|
|
36
36
|
auto: "",
|
|
@@ -45,14 +45,15 @@ const MediaPlaceholder = (props) => {
|
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: clsx(
|
|
48
|
-
"es-uic-flex es-uic-flex-col es-uic-items-center es-uic-justify-center es-uic-gap-2 es-uic-overflow-hidden",
|
|
48
|
+
"es-uic-flex es-uic-flex-col es-uic-items-center es-uic-justify-center es-uic-gap-2 es-uic-overflow-hidden es-uic-p-2",
|
|
49
49
|
styleClassName[style] ?? (styleClassName == null ? void 0 : styleClassName.default),
|
|
50
50
|
sizeClassName[size] ?? (sizeClassName == null ? void 0 : sizeClassName.default),
|
|
51
51
|
className
|
|
52
52
|
),
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ jsx("div", { className: "[&>svg]:es-uic-size-7", children: icon ?? icons.image }),
|
|
55
|
-
helpText && /* @__PURE__ */ jsx("div", { className: "es-uic-text-sm es-uic-text-gray-
|
|
55
|
+
helpText && /* @__PURE__ */ jsx("div", { className: "es-uic-text-sm es-uic-text-gray-500", children: helpText }),
|
|
56
|
+
children && /* @__PURE__ */ jsx("div", { className: "es-uic-mt-2 es-uic-flex es-uic-items-center es-uic-gap-x-2 es-uic-gap-y-2.5 es-uic-text-sm", children })
|
|
56
57
|
]
|
|
57
58
|
}
|
|
58
59
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, a as $de32f1b87079253c$export$3ddf2d174ce01153, b as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
2
|
+
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, a as $de32f1b87079253c$export$3ddf2d174ce01153, b as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-BN5EE7UH.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
-
import { _ as __ } from "../../default-i18n-
|
|
4
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
/**
|
|
7
7
|
* A popover component.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
3
|
-
import { c as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, h as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-
|
|
4
|
-
import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
2
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BwqMVkuV.js";
|
|
3
|
+
import { c as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, h as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-BCJajCwh.js";
|
|
4
|
+
import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-BttM1Nxd.js";
|
|
5
5
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
6
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
6
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-BVIXT8qq.js";
|
|
7
7
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
8
8
|
import React__default, { useMemo, useState, forwardRef, createContext, cloneElement } from "react";
|
|
9
|
-
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidationState-
|
|
10
|
-
import { d as $9ab94262bd0047c7$export$420e68273165f4ec, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
11
|
-
import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-
|
|
12
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
13
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-
|
|
14
|
-
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../../useFocusable-
|
|
15
|
-
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-
|
|
16
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
17
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-
|
|
9
|
+
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidationState-BjMhz_VI.js";
|
|
10
|
+
import { d as $9ab94262bd0047c7$export$420e68273165f4ec, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-CgFLw4FA.js";
|
|
11
|
+
import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-CtCX0OGo.js";
|
|
12
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Cs-ZD1nu.js";
|
|
13
|
+
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-B8m1uz1J.js";
|
|
14
|
+
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../../useFocusable-ByyKSVQv.js";
|
|
15
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-D8nPoIQm.js";
|
|
16
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-BMOTWmOx.js";
|
|
17
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-WhC7vZaL.js";
|
|
18
18
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
19
19
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
20
20
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
@@ -5,7 +5,7 @@ import { icons } from "../../icons/icons.js";
|
|
|
5
5
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
6
6
|
import { useContext } from "react";
|
|
7
7
|
import { Expandable } from "../expandable/expandable.js";
|
|
8
|
-
import { _ as __ } from "../../default-i18n-
|
|
8
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
9
9
|
import { RepeaterContext } from "./repeater-context.js";
|
|
10
10
|
/**
|
|
11
11
|
* A Repeater item.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-DRnM8y4w.js";
|
|
3
3
|
import { Button } from "../button/button.js";
|
|
4
4
|
import { icons } from "../../icons/icons.js";
|
|
5
5
|
import { useId } from "react";
|
|
@@ -9,7 +9,7 @@ import { RepeaterContext } from "./repeater-context.js";
|
|
|
9
9
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
10
10
|
import { L as List, a as arrayRemove, b as arrayMove } from "../../List-Bx2anbX-.js";
|
|
11
11
|
const fixIds = (items, itemIdBase) => {
|
|
12
|
-
return items.map((item, i) => ({
|
|
12
|
+
return items == null ? void 0 : items.map((item, i) => ({
|
|
13
13
|
...item,
|
|
14
14
|
id: (item == null ? void 0 : item.id) ?? `${itemIdBase}-${i}`
|
|
15
15
|
}));
|
|
@@ -90,7 +90,10 @@ const Repeater = (props) => {
|
|
|
90
90
|
emptyState,
|
|
91
91
|
hidden
|
|
92
92
|
} = props;
|
|
93
|
-
|
|
93
|
+
if (typeof rawItems === "undefined" || rawItems === null || !Array.isArray(rawItems)) {
|
|
94
|
+
console.warn(__("Repeater: 'items' are not an array or are undefined!", "eightshift-ui-components"));
|
|
95
|
+
}
|
|
96
|
+
const items = fixIds(rawItems ?? [], itemIdBase);
|
|
94
97
|
const canDelete = items.length > (minItems ?? 0);
|
|
95
98
|
const canAdd = items.length < (maxItems ?? Number.MAX_SAFE_INTEGER);
|
|
96
99
|
if (hidden) {
|