@easypost/easy-ui 1.0.0-alpha.4 → 1.0.0-alpha.6
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/Badge/index.js +32 -26
- package/Badge/index.mjs +32 -26
- package/Banner/index.js +15 -16
- package/Banner/index.mjs +15 -16
- package/Button/Button.d.ts +61 -0
- package/Button/Button.d.ts.map +1 -1
- package/Button/index.js +34 -69
- package/Button/index.mjs +33 -68
- package/CHANGELOG.md +21 -0
- package/Card/index.js +84 -5
- package/Card/index.mjs +84 -5
- package/Checkbox/index.js +84 -72
- package/Checkbox/index.mjs +84 -72
- package/CodeBlock/index.js +43 -49
- package/CodeBlock/index.mjs +43 -49
- package/DropdownButton/DropdownButton.d.ts +48 -0
- package/DropdownButton/DropdownButton.d.ts.map +1 -1
- package/DropdownButton/index.js +29 -101
- package/DropdownButton/index.mjs +29 -85
- package/HorizontalGrid/index.js +11 -31
- package/HorizontalGrid/index.mjs +11 -31
- package/HorizontalStack/index.js +48 -4
- package/HorizontalStack/index.mjs +48 -4
- package/Icon/Icon.d.ts +51 -0
- package/Icon/Icon.d.ts.map +1 -1
- package/Icon/index.js +38 -4
- package/Icon/index.mjs +38 -4
- package/IconButton/IconButton.d.ts +62 -0
- package/IconButton/IconButton.d.ts.map +1 -1
- package/IconButton/index.js +26 -43
- package/IconButton/index.mjs +25 -42
- package/InputField/Label.d.ts +2 -2
- package/InputField/index.js +282 -10
- package/InputField/index.mjs +266 -10
- package/InputField/utilities.d.ts +1 -1
- package/InputField/utilities.d.ts.map +1 -1
- package/Menu/MenuOverlay.d.ts.map +1 -1
- package/Menu/index.js +178 -1958
- package/Menu/index.mjs +168 -1948
- package/Menu/utilities.d.ts +11 -0
- package/Menu/utilities.d.ts.map +1 -0
- package/Notification/index.js +1534 -14
- package/Notification/index.mjs +1518 -14
- package/Provider/index.js +15 -15
- package/Provider/index.mjs +15 -15
- package/RadioGroup/index.js +63 -63
- package/RadioGroup/index.mjs +63 -63
- package/Select/Select.d.ts +88 -0
- package/Select/Select.d.ts.map +1 -0
- package/Select/Select.stories.d.ts +17 -0
- package/Select/Select.stories.d.ts.map +1 -0
- package/Select/Select.test.d.ts +2 -0
- package/Select/Select.test.d.ts.map +1 -0
- package/Select/SelectContext.d.ts +14 -0
- package/Select/SelectContext.d.ts.map +1 -0
- package/Select/SelectField.d.ts +62 -0
- package/Select/SelectField.d.ts.map +1 -0
- package/Select/SelectOption.d.ts +23 -0
- package/Select/SelectOption.d.ts.map +1 -0
- package/Select/SelectOverlay.d.ts +3 -0
- package/Select/SelectOverlay.d.ts.map +1 -0
- package/Select/SelectSection.d.ts +22 -0
- package/Select/SelectSection.d.ts.map +1 -0
- package/Select/SelectTrigger.d.ts +30 -0
- package/Select/SelectTrigger.d.ts.map +1 -0
- package/Select/index.d.ts +2 -0
- package/Select/index.d.ts.map +1 -0
- package/Select/index.js +816 -0
- package/Select/index.mjs +816 -0
- package/SelectorErrorTooltip/index.js +102 -11
- package/SelectorErrorTooltip/index.mjs +86 -11
- package/Text/index.js +85 -4
- package/Text/index.mjs +85 -4
- package/TextField/index.js +19 -38
- package/TextField/index.mjs +19 -38
- package/Textarea/index.js +20 -37
- package/Textarea/index.mjs +20 -37
- package/Theme/index.js +145 -9
- package/Theme/index.mjs +145 -9
- package/Toggle/index.js +51 -50
- package/Toggle/index.mjs +51 -50
- package/Tooltip/index.js +299 -10
- package/Tooltip/index.mjs +299 -10
- package/UnstyledButton/index.js +4 -4
- package/UnstyledButton/index.mjs +3 -3
- package/VerticalStack/index.js +13 -47
- package/VerticalStack/index.mjs +13 -47
- package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
- package/__chunks__/ExpandMore400-92646971.js +65 -0
- package/__chunks__/InputIcon-2317befd.mjs +148 -0
- package/__chunks__/InputIcon-d3963cf8.js +147 -0
- package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
- package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
- package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
- package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
- package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
- package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
- package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
- package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
- package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
- package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
- package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
- package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
- package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
- package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
- package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
- package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
- package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
- package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
- package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
- package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
- package/package.json +11 -11
- package/style.css +1423 -1196
- package/utilities/css.js +14 -58
- package/utilities/css.mjs +14 -58
- package/__chunks__/Card-7bbd41e0.mjs +0 -110
- package/__chunks__/Card-dac53c75.js +0 -109
- package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
- package/__chunks__/HorizontalStack-a862839b.js +0 -79
- package/__chunks__/Icon-3d00481a.js +0 -44
- package/__chunks__/Icon-a75b5201.mjs +0 -45
- package/__chunks__/InputField-4fbaae06.js +0 -487
- package/__chunks__/InputField-a272f602.mjs +0 -472
- package/__chunks__/Notification-b8eafec6.mjs +0 -1456
- package/__chunks__/Notification-c5b34eb3.js +0 -1471
- package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
- package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
- package/__chunks__/Text-1ae70c19.js +0 -102
- package/__chunks__/Text-4ae50d5c.mjs +0 -103
- package/__chunks__/Theme-4e498252.mjs +0 -132
- package/__chunks__/Theme-751e5575.js +0 -131
- package/__chunks__/Tooltip-bd55165e.js +0 -317
- package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
|
@@ -5,6 +5,11 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
5
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __knownSymbol = (name, symbol) => {
|
|
9
|
+
if (symbol = Symbol[name])
|
|
10
|
+
return symbol;
|
|
11
|
+
throw Error("Symbol." + name + " is not defined");
|
|
12
|
+
};
|
|
8
13
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
14
|
var __spreadValues = (a, b) => {
|
|
10
15
|
for (var prop in b || (b = {}))
|
|
@@ -30,21 +35,45 @@ var __objRest = (source, exclude) => {
|
|
|
30
35
|
}
|
|
31
36
|
return target;
|
|
32
37
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
var __await = function(promise, isYieldStar) {
|
|
39
|
+
this[0] = promise;
|
|
40
|
+
this[1] = isYieldStar;
|
|
41
|
+
};
|
|
42
|
+
var __yieldStar = (value) => {
|
|
43
|
+
var obj = value[__knownSymbol("asyncIterator")];
|
|
44
|
+
var isAwait = false;
|
|
45
|
+
var method;
|
|
46
|
+
var it = {};
|
|
47
|
+
if (obj == null) {
|
|
48
|
+
obj = value[__knownSymbol("iterator")]();
|
|
49
|
+
method = (k) => it[k] = (x) => obj[k](x);
|
|
43
50
|
} else {
|
|
44
|
-
obj
|
|
51
|
+
obj = obj.call(value);
|
|
52
|
+
method = (k) => it[k] = (v) => {
|
|
53
|
+
if (isAwait) {
|
|
54
|
+
isAwait = false;
|
|
55
|
+
if (k === "throw")
|
|
56
|
+
throw v;
|
|
57
|
+
return v;
|
|
58
|
+
}
|
|
59
|
+
isAwait = true;
|
|
60
|
+
return {
|
|
61
|
+
done: false,
|
|
62
|
+
value: new __await(new Promise((resolve) => {
|
|
63
|
+
var x = obj[k](v);
|
|
64
|
+
if (!(x instanceof Object))
|
|
65
|
+
throw TypeError("Object expected");
|
|
66
|
+
resolve(x);
|
|
67
|
+
}), 1)
|
|
68
|
+
};
|
|
69
|
+
};
|
|
45
70
|
}
|
|
46
|
-
return obj
|
|
47
|
-
|
|
71
|
+
return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
|
|
72
|
+
throw x;
|
|
73
|
+
}, "return" in obj && method("return"), it;
|
|
74
|
+
};
|
|
75
|
+
const React = require("react");
|
|
76
|
+
const _import = require("./import-a1e0f814.js");
|
|
48
77
|
let $14c0b72509d70225$var$state = "default";
|
|
49
78
|
let $14c0b72509d70225$var$savedUserSelect = "";
|
|
50
79
|
let $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -125,16 +154,6 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
125
154
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
126
155
|
"ref"
|
|
127
156
|
]);
|
|
128
|
-
let propsRef = React.useRef(null);
|
|
129
|
-
propsRef.current = {
|
|
130
|
-
onPress,
|
|
131
|
-
onPressChange,
|
|
132
|
-
onPressStart,
|
|
133
|
-
onPressEnd,
|
|
134
|
-
onPressUp,
|
|
135
|
-
isDisabled,
|
|
136
|
-
shouldCancelOnPointerExit
|
|
137
|
-
};
|
|
138
157
|
let [isPressed, setPressed] = React.useState(false);
|
|
139
158
|
let ref = React.useRef({
|
|
140
159
|
isPressed: false,
|
|
@@ -147,85 +166,89 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
147
166
|
pointerType: null
|
|
148
167
|
});
|
|
149
168
|
let { addGlobalListener, removeAllGlobalListeners } = _import.$03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
169
|
+
let triggerPressStart = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
|
|
170
|
+
let state = ref.current;
|
|
171
|
+
if (isDisabled || state.didFirePressStart)
|
|
172
|
+
return;
|
|
173
|
+
if (onPressStart)
|
|
174
|
+
onPressStart({
|
|
175
|
+
type: "pressstart",
|
|
176
|
+
pointerType,
|
|
177
|
+
target: originalEvent.currentTarget,
|
|
178
|
+
shiftKey: originalEvent.shiftKey,
|
|
179
|
+
metaKey: originalEvent.metaKey,
|
|
180
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
181
|
+
altKey: originalEvent.altKey
|
|
182
|
+
});
|
|
183
|
+
if (onPressChange)
|
|
184
|
+
onPressChange(true);
|
|
185
|
+
state.didFirePressStart = true;
|
|
186
|
+
setPressed(true);
|
|
187
|
+
});
|
|
188
|
+
let triggerPressEnd = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType, wasPressed = true) => {
|
|
189
|
+
let state = ref.current;
|
|
190
|
+
if (!state.didFirePressStart)
|
|
191
|
+
return;
|
|
192
|
+
state.ignoreClickAfterPress = true;
|
|
193
|
+
state.didFirePressStart = false;
|
|
194
|
+
if (onPressEnd)
|
|
195
|
+
onPressEnd({
|
|
196
|
+
type: "pressend",
|
|
197
|
+
pointerType,
|
|
198
|
+
target: originalEvent.currentTarget,
|
|
199
|
+
shiftKey: originalEvent.shiftKey,
|
|
200
|
+
metaKey: originalEvent.metaKey,
|
|
201
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
202
|
+
altKey: originalEvent.altKey
|
|
203
|
+
});
|
|
204
|
+
if (onPressChange)
|
|
205
|
+
onPressChange(false);
|
|
206
|
+
setPressed(false);
|
|
207
|
+
if (onPress && wasPressed && !isDisabled)
|
|
208
|
+
onPress({
|
|
209
|
+
type: "press",
|
|
210
|
+
pointerType,
|
|
211
|
+
target: originalEvent.currentTarget,
|
|
212
|
+
shiftKey: originalEvent.shiftKey,
|
|
213
|
+
metaKey: originalEvent.metaKey,
|
|
214
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
215
|
+
altKey: originalEvent.altKey
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
let triggerPressUp = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
|
|
219
|
+
if (isDisabled)
|
|
220
|
+
return;
|
|
221
|
+
if (onPressUp)
|
|
222
|
+
onPressUp({
|
|
223
|
+
type: "pressup",
|
|
224
|
+
pointerType,
|
|
225
|
+
target: originalEvent.currentTarget,
|
|
226
|
+
shiftKey: originalEvent.shiftKey,
|
|
227
|
+
metaKey: originalEvent.metaKey,
|
|
228
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
229
|
+
altKey: originalEvent.altKey
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
let cancel = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
233
|
+
let state = ref.current;
|
|
234
|
+
if (state.isPressed) {
|
|
235
|
+
if (state.isOverTarget)
|
|
236
|
+
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
237
|
+
state.isPressed = false;
|
|
238
|
+
state.isOverTarget = false;
|
|
239
|
+
state.activePointerId = null;
|
|
240
|
+
state.pointerType = null;
|
|
241
|
+
removeAllGlobalListeners();
|
|
242
|
+
if (!allowTextSelectionOnPress)
|
|
243
|
+
$14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
let cancelOnPointerExit = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
247
|
+
if (shouldCancelOnPointerExit)
|
|
248
|
+
cancel(e);
|
|
249
|
+
});
|
|
150
250
|
let pressProps = React.useMemo(() => {
|
|
151
251
|
let state = ref.current;
|
|
152
|
-
let triggerPressStart = (originalEvent, pointerType) => {
|
|
153
|
-
let { onPressStart: onPressStart2, onPressChange: onPressChange2, isDisabled: isDisabled2 } = propsRef.current;
|
|
154
|
-
if (isDisabled2 || state.didFirePressStart)
|
|
155
|
-
return;
|
|
156
|
-
if (onPressStart2)
|
|
157
|
-
onPressStart2({
|
|
158
|
-
type: "pressstart",
|
|
159
|
-
pointerType,
|
|
160
|
-
target: originalEvent.currentTarget,
|
|
161
|
-
shiftKey: originalEvent.shiftKey,
|
|
162
|
-
metaKey: originalEvent.metaKey,
|
|
163
|
-
ctrlKey: originalEvent.ctrlKey,
|
|
164
|
-
altKey: originalEvent.altKey
|
|
165
|
-
});
|
|
166
|
-
if (onPressChange2)
|
|
167
|
-
onPressChange2(true);
|
|
168
|
-
state.didFirePressStart = true;
|
|
169
|
-
setPressed(true);
|
|
170
|
-
};
|
|
171
|
-
let triggerPressEnd = (originalEvent, pointerType, wasPressed = true) => {
|
|
172
|
-
let { onPressEnd: onPressEnd2, onPressChange: onPressChange2, onPress: onPress2, isDisabled: isDisabled2 } = propsRef.current;
|
|
173
|
-
if (!state.didFirePressStart)
|
|
174
|
-
return;
|
|
175
|
-
state.ignoreClickAfterPress = true;
|
|
176
|
-
state.didFirePressStart = false;
|
|
177
|
-
if (onPressEnd2)
|
|
178
|
-
onPressEnd2({
|
|
179
|
-
type: "pressend",
|
|
180
|
-
pointerType,
|
|
181
|
-
target: originalEvent.currentTarget,
|
|
182
|
-
shiftKey: originalEvent.shiftKey,
|
|
183
|
-
metaKey: originalEvent.metaKey,
|
|
184
|
-
ctrlKey: originalEvent.ctrlKey,
|
|
185
|
-
altKey: originalEvent.altKey
|
|
186
|
-
});
|
|
187
|
-
if (onPressChange2)
|
|
188
|
-
onPressChange2(false);
|
|
189
|
-
setPressed(false);
|
|
190
|
-
if (onPress2 && wasPressed && !isDisabled2)
|
|
191
|
-
onPress2({
|
|
192
|
-
type: "press",
|
|
193
|
-
pointerType,
|
|
194
|
-
target: originalEvent.currentTarget,
|
|
195
|
-
shiftKey: originalEvent.shiftKey,
|
|
196
|
-
metaKey: originalEvent.metaKey,
|
|
197
|
-
ctrlKey: originalEvent.ctrlKey,
|
|
198
|
-
altKey: originalEvent.altKey
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
let triggerPressUp = (originalEvent, pointerType) => {
|
|
202
|
-
let { onPressUp: onPressUp2, isDisabled: isDisabled2 } = propsRef.current;
|
|
203
|
-
if (isDisabled2)
|
|
204
|
-
return;
|
|
205
|
-
if (onPressUp2)
|
|
206
|
-
onPressUp2({
|
|
207
|
-
type: "pressup",
|
|
208
|
-
pointerType,
|
|
209
|
-
target: originalEvent.currentTarget,
|
|
210
|
-
shiftKey: originalEvent.shiftKey,
|
|
211
|
-
metaKey: originalEvent.metaKey,
|
|
212
|
-
ctrlKey: originalEvent.ctrlKey,
|
|
213
|
-
altKey: originalEvent.altKey
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
let cancel = (e) => {
|
|
217
|
-
if (state.isPressed) {
|
|
218
|
-
if (state.isOverTarget)
|
|
219
|
-
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
220
|
-
state.isPressed = false;
|
|
221
|
-
state.isOverTarget = false;
|
|
222
|
-
state.activePointerId = null;
|
|
223
|
-
state.pointerType = null;
|
|
224
|
-
removeAllGlobalListeners();
|
|
225
|
-
if (!allowTextSelectionOnPress)
|
|
226
|
-
$14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
252
|
let pressProps2 = {
|
|
230
253
|
onKeyDown(e) {
|
|
231
254
|
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && e.currentTarget.contains(e.target)) {
|
|
@@ -330,8 +353,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
330
353
|
} else if (state.isOverTarget) {
|
|
331
354
|
state.isOverTarget = false;
|
|
332
355
|
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
|
|
333
|
-
|
|
334
|
-
cancel(e);
|
|
356
|
+
cancelOnPointerExit(e);
|
|
335
357
|
}
|
|
336
358
|
};
|
|
337
359
|
let onPointerUp = (e) => {
|
|
@@ -391,8 +413,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
391
413
|
if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
|
|
392
414
|
state.isOverTarget = false;
|
|
393
415
|
triggerPressEnd(e, state.pointerType, false);
|
|
394
|
-
|
|
395
|
-
cancel(e);
|
|
416
|
+
cancelOnPointerExit(e);
|
|
396
417
|
}
|
|
397
418
|
};
|
|
398
419
|
pressProps2.onMouseUp = (e) => {
|
|
@@ -451,8 +472,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
451
472
|
} else if (state.isOverTarget) {
|
|
452
473
|
state.isOverTarget = false;
|
|
453
474
|
triggerPressEnd(e, state.pointerType, false);
|
|
454
|
-
|
|
455
|
-
cancel(e);
|
|
475
|
+
cancelOnPointerExit(e);
|
|
456
476
|
}
|
|
457
477
|
};
|
|
458
478
|
pressProps2.onTouchEnd = (e) => {
|
|
@@ -504,7 +524,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
|
|
|
504
524
|
isDisabled,
|
|
505
525
|
preventFocusOnPress,
|
|
506
526
|
removeAllGlobalListeners,
|
|
507
|
-
allowTextSelectionOnPress
|
|
527
|
+
allowTextSelectionOnPress,
|
|
528
|
+
cancel,
|
|
529
|
+
cancelOnPointerExit,
|
|
530
|
+
triggerPressEnd,
|
|
531
|
+
triggerPressStart,
|
|
532
|
+
triggerPressUp
|
|
508
533
|
]);
|
|
509
534
|
React.useEffect(() => {
|
|
510
535
|
return () => {
|
|
@@ -635,10 +660,8 @@ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
|
|
|
635
660
|
function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
636
661
|
let stateRef = React.useRef({
|
|
637
662
|
isFocused: false,
|
|
638
|
-
onBlur,
|
|
639
663
|
observer: null
|
|
640
664
|
});
|
|
641
|
-
stateRef.current.onBlur = onBlur;
|
|
642
665
|
_import.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
643
666
|
const state = stateRef.current;
|
|
644
667
|
return () => {
|
|
@@ -648,15 +671,17 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
648
671
|
}
|
|
649
672
|
};
|
|
650
673
|
}, []);
|
|
674
|
+
let dispatchBlur = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
675
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
676
|
+
});
|
|
651
677
|
return React.useCallback((e) => {
|
|
652
678
|
if (e.target instanceof HTMLButtonElement || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement) {
|
|
653
679
|
stateRef.current.isFocused = true;
|
|
654
680
|
let target = e.target;
|
|
655
681
|
let onBlurHandler = (e2) => {
|
|
656
|
-
var _stateRef_current, _stateRef_current_onBlur;
|
|
657
682
|
stateRef.current.isFocused = false;
|
|
658
683
|
if (target.disabled)
|
|
659
|
-
(
|
|
684
|
+
dispatchBlur(new $8a9cb279dc87e130$export$905e7fc544a71f36("blur", e2));
|
|
660
685
|
if (stateRef.current.observer) {
|
|
661
686
|
stateRef.current.observer.disconnect();
|
|
662
687
|
stateRef.current.observer = null;
|
|
@@ -668,9 +693,13 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
668
693
|
stateRef.current.observer = new MutationObserver(() => {
|
|
669
694
|
if (stateRef.current.isFocused && target.disabled) {
|
|
670
695
|
stateRef.current.observer.disconnect();
|
|
671
|
-
target.
|
|
696
|
+
let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
|
|
697
|
+
target.dispatchEvent(new FocusEvent("blur", {
|
|
698
|
+
relatedTarget: relatedTargetEl
|
|
699
|
+
}));
|
|
672
700
|
target.dispatchEvent(new FocusEvent("focusout", {
|
|
673
|
-
bubbles: true
|
|
701
|
+
bubbles: true,
|
|
702
|
+
relatedTarget: relatedTargetEl
|
|
674
703
|
}));
|
|
675
704
|
}
|
|
676
705
|
});
|
|
@@ -681,7 +710,9 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
|
|
|
681
710
|
]
|
|
682
711
|
});
|
|
683
712
|
}
|
|
684
|
-
}, [
|
|
713
|
+
}, [
|
|
714
|
+
dispatchBlur
|
|
715
|
+
]);
|
|
685
716
|
}
|
|
686
717
|
function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
|
|
687
718
|
let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
|
|
@@ -804,6 +835,24 @@ function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
|
|
|
804
835
|
function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
|
|
805
836
|
return $507fabe10e71c6fb$var$currentModality;
|
|
806
837
|
}
|
|
838
|
+
function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
|
|
839
|
+
$507fabe10e71c6fb$var$currentModality = modality;
|
|
840
|
+
$507fabe10e71c6fb$var$triggerChangeHandlers(modality, null);
|
|
841
|
+
}
|
|
842
|
+
function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
|
|
843
|
+
$507fabe10e71c6fb$var$setupGlobalFocusEvents();
|
|
844
|
+
let [modality, setModality] = React.useState($507fabe10e71c6fb$var$currentModality);
|
|
845
|
+
React.useEffect(() => {
|
|
846
|
+
let handler = () => {
|
|
847
|
+
setModality($507fabe10e71c6fb$var$currentModality);
|
|
848
|
+
};
|
|
849
|
+
$507fabe10e71c6fb$var$changeHandlers.add(handler);
|
|
850
|
+
return () => {
|
|
851
|
+
$507fabe10e71c6fb$var$changeHandlers.delete(handler);
|
|
852
|
+
};
|
|
853
|
+
}, []);
|
|
854
|
+
return _import.$704cf1d3b684cc5c$export$535bd6ca7f90a273() ? null : modality;
|
|
855
|
+
}
|
|
807
856
|
function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
|
|
808
857
|
return !(isTextInput && modality === "keyboard" && e instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
|
|
809
858
|
}
|
|
@@ -996,27 +1045,27 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
996
1045
|
let { ref, onInteractOutside, isDisabled, onInteractOutsideStart } = props;
|
|
997
1046
|
let stateRef = React.useRef({
|
|
998
1047
|
isPointerDown: false,
|
|
999
|
-
ignoreEmulatedMouseEvents: false
|
|
1000
|
-
|
|
1001
|
-
|
|
1048
|
+
ignoreEmulatedMouseEvents: false
|
|
1049
|
+
});
|
|
1050
|
+
let onPointerDown = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
1051
|
+
if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {
|
|
1052
|
+
if (onInteractOutsideStart)
|
|
1053
|
+
onInteractOutsideStart(e);
|
|
1054
|
+
stateRef.current.isPointerDown = true;
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
let triggerInteractOutside = _import.$8ae05eaa5c114e9c$export$7f54fc3180508a52((e) => {
|
|
1058
|
+
if (onInteractOutside)
|
|
1059
|
+
onInteractOutside(e);
|
|
1002
1060
|
});
|
|
1003
|
-
let state = stateRef.current;
|
|
1004
|
-
state.onInteractOutside = onInteractOutside;
|
|
1005
|
-
state.onInteractOutsideStart = onInteractOutsideStart;
|
|
1006
1061
|
React.useEffect(() => {
|
|
1062
|
+
let state = stateRef.current;
|
|
1007
1063
|
if (isDisabled)
|
|
1008
1064
|
return;
|
|
1009
|
-
let onPointerDown = (e) => {
|
|
1010
|
-
if ($e0b6e0b68ec7f50f$var$isValidEvent(e, ref) && state.onInteractOutside) {
|
|
1011
|
-
if (state.onInteractOutsideStart)
|
|
1012
|
-
state.onInteractOutsideStart(e);
|
|
1013
|
-
state.isPointerDown = true;
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
1065
|
if (typeof PointerEvent !== "undefined") {
|
|
1017
1066
|
let onPointerUp = (e) => {
|
|
1018
|
-
if (state.isPointerDown &&
|
|
1019
|
-
|
|
1067
|
+
if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
1068
|
+
triggerInteractOutside(e);
|
|
1020
1069
|
state.isPointerDown = false;
|
|
1021
1070
|
};
|
|
1022
1071
|
document.addEventListener("pointerdown", onPointerDown, true);
|
|
@@ -1029,14 +1078,14 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
1029
1078
|
let onMouseUp = (e) => {
|
|
1030
1079
|
if (state.ignoreEmulatedMouseEvents)
|
|
1031
1080
|
state.ignoreEmulatedMouseEvents = false;
|
|
1032
|
-
else if (state.isPointerDown &&
|
|
1033
|
-
|
|
1081
|
+
else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
1082
|
+
triggerInteractOutside(e);
|
|
1034
1083
|
state.isPointerDown = false;
|
|
1035
1084
|
};
|
|
1036
1085
|
let onTouchEnd = (e) => {
|
|
1037
1086
|
state.ignoreEmulatedMouseEvents = true;
|
|
1038
|
-
if (state.
|
|
1039
|
-
|
|
1087
|
+
if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref))
|
|
1088
|
+
triggerInteractOutside(e);
|
|
1040
1089
|
state.isPointerDown = false;
|
|
1041
1090
|
};
|
|
1042
1091
|
document.addEventListener("mousedown", onPointerDown, true);
|
|
@@ -1052,8 +1101,9 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
1052
1101
|
}
|
|
1053
1102
|
}, [
|
|
1054
1103
|
ref,
|
|
1055
|
-
|
|
1056
|
-
|
|
1104
|
+
isDisabled,
|
|
1105
|
+
onPointerDown,
|
|
1106
|
+
triggerInteractOutside
|
|
1057
1107
|
]);
|
|
1058
1108
|
}
|
|
1059
1109
|
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
|
|
@@ -1273,7 +1323,7 @@ class $9bf71ea28793e738$var$Tree {
|
|
|
1273
1323
|
yield node;
|
|
1274
1324
|
if (node.children.size > 0)
|
|
1275
1325
|
for (let child of node.children)
|
|
1276
|
-
yield* this.traverse(child);
|
|
1326
|
+
yield* __yieldStar(this.traverse(child));
|
|
1277
1327
|
}
|
|
1278
1328
|
clone() {
|
|
1279
1329
|
let newTree = new $9bf71ea28793e738$var$Tree();
|
|
@@ -1282,7 +1332,7 @@ class $9bf71ea28793e738$var$Tree {
|
|
|
1282
1332
|
return newTree;
|
|
1283
1333
|
}
|
|
1284
1334
|
constructor() {
|
|
1285
|
-
|
|
1335
|
+
this.fastMap = /* @__PURE__ */ new Map();
|
|
1286
1336
|
this.root = new $9bf71ea28793e738$var$TreeNode({
|
|
1287
1337
|
scopeRef: null
|
|
1288
1338
|
});
|
|
@@ -1299,8 +1349,8 @@ class $9bf71ea28793e738$var$TreeNode {
|
|
|
1299
1349
|
node.parent = void 0;
|
|
1300
1350
|
}
|
|
1301
1351
|
constructor(props) {
|
|
1302
|
-
|
|
1303
|
-
|
|
1352
|
+
this.children = /* @__PURE__ */ new Set();
|
|
1353
|
+
this.contain = false;
|
|
1304
1354
|
this.scopeRef = props.scopeRef;
|
|
1305
1355
|
}
|
|
1306
1356
|
}
|
|
@@ -1337,7 +1387,7 @@ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
|
1337
1387
|
});
|
|
1338
1388
|
return {
|
|
1339
1389
|
isFocused,
|
|
1340
|
-
isFocusVisible:
|
|
1390
|
+
isFocusVisible: isFocusVisibleState,
|
|
1341
1391
|
focusProps: within ? focusWithinProps : focusProps
|
|
1342
1392
|
};
|
|
1343
1393
|
}
|
|
@@ -1368,7 +1418,10 @@ function $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, domRef) {
|
|
|
1368
1418
|
}), interactionProps)
|
|
1369
1419
|
};
|
|
1370
1420
|
}
|
|
1421
|
+
exports.$46d819fcbaf35654$export$8f71654801c2f7cd = $46d819fcbaf35654$export$8f71654801c2f7cd;
|
|
1371
1422
|
exports.$507fabe10e71c6fb$export$630ff653c5ada6a9 = $507fabe10e71c6fb$export$630ff653c5ada6a9;
|
|
1423
|
+
exports.$507fabe10e71c6fb$export$8397ddfc504fdb9a = $507fabe10e71c6fb$export$8397ddfc504fdb9a;
|
|
1424
|
+
exports.$507fabe10e71c6fb$export$98e20ec92f614cfe = $507fabe10e71c6fb$export$98e20ec92f614cfe;
|
|
1372
1425
|
exports.$507fabe10e71c6fb$export$b9b3dfddab17db27 = $507fabe10e71c6fb$export$b9b3dfddab17db27;
|
|
1373
1426
|
exports.$6179b936705e76d3$export$ae780daf29e6d456 = $6179b936705e76d3$export$ae780daf29e6d456;
|
|
1374
1427
|
exports.$6a99195332edec8b$export$80f3e147d781571c = $6a99195332edec8b$export$80f3e147d781571c;
|
|
@@ -1380,4 +1433,3 @@ exports.$e0b6e0b68ec7f50f$export$872b660ac5a1ff98 = $e0b6e0b68ec7f50f$export$872
|
|
|
1380
1433
|
exports.$e6afbd83fe6ebbd2$export$4c014de7c8940b4c = $e6afbd83fe6ebbd2$export$4c014de7c8940b4c;
|
|
1381
1434
|
exports.$f6c31cce2adf654f$export$45712eceda6fad21 = $f6c31cce2adf654f$export$45712eceda6fad21;
|
|
1382
1435
|
exports.$f7dceffc5ad7768b$export$4e328f61c538687f = $f7dceffc5ad7768b$export$4e328f61c538687f;
|
|
1383
|
-
exports._defineProperty = _defineProperty;
|