@eightshift/ui-components 1.3.1 → 1.4.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-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
- package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
- package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
- package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
- package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
- package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
- package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
- package/dist/Hidden-YSmyVF_5.js +45 -0
- package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
- package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
- package/dist/ListBox-MZyPpwvj.js +567 -0
- package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
- package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
- package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
- package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
- package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
- package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +311 -198
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +274 -9
- package/dist/components/checkbox/checkbox.js +171 -1
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +3 -3
- package/dist/components/color-pickers/solid-color-picker.js +46 -32
- package/dist/components/component-toggle/component-toggle.js +2 -2
- package/dist/components/container-panel/container-panel.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +3671 -6
- package/dist/components/expandable/expandable.js +7 -4
- package/dist/components/index.js +4 -4
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/link-input/link-input.js +1519 -489
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +3 -3
- package/dist/components/menu/menu.js +164 -466
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +22 -17
- package/dist/components/option-select/option-select.js +6 -4
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +3 -3
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +46 -91
- package/dist/components/repeater/repeater.js +5130 -175
- package/dist/components/responsive/responsive-legacy.js +3 -3
- package/dist/components/responsive/responsive.js +3 -3
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +5 -5
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- 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/tabs/tabs.js +46 -71
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +7 -7
- package/dist/components/tooltip/tooltip.js +3 -3
- package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
- package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
- package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
- package/dist/getScrollParent-B3XgpXBL.js +10 -0
- package/dist/icons/icons.js +205 -0
- package/dist/icons/jsx-svg.js +2 -2
- package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
- package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
- package/dist/index.js +4 -4
- package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
- package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
- package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
- package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
- package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
- package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
- package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
- package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
- package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
- package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
- package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
- package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
- package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
- package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
- package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
- package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
- package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
- package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
- package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
- package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
- package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
- package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
- package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
- package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
- package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
- package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
- package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
- package/package.json +24 -21
- package/dist/Checkbox-CiJIVbAP.js +0 -174
- package/dist/ListBox-DTKMdjQC.js +0 -4216
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/dist/button-IxfzzzbP.js +0 -277
- package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { c as $a11501f3d1d39e6c$export$ea8f71083e90600f, d as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, e as $337b884510726a0d$export$14c98a7594375490, f as $de32f1b87079253c$export$d2f961adcb0afbe, g as $337b884510726a0d$export$c6fdb837b070b4ff, h as $86ea4cb521eb2e37$export$2317d149ed6f78c4, b as $de32f1b87079253c$export$2e1e1122cf0cba88, a as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-
|
|
2
|
+
import { c as $a11501f3d1d39e6c$export$ea8f71083e90600f, d as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, e as $337b884510726a0d$export$14c98a7594375490, f as $de32f1b87079253c$export$d2f961adcb0afbe, g as $337b884510726a0d$export$c6fdb837b070b4ff, h as $86ea4cb521eb2e37$export$2317d149ed6f78c4, b as $de32f1b87079253c$export$2e1e1122cf0cba88, a as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-CGE2ficT.js";
|
|
3
3
|
import { a as $4e85f108e88277b8$export$d688439359537581 } from "../../RSPContexts-DQtGvvpM.js";
|
|
4
|
-
import {
|
|
4
|
+
import { d as $b5e257d569688ac6$export$535bd6ca7f90a273, c as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, o as $64fa3d84918910a7$export$45fda7c47f93fd48, p as $64fa3d84918910a7$export$6d3443f2c48bfc20, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, m as $5dc95899b306f630$export$c9058316764c140e } from "../../utils-B4IdLYb8.js";
|
|
5
5
|
import React__default, { useState, useEffect, forwardRef, useContext, useRef, useMemo, createContext } from "react";
|
|
6
6
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
7
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-
|
|
8
|
-
import { $ as $5e3802645cc19319$export$1c3ebcada18427bf } from "../../ariaHideOutside-
|
|
9
|
-
import {
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
7
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-C9mg1CP5.js";
|
|
8
|
+
import { $ as $5e3802645cc19319$export$1c3ebcada18427bf } from "../../ariaHideOutside-BzxkODNq.js";
|
|
9
|
+
import { Button } from "../button/button.js";
|
|
10
|
+
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
11
11
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
12
12
|
import { icons } from "../../icons/icons.js";
|
|
13
|
-
import "../../react-jsx-parser.min-
|
|
13
|
+
import "../../react-jsx-parser.min-CAGfntg1.js";
|
|
14
14
|
import { HStack } from "../layout/hstack.js";
|
|
15
15
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
16
16
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
@@ -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 $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-
|
|
4
|
-
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
5
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
6
|
-
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
7
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4,
|
|
8
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
3
|
+
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-WZgNv9RE.js";
|
|
4
|
+
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CaS4qmLb.js";
|
|
5
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-yZgqvhXc.js";
|
|
6
|
+
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-uYE9D_E3.js";
|
|
7
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-B4IdLYb8.js";
|
|
8
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-CBPJ4Xx8.js";
|
|
9
9
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
10
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
10
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-D8qh3_U7.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
12
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
13
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-
|
|
14
|
-
import {
|
|
12
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Bon2Gyx5.js";
|
|
13
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-BVFqhboT.js";
|
|
14
|
+
import { Button } from "../button/button.js";
|
|
15
15
|
import { icons } from "../../icons/icons.js";
|
|
16
16
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
17
17
|
import { BaseControl } from "../base-control/base-control.js";
|
|
@@ -164,10 +164,11 @@ const NumberPicker = ({
|
|
|
164
164
|
inline,
|
|
165
165
|
noScrollToChange = false,
|
|
166
166
|
size = "default",
|
|
167
|
+
"aria-label": ariaLabel,
|
|
167
168
|
hidden,
|
|
168
169
|
...props
|
|
169
170
|
}) => {
|
|
170
|
-
var _a, _b, _c, _d;
|
|
171
|
+
var _a, _b, _c, _d, _e;
|
|
171
172
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
172
173
|
if (hidden) {
|
|
173
174
|
return null;
|
|
@@ -175,15 +176,18 @@ const NumberPicker = ({
|
|
|
175
176
|
const sizes = {
|
|
176
177
|
compact: {
|
|
177
178
|
field: "es-uic-min-h-5",
|
|
178
|
-
noPrefixPadding: "es-uic-pl-1.5"
|
|
179
|
+
noPrefixPadding: "es-uic-pl-1.5",
|
|
180
|
+
extraContentSeparator: "es-uic-h-[1.875rem]"
|
|
179
181
|
},
|
|
180
182
|
small: {
|
|
181
183
|
field: "es-uic-min-h-9",
|
|
182
|
-
noPrefixPadding: "es-uic-pl-2"
|
|
184
|
+
noPrefixPadding: "es-uic-pl-2",
|
|
185
|
+
extraContentSeparator: "es-uic-h-[2.125rem]"
|
|
183
186
|
},
|
|
184
187
|
default: {
|
|
185
188
|
field: "es-uic-min-h-10",
|
|
186
|
-
noPrefixPadding: "es-uic-pl-2"
|
|
189
|
+
noPrefixPadding: "es-uic-pl-2",
|
|
190
|
+
extraContentSeparator: "es-uic-h-[2.375rem]"
|
|
187
191
|
}
|
|
188
192
|
};
|
|
189
193
|
return /* @__PURE__ */ jsx(
|
|
@@ -235,7 +239,8 @@ const NumberPicker = ({
|
|
|
235
239
|
placeholder,
|
|
236
240
|
style: {
|
|
237
241
|
width: fixedWidth ? `${fixedWidth}ch` : `calc(${min < 0 ? "0.75ch + " : ""}${(_d = (_c = max ?? 1e3) == null ? void 0 : _c.toString()) == null ? void 0 : _d.length} * 1ch)`
|
|
238
|
-
}
|
|
242
|
+
},
|
|
243
|
+
"aria-label": ariaLabel ?? __("Enter a number", "eightshift-ui-components")
|
|
239
244
|
}
|
|
240
245
|
),
|
|
241
246
|
suffix && /* @__PURE__ */ jsx(
|
|
@@ -267,8 +272,8 @@ const NumberPicker = ({
|
|
|
267
272
|
)
|
|
268
273
|
] }),
|
|
269
274
|
children && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
270
|
-
/* @__PURE__ */ jsx("div", { className: "es-uic-
|
|
271
|
-
/* @__PURE__ */ jsx("div", { className: "es-uic-
|
|
275
|
+
/* @__PURE__ */ jsx("div", { className: clsx("es-uic-w-px es-uic-bg-gray-300", ((_e = sizes == null ? void 0 : sizes[size]) == null ? void 0 : _e.extraContentSeparator) ?? sizes.default.extraContentSeparator) }),
|
|
276
|
+
/* @__PURE__ */ jsx("div", { className: "es-uic-p-0.5 es-uic-pr-0", children: Array.isArray(children) ? children.map((child) => cloneElement(child, { slot: null })) : cloneElement(children, { slot: null }) })
|
|
272
277
|
] })
|
|
273
278
|
]
|
|
274
279
|
}
|
|
@@ -2,12 +2,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Fragment } from "react";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ButtonGroup } from "../button/button.js";
|
|
6
6
|
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-BqWys-1G.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that allows the user to select an option from a list of options.
|
|
13
13
|
*
|
|
@@ -133,7 +133,8 @@ const OptionSelect = (props) => {
|
|
|
133
133
|
RichLabel,
|
|
134
134
|
{
|
|
135
135
|
label: optionLabel,
|
|
136
|
-
subtitle: optionSubtitle
|
|
136
|
+
subtitle: optionSubtitle,
|
|
137
|
+
noColor: true
|
|
137
138
|
}
|
|
138
139
|
)
|
|
139
140
|
]
|
|
@@ -228,7 +229,8 @@ const OptionSelect = (props) => {
|
|
|
228
229
|
RichLabel,
|
|
229
230
|
{
|
|
230
231
|
label: optionLabel,
|
|
231
|
-
subtitle: optionSubtitle
|
|
232
|
+
subtitle: optionSubtitle,
|
|
233
|
+
noColor: true
|
|
232
234
|
}
|
|
233
235
|
)
|
|
234
236
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-BqWys-1G.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";
|
|
@@ -1,8 +1,8 @@
|
|
|
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-CGE2ficT.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
-
import { _ as __ } from "../../default-i18n-
|
|
5
|
-
import {
|
|
4
|
+
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
6
|
/**
|
|
7
7
|
* A popover component.
|
|
8
8
|
*
|
|
@@ -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 {
|
|
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-yZgqvhXc.js";
|
|
3
|
+
import { c as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-B4IdLYb8.js";
|
|
4
|
+
import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-CBPJ4Xx8.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-D8qh3_U7.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 { a 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-DC5jbhBW.js";
|
|
10
|
+
import { d as $9ab94262bd0047c7$export$420e68273165f4ec, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-PMGZgZ9-.js";
|
|
11
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-CVd6C65L.js";
|
|
12
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Bon2Gyx5.js";
|
|
13
|
+
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-BCPbwfnH.js";
|
|
14
|
+
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../../useFocusable-BFKHuYS9.js";
|
|
15
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-CY8MpqYD.js";
|
|
16
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DsxEaA2J.js";
|
|
17
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-DD480kAb.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";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { b as $72e60046c03fbe42$export$54fe942636b6416d, a as $72e60046c03fbe42$export$e96fc9a8407faa6b } from "../../GridList-DjRnMEae.js";
|
|
4
|
-
import { B as Button } from "../../button-IxfzzzbP.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
5
3
|
import { icons } from "../../icons/icons.js";
|
|
6
4
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
5
|
+
import { useContext } from "react";
|
|
7
6
|
import { Expandable } from "../expandable/expandable.js";
|
|
8
|
-
import { _ as __ } from "../../default-i18n-
|
|
9
|
-
import {
|
|
10
|
-
import { useRef } from "react";
|
|
11
|
-
import { useCellEditMode } from "../../hooks/use-cell-edit-mode.js";
|
|
7
|
+
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
8
|
+
import { RepeaterContext } from "./repeater-context.js";
|
|
12
9
|
/**
|
|
13
10
|
* A Repeater item.
|
|
14
11
|
*
|
|
@@ -30,93 +27,51 @@ import { useCellEditMode } from "../../hooks/use-cell-edit-mode.js";
|
|
|
30
27
|
*/
|
|
31
28
|
const RepeaterItem = (props) => {
|
|
32
29
|
const { children, icon, label, subtitle, "aria-label": ariaLabel, className, actions, textValue, expandDisabled, ...rest } = props;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
const { canDelete, handleOpenChange, isPanelOpen, handleRef, deleteItem, isAnyPanelOpen, isDragSource } = useContext(RepeaterContext);
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Expandable,
|
|
33
|
+
{
|
|
34
|
+
disabled: canDelete,
|
|
35
|
+
icon,
|
|
36
|
+
label,
|
|
37
|
+
subtitle,
|
|
38
|
+
className: clsx(isDragSource && "es-uic-border es-uic-border-gray-100 es-uic-bg-white/50 es-uic-shadow-md es-uic-backdrop-blur-lg"),
|
|
39
|
+
labelClassName: className,
|
|
40
|
+
onOpenChange: (isOpen) => handleOpenChange(isOpen),
|
|
41
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
Button,
|
|
44
|
+
{
|
|
45
|
+
size: "small",
|
|
46
|
+
className: clsx(
|
|
47
|
+
"es-uic-h-6 es-uic-w-4 !es-uic-text-gray-500 es-uic-opacity-50 focus:es-uic-opacity-100",
|
|
48
|
+
(isAnyPanelOpen || canDelete) && "es-uic-pointer-events-none es-uic-invisible !es-uic-cursor-default"
|
|
49
|
+
),
|
|
50
|
+
type: "ghost",
|
|
51
|
+
icon: icons.reorderGrabberV,
|
|
52
|
+
tooltip: !isDragSource && __("Re-order", "eightshift-ui-components"),
|
|
53
|
+
forwardedRef: handleRef,
|
|
54
|
+
disabled: isPanelOpen
|
|
55
|
+
}
|
|
51
56
|
),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
Button,
|
|
59
|
+
{
|
|
60
|
+
hidden: !canDelete,
|
|
61
|
+
ariaLabel: __("Remove item", "eightshift-ui-components"),
|
|
62
|
+
size: "small",
|
|
63
|
+
type: "ghost",
|
|
64
|
+
icon: icons.trash,
|
|
65
|
+
onPress: () => deleteItem(),
|
|
66
|
+
className: "es-uic-translate-x-px"
|
|
59
67
|
}
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
61
|
-
Expandable,
|
|
62
|
-
{
|
|
63
|
-
disabled: expandDisabled || selectionMode === "multiple",
|
|
64
|
-
icon: itemIcon,
|
|
65
|
-
label: /* @__PURE__ */ jsx("div", { className: "es-uic-flex es-uic-items-center es-uic-gap-1", children: label }),
|
|
66
|
-
subtitle,
|
|
67
|
-
labelClassName: className,
|
|
68
|
-
className: clsx(isDragging && "es-uic-opacity-25"),
|
|
69
|
-
onOpenChange: (isOpen) => setCanReorder(!isOpen),
|
|
70
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
-
selectionMode === "none" && allowsDragging && /* @__PURE__ */ jsx(
|
|
72
|
-
Button,
|
|
73
|
-
{
|
|
74
|
-
size: "small",
|
|
75
|
-
className: "es-uic-h-6 es-uic-w-4 !es-uic-text-gray-500 es-uic-opacity-50 focus:es-uic-opacity-100",
|
|
76
|
-
slot: "drag",
|
|
77
|
-
type: "ghost",
|
|
78
|
-
icon: icons.reorderGrabberV,
|
|
79
|
-
tooltip: __("Re-order", "eightshift-ui-components")
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
actions
|
|
83
|
-
] }),
|
|
84
|
-
noFocusHandling: true,
|
|
85
|
-
...preventProps,
|
|
86
|
-
children
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
} });
|
|
93
|
-
};
|
|
94
|
-
const Checkbox = (props) => {
|
|
95
|
-
return /* @__PURE__ */ jsx($bc237834342dbd75$export$48513f6b9f8ce62d, { ...props, children: ({ isIndeterminate, isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
96
|
-
/* @__PURE__ */ jsxs(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
className: clsx(
|
|
100
|
-
"es-uic-flex es-uic-size-5.5 es-uic-items-center es-uic-justify-center es-uic-rounded-md es-uic-border es-uic-text-gray-600 es-uic-shadow-sm es-uic-transition",
|
|
101
|
-
isSelected && "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white"
|
|
102
68
|
),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
visible: !isIndeterminate && isSelected,
|
|
110
|
-
className: "[&>svg]:es-uic-size-3 [&>svg]:es-uic-stroke-2",
|
|
111
|
-
noInitial: true,
|
|
112
|
-
children: icons.check
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
props.children
|
|
119
|
-
] }) });
|
|
69
|
+
actions
|
|
70
|
+
] }),
|
|
71
|
+
noFocusHandling: true,
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
);
|
|
120
75
|
};
|
|
121
76
|
export {
|
|
122
77
|
RepeaterItem
|