@easypost/easy-ui 1.0.0-alpha.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.
Files changed (145) hide show
  1. package/Button/Button.d.ts +27 -0
  2. package/Button/Button.d.ts.map +1 -0
  3. package/Button/Button.test.d.ts +2 -0
  4. package/Button/Button.test.d.ts.map +1 -0
  5. package/Button/index.d.ts +2 -0
  6. package/Button/index.d.ts.map +1 -0
  7. package/Button/index.js +1 -0
  8. package/Button/index.mjs +49 -0
  9. package/Button/utilities.d.ts +5 -0
  10. package/Button/utilities.d.ts.map +1 -0
  11. package/Button.module-115ca683.mjs +818 -0
  12. package/Button.module-14fa8511.js +1 -0
  13. package/Button.module-1fb91980.js +1 -0
  14. package/Button.module-494257e9.js +1 -0
  15. package/Button.module-5cc363bc.js +1 -0
  16. package/Button.module-5ce97013.mjs +818 -0
  17. package/Button.module-607d5623.mjs +818 -0
  18. package/Button.module-679f6b64.js +1 -0
  19. package/Button.module-7023bed7.mjs +818 -0
  20. package/Button.module-77f21f0f.mjs +818 -0
  21. package/Button.module-7d974638.mjs +818 -0
  22. package/Button.module-7f3d0216.js +1 -0
  23. package/Button.module-82af93cc.mjs +818 -0
  24. package/Button.module-9123c201.mjs +818 -0
  25. package/Button.module-91cfa338.js +1 -0
  26. package/Button.module-942c4274.js +1 -0
  27. package/Button.module-94a630d2.js +1 -0
  28. package/Button.module-a2c386c5.mjs +818 -0
  29. package/Button.module-aa9387fb.js +1 -0
  30. package/Button.module-baa496d5.mjs +818 -0
  31. package/DropdownButton/DropdownButton.d.ts +15 -0
  32. package/DropdownButton/DropdownButton.d.ts.map +1 -0
  33. package/DropdownButton/DropdownButton.test.d.ts +2 -0
  34. package/DropdownButton/DropdownButton.test.d.ts.map +1 -0
  35. package/DropdownButton/index.d.ts +2 -0
  36. package/DropdownButton/index.d.ts.map +1 -0
  37. package/DropdownButton/index.js +1 -0
  38. package/DropdownButton/index.mjs +40 -0
  39. package/Icon/Icon.d.ts +17 -0
  40. package/Icon/Icon.d.ts.map +1 -0
  41. package/Icon/Icon.test.d.ts +2 -0
  42. package/Icon/Icon.test.d.ts.map +1 -0
  43. package/Icon/index.d.ts +2 -0
  44. package/Icon/index.d.ts.map +1 -0
  45. package/Icon/index.js +1 -0
  46. package/Icon/index.mjs +6 -0
  47. package/Icon-0c035f66.mjs +30 -0
  48. package/Icon-1b63144c.js +1 -0
  49. package/Icon-37ce3d9a.mjs +30 -0
  50. package/Icon-53acbca3.mjs +30 -0
  51. package/Icon-5639942d.js +1 -0
  52. package/Icon-570b5898.js +1 -0
  53. package/Icon-666c3de5.js +1 -0
  54. package/Icon-68936d33.mjs +30 -0
  55. package/Icon-6abef12c.mjs +30 -0
  56. package/Icon-8baad3e8.js +1 -0
  57. package/Icon-8d3de3bb.js +1 -0
  58. package/Icon-96d00995.mjs +30 -0
  59. package/Icon-98a40b01.mjs +30 -0
  60. package/Icon-aa3be33e.js +1 -0
  61. package/Icon-d82e92cf.js +1 -0
  62. package/Icon-da4359df.mjs +30 -0
  63. package/Icon-e3fea9c2.mjs +30 -0
  64. package/Icon-e457e65d.js +1 -0
  65. package/Icon-eacb00d7.js +1 -0
  66. package/Icon-fea6a93a.mjs +30 -0
  67. package/Placeholder/Placeholder.d.ts +15 -0
  68. package/Placeholder/Placeholder.d.ts.map +1 -0
  69. package/Placeholder/Placeholder.test.d.ts +2 -0
  70. package/Placeholder/Placeholder.test.d.ts.map +1 -0
  71. package/Placeholder/index.d.ts +2 -0
  72. package/Placeholder/index.d.ts.map +1 -0
  73. package/Placeholder/index.js +1 -0
  74. package/Placeholder/index.mjs +65 -0
  75. package/Provider/Provider.d.ts +10 -0
  76. package/Provider/Provider.d.ts.map +1 -0
  77. package/Provider/index.d.ts +2 -0
  78. package/Provider/index.d.ts.map +1 -0
  79. package/Provider/index.js +1 -0
  80. package/Provider/index.mjs +9 -0
  81. package/Text/Text.d.ts +70 -0
  82. package/Text/Text.d.ts.map +1 -0
  83. package/Text/Text.test.d.ts +2 -0
  84. package/Text/Text.test.d.ts.map +1 -0
  85. package/Text/index.d.ts +2 -0
  86. package/Text/index.d.ts.map +1 -0
  87. package/Text/index.js +1 -0
  88. package/Text/index.mjs +60 -0
  89. package/Theme/Container.d.ts +6 -0
  90. package/Theme/Container.d.ts.map +1 -0
  91. package/Theme/Theme.d.ts +63 -0
  92. package/Theme/Theme.d.ts.map +1 -0
  93. package/Theme/Theme.test.d.ts +2 -0
  94. package/Theme/Theme.test.d.ts.map +1 -0
  95. package/Theme/index.d.ts +2 -0
  96. package/Theme/index.d.ts.map +1 -0
  97. package/Theme/index.js +1 -0
  98. package/Theme/index.mjs +8 -0
  99. package/Theme-0f0cbd77.mjs +396 -0
  100. package/Theme-122e766e.mjs +63 -0
  101. package/Theme-141dde98.js +7 -0
  102. package/Theme-161aed4a.mjs +389 -0
  103. package/Theme-1644b1f8.js +1 -0
  104. package/Theme-1a567898.js +18 -0
  105. package/Theme-2364878e.js +33 -0
  106. package/Theme-5ea4ba90.js +5 -0
  107. package/Theme-6ff68130.mjs +3764 -0
  108. package/Theme-93ca6374.js +18 -0
  109. package/Theme-e616f85f.mjs +57 -0
  110. package/Theme-f6215b48.mjs +375 -0
  111. package/package.json +19 -0
  112. package/style.css +1 -0
  113. package/styles/ezui-theme.scss.js +1 -0
  114. package/styles/ezui-theme.scss.mjs +4 -0
  115. package/theme.css +13 -0
  116. package/tokens-19a34c03.js +1 -0
  117. package/tokens-32b892de.mjs +192 -0
  118. package/tokens-4571c29d.js +1 -0
  119. package/tokens-713623f4.mjs +210 -0
  120. package/tokens-e7406ce6.js +1 -0
  121. package/tokens-ecab3956.mjs +196 -0
  122. package/types.d.ts +16 -0
  123. package/types.d.ts.map +1 -0
  124. package/utilities/css.d.ts +21 -0
  125. package/utilities/css.d.ts.map +1 -0
  126. package/utilities/css.js +1 -0
  127. package/utilities/css.mjs +47 -0
  128. package/utilities/css.test.d.ts +2 -0
  129. package/utilities/css.test.d.ts.map +1 -0
  130. package/utilities/css.test.js +1 -0
  131. package/utilities/css.test.mjs +56 -0
  132. package/utilities/storybook.d.ts +33 -0
  133. package/utilities/storybook.d.ts.map +1 -0
  134. package/utilities/storybook.js +1 -0
  135. package/utilities/storybook.mjs +33 -0
  136. package/utilities/tokens.d.ts +2 -0
  137. package/utilities/tokens.d.ts.map +1 -0
  138. package/utilities/tokens.js +1 -0
  139. package/utilities/tokens.mjs +9 -0
  140. package/utilities/tokens.test.d.ts +2 -0
  141. package/utilities/tokens.test.d.ts.map +1 -0
  142. package/utilities/types.d.ts +7 -0
  143. package/utilities/types.d.ts.map +1 -0
  144. package/utilities/types.js +1 -0
  145. package/utilities/types.mjs +1 -0
