@eightshift/ui-components 8.1.0 → 8.2.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/{Autocomplete-BUU44AuW.js → Autocomplete-CO9aIsTe.js} +29 -25
- package/dist/{Button-_E2Z5G2l.js → Button-DO3oQfCq.js} +15 -9
- package/dist/{Dialog-3XLIaepk.js → Dialog-Bdqjmtt2.js} +293 -160
- package/dist/{Disclosure-Dh0z_DEQ.js → Disclosure-BTSsPhG9.js} +33 -29
- package/dist/{FocusScope-BKGWN6UK.js → FocusScope-Cj6cUR6X.js} +8 -6
- package/dist/{Heading-BWTs9ckA.js → Heading-BQje2nS2.js} +1 -1
- package/dist/{I18nProvider-BskRMK8G.js → I18nProvider-R_4IDnf9.js} +1 -1
- package/dist/{Label-UpU4cKPh.js → Label-C4bJkVti.js} +1 -1
- package/dist/{ListBox-DepY-52g.js → ListBox-CBvtIFuB.js} +20 -16
- package/dist/{NumberFormatter-WKBRKiEA.js → NumberFormatter-Bwdv413k.js} +4 -2
- package/dist/{RadioGroup-Br9Mn9QJ.js → RadioGroup-Dxzko0ma.js} +35 -35
- package/dist/{SearchField-q2Fj0L9K.js → SearchField-zY9JqR1c.js} +29 -26
- package/dist/{Slider-B8icnyOo.js → Slider-BXc72kE0.js} +55 -44
- package/dist/{Text-D4y19vs8.js → Text-i-ZK4MiL.js} +1 -1
- package/dist/{VisuallyHidden-B_LZ_kn7.js → VisuallyHidden-CsM0VnV1.js} +2 -2
- package/dist/{animation-DpSgtWyu.js → animation-COc9P6ap.js} +2 -4
- package/dist/assets/{image-analysis-worker-BuHru-CI.js → image-analysis-worker-CBOB71mx.js} +1 -1
- package/dist/assets/style-admin.css +1 -1
- package/dist/assets/style-editor.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/{button-XSk_8UW7.js → button-C7mc6eS1.js} +15 -12
- package/dist/{checkbox-BYaS9tQ5.js → checkbox-DlG5DILl.js} +8 -8
- package/dist/{color-swatch-6ZEIXej3.js → color-swatch-D6xMLGU-.js} +14 -15
- package/dist/components/animated-visibility/animated-visibility.js +5 -3
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/base-control/container.d.ts +4 -30
- package/dist/components/base-control/container.js +5 -32
- package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +7 -7
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +3 -3
- package/dist/components/container-panel/container-panel.js +11 -11
- package/dist/components/contextual-help/contextual-help.js +2 -2
- package/dist/components/draggable/draggable.d.ts +3 -3
- package/dist/components/draggable/draggable.js +1 -1
- package/dist/components/draggable-list/draggable-list.d.ts +3 -3
- package/dist/components/draggable-list/draggable-list.js +8 -8
- package/dist/components/expandable/expandable.js +3 -3
- package/dist/components/index.js +16 -16
- package/dist/components/input-field/input-field.js +1 -1
- package/dist/components/item-collection/item-collection.d.ts +3 -28
- package/dist/components/item-collection/item-collection.js +6 -6
- package/dist/components/link-input/link-input.d.ts +0 -2
- package/dist/components/link-input/link-input.js +1 -1
- package/dist/components/matrix-align/matrix-align.js +4 -3
- package/dist/components/menu/menu.js +10 -7
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/notice/notice.js +8 -8
- package/dist/components/number-picker/number-picker.js +1 -1
- package/dist/components/option-select/option-select.d.ts +1 -1
- package/dist/components/option-select/option-select.js +21 -15
- package/dist/components/options-panel/options-panel.js +4 -4
- package/dist/components/placeholders/file-picker-shell.js +4 -3
- package/dist/components/placeholders/file-placeholder.js +2 -1
- package/dist/components/popover/popover.js +3 -3
- package/dist/components/portal-provider/portal-provider.js +2 -1
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/repeater/repeater-context.d.ts +0 -1
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.d.ts +5 -38
- package/dist/components/repeater/repeater.js +7 -10
- package/dist/components/responsive/mini-responsive.d.ts +0 -1
- package/dist/components/responsive/mini-responsive.js +30 -30
- package/dist/components/responsive/responsive-legacy.d.ts +0 -1
- package/dist/components/responsive/responsive-legacy.js +12 -10
- package/dist/components/responsive/responsive.d.ts +0 -1
- package/dist/components/responsive/responsive.js +28 -28
- package/dist/components/responsive-preview/responsive-preview.js +3 -3
- package/dist/components/select/async-multi-select.d.ts +12 -13
- package/dist/components/select/async-multi-select.js +39 -20
- package/dist/components/select/async-select.d.ts +12 -13
- package/dist/components/select/async-select.js +38 -20
- package/dist/components/select/multi-select.d.ts +2 -8
- package/dist/components/select/multi-select.js +19 -19
- package/dist/components/select/shared.d.ts +5 -9
- package/dist/components/select/shared.js +2 -2
- package/dist/components/select/single-select.d.ts +2 -8
- package/dist/components/select/single-select.js +16 -16
- package/dist/components/slider/column-config-slider.js +7 -5
- package/dist/components/slider/slider.js +15 -11
- package/dist/components/smart-image/smart-image.d.ts +0 -1
- package/dist/components/smart-image/smart-image.js +52 -50
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toggle/switch.js +1 -1
- package/dist/components/toggle/toggle.js +2 -2
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/{draggable-9MfdTVWP.js → draggable-BUfOpGSZ.js} +129 -124
- package/dist/{es-dash-DunirOmV.js → es-dash-DPtJSRjw.js} +23 -52
- package/dist/{gradient-editor-yqSw0uPA.js → gradient-editor-_q3XF10i.js} +38 -29
- package/dist/icons/block-icon.js +1 -1
- package/dist/icons/icon.d.ts +3 -3
- package/dist/icons/icon.js +21 -9
- package/dist/icons/icons.d.ts +210 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/jsx-svg.d.ts +5 -4
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +16 -16
- package/dist/{input-field-nN6BO0oz.js → input-field-QzBpjm-m.js} +8 -8
- package/dist/{jsx-svg-BjGQUBLh.js → jsx-svg-DRwJdRpA.js} +171 -129
- package/dist/{keyboard-g5Amam-c.js → keyboard-BxnnQA2Z.js} +1 -1
- package/dist/{link-input-BhlPElU8.js → link-input-CElQp3lP.js} +145 -87
- package/dist/{modal-B5axB0Fc.js → modal-BeacK9N_.js} +14 -13
- package/dist/{number-picker-nnOf0XnN.js → number-picker-CK_OHBXw.js} +9 -9
- package/dist/{react-y40Dt3ab.js → react-C6Y6cCOx.js} +194 -215
- package/dist/{shared-Ba_bt4s9.js → shared-DBCipn_m.js} +59 -43
- package/dist/{solid-color-picker-CsosgTVa.js → solid-color-picker-2-X3ridX.js} +58 -53
- package/dist/{switch-BJ4_OyUm.js → switch-B87lQ1V0.js} +6 -6
- package/dist/{tabs-wAe0AAyu.js → tabs-DgkJUkIX.js} +33 -28
- package/dist/{text-helpers-2j9DuxP1.js → text-helpers-QrwKKaOh.js} +3 -2
- package/dist/{textSelection-B_Nv6Jz3.js → textSelection-5Qk8tLtm.js} +3 -3
- package/dist/{toggle-button-BLJdEp8V.js → toggle-button-B2-f2rU6.js} +8 -7
- package/dist/{tooltip-BW9nj5-V.js → tooltip-AzOLps8g.js} +68 -62
- package/dist/{useAsyncList-B3-uyJgA.js → useAsyncList-CjKVLGN0.js} +8 -4
- package/dist/{useButton-CPMVLXoX.js → useButton-BIrfoiY8.js} +3 -3
- package/dist/{useCollection-PzY6FI39.js → useCollection-LQlZnc1u.js} +267 -180
- package/dist/{useEvent-CzuFZ2HT.js → useEvent-Bih8lvtM.js} +1 -1
- package/dist/{useField-DrfR8j9h.js → useField-B_ibsWst.js} +2 -2
- package/dist/{useFilter-CiCjo6Na.js → useFilter-BFaOw4yi.js} +1 -1
- package/dist/{useFocusRing-CrYHpV7C.js → useFocusRing-ZXFsftJJ.js} +1 -1
- package/dist/{useFormReset-U6c35PHq.js → useFormReset-DDJhIIfG.js} +1 -1
- package/dist/{useFormValidation-B2q2MGWN.js → useFormValidation-BfnJKcdX.js} +2 -2
- package/dist/{useHover-CNsbAR0V.js → useHover-CbyH227W.js} +216 -39
- package/dist/{useLabel-DuxAjaic.js → useLabel-gfFDE4bn.js} +2 -2
- package/dist/{useLabels-NUsp5IW3.js → useLabels-Dcg-cEyM.js} +1 -1
- package/dist/{useListState-FLxa7R_U.js → useListState-I22DfnmE.js} +4 -2
- package/dist/{useLocalizedStringFormatter-Ccm8EL_u.js → useLocalizedStringFormatter-CTCqjYu4.js} +6 -1
- package/dist/{useNumberFieldState-DWvm7CXu.js → useNumberFieldState-C1gD0RuW.js} +79 -62
- package/dist/{useNumberFormatter-B0_D7a_o.js → useNumberFormatter-DbAt_fC_.js} +2 -2
- package/dist/{useOverlayTriggerState-zZ7homyI.js → useOverlayTriggerState-Cpc_IbQf.js} +12 -9
- package/dist/{usePress-DRoujMNm.js → usePress-BF7otjax.js} +30 -19
- package/dist/{useSlot-pRz-v9kC.js → useSlot-CnQHcvd4.js} +1 -1
- package/dist/{useTextField-e8jIFT3s.js → useTextField-CnTuCBMs.js} +6 -6
- package/dist/{useToggle-CR_ZKvr_.js → useToggle-Cgv5UXaB.js} +6 -6
- package/dist/{useToggleState-ButQxGrJ.js → useToggleState-Cy1E36QZ.js} +1 -1
- package/dist/utilities/array-helpers.d.ts +1 -1
- package/dist/utilities/array-helpers.js +4 -3
- package/dist/utilities/debounce-throttle.d.ts +9 -2
- package/dist/utilities/es-dash.d.ts +11 -8
- package/dist/utilities/es-dash.js +1 -1
- package/dist/utilities/index.js +2 -2
- package/dist/utilities/text-helpers.js +1 -1
- package/dist/utilities/web-workers.d.ts +7 -7
- package/dist/utilities/web-workers.js +5 -5
- package/dist/{utils-Czi6q2Ub.js → utils-ClM91CuL.js} +30 -19
- package/package.json +21 -25
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as clsx } from "./clsx-DQoRUQAf.js";
|
|
2
|
-
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, l as $03e8ab2d84d7657a$export$4338b53315abf666, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
3
|
-
import {
|
|
4
|
-
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-
|
|
2
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, l as $03e8ab2d84d7657a$export$4338b53315abf666, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
3
|
+
import { U as $23f2114a1b82827e$export$e58f029f0fbfdb29, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-CbyH227W.js";
|
|
4
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-R_4IDnf9.js";
|
|
5
5
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
6
|
-
import { a as $6c0095e7e99364f2$export$c17561cb55d4db30, n as $7705c033048f6da7$export$353f5b6fc5456de1 } from "./Button-
|
|
7
|
-
import { i as $535772f9d2c1f38d$export$c5251b9e124bf29 } from "./FocusScope-
|
|
8
|
-
import { n as Tooltip } from "./tooltip-
|
|
6
|
+
import { a as $6c0095e7e99364f2$export$c17561cb55d4db30, n as $7705c033048f6da7$export$353f5b6fc5456de1 } from "./Button-DO3oQfCq.js";
|
|
7
|
+
import { i as $535772f9d2c1f38d$export$c5251b9e124bf29 } from "./FocusScope-Cj6cUR6X.js";
|
|
8
|
+
import { n as Tooltip } from "./tooltip-AzOLps8g.js";
|
|
9
9
|
import { t as __ } from "./build-module-DG6ZK7Ty.js";
|
|
10
10
|
import { t as cva } from "./dist-DpXluZqJ.js";
|
|
11
11
|
import $3ARPR$react, { createContext, forwardRef, useRef, useState } from "react";
|
|
@@ -22,11 +22,13 @@ function $afa781ff67c1cd08$export$fa142eb1681c520(props, ref) {
|
|
|
22
22
|
let focusManager = $535772f9d2c1f38d$export$c5251b9e124bf29(ref);
|
|
23
23
|
const onKeyDown = (e) => {
|
|
24
24
|
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
25
|
-
if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
else
|
|
29
|
-
|
|
25
|
+
if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
|
|
26
|
+
if (shouldReverse) focusManager.focusPrevious();
|
|
27
|
+
else focusManager.focusNext();
|
|
28
|
+
} else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
|
|
29
|
+
if (shouldReverse) focusManager.focusNext();
|
|
30
|
+
else focusManager.focusPrevious();
|
|
31
|
+
} else if (e.key === "Tab") {
|
|
30
32
|
lastFocused.current = $23f2114a1b82827e$export$cd4e5573fbe2b576();
|
|
31
33
|
if (e.shiftKey) focusManager.focusFirst();
|
|
32
34
|
else focusManager.focusLast();
|
|
@@ -442,6 +444,7 @@ var createComponentClasses = ({ className, flat, pending }) => cva([
|
|
|
442
444
|
defaultVariants: { disabled: false }
|
|
443
445
|
});
|
|
444
446
|
var TypedTooltip = Tooltip;
|
|
447
|
+
var isStringValue = (value) => Object.prototype.toString.call(value) === "[object String]";
|
|
445
448
|
/**
|
|
446
449
|
* A simple button component.
|
|
447
450
|
*
|
|
@@ -458,7 +461,7 @@ var TypedTooltip = Tooltip;
|
|
|
458
461
|
*/
|
|
459
462
|
var Button = (props) => {
|
|
460
463
|
const { children, icon, size = "default", type = "default", flat, pending, pendingAriaLabel = __("Loading", "eightshift-ui-components"), disabled, className, tooltip: rawTooltip, onPress, forwardedRef, wrapperClassName, tooltipProps, "aria-label": rawAriaLabel, hidden, ...other } = props;
|
|
461
|
-
const ariaLabel = rawAriaLabel ?? (
|
|
464
|
+
const ariaLabel = rawAriaLabel ?? (isStringValue(children) ? children : __("Menu item", "eightshift-ui-components"));
|
|
462
465
|
let tooltip = rawTooltip;
|
|
463
466
|
if (rawTooltip === true && ariaLabel.length > 0) tooltip = ariaLabel;
|
|
464
467
|
const resolvedTooltip = tooltip === true ? ariaLabel : tooltip;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as clsx } from "./clsx-DQoRUQAf.js";
|
|
2
2
|
import { AnimatedVisibility } from "./components/animated-visibility/animated-visibility.js";
|
|
3
|
-
import { c as $7230ffa83bc0c2cf$export$fabf2dc03a41866e, d as $4064df0d6f9620e1$export$c9058316764c140e, l as $03e8ab2d84d7657a$export$4338b53315abf666, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, s as $7230ffa83bc0c2cf$export$ef03459518577ad4, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
4
|
-
import { t as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "./useHover-
|
|
3
|
+
import { c as $7230ffa83bc0c2cf$export$fabf2dc03a41866e, d as $4064df0d6f9620e1$export$c9058316764c140e, l as $03e8ab2d84d7657a$export$4338b53315abf666, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, s as $7230ffa83bc0c2cf$export$ef03459518577ad4, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
4
|
+
import { t as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "./useHover-CbyH227W.js";
|
|
5
5
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
6
|
-
import { t as $0c4a58759813079a$export$4e328f61c538687f } from "./useFocusRing-
|
|
7
|
-
import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "./Label-
|
|
8
|
-
import { t as $ea3928288112382f$export$439d29a4e110a164 } from "./VisuallyHidden-
|
|
9
|
-
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb, r as $fd2148440a13ec26$export$dad6ae84456c676a } from "./useFormValidation-
|
|
6
|
+
import { t as $0c4a58759813079a$export$4e328f61c538687f } from "./useFocusRing-ZXFsftJJ.js";
|
|
7
|
+
import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "./Label-C4bJkVti.js";
|
|
8
|
+
import { t as $ea3928288112382f$export$439d29a4e110a164 } from "./VisuallyHidden-CsM0VnV1.js";
|
|
9
|
+
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb, r as $fd2148440a13ec26$export$dad6ae84456c676a } from "./useFormValidation-BfnJKcdX.js";
|
|
10
10
|
import { t as $cdaed739b1139372$export$c24727297075ec6a } from "./Form-BWMVEpwR.js";
|
|
11
|
-
import { t as $876b6f32ca5a04c3$export$cbe85ee05b554577 } from "./useToggle-
|
|
12
|
-
import { t as $fd3c5e01e837dc20$export$8042c6c013fd5226 } from "./useToggleState-
|
|
11
|
+
import { t as $876b6f32ca5a04c3$export$cbe85ee05b554577 } from "./useToggle-Cgv5UXaB.js";
|
|
12
|
+
import { t as $fd3c5e01e837dc20$export$8042c6c013fd5226 } from "./useToggleState-Cy1E36QZ.js";
|
|
13
13
|
import { RichLabel } from "./components/rich-label/rich-label.js";
|
|
14
14
|
import { t as cva } from "./dist-DpXluZqJ.js";
|
|
15
15
|
import { check } from "./icons/ui-icons/check.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as clsx } from "./clsx-DQoRUQAf.js";
|
|
2
|
-
import { n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, p as $390e54f620492c70$export$f680877a34711e37, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
3
|
-
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-
|
|
4
|
-
import { n as $b27c684a33948c64$export$2f817fcdc4b89ae0, r as $a747a10fe70a57da$export$c17fa47878dc55b6, t as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-
|
|
2
|
+
import { n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, p as $390e54f620492c70$export$f680877a34711e37, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
3
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-R_4IDnf9.js";
|
|
4
|
+
import { n as $b27c684a33948c64$export$2f817fcdc4b89ae0, r as $a747a10fe70a57da$export$c17fa47878dc55b6, t as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CTCqjYu4.js";
|
|
5
5
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
6
|
-
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-
|
|
6
|
+
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-Bwdv413k.js";
|
|
7
7
|
import { n as $240e9101ba2842f5$export$b6268554fba451f, t as $240e9101ba2842f5$export$7d15b64cf5a3a4c4 } from "./number-BeC0ySe4.js";
|
|
8
8
|
import { t as __ } from "./build-module-DG6ZK7Ty.js";
|
|
9
9
|
import $3ARPR$react, { createContext, forwardRef, useMemo } from "react";
|
|
@@ -1960,9 +1960,10 @@ var $890783418b00a858$var$Color = class {
|
|
|
1960
1960
|
[hue, l] = this.getOklchHue(l, c, h, locale);
|
|
1961
1961
|
let lightness = "";
|
|
1962
1962
|
let chroma = "";
|
|
1963
|
-
if (c <= .1 && c >= $890783418b00a858$var$GRAY_THRESHOLD)
|
|
1964
|
-
|
|
1965
|
-
|
|
1963
|
+
if (c <= .1 && c >= $890783418b00a858$var$GRAY_THRESHOLD) {
|
|
1964
|
+
if (l >= .7) chroma = "pale";
|
|
1965
|
+
else chroma = "grayish";
|
|
1966
|
+
} else if (c >= .15) chroma = "vibrant";
|
|
1966
1967
|
if (l < .3) lightness = "very dark";
|
|
1967
1968
|
else if (l < $890783418b00a858$var$MAX_DARK_LIGHTNESS) lightness = "dark";
|
|
1968
1969
|
else if (l < .7);
|
|
@@ -1993,8 +1994,10 @@ var $890783418b00a858$var$Color = class {
|
|
|
1993
1994
|
let [hue, hueName] = $890783418b00a858$var$OKLCH_HUES[i];
|
|
1994
1995
|
let [nextHue, nextHueName] = $890783418b00a858$var$OKLCH_HUES[i + 1] || [360, "pink"];
|
|
1995
1996
|
if (h >= hue && h < nextHue) {
|
|
1996
|
-
if (hueName === "orange")
|
|
1997
|
-
|
|
1997
|
+
if (hueName === "orange") {
|
|
1998
|
+
if (l < $890783418b00a858$var$ORANGE_LIGHTNESS_THRESHOLD) hueName = "brown";
|
|
1999
|
+
else l = l - $890783418b00a858$var$ORANGE_LIGHTNESS_THRESHOLD + $890783418b00a858$var$MAX_DARK_LIGHTNESS;
|
|
2000
|
+
}
|
|
1998
2001
|
if (h > hue + (nextHue - hue) / 2 && hueName !== nextHueName) hueName = `${hueName} ${nextHueName}`;
|
|
1999
2002
|
else if (hueName === "yellow" && l < $890783418b00a858$var$YELLOW_GREEN_LIGHTNESS_THRESHOLD) hueName = "yellow green";
|
|
2000
2003
|
return [strings.getStringForLocale(hueName, locale).toLocaleLowerCase(locale), l];
|
|
@@ -2082,9 +2085,7 @@ var $890783418b00a858$var$RGBColor = class $890783418b00a858$var$RGBColor extend
|
|
|
2082
2085
|
case green:
|
|
2083
2086
|
hue = (blue - red) / chroma + 2;
|
|
2084
2087
|
break;
|
|
2085
|
-
case blue:
|
|
2086
|
-
hue = (red - green) / chroma + 4;
|
|
2087
|
-
break;
|
|
2088
|
+
case blue: hue = (red - green) / chroma + 4;
|
|
2088
2089
|
}
|
|
2089
2090
|
hue /= 6;
|
|
2090
2091
|
}
|
|
@@ -2116,9 +2117,7 @@ var $890783418b00a858$var$RGBColor = class $890783418b00a858$var$RGBColor extend
|
|
|
2116
2117
|
hue = (blue - red) / chroma + 2;
|
|
2117
2118
|
break;
|
|
2118
2119
|
case blue:
|
|
2119
|
-
default:
|
|
2120
|
-
hue = (red - green) / chroma + 4;
|
|
2121
|
-
break;
|
|
2120
|
+
default: hue = (red - green) / chroma + 4;
|
|
2122
2121
|
}
|
|
2123
2122
|
hue /= 6;
|
|
2124
2123
|
}
|
|
@@ -60,11 +60,13 @@ var AnimatedVisibility = (props) => {
|
|
|
60
60
|
const [isVisibleInner, setIsVisibleInner] = useState(false);
|
|
61
61
|
const [canAnimate, setCanAnimate] = useState(true);
|
|
62
62
|
useEffect(() => {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
queueMicrotask(() => {
|
|
64
|
+
if (visible) setIsVisibleInner(true);
|
|
65
|
+
if (!visible && noExitAnimation) setIsVisibleInner(false);
|
|
66
|
+
});
|
|
65
67
|
}, [noExitAnimation, visible]);
|
|
66
68
|
useEffect(() => {
|
|
67
|
-
if (noInitial && visible) setCanAnimate(false);
|
|
69
|
+
if (noInitial && visible) queueMicrotask(() => setCanAnimate(false));
|
|
68
70
|
}, [noInitial, visible]);
|
|
69
71
|
return jsx(Fragment$1, { children: isVisibleInner && jsx("div", {
|
|
70
72
|
className: clsx(!noEnterAnimation && visible && noInitial && visible && canAnimate && transitions[transition].inClassName, !noEnterAnimation && visible && !noInitial && transitions[transition].inClassName, !noExitAnimation && !visible && transitions[transition].outClassName, "es:motion-duration-300", decreaseBounce && "es:motion-ease-spring-snappy es:motion-ease-linear/opacity", !decreaseBounce && "es:motion-ease-spring-bouncy es:motion-ease-linear/opacity", "es:fill-mode-forwards", className),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
|
-
import { t as $efe09c6d1c304b50$export$5f1af8db9871e1d6 } from "../../Text-
|
|
2
|
+
import { t as $efe09c6d1c304b50$export$5f1af8db9871e1d6 } from "../../Text-i-ZK4MiL.js";
|
|
3
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
4
|
import { Children } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -45,22 +45,10 @@ export type ContainerProps<T extends ElementType = 'div'> = {
|
|
|
45
45
|
type ContainerComponent = <T extends ElementType = 'div'>(props: Prettify<ContainerProps<T> & {
|
|
46
46
|
ref?: React.Ref<Element>;
|
|
47
47
|
}>) => ReactNode;
|
|
48
|
-
|
|
49
|
-
* A container component to wrap other components, providing consistent styling and spacing.
|
|
50
|
-
*
|
|
51
|
-
* @component
|
|
52
|
-
* @param {ContainerProps} props - Component props.
|
|
53
|
-
*
|
|
54
|
-
* @returns {JSX.Element} The Container component.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* <Container accent elevated>
|
|
58
|
-
* <p>This is a container with accent and elevated styles.</p>
|
|
59
|
-
* </Container>
|
|
60
|
-
*/
|
|
61
|
-
export declare const Container: ContainerComponent & {
|
|
48
|
+
declare const TypedContainer: ContainerComponent & {
|
|
62
49
|
displayName?: string;
|
|
63
50
|
};
|
|
51
|
+
export { TypedContainer as Container };
|
|
64
52
|
type ContainerGroupProps<T extends ElementType = 'div'> = {
|
|
65
53
|
/** The HTML element to render as the container group. */
|
|
66
54
|
as?: T;
|
|
@@ -79,21 +67,7 @@ type ContainerGroupProps<T extends ElementType = 'div'> = {
|
|
|
79
67
|
type ContainerGroupComponent = <T extends ElementType = 'div'>(props: Prettify<ContainerGroupProps<T> & {
|
|
80
68
|
ref?: React.Ref<Element>;
|
|
81
69
|
}>) => ReactNode;
|
|
82
|
-
|
|
83
|
-
* A container group component to wrap multiple Container components, providing consistent spacing between them.
|
|
84
|
-
*
|
|
85
|
-
* @component
|
|
86
|
-
* @param {ContainerGroupProps} props - Component props.
|
|
87
|
-
*
|
|
88
|
-
* @returns {JSX.Element} The ContainerGroup component.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* <ContainerGroup>
|
|
92
|
-
* <Container>First container</Container>
|
|
93
|
-
* <Container>Second container</Container>
|
|
94
|
-
* </ContainerGroup>
|
|
95
|
-
*/
|
|
96
|
-
export declare const ContainerGroup: ContainerGroupComponent & {
|
|
70
|
+
declare const TypedContainerGroup: ContainerGroupComponent & {
|
|
97
71
|
displayName?: string;
|
|
98
72
|
};
|
|
99
|
-
export {};
|
|
73
|
+
export { TypedContainerGroup as ContainerGroup };
|
|
@@ -133,21 +133,8 @@ var ContainerBase = (props, ref) => {
|
|
|
133
133
|
children
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
*
|
|
139
|
-
* @component
|
|
140
|
-
* @param {ContainerProps} props - Component props.
|
|
141
|
-
*
|
|
142
|
-
* @returns {JSX.Element} The Container component.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* <Container accent elevated>
|
|
146
|
-
* <p>This is a container with accent and elevated styles.</p>
|
|
147
|
-
* </Container>
|
|
148
|
-
*/
|
|
149
|
-
var Container = forwardRef(ContainerBase);
|
|
150
|
-
Container.displayName = "Container";
|
|
136
|
+
var TypedContainer = forwardRef(ContainerBase);
|
|
137
|
+
TypedContainer.displayName = "Container";
|
|
151
138
|
var ContainerGroupBase = (props, ref) => {
|
|
152
139
|
const { className, children, as, hidden, horizontal, label, wrapClassName, ...rest } = props;
|
|
153
140
|
const ComponentToRender = as ?? "div";
|
|
@@ -175,21 +162,7 @@ var ContainerGroupBase = (props, ref) => {
|
|
|
175
162
|
}), inner]
|
|
176
163
|
});
|
|
177
164
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
*
|
|
181
|
-
* @component
|
|
182
|
-
* @param {ContainerGroupProps} props - Component props.
|
|
183
|
-
*
|
|
184
|
-
* @returns {JSX.Element} The ContainerGroup component.
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* <ContainerGroup>
|
|
188
|
-
* <Container>First container</Container>
|
|
189
|
-
* <Container>Second container</Container>
|
|
190
|
-
* </ContainerGroup>
|
|
191
|
-
*/
|
|
192
|
-
var ContainerGroup = forwardRef(ContainerGroupBase);
|
|
193
|
-
ContainerGroup.displayName = "ContainerGroup";
|
|
165
|
+
var TypedContainerGroup = forwardRef(ContainerGroupBase);
|
|
166
|
+
TypedContainerGroup.displayName = "ContainerGroup";
|
|
194
167
|
//#endregion
|
|
195
|
-
export { Container, ContainerGroup };
|
|
168
|
+
export { TypedContainer as Container, TypedContainerGroup as ContainerGroup };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
|
-
import { f as upperFirst } from "../../es-dash-
|
|
2
|
+
import { f as upperFirst } from "../../es-dash-DPtJSRjw.js";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region lib/components/breakpoint-preview/breakpoint-preview.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ButtonGroup, t as Button } from "../../button-
|
|
1
|
+
import { n as ButtonGroup, t as Button } from "../../button-C7mc6eS1.js";
|
|
2
2
|
export { Button, ButtonGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Checkbox } from "../../checkbox-
|
|
1
|
+
import { t as Checkbox } from "../../checkbox-DlG5DILl.js";
|
|
2
2
|
export { Checkbox };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
|
-
import { t as ColorSwatch } from "../../color-swatch-
|
|
2
|
+
import { t as ColorSwatch } from "../../color-swatch-D6xMLGU-.js";
|
|
3
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
5
|
import { t as __ } from "../../build-module-DG6ZK7Ty.js";
|
|
@@ -39,7 +39,7 @@ var ColorPicker = (props) => {
|
|
|
39
39
|
if (hidden) return null;
|
|
40
40
|
const currentColor = colors.find(({ slug }) => slug === value)?.color;
|
|
41
41
|
const hasColorGroups = !noColorGroups && colors.some(({ slug }) => colorSuffixRegex.test(slug));
|
|
42
|
-
const colorGroupNames =
|
|
42
|
+
const colorGroupNames = new Map([["generic", __("Other colors", "eightshift-ui-components")]]);
|
|
43
43
|
let groupedColors;
|
|
44
44
|
if (hasColorGroups) groupedColors = colors.reduce((output, current) => {
|
|
45
45
|
if (!current?.name || !current?.slug) return output;
|
|
@@ -48,7 +48,7 @@ var ColorPicker = (props) => {
|
|
|
48
48
|
const newSlug = current.slug.replace(colorSuffixRegex, "").trim();
|
|
49
49
|
if (!output[newSlug]) {
|
|
50
50
|
output[newSlug] = [];
|
|
51
|
-
colorGroupNames
|
|
51
|
+
colorGroupNames.set(newSlug, current.name.replace(colorSuffixRegex, "").trim());
|
|
52
52
|
}
|
|
53
53
|
output[newSlug] = [...output[newSlug], {
|
|
54
54
|
...current,
|
|
@@ -124,13 +124,13 @@ var ColorPicker = (props) => {
|
|
|
124
124
|
tooltip: tooltipText,
|
|
125
125
|
triggerProps: {
|
|
126
126
|
...triggerProps,
|
|
127
|
-
"aria-label":
|
|
127
|
+
"aria-label": label !== void 0 ? void 0 : ariaLabel
|
|
128
128
|
},
|
|
129
129
|
...menuProps,
|
|
130
130
|
children: [
|
|
131
131
|
clearable ? jsxs(Fragment$1, { children: [jsx(MenuItem, {
|
|
132
132
|
onClick: () => onChange(void 0),
|
|
133
|
-
selected:
|
|
133
|
+
selected: value === void 0,
|
|
134
134
|
endIcon: jsx(ColorSwatch, {
|
|
135
135
|
className: "es:size-5!",
|
|
136
136
|
flat: true
|
|
@@ -141,11 +141,11 @@ var ColorPicker = (props) => {
|
|
|
141
141
|
hasColorGroups && groupedColors ? jsxs(Fragment$1, { children: [Object.entries(groupedColors).map(([groupSlug, groupedColorItems]) => {
|
|
142
142
|
if (groupSlug === "generic") return null;
|
|
143
143
|
return jsx(MenuSection, {
|
|
144
|
-
"aria-label": colorGroupNames
|
|
144
|
+
"aria-label": colorGroupNames.get(groupSlug),
|
|
145
145
|
children: groupedColorItems.map((color) => jsx(SingleItem, { ...color }, color.slug))
|
|
146
146
|
}, groupSlug);
|
|
147
147
|
}), genericGroupedColors.length > 0 ? jsx(MenuSection, {
|
|
148
|
-
"aria-label": colorGroupNames.generic,
|
|
148
|
+
"aria-label": colorGroupNames.get("generic"),
|
|
149
149
|
children: genericGroupedColors.map((color) => jsx(SingleItem, { ...color }, color.slug))
|
|
150
150
|
}) : null] }) : null,
|
|
151
151
|
extraOptions ? jsx(MenuSeparator, {}) : null,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ColorSwatch } from "../../color-swatch-
|
|
1
|
+
import { t as ColorSwatch } from "../../color-swatch-D6xMLGU-.js";
|
|
2
2
|
export { ColorSwatch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as GradientEditor } from "../../gradient-editor-
|
|
1
|
+
import { t as GradientEditor } from "../../gradient-editor-_q3XF10i.js";
|
|
2
2
|
export { GradientEditor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SolidColorPicker } from "../../solid-color-picker-
|
|
1
|
+
import { t as SolidColorPicker } from "../../solid-color-picker-2-X3ridX.js";
|
|
2
2
|
export { SolidColorPicker };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
2
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
3
|
-
import { t as Switch } from "../../switch-
|
|
4
|
-
import { t as ToggleButton } from "../../toggle-button-
|
|
5
|
-
import { n as ButtonGroup } from "../../button-
|
|
3
|
+
import { t as Switch } from "../../switch-B87lQ1V0.js";
|
|
4
|
+
import { t as ToggleButton } from "../../toggle-button-B2-f2rU6.js";
|
|
5
|
+
import { n as ButtonGroup } from "../../button-C7mc6eS1.js";
|
|
6
6
|
import { BaseControl } from "../base-control/base-control.js";
|
|
7
7
|
import { t as sprintf } from "../../sprintf-xJRAt4p0.js";
|
|
8
8
|
import { t as __ } from "../../build-module-DG6ZK7Ty.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
|
-
import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-
|
|
3
|
-
import { t as Switch } from "../../switch-
|
|
4
|
-
import { t as Button } from "../../button-
|
|
2
|
+
import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-BTSsPhG9.js";
|
|
3
|
+
import { t as Switch } from "../../switch-B87lQ1V0.js";
|
|
4
|
+
import { t as Button } from "../../button-C7mc6eS1.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { chevronDown } from "../../icons/ui-icons/chevron-down.js";
|
|
7
7
|
import { HStack } from "../layout/hstack.js";
|
|
@@ -27,16 +27,16 @@ var ContainerPanel = (props) => {
|
|
|
27
27
|
const { children, className, title, icon, subtitle, use, onUseChange, closable, startOpen = false, topBorder = false, accentLabel = false, accentIcon = false, noLabelInset = false, actions, hidden } = props;
|
|
28
28
|
const [open, setOpen] = useState(startOpen);
|
|
29
29
|
if (hidden) return null;
|
|
30
|
-
if (!title &&
|
|
30
|
+
if (!title && use === void 0) return jsx("div", {
|
|
31
31
|
className: clsx("es:flex es:flex-col es:gap-3 es:p-4", topBorder && "es:border-t es:border-t-secondary-200", className),
|
|
32
32
|
children
|
|
33
33
|
});
|
|
34
|
-
const justUse = !closable &&
|
|
35
|
-
const justClosable = Boolean(closable) &&
|
|
36
|
-
const useAndClosable = Boolean(closable) &&
|
|
37
|
-
const shouldUseDisclosure = Boolean(closable) ||
|
|
34
|
+
const justUse = !closable && onUseChange !== void 0;
|
|
35
|
+
const justClosable = Boolean(closable) && onUseChange === void 0;
|
|
36
|
+
const useAndClosable = Boolean(closable) && onUseChange !== void 0;
|
|
37
|
+
const shouldUseDisclosure = Boolean(closable) || use !== void 0;
|
|
38
38
|
let isExpanded = Boolean(use);
|
|
39
|
-
if (closable) isExpanded =
|
|
39
|
+
if (closable) isExpanded = use !== void 0 ? Boolean(use) && open : open;
|
|
40
40
|
return jsx($a3e16eab0ea4036c$export$74a362b31437ec83, {
|
|
41
41
|
isExpanded: shouldUseDisclosure ? isExpanded : true,
|
|
42
42
|
className: "es:block",
|
|
@@ -61,10 +61,10 @@ var ContainerPanel = (props) => {
|
|
|
61
61
|
type: "ghost",
|
|
62
62
|
size: "small",
|
|
63
63
|
className: clsx("es:icon:size-4! es:icon:transition-transform", isExpanded && "es:icon:-scale-y-100"),
|
|
64
|
-
disabled:
|
|
64
|
+
disabled: use !== void 0 && !use
|
|
65
65
|
}) : null
|
|
66
66
|
})] }),
|
|
67
|
-
className: clsx(topBorder && "es:border-t es:border-t-secondary-200", !closable &&
|
|
67
|
+
className: clsx(topBorder && "es:border-t es:border-t-secondary-200", !closable && use === void 0 && "es:space-y-2", justClosable && open && "es:pb-4", justUse && use && "es:pb-4", useAndClosable && use && open && "es:pb-4", !justClosable && !justUse && !useAndClosable && "es:pb-4", !closable && !onUseChange && use === void 0 && "es:px-4", className),
|
|
68
68
|
labelContainerClassName: clsx((closable || onUseChange) && "es:pl-4 es:pr-3 es:min-h-12", !(closable || onUseChange) && "es:mt-3 es:mb-3", (closable || onUseChange) && "es:mb-0!", "es:pb-0!"),
|
|
69
69
|
controlContainerClassName: "es:px-4",
|
|
70
70
|
labelClassName: clsx(!noLabelInset && "es:px-1", accentLabel && "es:text-accent-800 es:any-icon:text-accent-700", accentIcon && "es:any-icon:text-accent-700", !accentLabel && "es:text-surface-700"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
|
-
import { t as $f2ff30fde7b014be$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
3
|
-
import { t as Button } from "../../button-
|
|
2
|
+
import { t as $f2ff30fde7b014be$export$2e1e1122cf0cba88 } from "../../Dialog-Bdqjmtt2.js";
|
|
3
|
+
import { t as Button } from "../../button-C7mc6eS1.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
import { t as __ } from "../../build-module-DG6ZK7Ty.js";
|
|
6
6
|
import { clear } from "../../icons/ui-icons/clear.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import type { Prettify } from '../../utilities/types';
|
|
3
3
|
type DragAxis = 'both' | 'horizontal' | 'vertical';
|
|
4
|
-
type DraggableRenderContext<TItem extends
|
|
4
|
+
type DraggableRenderContext<TItem extends object> = TItem & {
|
|
5
5
|
updateData: (newValue: Partial<TItem>) => void;
|
|
6
6
|
itemIndex: number;
|
|
7
7
|
deleteItem: () => void;
|
|
8
8
|
};
|
|
9
|
-
type DraggableProps<TItem extends
|
|
9
|
+
type DraggableProps<TItem extends object> = HTMLAttributes<HTMLDivElement> & {
|
|
10
10
|
children: (item: DraggableRenderContext<TItem>) => ReactNode;
|
|
11
11
|
/** Data to display in the list. */
|
|
12
12
|
items?: TItem[] | null;
|
|
@@ -48,5 +48,5 @@ type DraggableProps<TItem extends Record<string, unknown>> = HTMLAttributes<HTML
|
|
|
48
48
|
* }}
|
|
49
49
|
* </Draggable>
|
|
50
50
|
*/
|
|
51
|
-
export declare const Draggable: <TItem extends
|
|
51
|
+
export declare const Draggable: <TItem extends object>(props: Prettify<DraggableProps<TItem>>) => import("react").JSX.Element | null;
|
|
52
52
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Draggable } from "../../draggable-
|
|
1
|
+
import { t as Draggable } from "../../draggable-BUfOpGSZ.js";
|
|
2
2
|
export { Draggable };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
2
|
import { BaseControl } from '../base-control/base-control';
|
|
3
3
|
import type { Prettify } from '../../utilities/types';
|
|
4
|
-
type DraggableListRenderContext<TItem extends
|
|
4
|
+
type DraggableListRenderContext<TItem extends object> = TItem & {
|
|
5
5
|
updateData: (newValue: Partial<TItem>) => void;
|
|
6
6
|
itemIndex: number;
|
|
7
7
|
deleteItem: () => void;
|
|
8
8
|
};
|
|
9
|
-
type DraggableListProps<TItem extends
|
|
9
|
+
type DraggableListProps<TItem extends object> = ComponentProps<typeof BaseControl> & {
|
|
10
10
|
children: (item: DraggableListRenderContext<TItem>) => ReactNode;
|
|
11
11
|
/** Data to display in the list. */
|
|
12
12
|
items?: TItem[] | null;
|
|
@@ -52,5 +52,5 @@ type DraggableListProps<TItem extends Record<string, unknown>> = ComponentProps<
|
|
|
52
52
|
* }}
|
|
53
53
|
* </DraggableList>
|
|
54
54
|
*/
|
|
55
|
-
export declare const DraggableList: <TItem extends
|
|
55
|
+
export declare const DraggableList: <TItem extends object>(props: Prettify<DraggableListProps<TItem>>) => import("react").JSX.Element | null;
|
|
56
56
|
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
2
|
import { BaseControl } from "../base-control/base-control.js";
|
|
3
3
|
import { t as __ } from "../../build-module-DG6ZK7Ty.js";
|
|
4
|
-
import { Container } from "../base-control/container.js";
|
|
4
|
+
import { Container as TypedContainer$1 } from "../base-control/container.js";
|
|
5
5
|
import { n as arrayMove, r as arrayRemove, t as List } from "../../List-BKcyZ8tT.js";
|
|
6
6
|
import { useCallback, useMemo } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region lib/components/draggable-list/draggable-list.tsx
|
|
9
9
|
var TypedBaseControl = BaseControl;
|
|
10
|
-
var TypedContainer =
|
|
10
|
+
var TypedContainer = TypedContainer$1;
|
|
11
|
+
var mergeItem = (item, newValue) => ({
|
|
12
|
+
...item,
|
|
13
|
+
...newValue
|
|
14
|
+
});
|
|
11
15
|
/**
|
|
12
16
|
* A component that allows re-ordering a list of items.
|
|
13
17
|
*
|
|
@@ -44,7 +48,7 @@ var TypedContainer = Container;
|
|
|
44
48
|
var DraggableList = (props) => {
|
|
45
49
|
const { children, items, onChange, icon, label, subtitle, help, actions, className, itemClassName, itemContainerClassName, onAfterItemRemove, hidden, ...rest } = props;
|
|
46
50
|
const normalizedItems = useMemo(() => Array.isArray(items) ? items : [], [items]);
|
|
47
|
-
if (
|
|
51
|
+
if (items === void 0 || items === null || !Array.isArray(items)) console.warn(__("DraggableList: 'items' are not an array or are undefined!", "eightshift-ui-components"));
|
|
48
52
|
const handleListChange = useCallback(({ oldIndex, newIndex }) => onChange(newIndex === -1 ? arrayRemove(normalizedItems, oldIndex) : arrayMove(normalizedItems, oldIndex, newIndex)), [normalizedItems, onChange]);
|
|
49
53
|
const renderList = useCallback(({ children: listChildren, props: listProps }) => {
|
|
50
54
|
return jsx("ul", {
|
|
@@ -66,11 +70,7 @@ var DraggableList = (props) => {
|
|
|
66
70
|
children: children({
|
|
67
71
|
...value,
|
|
68
72
|
updateData: (newValue) => {
|
|
69
|
-
const updated =
|
|
70
|
-
updated[index] = {
|
|
71
|
-
...updated[index],
|
|
72
|
-
...newValue
|
|
73
|
-
};
|
|
73
|
+
const updated = normalizedItems.map((currentItem, itemIndex) => itemIndex === index ? mergeItem(currentItem, newValue) : currentItem);
|
|
74
74
|
onChange(updated);
|
|
75
75
|
},
|
|
76
76
|
itemIndex: index,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as clsx } from "../../clsx-DQoRUQAf.js";
|
|
2
2
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
3
|
-
import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "../../Label-
|
|
4
|
-
import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-
|
|
5
|
-
import { t as Button } from "../../button-
|
|
3
|
+
import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "../../Label-C4bJkVti.js";
|
|
4
|
+
import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-BTSsPhG9.js";
|
|
5
|
+
import { t as Button } from "../../button-C7mc6eS1.js";
|
|
6
6
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
7
7
|
import { t as __ } from "../../build-module-DG6ZK7Ty.js";
|
|
8
8
|
import { dropdownCaretAlt } from "../../icons/ui-icons/dropdown-caret-alt.js";
|
package/dist/components/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { AnimatedVisibility } from "./animated-visibility/animated-visibility.js";
|
|
2
|
-
import { t as LinkInput } from "../link-input-
|
|
3
|
-
import { t as Checkbox } from "../checkbox-
|
|
4
|
-
import { t as SolidColorPicker } from "../solid-color-picker-
|
|
5
|
-
import { t as ColorSwatch } from "../color-swatch-
|
|
6
|
-
import { i as Tabs, n as TabList, r as TabPanel, t as Tab } from "../tabs-
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { n as
|
|
2
|
+
import { t as LinkInput } from "../link-input-CElQp3lP.js";
|
|
3
|
+
import { t as Checkbox } from "../checkbox-DlG5DILl.js";
|
|
4
|
+
import { t as SolidColorPicker } from "../solid-color-picker-2-X3ridX.js";
|
|
5
|
+
import { t as ColorSwatch } from "../color-swatch-D6xMLGU-.js";
|
|
6
|
+
import { i as Tabs, n as TabList, r as TabPanel, t as Tab } from "../tabs-DgkJUkIX.js";
|
|
7
|
+
import { n as Tooltip, t as DecorativeTooltip } from "../tooltip-AzOLps8g.js";
|
|
8
|
+
import { t as Modal } from "../modal-BeacK9N_.js";
|
|
9
|
+
import { t as NumberPicker } from "../number-picker-CK_OHBXw.js";
|
|
10
|
+
import { t as Switch } from "../switch-B87lQ1V0.js";
|
|
11
|
+
import { t as InputField } from "../input-field-QzBpjm-m.js";
|
|
12
|
+
import { t as ToggleButton } from "../toggle-button-B2-f2rU6.js";
|
|
13
|
+
import { n as ButtonGroup, t as Button } from "../button-C7mc6eS1.js";
|
|
14
14
|
import { RichLabel } from "./rich-label/rich-label.js";
|
|
15
15
|
import { BaseControl } from "./base-control/base-control.js";
|
|
16
16
|
import { BreakpointPreview } from "./breakpoint-preview/breakpoint-preview.js";
|
|
@@ -23,17 +23,17 @@ import { ContainerPanel } from "./container-panel/container-panel.js";
|
|
|
23
23
|
import { Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, SubMenuItem } from "./menu/menu.js";
|
|
24
24
|
import { ColorPicker } from "./color-pickers/color-picker.js";
|
|
25
25
|
import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./slider/column-config-slider.js";
|
|
26
|
-
import { Container, ContainerGroup } from "./base-control/container.js";
|
|
26
|
+
import { Container as TypedContainer, ContainerGroup as TypedContainerGroup } from "./base-control/container.js";
|
|
27
27
|
import { ContextualHelp } from "./contextual-help/contextual-help.js";
|
|
28
28
|
import { DraggableList } from "./draggable-list/draggable-list.js";
|
|
29
29
|
import { DraggableListItem, DraggableListItemHandle } from "./draggable-list/draggable-list-item.js";
|
|
30
30
|
import { DraggableContext } from "./draggable/draggable-context.js";
|
|
31
|
-
import { t as Draggable } from "../draggable-
|
|
31
|
+
import { t as Draggable } from "../draggable-BUfOpGSZ.js";
|
|
32
32
|
import { DraggableHandle } from "./draggable/draggable-handle.js";
|
|
33
33
|
import { SmartImage } from "./smart-image/smart-image.js";
|
|
34
34
|
import { FilePickerShell } from "./placeholders/file-picker-shell.js";
|
|
35
35
|
import { FilePlaceholder } from "./placeholders/file-placeholder.js";
|
|
36
|
-
import { t as GradientEditor } from "../gradient-editor-
|
|
36
|
+
import { t as GradientEditor } from "../gradient-editor-_q3XF10i.js";
|
|
37
37
|
import { MatrixAlign } from "./matrix-align/matrix-align.js";
|
|
38
38
|
import { RadioButton, RadioButtonGroup } from "./radio/radio.js";
|
|
39
39
|
import { OptionSelect } from "./option-select/option-select.js";
|
|
@@ -56,4 +56,4 @@ import { MultiSelect } from "./select/multi-select.js";
|
|
|
56
56
|
import { OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection } from "./options-panel/options-panel.js";
|
|
57
57
|
import { Select } from "./select/single-select.js";
|
|
58
58
|
import { VStack } from "./layout/vstack.js";
|
|
59
|
-
export { AnimatedVisibility, AsyncMultiSelect, AsyncSelect, BaseControl, BreakpointPreview, Button, ButtonGroup, Checkbox, ColorPicker, ColorSwatch, ColumnConfigSlider, ColumnConfigSliderOutput, ComponentToggle, Container, ContainerGroup, ContainerPanel, ContextualHelp, DecorativeTooltip, Draggable, DraggableContext, DraggableHandle, DraggableList, DraggableListItem, DraggableListItemHandle, Expandable, FilePickerShell, FilePlaceholder, GradientEditor, HStack, ImagePlaceholder, InputField, ItemCollection, LinkInput, MatrixAlign, MediaPlaceholder, Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, MiniResponsive, Modal, MultiSelect, Notice, NumberPicker, OptionSelect, OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection, Popover, PortalProvider, RadioButton, RadioButtonGroup, Repeater, RepeaterItem, Responsive, ResponsiveLegacy, ResponsivePreview, RichLabel, Select, Slider, SmartImage, SolidColorPicker, Spacer, SubMenuItem, Switch, Tab, TabList, TabPanel, Tabs, Toggle, ToggleButton, Tooltip, TriggeredPopover, VStack };
|
|
59
|
+
export { AnimatedVisibility, AsyncMultiSelect, AsyncSelect, BaseControl, BreakpointPreview, Button, ButtonGroup, Checkbox, ColorPicker, ColorSwatch, ColumnConfigSlider, ColumnConfigSliderOutput, ComponentToggle, TypedContainer as Container, TypedContainerGroup as ContainerGroup, ContainerPanel, ContextualHelp, DecorativeTooltip, Draggable, DraggableContext, DraggableHandle, DraggableList, DraggableListItem, DraggableListItemHandle, Expandable, FilePickerShell, FilePlaceholder, GradientEditor, HStack, ImagePlaceholder, InputField, ItemCollection, LinkInput, MatrixAlign, MediaPlaceholder, Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, MiniResponsive, Modal, MultiSelect, Notice, NumberPicker, OptionSelect, OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection, Popover, PortalProvider, RadioButton, RadioButtonGroup, Repeater, RepeaterItem, Responsive, ResponsiveLegacy, ResponsivePreview, RichLabel, Select, Slider, SmartImage, SolidColorPicker, Spacer, SubMenuItem, Switch, Tab, TabList, TabPanel, Tabs, Toggle, ToggleButton, Tooltip, TriggeredPopover, VStack };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as InputField } from "../../input-field-
|
|
1
|
+
import { t as InputField } from "../../input-field-QzBpjm-m.js";
|
|
2
2
|
export { InputField };
|