@wix/editor-react-components 1.2288.0 → 1.2290.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/site/components/AccordionComponent/component.js +1 -1
- package/dist/site/components/AccordionComponent/manifest.js +1 -1
- package/dist/site/components/AnimatedIcon/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +14 -1112
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/BoxContainer/component.js +1 -1
- package/dist/site/components/BoxContainer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +3 -117
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/Button/manifest.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/site/components/DatePicker/DatePicker.types.d.ts +91 -0
- package/dist/site/components/DatePicker/component.d.ts +2 -0
- package/dist/site/components/DatePicker/component.js +5644 -0
- package/dist/site/components/DatePicker/component.preview.d.ts +2 -0
- package/dist/site/components/DatePicker/components/DatePickerCalendar.d.ts +5 -0
- package/dist/site/components/DatePicker/components/DatePickerField.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerLabel.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerTooltip.d.ts +5 -0
- package/dist/site/components/DatePicker/constants.d.ts +177 -0
- package/dist/site/components/DatePicker/css.css +349 -0
- package/dist/site/components/DatePicker/datePickerUtils.d.ts +26 -0
- package/dist/site/components/DatePicker/hooks/useDateConstraints.d.ts +12 -0
- package/dist/site/components/DatePicker/hooks/useDatePickerValue.d.ts +15 -0
- package/dist/site/components/DatePicker/hooks/useUnavailableDates.d.ts +3 -0
- package/dist/site/components/DatePicker/index.d.ts +2 -0
- package/dist/site/components/DatePicker/index.js +6 -0
- package/dist/site/components/DatePicker/manifest.d.ts +5 -0
- package/dist/site/components/DatePicker/manifest.js +370 -0
- package/dist/site/components/Dropdown/component.js +2 -4
- package/dist/site/components/Dropdown/manifest.js +1 -1
- package/dist/site/components/HTMLComponent/component.js +1 -1
- package/dist/site/components/HipaaIcon/component.js +1 -1
- package/dist/site/components/HipaaIcon/manifest.js +1 -1
- package/dist/site/components/LinkBar/component.js +1 -1
- package/dist/site/components/LinkBar/manifest.js +1 -1
- package/dist/site/components/Logo/component.js +1 -1
- package/dist/site/components/Logo/manifest.js +1 -1
- package/dist/site/components/Logo/sdk.js +1 -1
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Lottie/manifest.js +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/Menu/manifest.js +1 -1
- package/dist/site/components/MultiStateBox/component.js +1 -1
- package/dist/site/components/MultiStateBox/manifest.js +1 -1
- package/dist/site/components/ProgressBar/component.js +1 -1
- package/dist/site/components/ProgressBar/manifest.js +1 -1
- package/dist/site/components/ProgressBar/sdk.js +1 -1
- package/dist/site/components/Repeater/component.js +1 -1
- package/dist/site/components/Repeater/manifest.js +1 -1
- package/dist/site/components/ShareButtons/component.js +1 -1
- package/dist/site/components/ShareButtons/manifest.js +1 -1
- package/dist/site/components/Tabs/component.js +1 -1
- package/dist/site/components/Tabs/manifest.js +1 -1
- package/dist/site/components/TextBox/component.js +2 -5
- package/dist/site/components/TextBox/manifest.js +1 -1
- package/dist/site/components/TextEffects3d/component.js +1 -1
- package/dist/site/components/TextEffects3d/manifest.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlass/component.js +1 -1
- package/dist/site/components/TextEffectsGlass/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlitch/component.js +1 -1
- package/dist/site/components/TextEffectsGlitch/manifest.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/manifest.js +1 -1
- package/dist/site/components/TextEffectsMatrix/component.js +1 -1
- package/dist/site/components/TextEffectsMatrix/manifest.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/manifest.js +1 -1
- package/dist/site/components/TextEffectsNoisy/component.js +1 -1
- package/dist/site/components/TextEffectsNoisy/manifest.js +1 -1
- package/dist/site/components/TextEffectsOutlineOut/component.js +2 -2
- package/dist/site/components/TextEffectsOutlineOut/manifest.js +1 -1
- package/dist/site/components/TextEffectsRetro/component.js +1 -1
- package/dist/site/components/TextEffectsRetro/manifest.js +1 -1
- package/dist/site/components/TextEffectsShook/component.js +1 -1
- package/dist/site/components/TextEffectsShook/manifest.js +1 -1
- package/dist/site/components/TextEffectsSticker/component.js +1 -1
- package/dist/site/components/TextEffectsSticker/manifest.js +2 -2
- package/dist/site/components/TextEffectsStriped/component.js +1 -1
- package/dist/site/components/TextEffectsStriped/manifest.js +1 -1
- package/dist/site/components/TextInput/component.js +173 -465
- package/dist/site/components/TextInput/manifest.js +1 -1
- package/dist/site/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +29 -0
- package/dist/site/components/TimePicker/component.d.ts +2 -0
- package/dist/site/components/TimePicker/component.js +146 -0
- package/dist/site/components/TimePicker/component.preview.d.ts +2 -0
- package/dist/site/components/TimePicker/components/TimePickerField.d.ts +4 -0
- package/dist/site/components/TimePicker/constants.d.ts +32 -0
- package/dist/site/components/TimePicker/css.css +64 -0
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +10 -0
- package/dist/site/components/TimePicker/index.d.ts +2 -0
- package/dist/site/components/TimePicker/index.js +6 -0
- package/dist/site/components/TimePicker/manifest.d.ts +5 -0
- package/dist/site/components/TimePicker/manifest.js +113 -0
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +15 -0
- package/dist/site/components/chunks/AnimatedIcon.js +1 -1
- package/dist/site/components/chunks/Button.js +1 -1
- package/dist/site/components/chunks/Button2.js +299 -0
- package/dist/site/components/chunks/DateField.js +6763 -0
- package/dist/site/components/chunks/DismissSmall.js +7 -0
- package/dist/site/components/chunks/Group.js +60 -101
- package/dist/site/components/chunks/I18nProvider.js +32 -2
- package/dist/site/components/chunks/InfoCircleSmall.js +7 -0
- package/dist/site/components/chunks/Input.js +341 -0
- package/dist/site/components/chunks/Patterns.js +1 -1
- package/dist/site/components/chunks/TextEffectsShared.js +1 -1
- package/dist/site/components/chunks/constants10.js +14 -12
- package/dist/site/components/chunks/constants11.js +9 -9
- package/dist/site/components/chunks/constants12.js +10 -8
- package/dist/site/components/chunks/constants13.js +9 -13
- package/dist/site/components/chunks/constants14.js +14 -17
- package/dist/site/components/chunks/constants15.js +17 -12
- package/dist/site/components/chunks/constants16.js +11 -13
- package/dist/site/components/chunks/constants17.js +20 -66
- package/dist/site/components/chunks/constants18.js +67 -17
- package/dist/site/components/chunks/constants19.js +15 -50
- package/dist/site/components/chunks/constants2.js +30 -50
- package/dist/site/components/chunks/constants20.js +43 -45
- package/dist/site/components/chunks/constants21.js +48 -297
- package/dist/site/components/chunks/constants22.js +299 -41
- package/dist/site/components/chunks/constants23.js +44 -29
- package/dist/site/components/chunks/constants24.js +32 -17
- package/dist/site/components/chunks/constants25.js +16 -402
- package/dist/site/components/chunks/constants26.js +393 -73
- package/dist/site/components/chunks/constants27.js +80 -15
- package/dist/site/components/chunks/constants28.js +11 -42
- package/dist/site/components/chunks/constants29.js +44 -23
- package/dist/site/components/chunks/constants3.js +49 -14
- package/dist/site/components/chunks/constants30.js +28 -10
- package/dist/site/components/chunks/constants31.js +10 -132
- package/dist/site/components/chunks/constants32.js +114 -46
- package/dist/site/components/chunks/constants33.js +154 -69
- package/dist/site/components/chunks/constants34.js +59 -81
- package/dist/site/components/chunks/constants35.js +73 -58
- package/dist/site/components/chunks/constants36.js +91 -0
- package/dist/site/components/chunks/constants37.js +72 -0
- package/dist/site/components/chunks/constants4.js +10 -19
- package/dist/site/components/chunks/constants5.js +14 -14
- package/dist/site/components/chunks/constants6.js +11 -10
- package/dist/site/components/chunks/constants7.js +14 -14
- package/dist/site/components/chunks/constants8.js +22 -65
- package/dist/site/components/chunks/constants9.js +65 -20
- package/dist/site/components/chunks/filterDOMProps.js +15 -9
- package/dist/site/components/chunks/manifestBase.js +1 -1
- package/dist/site/components/chunks/useFocusable.js +118 -0
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +122 -0
- package/dist/site/components/chunks/usePress.js +825 -0
- package/dist/site/components/chunks/utils.js +1 -1
- package/dist/site/components/extensions.js +59 -49
- package/package.json +4 -3
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, w as $2c9edc598a03d523$export$420e68273165f4ec, A as $0c4a58759813079a$export$4e328f61c538687f, B as $e969f22b6713ca4a$export$ae780daf29e6d456, x as $390e54f620492c70$export$f680877a34711e37 } from "./Group.js";
|
|
2
|
+
import React__default, { useState, useMemo, createContext, useRef, useEffect } from "react";
|
|
3
|
+
import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps.js";
|
|
4
|
+
import { $ as $d1116acdf220c2da$export$4c014de7c8940b4c } from "./useFocusable.js";
|
|
5
|
+
import { a as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress.js";
|
|
6
|
+
const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
7
|
+
let $319e236875307eab$var$liveAnnouncer = null;
|
|
8
|
+
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
9
|
+
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
10
|
+
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
11
|
+
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
12
|
+
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 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
13
|
+
}, 100);
|
|
14
|
+
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
15
|
+
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
16
|
+
}
|
|
17
|
+
class $319e236875307eab$var$LiveAnnouncer {
|
|
18
|
+
isAttached() {
|
|
19
|
+
var _this_node;
|
|
20
|
+
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
21
|
+
}
|
|
22
|
+
createLog(ariaLive) {
|
|
23
|
+
let node = document.createElement("div");
|
|
24
|
+
node.setAttribute("role", "log");
|
|
25
|
+
node.setAttribute("aria-live", ariaLive);
|
|
26
|
+
node.setAttribute("aria-relevant", "additions");
|
|
27
|
+
return node;
|
|
28
|
+
}
|
|
29
|
+
destroy() {
|
|
30
|
+
if (!this.node) return;
|
|
31
|
+
document.body.removeChild(this.node);
|
|
32
|
+
this.node = null;
|
|
33
|
+
}
|
|
34
|
+
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
35
|
+
var _this_assertiveLog, _this_politeLog;
|
|
36
|
+
if (!this.node) return;
|
|
37
|
+
let node = document.createElement("div");
|
|
38
|
+
if (typeof message === "object") {
|
|
39
|
+
node.setAttribute("role", "img");
|
|
40
|
+
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
41
|
+
} else node.textContent = message;
|
|
42
|
+
if (assertiveness === "assertive") (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
43
|
+
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
44
|
+
if (message !== "") setTimeout(() => {
|
|
45
|
+
node.remove();
|
|
46
|
+
}, timeout);
|
|
47
|
+
}
|
|
48
|
+
clear(assertiveness) {
|
|
49
|
+
if (!this.node) return;
|
|
50
|
+
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
51
|
+
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
52
|
+
}
|
|
53
|
+
constructor() {
|
|
54
|
+
this.node = null;
|
|
55
|
+
this.assertiveLog = null;
|
|
56
|
+
this.politeLog = null;
|
|
57
|
+
if (typeof document !== "undefined") {
|
|
58
|
+
this.node = document.createElement("div");
|
|
59
|
+
this.node.dataset.liveAnnouncer = "true";
|
|
60
|
+
Object.assign(this.node.style, {
|
|
61
|
+
border: 0,
|
|
62
|
+
clip: "rect(0 0 0 0)",
|
|
63
|
+
clipPath: "inset(50%)",
|
|
64
|
+
height: "1px",
|
|
65
|
+
margin: "-1px",
|
|
66
|
+
overflow: "hidden",
|
|
67
|
+
padding: 0,
|
|
68
|
+
position: "absolute",
|
|
69
|
+
width: "1px",
|
|
70
|
+
whiteSpace: "nowrap"
|
|
71
|
+
});
|
|
72
|
+
this.assertiveLog = this.createLog("assertive");
|
|
73
|
+
this.node.appendChild(this.assertiveLog);
|
|
74
|
+
this.politeLog = this.createLog("polite");
|
|
75
|
+
this.node.appendChild(this.politeLog);
|
|
76
|
+
document.body.prepend(this.node);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function $ac4318a9c075bb9f$export$ea18c227d4417cc3(props, ref) {
|
|
81
|
+
let { elementType = "button", isDisabled, onPress, onPressStart, onPressEnd, onPressUp, onPressChange, preventFocusOnPress, allowFocusWhenDisabled, onClick, href, target, rel, type = "button" } = props;
|
|
82
|
+
let additionalProps;
|
|
83
|
+
if (elementType === "button") additionalProps = {
|
|
84
|
+
type,
|
|
85
|
+
disabled: isDisabled,
|
|
86
|
+
form: props.form,
|
|
87
|
+
formAction: props.formAction,
|
|
88
|
+
formEncType: props.formEncType,
|
|
89
|
+
formMethod: props.formMethod,
|
|
90
|
+
formNoValidate: props.formNoValidate,
|
|
91
|
+
formTarget: props.formTarget,
|
|
92
|
+
name: props.name,
|
|
93
|
+
value: props.value
|
|
94
|
+
};
|
|
95
|
+
else additionalProps = {
|
|
96
|
+
role: "button",
|
|
97
|
+
href: elementType === "a" && !isDisabled ? href : void 0,
|
|
98
|
+
target: elementType === "a" ? target : void 0,
|
|
99
|
+
type: elementType === "input" ? type : void 0,
|
|
100
|
+
disabled: elementType === "input" ? isDisabled : void 0,
|
|
101
|
+
"aria-disabled": !isDisabled || elementType === "input" ? void 0 : isDisabled,
|
|
102
|
+
rel: elementType === "a" ? rel : void 0
|
|
103
|
+
};
|
|
104
|
+
let { pressProps, isPressed } = $d27d541f9569d26d$export$45712eceda6fad21({
|
|
105
|
+
onPressStart,
|
|
106
|
+
onPressEnd,
|
|
107
|
+
onPressChange,
|
|
108
|
+
onPress,
|
|
109
|
+
onPressUp,
|
|
110
|
+
onClick,
|
|
111
|
+
isDisabled,
|
|
112
|
+
preventFocusOnPress,
|
|
113
|
+
ref
|
|
114
|
+
});
|
|
115
|
+
let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
|
|
116
|
+
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
|
|
117
|
+
let buttonProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(focusableProps, pressProps, $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
|
|
118
|
+
labelable: true
|
|
119
|
+
}));
|
|
120
|
+
return {
|
|
121
|
+
isPressed,
|
|
122
|
+
buttonProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(additionalProps, buttonProps, {
|
|
123
|
+
"aria-haspopup": props["aria-haspopup"],
|
|
124
|
+
"aria-expanded": props["aria-expanded"],
|
|
125
|
+
"aria-controls": props["aria-controls"],
|
|
126
|
+
"aria-pressed": props["aria-pressed"],
|
|
127
|
+
"aria-current": props["aria-current"],
|
|
128
|
+
"aria-disabled": props["aria-disabled"]
|
|
129
|
+
})
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function $240e9101ba2842f5$export$7d15b64cf5a3a4c4(value, min = -Infinity, max = Infinity) {
|
|
133
|
+
let newValue = Math.min(Math.max(value, min), max);
|
|
134
|
+
return newValue;
|
|
135
|
+
}
|
|
136
|
+
function $240e9101ba2842f5$export$e1a7b8e69ef6c52f(value, step) {
|
|
137
|
+
let roundedValue = value;
|
|
138
|
+
let precision = 0;
|
|
139
|
+
let stepString = step.toString();
|
|
140
|
+
let eIndex = stepString.toLowerCase().indexOf("e-");
|
|
141
|
+
if (eIndex > 0) precision = Math.abs(Math.floor(Math.log10(Math.abs(step)))) + eIndex;
|
|
142
|
+
else {
|
|
143
|
+
let pointIndex = stepString.indexOf(".");
|
|
144
|
+
if (pointIndex >= 0) precision = stepString.length - pointIndex;
|
|
145
|
+
}
|
|
146
|
+
if (precision > 0) {
|
|
147
|
+
let pow = Math.pow(10, precision);
|
|
148
|
+
roundedValue = Math.round(roundedValue * pow) / pow;
|
|
149
|
+
}
|
|
150
|
+
return roundedValue;
|
|
151
|
+
}
|
|
152
|
+
function $240e9101ba2842f5$export$cb6e0bb50bc19463(value, min, max, step) {
|
|
153
|
+
min = Number(min);
|
|
154
|
+
max = Number(max);
|
|
155
|
+
let remainder = (value - (isNaN(min) ? 0 : min)) % step;
|
|
156
|
+
let snappedValue = $240e9101ba2842f5$export$e1a7b8e69ef6c52f(Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder, step);
|
|
157
|
+
if (!isNaN(min)) {
|
|
158
|
+
if (snappedValue < min) snappedValue = min;
|
|
159
|
+
else if (!isNaN(max) && snappedValue > max) snappedValue = min + Math.floor($240e9101ba2842f5$export$e1a7b8e69ef6c52f((max - min) / step, step)) * step;
|
|
160
|
+
} else if (!isNaN(max) && snappedValue > max) snappedValue = Math.floor($240e9101ba2842f5$export$e1a7b8e69ef6c52f(max / step, step)) * step;
|
|
161
|
+
snappedValue = $240e9101ba2842f5$export$e1a7b8e69ef6c52f(snappedValue, step);
|
|
162
|
+
return snappedValue;
|
|
163
|
+
}
|
|
164
|
+
const $ea3928288112382f$var$styles = {
|
|
165
|
+
border: 0,
|
|
166
|
+
clip: "rect(0 0 0 0)",
|
|
167
|
+
clipPath: "inset(50%)",
|
|
168
|
+
height: "1px",
|
|
169
|
+
margin: "-1px",
|
|
170
|
+
overflow: "hidden",
|
|
171
|
+
padding: 0,
|
|
172
|
+
position: "absolute",
|
|
173
|
+
width: "1px",
|
|
174
|
+
whiteSpace: "nowrap"
|
|
175
|
+
};
|
|
176
|
+
function $ea3928288112382f$export$a966af930f325cab(props = {}) {
|
|
177
|
+
let { style, isFocusable } = props;
|
|
178
|
+
let [isFocused, setFocused] = useState(false);
|
|
179
|
+
let { focusWithinProps } = $2c9edc598a03d523$export$420e68273165f4ec({
|
|
180
|
+
isDisabled: !isFocusable,
|
|
181
|
+
onFocusWithinChange: (val) => setFocused(val)
|
|
182
|
+
});
|
|
183
|
+
let combinedStyles = useMemo(() => {
|
|
184
|
+
if (isFocused) return style;
|
|
185
|
+
else if (style) return {
|
|
186
|
+
...$ea3928288112382f$var$styles,
|
|
187
|
+
...style
|
|
188
|
+
};
|
|
189
|
+
else return $ea3928288112382f$var$styles;
|
|
190
|
+
}, [
|
|
191
|
+
isFocused
|
|
192
|
+
]);
|
|
193
|
+
return {
|
|
194
|
+
visuallyHiddenProps: {
|
|
195
|
+
...focusWithinProps,
|
|
196
|
+
style: combinedStyles
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function $ea3928288112382f$export$439d29a4e110a164(props) {
|
|
201
|
+
let { children, elementType: Element = "div", isFocusable, style, ...otherProps } = props;
|
|
202
|
+
let { visuallyHiddenProps } = $ea3928288112382f$export$a966af930f325cab(props);
|
|
203
|
+
return /* @__PURE__ */ React__default.createElement(Element, $bbaa08b3cd72f041$export$9d1611c77c2fe928(otherProps, visuallyHiddenProps), children);
|
|
204
|
+
}
|
|
205
|
+
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /* @__PURE__ */ createContext(null);
|
|
206
|
+
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /* @__PURE__ */ createContext({});
|
|
207
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Button(props, ref) {
|
|
208
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
209
|
+
props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
|
|
210
|
+
let ctx = props;
|
|
211
|
+
let { isPending } = ctx;
|
|
212
|
+
let { buttonProps, isPressed } = $ac4318a9c075bb9f$export$ea18c227d4417cc3(props, ref);
|
|
213
|
+
let { focusProps, isFocused, isFocusVisible } = $0c4a58759813079a$export$4e328f61c538687f(props);
|
|
214
|
+
let { hoverProps, isHovered } = $e969f22b6713ca4a$export$ae780daf29e6d456({
|
|
215
|
+
...props,
|
|
216
|
+
isDisabled: props.isDisabled || isPending
|
|
217
|
+
});
|
|
218
|
+
let renderValues = {
|
|
219
|
+
isHovered,
|
|
220
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
221
|
+
isFocused,
|
|
222
|
+
isFocusVisible,
|
|
223
|
+
isDisabled: props.isDisabled || false,
|
|
224
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
225
|
+
};
|
|
226
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
227
|
+
...props,
|
|
228
|
+
values: renderValues,
|
|
229
|
+
defaultClassName: "react-aria-Button"
|
|
230
|
+
});
|
|
231
|
+
let buttonId = $390e54f620492c70$export$f680877a34711e37(buttonProps.id);
|
|
232
|
+
let progressId = $390e54f620492c70$export$f680877a34711e37();
|
|
233
|
+
let ariaLabelledby = buttonProps["aria-labelledby"];
|
|
234
|
+
if (isPending) {
|
|
235
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
236
|
+
else if (buttonProps["aria-label"]) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
237
|
+
}
|
|
238
|
+
let wasPending = useRef(isPending);
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
let message = {
|
|
241
|
+
"aria-labelledby": ariaLabelledby || buttonId
|
|
242
|
+
};
|
|
243
|
+
if (!wasPending.current && isFocused && isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
244
|
+
else if (wasPending.current && isFocused && !isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
245
|
+
wasPending.current = isPending;
|
|
246
|
+
}, [
|
|
247
|
+
isPending,
|
|
248
|
+
isFocused,
|
|
249
|
+
ariaLabelledby,
|
|
250
|
+
buttonId
|
|
251
|
+
]);
|
|
252
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
253
|
+
global: true
|
|
254
|
+
});
|
|
255
|
+
delete DOMProps.onClick;
|
|
256
|
+
return /* @__PURE__ */ React__default.createElement("button", {
|
|
257
|
+
...$bbaa08b3cd72f041$export$9d1611c77c2fe928(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
258
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
259
|
+
// We do this by changing the button's type to button.
|
|
260
|
+
type: buttonProps.type === "submit" && isPending ? "button" : buttonProps.type,
|
|
261
|
+
id: buttonId,
|
|
262
|
+
ref,
|
|
263
|
+
"aria-labelledby": ariaLabelledby,
|
|
264
|
+
slot: props.slot || void 0,
|
|
265
|
+
"aria-disabled": isPending ? "true" : buttonProps["aria-disabled"],
|
|
266
|
+
"data-disabled": props.isDisabled || void 0,
|
|
267
|
+
"data-pressed": renderValues.isPressed || void 0,
|
|
268
|
+
"data-hovered": isHovered || void 0,
|
|
269
|
+
"data-focused": isFocused || void 0,
|
|
270
|
+
"data-pending": isPending || void 0,
|
|
271
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
272
|
+
}, /* @__PURE__ */ React__default.createElement($0393f8ab869a0f1a$export$e9f3bf65a26ce129.Provider, {
|
|
273
|
+
value: {
|
|
274
|
+
id: progressId
|
|
275
|
+
}
|
|
276
|
+
}, renderProps.children));
|
|
277
|
+
});
|
|
278
|
+
function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
|
|
279
|
+
if (props.isPending) {
|
|
280
|
+
props.onPress = void 0;
|
|
281
|
+
props.onPressStart = void 0;
|
|
282
|
+
props.onPressEnd = void 0;
|
|
283
|
+
props.onPressChange = void 0;
|
|
284
|
+
props.onPressUp = void 0;
|
|
285
|
+
props.onKeyDown = void 0;
|
|
286
|
+
props.onKeyUp = void 0;
|
|
287
|
+
props.onClick = void 0;
|
|
288
|
+
props.href = void 0;
|
|
289
|
+
}
|
|
290
|
+
return props;
|
|
291
|
+
}
|
|
292
|
+
export {
|
|
293
|
+
$ea3928288112382f$export$439d29a4e110a164 as $,
|
|
294
|
+
$240e9101ba2842f5$export$7d15b64cf5a3a4c4 as a,
|
|
295
|
+
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as b,
|
|
296
|
+
$ea3928288112382f$export$a966af930f325cab as c,
|
|
297
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as d,
|
|
298
|
+
$240e9101ba2842f5$export$cb6e0bb50bc19463 as e
|
|
299
|
+
};
|