@eightshift/ui-components 7.2.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete-pLMPWMFq.js +451 -0
- package/dist/Button-Biwg7zwt.js +223 -0
- package/dist/Dialog-C1sh8jbh.js +2474 -0
- package/dist/{Disclosure-NYWFw9RJ.js → Disclosure-B_SHgiUz.js} +50 -51
- package/dist/FocusScope-lGkM8AO8.js +734 -0
- package/dist/Form-BxIJCHYd.js +5 -0
- package/dist/Heading-B2EsUuu6.js +16 -0
- package/dist/{Hidden-8TB37dpK.js → Hidden-DYY00jLm.js} +10 -10
- package/dist/I18nProvider-Cm6dj5jY.js +93 -0
- package/dist/Label-B1TkoVOG.js +17 -0
- package/dist/ListBox-BquE0m8z.js +584 -0
- package/dist/{NumberFormatter-m5VW6MTK.js → NumberFormatter-JHF0Tadk.js} +24 -26
- package/dist/PortalProvider-BYcv24il.js +13 -0
- package/dist/RadioGroup-BxjLooWU.js +324 -0
- package/dist/SearchField-BkAU0HLm.js +322 -0
- package/dist/SelectionIndicator-Bx_EYBXD.js +13 -0
- package/dist/{Slider-DW1RuMVp.js → Slider-DSv6fyZ6.js} +321 -363
- package/dist/Text-C8pfwn0W.js +16 -0
- package/dist/{VisuallyHidden-CfsnJHZb.js → VisuallyHidden-KcXlGa5p.js} +12 -12
- package/dist/{animation-Bd2peown.js → animation-BJ-2VKdB.js} +12 -12
- package/dist/assets/style-admin.css +1 -1
- package/dist/assets/style-editor.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/{button-D9cbyHeZ.js → button-CawAzlko.js} +21 -73
- package/dist/{checkbox-BO5RZmO8.js → checkbox-t7VrqXv2.js} +59 -62
- package/dist/{color-swatch-D2ZBkuTt.js → color-swatch-gU09x9Ga.js} +417 -414
- package/dist/components/base-control/base-control.js +2 -2
- package/dist/components/base-control/container.js +1 -1
- package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +2 -2
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +4 -4
- package/dist/components/container-panel/container-panel.js +5 -5
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +1 -1
- 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 +7 -7
- package/dist/components/index.js +15 -15
- package/dist/components/input-field/input-field.js +1 -1
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +1 -1
- package/dist/components/matrix-align/matrix-align.js +5 -5
- package/dist/components/menu/menu.js +11 -11
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/number-picker/number-picker.js +1 -1
- package/dist/components/option-select/option-select.js +3 -3
- package/dist/components/options-panel/options-panel.js +3 -3
- package/dist/components/placeholders/file-picker-shell.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +6 -6
- package/dist/components/portal-provider/portal-provider.js +2 -2
- package/dist/components/radio/radio.js +9 -9
- package/dist/components/repeater/repeater-item.js +2 -2
- package/dist/components/repeater/repeater.js +3 -3
- package/dist/components/responsive/mini-responsive.js +6 -6
- package/dist/components/responsive/responsive-legacy.js +5 -5
- package/dist/components/responsive/responsive.js +5 -5
- package/dist/components/responsive-preview/responsive-preview.js +2 -2
- package/dist/components/select/async-multi-select.js +27 -26
- package/dist/components/select/async-select.js +27 -26
- package/dist/components/select/multi-select.js +33 -32
- package/dist/components/select/shared.js +1 -1
- package/dist/components/select/single-select.js +33 -32
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +8 -8
- package/dist/components/slider/slider.js +8 -8
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/smart-image/smart-image.js +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toggle/switch.js +1 -1
- package/dist/components/toggle/toggle.js +3 -3
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/{draggable-CTDVJ4zd.js → draggable-Cxv-OueQ.js} +1 -1
- package/dist/filterDOMProps-BfW758QC.js +69 -0
- package/dist/{gradient-editor-CD5Sho6A.js → gradient-editor-CInqVF8v.js} +6 -6
- package/dist/icons/index.js +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +15 -15
- package/dist/{input-field-_OCWbftf.js → input-field-BdFrxQ-R.js} +46 -47
- package/dist/keyboard-CT41mQzR.js +55 -0
- package/dist/{link-input-BnjtzMbF.js → link-input-BDFhSSvH.js} +324 -356
- package/dist/{modal-snrElwty.js → modal-CJDaBdPh.js} +100 -92
- package/dist/{number-ZZIxJukn.js → number-MWRvGfyE.js} +10 -10
- package/dist/{number-picker-Dhtx4409.js → number-picker-BrxrB-xq.js} +43 -42
- package/dist/{shared-BpAYSi3F.js → shared-CI4kcnm8.js} +482 -502
- package/dist/{smart-image-CBNbxJ57.js → smart-image-eGdMu9s9.js} +2 -2
- package/dist/{solid-color-picker-DukArNH-.js → solid-color-picker-DXgX-OAm.js} +926 -935
- package/dist/{switch-DmsvyQPa.js → switch-DNHFoCCx.js} +28 -28
- package/dist/{tabs-Cy6gB0RL.js → tabs-C2tPOEYr.js} +145 -149
- package/dist/textSelection-BhX_2zV9.js +45 -0
- package/dist/{toggle-button-BlzUGfGy.js → toggle-button-DYDp11rq.js} +35 -35
- package/dist/{tooltip-BzJzYlcc.js → tooltip-C-hT6tN9.js} +162 -162
- package/dist/{useAsyncList-BNzwKoX4.js → useAsyncList-DsOh1xIx.js} +54 -74
- package/dist/{useButton-ra1ZSZ4z.js → useButton-BMZc4fTX.js} +11 -11
- package/dist/{SelectionManager-B8lLv6Ue.js → useCollection-CBVYSuGz.js} +1689 -1777
- package/dist/{useEvent-DkZVfgsS.js → useEvent-ypAU33vv.js} +5 -5
- package/dist/useField-BXf__jxy.js +32 -0
- package/dist/{useFilter-OiMnf6sb.js → useFilter-CfKEbIwL.js} +5 -5
- package/dist/{useFocusRing-DuYL4cdO.js → useFocusRing-BgYY-7ko.js} +23 -23
- package/dist/useFormReset-BuMc_O4y.js +17 -0
- package/dist/{FieldError-BWDbP5Db.js → useFormValidation-BcME9D0E.js} +63 -66
- package/dist/useHover-lyApu3ba.js +975 -0
- package/dist/{useLabel-2EohW5l6.js → useLabel-Rv8cIIKk.js} +8 -8
- package/dist/{useLabels-B2p7RXi5.js → useLabels-xOYtkA8o.js} +5 -5
- package/dist/useListState-u6DfeXHi.js +135 -0
- package/dist/{useLocalizedStringFormatter-Dv2diN3k.js → useLocalizedStringFormatter-CR-bmorj.js} +45 -45
- package/dist/{useNumberField-2xbi3jRV.js → useNumberFieldState-xL-ecwNz.js} +665 -619
- package/dist/useNumberFormatter-CR1PAFPG.js +10 -0
- package/dist/useOverlayTriggerState-AeCx45Gv.js +551 -0
- package/dist/usePress-Dnx5rBoD.js +593 -0
- package/dist/useTextField-BW3ZwGyz.js +159 -0
- package/dist/{useToggle-ecIirvIM.js → useToggle-BF5wptMP.js} +19 -20
- package/dist/useToggleState-D5P01lch.js +22 -0
- package/dist/useToolbar-BT25-MJg.js +55 -0
- package/dist/utilities/debounce-throttle.js +1 -1
- package/dist/utilities/es-dash.js +1 -1
- package/dist/utilities/index.js +3 -3
- package/dist/{utils-B_uiqNa4.js → utils-JFcCNFzy.js} +121 -122
- package/package.json +13 -13
- package/dist/Button-h6xF_WrP.js +0 -225
- package/dist/Dialog-i5VLQw1o.js +0 -2488
- package/dist/FocusScope-CgwbGOBB.js +0 -746
- package/dist/Form-DTMkbrQY.js +0 -5
- package/dist/Heading-Hol-wS_B.js +0 -16
- package/dist/Input-BURqyJXW.js +0 -161
- package/dist/Label-DFXXxMKY.js +0 -17
- package/dist/ListBox-BHUJxpwh.js +0 -600
- package/dist/OverlayArrow-BoloUPQM.js +0 -573
- package/dist/PortalProvider-DinZZCKX.js +0 -14
- package/dist/RSPContexts-C_z0bI8W.js +0 -12
- package/dist/RadioGroup-BwlGtCja.js +0 -329
- package/dist/SearchField-Cm1i5mLj.js +0 -764
- package/dist/SelectionIndicator-31L6EI9F.js +0 -13
- package/dist/Text-O6VBBDlP.js +0 -16
- package/dist/context-C-XNeJ_l.js +0 -93
- package/dist/filterDOMProps-_2_3GD-K.js +0 -69
- package/dist/textSelection-Dv6WPj0Z.js +0 -45
- package/dist/useField-D0WrzR2F.js +0 -32
- package/dist/useFormReset-DdkykzAn.js +0 -18
- package/dist/useHover-qaMm3XFO.js +0 -982
- package/dist/useListState-CD_5vfyy.js +0 -147
- package/dist/useNumberFormatter-C2Cm2mNj.js +0 -10
- package/dist/usePress-ZP1TjkFf.js +0 -678
- package/dist/useToggleState-IIDbiKPl.js +0 -23
- /package/dist/{List-DWlgW2Ex.js → List---tsVJlI.js} +0 -0
- /package/dist/{build-module-Bsx62nlm.js → build-module-K6vi4xE0.js} +0 -0
- /package/dist/{debounce-throttle-DXxSAKpq.js → debounce-throttle-LSPAPFtq.js} +0 -0
- /package/dist/{dist-2gkv7_1U.js → dist-jw8wvxoG.js} +0 -0
- /package/dist/{es-dash-HqXWZZ3_.js → es-dash-BuShf_ht.js} +0 -0
- /package/dist/{jsx-svg-DgKbriN1.js → jsx-svg-DT1SBWuP.js} +0 -0
- /package/dist/{utilities-lwX686oD.js → utilities-DV0KKJNR.js} +0 -0
package/dist/Button-h6xF_WrP.js
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { i as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, m as $bdb11010cef70236$export$f680877a34711e37, n as $64fa3d84918910a7$export$29f1550f4b0d4415, o as $64fa3d84918910a7$export$df3a06d6289f983e, r as $64fa3d84918910a7$export$4d86445c2cf5e3, u as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B_uiqNa4.js";
|
|
2
|
-
import { t as $6179b936705e76d3$export$ae780daf29e6d456 } from "./useHover-qaMm3XFO.js";
|
|
3
|
-
import { t as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-_2_3GD-K.js";
|
|
4
|
-
import { t as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-ZZIxJukn.js";
|
|
5
|
-
import { t as $a916eb452884faea$export$b7a616150fdb9f44 } from "./useNumberFormatter-C2Cm2mNj.js";
|
|
6
|
-
import { t as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-DuYL4cdO.js";
|
|
7
|
-
import { t as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-2EohW5l6.js";
|
|
8
|
-
import { t as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-8TB37dpK.js";
|
|
9
|
-
import { t as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-ra1ZSZ4z.js";
|
|
10
|
-
import { t as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-DFXXxMKY.js";
|
|
11
|
-
import React, { createContext, forwardRef, useEffect, useRef } from "react";
|
|
12
|
-
//#region node_modules/@react-aria/live-announcer/dist/LiveAnnouncer.mjs
|
|
13
|
-
var $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
14
|
-
var $319e236875307eab$var$liveAnnouncer = null;
|
|
15
|
-
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
16
|
-
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
17
|
-
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
18
|
-
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
19
|
-
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 || $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
20
|
-
}, 100);
|
|
21
|
-
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
22
|
-
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
23
|
-
}
|
|
24
|
-
function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
|
|
25
|
-
if ($319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
|
|
26
|
-
}
|
|
27
|
-
var $319e236875307eab$var$LiveAnnouncer = class {
|
|
28
|
-
isAttached() {
|
|
29
|
-
var _this_node;
|
|
30
|
-
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
31
|
-
}
|
|
32
|
-
createLog(ariaLive) {
|
|
33
|
-
let node = document.createElement("div");
|
|
34
|
-
node.setAttribute("role", "log");
|
|
35
|
-
node.setAttribute("aria-live", ariaLive);
|
|
36
|
-
node.setAttribute("aria-relevant", "additions");
|
|
37
|
-
return node;
|
|
38
|
-
}
|
|
39
|
-
destroy() {
|
|
40
|
-
if (!this.node) return;
|
|
41
|
-
document.body.removeChild(this.node);
|
|
42
|
-
this.node = null;
|
|
43
|
-
}
|
|
44
|
-
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
45
|
-
var _this_assertiveLog, _this_politeLog;
|
|
46
|
-
if (!this.node) return;
|
|
47
|
-
let node = document.createElement("div");
|
|
48
|
-
if (typeof message === "object") {
|
|
49
|
-
node.setAttribute("role", "img");
|
|
50
|
-
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
51
|
-
} else node.textContent = message;
|
|
52
|
-
if (assertiveness === "assertive") (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 || _this_assertiveLog.appendChild(node);
|
|
53
|
-
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 || _this_politeLog.appendChild(node);
|
|
54
|
-
if (message !== "") setTimeout(() => {
|
|
55
|
-
node.remove();
|
|
56
|
-
}, timeout);
|
|
57
|
-
}
|
|
58
|
-
clear(assertiveness) {
|
|
59
|
-
if (!this.node) return;
|
|
60
|
-
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
61
|
-
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
62
|
-
}
|
|
63
|
-
constructor() {
|
|
64
|
-
this.node = null;
|
|
65
|
-
this.assertiveLog = null;
|
|
66
|
-
this.politeLog = null;
|
|
67
|
-
if (typeof document !== "undefined") {
|
|
68
|
-
this.node = document.createElement("div");
|
|
69
|
-
this.node.dataset.liveAnnouncer = "true";
|
|
70
|
-
Object.assign(this.node.style, {
|
|
71
|
-
border: 0,
|
|
72
|
-
clip: "rect(0 0 0 0)",
|
|
73
|
-
clipPath: "inset(50%)",
|
|
74
|
-
height: "1px",
|
|
75
|
-
margin: "-1px",
|
|
76
|
-
overflow: "hidden",
|
|
77
|
-
padding: 0,
|
|
78
|
-
position: "absolute",
|
|
79
|
-
width: "1px",
|
|
80
|
-
whiteSpace: "nowrap"
|
|
81
|
-
});
|
|
82
|
-
this.assertiveLog = this.createLog("assertive");
|
|
83
|
-
this.node.appendChild(this.assertiveLog);
|
|
84
|
-
this.politeLog = this.createLog("polite");
|
|
85
|
-
this.node.appendChild(this.politeLog);
|
|
86
|
-
document.body.prepend(this.node);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region node_modules/@react-aria/progress/dist/useProgressBar.mjs
|
|
92
|
-
function $204d9ebcedfb8806$export$ed5abd763a836edc(props) {
|
|
93
|
-
let { value = 0, minValue = 0, maxValue = 100, valueLabel, isIndeterminate, formatOptions = { style: "percent" } } = props;
|
|
94
|
-
let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { labelable: true });
|
|
95
|
-
let { labelProps, fieldProps } = $d191a55c9702f145$export$8467354a121f1b9f({
|
|
96
|
-
...props,
|
|
97
|
-
labelElementType: "span"
|
|
98
|
-
});
|
|
99
|
-
value = $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, minValue, maxValue);
|
|
100
|
-
let percentage = (value - minValue) / (maxValue - minValue);
|
|
101
|
-
let formatter = $a916eb452884faea$export$b7a616150fdb9f44(formatOptions);
|
|
102
|
-
if (!isIndeterminate && !valueLabel) {
|
|
103
|
-
let valueToFormat = formatOptions.style === "percent" ? percentage : value;
|
|
104
|
-
valueLabel = formatter.format(valueToFormat);
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
progressBarProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, {
|
|
108
|
-
...fieldProps,
|
|
109
|
-
"aria-valuenow": isIndeterminate ? void 0 : value,
|
|
110
|
-
"aria-valuemin": minValue,
|
|
111
|
-
"aria-valuemax": maxValue,
|
|
112
|
-
"aria-valuetext": isIndeterminate ? void 0 : valueLabel,
|
|
113
|
-
role: "progressbar"
|
|
114
|
-
}),
|
|
115
|
-
labelProps
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region node_modules/react-aria-components/dist/ProgressBar.mjs
|
|
120
|
-
var $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = createContext(null);
|
|
121
|
-
var $0393f8ab869a0f1a$export$c17561cb55d4db30 = forwardRef(function ProgressBar(props, ref) {
|
|
122
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $0393f8ab869a0f1a$export$e9f3bf65a26ce129);
|
|
123
|
-
let { value = 0, minValue = 0, maxValue = 100, isIndeterminate = false } = props;
|
|
124
|
-
value = $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, minValue, maxValue);
|
|
125
|
-
let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
126
|
-
let { progressBarProps, labelProps } = $204d9ebcedfb8806$export$ed5abd763a836edc({
|
|
127
|
-
...props,
|
|
128
|
-
label
|
|
129
|
-
});
|
|
130
|
-
let percentage = isIndeterminate ? void 0 : (value - minValue) / (maxValue - minValue) * 100;
|
|
131
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
132
|
-
...props,
|
|
133
|
-
defaultClassName: "react-aria-ProgressBar",
|
|
134
|
-
values: {
|
|
135
|
-
percentage,
|
|
136
|
-
valueText: progressBarProps["aria-valuetext"],
|
|
137
|
-
isIndeterminate
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { global: true });
|
|
141
|
-
return React.createElement($64fa3d84918910a7$export$df3a06d6289f983e.div, {
|
|
142
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, progressBarProps),
|
|
143
|
-
ref,
|
|
144
|
-
slot: props.slot || void 0
|
|
145
|
-
}, React.createElement($01b77f81d0f07f68$export$75b6ee27786ba447.Provider, { value: {
|
|
146
|
-
...labelProps,
|
|
147
|
-
ref: labelRef,
|
|
148
|
-
elementType: "span"
|
|
149
|
-
} }, renderProps.children));
|
|
150
|
-
});
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region node_modules/react-aria-components/dist/Button.mjs
|
|
153
|
-
var $d2b4bc8c273e7be6$export$24d547caef80ccd1 = createContext({});
|
|
154
|
-
var $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = $f39a9eba43920ace$export$86427a43e3e48ebb(function Button(props, ref) {
|
|
155
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
156
|
-
let ctx = props;
|
|
157
|
-
let { isPending } = ctx;
|
|
158
|
-
let { buttonProps, isPressed } = $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref);
|
|
159
|
-
buttonProps = $d2b4bc8c273e7be6$var$useDisableInteractions(buttonProps, isPending);
|
|
160
|
-
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
161
|
-
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
162
|
-
...props,
|
|
163
|
-
isDisabled: props.isDisabled || isPending
|
|
164
|
-
});
|
|
165
|
-
let renderValues = {
|
|
166
|
-
isHovered,
|
|
167
|
-
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
168
|
-
isFocused,
|
|
169
|
-
isFocusVisible,
|
|
170
|
-
isDisabled: props.isDisabled || false,
|
|
171
|
-
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
172
|
-
};
|
|
173
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
174
|
-
...props,
|
|
175
|
-
values: renderValues,
|
|
176
|
-
defaultClassName: "react-aria-Button"
|
|
177
|
-
});
|
|
178
|
-
let buttonId = $bdb11010cef70236$export$f680877a34711e37(buttonProps.id);
|
|
179
|
-
let progressId = $bdb11010cef70236$export$f680877a34711e37();
|
|
180
|
-
let ariaLabelledby = buttonProps["aria-labelledby"];
|
|
181
|
-
if (isPending) {
|
|
182
|
-
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
183
|
-
else if (buttonProps["aria-label"]) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
184
|
-
}
|
|
185
|
-
let wasPending = useRef(isPending);
|
|
186
|
-
useEffect(() => {
|
|
187
|
-
let message = { "aria-labelledby": ariaLabelledby || buttonId };
|
|
188
|
-
if (!wasPending.current && isFocused && isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
189
|
-
else if (wasPending.current && isFocused && !isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
190
|
-
wasPending.current = isPending;
|
|
191
|
-
}, [
|
|
192
|
-
isPending,
|
|
193
|
-
isFocused,
|
|
194
|
-
ariaLabelledby,
|
|
195
|
-
buttonId
|
|
196
|
-
]);
|
|
197
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { global: true });
|
|
198
|
-
delete DOMProps.onClick;
|
|
199
|
-
return React.createElement($64fa3d84918910a7$export$df3a06d6289f983e.button, {
|
|
200
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
201
|
-
type: buttonProps.type === "submit" && isPending ? "button" : buttonProps.type,
|
|
202
|
-
id: buttonId,
|
|
203
|
-
ref,
|
|
204
|
-
"aria-labelledby": ariaLabelledby,
|
|
205
|
-
slot: props.slot || void 0,
|
|
206
|
-
"aria-disabled": isPending ? "true" : buttonProps["aria-disabled"],
|
|
207
|
-
"data-disabled": props.isDisabled || void 0,
|
|
208
|
-
"data-pressed": renderValues.isPressed || void 0,
|
|
209
|
-
"data-hovered": isHovered || void 0,
|
|
210
|
-
"data-focused": isFocused || void 0,
|
|
211
|
-
"data-pending": isPending || void 0,
|
|
212
|
-
"data-focus-visible": isFocusVisible || void 0
|
|
213
|
-
}, React.createElement($0393f8ab869a0f1a$export$e9f3bf65a26ce129.Provider, { value: { id: progressId } }, renderProps.children));
|
|
214
|
-
});
|
|
215
|
-
var $d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;
|
|
216
|
-
function $d2b4bc8c273e7be6$var$useDisableInteractions(props, isPending) {
|
|
217
|
-
if (isPending) {
|
|
218
|
-
for (const key in props) if (key.startsWith("on") && !$d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN.test(key)) props[key] = void 0;
|
|
219
|
-
props.href = void 0;
|
|
220
|
-
props.target = void 0;
|
|
221
|
-
}
|
|
222
|
-
return props;
|
|
223
|
-
}
|
|
224
|
-
//#endregion
|
|
225
|
-
export { $319e236875307eab$export$d10ae4f68404609a as a, $319e236875307eab$export$a9b970dcc4ae71a9 as i, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as n, $0393f8ab869a0f1a$export$c17561cb55d4db30 as r, $d2b4bc8c273e7be6$export$24d547caef80ccd1 as t };
|