@eightshift/ui-components 5.1.4 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-DH22t_SM.js → Button-RTwMSBs-.js} +20 -26
- package/dist/{Collection-BRJOMbOa.js → Collection-D_KhdLDC.js} +40 -23
- package/dist/{Color-CNqKeT8D.js → Color-WxFE7lQB.js} +2 -2
- package/dist/{ColorSwatch-Dt3lRApA.js → ColorSwatch-xVS3rMYS.js} +9 -7
- package/dist/{Dialog-D6EdDPeu.js → Dialog-Xf6AsnV-.js} +86 -62
- package/dist/{FieldError-DHrSdE_Q.js → FieldError-B8BgFmIQ.js} +2 -2
- package/dist/{FocusScope-BEPI2m7u.js → FocusScope-BnwM-e8R.js} +24 -22
- package/dist/{Form-Bnyyv3Im.js → Form-BeMxJA29.js} +13 -3
- package/dist/{Input-DfSBLhDx.js → Group-C4cXobNT.js} +56 -11
- package/dist/{Heading-ba38ScjJ.js → Heading-bh1HU5HH.js} +1 -1
- package/dist/{Label-JS_ob-kh.js → Label-DWVaNd2E.js} +1 -1
- package/dist/{List-BLeHBkfx.js → List-CwJTORxj.js} +1 -1
- package/dist/{ListBox-BY3gwI8c.js → ListBox-BeC97FZ4.js} +62 -38
- package/dist/{OverlayArrow-BUfV-5P3.js → OverlayArrow-EZ0v_ljk.js} +6 -6
- package/dist/{Select-BebwUgKB.js → Select-DEQf8ZWI.js} +96 -58
- package/dist/{Select-aab027f3.esm-BKIJGje-.js → Select-ef7c0426.esm-D6WOCaYm.js} +11 -6
- package/dist/{Separator-CTQWg_HO.js → Separator-Fl7qSeN-.js} +37 -20
- package/dist/{Slider-uOPcIpqS.js → Slider-BQFSEhvk.js} +28 -21
- package/dist/{Text-BuJgePCv.js → Text-AxKZjtFm.js} +1 -1
- package/dist/{TextField-o2U-uBWv.js → TextField-x_eEa_qR.js} +20 -10
- package/dist/{VisuallyHidden-BYi0pekx.js → VisuallyHidden-D9s7FTtC.js} +2 -2
- package/dist/assets/style-admin.css +227 -3
- package/dist/assets/style-editor.css +227 -3
- package/dist/assets/style.css +227 -3
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +11 -10
- package/dist/components/checkbox/checkbox.js +17 -12
- 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 -2
- package/dist/components/color-pickers/solid-color-picker.js +85 -49
- package/dist/components/component-toggle/component-toggle.js +2 -1
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +191 -170
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +18 -18
- package/dist/components/index.js +5 -1
- package/dist/components/input-field/input-field.js +3 -3
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +45 -34
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +3 -3
- package/dist/components/modal/modal.js +39 -13
- package/dist/components/number-picker/number-picker.js +15 -13
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/radio/radio.js +45 -22
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +2 -2
- package/dist/components/responsive/mini-responsive.js +3 -2
- package/dist/components/responsive/responsive-legacy.js +2 -1
- package/dist/components/responsive/responsive.js +2 -1
- 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 +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/shared.js +19 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/v2/async-multi-select.js +432 -0
- package/dist/components/select/v2/async-select.js +25 -14
- package/dist/components/select/v2/multi-select.js +403 -0
- package/dist/components/select/v2/shared.js +44 -8
- package/dist/components/select/v2/single-select.js +10 -10
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +2 -1
- package/dist/components/tabs/tabs.js +33 -23
- package/dist/components/toggle/switch.js +11 -8
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +14 -8
- package/dist/components/tooltip/tooltip.js +9 -7
- package/dist/{context-BbYZoHvX.js → context-DMOmz986.js} +1 -1
- package/dist/{default-i18n-OFa3zAyB.js → default-i18n-DY6EfUSA.js} +21 -284
- package/dist/filterDOMProps-D2C6R0DK.js +71 -0
- package/dist/icons/icons.js +1 -1
- package/dist/{index-641ee5b8.esm-BPU8rMZr.js → index-641ee5b8.esm-Bu-mgopl.js} +1 -1
- package/dist/{index-CFozsmNS.js → index-CBHA_HDD.js} +3 -1
- package/dist/{index-BljRBEr_.js → index-Dq3gT5pW.js} +1 -1
- package/dist/index.js +4 -0
- package/dist/{multi-select-components-BcKzA24f.js → multi-select-components-rCCyCaKO.js} +1 -1
- package/dist/{number-CHmNj-oR.js → number-7sOvrqo0.js} +7 -2
- package/dist/{react-select-async.esm-D937XTWW.js → react-select-async.esm-XYrsKYb2.js} +3 -3
- package/dist/{react-select.esm-Ciai3aKf.js → react-select.esm-CCSPY6XR.js} +3 -3
- package/dist/sprintf-DmNrJSYG.js +51 -0
- package/dist/{textSelection-8DpK8fJl.js → textSelection-D5tWX1rJ.js} +1 -1
- package/dist/{useAsyncList-fLtZMvJO.js → useAsyncList-ZqaIH2gh.js} +1 -1
- package/dist/{useButton-lRcWnvOB.js → useButton-BtJSiQi3.js} +13 -5
- package/dist/useDragAndDrop-CddFteYC.js +3917 -0
- package/dist/{useEvent-ICdlokG-.js → useEvent-BifIGnVS.js} +1 -1
- package/dist/{useFilter-BR5z1A4Q.js → useFilter-Cl2ggwwq.js} +1 -1
- package/dist/{useFocusRing-Bv0UJQl8.js → useFocusRing-D5BfOWag.js} +3 -3
- package/dist/{useFormReset-D2YaWRIA.js → useFormReset-yV9VVy9R.js} +3 -4
- package/dist/{useHover-C2SkI1Fn.js → useHover-44IApaa2.js} +67 -34
- package/dist/{useLabel-BPCd5c7-.js → useLabel-C8umX0gk.js} +2 -2
- package/dist/{useLabels-B7-lUnAF.js → useLabels-Cdxi6JSa.js} +1 -1
- package/dist/{useListState-BrZ2XvDS.js → useListState-BSkHuB7-.js} +1 -1
- package/dist/{useLocalizedStringFormatter-C9GO0IDB.js → useLocalizedStringFormatter-eaZiN2tE.js} +1 -1
- package/dist/{useNumberField-y0dLc_6m.js → useNumberField-JhWPy1JY.js} +23 -16
- package/dist/{useNumberFormatter-CZ9QUnRt.js → useNumberFormatter-BCmkV-7c.js} +1 -1
- package/dist/{usePress-DWBuejBp.js → usePress-BnrkvZ7e.js} +20 -5
- package/dist/{useSingleSelectListState-Bh46cRXs.js → useSingleSelectListState-CzJFsSHr.js} +2 -2
- package/dist/{useToggle-yGuUBU7q.js → useToggle-OaIBlwRu.js} +21 -8
- package/dist/{useToggleState-ibcBUHnB.js → useToggleState-BF8hvidm.js} +5 -1
- package/dist/{utils-CZt7LCbO.js → utils-cvK1vxO7.js} +9 -7
- package/package.json +18 -18
- package/dist/Group-LBogWgyp.js +0 -48
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/filterDOMProps-EDDcM64A.js +0 -28
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useMemo, useRef,
|
|
2
|
+
import React__default, { useState, useMemo, useRef, useCallback, forwardRef, createContext, useContext } from "react";
|
|
3
3
|
import { b as $4e85f108e88277b8$export$ebe63fadcdce34ed, c as $4e85f108e88277b8$export$44644b8a16031b5b, d as $4e85f108e88277b8$export$717b2c0a523a0b53 } from "../../RSPContexts-2lR5GG9p.js";
|
|
4
|
-
import {
|
|
5
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { $ as $799cddbef784668f$export$6e865ea70d7724f, b as $799cddbef784668f$export$4cde5df63f53f473, a as $3493a52097159720$exports } from "../../Color-
|
|
9
|
-
import { a as $9446cca9a3875146$export$cb6e0bb50bc19463, $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "../../number-
|
|
10
|
-
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-
|
|
11
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-
|
|
12
|
-
import { e as $28f99e3e86e6ec45$export$e5fda3247f5d67f9, f as $e8a7022cf87cba2a$export$36da96379f79f245, g as $bcca50147b47f54d$export$56b2c08e277f365, h as $47b897dc8cdb026b$export$8d15029008292ae, d as $6f909507e6374d18$export$1e7083018727fa60, i as $6f909507e6374d18$export$f1fce0420cc6d8ee, j as $6f909507e6374d18$export$6189c2744041d8f8, a as $6f909507e6374d18$export$105594979f116971 } from "../../Slider-
|
|
13
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
14
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-
|
|
15
|
-
import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "../../VisuallyHidden-
|
|
16
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
17
|
-
import {
|
|
18
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
19
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
20
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, b as $d2e8511e6f209edf$export$e908e06f4b8e3402, c as $7d0a636d7a4dcefd$export$2123ff2b87c81ca, d as $d841c8010a73d545$export$4f384c9210e583c3, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-
|
|
21
|
-
import { a as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../Form-
|
|
4
|
+
import { b as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37, h as $64fa3d84918910a7$export$4d86445c2cf5e3, a as $64fa3d84918910a7$export$29f1550f4b0d4415, i as $64fa3d84918910a7$export$2881499e37b75b9a, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-cvK1vxO7.js";
|
|
5
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
6
|
+
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec, a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-D5BfOWag.js";
|
|
7
|
+
import { a as $458b0a5536c1a7cf$export$40bfa8c7b0832715, f as $03deb23ff14920c4$export$4eaf04e54aa8eed6, z as $7215afc6de606d6b$export$de79e2c695e052f3, A as $46d819fcbaf35654$export$8f71654801c2f7cd, o as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, b as $c87311424ea30a05$export$fedb369cb70207f1, t as $c87311424ea30a05$export$a11b0059900ceec8, e as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-44IApaa2.js";
|
|
8
|
+
import { $ as $799cddbef784668f$export$6e865ea70d7724f, b as $799cddbef784668f$export$4cde5df63f53f473, a as $3493a52097159720$exports } from "../../Color-WxFE7lQB.js";
|
|
9
|
+
import { a as $9446cca9a3875146$export$cb6e0bb50bc19463, $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "../../number-7sOvrqo0.js";
|
|
10
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-Cdxi6JSa.js";
|
|
11
|
+
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-yV9VVy9R.js";
|
|
12
|
+
import { e as $28f99e3e86e6ec45$export$e5fda3247f5d67f9, f as $e8a7022cf87cba2a$export$36da96379f79f245, g as $bcca50147b47f54d$export$56b2c08e277f365, h as $47b897dc8cdb026b$export$8d15029008292ae, d as $6f909507e6374d18$export$1e7083018727fa60, i as $6f909507e6374d18$export$f1fce0420cc6d8ee, j as $6f909507e6374d18$export$6189c2744041d8f8, a as $6f909507e6374d18$export$105594979f116971 } from "../../Slider-BQFSEhvk.js";
|
|
13
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DMOmz986.js";
|
|
14
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-eaZiN2tE.js";
|
|
15
|
+
import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "../../VisuallyHidden-D9s7FTtC.js";
|
|
16
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
17
|
+
import { b as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $a049562f99e7db0e$export$f9c6924e160136d1, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Group-C4cXobNT.js";
|
|
18
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
19
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
20
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, b as $d2e8511e6f209edf$export$e908e06f4b8e3402, c as $7d0a636d7a4dcefd$export$2123ff2b87c81ca, d as $d841c8010a73d545$export$4f384c9210e583c3, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-JhWPy1JY.js";
|
|
21
|
+
import { a as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../Form-BeMxJA29.js";
|
|
22
22
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
23
23
|
import { BaseControl } from "../base-control/base-control.js";
|
|
24
|
-
import { _ as __ } from "../../default-i18n-
|
|
24
|
+
import { _ as __ } from "../../default-i18n-DY6EfUSA.js";
|
|
25
25
|
import { TriggeredPopover } from "../popover/popover.js";
|
|
26
26
|
import { icons } from "../../icons/icons.js";
|
|
27
27
|
import { Tabs, TabList, Tab, TabPanel } from "../tabs/tabs.js";
|
|
@@ -32,6 +32,7 @@ function $6e14a98a7f67141d$export$6df7f0e2cabc7eef(props) {
|
|
|
32
32
|
if (value) value = $799cddbef784668f$export$4cde5df63f53f473(value);
|
|
33
33
|
if (defaultValue) defaultValue = $799cddbef784668f$export$4cde5df63f53f473(defaultValue);
|
|
34
34
|
let [colorValue, setColorState] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange);
|
|
35
|
+
let [initialValue] = useState(colorValue);
|
|
35
36
|
let color = useMemo(() => colorSpace && colorValue ? colorValue.toFormat(colorSpace) : colorValue, [
|
|
36
37
|
colorValue,
|
|
37
38
|
colorSpace
|
|
@@ -74,6 +75,7 @@ function $6e14a98a7f67141d$export$6df7f0e2cabc7eef(props) {
|
|
|
74
75
|
xChannelPageStep: pageSizeX,
|
|
75
76
|
yChannelPageStep: pageSizeY,
|
|
76
77
|
value: color,
|
|
78
|
+
defaultValue: value !== void 0 ? initialValue : defaultValue,
|
|
77
79
|
setValue(value2) {
|
|
78
80
|
setColor($799cddbef784668f$export$4cde5df63f53f473(value2));
|
|
79
81
|
},
|
|
@@ -137,6 +139,12 @@ function $25a25ac0d1624665$export$57bc203e1c9c6d44(props) {
|
|
|
137
139
|
colorValue,
|
|
138
140
|
colorSpace
|
|
139
141
|
]);
|
|
142
|
+
let [initialValue] = useState(colorValue);
|
|
143
|
+
let defaultColorValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : initialValue;
|
|
144
|
+
let defaultColor = useMemo(() => colorSpace && defaultColorValue ? defaultColorValue.toFormat(colorSpace) : defaultColorValue, [
|
|
145
|
+
defaultColorValue,
|
|
146
|
+
colorSpace
|
|
147
|
+
]);
|
|
140
148
|
let sliderState = $28f99e3e86e6ec45$export$e5fda3247f5d67f9({
|
|
141
149
|
...color.getChannelRange(channel),
|
|
142
150
|
...otherProps,
|
|
@@ -144,6 +152,7 @@ function $25a25ac0d1624665$export$57bc203e1c9c6d44(props) {
|
|
|
144
152
|
// @ts-ignore
|
|
145
153
|
numberFormatter: null,
|
|
146
154
|
value: color.getChannelValue(channel),
|
|
155
|
+
defaultValue: defaultColor.getChannelValue(channel),
|
|
147
156
|
onChange(v) {
|
|
148
157
|
setColor(color.withChannelValue(channel, v));
|
|
149
158
|
},
|
|
@@ -202,9 +211,9 @@ const $b335ada08155d9c0$var$MAX_COLOR_INT = $b335ada08155d9c0$var$MAX_COLOR.toHe
|
|
|
202
211
|
function $b335ada08155d9c0$export$d52a01683abdfcd6(props) {
|
|
203
212
|
let { value, defaultValue, onChange } = props;
|
|
204
213
|
let { step } = $b335ada08155d9c0$var$MIN_COLOR.getChannelRange("red");
|
|
205
|
-
let initialValue = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2(value);
|
|
206
214
|
let initialDefaultValue = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2(defaultValue);
|
|
207
|
-
let [colorValue, setColorValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(
|
|
215
|
+
let [colorValue, setColorValue] = $458b0a5536c1a7cf$export$40bfa8c7b0832715($aa90ad8b2b1d015f$export$5aadd9c0606af5c2(value), initialDefaultValue, onChange);
|
|
216
|
+
let [initialValue] = useState(colorValue);
|
|
208
217
|
let [inputValue, setInputValue] = useState(() => (value || defaultValue) && colorValue ? colorValue.toString("hex") : "");
|
|
209
218
|
let validation = $e5be200c675c3b3a$export$fc1a364ae1f3ff10({
|
|
210
219
|
...props,
|
|
@@ -251,6 +260,7 @@ function $b335ada08155d9c0$export$d52a01683abdfcd6(props) {
|
|
|
251
260
|
let newColorValue = "";
|
|
252
261
|
if (colorValue) newColorValue = colorValue.toString("hex");
|
|
253
262
|
setInputValue(newColorValue);
|
|
263
|
+
validation.commitValidation();
|
|
254
264
|
};
|
|
255
265
|
let increment = () => {
|
|
256
266
|
let newValue = $b335ada08155d9c0$var$addColorValue(parsedValue, step);
|
|
@@ -274,6 +284,8 @@ function $b335ada08155d9c0$export$d52a01683abdfcd6(props) {
|
|
|
274
284
|
...validation,
|
|
275
285
|
validate,
|
|
276
286
|
colorValue,
|
|
287
|
+
defaultColorValue: initialDefaultValue !== null && initialDefaultValue !== void 0 ? initialDefaultValue : initialValue,
|
|
288
|
+
setColorValue,
|
|
277
289
|
inputValue,
|
|
278
290
|
setInputValue,
|
|
279
291
|
commit,
|
|
@@ -295,18 +307,13 @@ function $b335ada08155d9c0$var$addColorValue(color, step) {
|
|
|
295
307
|
}
|
|
296
308
|
function $31a863bb88e75dd6$export$b9fc0d69c9190c4a(props) {
|
|
297
309
|
let { channel, colorSpace, locale } = props;
|
|
298
|
-
let black = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2("#000");
|
|
299
310
|
let initialValue = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2(props.value);
|
|
300
311
|
let initialDefaultValue = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2(props.defaultValue);
|
|
301
312
|
let [colorValue, setColor] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(initialValue, initialDefaultValue !== null && initialDefaultValue !== void 0 ? initialDefaultValue : null, props.onChange);
|
|
302
|
-
let color =
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
black,
|
|
307
|
-
colorValue,
|
|
308
|
-
colorSpace
|
|
309
|
-
]);
|
|
313
|
+
let color = $31a863bb88e75dd6$var$useConvertColor(colorValue, colorSpace);
|
|
314
|
+
let [initialColorValue] = useState(colorValue);
|
|
315
|
+
let defaultColorValue = initialDefaultValue !== null && initialDefaultValue !== void 0 ? initialDefaultValue : initialColorValue;
|
|
316
|
+
let defaultColor = $31a863bb88e75dd6$var$useConvertColor(defaultColorValue, colorSpace);
|
|
310
317
|
let value = color.getChannelValue(channel);
|
|
311
318
|
let range = color.getChannelRange(channel);
|
|
312
319
|
let formatOptions = useMemo(() => color.getChannelFormatOptions(channel), [
|
|
@@ -317,6 +324,7 @@ function $31a863bb88e75dd6$export$b9fc0d69c9190c4a(props) {
|
|
|
317
324
|
let numberFieldState = $de67e98908f0c6ee$export$7f629e9dc1ecf37c({
|
|
318
325
|
locale,
|
|
319
326
|
value: colorValue === null ? NaN : value / multiplier,
|
|
327
|
+
defaultValue: defaultColorValue === null ? NaN : defaultColor.getChannelValue(channel) / multiplier,
|
|
320
328
|
onChange: (v) => {
|
|
321
329
|
if (!Number.isNaN(v)) setColor(color.withChannelValue(channel, v * multiplier));
|
|
322
330
|
else setColor(null);
|
|
@@ -328,9 +336,22 @@ function $31a863bb88e75dd6$export$b9fc0d69c9190c4a(props) {
|
|
|
328
336
|
});
|
|
329
337
|
return {
|
|
330
338
|
...numberFieldState,
|
|
331
|
-
colorValue: color
|
|
339
|
+
colorValue: color,
|
|
340
|
+
defaultColorValue,
|
|
341
|
+
setColorValue: setColor
|
|
332
342
|
};
|
|
333
343
|
}
|
|
344
|
+
function $31a863bb88e75dd6$var$useConvertColor(colorValue, colorSpace) {
|
|
345
|
+
let black = $aa90ad8b2b1d015f$export$5aadd9c0606af5c2("#000");
|
|
346
|
+
return useMemo(() => {
|
|
347
|
+
let nonNullColorValue = colorValue || black;
|
|
348
|
+
return colorSpace && nonNullColorValue ? nonNullColorValue.toFormat(colorSpace) : nonNullColorValue;
|
|
349
|
+
}, [
|
|
350
|
+
black,
|
|
351
|
+
colorValue,
|
|
352
|
+
colorSpace
|
|
353
|
+
]);
|
|
354
|
+
}
|
|
334
355
|
const $40297c24c53588e6$var$hue = (color) => [
|
|
335
356
|
0,
|
|
336
357
|
60,
|
|
@@ -431,7 +452,7 @@ function $parcel$interopDefault(a) {
|
|
|
431
452
|
return a && a.__esModule ? a.default : a;
|
|
432
453
|
}
|
|
433
454
|
function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
|
|
434
|
-
let { isDisabled, inputXRef, inputYRef, containerRef, "aria-label": ariaLabel, xName, yName } = props;
|
|
455
|
+
let { isDisabled, inputXRef, inputYRef, containerRef, "aria-label": ariaLabel, xName, yName, form } = props;
|
|
435
456
|
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($3493a52097159720$exports), "@react-aria/color");
|
|
436
457
|
let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
437
458
|
let { direction, locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
@@ -441,13 +462,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
|
|
|
441
462
|
}, [
|
|
442
463
|
inputXRef
|
|
443
464
|
]);
|
|
444
|
-
$99facab73266f662$export$5add1d006293d136(inputXRef,
|
|
445
|
-
state.xValue,
|
|
446
|
-
state.yValue
|
|
447
|
-
], ([x, y]) => {
|
|
448
|
-
let newColor = state.value.withChannelValue(state.channels.xChannel, x).withChannelValue(state.channels.yChannel, y);
|
|
449
|
-
state.setValue(newColor);
|
|
450
|
-
});
|
|
465
|
+
$99facab73266f662$export$5add1d006293d136(inputXRef, state.defaultValue, state.setValue);
|
|
451
466
|
let [valueChangedViaKeyboard, setValueChangedViaKeyboard] = useState(false);
|
|
452
467
|
let [valueChangedViaInputChangeEvent, setValueChangedViaInputChangeEvent] = useState(false);
|
|
453
468
|
let { xChannel, yChannel, zChannel } = state.channels;
|
|
@@ -758,6 +773,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
|
|
|
758
773
|
disabled: isDisabled,
|
|
759
774
|
value: state.value.getChannelValue(xChannel),
|
|
760
775
|
name: xName,
|
|
776
|
+
form,
|
|
761
777
|
tabIndex: isMobile || !focusedInput || focusedInput === "x" ? void 0 : -1,
|
|
762
778
|
/*
|
|
763
779
|
So that only a single "2d slider" control shows up when listing form elements for screen readers,
|
|
@@ -783,6 +799,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
|
|
|
783
799
|
disabled: isDisabled,
|
|
784
800
|
value: state.value.getChannelValue(yChannel),
|
|
785
801
|
name: yName,
|
|
802
|
+
form,
|
|
786
803
|
tabIndex: isMobile || focusedInput === "y" ? void 0 : -1,
|
|
787
804
|
/*
|
|
788
805
|
So that only a single "2d slider" control shows up when listing form elements for screen readers,
|
|
@@ -795,7 +812,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
|
|
|
795
812
|
};
|
|
796
813
|
}
|
|
797
814
|
function $40af666d6c251e36$export$106b7a4e66508f66(props, state) {
|
|
798
|
-
let { trackRef, inputRef, orientation, channel, "aria-label": ariaLabel, name } = props;
|
|
815
|
+
let { trackRef, inputRef, orientation, channel, "aria-label": ariaLabel, name, form } = props;
|
|
799
816
|
let { locale, direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
800
817
|
if (!props.label && !ariaLabel && !props["aria-labelledby"]) ariaLabel = state.value.getChannelName(channel, locale);
|
|
801
818
|
let { groupProps, trackProps, labelProps, outputProps } = $bcca50147b47f54d$export$56b2c08e277f365({
|
|
@@ -807,6 +824,7 @@ function $40af666d6c251e36$export$106b7a4e66508f66(props, state) {
|
|
|
807
824
|
orientation,
|
|
808
825
|
isDisabled: props.isDisabled,
|
|
809
826
|
name,
|
|
827
|
+
form,
|
|
810
828
|
trackRef,
|
|
811
829
|
inputRef
|
|
812
830
|
}, state);
|
|
@@ -933,13 +951,16 @@ function $f6896b05b2ecad12$export$77e32ca575a28fdf(props, state, ref) {
|
|
|
933
951
|
...props,
|
|
934
952
|
id: inputId,
|
|
935
953
|
value: inputValue,
|
|
936
|
-
|
|
954
|
+
// Intentionally invalid value that will be ignored by onChange during form reset
|
|
955
|
+
// This is handled separately below.
|
|
956
|
+
defaultValue: "!",
|
|
937
957
|
validate: void 0,
|
|
938
958
|
[$e5be200c675c3b3a$export$a763b9476acd3eb]: state,
|
|
939
959
|
type: "text",
|
|
940
960
|
autoComplete: "off",
|
|
941
961
|
onChange
|
|
942
962
|
}, state, ref);
|
|
963
|
+
$99facab73266f662$export$5add1d006293d136(ref, state.defaultColorValue, state.setColorValue);
|
|
943
964
|
inputProps = $3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, spinButtonProps, focusWithinProps, {
|
|
944
965
|
role: "textbox",
|
|
945
966
|
"aria-valuemax": null,
|
|
@@ -989,7 +1010,9 @@ const $e2b71ec1d6016406$export$a3cc47cee1c1ccc = /* @__PURE__ */ forwardRef(func
|
|
|
989
1010
|
isDisabled
|
|
990
1011
|
}
|
|
991
1012
|
});
|
|
992
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props
|
|
1013
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
1014
|
+
global: true
|
|
1015
|
+
});
|
|
993
1016
|
delete DOMProps.id;
|
|
994
1017
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
995
1018
|
...$3ef42575df84b30b$export$9d1611c77c2fe928(thumbProps, hoverProps, DOMProps),
|
|
@@ -1031,13 +1054,13 @@ const $0de070065d44825d$export$b2103f68a961418e = /* @__PURE__ */ forwardRef(fun
|
|
|
1031
1054
|
isDisabled: props.isDisabled || false
|
|
1032
1055
|
}
|
|
1033
1056
|
});
|
|
1034
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props
|
|
1057
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
1058
|
+
global: true
|
|
1059
|
+
});
|
|
1035
1060
|
delete DOMProps.id;
|
|
1036
1061
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1037
1062
|
ref,
|
|
1038
|
-
|
|
1039
|
-
...DOMProps,
|
|
1040
|
-
...renderProps,
|
|
1063
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, colorAreaProps, renderProps),
|
|
1041
1064
|
slot: props.slot || void 0,
|
|
1042
1065
|
"data-disabled": props.isDisabled || void 0
|
|
1043
1066
|
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
@@ -1091,6 +1114,7 @@ function $3ada01a82feafb94$var$ColorChannelField(props) {
|
|
|
1091
1114
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, $3ada01a82feafb94$var$useChildren(props, state, props.forwardedRef, inputProps, inputRef, labelProps, labelRef, descriptionProps, errorMessageProps, validation), props.name && /* @__PURE__ */ React__default.createElement("input", {
|
|
1092
1115
|
type: "hidden",
|
|
1093
1116
|
name: props.name,
|
|
1117
|
+
form: props.form,
|
|
1094
1118
|
value: isNaN(state.numberValue) ? "" : state.numberValue
|
|
1095
1119
|
}));
|
|
1096
1120
|
}
|
|
@@ -1121,7 +1145,9 @@ function $3ada01a82feafb94$var$useChildren(props, state, ref, inputProps, inputR
|
|
|
1121
1145
|
},
|
|
1122
1146
|
defaultClassName: "react-aria-ColorField"
|
|
1123
1147
|
});
|
|
1124
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props
|
|
1148
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
1149
|
+
global: true
|
|
1150
|
+
});
|
|
1125
1151
|
delete DOMProps.id;
|
|
1126
1152
|
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
1127
1153
|
values: [
|
|
@@ -1143,6 +1169,14 @@ function $3ada01a82feafb94$var$useChildren(props, state, ref, inputProps, inputR
|
|
|
1143
1169
|
ref: labelRef
|
|
1144
1170
|
}
|
|
1145
1171
|
],
|
|
1172
|
+
[
|
|
1173
|
+
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
1174
|
+
{
|
|
1175
|
+
role: "presentation",
|
|
1176
|
+
isInvalid: validation.isInvalid,
|
|
1177
|
+
isDisabled: props.isDisabled || false
|
|
1178
|
+
}
|
|
1179
|
+
],
|
|
1146
1180
|
[
|
|
1147
1181
|
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
1148
1182
|
{
|
|
@@ -1193,7 +1227,9 @@ const $1cca5300a3c2e7f9$export$44fd664bcca5b6fb = /* @__PURE__ */ forwardRef(fun
|
|
|
1193
1227
|
},
|
|
1194
1228
|
defaultClassName: "react-aria-ColorSlider"
|
|
1195
1229
|
});
|
|
1196
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props
|
|
1230
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
1231
|
+
global: true
|
|
1232
|
+
});
|
|
1197
1233
|
delete DOMProps.id;
|
|
1198
1234
|
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
1199
1235
|
values: [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { s as sprintf } from "../../sprintf-DmNrJSYG.js";
|
|
3
|
+
import { _ as __ } from "../../default-i18n-DY6EfUSA.js";
|
|
3
4
|
import { Expandable } from "../expandable/expandable.js";
|
|
4
5
|
import { icons } from "../../icons/icons.js";
|
|
5
6
|
import { Switch } from "../toggle/switch.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
-
import "../../default-i18n-
|
|
3
|
+
import "../../default-i18n-DY6EfUSA.js";
|
|
4
4
|
import { DraggableContext } from "./draggable-context.js";
|
|
5
5
|
import { useContext } from "react";
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|