@@ -0,0 +1,818 @@
1
+ import Q, { useRef as D, useCallback as K, useEffect as Z, useState as xe, useMemo as _e, useContext as ge } from "react";
2
+ function ve(e) {
3
+ var t, r, o = "";
4
+ if (typeof e == "string" || typeof e == "number")
5
+ o += e;
6
+ else if (typeof e == "object")
7
+ if (Array.isArray(e))
8
+ for (t = 0; t < e.length; t++)
9
+ e[t] && (r = ve(e[t])) && (o && (o += " "), o += r);
10
+ else
11
+ for (t in e)
12
+ e[t] && (o && (o += " "), o += t);
13
+ return o;
14
+ }
15
+ function Le() {
16
+ for (var e, t, r = 0, o = ""; r < arguments.length; )
17
+ (e = arguments[r++]) && (t = ve(e)) && (o && (o += " "), o += t);
18
+ return o;
19
+ }
20
+ const $e = typeof window < "u" ? Q.useLayoutEffect : () => {
21
+ };
22
+ let ae = /* @__PURE__ */ new Map();
23
+ function Me(e, t) {
24
+ if (e === t)
25
+ return e;
26
+ let r = ae.get(e);
27
+ if (r)
28
+ return r(t), t;
29
+ let o = ae.get(t);
30
+ return o ? (o(e), e) : t;
31
+ }
32
+ function Ce(...e) {
33
+ return (...t) => {
34
+ for (let r of e)
35
+ typeof r == "function" && r(...t);
36
+ };
37
+ }
38
+ function k(...e) {
39
+ let t = {
40
+ ...e[0]
41
+ };
42
+ for (let r = 1; r < e.length; r++) {
43
+ let o = e[r];
44
+ for (let l in o) {
45
+ let c = t[l], u = o[l];
46
+ typeof c == "function" && typeof u == "function" && // This is a lot faster than a regex.
47
+ l[0] === "o" && l[1] === "n" && l.charCodeAt(2) >= /* 'A' */
48
+ 65 && l.charCodeAt(2) <= /* 'Z' */
49
+ 90 ? t[l] = Ce(c, u) : (l === "className" || l === "UNSAFE_className") && typeof c == "string" && typeof u == "string" ? t[l] = Le(c, u) : l === "id" && c && u ? t.id = Me(c, u) : t[l] = u !== void 0 ? u : c;
50
+ }
51
+ }
52
+ return t;
53
+ }
54
+ const Ke = /* @__PURE__ */ new Set([
55
+ "id"
56
+ ]), ke = /* @__PURE__ */ new Set([
57
+ "aria-label",
58
+ "aria-labelledby",
59
+ "aria-describedby",
60
+ "aria-details"
61
+ ]), Oe = /^(data-.*)$/;
62
+ function De(e, t = {}) {
63
+ let { labelable: r, propNames: o } = t, l = {};
64
+ for (const c in e)
65
+ Object.prototype.hasOwnProperty.call(e, c) && (Ke.has(c) || r && ke.has(c) || o != null && o.has(c) || Oe.test(c)) && (l[c] = e[c]);
66
+ return l;
67
+ }
68
+ function M(e) {
69
+ if (Fe())
70
+ e.focus({
71
+ preventScroll: !0
72
+ });
73
+ else {
74
+ let t = Ae(e);
75
+ e.focus(), Ie(t);
76
+ }
77
+ }
78
+ let N = null;
79
+ function Fe() {
80
+ if (N == null) {
81
+ N = !1;
82
+ try {
83
+ var e = document.createElement("div");
84
+ e.focus({
85
+ get preventScroll() {
86
+ return N = !0, !0;
87
+ }
88
+ });
89
+ } catch {
90
+ }
91
+ }
92
+ return N;
93
+ }
94
+ function Ae(e) {
95
+ for (var t = e.parentNode, r = [], o = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== o; )
96
+ (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
97
+ element: t,
98
+ scrollTop: t.scrollTop,
99
+ scrollLeft: t.scrollLeft
100
+ }), t = t.parentNode;
101
+ return o instanceof HTMLElement && r.push({
102
+ element: o,
103
+ scrollTop: o.scrollTop,
104
+ scrollLeft: o.scrollLeft
105
+ }), r;
106
+ }
107
+ function Ie(e) {
108
+ for (let { element: t, scrollTop: r, scrollLeft: o } of e)
109
+ t.scrollTop = r, t.scrollLeft = o;
110
+ }
111
+ let L = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Set();
112
+ function se() {
113
+ if (typeof window > "u")
114
+ return;
115
+ let e = (r) => {
116
+ let o = L.get(r.target);
117
+ o || (o = /* @__PURE__ */ new Set(), L.set(r.target, o), r.target.addEventListener("transitioncancel", t)), o.add(r.propertyName);
118
+ }, t = (r) => {
119
+ let o = L.get(r.target);
120
+ if (o && (o.delete(r.propertyName), o.size === 0 && (r.target.removeEventListener("transitioncancel", t), L.delete(r.target)), L.size === 0)) {
121
+ for (let l of W)
122
+ l();
123
+ W.clear();
124
+ }
125
+ };
126
+ document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
127
+ }
128
+ typeof document < "u" && (document.readyState !== "loading" ? se() : document.addEventListener("DOMContentLoaded", se));
129
+ function ye(e) {
130
+ requestAnimationFrame(() => {
131
+ L.size === 0 ? e() : W.add(e);
132
+ });
133
+ }
134
+ function Re() {
135
+ let e = D(/* @__PURE__ */ new Map()), t = K((l, c, u, d) => {
136
+ let f = d != null && d.once ? (...E) => {
137
+ e.current.delete(u), u(...E);
138
+ } : u;
139
+ e.current.set(u, {
140
+ type: c,
141
+ eventTarget: l,
142
+ fn: f,
143
+ options: d
144
+ }), l.addEventListener(c, u, d);
145
+ }, []), r = K((l, c, u, d) => {
146
+ var f;
147
+ let E = ((f = e.current.get(u)) === null || f === void 0 ? void 0 : f.fn) || u;
148
+ l.removeEventListener(c, E, d), e.current.delete(u);
149
+ }, []), o = K(() => {
150
+ e.current.forEach((l, c) => {
151
+ r(l.eventTarget, l.type, c, l.options);
152
+ });
153
+ }, [
154
+ r
155
+ ]);
156
+ return Z(() => o, [
157
+ o
158
+ ]), {
159
+ addGlobalListener: t,
160
+ removeGlobalListener: r,
161
+ removeAllGlobalListeners: o
162
+ };
163
+ }
164
+ function Pe(e, t) {
165
+ $e(() => {
166
+ if (e && e.ref && t)
167
+ return e.ref.current = t.current, () => {
168
+ e.ref.current = null;
169
+ };
170
+ }, [
171
+ e,
172
+ t
173
+ ]);
174
+ }
175
+ function Ne(e) {
176
+ var t;
177
+ return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((r) => e.test(r.brand))) || e.test(window.navigator.userAgent);
178
+ }
179
+ function ee(e) {
180
+ var t;
181
+ return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
182
+ }
183
+ function me() {
184
+ return ee(/^Mac/i);
185
+ }
186
+ function Ue() {
187
+ return ee(/^iPhone/i);
188
+ }
189
+ function He() {
190
+ return ee(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
191
+ me() && navigator.maxTouchPoints > 1;
192
+ }
193
+ function he() {
194
+ return Ue() || He();
195
+ }
196
+ function Be() {
197
+ return Ne(/Android/i);
198
+ }
199
+ function V(e) {
200
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : Be() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
201
+ }
202
+ function je(e) {
203
+ return e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
204
+ }
205
+ function Y(e, t, r) {
206
+ return t in e ? Object.defineProperty(e, t, {
207
+ value: r,
208
+ enumerable: !0,
209
+ configurable: !0,
210
+ writable: !0
211
+ }) : e[t] = r, e;
212
+ }
213
+ let C = "default", X = "", H = /* @__PURE__ */ new WeakMap();
214
+ function ie(e) {
215
+ he() ? (C === "default" && (X = document.documentElement.style.webkitUserSelect, document.documentElement.style.webkitUserSelect = "none"), C = "disabled") : (e instanceof HTMLElement || e instanceof SVGElement) && (H.set(e, e.style.userSelect), e.style.userSelect = "none");
216
+ }
217
+ function U(e) {
218
+ if (he()) {
219
+ if (C !== "disabled")
220
+ return;
221
+ C = "restoring", setTimeout(() => {
222
+ ye(() => {
223
+ C === "restoring" && (document.documentElement.style.webkitUserSelect === "none" && (document.documentElement.style.webkitUserSelect = X || ""), X = "", C = "default");
224
+ });
225
+ }, 300);
226
+ } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && H.has(e)) {
227
+ let t = H.get(e);
228
+ e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), H.delete(e);
229
+ }
230
+ }
231
+ const Te = Q.createContext(null);
232
+ Te.displayName = "PressResponderContext";
233
+ function Ge(e) {
234
+ let t = ge(Te);
235
+ if (t) {
236
+ let { register: r, ...o } = t;
237
+ e = k(o, e), r();
238
+ }
239
+ return Pe(t, e.ref), e;
240
+ }
241
+ function ze(e) {
242
+ let {
243
+ onPress: t,
244
+ onPressChange: r,
245
+ onPressStart: o,
246
+ onPressEnd: l,
247
+ onPressUp: c,
248
+ isDisabled: u,
249
+ isPressed: d,
250
+ preventFocusOnPress: f,
251
+ shouldCancelOnPointerExit: E,
252
+ allowTextSelectionOnPress: v,
253
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
254
+ ref: ne,
255
+ ...B
256
+ } = Ge(e), y = D(null);
257
+ y.current = {
258
+ onPress: t,
259
+ onPressChange: r,
260
+ onPressStart: o,
261
+ onPressEnd: l,
262
+ onPressUp: c,
263
+ isDisabled: u,
264
+ shouldCancelOnPointerExit: E
265
+ };
266
+ let [A, S] = xe(!1), I = D({
267
+ isPressed: !1,
268
+ ignoreEmulatedMouseEvents: !1,
269
+ ignoreClickAfterPress: !1,
270
+ didFirePressStart: !1,
271
+ activePointerId: null,
272
+ target: null,
273
+ isOverTarget: !1,
274
+ pointerType: null
275
+ }), { addGlobalListener: P, removeAllGlobalListeners: $ } = Re(), j = _e(() => {
276
+ let n = I.current, h = (s, b) => {
277
+ let { onPressStart: a, onPressChange: i, isDisabled: R } = y.current;
278
+ R || n.didFirePressStart || (a && a({
279
+ type: "pressstart",
280
+ pointerType: b,
281
+ target: s.currentTarget,
282
+ shiftKey: s.shiftKey,
283
+ metaKey: s.metaKey,
284
+ ctrlKey: s.ctrlKey,
285
+ altKey: s.altKey
286
+ }), i && i(!0), n.didFirePressStart = !0, S(!0));
287
+ }, g = (s, b, a = !0) => {
288
+ let { onPressEnd: i, onPressChange: R, onPress: oe, isDisabled: Se } = y.current;
289
+ n.didFirePressStart && (n.ignoreClickAfterPress = !0, n.didFirePressStart = !1, i && i({
290
+ type: "pressend",
291
+ pointerType: b,
292
+ target: s.currentTarget,
293
+ shiftKey: s.shiftKey,
294
+ metaKey: s.metaKey,
295
+ ctrlKey: s.ctrlKey,
296
+ altKey: s.altKey
297
+ }), R && R(!1), S(!1), oe && a && !Se && oe({
298
+ type: "press",
299
+ pointerType: b,
300
+ target: s.currentTarget,
301
+ shiftKey: s.shiftKey,
302
+ metaKey: s.metaKey,
303
+ ctrlKey: s.ctrlKey,
304
+ altKey: s.altKey
305
+ }));
306
+ }, O = (s, b) => {
307
+ let { onPressUp: a, isDisabled: i } = y.current;
308
+ i || a && a({
309
+ type: "pressup",
310
+ pointerType: b,
311
+ target: s.currentTarget,
312
+ shiftKey: s.shiftKey,
313
+ metaKey: s.metaKey,
314
+ ctrlKey: s.ctrlKey,
315
+ altKey: s.altKey
316
+ });
317
+ }, T = (s) => {
318
+ n.isPressed && (n.isOverTarget && g(m(n.target, s), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, $(), v || U(n.target));
319
+ }, p = {
320
+ onKeyDown(s) {
321
+ G(s.nativeEvent, s.currentTarget) && s.currentTarget.contains(s.target) ? (ce(s.target, s.key) && s.preventDefault(), s.stopPropagation(), !n.isPressed && !s.repeat && (n.target = s.currentTarget, n.isPressed = !0, h(s, "keyboard"), P(document, "keyup", we, !1))) : s.key === "Enter" && q(s.currentTarget) && s.stopPropagation();
322
+ },
323
+ onKeyUp(s) {
324
+ G(s.nativeEvent, s.currentTarget) && !s.repeat && s.currentTarget.contains(s.target) && O(m(n.target, s), "keyboard");
325
+ },
326
+ onClick(s) {
327
+ s && !s.currentTarget.contains(s.target) || s && s.button === 0 && (s.stopPropagation(), u && s.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && (n.pointerType === "virtual" || V(s.nativeEvent)) && (!u && !f && M(s.currentTarget), h(s, "virtual"), O(s, "virtual"), g(s, "virtual")), n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1);
328
+ }
329
+ }, we = (s) => {
330
+ if (n.isPressed && G(s, n.target)) {
331
+ ce(s.target, s.key) && s.preventDefault(), s.stopPropagation(), n.isPressed = !1;
332
+ let b = s.target;
333
+ g(m(n.target, s), "keyboard", n.target.contains(b)), $(), n.target instanceof HTMLElement && n.target.contains(b) && (q(n.target) || n.target.getAttribute("role") === "link") && n.target.click();
334
+ }
335
+ };
336
+ if (typeof PointerEvent < "u") {
337
+ p.onPointerDown = (i) => {
338
+ if (!(i.button !== 0 || !i.currentTarget.contains(i.target))) {
339
+ if (je(i.nativeEvent)) {
340
+ n.pointerType = "virtual";
341
+ return;
342
+ }
343
+ z(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType, i.stopPropagation(), n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !u && !f && M(i.currentTarget), v || ie(n.target), h(i, n.pointerType), P(document, "pointermove", s, !1), P(document, "pointerup", b, !1), P(document, "pointercancel", a, !1));
344
+ }
345
+ }, p.onMouseDown = (i) => {
346
+ i.currentTarget.contains(i.target) && i.button === 0 && (z(i.currentTarget) && i.preventDefault(), i.stopPropagation());
347
+ }, p.onPointerUp = (i) => {
348
+ !i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && x(i, i.currentTarget) && O(i, n.pointerType || i.pointerType);
349
+ };
350
+ let s = (i) => {
351
+ i.pointerId === n.activePointerId && (x(i, n.target) ? n.isOverTarget || (n.isOverTarget = !0, h(m(n.target, i), n.pointerType)) : n.isOverTarget && (n.isOverTarget = !1, g(m(n.target, i), n.pointerType, !1), y.current.shouldCancelOnPointerExit && T(i)));
352
+ }, b = (i) => {
353
+ i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && (x(i, n.target) ? g(m(n.target, i), n.pointerType) : n.isOverTarget && g(m(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, $(), v || U(n.target));
354
+ }, a = (i) => {
355
+ T(i);
356
+ };
357
+ p.onDragStart = (i) => {
358
+ i.currentTarget.contains(i.target) && T(i);
359
+ };
360
+ } else {
361
+ p.onMouseDown = (a) => {
362
+ a.button !== 0 || !a.currentTarget.contains(a.target) || (z(a.currentTarget) && a.preventDefault(), a.stopPropagation(), !n.ignoreEmulatedMouseEvents && (n.isPressed = !0, n.isOverTarget = !0, n.target = a.currentTarget, n.pointerType = V(a.nativeEvent) ? "virtual" : "mouse", !u && !f && M(a.currentTarget), h(a, n.pointerType), P(document, "mouseup", s, !1)));
363
+ }, p.onMouseEnter = (a) => {
364
+ a.currentTarget.contains(a.target) && (a.stopPropagation(), n.isPressed && !n.ignoreEmulatedMouseEvents && (n.isOverTarget = !0, h(a, n.pointerType)));
365
+ }, p.onMouseLeave = (a) => {
366
+ a.currentTarget.contains(a.target) && (a.stopPropagation(), n.isPressed && !n.ignoreEmulatedMouseEvents && (n.isOverTarget = !1, g(a, n.pointerType, !1), y.current.shouldCancelOnPointerExit && T(a)));
367
+ }, p.onMouseUp = (a) => {
368
+ a.currentTarget.contains(a.target) && !n.ignoreEmulatedMouseEvents && a.button === 0 && O(a, n.pointerType);
369
+ };
370
+ let s = (a) => {
371
+ if (a.button === 0) {
372
+ if (n.isPressed = !1, $(), n.ignoreEmulatedMouseEvents) {
373
+ n.ignoreEmulatedMouseEvents = !1;
374
+ return;
375
+ }
376
+ x(a, n.target) ? g(m(n.target, a), n.pointerType) : n.isOverTarget && g(m(n.target, a), n.pointerType, !1), n.isOverTarget = !1;
377
+ }
378
+ };
379
+ p.onTouchStart = (a) => {
380
+ if (!a.currentTarget.contains(a.target))
381
+ return;
382
+ a.stopPropagation();
383
+ let i = We(a.nativeEvent);
384
+ i && (n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = a.currentTarget, n.pointerType = "touch", !u && !f && M(a.currentTarget), v || ie(n.target), h(a, n.pointerType), P(window, "scroll", b, !0));
385
+ }, p.onTouchMove = (a) => {
386
+ if (!a.currentTarget.contains(a.target) || (a.stopPropagation(), !n.isPressed))
387
+ return;
388
+ let i = le(a.nativeEvent, n.activePointerId);
389
+ i && x(i, a.currentTarget) ? n.isOverTarget || (n.isOverTarget = !0, h(a, n.pointerType)) : n.isOverTarget && (n.isOverTarget = !1, g(a, n.pointerType, !1), y.current.shouldCancelOnPointerExit && T(a));
390
+ }, p.onTouchEnd = (a) => {
391
+ if (!a.currentTarget.contains(a.target) || (a.stopPropagation(), !n.isPressed))
392
+ return;
393
+ let i = le(a.nativeEvent, n.activePointerId);
394
+ i && x(i, a.currentTarget) ? (O(a, n.pointerType), g(a, n.pointerType)) : n.isOverTarget && g(a, n.pointerType, !1), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, v || U(n.target), $();
395
+ }, p.onTouchCancel = (a) => {
396
+ a.currentTarget.contains(a.target) && (a.stopPropagation(), n.isPressed && T(a));
397
+ };
398
+ let b = (a) => {
399
+ n.isPressed && a.target.contains(n.target) && T({
400
+ currentTarget: n.target,
401
+ shiftKey: !1,
402
+ ctrlKey: !1,
403
+ metaKey: !1,
404
+ altKey: !1
405
+ });
406
+ };
407
+ p.onDragStart = (a) => {
408
+ a.currentTarget.contains(a.target) && T(a);
409
+ };
410
+ }
411
+ return p;
412
+ }, [
413
+ P,
414
+ u,
415
+ f,
416
+ $,
417
+ v
418
+ ]);
419
+ return Z(() => () => {
420
+ v || U(I.current.target);
421
+ }, [
422
+ v
423
+ ]), {
424
+ isPressed: d || A,
425
+ pressProps: k(B, j)
426
+ };
427
+ }
428
+ function q(e) {
429
+ return e.tagName === "A" && e.hasAttribute("href");
430
+ }
431
+ function G(e, t) {
432
+ const { key: r, code: o } = e, l = t, c = l.getAttribute("role");
433
+ return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(l instanceof HTMLInputElement && !Ee(l, r) || l instanceof HTMLTextAreaElement || l.isContentEditable) && // A link with a valid href should be handled natively,
434
+ // unless it also has role='button' and was triggered using Space.
435
+ (!q(l) || c === "button" && r !== "Enter") && // An element with role='link' should only trigger with Enter key
436
+ !(c === "link" && r !== "Enter");
437
+ }
438
+ function We(e) {
439
+ const { targetTouches: t } = e;
440
+ return t.length > 0 ? t[0] : null;
441
+ }
442
+ function le(e, t) {
443
+ const r = e.changedTouches;
444
+ for (let o = 0; o < r.length; o++) {
445
+ const l = r[o];
446
+ if (l.identifier === t)
447
+ return l;
448
+ }
449
+ return null;
450
+ }
451
+ function m(e, t) {
452
+ return {
453
+ currentTarget: e,
454
+ shiftKey: t.shiftKey,
455
+ ctrlKey: t.ctrlKey,
456
+ metaKey: t.metaKey,
457
+ altKey: t.altKey
458
+ };
459
+ }
460
+ function Ve(e) {
461
+ let t = e.width / 2 || e.radiusX || 0, r = e.height / 2 || e.radiusY || 0;
462
+ return {
463
+ top: e.clientY - r,
464
+ right: e.clientX + t,
465
+ bottom: e.clientY + r,
466
+ left: e.clientX - t
467
+ };
468
+ }
469
+ function Ye(e, t) {
470
+ return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
471
+ }
472
+ function x(e, t) {
473
+ let r = t.getBoundingClientRect(), o = Ve(e);
474
+ return Ye(r, o);
475
+ }
476
+ function z(e) {
477
+ return !(e instanceof HTMLElement) || !e.draggable;
478
+ }
479
+ function ce(e, t) {
480
+ return e instanceof HTMLInputElement ? !Ee(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" : !0;
481
+ }
482
+ const Xe = /* @__PURE__ */ new Set([
483
+ "checkbox",
484
+ "radio",
485
+ "range",
486
+ "color",
487
+ "file",
488
+ "image",
489
+ "button",
490
+ "submit",
491
+ "reset"
492
+ ]);
493
+ function Ee(e, t) {
494
+ return e.type === "checkbox" || e.type === "radio" ? t === " " : Xe.has(e.type);
495
+ }
496
+ class qe {
497
+ isDefaultPrevented() {
498
+ return this.nativeEvent.defaultPrevented;
499
+ }
500
+ preventDefault() {
501
+ this.defaultPrevented = !0, this.nativeEvent.preventDefault();
502
+ }
503
+ stopPropagation() {
504
+ this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0;
505
+ }
506
+ isPropagationStopped() {
507
+ return !1;
508
+ }
509
+ persist() {
510
+ }
511
+ constructor(t, r) {
512
+ this.nativeEvent = r, this.target = r.target, this.currentTarget = r.currentTarget, this.relatedTarget = r.relatedTarget, this.bubbles = r.bubbles, this.cancelable = r.cancelable, this.defaultPrevented = r.defaultPrevented, this.eventPhase = r.eventPhase, this.isTrusted = r.isTrusted, this.timeStamp = r.timeStamp, this.type = t;
513
+ }
514
+ }
515
+ function Je(e) {
516
+ let t = D({
517
+ isFocused: !1,
518
+ onBlur: e,
519
+ observer: null
520
+ });
521
+ return t.current.onBlur = e, $e(() => {
522
+ const r = t.current;
523
+ return () => {
524
+ r.observer && (r.observer.disconnect(), r.observer = null);
525
+ };
526
+ }, []), K((r) => {
527
+ if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
528
+ t.current.isFocused = !0;
529
+ let o = r.target, l = (c) => {
530
+ var u, d;
531
+ t.current.isFocused = !1, o.disabled && ((d = (u = t.current).onBlur) === null || d === void 0 || d.call(u, new qe("blur", c))), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
532
+ };
533
+ o.addEventListener("focusout", l, {
534
+ once: !0
535
+ }), t.current.observer = new MutationObserver(() => {
536
+ t.current.isFocused && o.disabled && (t.current.observer.disconnect(), o.dispatchEvent(new FocusEvent("blur")), o.dispatchEvent(new FocusEvent("focusout", {
537
+ bubbles: !0
538
+ })));
539
+ }), t.current.observer.observe(o, {
540
+ attributes: !0,
541
+ attributeFilter: [
542
+ "disabled"
543
+ ]
544
+ });
545
+ }
546
+ }, []);
547
+ }
548
+ function Qe(e) {
549
+ let { isDisabled: t, onFocus: r, onBlur: o, onFocusChange: l } = e;
550
+ const c = K((f) => {
551
+ if (f.target === f.currentTarget)
552
+ return o && o(f), l && l(!1), !0;
553
+ }, [
554
+ o,
555
+ l
556
+ ]), u = Je(c), d = K((f) => {
557
+ f.target === f.currentTarget && (r && r(f), l && l(!0), u(f));
558
+ }, [
559
+ l,
560
+ r,
561
+ u
562
+ ]);
563
+ return {
564
+ focusProps: {
565
+ onFocus: !t && (r || l || o) ? d : void 0,
566
+ onBlur: !t && (o || l) ? c : void 0
567
+ }
568
+ };
569
+ }
570
+ let F = null, Ze = /* @__PURE__ */ new Set(), ue = !1, w = !1, J = !1;
571
+ function te(e, t) {
572
+ for (let r of Ze)
573
+ r(e, t);
574
+ }
575
+ function et(e) {
576
+ return !(e.metaKey || !me() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
577
+ }
578
+ function fe(e) {
579
+ w = !0, et(e) && (F = "keyboard", te("keyboard", e));
580
+ }
581
+ function _(e) {
582
+ F = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (w = !0, te("pointer", e));
583
+ }
584
+ function tt(e) {
585
+ V(e) && (w = !0, F = "virtual");
586
+ }
587
+ function rt(e) {
588
+ e.target === window || e.target === document || (!w && !J && (F = "virtual", te("virtual", e)), w = !1, J = !1);
589
+ }
590
+ function nt() {
591
+ w = !1, J = !0;
592
+ }
593
+ function de() {
594
+ if (typeof window > "u" || ue)
595
+ return;
596
+ let e = HTMLElement.prototype.focus;
597
+ HTMLElement.prototype.focus = function() {
598
+ w = !0, e.apply(this, arguments);
599
+ }, document.addEventListener("keydown", fe, !0), document.addEventListener("keyup", fe, !0), document.addEventListener("click", tt, !0), window.addEventListener("focus", rt, !0), window.addEventListener("blur", nt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", _, !0), document.addEventListener("pointermove", _, !0), document.addEventListener("pointerup", _, !0)) : (document.addEventListener("mousedown", _, !0), document.addEventListener("mousemove", _, !0), document.addEventListener("mouseup", _, !0)), ue = !0;
600
+ }
601
+ typeof document < "u" && (document.readyState !== "loading" ? de() : document.addEventListener("DOMContentLoaded", de));
602
+ function ot() {
603
+ return F;
604
+ }
605
+ function pe(e) {
606
+ if (!e)
607
+ return;
608
+ let t = !0;
609
+ return (r) => {
610
+ let o = {
611
+ ...r,
612
+ preventDefault() {
613
+ r.preventDefault();
614
+ },
615
+ isDefaultPrevented() {
616
+ return r.isDefaultPrevented();
617
+ },
618
+ stopPropagation() {
619
+ console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
620
+ },
621
+ continuePropagation() {
622
+ t = !1;
623
+ }
624
+ };
625
+ e(o), t && r.stopPropagation();
626
+ };
627
+ }
628
+ function at(e) {
629
+ return {
630
+ keyboardProps: e.isDisabled ? {} : {
631
+ onKeyDown: pe(e.onKeyDown),
632
+ onKeyUp: pe(e.onKeyUp)
633
+ }
634
+ };
635
+ }
636
+ function st(e) {
637
+ if (ot() === "virtual") {
638
+ let t = document.activeElement;
639
+ ye(() => {
640
+ document.activeElement === t && document.contains(e) && M(e);
641
+ });
642
+ } else
643
+ M(e);
644
+ }
645
+ function it(e, t) {
646
+ return t.some((r) => r.contains(e));
647
+ }
648
+ class re {
649
+ get size() {
650
+ return this.fastMap.size;
651
+ }
652
+ getTreeNode(t) {
653
+ return this.fastMap.get(t);
654
+ }
655
+ addTreeNode(t, r, o) {
656
+ let l = this.fastMap.get(r ?? null), c = new be({
657
+ scopeRef: t
658
+ });
659
+ l.addChild(c), c.parent = l, this.fastMap.set(t, c), o && (c.nodeToRestore = o);
660
+ }
661
+ addNode(t) {
662
+ this.fastMap.set(t.scopeRef, t);
663
+ }
664
+ removeTreeNode(t) {
665
+ if (t === null)
666
+ return;
667
+ let r = this.fastMap.get(t), o = r.parent;
668
+ for (let c of this.traverse())
669
+ c !== r && r.nodeToRestore && c.nodeToRestore && r.scopeRef.current && it(c.nodeToRestore, r.scopeRef.current) && (c.nodeToRestore = r.nodeToRestore);
670
+ let l = r.children;
671
+ o.removeChild(r), l.size > 0 && l.forEach((c) => o.addChild(c)), this.fastMap.delete(r.scopeRef);
672
+ }
673
+ // Pre Order Depth First
674
+ *traverse(t = this.root) {
675
+ if (t.scopeRef != null && (yield t), t.children.size > 0)
676
+ for (let r of t.children)
677
+ yield* this.traverse(r);
678
+ }
679
+ clone() {
680
+ let t = new re();
681
+ for (let r of this.traverse())
682
+ t.addTreeNode(r.scopeRef, r.parent.scopeRef, r.nodeToRestore);
683
+ return t;
684
+ }
685
+ constructor() {
686
+ Y(this, "fastMap", /* @__PURE__ */ new Map()), this.root = new be({
687
+ scopeRef: null
688
+ }), this.fastMap.set(null, this.root);
689
+ }
690
+ }
691
+ class be {
692
+ addChild(t) {
693
+ this.children.add(t), t.parent = this;
694
+ }
695
+ removeChild(t) {
696
+ this.children.delete(t), t.parent = void 0;
697
+ }
698
+ constructor(t) {
699
+ Y(this, "children", /* @__PURE__ */ new Set()), Y(this, "contain", !1), this.scopeRef = t.scopeRef;
700
+ }
701
+ }
702
+ new re();
703
+ let lt = /* @__PURE__ */ Q.createContext(null);
704
+ function ct(e) {
705
+ let t = ge(lt) || {};
706
+ Pe(t, e);
707
+ let { ref: r, ...o } = t;
708
+ return o;
709
+ }
710
+ function ut(e, t) {
711
+ let { focusProps: r } = Qe(e), { keyboardProps: o } = at(e), l = k(r, o), c = ct(t), u = e.isDisabled ? {} : c, d = D(e.autoFocus);
712
+ return Z(() => {
713
+ d.current && t.current && st(t.current), d.current = !1;
714
+ }, [
715
+ t
716
+ ]), {
717
+ focusableProps: k({
718
+ ...l,
719
+ tabIndex: e.excludeFromTabOrder && !e.isDisabled ? -1 : void 0
720
+ }, u)
721
+ };
722
+ }
723
+ function Lt(e, t) {
724
+ let {
725
+ elementType: r = "button",
726
+ isDisabled: o,
727
+ onPress: l,
728
+ onPressStart: c,
729
+ onPressEnd: u,
730
+ onPressChange: d,
731
+ preventFocusOnPress: f,
732
+ allowFocusWhenDisabled: E,
733
+ // @ts-ignore
734
+ onClick: v,
735
+ href: ne,
736
+ target: B,
737
+ rel: y,
738
+ type: A = "button"
739
+ } = e, S;
740
+ r === "button" ? S = {
741
+ type: A,
742
+ disabled: o
743
+ } : S = {
744
+ role: "button",
745
+ tabIndex: o ? void 0 : 0,
746
+ href: r === "a" && o ? void 0 : ne,
747
+ target: r === "a" ? B : void 0,
748
+ type: r === "input" ? A : void 0,
749
+ disabled: r === "input" ? o : void 0,
750
+ "aria-disabled": !o || r === "input" ? void 0 : o,
751
+ rel: r === "a" ? y : void 0
752
+ };
753
+ let { pressProps: I, isPressed: P } = ze({
754
+ onPressStart: c,
755
+ onPressEnd: u,
756
+ onPressChange: d,
757
+ onPress: l,
758
+ isDisabled: o,
759
+ preventFocusOnPress: f,
760
+ ref: t
761
+ }), { focusableProps: $ } = ut(e, t);
762
+ E && ($.tabIndex = o ? -1 : $.tabIndex);
763
+ let j = k($, I, De(e, {
764
+ labelable: !0
765
+ }));
766
+ return {
767
+ isPressed: P,
768
+ buttonProps: k(S, j, {
769
+ "aria-haspopup": e["aria-haspopup"],
770
+ "aria-expanded": e["aria-expanded"],
771
+ "aria-controls": e["aria-controls"],
772
+ "aria-pressed": e["aria-pressed"],
773
+ onClick: (n) => {
774
+ v && (v(n), console.warn("onClick is deprecated, please use onPress"));
775
+ }
776
+ })
777
+ };
778
+ }
779
+ function Mt(e, t) {
780
+ var o;
781
+ (o = {
782
+ filled: ["primary", "secondary", "success", "warning", "neutral"],
783
+ outlined: [
784
+ "primary",
785
+ "secondary",
786
+ "success",
787
+ "warning",
788
+ "support",
789
+ "inverse"
790
+ ],
791
+ link: ["primary", "secondary"]
792
+ }[t]) != null && o.includes(e) || console.warn(
793
+ `The color '${e}' is not supported with the '${t}' variant`
794
+ );
795
+ }
796
+ const ft = "_Button_8y9jx_5", dt = "_colorPrimary_8y9jx_20", pt = "_colorSecondary_8y9jx_28", bt = "_colorSuccess_8y9jx_36", gt = "_colorWarning_8y9jx_44", vt = "_colorNeutral_8y9jx_52", $t = "_colorSupport_8y9jx_60", yt = "_colorInverse_8y9jx_66", Pt = "_variantFilled_8y9jx_72", mt = "_variantOutlined_8y9jx_99", ht = "_variantLink_8y9jx_128", Tt = "_sizeMd_8y9jx_148", Et = "_sizeSm_8y9jx_156", wt = "_block_8y9jx_173", St = "_iconAtStart_8y9jx_178", xt = "_iconAtEnd_8y9jx_182", Ct = {
797
+ Button: ft,
798
+ colorPrimary: dt,
799
+ colorSecondary: pt,
800
+ colorSuccess: bt,
801
+ colorWarning: gt,
802
+ colorNeutral: vt,
803
+ colorSupport: $t,
804
+ colorInverse: yt,
805
+ variantFilled: Pt,
806
+ variantOutlined: mt,
807
+ variantLink: ht,
808
+ sizeMd: Tt,
809
+ sizeSm: Et,
810
+ block: wt,
811
+ iconAtStart: St,
812
+ iconAtEnd: xt
813
+ };
814
+ export {
815
+ Lt as $,
816
+ Ct as c,
817
+ Mt as l
818
+ };