@uva-glass/component-library 1.43.0 → 1.44.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/{MultiSelect-DFMb82q4.js → MultiSelect-B9JaIPXs.js} +17 -12
- package/dist/{MultiSelect-DFMb82q4.js.map → MultiSelect-B9JaIPXs.js.map} +1 -1
- package/dist/assets/MenuLink.css +1 -1
- package/dist/assets/MenuLink2.css +1 -1
- package/dist/assets/Spinner.css +1 -1
- package/dist/components/Drawer/Drawer.js +39 -37
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.stories.js +18 -18
- package/dist/components/InputField/InputField.stories.js +24 -19
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/MenuButton/MenuButton.d.ts +2 -3
- package/dist/components/MenuButton/MenuButton.js +11 -605
- package/dist/components/MenuButton/MenuButton.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.js +14 -4
- package/dist/components/MenuLink/MenuLink.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.stories.js +5 -4
- package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
- package/dist/components/MenuLink/index.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.js +62 -60
- package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +12 -12
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +7 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +28 -23
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/Spinner/Spinner.js +13 -12
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/index.js +6 -6
- package/dist/index.js +6 -6
- package/package.json +10 -12
- package/dist/MenuLink-yPEEfABB.js +0 -859
- package/dist/MenuLink-yPEEfABB.js.map +0 -1
- package/dist/focusSafely-b94Glb9J.js +0 -402
- package/dist/focusSafely-b94Glb9J.js.map +0 -1
- package/dist/index-HuvfQN5H.js +0 -19071
- package/dist/index-HuvfQN5H.js.map +0 -1
- package/dist/useDialog-DZhIlo2a.js +0 -785
- package/dist/useDialog-DZhIlo2a.js.map +0 -1
|
@@ -1,610 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (let a = 1; a < t.length; a++) {
|
|
12
|
-
let i = t[a];
|
|
13
|
-
for (let o in i) {
|
|
14
|
-
let c = r[o], u = i[o];
|
|
15
|
-
typeof c == "function" && typeof u == "function" && // This is a lot faster than a regex.
|
|
16
|
-
o[0] === "o" && o[1] === "n" && o.charCodeAt(2) >= /* 'A' */
|
|
17
|
-
65 && o.charCodeAt(2) <= /* 'Z' */
|
|
18
|
-
90 ? r[o] = le(c, u) : (o === "className" || o === "UNSAFE_className") && typeof c == "string" && typeof u == "string" ? r[o] = ce(c, u) : o === "id" && c && u ? r.id = Te(c, u) : r[o] = u !== void 0 ? u : c;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return r;
|
|
22
|
-
}
|
|
23
|
-
function U(t, r, a = !0) {
|
|
24
|
-
var i, o;
|
|
25
|
-
let { metaKey: c, ctrlKey: u, altKey: p, shiftKey: d } = r;
|
|
26
|
-
he() && (!((o = window.event) === null || o === void 0 || (i = o.type) === null || i === void 0) && i.startsWith("key")) && t.target === "_blank" && (V() ? c = !0 : u = !0);
|
|
27
|
-
let y = me() && V() && !Ee() ? new KeyboardEvent("keydown", {
|
|
28
|
-
keyIdentifier: "Enter",
|
|
29
|
-
metaKey: c,
|
|
30
|
-
ctrlKey: u,
|
|
31
|
-
altKey: p,
|
|
32
|
-
shiftKey: d
|
|
33
|
-
}) : new MouseEvent("click", {
|
|
34
|
-
metaKey: c,
|
|
35
|
-
ctrlKey: u,
|
|
36
|
-
altKey: p,
|
|
37
|
-
shiftKey: d,
|
|
38
|
-
bubbles: !0,
|
|
39
|
-
cancelable: !0
|
|
40
|
-
});
|
|
41
|
-
U.isOpening = a, I(t), t.dispatchEvent(y), U.isOpening = !1;
|
|
42
|
-
}
|
|
43
|
-
U.isOpening = !1;
|
|
44
|
-
function De() {
|
|
45
|
-
let t = J(/* @__PURE__ */ new Map()), r = L((o, c, u, p) => {
|
|
46
|
-
let d = p != null && p.once ? (...y) => {
|
|
47
|
-
t.current.delete(u), u(...y);
|
|
48
|
-
} : u;
|
|
49
|
-
t.current.set(u, {
|
|
50
|
-
type: c,
|
|
51
|
-
eventTarget: o,
|
|
52
|
-
fn: d,
|
|
53
|
-
options: p
|
|
54
|
-
}), o.addEventListener(c, u, p);
|
|
55
|
-
}, []), a = L((o, c, u, p) => {
|
|
56
|
-
var d;
|
|
57
|
-
let y = ((d = t.current.get(u)) === null || d === void 0 ? void 0 : d.fn) || u;
|
|
58
|
-
o.removeEventListener(c, y, p), t.current.delete(u);
|
|
59
|
-
}, []), i = L(() => {
|
|
60
|
-
t.current.forEach((o, c) => {
|
|
61
|
-
a(o.eventTarget, o.type, c, o.options);
|
|
62
|
-
});
|
|
63
|
-
}, [
|
|
64
|
-
a
|
|
65
|
-
]);
|
|
66
|
-
return Q(() => i, [
|
|
67
|
-
i
|
|
68
|
-
]), {
|
|
69
|
-
addGlobalListener: r,
|
|
70
|
-
removeGlobalListener: a,
|
|
71
|
-
removeAllGlobalListeners: i
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function pe(t, r) {
|
|
75
|
-
Ke(() => {
|
|
76
|
-
if (t && t.ref && r)
|
|
77
|
-
return t.ref.current = r.current, () => {
|
|
78
|
-
t.ref && (t.ref.current = null);
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
let M = "default", q = "", H = /* @__PURE__ */ new WeakMap();
|
|
83
|
-
function re(t) {
|
|
84
|
-
if (ue()) {
|
|
85
|
-
if (M === "default") {
|
|
86
|
-
const r = k(t);
|
|
87
|
-
q = r.documentElement.style.webkitUserSelect, r.documentElement.style.webkitUserSelect = "none";
|
|
88
|
-
}
|
|
89
|
-
M = "disabled";
|
|
90
|
-
} else (t instanceof HTMLElement || t instanceof SVGElement) && (H.set(t, t.style.userSelect), t.style.userSelect = "none");
|
|
91
|
-
}
|
|
92
|
-
function X(t) {
|
|
93
|
-
if (ue()) {
|
|
94
|
-
if (M !== "disabled") return;
|
|
95
|
-
M = "restoring", setTimeout(() => {
|
|
96
|
-
xe(() => {
|
|
97
|
-
if (M === "restoring") {
|
|
98
|
-
const r = k(t);
|
|
99
|
-
r.documentElement.style.webkitUserSelect === "none" && (r.documentElement.style.webkitUserSelect = q || ""), q = "", M = "default";
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}, 300);
|
|
103
|
-
} else if ((t instanceof HTMLElement || t instanceof SVGElement) && t && H.has(t)) {
|
|
104
|
-
let r = H.get(t);
|
|
105
|
-
t.style.userSelect === "none" && (t.style.userSelect = r), t.getAttribute("style") === "" && t.removeAttribute("style"), H.delete(t);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const ge = fe.createContext({
|
|
109
|
-
register: () => {
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
ge.displayName = "PressResponderContext";
|
|
113
|
-
function Fe(t, r) {
|
|
114
|
-
return r.get ? r.get.call(t) : r.value;
|
|
115
|
-
}
|
|
116
|
-
function ve(t, r, a) {
|
|
117
|
-
if (!r.has(t)) throw new TypeError("attempted to " + a + " private field on non-instance");
|
|
118
|
-
return r.get(t);
|
|
119
|
-
}
|
|
120
|
-
function Ie(t, r) {
|
|
121
|
-
var a = ve(t, r, "get");
|
|
122
|
-
return Fe(t, a);
|
|
123
|
-
}
|
|
124
|
-
function Le(t, r) {
|
|
125
|
-
if (r.has(t))
|
|
126
|
-
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
127
|
-
}
|
|
128
|
-
function Ue(t, r, a) {
|
|
129
|
-
Le(t, r), r.set(t, a);
|
|
130
|
-
}
|
|
131
|
-
function Ae(t, r, a) {
|
|
132
|
-
if (r.set) r.set.call(t, a);
|
|
133
|
-
else {
|
|
134
|
-
if (!r.writable)
|
|
135
|
-
throw new TypeError("attempted to set read only private field");
|
|
136
|
-
r.value = a;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
function ne(t, r, a) {
|
|
140
|
-
var i = ve(t, r, "set");
|
|
141
|
-
return Ae(t, i, a), a;
|
|
142
|
-
}
|
|
143
|
-
function Ye(t) {
|
|
144
|
-
let r = de(ge);
|
|
145
|
-
if (r) {
|
|
146
|
-
let { register: a, ...i } = r;
|
|
147
|
-
t = D(i, t), a();
|
|
148
|
-
}
|
|
149
|
-
return pe(r, t.ref), t;
|
|
150
|
-
}
|
|
151
|
-
var G = /* @__PURE__ */ new WeakMap();
|
|
152
|
-
class B {
|
|
153
|
-
continuePropagation() {
|
|
154
|
-
ne(this, G, !1);
|
|
155
|
-
}
|
|
156
|
-
get shouldStopPropagation() {
|
|
157
|
-
return Ie(this, G);
|
|
158
|
-
}
|
|
159
|
-
constructor(r, a, i, o) {
|
|
160
|
-
Ue(this, G, {
|
|
161
|
-
writable: !0,
|
|
162
|
-
value: void 0
|
|
163
|
-
}), ne(this, G, !0);
|
|
164
|
-
var c;
|
|
165
|
-
let u = (c = o == null ? void 0 : o.target) !== null && c !== void 0 ? c : i.currentTarget;
|
|
166
|
-
const p = u == null ? void 0 : u.getBoundingClientRect();
|
|
167
|
-
let d, y = 0, b, O = null;
|
|
168
|
-
i.clientX != null && i.clientY != null && (b = i.clientX, O = i.clientY), p && (b != null && O != null ? (d = b - p.left, y = O - p.top) : (d = p.width / 2, y = p.height / 2)), this.type = r, this.pointerType = a, this.target = i.currentTarget, this.shiftKey = i.shiftKey, this.metaKey = i.metaKey, this.ctrlKey = i.ctrlKey, this.altKey = i.altKey, this.x = d, this.y = y;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const ae = Symbol("linkClicked");
|
|
172
|
-
function Xe(t) {
|
|
173
|
-
let {
|
|
174
|
-
onPress: r,
|
|
175
|
-
onPressChange: a,
|
|
176
|
-
onPressStart: i,
|
|
177
|
-
onPressEnd: o,
|
|
178
|
-
onPressUp: c,
|
|
179
|
-
isDisabled: u,
|
|
180
|
-
isPressed: p,
|
|
181
|
-
preventFocusOnPress: d,
|
|
182
|
-
shouldCancelOnPointerExit: y,
|
|
183
|
-
allowTextSelectionOnPress: b,
|
|
184
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
185
|
-
ref: O,
|
|
186
|
-
...R
|
|
187
|
-
} = Ye(t), [N, A] = Ce(!1), m = J({
|
|
188
|
-
isPressed: !1,
|
|
189
|
-
ignoreEmulatedMouseEvents: !1,
|
|
190
|
-
ignoreClickAfterPress: !1,
|
|
191
|
-
didFirePressStart: !1,
|
|
192
|
-
isTriggeringEvent: !1,
|
|
193
|
-
activePointerId: null,
|
|
194
|
-
target: null,
|
|
195
|
-
isOverTarget: !1,
|
|
196
|
-
pointerType: null
|
|
197
|
-
}), { addGlobalListener: $, removeAllGlobalListeners: x } = De(), T = F((e, f) => {
|
|
198
|
-
let h = m.current;
|
|
199
|
-
if (u || h.didFirePressStart) return !1;
|
|
200
|
-
let l = !0;
|
|
201
|
-
if (h.isTriggeringEvent = !0, i) {
|
|
202
|
-
let g = new B("pressstart", f, e);
|
|
203
|
-
i(g), l = g.shouldStopPropagation;
|
|
204
|
-
}
|
|
205
|
-
return a && a(!0), h.isTriggeringEvent = !1, h.didFirePressStart = !0, A(!0), l;
|
|
206
|
-
}), P = F((e, f, h = !0) => {
|
|
207
|
-
let l = m.current;
|
|
208
|
-
if (!l.didFirePressStart) return !1;
|
|
209
|
-
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
|
210
|
-
let g = !0;
|
|
211
|
-
if (o) {
|
|
212
|
-
let n = new B("pressend", f, e);
|
|
213
|
-
o(n), g = n.shouldStopPropagation;
|
|
214
|
-
}
|
|
215
|
-
if (a && a(!1), A(!1), r && h && !u) {
|
|
216
|
-
let n = new B("press", f, e);
|
|
217
|
-
r(n), g && (g = n.shouldStopPropagation);
|
|
218
|
-
}
|
|
219
|
-
return l.isTriggeringEvent = !1, g;
|
|
220
|
-
}), S = F((e, f) => {
|
|
221
|
-
let h = m.current;
|
|
222
|
-
if (u) return !1;
|
|
223
|
-
if (c) {
|
|
224
|
-
h.isTriggeringEvent = !0;
|
|
225
|
-
let l = new B("pressup", f, e);
|
|
226
|
-
return c(l), h.isTriggeringEvent = !1, l.shouldStopPropagation;
|
|
227
|
-
}
|
|
228
|
-
return !0;
|
|
229
|
-
}), E = F((e) => {
|
|
230
|
-
let f = m.current;
|
|
231
|
-
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && P(K(f.target, e), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, x(), b || X(f.target));
|
|
232
|
-
}), Y = F((e) => {
|
|
233
|
-
y && E(e);
|
|
234
|
-
}), ye = _e(() => {
|
|
235
|
-
let e = m.current, f = {
|
|
236
|
-
onKeyDown(l) {
|
|
237
|
-
if (j(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
|
238
|
-
var g;
|
|
239
|
-
ie(l.target, l.key) && l.preventDefault();
|
|
240
|
-
let n = !0;
|
|
241
|
-
if (!e.isPressed && !l.repeat) {
|
|
242
|
-
e.target = l.currentTarget, e.isPressed = !0, n = T(l, "keyboard");
|
|
243
|
-
let s = l.currentTarget, v = (C) => {
|
|
244
|
-
j(C, s) && !C.repeat && s.contains(C.target) && e.target && S(K(e.target, C), "keyboard");
|
|
245
|
-
};
|
|
246
|
-
$(k(l.currentTarget), "keyup", le(v, h), !0);
|
|
247
|
-
}
|
|
248
|
-
n && l.stopPropagation(), l.metaKey && V() && ((g = e.metaKeyEvents) === null || g === void 0 || g.set(l.key, l.nativeEvent));
|
|
249
|
-
} else l.key === "Meta" && (e.metaKeyEvents = /* @__PURE__ */ new Map());
|
|
250
|
-
},
|
|
251
|
-
onClick(l) {
|
|
252
|
-
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !e.isTriggeringEvent && !U.isOpening) {
|
|
253
|
-
let g = !0;
|
|
254
|
-
if (u && l.preventDefault(), !e.ignoreClickAfterPress && !e.ignoreEmulatedMouseEvents && !e.isPressed && (e.pointerType === "virtual" || ee(l.nativeEvent))) {
|
|
255
|
-
!u && !d && I(l.currentTarget);
|
|
256
|
-
let n = T(l, "virtual"), s = S(l, "virtual"), v = P(l, "virtual");
|
|
257
|
-
g = n && s && v;
|
|
258
|
-
}
|
|
259
|
-
e.ignoreEmulatedMouseEvents = !1, e.ignoreClickAfterPress = !1, g && l.stopPropagation();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}, h = (l) => {
|
|
263
|
-
var g;
|
|
264
|
-
if (e.isPressed && e.target && j(l, e.target)) {
|
|
265
|
-
var n;
|
|
266
|
-
ie(l.target, l.key) && l.preventDefault();
|
|
267
|
-
let v = l.target;
|
|
268
|
-
P(K(e.target, l), "keyboard", e.target.contains(v)), x(), l.key !== "Enter" && Z(e.target) && e.target.contains(v) && !l[ae] && (l[ae] = !0, U(e.target, l, !1)), e.isPressed = !1, (n = e.metaKeyEvents) === null || n === void 0 || n.delete(l.key);
|
|
269
|
-
} else if (l.key === "Meta" && (!((g = e.metaKeyEvents) === null || g === void 0) && g.size)) {
|
|
270
|
-
var s;
|
|
271
|
-
let v = e.metaKeyEvents;
|
|
272
|
-
e.metaKeyEvents = void 0;
|
|
273
|
-
for (let C of v.values()) (s = e.target) === null || s === void 0 || s.dispatchEvent(new KeyboardEvent("keyup", C));
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
if (typeof PointerEvent < "u") {
|
|
277
|
-
f.onPointerDown = (s) => {
|
|
278
|
-
if (s.button !== 0 || !s.currentTarget.contains(s.target)) return;
|
|
279
|
-
if (Se(s.nativeEvent)) {
|
|
280
|
-
e.pointerType = "virtual";
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
W(s.currentTarget) && s.preventDefault(), e.pointerType = s.pointerType;
|
|
284
|
-
let v = !0;
|
|
285
|
-
e.isPressed || (e.isPressed = !0, e.isOverTarget = !0, e.activePointerId = s.pointerId, e.target = s.currentTarget, !u && !d && I(s.currentTarget), b || re(e.target), v = T(s, e.pointerType), $(k(s.currentTarget), "pointermove", l, !1), $(k(s.currentTarget), "pointerup", g, !1), $(k(s.currentTarget), "pointercancel", n, !1)), v && s.stopPropagation();
|
|
286
|
-
}, f.onMouseDown = (s) => {
|
|
287
|
-
s.currentTarget.contains(s.target) && s.button === 0 && (W(s.currentTarget) && s.preventDefault(), s.stopPropagation());
|
|
288
|
-
}, f.onPointerUp = (s) => {
|
|
289
|
-
!s.currentTarget.contains(s.target) || e.pointerType === "virtual" || s.button === 0 && _(s, s.currentTarget) && S(s, e.pointerType || s.pointerType);
|
|
290
|
-
};
|
|
291
|
-
let l = (s) => {
|
|
292
|
-
s.pointerId === e.activePointerId && (e.target && _(s, e.target) ? !e.isOverTarget && e.pointerType != null && (e.isOverTarget = !0, T(K(e.target, s), e.pointerType)) : e.target && e.isOverTarget && e.pointerType != null && (e.isOverTarget = !1, P(K(e.target, s), e.pointerType, !1), Y(s)));
|
|
293
|
-
}, g = (s) => {
|
|
294
|
-
s.pointerId === e.activePointerId && e.isPressed && s.button === 0 && e.target && (_(s, e.target) && e.pointerType != null ? P(K(e.target, s), e.pointerType) : e.isOverTarget && e.pointerType != null && P(K(e.target, s), e.pointerType, !1), e.isPressed = !1, e.isOverTarget = !1, e.activePointerId = null, e.pointerType = null, x(), b || X(e.target));
|
|
295
|
-
}, n = (s) => {
|
|
296
|
-
E(s);
|
|
297
|
-
};
|
|
298
|
-
f.onDragStart = (s) => {
|
|
299
|
-
s.currentTarget.contains(s.target) && E(s);
|
|
300
|
-
};
|
|
301
|
-
} else {
|
|
302
|
-
f.onMouseDown = (n) => {
|
|
303
|
-
if (n.button !== 0 || !n.currentTarget.contains(n.target)) return;
|
|
304
|
-
if (W(n.currentTarget) && n.preventDefault(), e.ignoreEmulatedMouseEvents) {
|
|
305
|
-
n.stopPropagation();
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
e.isPressed = !0, e.isOverTarget = !0, e.target = n.currentTarget, e.pointerType = ee(n.nativeEvent) ? "virtual" : "mouse", !u && !d && I(n.currentTarget), T(n, e.pointerType) && n.stopPropagation(), $(k(n.currentTarget), "mouseup", l, !1);
|
|
309
|
-
}, f.onMouseEnter = (n) => {
|
|
310
|
-
if (!n.currentTarget.contains(n.target)) return;
|
|
311
|
-
let s = !0;
|
|
312
|
-
e.isPressed && !e.ignoreEmulatedMouseEvents && e.pointerType != null && (e.isOverTarget = !0, s = T(n, e.pointerType)), s && n.stopPropagation();
|
|
313
|
-
}, f.onMouseLeave = (n) => {
|
|
314
|
-
if (!n.currentTarget.contains(n.target)) return;
|
|
315
|
-
let s = !0;
|
|
316
|
-
e.isPressed && !e.ignoreEmulatedMouseEvents && e.pointerType != null && (e.isOverTarget = !1, s = P(n, e.pointerType, !1), Y(n)), s && n.stopPropagation();
|
|
317
|
-
}, f.onMouseUp = (n) => {
|
|
318
|
-
n.currentTarget.contains(n.target) && !e.ignoreEmulatedMouseEvents && n.button === 0 && S(n, e.pointerType || "mouse");
|
|
319
|
-
};
|
|
320
|
-
let l = (n) => {
|
|
321
|
-
if (n.button === 0) {
|
|
322
|
-
if (e.isPressed = !1, x(), e.ignoreEmulatedMouseEvents) {
|
|
323
|
-
e.ignoreEmulatedMouseEvents = !1;
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
e.target && _(n, e.target) && e.pointerType != null ? P(K(e.target, n), e.pointerType) : e.target && e.isOverTarget && e.pointerType != null && P(K(e.target, n), e.pointerType, !1), e.isOverTarget = !1;
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
f.onTouchStart = (n) => {
|
|
330
|
-
if (!n.currentTarget.contains(n.target)) return;
|
|
331
|
-
let s = Ge(n.nativeEvent);
|
|
332
|
-
if (!s) return;
|
|
333
|
-
e.activePointerId = s.identifier, e.ignoreEmulatedMouseEvents = !0, e.isOverTarget = !0, e.isPressed = !0, e.target = n.currentTarget, e.pointerType = "touch", !u && !d && I(n.currentTarget), b || re(e.target), T(w(e.target, n), e.pointerType) && n.stopPropagation(), $(z(n.currentTarget), "scroll", g, !0);
|
|
334
|
-
}, f.onTouchMove = (n) => {
|
|
335
|
-
if (!n.currentTarget.contains(n.target)) return;
|
|
336
|
-
if (!e.isPressed) {
|
|
337
|
-
n.stopPropagation();
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
let s = se(n.nativeEvent, e.activePointerId), v = !0;
|
|
341
|
-
s && _(s, n.currentTarget) ? !e.isOverTarget && e.pointerType != null && (e.isOverTarget = !0, v = T(w(e.target, n), e.pointerType)) : e.isOverTarget && e.pointerType != null && (e.isOverTarget = !1, v = P(w(e.target, n), e.pointerType, !1), Y(w(e.target, n))), v && n.stopPropagation();
|
|
342
|
-
}, f.onTouchEnd = (n) => {
|
|
343
|
-
if (!n.currentTarget.contains(n.target)) return;
|
|
344
|
-
if (!e.isPressed) {
|
|
345
|
-
n.stopPropagation();
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
let s = se(n.nativeEvent, e.activePointerId), v = !0;
|
|
349
|
-
s && _(s, n.currentTarget) && e.pointerType != null ? (S(w(e.target, n), e.pointerType), v = P(w(e.target, n), e.pointerType)) : e.isOverTarget && e.pointerType != null && (v = P(w(e.target, n), e.pointerType, !1)), v && n.stopPropagation(), e.isPressed = !1, e.activePointerId = null, e.isOverTarget = !1, e.ignoreEmulatedMouseEvents = !0, e.target && !b && X(e.target), x();
|
|
350
|
-
}, f.onTouchCancel = (n) => {
|
|
351
|
-
n.currentTarget.contains(n.target) && (n.stopPropagation(), e.isPressed && E(w(e.target, n)));
|
|
352
|
-
};
|
|
353
|
-
let g = (n) => {
|
|
354
|
-
e.isPressed && n.target.contains(e.target) && E({
|
|
355
|
-
currentTarget: e.target,
|
|
356
|
-
shiftKey: !1,
|
|
357
|
-
ctrlKey: !1,
|
|
358
|
-
metaKey: !1,
|
|
359
|
-
altKey: !1
|
|
360
|
-
});
|
|
361
|
-
};
|
|
362
|
-
f.onDragStart = (n) => {
|
|
363
|
-
n.currentTarget.contains(n.target) && E(n);
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
return f;
|
|
367
|
-
}, [
|
|
368
|
-
$,
|
|
369
|
-
u,
|
|
370
|
-
d,
|
|
371
|
-
x,
|
|
372
|
-
b,
|
|
373
|
-
E,
|
|
374
|
-
Y,
|
|
375
|
-
P,
|
|
376
|
-
T,
|
|
377
|
-
S
|
|
378
|
-
]);
|
|
379
|
-
return Q(() => () => {
|
|
380
|
-
var e;
|
|
381
|
-
b || X((e = m.current.target) !== null && e !== void 0 ? e : void 0);
|
|
382
|
-
}, [
|
|
383
|
-
b
|
|
384
|
-
]), {
|
|
385
|
-
isPressed: p || N,
|
|
386
|
-
pressProps: D(R, ye)
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function Z(t) {
|
|
390
|
-
return t.tagName === "A" && t.hasAttribute("href");
|
|
391
|
-
}
|
|
392
|
-
function j(t, r) {
|
|
393
|
-
const { key: a, code: i } = t, o = r, c = o.getAttribute("role");
|
|
394
|
-
return (a === "Enter" || a === " " || a === "Spacebar" || i === "Space") && !(o instanceof z(o).HTMLInputElement && !Pe(o, a) || o instanceof z(o).HTMLTextAreaElement || o.isContentEditable) && // Links should only trigger with Enter key
|
|
395
|
-
!((c === "link" || !c && Z(o)) && a !== "Enter");
|
|
396
|
-
}
|
|
397
|
-
function Ge(t) {
|
|
398
|
-
const { targetTouches: r } = t;
|
|
399
|
-
return r.length > 0 ? r[0] : null;
|
|
400
|
-
}
|
|
401
|
-
function se(t, r) {
|
|
402
|
-
const a = t.changedTouches;
|
|
403
|
-
for (let i = 0; i < a.length; i++) {
|
|
404
|
-
const o = a[i];
|
|
405
|
-
if (o.identifier === r) return o;
|
|
406
|
-
}
|
|
407
|
-
return null;
|
|
408
|
-
}
|
|
409
|
-
function w(t, r) {
|
|
410
|
-
let a = 0, i = 0;
|
|
411
|
-
return r.targetTouches && r.targetTouches.length === 1 && (a = r.targetTouches[0].clientX, i = r.targetTouches[0].clientY), {
|
|
412
|
-
currentTarget: t,
|
|
413
|
-
shiftKey: r.shiftKey,
|
|
414
|
-
ctrlKey: r.ctrlKey,
|
|
415
|
-
metaKey: r.metaKey,
|
|
416
|
-
altKey: r.altKey,
|
|
417
|
-
clientX: a,
|
|
418
|
-
clientY: i
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
function K(t, r) {
|
|
422
|
-
let a = r.clientX, i = r.clientY;
|
|
423
|
-
return {
|
|
424
|
-
currentTarget: t,
|
|
425
|
-
shiftKey: r.shiftKey,
|
|
426
|
-
ctrlKey: r.ctrlKey,
|
|
427
|
-
metaKey: r.metaKey,
|
|
428
|
-
altKey: r.altKey,
|
|
429
|
-
clientX: a,
|
|
430
|
-
clientY: i
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
function Be(t) {
|
|
434
|
-
let r = 0, a = 0;
|
|
435
|
-
return t.width !== void 0 ? r = t.width / 2 : t.radiusX !== void 0 && (r = t.radiusX), t.height !== void 0 ? a = t.height / 2 : t.radiusY !== void 0 && (a = t.radiusY), {
|
|
436
|
-
top: t.clientY - a,
|
|
437
|
-
right: t.clientX + r,
|
|
438
|
-
bottom: t.clientY + a,
|
|
439
|
-
left: t.clientX - r
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
function He(t, r) {
|
|
443
|
-
return !(t.left > r.right || r.left > t.right || t.top > r.bottom || r.top > t.bottom);
|
|
444
|
-
}
|
|
445
|
-
function _(t, r) {
|
|
446
|
-
let a = r.getBoundingClientRect(), i = Be(t);
|
|
447
|
-
return He(a, i);
|
|
448
|
-
}
|
|
449
|
-
function W(t) {
|
|
450
|
-
return !(t instanceof HTMLElement) || !t.hasAttribute("draggable");
|
|
451
|
-
}
|
|
452
|
-
function ie(t, r) {
|
|
453
|
-
return t instanceof HTMLInputElement ? !Pe(t, r) : t instanceof HTMLButtonElement ? t.type !== "submit" && t.type !== "reset" : !Z(t);
|
|
454
|
-
}
|
|
455
|
-
const Re = /* @__PURE__ */ new Set([
|
|
456
|
-
"checkbox",
|
|
457
|
-
"radio",
|
|
458
|
-
"range",
|
|
459
|
-
"color",
|
|
460
|
-
"file",
|
|
461
|
-
"image",
|
|
462
|
-
"button",
|
|
463
|
-
"submit",
|
|
464
|
-
"reset"
|
|
465
|
-
]);
|
|
466
|
-
function Pe(t, r) {
|
|
467
|
-
return t.type === "checkbox" || t.type === "radio" ? r === " " : Re.has(t.type);
|
|
468
|
-
}
|
|
469
|
-
function Ne(t) {
|
|
470
|
-
let { isDisabled: r, onFocus: a, onBlur: i, onFocusChange: o } = t;
|
|
471
|
-
const c = L((d) => {
|
|
472
|
-
if (d.target === d.currentTarget)
|
|
473
|
-
return i && i(d), o && o(!1), !0;
|
|
474
|
-
}, [
|
|
475
|
-
i,
|
|
476
|
-
o
|
|
477
|
-
]), u = we(c), p = L((d) => {
|
|
478
|
-
const y = k(d.target);
|
|
479
|
-
d.target === d.currentTarget && y.activeElement === d.target && (a && a(d), o && o(!0), u(d));
|
|
480
|
-
}, [
|
|
481
|
-
o,
|
|
482
|
-
a,
|
|
483
|
-
u
|
|
484
|
-
]);
|
|
485
|
-
return {
|
|
486
|
-
focusProps: {
|
|
487
|
-
onFocus: !r && (a || o || i) ? p : void 0,
|
|
488
|
-
onBlur: !r && (i || o) ? c : void 0
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
function oe(t) {
|
|
493
|
-
if (!t) return;
|
|
494
|
-
let r = !0;
|
|
495
|
-
return (a) => {
|
|
496
|
-
let i = {
|
|
497
|
-
...a,
|
|
498
|
-
preventDefault() {
|
|
499
|
-
a.preventDefault();
|
|
500
|
-
},
|
|
501
|
-
isDefaultPrevented() {
|
|
502
|
-
return a.isDefaultPrevented();
|
|
503
|
-
},
|
|
504
|
-
stopPropagation() {
|
|
505
|
-
console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
|
|
506
|
-
},
|
|
507
|
-
continuePropagation() {
|
|
508
|
-
r = !1;
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
t(i), r && a.stopPropagation();
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
function je(t) {
|
|
515
|
-
return {
|
|
516
|
-
keyboardProps: t.isDisabled ? {} : {
|
|
517
|
-
onKeyDown: oe(t.onKeyDown),
|
|
518
|
-
onKeyUp: oe(t.onKeyUp)
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
let We = /* @__PURE__ */ fe.createContext(null);
|
|
523
|
-
function Ve(t) {
|
|
524
|
-
let r = de(We) || {};
|
|
525
|
-
pe(r, t);
|
|
526
|
-
let { ref: a, ...i } = r;
|
|
527
|
-
return i;
|
|
528
|
-
}
|
|
529
|
-
function ze(t, r) {
|
|
530
|
-
let { focusProps: a } = Ne(t), { keyboardProps: i } = je(t), o = D(a, i), c = Ve(r), u = t.isDisabled ? {} : c, p = J(t.autoFocus);
|
|
531
|
-
return Q(() => {
|
|
532
|
-
p.current && r.current && ke(r.current), p.current = !1;
|
|
533
|
-
}, [
|
|
534
|
-
r
|
|
535
|
-
]), {
|
|
536
|
-
focusableProps: D({
|
|
537
|
-
...o,
|
|
538
|
-
tabIndex: t.excludeFromTabOrder && !t.isDisabled ? -1 : void 0
|
|
539
|
-
}, u)
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
function qe(t, r) {
|
|
543
|
-
let {
|
|
544
|
-
elementType: a = "button",
|
|
545
|
-
isDisabled: i,
|
|
546
|
-
onPress: o,
|
|
547
|
-
onPressStart: c,
|
|
548
|
-
onPressEnd: u,
|
|
549
|
-
onPressUp: p,
|
|
550
|
-
onPressChange: d,
|
|
551
|
-
preventFocusOnPress: y,
|
|
552
|
-
allowFocusWhenDisabled: b,
|
|
553
|
-
// @ts-ignore
|
|
554
|
-
onClick: O,
|
|
555
|
-
href: R,
|
|
556
|
-
target: N,
|
|
557
|
-
rel: A,
|
|
558
|
-
type: m = "button"
|
|
559
|
-
} = t, $;
|
|
560
|
-
a === "button" ? $ = {
|
|
561
|
-
type: m,
|
|
562
|
-
disabled: i
|
|
563
|
-
} : $ = {
|
|
564
|
-
role: "button",
|
|
565
|
-
tabIndex: i ? void 0 : 0,
|
|
566
|
-
href: a === "a" && i ? void 0 : R,
|
|
567
|
-
target: a === "a" ? N : void 0,
|
|
568
|
-
type: a === "input" ? m : void 0,
|
|
569
|
-
disabled: a === "input" ? i : void 0,
|
|
570
|
-
"aria-disabled": !i || a === "input" ? void 0 : i,
|
|
571
|
-
rel: a === "a" ? A : void 0
|
|
572
|
-
};
|
|
573
|
-
let { pressProps: x, isPressed: T } = Xe({
|
|
574
|
-
onPressStart: c,
|
|
575
|
-
onPressEnd: u,
|
|
576
|
-
onPressChange: d,
|
|
577
|
-
onPress: o,
|
|
578
|
-
onPressUp: p,
|
|
579
|
-
isDisabled: i,
|
|
580
|
-
preventFocusOnPress: y,
|
|
581
|
-
ref: r
|
|
582
|
-
}), { focusableProps: P } = ze(t, r);
|
|
583
|
-
b && (P.tabIndex = i ? -1 : P.tabIndex);
|
|
584
|
-
let S = D(P, x, Oe(t, {
|
|
585
|
-
labelable: !0
|
|
586
|
-
}));
|
|
587
|
-
return {
|
|
588
|
-
isPressed: T,
|
|
589
|
-
buttonProps: D($, S, {
|
|
590
|
-
"aria-haspopup": t["aria-haspopup"],
|
|
591
|
-
"aria-expanded": t["aria-expanded"],
|
|
592
|
-
"aria-controls": t["aria-controls"],
|
|
593
|
-
"aria-pressed": t["aria-pressed"],
|
|
594
|
-
onClick: (E) => {
|
|
595
|
-
O && (O(E), console.warn("onClick is deprecated, please use onPress"));
|
|
596
|
-
}
|
|
597
|
-
})
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
function nt({ buttonRef: t, variant: r, iconName: a, children: i, ...o }) {
|
|
601
|
-
const { buttonProps: c } = qe(o, t);
|
|
602
|
-
return /* @__PURE__ */ be("button", { ...c, ref: t, className: ce(te.button, te[`button--${r}`]), children: [
|
|
603
|
-
i,
|
|
604
|
-
a && /* @__PURE__ */ $e(Me, { name: a })
|
|
1
|
+
import { jsxs as e, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useButton as c } from "@react-aria/button";
|
|
3
|
+
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { s as r } from "../../Button.module-DfLXeuUK.js";
|
|
5
|
+
import { Icon as i } from "../Icon/Icon.js";
|
|
6
|
+
function B({ buttonRef: t, variant: s, iconName: o, children: n, ...m }) {
|
|
7
|
+
const { buttonProps: u } = c(m, t);
|
|
8
|
+
return /* @__PURE__ */ e("button", { ...u, ref: t, className: f(r.button, r[`button--${s}`]), children: [
|
|
9
|
+
n,
|
|
10
|
+
o && /* @__PURE__ */ p(i, { name: o })
|
|
605
11
|
] });
|
|
606
12
|
}
|
|
607
13
|
export {
|
|
608
|
-
|
|
14
|
+
B as MenuButton
|
|
609
15
|
};
|
|
610
16
|
//# sourceMappingURL=MenuButton.js.map
|