@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,8 +1,8 @@
|
|
|
1
|
-
import { u as useStateManager, S as Select } from "./Select-49a62830.esm-
|
|
2
|
-
import { _ as _extends } from "./index-a301f526.esm-
|
|
1
|
+
import { u as useStateManager, S as Select } from "./Select-49a62830.esm-BnlXlUnT.js";
|
|
2
|
+
import { _ as _extends } from "./index-a301f526.esm-ByOfDxiG.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-CAPcSs9K.js";
|
|
6
6
|
var StateManagedSelect = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
7
7
|
var baseSelectProps = useStateManager(props);
|
|
8
8
|
return /* @__PURE__ */ React.createElement(Select, _extends({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import { j as $c87311424ea30a05$export$fedb369cb70207f1, g as $431fbd86ca7dc216$export$b204af158042fbac, k as $bbed8b41f857bcc0$export$24490316f764c430 } from "./focusSafely-
|
|
2
|
+
import { j as $c87311424ea30a05$export$fedb369cb70207f1, g as $431fbd86ca7dc216$export$b204af158042fbac, k as $bbed8b41f857bcc0$export$24490316f764c430 } from "./focusSafely-BS4dllCW.js";
|
|
3
3
|
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
4
4
|
let globalListeners = useRef(/* @__PURE__ */ new Map());
|
|
5
5
|
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
@@ -57,15 +57,13 @@ function $14c0b72509d70225$export$16a4697467175487(target) {
|
|
|
57
57
|
}
|
|
58
58
|
function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
59
59
|
if ($c87311424ea30a05$export$fedb369cb70207f1()) {
|
|
60
|
-
if ($14c0b72509d70225$var$state !== "disabled")
|
|
61
|
-
return;
|
|
60
|
+
if ($14c0b72509d70225$var$state !== "disabled") return;
|
|
62
61
|
$14c0b72509d70225$var$state = "restoring";
|
|
63
62
|
setTimeout(() => {
|
|
64
63
|
$bbed8b41f857bcc0$export$24490316f764c430(() => {
|
|
65
64
|
if ($14c0b72509d70225$var$state === "restoring") {
|
|
66
65
|
const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(target);
|
|
67
|
-
if (documentObject.documentElement.style.webkitUserSelect === "none")
|
|
68
|
-
documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || "";
|
|
66
|
+
if (documentObject.documentElement.style.webkitUserSelect === "none") documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || "";
|
|
69
67
|
$14c0b72509d70225$var$savedUserSelect = "";
|
|
70
68
|
$14c0b72509d70225$var$state = "default";
|
|
71
69
|
}
|
|
@@ -74,10 +72,8 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
|
74
72
|
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
|
|
75
73
|
if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
|
|
76
74
|
let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
|
|
77
|
-
if (target.style.userSelect === "none")
|
|
78
|
-
|
|
79
|
-
if (target.getAttribute("style") === "")
|
|
80
|
-
target.removeAttribute("style");
|
|
75
|
+
if (target.style.userSelect === "none") target.style.userSelect = targetOldUserSelect;
|
|
76
|
+
if (target.getAttribute("style") === "") target.removeAttribute("style");
|
|
81
77
|
$14c0b72509d70225$var$modifiedElementMap.delete(target);
|
|
82
78
|
}
|
|
83
79
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, o as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, q as $64fa3d84918910a7$export$45fda7c47f93fd48, r as $64fa3d84918910a7$export$6d3443f2c48bfc20 } from "./utils-
|
|
2
|
+
import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, o as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, q as $64fa3d84918910a7$export$45fda7c47f93fd48, r as $64fa3d84918910a7$export$6d3443f2c48bfc20 } from "./utils-Dc35LwuT.js";
|
|
3
3
|
import React__default, { useEffect, useState, useRef, useCallback, useContext, useMemo, forwardRef, createContext } from "react";
|
|
4
|
-
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c, b as $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 } from "./useFocusable-
|
|
5
|
-
import { p as $c87311424ea30a05$export$78551043582a6a98, $ as $6179b936705e76d3$export$ae780daf29e6d456, t as $507fabe10e71c6fb$export$630ff653c5ada6a9, a as $507fabe10e71c6fb$export$b9b3dfddab17db27, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-
|
|
6
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-
|
|
7
|
-
import { $ as $dbSRa$reactdom } from "./index-
|
|
8
|
-
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-
|
|
9
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
10
|
-
import { c as clsx } from "./lite-
|
|
4
|
+
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c, b as $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 } from "./useFocusable-CLmhO94g.js";
|
|
5
|
+
import { p as $c87311424ea30a05$export$78551043582a6a98, $ as $6179b936705e76d3$export$ae780daf29e6d456, t as $507fabe10e71c6fb$export$630ff653c5ada6a9, a as $507fabe10e71c6fb$export$b9b3dfddab17db27, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-BS4dllCW.js";
|
|
6
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
7
|
+
import { $ as $dbSRa$reactdom } from "./index-CAPcSs9K.js";
|
|
8
|
+
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-CHmNj-oR.js";
|
|
9
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-4oSz1ItD.js";
|
|
10
|
+
import { c as clsx } from "./lite-DVmmD_-j.js";
|
|
11
11
|
function $9daab02d461809db$var$hasResizeObserver() {
|
|
12
12
|
return typeof window.ResizeObserver !== "undefined";
|
|
13
13
|
}
|
|
@@ -15,8 +15,7 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
15
15
|
const { ref, onResize } = options;
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
18
|
-
if (!element)
|
|
19
|
-
return;
|
|
18
|
+
if (!element) return;
|
|
20
19
|
if (!$9daab02d461809db$var$hasResizeObserver()) {
|
|
21
20
|
window.addEventListener("resize", onResize, false);
|
|
22
21
|
return () => {
|
|
@@ -24,14 +23,12 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
|
24
23
|
};
|
|
25
24
|
} else {
|
|
26
25
|
const resizeObserverInstance = new window.ResizeObserver((entries) => {
|
|
27
|
-
if (!entries.length)
|
|
28
|
-
return;
|
|
26
|
+
if (!entries.length) return;
|
|
29
27
|
onResize();
|
|
30
28
|
});
|
|
31
29
|
resizeObserverInstance.observe(element);
|
|
32
30
|
return () => {
|
|
33
|
-
if (element)
|
|
34
|
-
resizeObserverInstance.unobserve(element);
|
|
31
|
+
if (element) resizeObserverInstance.unobserve(element);
|
|
35
32
|
};
|
|
36
33
|
}
|
|
37
34
|
}, [
|
|
@@ -121,12 +118,9 @@ function $edcf132a9284368a$var$getDelta(axis, offset, size, boundaryDimensions,
|
|
|
121
118
|
let boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding;
|
|
122
119
|
let startEdgeOffset = offset - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
123
120
|
let endEdgeOffset = offset - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
124
|
-
if (startEdgeOffset < boundaryStartEdge)
|
|
125
|
-
|
|
126
|
-
else
|
|
127
|
-
return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
128
|
-
else
|
|
129
|
-
return 0;
|
|
121
|
+
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
122
|
+
else if (endEdgeOffset > boundaryEndEdge) return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
123
|
+
else return 0;
|
|
130
124
|
}
|
|
131
125
|
function $edcf132a9284368a$var$getMargins(node) {
|
|
132
126
|
let style = window.getComputedStyle(node);
|
|
@@ -138,13 +132,11 @@ function $edcf132a9284368a$var$getMargins(node) {
|
|
|
138
132
|
};
|
|
139
133
|
}
|
|
140
134
|
function $edcf132a9284368a$var$parsePlacement(input) {
|
|
141
|
-
if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input])
|
|
142
|
-
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
135
|
+
if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
143
136
|
let [placement, crossPlacement] = input.split(" ");
|
|
144
137
|
let axis = $edcf132a9284368a$var$AXIS[placement] || "right";
|
|
145
138
|
let crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
|
|
146
|
-
if (!$edcf132a9284368a$var$AXIS[crossPlacement])
|
|
147
|
-
crossPlacement = "center";
|
|
139
|
+
if (!$edcf132a9284368a$var$AXIS[crossPlacement]) crossPlacement = "center";
|
|
148
140
|
let size = $edcf132a9284368a$var$AXIS_SIZE[axis];
|
|
149
141
|
let crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
|
|
150
142
|
$edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
|
|
@@ -172,8 +164,7 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
172
164
|
if (placement === axis) {
|
|
173
165
|
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
|
|
174
166
|
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
175
|
-
} else
|
|
176
|
-
position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
167
|
+
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
177
168
|
return position;
|
|
178
169
|
}
|
|
179
170
|
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
@@ -187,8 +178,7 @@ function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, contai
|
|
|
187
178
|
}
|
|
188
179
|
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
189
180
|
let { placement, axis, size } = placementInfo;
|
|
190
|
-
if (placement === axis)
|
|
191
|
-
return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
181
|
+
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
192
182
|
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
193
183
|
}
|
|
194
184
|
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
@@ -209,21 +199,16 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
209
199
|
}
|
|
210
200
|
let heightGrowthDirection = "bottom";
|
|
211
201
|
if (placementInfo.axis === "top") {
|
|
212
|
-
if (placementInfo.placement === "top")
|
|
213
|
-
|
|
214
|
-
else if (placementInfo.placement === "bottom")
|
|
215
|
-
heightGrowthDirection = "bottom";
|
|
202
|
+
if (placementInfo.placement === "top") heightGrowthDirection = "top";
|
|
203
|
+
else if (placementInfo.placement === "bottom") heightGrowthDirection = "bottom";
|
|
216
204
|
} else if (placementInfo.crossAxis === "top") {
|
|
217
|
-
if (placementInfo.crossPlacement === "top")
|
|
218
|
-
|
|
219
|
-
else if (placementInfo.crossPlacement === "bottom")
|
|
220
|
-
heightGrowthDirection = "top";
|
|
205
|
+
if (placementInfo.crossPlacement === "top") heightGrowthDirection = "bottom";
|
|
206
|
+
else if (placementInfo.crossPlacement === "bottom") heightGrowthDirection = "top";
|
|
221
207
|
}
|
|
222
208
|
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
223
209
|
position[crossAxis] += delta;
|
|
224
210
|
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
|
|
225
|
-
if (userSetMaxHeight && userSetMaxHeight < maxHeight)
|
|
226
|
-
maxHeight = userSetMaxHeight;
|
|
211
|
+
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
227
212
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
228
213
|
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
229
214
|
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
@@ -306,12 +291,10 @@ function $edcf132a9284368a$var$getPosition(node, parent) {
|
|
|
306
291
|
}
|
|
307
292
|
function $edcf132a9284368a$var$getContainingBlock(node) {
|
|
308
293
|
let offsetParent = node.offsetParent;
|
|
309
|
-
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent))
|
|
310
|
-
offsetParent = document.documentElement;
|
|
294
|
+
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent)) offsetParent = document.documentElement;
|
|
311
295
|
if (offsetParent == null) {
|
|
312
296
|
offsetParent = node.parentElement;
|
|
313
|
-
while (offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent))
|
|
314
|
-
offsetParent = offsetParent.parentElement;
|
|
297
|
+
while (offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent)) offsetParent = offsetParent.parentElement;
|
|
315
298
|
}
|
|
316
299
|
return offsetParent || document.documentElement;
|
|
317
300
|
}
|
|
@@ -325,15 +308,12 @@ const $dd149f63282afbbf$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap();
|
|
|
325
308
|
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
326
309
|
let { triggerRef, isOpen, onClose } = opts;
|
|
327
310
|
useEffect(() => {
|
|
328
|
-
if (!isOpen || onClose === null)
|
|
329
|
-
return;
|
|
311
|
+
if (!isOpen || onClose === null) return;
|
|
330
312
|
let onScroll = (e) => {
|
|
331
313
|
let target = e.target;
|
|
332
|
-
if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current))
|
|
333
|
-
return;
|
|
314
|
+
if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
|
|
334
315
|
let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
|
|
335
|
-
if (onCloseHandler)
|
|
336
|
-
onCloseHandler();
|
|
316
|
+
if (onCloseHandler) onCloseHandler();
|
|
337
317
|
};
|
|
338
318
|
window.addEventListener("scroll", onScroll, true);
|
|
339
319
|
return () => {
|
|
@@ -375,16 +355,13 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
375
355
|
];
|
|
376
356
|
let lastScale = useRef($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale);
|
|
377
357
|
useEffect(() => {
|
|
378
|
-
if (isOpen)
|
|
379
|
-
lastScale.current = $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale;
|
|
358
|
+
if (isOpen) lastScale.current = $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale;
|
|
380
359
|
}, [
|
|
381
360
|
isOpen
|
|
382
361
|
]);
|
|
383
362
|
let updatePosition = useCallback(() => {
|
|
384
|
-
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement)
|
|
385
|
-
|
|
386
|
-
if (($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale) !== lastScale.current)
|
|
387
|
-
return;
|
|
363
|
+
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) return;
|
|
364
|
+
if (($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale) !== lastScale.current) return;
|
|
388
365
|
let overlay = overlayRef.current;
|
|
389
366
|
if (!maxHeight && overlayRef.current) {
|
|
390
367
|
var _window_visualViewport;
|
|
@@ -431,8 +408,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
431
408
|
updatePosition();
|
|
432
409
|
};
|
|
433
410
|
let onScroll = () => {
|
|
434
|
-
if (isResizing.current)
|
|
435
|
-
onResize();
|
|
411
|
+
if (isResizing.current) onResize();
|
|
436
412
|
};
|
|
437
413
|
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("resize", onResize);
|
|
438
414
|
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("scroll", onScroll);
|
|
@@ -444,8 +420,7 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
444
420
|
updatePosition
|
|
445
421
|
]);
|
|
446
422
|
let close = useCallback(() => {
|
|
447
|
-
if (!isResizing.current)
|
|
448
|
-
onClose();
|
|
423
|
+
if (!isResizing.current) onClose();
|
|
449
424
|
}, [
|
|
450
425
|
onClose,
|
|
451
426
|
isResizing
|
|
@@ -487,8 +462,7 @@ function $2a41e45df1593e64$var$useResize(onResize) {
|
|
|
487
462
|
]);
|
|
488
463
|
}
|
|
489
464
|
function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
490
|
-
if (direction === "rtl")
|
|
491
|
-
return position.replace("start", "right").replace("end", "left");
|
|
465
|
+
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
492
466
|
return position.replace("start", "left").replace("end", "right");
|
|
493
467
|
}
|
|
494
468
|
const $f57aed4a881a3485$var$Context = /* @__PURE__ */ React__default.createContext(null);
|
|
@@ -501,13 +475,11 @@ function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
|
501
475
|
modalCount,
|
|
502
476
|
addModal() {
|
|
503
477
|
setModalCount((count) => count + 1);
|
|
504
|
-
if (parent)
|
|
505
|
-
parent.addModal();
|
|
478
|
+
if (parent) parent.addModal();
|
|
506
479
|
},
|
|
507
480
|
removeModal() {
|
|
508
481
|
setModalCount((count) => count - 1);
|
|
509
|
-
if (parent)
|
|
510
|
-
parent.removeModal();
|
|
482
|
+
if (parent) parent.removeModal();
|
|
511
483
|
}
|
|
512
484
|
}), [
|
|
513
485
|
parent,
|
|
@@ -540,13 +512,11 @@ function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
|
540
512
|
let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
|
|
541
513
|
let { portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
542
514
|
React__default.useEffect(() => {
|
|
543
|
-
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]"))
|
|
544
|
-
throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
515
|
+
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
545
516
|
}, [
|
|
546
517
|
portalContainer
|
|
547
518
|
]);
|
|
548
|
-
if (!portalContainer)
|
|
549
|
-
return null;
|
|
519
|
+
if (!portalContainer) return null;
|
|
550
520
|
let contents = /* @__PURE__ */ React__default.createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
|
|
551
521
|
return /* @__PURE__ */ $dbSRa$reactdom.createPortal(contents, portalContainer);
|
|
552
522
|
}
|
|
@@ -570,12 +540,10 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
570
540
|
let isHovered = useRef(false);
|
|
571
541
|
let isFocused = useRef(false);
|
|
572
542
|
let handleShow = () => {
|
|
573
|
-
if (isHovered.current || isFocused.current)
|
|
574
|
-
state.open(isFocused.current);
|
|
543
|
+
if (isHovered.current || isFocused.current) state.open(isFocused.current);
|
|
575
544
|
};
|
|
576
545
|
let handleHide = (immediate) => {
|
|
577
|
-
if (!isHovered.current && !isFocused.current)
|
|
578
|
-
state.close(immediate);
|
|
546
|
+
if (!isHovered.current && !isFocused.current) state.close(immediate);
|
|
579
547
|
};
|
|
580
548
|
useEffect(() => {
|
|
581
549
|
let onKeyDown = (e) => {
|
|
@@ -597,17 +565,13 @@ function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
|
|
|
597
565
|
state
|
|
598
566
|
]);
|
|
599
567
|
let onHoverStart = () => {
|
|
600
|
-
if (trigger === "focus")
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
isHovered.current = true;
|
|
604
|
-
else
|
|
605
|
-
isHovered.current = false;
|
|
568
|
+
if (trigger === "focus") return;
|
|
569
|
+
if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "pointer") isHovered.current = true;
|
|
570
|
+
else isHovered.current = false;
|
|
606
571
|
handleShow();
|
|
607
572
|
};
|
|
608
573
|
let onHoverEnd = () => {
|
|
609
|
-
if (trigger === "focus")
|
|
610
|
-
return;
|
|
574
|
+
if (trigger === "focus") return;
|
|
611
575
|
isFocused.current = false;
|
|
612
576
|
isHovered.current = false;
|
|
613
577
|
handleHide();
|
|
@@ -694,11 +658,10 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
694
658
|
$8796f90736e175cb$var$tooltips[id] = hideTooltip;
|
|
695
659
|
};
|
|
696
660
|
let closeOpenTooltips = () => {
|
|
697
|
-
for (let hideTooltipId in $8796f90736e175cb$var$tooltips)
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
661
|
+
for (let hideTooltipId in $8796f90736e175cb$var$tooltips) if (hideTooltipId !== id) {
|
|
662
|
+
$8796f90736e175cb$var$tooltips[hideTooltipId](true);
|
|
663
|
+
delete $8796f90736e175cb$var$tooltips[hideTooltipId];
|
|
664
|
+
}
|
|
702
665
|
};
|
|
703
666
|
let showTooltip = () => {
|
|
704
667
|
clearTimeout(closeTimeout.current);
|
|
@@ -721,18 +684,16 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
721
684
|
clearTimeout(closeTimeout.current);
|
|
722
685
|
closeTimeout.current = null;
|
|
723
686
|
close();
|
|
724
|
-
} else if (!closeTimeout.current)
|
|
725
|
-
closeTimeout.current =
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}, closeDelay);
|
|
687
|
+
} else if (!closeTimeout.current) closeTimeout.current = setTimeout(() => {
|
|
688
|
+
closeTimeout.current = null;
|
|
689
|
+
close();
|
|
690
|
+
}, closeDelay);
|
|
729
691
|
if ($8796f90736e175cb$var$globalWarmUpTimeout) {
|
|
730
692
|
clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout);
|
|
731
693
|
$8796f90736e175cb$var$globalWarmUpTimeout = null;
|
|
732
694
|
}
|
|
733
695
|
if ($8796f90736e175cb$var$globalWarmedUp) {
|
|
734
|
-
if ($8796f90736e175cb$var$globalCooldownTimeout)
|
|
735
|
-
clearTimeout($8796f90736e175cb$var$globalCooldownTimeout);
|
|
696
|
+
if ($8796f90736e175cb$var$globalCooldownTimeout) clearTimeout($8796f90736e175cb$var$globalCooldownTimeout);
|
|
736
697
|
$8796f90736e175cb$var$globalCooldownTimeout = setTimeout(() => {
|
|
737
698
|
delete $8796f90736e175cb$var$tooltips[id];
|
|
738
699
|
$8796f90736e175cb$var$globalCooldownTimeout = null;
|
|
@@ -743,21 +704,18 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
743
704
|
let warmupTooltip = () => {
|
|
744
705
|
closeOpenTooltips();
|
|
745
706
|
ensureTooltipEntry();
|
|
746
|
-
if (!isOpen && !$8796f90736e175cb$var$globalWarmUpTimeout && !$8796f90736e175cb$var$globalWarmedUp)
|
|
747
|
-
$8796f90736e175cb$var$globalWarmUpTimeout =
|
|
748
|
-
|
|
749
|
-
$8796f90736e175cb$var$globalWarmedUp = true;
|
|
750
|
-
showTooltip();
|
|
751
|
-
}, delay);
|
|
752
|
-
else if (!isOpen)
|
|
707
|
+
if (!isOpen && !$8796f90736e175cb$var$globalWarmUpTimeout && !$8796f90736e175cb$var$globalWarmedUp) $8796f90736e175cb$var$globalWarmUpTimeout = setTimeout(() => {
|
|
708
|
+
$8796f90736e175cb$var$globalWarmUpTimeout = null;
|
|
709
|
+
$8796f90736e175cb$var$globalWarmedUp = true;
|
|
753
710
|
showTooltip();
|
|
711
|
+
}, delay);
|
|
712
|
+
else if (!isOpen) showTooltip();
|
|
754
713
|
};
|
|
755
714
|
useEffect(() => {
|
|
756
715
|
return () => {
|
|
757
716
|
clearTimeout(closeTimeout.current);
|
|
758
717
|
let tooltip = $8796f90736e175cb$var$tooltips[id];
|
|
759
|
-
if (tooltip)
|
|
760
|
-
delete $8796f90736e175cb$var$tooltips[id];
|
|
718
|
+
if (tooltip) delete $8796f90736e175cb$var$tooltips[id];
|
|
761
719
|
};
|
|
762
720
|
}, [
|
|
763
721
|
id
|
|
@@ -765,10 +723,8 @@ function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
|
|
|
765
723
|
return {
|
|
766
724
|
isOpen,
|
|
767
725
|
open: (immediate) => {
|
|
768
|
-
if (!immediate && delay > 0 && !closeTimeout.current)
|
|
769
|
-
|
|
770
|
-
else
|
|
771
|
-
showTooltip();
|
|
726
|
+
if (!immediate && delay > 0 && !closeTimeout.current) warmupTooltip();
|
|
727
|
+
else showTooltip();
|
|
772
728
|
},
|
|
773
729
|
close: hideTooltip
|
|
774
730
|
};
|
|
@@ -791,8 +747,7 @@ function $44f671af83e7d9e0$var$OverlayArrow(props, ref) {
|
|
|
791
747
|
placement
|
|
792
748
|
}
|
|
793
749
|
});
|
|
794
|
-
if (renderProps.style)
|
|
795
|
-
Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]);
|
|
750
|
+
if (renderProps.style) Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]);
|
|
796
751
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
797
752
|
...props,
|
|
798
753
|
...renderProps,
|
|
@@ -836,8 +791,7 @@ function $4e3b923658d69c60$var$Tooltip({ UNSTABLE_portalContainer, ...props }, r
|
|
|
836
791
|
let localState = $8796f90736e175cb$export$4d40659c25ecb50b(props);
|
|
837
792
|
let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
|
|
838
793
|
let isExiting = $64fa3d84918910a7$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
|
|
839
|
-
if (!state.isOpen && !isExiting)
|
|
840
|
-
return null;
|
|
794
|
+
if (!state.isOpen && !isExiting) return null;
|
|
841
795
|
return /* @__PURE__ */ React__default.createElement($f57aed4a881a3485$export$b47c3594eab58386, {
|
|
842
796
|
portalContainer: UNSTABLE_portalContainer
|
|
843
797
|
}, /* @__PURE__ */ React__default.createElement($4e3b923658d69c60$var$TooltipInner, {
|
|
@@ -852,8 +806,7 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
852
806
|
let arrowRef = useRef(null);
|
|
853
807
|
let [arrowWidth, setArrowWidth] = useState(0);
|
|
854
808
|
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
855
|
-
if (arrowRef.current && state.isOpen)
|
|
856
|
-
setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
809
|
+
if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
857
810
|
}, [
|
|
858
811
|
state.isOpen,
|
|
859
812
|
arrowRef
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
2
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-
|
|
3
|
-
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "./useFocusable-
|
|
4
|
-
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-
|
|
1
|
+
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-Dc35LwuT.js";
|
|
2
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
3
|
+
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "./useFocusable-CLmhO94g.js";
|
|
4
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-CScNeV3V.js";
|
|
5
5
|
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
6
6
|
let {
|
|
7
7
|
elementType = "button",
|
|
@@ -21,22 +21,20 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
21
21
|
type = "button"
|
|
22
22
|
} = props;
|
|
23
23
|
let additionalProps;
|
|
24
|
-
if (elementType === "button")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
rel: elementType === "a" ? rel : void 0
|
|
39
|
-
};
|
|
24
|
+
if (elementType === "button") additionalProps = {
|
|
25
|
+
type,
|
|
26
|
+
disabled: isDisabled
|
|
27
|
+
};
|
|
28
|
+
else additionalProps = {
|
|
29
|
+
role: "button",
|
|
30
|
+
tabIndex: isDisabled ? void 0 : 0,
|
|
31
|
+
href: elementType === "a" && isDisabled ? void 0 : href,
|
|
32
|
+
target: elementType === "a" ? target : void 0,
|
|
33
|
+
type: elementType === "input" ? type : void 0,
|
|
34
|
+
disabled: elementType === "input" ? isDisabled : void 0,
|
|
35
|
+
"aria-disabled": !isDisabled || elementType === "input" ? void 0 : isDisabled,
|
|
36
|
+
rel: elementType === "a" ? rel : void 0
|
|
37
|
+
};
|
|
40
38
|
let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
|
|
41
39
|
onPressStart,
|
|
42
40
|
onPressEnd,
|
|
@@ -48,8 +46,7 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
48
46
|
ref
|
|
49
47
|
});
|
|
50
48
|
let { focusableProps } = $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, ref);
|
|
51
|
-
if (allowFocusWhenDisabled)
|
|
52
|
-
focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
|
|
49
|
+
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
|
|
53
50
|
let buttonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, pressProps, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
54
51
|
labelable: true
|
|
55
52
|
}));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-
|
|
1
|
+
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-Dc35LwuT.js";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
|
|
4
4
|
let handleEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(handler);
|
|
5
5
|
let isDisabled = handler == null;
|
|
6
6
|
useEffect(() => {
|
|
7
|
-
if (isDisabled || !ref.current)
|
|
8
|
-
return;
|
|
7
|
+
if (isDisabled || !ref.current) return;
|
|
9
8
|
let element = ref.current;
|
|
10
9
|
element.addEventListener(event, handleEvent, options);
|
|
11
10
|
return () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as $507fabe10e71c6fb$export$b9b3dfddab17db27, b as $507fabe10e71c6fb$export$ec71b4b83ac08ec3, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-
|
|
1
|
+
import { a as $507fabe10e71c6fb$export$b9b3dfddab17db27, b as $507fabe10e71c6fb$export$ec71b4b83ac08ec3, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, d as $9ab94262bd0047c7$export$420e68273165f4ec } from "./focusSafely-BS4dllCW.js";
|
|
2
2
|
import { useRef, useState, useCallback } from "react";
|
|
3
3
|
function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
4
4
|
let { autoFocus = false, isTextInput, within } = props;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, h as $6a99195332edec8b$export$80f3e147d781571c, l as $e7801be82b4b2a53$export$4debdb1a3f0fa79e } from "./focusSafely-
|
|
2
|
-
import { l as $df56164dff5785e2$export$4338b53315abf666, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
1
|
+
import { c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, h as $6a99195332edec8b$export$80f3e147d781571c, l as $e7801be82b4b2a53$export$4debdb1a3f0fa79e } from "./focusSafely-BS4dllCW.js";
|
|
2
|
+
import { l as $df56164dff5785e2$export$4338b53315abf666, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-Dc35LwuT.js";
|
|
3
3
|
import React__default, { useRef, useEffect, useContext } from "react";
|
|
4
4
|
function $93925083ecbb358c$export$48d1ea6320830260(handler) {
|
|
5
|
-
if (!handler)
|
|
6
|
-
return void 0;
|
|
5
|
+
if (!handler) return void 0;
|
|
7
6
|
let shouldStopPropagation = true;
|
|
8
7
|
return (e) => {
|
|
9
8
|
let event = {
|
|
@@ -22,8 +21,7 @@ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
|
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
handler(event);
|
|
25
|
-
if (shouldStopPropagation)
|
|
26
|
-
e.stopPropagation();
|
|
24
|
+
if (shouldStopPropagation) e.stopPropagation();
|
|
27
25
|
};
|
|
28
26
|
}
|
|
29
27
|
function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
|
|
@@ -61,8 +59,7 @@ function $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, domRef) {
|
|
|
61
59
|
let interactionProps = props.isDisabled ? {} : domProps;
|
|
62
60
|
let autoFocusRef = useRef(props.autoFocus);
|
|
63
61
|
useEffect(() => {
|
|
64
|
-
if (autoFocusRef.current && domRef.current)
|
|
65
|
-
$6a99195332edec8b$export$80f3e147d781571c(domRef.current);
|
|
62
|
+
if (autoFocusRef.current && domRef.current) $6a99195332edec8b$export$80f3e147d781571c(domRef.current);
|
|
66
63
|
autoFocusRef.current = false;
|
|
67
64
|
}, [
|
|
68
65
|
domRef
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-
|
|
1
|
+
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-Dc35LwuT.js";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
3
|
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
4
4
|
let resetValue = useRef(initialValue);
|
|
5
5
|
let handleReset = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
6
|
-
if (onReset)
|
|
7
|
-
onReset(resetValue.current);
|
|
6
|
+
if (onReset) onReset(resetValue.current);
|
|
8
7
|
});
|
|
9
8
|
useEffect(() => {
|
|
10
9
|
var _ref_current;
|