@eightshift/ui-components 1.0.6 → 1.1.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/README.md +9 -0
- package/dist/{Button-eebLs4cp.js → Button-CbFrFO04.js} +5 -5
- package/dist/{Checkbox-BN0TEda-.js → Checkbox-Cv3pZDHg.js} +12 -16
- package/dist/{ColorSwatch-BrowHhTG.js → ColorSwatch-CNQmCQV8.js} +6 -7
- package/dist/{FieldError-ILxgMZy5.js → FieldError-J1-YPbi6.js} +2 -2
- package/dist/{FocusScope-B9b0VMib.js → FocusScope-Bw-IatMO.js} +79 -153
- package/dist/{GridList-CzpWxJsS.js → GridList-CEzzyr-l.js} +62 -90
- package/dist/{Group-Dkdm2-E7.js → Group-D3Qa6PrV.js} +3 -3
- package/dist/{Input-BJA4rmIo.js → Input-CX_rocyZ.js} +8 -8
- package/dist/{Label-9x5iLJ-Y.js → Label-Bg5O81Wb.js} +1 -1
- package/dist/{ListBox-D3Vr4vvC.js → ListBox-CCWXTj0t.js} +391 -598
- package/dist/{LiveAnnouncer-IsokfWQ5.js → LiveAnnouncer-D8h-3GrG.js} +12 -22
- package/dist/{NumberFormatter-LzoKy975.js → NumberFormatter-U_Gx0UDq.js} +26 -44
- package/dist/{Select-49a62830.esm-CKPmlkza.js → Select-49a62830.esm-BnlXlUnT.js} +92 -166
- package/dist/{SelectionManager-sedvcM-1.js → SelectionManager-XOAt-Ekx.js} +219 -401
- package/dist/{Separator-B6rnDabE.js → Separator-DZeg0KOr.js} +41 -72
- package/dist/{Slider-C5U5N7uM.js → Slider-fULMI0gI.js} +51 -82
- package/dist/{Text-Cyxp9ewv.js → Text-WqetJduR.js} +1 -1
- package/dist/{VisuallyHidden-BPJVSUyp.js → VisuallyHidden-Di1zXprL.js} +8 -11
- package/dist/{ariaHideOutside-ByKBPHmX.js → ariaHideOutside-Zn64-frS.js} +20 -36
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/{button-idVI4jmd.js → button-CD8Q1eok.js} +17 -29
- package/dist/components/animated-visibility/animated-visibility.js +125 -113
- package/dist/components/base-control/base-control.js +3 -9
- package/dist/components/breakpoint-preview/breakpoint-preview.js +51 -108
- package/dist/components/button/button.js +6 -6
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/color-pickers/color-picker.js +2 -2
- package/dist/components/color-pickers/color-swatch.js +5 -9
- package/dist/components/color-pickers/gradient-editor.js +15 -29
- package/dist/components/color-pickers/solid-color-picker.js +81 -128
- package/dist/components/component-toggle/component-toggle.js +4 -4
- package/dist/components/container-panel/container-panel.js +4 -11
- package/dist/components/draggable-list/draggable-list-item.js +4 -4
- package/dist/components/draggable-list/draggable-list.js +5 -5
- package/dist/components/expandable/expandable.js +45 -57
- package/dist/components/index.js +3 -3
- package/dist/components/input-field/input-field.js +11 -26
- package/dist/components/layout/hstack.js +2 -12
- package/dist/components/layout/vstack.js +2 -12
- package/dist/components/link-input/link-input.js +36 -53
- package/dist/components/list-box/list-box.js +4 -4
- package/dist/components/matrix-align/matrix-align.js +6 -10
- package/dist/components/menu/menu.js +101 -170
- package/dist/components/notice/notice.js +1 -1
- package/dist/components/number-picker/number-picker.js +15 -15
- package/dist/components/option-select/option-select.js +48 -64
- package/dist/components/options-panel/options-panel.js +3 -3
- package/dist/components/placeholders/file-placeholder.js +2 -2
- package/dist/components/placeholders/image-placeholder.js +1 -1
- package/dist/components/placeholders/media-placeholder.js +1 -1
- package/dist/components/popover/popover.js +4 -4
- package/dist/components/radio/radio.js +25 -38
- package/dist/components/repeater/repeater-item.js +6 -17
- package/dist/components/repeater/repeater.js +6 -7
- package/dist/components/responsive/responsive-legacy.js +6 -12
- package/dist/components/responsive/responsive.js +21 -48
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/rich-label/rich-label.js +2 -8
- 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 +2 -2
- package/dist/components/select/multi-select-components.js +2 -2
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +9 -9
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +3 -10
- package/dist/components/slider/column-config-slider.js +4 -4
- package/dist/components/slider/slider.js +5 -8
- package/dist/components/slider/utils.js +2 -6
- package/dist/components/spacer/spacer.js +2 -7
- package/dist/components/tabs/tabs.js +29 -50
- package/dist/components/toggle/switch.js +8 -8
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +8 -22
- package/dist/components/tooltip/tooltip.js +4 -4
- package/dist/{context-BAcFg5GO.js → context-4oSz1ItD.js} +10 -16
- package/dist/{default-i18n-Bk1GxDHz.js → default-i18n-BqwLkgZv.js} +21 -22
- package/dist/{filterDOMProps-DG2RfOUr.js → filterDOMProps-EDDcM64A.js} +1 -3
- package/dist/{focusSafely-B0hyd-S4.js → focusSafely-BS4dllCW.js} +85 -143
- package/dist/icons/generic-color-swatch.js +105 -13
- package/dist/icons/icons.js +31010 -3447
- package/dist/icons/jsx-svg.js +591 -953
- package/dist/{index-BDk0TPWz.js → index-CAPcSs9K.js} +1504 -2087
- package/dist/{index-a301f526.esm-BzTuHLdr.js → index-a301f526.esm-ByOfDxiG.js} +111 -183
- package/dist/index.js +3 -3
- package/dist/{intlStrings-Ctkp0HDc.js → intlStrings-Dxaeitoh.js} +35 -60
- package/dist/{isScrollable-PcyglExV.js → isScrollable-Dh9D9IOd.js} +1 -2
- package/dist/lite-DVmmD_-j.js +7 -0
- package/dist/{multi-select-components-nORKdJ-2.js → multi-select-components-7vKCF8dG.js} +3 -3
- package/dist/{number-rWqELA8W.js → number-CHmNj-oR.js} +3 -6
- package/dist/{popover-o2Q28Ljn.js → popover-Dk2o4S7K.js} +70 -112
- package/dist/{react-select-async.esm-CLj9uZTq.js → react-select-async.esm-5zW9Dv9E.js} +7 -11
- package/dist/{react-select.esm-3tyTZmrx.js → react-select.esm-Bi6uzjbT.js} +3 -3
- package/dist/{textSelection-BRZdHY-4.js → textSelection-exP_9srp.js} +5 -9
- package/dist/{tooltip-T6H9uF-Z.js → tooltip-BRQ4tvZL.js} +64 -111
- package/dist/{useButton-D-xACzEY.js → useButton-DbjDV_33.js} +19 -22
- package/dist/{useEvent-XlYPKgwX.js → useEvent-zvxfEnmK.js} +2 -3
- package/dist/{useFocusRing-CRx_hYC4.js → useFocusRing-SPRI0-SN.js} +1 -1
- package/dist/{useFocusable-CHfpEdlE.js → useFocusable-CLmhO94g.js} +5 -8
- package/dist/{useFormReset-aHn6-wRk.js → useFormReset-BVWgcyGO.js} +2 -3
- package/dist/{useFormValidationState-CdYmOaXI.js → useFormValidationState-CthG9Fbc.js} +20 -38
- package/dist/{useHasTabbableChild-domoFB7A.js → useHasTabbableChild--gkWUICh.js} +2 -2
- package/dist/{useLabel-DVhXVhtH.js → useLabel-g836T8kL.js} +3 -4
- package/dist/{useLabels-C7E5SkOi.js → useLabels-CfOtyOe2.js} +3 -5
- package/dist/{useListData-BelKu4kx.js → useListData-BpYQj7kK.js} +18 -32
- package/dist/{useListState-BRsq7O1C.js → useListState-DnWZa__1.js} +6 -12
- package/dist/{useLocalizedStringFormatter-WsEL47qR.js → useLocalizedStringFormatter-BQCMno9k.js} +12 -21
- package/dist/{useNumberFieldState-ZH2Qyyxh.js → useNumberFieldState-BegO5X6F.js} +75 -132
- package/dist/{useNumberFormatter-mhdYLxWQ.js → useNumberFormatter-DhOGEsEK.js} +2 -2
- package/dist/{usePress-B42RawCH.js → usePress-CScNeV3V.js} +92 -175
- package/dist/{useToggle-CExfZM8x.js → useToggle-6LnpaJ7-.js} +6 -7
- package/dist/{useToggleState-DghG5ImG.js → useToggleState-Cymkpac8.js} +3 -5
- package/dist/utilities/array-helpers.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/text-helpers.js +20 -20
- package/dist/{utils-DIBzm1e4.js → utils-Dc35LwuT.js} +49 -90
- package/package.json +96 -90
- package/dist/lite-pbIeT7tm.js +0 -8
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { c as $ae20dd8cbca75726$export$d6daf82dcd84e87c, d as $c5a24bc478652b5f$export$1005530eda016c13, e as $7135fc7d473fd974$export$aeba0b1fb3dcd8b8 } from "./SelectionManager-
|
|
2
|
-
import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-
|
|
3
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
1
|
+
import { c as $ae20dd8cbca75726$export$d6daf82dcd84e87c, d as $c5a24bc478652b5f$export$1005530eda016c13, e as $7135fc7d473fd974$export$aeba0b1fb3dcd8b8 } from "./SelectionManager-XOAt-Ekx.js";
|
|
2
|
+
import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-Dh9D9IOd.js";
|
|
3
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-4oSz1ItD.js";
|
|
4
4
|
import React__default, { useMemo, forwardRef, createContext } from "react";
|
|
5
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-
|
|
6
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-
|
|
5
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-Dc35LwuT.js";
|
|
6
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
7
7
|
let $325a3faab7a68acd$var$cache = /* @__PURE__ */ new Map();
|
|
8
8
|
function $325a3faab7a68acd$export$a16aca283550c30d(options) {
|
|
9
9
|
let { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
10
10
|
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
11
|
-
if ($325a3faab7a68acd$var$cache.has(cacheKey))
|
|
12
|
-
return $325a3faab7a68acd$var$cache.get(cacheKey);
|
|
11
|
+
if ($325a3faab7a68acd$var$cache.has(cacheKey)) return $325a3faab7a68acd$var$cache.get(cacheKey);
|
|
13
12
|
let formatter = new Intl.Collator(locale, options);
|
|
14
13
|
$325a3faab7a68acd$var$cache.set(cacheKey, formatter);
|
|
15
14
|
return formatter;
|
|
@@ -23,8 +22,7 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
23
22
|
key = this.collection.getKeyAfter(key);
|
|
24
23
|
while (key != null) {
|
|
25
24
|
let item = this.collection.getItem(key);
|
|
26
|
-
if (item.type === "item" && !this.isDisabled(item))
|
|
27
|
-
return key;
|
|
25
|
+
if (item.type === "item" && !this.isDisabled(item)) return key;
|
|
28
26
|
key = this.collection.getKeyAfter(key);
|
|
29
27
|
}
|
|
30
28
|
return null;
|
|
@@ -33,16 +31,14 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
33
31
|
key = this.collection.getKeyBefore(key);
|
|
34
32
|
while (key != null) {
|
|
35
33
|
let item = this.collection.getItem(key);
|
|
36
|
-
if (item.type === "item" && !this.isDisabled(item))
|
|
37
|
-
return key;
|
|
34
|
+
if (item.type === "item" && !this.isDisabled(item)) return key;
|
|
38
35
|
key = this.collection.getKeyBefore(key);
|
|
39
36
|
}
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
42
39
|
findKey(key, nextKey, shouldSkip) {
|
|
43
40
|
let item = this.getItem(key);
|
|
44
|
-
if (!item)
|
|
45
|
-
return null;
|
|
41
|
+
if (!item) return null;
|
|
46
42
|
let prevRect = item.getBoundingClientRect();
|
|
47
43
|
do {
|
|
48
44
|
key = nextKey(key);
|
|
@@ -57,46 +53,35 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
57
53
|
return prevRect.left === itemRect.left || prevRect.top !== itemRect.top;
|
|
58
54
|
}
|
|
59
55
|
getKeyBelow(key) {
|
|
60
|
-
if (this.layout === "grid" && this.orientation === "vertical")
|
|
61
|
-
|
|
62
|
-
else
|
|
63
|
-
return this.getNextKey(key);
|
|
56
|
+
if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getNextKey(key2), this.isSameRow);
|
|
57
|
+
else return this.getNextKey(key);
|
|
64
58
|
}
|
|
65
59
|
getKeyAbove(key) {
|
|
66
|
-
if (this.layout === "grid" && this.orientation === "vertical")
|
|
67
|
-
|
|
68
|
-
else
|
|
69
|
-
return this.getPreviousKey(key);
|
|
60
|
+
if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (key2) => this.getPreviousKey(key2), this.isSameRow);
|
|
61
|
+
else return this.getPreviousKey(key);
|
|
70
62
|
}
|
|
71
63
|
getNextColumn(key, right) {
|
|
72
64
|
return right ? this.getPreviousKey(key) : this.getNextKey(key);
|
|
73
65
|
}
|
|
74
66
|
getKeyRightOf(key) {
|
|
75
67
|
if (this.layout === "grid") {
|
|
76
|
-
if (this.orientation === "vertical")
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl"), this.isSameColumn);
|
|
80
|
-
} else if (this.orientation === "horizontal")
|
|
81
|
-
return this.getNextColumn(key, this.direction === "rtl");
|
|
68
|
+
if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl");
|
|
69
|
+
else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl"), this.isSameColumn);
|
|
70
|
+
} else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl");
|
|
82
71
|
return null;
|
|
83
72
|
}
|
|
84
73
|
getKeyLeftOf(key) {
|
|
85
74
|
if (this.layout === "grid") {
|
|
86
|
-
if (this.orientation === "vertical")
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr"), this.isSameColumn);
|
|
90
|
-
} else if (this.orientation === "horizontal")
|
|
91
|
-
return this.getNextColumn(key, this.direction === "ltr");
|
|
75
|
+
if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr");
|
|
76
|
+
else return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr"), this.isSameColumn);
|
|
77
|
+
} else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr");
|
|
92
78
|
return null;
|
|
93
79
|
}
|
|
94
80
|
getFirstKey() {
|
|
95
81
|
let key = this.collection.getFirstKey();
|
|
96
82
|
while (key != null) {
|
|
97
83
|
let item = this.collection.getItem(key);
|
|
98
|
-
if ((item === null || item === void 0 ? void 0 : item.type) === "item" && !this.isDisabled(item))
|
|
99
|
-
return key;
|
|
84
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === "item" && !this.isDisabled(item)) return key;
|
|
100
85
|
key = this.collection.getKeyAfter(key);
|
|
101
86
|
}
|
|
102
87
|
return null;
|
|
@@ -105,8 +90,7 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
105
90
|
let key = this.collection.getLastKey();
|
|
106
91
|
while (key != null) {
|
|
107
92
|
let item = this.collection.getItem(key);
|
|
108
|
-
if (item.type === "item" && !this.isDisabled(item))
|
|
109
|
-
return key;
|
|
93
|
+
if (item.type === "item" && !this.isDisabled(item)) return key;
|
|
110
94
|
key = this.collection.getKeyBefore(key);
|
|
111
95
|
}
|
|
112
96
|
return null;
|
|
@@ -117,10 +101,8 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
117
101
|
getKeyPageAbove(key) {
|
|
118
102
|
let menu = this.ref.current;
|
|
119
103
|
let item = this.getItem(key);
|
|
120
|
-
if (!item)
|
|
121
|
-
|
|
122
|
-
if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu))
|
|
123
|
-
return this.getFirstKey();
|
|
104
|
+
if (!item) return null;
|
|
105
|
+
if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu)) return this.getFirstKey();
|
|
124
106
|
let containerRect = menu.getBoundingClientRect();
|
|
125
107
|
let itemRect = item.getBoundingClientRect();
|
|
126
108
|
if (this.orientation === "horizontal") {
|
|
@@ -145,10 +127,8 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
145
127
|
getKeyPageBelow(key) {
|
|
146
128
|
let menu = this.ref.current;
|
|
147
129
|
let item = this.getItem(key);
|
|
148
|
-
if (!item)
|
|
149
|
-
|
|
150
|
-
if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu))
|
|
151
|
-
return this.getLastKey();
|
|
130
|
+
if (!item) return null;
|
|
131
|
+
if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu)) return this.getLastKey();
|
|
152
132
|
let containerRect = menu.getBoundingClientRect();
|
|
153
133
|
let itemRect = item.getBoundingClientRect();
|
|
154
134
|
if (this.orientation === "horizontal") {
|
|
@@ -171,15 +151,13 @@ class $2a25aae57d74318e$export$a05409b8bb224a5a {
|
|
|
171
151
|
return key !== null && key !== void 0 ? key : this.getLastKey();
|
|
172
152
|
}
|
|
173
153
|
getKeyForSearch(search, fromKey) {
|
|
174
|
-
if (!this.collator)
|
|
175
|
-
return null;
|
|
154
|
+
if (!this.collator) return null;
|
|
176
155
|
let collection = this.collection;
|
|
177
156
|
let key = fromKey || this.getFirstKey();
|
|
178
157
|
while (key != null) {
|
|
179
158
|
let item = collection.getItem(key);
|
|
180
159
|
let substring = item.textValue.slice(0, search.length);
|
|
181
|
-
if (item.textValue && this.collator.compare(substring, search) === 0)
|
|
182
|
-
return key;
|
|
160
|
+
if (item.textValue && this.collator.compare(substring, search) === 0) return key;
|
|
183
161
|
key = this.getKeyBelow(key);
|
|
184
162
|
}
|
|
185
163
|
return null;
|
|
@@ -244,15 +222,11 @@ function $982254629710d113$export$b95089534ab7c1fd(props) {
|
|
|
244
222
|
const $453cc9f0df89c0a5$var$cache = /* @__PURE__ */ new WeakMap();
|
|
245
223
|
function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
|
|
246
224
|
let count = $453cc9f0df89c0a5$var$cache.get(collection);
|
|
247
|
-
if (count != null)
|
|
248
|
-
return count;
|
|
225
|
+
if (count != null) return count;
|
|
249
226
|
count = 0;
|
|
250
227
|
let countItems = (items) => {
|
|
251
|
-
for (let item of items)
|
|
252
|
-
|
|
253
|
-
countItems($c5a24bc478652b5f$export$1005530eda016c13(item, collection));
|
|
254
|
-
else
|
|
255
|
-
count++;
|
|
228
|
+
for (let item of items) if (item.type === "section") countItems($c5a24bc478652b5f$export$1005530eda016c13(item, collection));
|
|
229
|
+
else count++;
|
|
256
230
|
};
|
|
257
231
|
countItems(collection);
|
|
258
232
|
$453cc9f0df89c0a5$var$cache.set(collection, count);
|
|
@@ -263,16 +237,14 @@ function $f4b273590fab9f93$export$52210f68a14655d0(props) {
|
|
|
263
237
|
labelable: true
|
|
264
238
|
});
|
|
265
239
|
let ariaOrientation;
|
|
266
|
-
if (props.orientation === "vertical")
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
};
|
|
240
|
+
if (props.orientation === "vertical") ariaOrientation = "vertical";
|
|
241
|
+
if (props.elementType !== "hr") return {
|
|
242
|
+
separatorProps: {
|
|
243
|
+
...domProps,
|
|
244
|
+
role: "separator",
|
|
245
|
+
"aria-orientation": ariaOrientation
|
|
246
|
+
}
|
|
247
|
+
};
|
|
276
248
|
return {
|
|
277
249
|
separatorProps: domProps
|
|
278
250
|
};
|
|
@@ -281,8 +253,7 @@ const $72a5793c14baf454$export$e0e4026c12a8bdbb = /* @__PURE__ */ createContext(
|
|
|
281
253
|
function $72a5793c14baf454$var$Header(originalProps, originalRef) {
|
|
282
254
|
let [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(originalProps, originalRef, $72a5793c14baf454$export$e0e4026c12a8bdbb);
|
|
283
255
|
let shallow = $7135fc7d473fd974$export$aeba0b1fb3dcd8b8("header", originalProps, originalRef);
|
|
284
|
-
if (shallow)
|
|
285
|
-
return shallow;
|
|
256
|
+
if (shallow) return shallow;
|
|
286
257
|
return /* @__PURE__ */ React__default.createElement("header", {
|
|
287
258
|
className: "react-aria-Header",
|
|
288
259
|
...props,
|
|
@@ -295,15 +266,13 @@ function $431f98aba6844401$var$Separator(originalProps, originalRef) {
|
|
|
295
266
|
let [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(originalProps, originalRef, $431f98aba6844401$export$6615d83f6de245ce);
|
|
296
267
|
let { elementType, orientation, style, className } = props;
|
|
297
268
|
let Element = elementType || "hr";
|
|
298
|
-
if (Element === "hr" && orientation === "vertical")
|
|
299
|
-
Element = "div";
|
|
269
|
+
if (Element === "hr" && orientation === "vertical") Element = "div";
|
|
300
270
|
let { separatorProps } = $f4b273590fab9f93$export$52210f68a14655d0({
|
|
301
271
|
elementType,
|
|
302
272
|
orientation
|
|
303
273
|
});
|
|
304
274
|
let shallow = $7135fc7d473fd974$export$aeba0b1fb3dcd8b8("separator", originalProps, originalRef);
|
|
305
|
-
if (shallow)
|
|
306
|
-
return shallow;
|
|
275
|
+
if (shallow) return shallow;
|
|
307
276
|
return /* @__PURE__ */ React__default.createElement(Element, {
|
|
308
277
|
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
|
|
309
278
|
...separatorProps,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "./utils-
|
|
2
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-
|
|
3
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-
|
|
1
|
+
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "./utils-Dc35LwuT.js";
|
|
2
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-Bg5O81Wb.js";
|
|
3
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
4
4
|
import React__default, { useRef, useMemo, useCallback, useEffect, useState, createContext, forwardRef, useContext } from "react";
|
|
5
|
-
import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-
|
|
6
|
-
import { i as $507fabe10e71c6fb$export$8397ddfc504fdb9a, m as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./focusSafely-
|
|
7
|
-
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as $9446cca9a3875146$export$cb6e0bb50bc19463 } from "./number-
|
|
8
|
-
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6, a as $14c0b72509d70225$export$b0d6fa1ab32e3295, b as $14c0b72509d70225$export$16a4697467175487 } from "./textSelection-
|
|
9
|
-
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-
|
|
10
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
11
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-
|
|
12
|
-
import { a as $46d819fcbaf35654$export$8f71654801c2f7cd, $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "./useFocusable-
|
|
13
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-
|
|
14
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-
|
|
5
|
+
import { $ as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-DhOGEsEK.js";
|
|
6
|
+
import { i as $507fabe10e71c6fb$export$8397ddfc504fdb9a, m as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./focusSafely-BS4dllCW.js";
|
|
7
|
+
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as $9446cca9a3875146$export$cb6e0bb50bc19463 } from "./number-CHmNj-oR.js";
|
|
8
|
+
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6, a as $14c0b72509d70225$export$b0d6fa1ab32e3295, b as $14c0b72509d70225$export$16a4697467175487 } from "./textSelection-exP_9srp.js";
|
|
9
|
+
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-g836T8kL.js";
|
|
10
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-4oSz1ItD.js";
|
|
11
|
+
import { $ as $99facab73266f662$export$5add1d006293d136 } from "./useFormReset-BVWgcyGO.js";
|
|
12
|
+
import { a as $46d819fcbaf35654$export$8f71654801c2f7cd, $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "./useFocusable-CLmhO94g.js";
|
|
13
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-SPRI0-SN.js";
|
|
14
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-Di1zXprL.js";
|
|
15
15
|
function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
16
16
|
let { onMoveStart, onMove, onMoveEnd } = props;
|
|
17
17
|
let state = useRef({
|
|
@@ -21,8 +21,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
21
21
|
});
|
|
22
22
|
let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
23
23
|
let move = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType, deltaX, deltaY) => {
|
|
24
|
-
if (deltaX === 0 && deltaY === 0)
|
|
25
|
-
return;
|
|
24
|
+
if (deltaX === 0 && deltaY === 0) return;
|
|
26
25
|
if (!state.current.didMove) {
|
|
27
26
|
state.current.didMove = true;
|
|
28
27
|
onMoveStart === null || onMoveStart === void 0 ? void 0 : onMoveStart({
|
|
@@ -47,15 +46,14 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
47
46
|
});
|
|
48
47
|
let end = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
|
|
49
48
|
$14c0b72509d70225$export$b0d6fa1ab32e3295();
|
|
50
|
-
if (state.current.didMove)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
49
|
+
if (state.current.didMove) onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd({
|
|
50
|
+
type: "moveend",
|
|
51
|
+
pointerType,
|
|
52
|
+
shiftKey: originalEvent.shiftKey,
|
|
53
|
+
metaKey: originalEvent.metaKey,
|
|
54
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
55
|
+
altKey: originalEvent.altKey
|
|
56
|
+
});
|
|
59
57
|
});
|
|
60
58
|
let moveProps = useMemo(() => {
|
|
61
59
|
let moveProps2 = {};
|
|
@@ -123,8 +121,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
123
|
moveProps2.onTouchStart = (e) => {
|
|
126
|
-
if (e.changedTouches.length === 0 || state.current.id != null)
|
|
127
|
-
return;
|
|
124
|
+
if (e.changedTouches.length === 0 || state.current.id != null) return;
|
|
128
125
|
let { pageX, pageY, identifier } = e.changedTouches[0];
|
|
129
126
|
start();
|
|
130
127
|
e.stopPropagation();
|
|
@@ -225,8 +222,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
|
|
|
225
222
|
const $aa519ee6cf463259$export$d6c8d9636a3dc49c = /* @__PURE__ */ new WeakMap();
|
|
226
223
|
function $aa519ee6cf463259$export$68e648cbec363a18(state, index) {
|
|
227
224
|
let data = $aa519ee6cf463259$export$d6c8d9636a3dc49c.get(state);
|
|
228
|
-
if (!data)
|
|
229
|
-
throw new Error("Unknown slider state");
|
|
225
|
+
if (!data) throw new Error("Unknown slider state");
|
|
230
226
|
return `${data.id}-${index}`;
|
|
231
227
|
}
|
|
232
228
|
function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
|
|
@@ -250,11 +246,9 @@ function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
|
|
|
250
246
|
onMove({ deltaX, deltaY }) {
|
|
251
247
|
let { height, width } = trackRef.current.getBoundingClientRect();
|
|
252
248
|
let size = isVertical ? height : width;
|
|
253
|
-
if (currentPosition.current == null)
|
|
254
|
-
currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
|
|
249
|
+
if (currentPosition.current == null) currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
|
|
255
250
|
let delta = isVertical ? deltaY : deltaX;
|
|
256
|
-
if (isVertical || reverseX)
|
|
257
|
-
delta = -delta;
|
|
251
|
+
if (isVertical || reverseX) delta = -delta;
|
|
258
252
|
currentPosition.current += delta;
|
|
259
253
|
if (realTimeTrackDraggingIndex.current != null && trackRef.current) {
|
|
260
254
|
const percent = $9446cca9a3875146$export$7d15b64cf5a3a4c4(currentPosition.current / size, 0, 1);
|
|
@@ -277,22 +271,17 @@ function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
|
|
|
277
271
|
const clickPosition = isVertical ? clientY : clientX;
|
|
278
272
|
const offset = clickPosition - trackPosition;
|
|
279
273
|
let percent = offset / size;
|
|
280
|
-
if (direction === "rtl" || isVertical)
|
|
281
|
-
percent = 1 - percent;
|
|
274
|
+
if (direction === "rtl" || isVertical) percent = 1 - percent;
|
|
282
275
|
let value = state.getPercentValue(percent);
|
|
283
276
|
let closestThumb;
|
|
284
277
|
let split = state.values.findIndex((v) => value - v < 0);
|
|
285
|
-
if (split === 0)
|
|
286
|
-
|
|
287
|
-
else if (split === -1)
|
|
288
|
-
closestThumb = state.values.length - 1;
|
|
278
|
+
if (split === 0) closestThumb = split;
|
|
279
|
+
else if (split === -1) closestThumb = state.values.length - 1;
|
|
289
280
|
else {
|
|
290
281
|
let lastLeft = state.values[split - 1];
|
|
291
282
|
let firstRight = state.values[split];
|
|
292
|
-
if (Math.abs(lastLeft - value) < Math.abs(firstRight - value))
|
|
293
|
-
|
|
294
|
-
else
|
|
295
|
-
closestThumb = split;
|
|
283
|
+
if (Math.abs(lastLeft - value) < Math.abs(firstRight - value)) closestThumb = split - 1;
|
|
284
|
+
else closestThumb = split;
|
|
296
285
|
}
|
|
297
286
|
if (closestThumb >= 0 && state.isThumbEditable(closestThumb)) {
|
|
298
287
|
e.preventDefault();
|
|
@@ -304,8 +293,7 @@ function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
|
|
|
304
293
|
addGlobalListener(window, "mouseup", onUpTrack, false);
|
|
305
294
|
addGlobalListener(window, "touchend", onUpTrack, false);
|
|
306
295
|
addGlobalListener(window, "pointerup", onUpTrack, false);
|
|
307
|
-
} else
|
|
308
|
-
realTimeTrackDraggingIndex.current = null;
|
|
296
|
+
} else realTimeTrackDraggingIndex.current = null;
|
|
309
297
|
}
|
|
310
298
|
};
|
|
311
299
|
let onUpTrack = (e) => {
|
|
@@ -341,13 +329,11 @@ function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
|
|
|
341
329
|
},
|
|
342
330
|
trackProps: $3ef42575df84b30b$export$9d1611c77c2fe928({
|
|
343
331
|
onMouseDown(e) {
|
|
344
|
-
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)
|
|
345
|
-
return;
|
|
332
|
+
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
346
333
|
onDownTrack(e, void 0, e.clientX, e.clientY);
|
|
347
334
|
},
|
|
348
335
|
onPointerDown(e) {
|
|
349
|
-
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey))
|
|
350
|
-
return;
|
|
336
|
+
if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
|
|
351
337
|
onDownTrack(e, e.pointerId, e.clientX, e.clientY);
|
|
352
338
|
},
|
|
353
339
|
onTouchStart(e) {
|
|
@@ -379,15 +365,13 @@ function $47b897dc8cdb026b$export$8d15029008292ae(opts, state) {
|
|
|
379
365
|
});
|
|
380
366
|
const value = state.values[index];
|
|
381
367
|
const focusInput = useCallback(() => {
|
|
382
|
-
if (inputRef.current)
|
|
383
|
-
$7215afc6de606d6b$export$de79e2c695e052f3(inputRef.current);
|
|
368
|
+
if (inputRef.current) $7215afc6de606d6b$export$de79e2c695e052f3(inputRef.current);
|
|
384
369
|
}, [
|
|
385
370
|
inputRef
|
|
386
371
|
]);
|
|
387
372
|
const isFocused = state.focusedThumb === index;
|
|
388
373
|
useEffect(() => {
|
|
389
|
-
if (isFocused)
|
|
390
|
-
focusInput();
|
|
374
|
+
if (isFocused) focusInput();
|
|
391
375
|
}, [
|
|
392
376
|
isFocused,
|
|
393
377
|
focusInput
|
|
@@ -429,17 +413,13 @@ function $47b897dc8cdb026b$export$8d15029008292ae(opts, state) {
|
|
|
429
413
|
const { getThumbPercent, setThumbPercent, decrementThumb, incrementThumb, step, pageSize } = state;
|
|
430
414
|
let { width, height } = trackRef.current.getBoundingClientRect();
|
|
431
415
|
let size = isVertical ? height : width;
|
|
432
|
-
if (currentPosition.current == null)
|
|
433
|
-
currentPosition.current = getThumbPercent(index) * size;
|
|
416
|
+
if (currentPosition.current == null) currentPosition.current = getThumbPercent(index) * size;
|
|
434
417
|
if (pointerType === "keyboard") {
|
|
435
|
-
if (deltaX > 0 && reverseX || deltaX < 0 && !reverseX || deltaY > 0)
|
|
436
|
-
|
|
437
|
-
else
|
|
438
|
-
incrementThumb(index, shiftKey ? pageSize : step);
|
|
418
|
+
if (deltaX > 0 && reverseX || deltaX < 0 && !reverseX || deltaY > 0) decrementThumb(index, shiftKey ? pageSize : step);
|
|
419
|
+
else incrementThumb(index, shiftKey ? pageSize : step);
|
|
439
420
|
} else {
|
|
440
421
|
let delta = isVertical ? deltaY : deltaX;
|
|
441
|
-
if (isVertical || reverseX)
|
|
442
|
-
delta = -delta;
|
|
422
|
+
if (isVertical || reverseX) delta = -delta;
|
|
443
423
|
currentPosition.current += delta;
|
|
444
424
|
setThumbPercent(index, $9446cca9a3875146$export$7d15b64cf5a3a4c4(currentPosition.current / size, 0, 1));
|
|
445
425
|
}
|
|
@@ -475,17 +455,14 @@ function $47b897dc8cdb026b$export$8d15029008292ae(opts, state) {
|
|
|
475
455
|
}
|
|
476
456
|
};
|
|
477
457
|
let thumbPosition = state.getThumbPercent(index);
|
|
478
|
-
if (isVertical || direction === "rtl")
|
|
479
|
-
thumbPosition = 1 - thumbPosition;
|
|
458
|
+
if (isVertical || direction === "rtl") thumbPosition = 1 - thumbPosition;
|
|
480
459
|
let interactions = !isDisabled ? $3ef42575df84b30b$export$9d1611c77c2fe928(keyboardProps, moveProps, {
|
|
481
460
|
onMouseDown: (e) => {
|
|
482
|
-
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)
|
|
483
|
-
return;
|
|
461
|
+
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
484
462
|
onDown();
|
|
485
463
|
},
|
|
486
464
|
onPointerDown: (e) => {
|
|
487
|
-
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)
|
|
488
|
-
return;
|
|
465
|
+
if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
489
466
|
onDown(e.pointerId);
|
|
490
467
|
},
|
|
491
468
|
onTouchStart: (e) => {
|
|
@@ -604,8 +581,7 @@ function $28f99e3e86e6ec45$export$e5fda3247f5d67f9(props) {
|
|
|
604
581
|
isEditablesRef.current[index] = editable;
|
|
605
582
|
}
|
|
606
583
|
function updateValue(index, value2) {
|
|
607
|
-
if (isDisabled || !isThumbEditable(index))
|
|
608
|
-
return;
|
|
584
|
+
if (isDisabled || !isThumbEditable(index)) return;
|
|
609
585
|
const thisMin = getThumbMinValue(index);
|
|
610
586
|
const thisMax = getThumbMaxValue(index);
|
|
611
587
|
value2 = $9446cca9a3875146$export$cb6e0bb50bc19463(value2, thisMin, thisMax, step);
|
|
@@ -613,15 +589,12 @@ function $28f99e3e86e6ec45$export$e5fda3247f5d67f9(props) {
|
|
|
613
589
|
setValues(newValues);
|
|
614
590
|
}
|
|
615
591
|
function updateDragging(index, dragging) {
|
|
616
|
-
if (isDisabled || !isThumbEditable(index))
|
|
617
|
-
|
|
618
|
-
if (dragging)
|
|
619
|
-
valuesRef.current = values;
|
|
592
|
+
if (isDisabled || !isThumbEditable(index)) return;
|
|
593
|
+
if (dragging) valuesRef.current = values;
|
|
620
594
|
const wasDragging = isDraggingsRef.current[index];
|
|
621
595
|
isDraggingsRef.current = $28f99e3e86e6ec45$var$replaceIndex(isDraggingsRef.current, index, dragging);
|
|
622
596
|
setDraggings(isDraggingsRef.current);
|
|
623
|
-
if (onChangeEnd && wasDragging && !isDraggingsRef.current.some(Boolean))
|
|
624
|
-
onChangeEnd(valuesRef.current);
|
|
597
|
+
if (onChangeEnd && wasDragging && !isDraggingsRef.current.some(Boolean)) onChangeEnd(valuesRef.current);
|
|
625
598
|
}
|
|
626
599
|
function getFormattedValue(value2) {
|
|
627
600
|
return formatter.format(value2);
|
|
@@ -671,8 +644,7 @@ function $28f99e3e86e6ec45$export$e5fda3247f5d67f9(props) {
|
|
|
671
644
|
};
|
|
672
645
|
}
|
|
673
646
|
function $28f99e3e86e6ec45$var$replaceIndex(array, index, value) {
|
|
674
|
-
if (array[index] === value)
|
|
675
|
-
return array;
|
|
647
|
+
if (array[index] === value) return array;
|
|
676
648
|
return [
|
|
677
649
|
...array.slice(0, index),
|
|
678
650
|
value,
|
|
@@ -680,18 +652,15 @@ function $28f99e3e86e6ec45$var$replaceIndex(array, index, value) {
|
|
|
680
652
|
];
|
|
681
653
|
}
|
|
682
654
|
function $28f99e3e86e6ec45$var$convertValue(value) {
|
|
683
|
-
if (value == null)
|
|
684
|
-
return void 0;
|
|
655
|
+
if (value == null) return void 0;
|
|
685
656
|
return Array.isArray(value) ? value : [
|
|
686
657
|
value
|
|
687
658
|
];
|
|
688
659
|
}
|
|
689
660
|
function $28f99e3e86e6ec45$var$createOnChange(value, defaultValue, onChange) {
|
|
690
661
|
return (newValue) => {
|
|
691
|
-
if (typeof value === "number" || typeof defaultValue === "number")
|
|
692
|
-
|
|
693
|
-
else
|
|
694
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
662
|
+
if (typeof value === "number" || typeof defaultValue === "number") onChange === null || onChange === void 0 ? void 0 : onChange(newValue[0]);
|
|
663
|
+
else onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
695
664
|
};
|
|
696
665
|
}
|
|
697
666
|
const $6f909507e6374d18$export$e99164f0030f3bff = /* @__PURE__ */ createContext(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-
|
|
1
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-Dc35LwuT.js";
|
|
2
2
|
import React__default, { forwardRef, createContext } from "react";
|
|
3
3
|
const $514c0188e459b4c0$export$9afb8bc826b033ea = /* @__PURE__ */ createContext({});
|
|
4
4
|
function $514c0188e459b4c0$var$Text(props, ref) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
1
|
+
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-Dc35LwuT.js";
|
|
2
2
|
import React__default, { useState, useMemo } from "react";
|
|
3
|
-
import { d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-
|
|
3
|
+
import { d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-BS4dllCW.js";
|
|
4
4
|
const $5c3e21d68f1c4674$var$styles = {
|
|
5
5
|
border: 0,
|
|
6
6
|
clip: "rect(0 0 0 0)",
|
|
@@ -21,15 +21,12 @@ function $5c3e21d68f1c4674$export$a966af930f325cab(props = {}) {
|
|
|
21
21
|
onFocusWithinChange: (val) => setFocused(val)
|
|
22
22
|
});
|
|
23
23
|
let combinedStyles = useMemo(() => {
|
|
24
|
-
if (isFocused)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
else
|
|
32
|
-
return $5c3e21d68f1c4674$var$styles;
|
|
24
|
+
if (isFocused) return style;
|
|
25
|
+
else if (style) return {
|
|
26
|
+
...$5c3e21d68f1c4674$var$styles,
|
|
27
|
+
...style
|
|
28
|
+
};
|
|
29
|
+
else return $5c3e21d68f1c4674$var$styles;
|
|
33
30
|
}, [
|
|
34
31
|
isFocused
|
|
35
32
|
]);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-
|
|
1
|
+
import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-Dh9D9IOd.js";
|
|
2
2
|
function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
|
|
3
3
|
let scrollableNode = node;
|
|
4
|
-
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(scrollableNode, checkForOverflow))
|
|
5
|
-
|
|
6
|
-
while (scrollableNode && !$cc38e7bd3fc7b213$export$2bb74740c4e19def(scrollableNode, checkForOverflow))
|
|
7
|
-
scrollableNode = scrollableNode.parentElement;
|
|
4
|
+
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
|
|
5
|
+
while (scrollableNode && !$cc38e7bd3fc7b213$export$2bb74740c4e19def(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
|
|
8
6
|
return scrollableNode || document.scrollingElement || document.documentElement;
|
|
9
7
|
}
|
|
10
8
|
let $5e3802645cc19319$var$refCountMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -13,14 +11,11 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
13
11
|
let visibleNodes = new Set(targets);
|
|
14
12
|
let hiddenNodes = /* @__PURE__ */ new Set();
|
|
15
13
|
let walk = (root2) => {
|
|
16
|
-
for (let element of root2.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
|
|
17
|
-
visibleNodes.add(element);
|
|
14
|
+
for (let element of root2.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) visibleNodes.add(element);
|
|
18
15
|
let acceptNode = (node) => {
|
|
19
|
-
if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute("role") !== "row")
|
|
20
|
-
return NodeFilter.FILTER_REJECT;
|
|
16
|
+
if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
|
|
21
17
|
for (let target of visibleNodes) {
|
|
22
|
-
if (node.contains(target))
|
|
23
|
-
return NodeFilter.FILTER_SKIP;
|
|
18
|
+
if (node.contains(target)) return NodeFilter.FILTER_SKIP;
|
|
24
19
|
}
|
|
25
20
|
return NodeFilter.FILTER_ACCEPT;
|
|
26
21
|
};
|
|
@@ -28,8 +23,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
28
23
|
acceptNode
|
|
29
24
|
});
|
|
30
25
|
let acceptRoot = acceptNode(root2);
|
|
31
|
-
if (acceptRoot === NodeFilter.FILTER_ACCEPT)
|
|
32
|
-
hide(root2);
|
|
26
|
+
if (acceptRoot === NodeFilter.FILTER_ACCEPT) hide(root2);
|
|
33
27
|
if (acceptRoot !== NodeFilter.FILTER_REJECT) {
|
|
34
28
|
let node = walker.nextNode();
|
|
35
29
|
while (node != null) {
|
|
@@ -41,34 +35,27 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
41
35
|
let hide = (node) => {
|
|
42
36
|
var _refCountMap_get;
|
|
43
37
|
let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;
|
|
44
|
-
if (node.getAttribute("aria-hidden") === "true" && refCount === 0)
|
|
45
|
-
|
|
46
|
-
if (refCount === 0)
|
|
47
|
-
node.setAttribute("aria-hidden", "true");
|
|
38
|
+
if (node.getAttribute("aria-hidden") === "true" && refCount === 0) return;
|
|
39
|
+
if (refCount === 0) node.setAttribute("aria-hidden", "true");
|
|
48
40
|
hiddenNodes.add(node);
|
|
49
41
|
$5e3802645cc19319$var$refCountMap.set(node, refCount + 1);
|
|
50
42
|
};
|
|
51
|
-
if ($5e3802645cc19319$var$observerStack.length)
|
|
52
|
-
$5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].disconnect();
|
|
43
|
+
if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].disconnect();
|
|
53
44
|
walk(root);
|
|
54
45
|
let observer = new MutationObserver((changes) => {
|
|
55
46
|
for (let change of changes) {
|
|
56
|
-
if (change.type !== "childList" || change.addedNodes.length === 0)
|
|
57
|
-
continue;
|
|
47
|
+
if (change.type !== "childList" || change.addedNodes.length === 0) continue;
|
|
58
48
|
if (![
|
|
59
49
|
...visibleNodes,
|
|
60
50
|
...hiddenNodes
|
|
61
51
|
].some((node) => node.contains(change.target))) {
|
|
62
|
-
for (let node of change.removedNodes)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
52
|
+
for (let node of change.removedNodes) if (node instanceof Element) {
|
|
53
|
+
visibleNodes.delete(node);
|
|
54
|
+
hiddenNodes.delete(node);
|
|
55
|
+
}
|
|
67
56
|
for (let node of change.addedNodes) {
|
|
68
|
-
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer === "true"))
|
|
69
|
-
|
|
70
|
-
else if (node instanceof Element)
|
|
71
|
-
walk(node);
|
|
57
|
+
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer === "true")) visibleNodes.add(node);
|
|
58
|
+
else if (node instanceof Element) walk(node);
|
|
72
59
|
}
|
|
73
60
|
}
|
|
74
61
|
}
|
|
@@ -96,15 +83,12 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
96
83
|
if (count === 1) {
|
|
97
84
|
node.removeAttribute("aria-hidden");
|
|
98
85
|
$5e3802645cc19319$var$refCountMap.delete(node);
|
|
99
|
-
} else
|
|
100
|
-
$5e3802645cc19319$var$refCountMap.set(node, count - 1);
|
|
86
|
+
} else $5e3802645cc19319$var$refCountMap.set(node, count - 1);
|
|
101
87
|
}
|
|
102
88
|
if (observerWrapper === $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1]) {
|
|
103
89
|
$5e3802645cc19319$var$observerStack.pop();
|
|
104
|
-
if ($5e3802645cc19319$var$observerStack.length)
|
|
105
|
-
|
|
106
|
-
} else
|
|
107
|
-
$5e3802645cc19319$var$observerStack.splice($5e3802645cc19319$var$observerStack.indexOf(observerWrapper), 1);
|
|
90
|
+
if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].observe();
|
|
91
|
+
} else $5e3802645cc19319$var$observerStack.splice($5e3802645cc19319$var$observerStack.indexOf(observerWrapper), 1);
|
|
108
92
|
};
|
|
109
93
|
}
|
|
110
94
|
export {
|