@protonradio/proton-ui 0.1.7 → 0.1.9
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/proton-ui.es.d.ts +36 -0
- package/dist/proton-ui.es.js +124 -103
- package/dist/proton-ui.es.js.map +1 -1
- package/dist/proton-ui.umd.js +6 -6
- package/dist/proton-ui.umd.js.map +1 -1
- package/dist/style.css +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
export declare function Switch(props: SwitchProps): JSX_2.Element;
|
|
4
|
+
|
|
5
|
+
export declare namespace Switch {
|
|
6
|
+
var defaultProps: {
|
|
7
|
+
defaultOn: boolean;
|
|
8
|
+
isDisabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare interface SwitchProps {
|
|
13
|
+
/**
|
|
14
|
+
* Whether the Switch is in the 'on' state (uncontrolled).
|
|
15
|
+
*/
|
|
16
|
+
defaultOn: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the Switch is in the 'on' state. Providing this prop causes the
|
|
19
|
+
* component to become controlled.
|
|
20
|
+
*/
|
|
21
|
+
isOn?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Should the input be non-interactive?
|
|
24
|
+
*/
|
|
25
|
+
isDisabled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Called when the Switch's on state changes.
|
|
28
|
+
*/
|
|
29
|
+
onChange?: (isOn: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The text or component to be rendered as the Switch's label.
|
|
32
|
+
*/
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { }
|
package/dist/proton-ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var Le = { exports: {} },
|
|
1
|
+
import ae, { useRef as Y, useEffect as Pe, useCallback as U, useState as Ie, useMemo as Ot, useContext as Ct } from "react";
|
|
2
|
+
var Le = { exports: {} }, oe = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,9 +12,9 @@ var Le = { exports: {} }, ie = {};
|
|
|
12
12
|
var pt;
|
|
13
13
|
function dr() {
|
|
14
14
|
if (pt)
|
|
15
|
-
return
|
|
15
|
+
return oe;
|
|
16
16
|
pt = 1;
|
|
17
|
-
var e =
|
|
17
|
+
var e = ae, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
18
|
function u(h, v, T) {
|
|
19
19
|
var w, F = {}, L = null, V = null;
|
|
20
20
|
T !== void 0 && (L = "" + T), v.key !== void 0 && (L = "" + v.key), v.ref !== void 0 && (V = v.ref);
|
|
@@ -25,9 +25,9 @@ function dr() {
|
|
|
25
25
|
F[w] === void 0 && (F[w] = v[w]);
|
|
26
26
|
return { $$typeof: r, type: h, key: L, ref: V, props: F, _owner: o.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return oe.Fragment = n, oe.jsx = u, oe.jsxs = u, oe;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var se = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -40,7 +40,7 @@ var oe = {};
|
|
|
40
40
|
var vt;
|
|
41
41
|
function pr() {
|
|
42
42
|
return vt || (vt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var e =
|
|
43
|
+
var e = ae, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), h = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), H = Symbol.iterator, j = "@@iterator";
|
|
44
44
|
function A(t) {
|
|
45
45
|
if (t === null || typeof t != "object")
|
|
46
46
|
return null;
|
|
@@ -65,10 +65,10 @@ function pr() {
|
|
|
65
65
|
E.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, E);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var I = !1, M = !1,
|
|
68
|
+
var I = !1, M = !1, X = !1, Te = !1, a = !1, y;
|
|
69
69
|
y = Symbol.for("react.module.reference");
|
|
70
70
|
function D(t) {
|
|
71
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === f || a || t === o || t === T || t === w || Te || t === V || I || M ||
|
|
71
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === f || a || t === o || t === T || t === w || Te || t === V || I || M || X || typeof t == "object" && t !== null && (t.$$typeof === L || t.$$typeof === F || t.$$typeof === u || t.$$typeof === h || t.$$typeof === v || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
@@ -278,7 +278,7 @@ function pr() {
|
|
|
278
278
|
} finally {
|
|
279
279
|
_e = !1, we.current = E, Ut(), Error.prepareStackTrace = $;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var Q = t ? t.displayName || t.name : "", dt = Q ? fe(Q) : "";
|
|
282
282
|
return typeof t == "function" && de.set(t, dt), dt;
|
|
283
283
|
}
|
|
284
284
|
function Yt(t, s, d) {
|
|
@@ -368,7 +368,7 @@ function pr() {
|
|
|
368
368
|
if (qt(t))
|
|
369
369
|
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", zt(t)), rt(t);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var ie = C.ReactCurrentOwner, Jt = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
@@ -392,9 +392,9 @@ function pr() {
|
|
|
392
392
|
return t.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function Qt(t, s) {
|
|
395
|
-
if (typeof t.ref == "string" &&
|
|
396
|
-
var d = l(
|
|
397
|
-
xe[d] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', l(
|
|
395
|
+
if (typeof t.ref == "string" && ie.current && s && ie.current.stateNode !== s) {
|
|
396
|
+
var d = l(ie.current.type);
|
|
397
|
+
xe[d] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', l(ie.current.type), t.ref), xe[d] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function er(t, s) {
|
|
@@ -463,11 +463,11 @@ function pr() {
|
|
|
463
463
|
var x = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
464
464
|
b && er(m, x), k && tr(m, x);
|
|
465
465
|
}
|
|
466
|
-
return rr(t, b, k, $, g,
|
|
466
|
+
return rr(t, b, k, $, g, ie.current, m);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var Oe = C.ReactCurrentOwner, ot = C.ReactDebugCurrentFrame;
|
|
470
|
-
function
|
|
470
|
+
function Z(t) {
|
|
471
471
|
if (t) {
|
|
472
472
|
var s = t._owner, d = pe(t.type, t._source, s ? s.type : null);
|
|
473
473
|
ot.setExtraStackFrame(d);
|
|
@@ -525,7 +525,7 @@ Check the top-level render call using <` + d + ">.");
|
|
|
525
525
|
return;
|
|
526
526
|
lt[d] = !0;
|
|
527
527
|
var g = "";
|
|
528
|
-
t && t._owner && t._owner !== Oe.current && (g = " It was passed a child from " + l(t._owner.type) + "."),
|
|
528
|
+
t && t._owner && t._owner !== Oe.current && (g = " It was passed a child from " + l(t._owner.type) + "."), Z(t), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, g), Z(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function ct(t, s) {
|
|
@@ -577,11 +577,11 @@ Check the top-level render call using <` + d + ">.");
|
|
|
577
577
|
for (var s = Object.keys(t.props), d = 0; d < s.length; d++) {
|
|
578
578
|
var g = s[d];
|
|
579
579
|
if (g !== "children" && g !== "key") {
|
|
580
|
-
|
|
580
|
+
Z(t), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), Z(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
t.ref !== null && (
|
|
584
|
+
t.ref !== null && (Z(t), P("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
function ft(t, s, d, g, $, E) {
|
|
@@ -603,8 +603,8 @@ Check the top-level render call using <` + d + ">.");
|
|
|
603
603
|
if (K !== void 0)
|
|
604
604
|
if (g)
|
|
605
605
|
if (Re(K)) {
|
|
606
|
-
for (var
|
|
607
|
-
ct(K[
|
|
606
|
+
for (var Q = 0; Q < K.length; Q++)
|
|
607
|
+
ct(K[Q], t);
|
|
608
608
|
Object.freeze && Object.freeze(K);
|
|
609
609
|
} else
|
|
610
610
|
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -621,11 +621,11 @@ Check the top-level render call using <` + d + ">.");
|
|
|
621
621
|
return ft(t, s, d, !1);
|
|
622
622
|
}
|
|
623
623
|
var cr = ur, fr = lr;
|
|
624
|
-
|
|
625
|
-
}()),
|
|
624
|
+
se.Fragment = i, se.jsx = cr, se.jsxs = fr;
|
|
625
|
+
}()), se;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? Le.exports = dr() : Le.exports = pr();
|
|
628
|
-
var
|
|
628
|
+
var B = Le.exports;
|
|
629
629
|
function kt(e) {
|
|
630
630
|
var r, n, i = "";
|
|
631
631
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -644,9 +644,9 @@ function vr() {
|
|
|
644
644
|
(e = arguments[n++]) && (r = kt(e)) && (i && (i += " "), i += r);
|
|
645
645
|
return i;
|
|
646
646
|
}
|
|
647
|
-
const We = typeof document < "u" ?
|
|
647
|
+
const We = typeof document < "u" ? ae.useLayoutEffect : () => {
|
|
648
648
|
};
|
|
649
|
-
function
|
|
649
|
+
function G(e) {
|
|
650
650
|
const r = Y(null);
|
|
651
651
|
return We(() => {
|
|
652
652
|
r.current = e;
|
|
@@ -673,7 +673,7 @@ function br(...e) {
|
|
|
673
673
|
typeof n == "function" && n(...r);
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function q(...e) {
|
|
677
677
|
let r = {
|
|
678
678
|
...e[0]
|
|
679
679
|
};
|
|
@@ -710,7 +710,7 @@ function Pr(e, r = {}) {
|
|
|
710
710
|
Object.prototype.hasOwnProperty.call(e, u) && (hr.has(u) || n && yr.has(u) || i && mr.has(u) || o != null && o.has(u) || $r.test(u)) && (f[u] = e[u]);
|
|
711
711
|
return f;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function z(e) {
|
|
714
714
|
if (Er())
|
|
715
715
|
e.focus({
|
|
716
716
|
preventScroll: !0
|
|
@@ -804,19 +804,19 @@ function ue(e, r, n = !0) {
|
|
|
804
804
|
bubbles: !0,
|
|
805
805
|
cancelable: !0
|
|
806
806
|
});
|
|
807
|
-
ue.isOpening = n,
|
|
807
|
+
ue.isOpening = n, z(e), e.dispatchEvent(T), ue.isOpening = !1;
|
|
808
808
|
}
|
|
809
809
|
ue.isOpening = !1;
|
|
810
|
-
let
|
|
810
|
+
let re = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ new Set();
|
|
811
811
|
function bt() {
|
|
812
812
|
if (typeof window > "u")
|
|
813
813
|
return;
|
|
814
814
|
let e = (n) => {
|
|
815
|
-
let i =
|
|
816
|
-
i || (i = /* @__PURE__ */ new Set(),
|
|
815
|
+
let i = re.get(n.target);
|
|
816
|
+
i || (i = /* @__PURE__ */ new Set(), re.set(n.target, i), n.target.addEventListener("transitioncancel", r)), i.add(n.propertyName);
|
|
817
817
|
}, r = (n) => {
|
|
818
|
-
let i =
|
|
819
|
-
if (i && (i.delete(n.propertyName), i.size === 0 && (n.target.removeEventListener("transitioncancel", r),
|
|
818
|
+
let i = re.get(n.target);
|
|
819
|
+
if (i && (i.delete(n.propertyName), i.size === 0 && (n.target.removeEventListener("transitioncancel", r), re.delete(n.target)), re.size === 0)) {
|
|
820
820
|
for (let o of Me)
|
|
821
821
|
o();
|
|
822
822
|
Me.clear();
|
|
@@ -827,7 +827,7 @@ function bt() {
|
|
|
827
827
|
typeof document < "u" && (document.readyState !== "loading" ? bt() : document.addEventListener("DOMContentLoaded", bt));
|
|
828
828
|
function Mt(e) {
|
|
829
829
|
requestAnimationFrame(() => {
|
|
830
|
-
|
|
830
|
+
re.size === 0 ? e() : Me.add(e);
|
|
831
831
|
});
|
|
832
832
|
}
|
|
833
833
|
function Or() {
|
|
@@ -875,7 +875,7 @@ function Cr(e) {
|
|
|
875
875
|
return !Lt() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
|
876
876
|
}
|
|
877
877
|
function kr(e, r, n) {
|
|
878
|
-
let i = Y(r), o =
|
|
878
|
+
let i = Y(r), o = G(() => {
|
|
879
879
|
n && n(i.current);
|
|
880
880
|
});
|
|
881
881
|
Pe(() => {
|
|
@@ -921,17 +921,17 @@ function ht(e, r, n) {
|
|
|
921
921
|
var i = At(e, r, "set");
|
|
922
922
|
return Kr(e, i, n), n;
|
|
923
923
|
}
|
|
924
|
-
let
|
|
924
|
+
let ne = "default", Ae = "", $e = /* @__PURE__ */ new WeakMap();
|
|
925
925
|
function yt(e) {
|
|
926
|
-
Dt() ? (
|
|
926
|
+
Dt() ? (ne === "default" && (Ae = document.documentElement.style.webkitUserSelect, document.documentElement.style.webkitUserSelect = "none"), ne = "disabled") : (e instanceof HTMLElement || e instanceof SVGElement) && ($e.set(e, e.style.userSelect), e.style.userSelect = "none");
|
|
927
927
|
}
|
|
928
928
|
function he(e) {
|
|
929
929
|
if (Dt()) {
|
|
930
|
-
if (
|
|
930
|
+
if (ne !== "disabled")
|
|
931
931
|
return;
|
|
932
|
-
|
|
932
|
+
ne = "restoring", setTimeout(() => {
|
|
933
933
|
Mt(() => {
|
|
934
|
-
|
|
934
|
+
ne === "restoring" && (document.documentElement.style.webkitUserSelect === "none" && (document.documentElement.style.webkitUserSelect = Ae || ""), Ae = "", ne = "default");
|
|
935
935
|
});
|
|
936
936
|
}, 300);
|
|
937
937
|
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && $e.has(e)) {
|
|
@@ -939,13 +939,13 @@ function he(e) {
|
|
|
939
939
|
e.style.userSelect === "none" && (e.style.userSelect = r), e.getAttribute("style") === "" && e.removeAttribute("style"), $e.delete(e);
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const jt =
|
|
942
|
+
const jt = ae.createContext(null);
|
|
943
943
|
jt.displayName = "PressResponderContext";
|
|
944
944
|
function Ar(e) {
|
|
945
945
|
let r = Ct(jt);
|
|
946
946
|
if (r) {
|
|
947
947
|
let { register: n, ...i } = r;
|
|
948
|
-
e =
|
|
948
|
+
e = q(i, e), n();
|
|
949
949
|
}
|
|
950
950
|
return Kt(r, e.ref), e;
|
|
951
951
|
}
|
|
@@ -990,7 +990,7 @@ function jr(e) {
|
|
|
990
990
|
target: null,
|
|
991
991
|
isOverTarget: !1,
|
|
992
992
|
pointerType: null
|
|
993
|
-
}), { addGlobalListener: A, removeAllGlobalListeners: C } = Or(), P =
|
|
993
|
+
}), { addGlobalListener: A, removeAllGlobalListeners: C } = Or(), P = G((a, y) => {
|
|
994
994
|
let D = j.current;
|
|
995
995
|
if (u || D.didFirePressStart)
|
|
996
996
|
return;
|
|
@@ -1000,7 +1000,7 @@ function jr(e) {
|
|
|
1000
1000
|
i(S), p = S.shouldStopPropagation;
|
|
1001
1001
|
}
|
|
1002
1002
|
return n && n(!0), D.isTriggeringEvent = !1, D.didFirePressStart = !0, H(!0), p;
|
|
1003
|
-
}), O =
|
|
1003
|
+
}), O = G((a, y, D = !0) => {
|
|
1004
1004
|
let p = j.current;
|
|
1005
1005
|
if (!p.didFirePressStart)
|
|
1006
1006
|
return;
|
|
@@ -1015,7 +1015,7 @@ function jr(e) {
|
|
|
1015
1015
|
r(l), S && (S = l.shouldStopPropagation);
|
|
1016
1016
|
}
|
|
1017
1017
|
return p.isTriggeringEvent = !1, S;
|
|
1018
|
-
}), I =
|
|
1018
|
+
}), I = G((a, y) => {
|
|
1019
1019
|
let D = j.current;
|
|
1020
1020
|
if (!u) {
|
|
1021
1021
|
if (f) {
|
|
@@ -1025,10 +1025,10 @@ function jr(e) {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
}
|
|
1028
|
-
}), M =
|
|
1028
|
+
}), M = G((a) => {
|
|
1029
1029
|
let y = j.current;
|
|
1030
1030
|
y.isPressed && (y.isOverTarget && O(N(y.target, a), y.pointerType, !1), y.isPressed = !1, y.isOverTarget = !1, y.activePointerId = null, y.pointerType = null, C(), w || he(y.target));
|
|
1031
|
-
}),
|
|
1031
|
+
}), X = G((a) => {
|
|
1032
1032
|
T && M(a);
|
|
1033
1033
|
}), Te = Ot(() => {
|
|
1034
1034
|
let a = j.current, y = {
|
|
@@ -1047,7 +1047,7 @@ function jr(e) {
|
|
|
1047
1047
|
if (!(p && !p.currentTarget.contains(p.target)) && p && p.button === 0 && !a.isTriggeringEvent && !ue.isOpening) {
|
|
1048
1048
|
let S = !0;
|
|
1049
1049
|
if (u && p.preventDefault(), !a.ignoreClickAfterPress && !a.ignoreEmulatedMouseEvents && !a.isPressed && (a.pointerType === "virtual" || Ke(p.nativeEvent))) {
|
|
1050
|
-
!u && !v &&
|
|
1050
|
+
!u && !v && z(p.currentTarget);
|
|
1051
1051
|
let l = P(p, "virtual"), c = I(p, "virtual"), _ = O(p, "virtual");
|
|
1052
1052
|
S = l && c && _;
|
|
1053
1053
|
}
|
|
@@ -1078,16 +1078,16 @@ function jr(e) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
De(c.currentTarget) && c.preventDefault(), a.pointerType = c.pointerType;
|
|
1080
1080
|
let _ = !0;
|
|
1081
|
-
a.isPressed || (a.isPressed = !0, a.isOverTarget = !0, a.activePointerId = c.pointerId, a.target = c.currentTarget, !u && !v &&
|
|
1081
|
+
a.isPressed || (a.isPressed = !0, a.isOverTarget = !0, a.activePointerId = c.pointerId, a.target = c.currentTarget, !u && !v && z(c.currentTarget), w || yt(a.target), _ = P(c, a.pointerType), A(document, "pointermove", p, !1), A(document, "pointerup", S, !1), A(document, "pointercancel", l, !1)), _ && c.stopPropagation();
|
|
1082
1082
|
}, y.onMouseDown = (c) => {
|
|
1083
1083
|
c.currentTarget.contains(c.target) && c.button === 0 && (De(c.currentTarget) && c.preventDefault(), c.stopPropagation());
|
|
1084
1084
|
}, y.onPointerUp = (c) => {
|
|
1085
|
-
!c.currentTarget.contains(c.target) || a.pointerType === "virtual" || c.button === 0 &&
|
|
1085
|
+
!c.currentTarget.contains(c.target) || a.pointerType === "virtual" || c.button === 0 && ee(c, c.currentTarget) && I(c, a.pointerType || c.pointerType);
|
|
1086
1086
|
};
|
|
1087
1087
|
let p = (c) => {
|
|
1088
|
-
c.pointerId === a.activePointerId && (
|
|
1088
|
+
c.pointerId === a.activePointerId && (ee(c, a.target) ? a.isOverTarget || (a.isOverTarget = !0, P(N(a.target, c), a.pointerType)) : a.isOverTarget && (a.isOverTarget = !1, O(N(a.target, c), a.pointerType, !1), X(c)));
|
|
1089
1089
|
}, S = (c) => {
|
|
1090
|
-
c.pointerId === a.activePointerId && a.isPressed && c.button === 0 && (
|
|
1090
|
+
c.pointerId === a.activePointerId && a.isPressed && c.button === 0 && (ee(c, a.target) ? O(N(a.target, c), a.pointerType) : a.isOverTarget && O(N(a.target, c), a.pointerType, !1), a.isPressed = !1, a.isOverTarget = !1, a.activePointerId = null, a.pointerType = null, C(), w || he(a.target));
|
|
1091
1091
|
}, l = (c) => {
|
|
1092
1092
|
M(c);
|
|
1093
1093
|
};
|
|
@@ -1102,7 +1102,7 @@ function jr(e) {
|
|
|
1102
1102
|
l.stopPropagation();
|
|
1103
1103
|
return;
|
|
1104
1104
|
}
|
|
1105
|
-
a.isPressed = !0, a.isOverTarget = !0, a.target = l.currentTarget, a.pointerType = Ke(l.nativeEvent) ? "virtual" : "mouse", !u && !v &&
|
|
1105
|
+
a.isPressed = !0, a.isOverTarget = !0, a.target = l.currentTarget, a.pointerType = Ke(l.nativeEvent) ? "virtual" : "mouse", !u && !v && z(l.currentTarget), P(l, a.pointerType) && l.stopPropagation(), A(document, "mouseup", p, !1);
|
|
1106
1106
|
}, y.onMouseEnter = (l) => {
|
|
1107
1107
|
if (!l.currentTarget.contains(l.target))
|
|
1108
1108
|
return;
|
|
@@ -1112,7 +1112,7 @@ function jr(e) {
|
|
|
1112
1112
|
if (!l.currentTarget.contains(l.target))
|
|
1113
1113
|
return;
|
|
1114
1114
|
let c = !0;
|
|
1115
|
-
a.isPressed && !a.ignoreEmulatedMouseEvents && (a.isOverTarget = !1, c = O(l, a.pointerType, !1),
|
|
1115
|
+
a.isPressed && !a.ignoreEmulatedMouseEvents && (a.isOverTarget = !1, c = O(l, a.pointerType, !1), X(l)), c && l.stopPropagation();
|
|
1116
1116
|
}, y.onMouseUp = (l) => {
|
|
1117
1117
|
l.currentTarget.contains(l.target) && !a.ignoreEmulatedMouseEvents && l.button === 0 && I(l, a.pointerType || "mouse");
|
|
1118
1118
|
};
|
|
@@ -1122,7 +1122,7 @@ function jr(e) {
|
|
|
1122
1122
|
a.ignoreEmulatedMouseEvents = !1;
|
|
1123
1123
|
return;
|
|
1124
1124
|
}
|
|
1125
|
-
|
|
1125
|
+
ee(l, a.target) ? O(N(a.target, l), a.pointerType) : a.isOverTarget && O(N(a.target, l), a.pointerType, !1), a.isOverTarget = !1;
|
|
1126
1126
|
}
|
|
1127
1127
|
};
|
|
1128
1128
|
y.onTouchStart = (l) => {
|
|
@@ -1131,7 +1131,7 @@ function jr(e) {
|
|
|
1131
1131
|
let c = Ir(l.nativeEvent);
|
|
1132
1132
|
if (!c)
|
|
1133
1133
|
return;
|
|
1134
|
-
a.activePointerId = c.identifier, a.ignoreEmulatedMouseEvents = !0, a.isOverTarget = !0, a.isPressed = !0, a.target = l.currentTarget, a.pointerType = "touch", !u && !v &&
|
|
1134
|
+
a.activePointerId = c.identifier, a.ignoreEmulatedMouseEvents = !0, a.isOverTarget = !0, a.isPressed = !0, a.target = l.currentTarget, a.pointerType = "touch", !u && !v && z(l.currentTarget), w || yt(a.target), P(l, a.pointerType) && l.stopPropagation(), A(window, "scroll", S, !0);
|
|
1135
1135
|
}, y.onTouchMove = (l) => {
|
|
1136
1136
|
if (!l.currentTarget.contains(l.target))
|
|
1137
1137
|
return;
|
|
@@ -1140,7 +1140,7 @@ function jr(e) {
|
|
|
1140
1140
|
return;
|
|
1141
1141
|
}
|
|
1142
1142
|
let c = $t(l.nativeEvent, a.activePointerId), _ = !0;
|
|
1143
|
-
c &&
|
|
1143
|
+
c && ee(c, l.currentTarget) ? a.isOverTarget || (a.isOverTarget = !0, _ = P(l, a.pointerType)) : a.isOverTarget && (a.isOverTarget = !1, _ = O(l, a.pointerType, !1), X(l)), _ && l.stopPropagation();
|
|
1144
1144
|
}, y.onTouchEnd = (l) => {
|
|
1145
1145
|
if (!l.currentTarget.contains(l.target))
|
|
1146
1146
|
return;
|
|
@@ -1149,7 +1149,7 @@ function jr(e) {
|
|
|
1149
1149
|
return;
|
|
1150
1150
|
}
|
|
1151
1151
|
let c = $t(l.nativeEvent, a.activePointerId), _ = !0;
|
|
1152
|
-
c &&
|
|
1152
|
+
c && ee(c, l.currentTarget) ? (I(l, a.pointerType), _ = O(l, a.pointerType)) : a.isOverTarget && (_ = O(l, a.pointerType, !1)), _ && l.stopPropagation(), a.isPressed = !1, a.activePointerId = null, a.isOverTarget = !1, a.ignoreEmulatedMouseEvents = !0, w || he(a.target), C();
|
|
1153
1153
|
}, y.onTouchCancel = (l) => {
|
|
1154
1154
|
l.currentTarget.contains(l.target) && (l.stopPropagation(), a.isPressed && M(l));
|
|
1155
1155
|
};
|
|
@@ -1174,7 +1174,7 @@ function jr(e) {
|
|
|
1174
1174
|
C,
|
|
1175
1175
|
w,
|
|
1176
1176
|
M,
|
|
1177
|
-
|
|
1177
|
+
X,
|
|
1178
1178
|
O,
|
|
1179
1179
|
P,
|
|
1180
1180
|
I
|
|
@@ -1185,7 +1185,7 @@ function jr(e) {
|
|
|
1185
1185
|
w
|
|
1186
1186
|
]), {
|
|
1187
1187
|
isPressed: h || V,
|
|
1188
|
-
pressProps:
|
|
1188
|
+
pressProps: q(L, Te)
|
|
1189
1189
|
};
|
|
1190
1190
|
}
|
|
1191
1191
|
function Ue(e) {
|
|
@@ -1230,7 +1230,7 @@ function Wr(e) {
|
|
|
1230
1230
|
function Nr(e, r) {
|
|
1231
1231
|
return !(e.left > r.right || r.left > e.right || e.top > r.bottom || r.top > e.bottom);
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function ee(e, r) {
|
|
1234
1234
|
let n = r.getBoundingClientRect(), i = Wr(e);
|
|
1235
1235
|
return Nr(n, i);
|
|
1236
1236
|
}
|
|
@@ -1284,7 +1284,7 @@ function Wt(e) {
|
|
|
1284
1284
|
i.observer && (i.observer.disconnect(), i.observer = null);
|
|
1285
1285
|
};
|
|
1286
1286
|
}, []);
|
|
1287
|
-
let n =
|
|
1287
|
+
let n = G((i) => {
|
|
1288
1288
|
e == null || e(i);
|
|
1289
1289
|
});
|
|
1290
1290
|
return U((i) => {
|
|
@@ -1339,7 +1339,7 @@ function Yr(e) {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
};
|
|
1341
1341
|
}
|
|
1342
|
-
let ce = null, Hr = /* @__PURE__ */ new Set(), Et = !1,
|
|
1342
|
+
let ce = null, Hr = /* @__PURE__ */ new Set(), Et = !1, J = !1, je = !1;
|
|
1343
1343
|
function Ve(e, r) {
|
|
1344
1344
|
for (let n of Hr)
|
|
1345
1345
|
n(e, r);
|
|
@@ -1348,27 +1348,27 @@ function Br(e) {
|
|
|
1348
1348
|
return !(e.metaKey || !le() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
1349
1349
|
}
|
|
1350
1350
|
function Tt(e) {
|
|
1351
|
-
|
|
1351
|
+
J = !0, Br(e) && (ce = "keyboard", Ve("keyboard", e));
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
ce = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (
|
|
1353
|
+
function te(e) {
|
|
1354
|
+
ce = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (J = !0, Ve("pointer", e));
|
|
1355
1355
|
}
|
|
1356
1356
|
function Gr(e) {
|
|
1357
|
-
Ke(e) && (
|
|
1357
|
+
Ke(e) && (J = !0, ce = "virtual");
|
|
1358
1358
|
}
|
|
1359
1359
|
function zr(e) {
|
|
1360
|
-
e.target === window || e.target === document || (!
|
|
1360
|
+
e.target === window || e.target === document || (!J && !je && (ce = "virtual", Ve("virtual", e)), J = !1, je = !1);
|
|
1361
1361
|
}
|
|
1362
1362
|
function qr() {
|
|
1363
|
-
|
|
1363
|
+
J = !1, je = !0;
|
|
1364
1364
|
}
|
|
1365
1365
|
function wt() {
|
|
1366
1366
|
if (typeof window > "u" || Et)
|
|
1367
1367
|
return;
|
|
1368
1368
|
let e = HTMLElement.prototype.focus;
|
|
1369
1369
|
HTMLElement.prototype.focus = function() {
|
|
1370
|
-
|
|
1371
|
-
}, document.addEventListener("keydown", Tt, !0), document.addEventListener("keyup", Tt, !0), document.addEventListener("click", Gr, !0), window.addEventListener("focus", zr, !0), window.addEventListener("blur", qr, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown",
|
|
1370
|
+
J = !0, e.apply(this, arguments);
|
|
1371
|
+
}, document.addEventListener("keydown", Tt, !0), document.addEventListener("keyup", Tt, !0), document.addEventListener("click", Gr, !0), window.addEventListener("focus", zr, !0), window.addEventListener("blur", qr, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", te, !0), document.addEventListener("pointermove", te, !0), document.addEventListener("pointerup", te, !0)) : (document.addEventListener("mousedown", te, !0), document.addEventListener("mousemove", te, !0), document.addEventListener("mouseup", te, !0)), Et = !0;
|
|
1372
1372
|
}
|
|
1373
1373
|
typeof document < "u" && (document.readyState !== "loading" ? wt() : document.addEventListener("DOMContentLoaded", wt));
|
|
1374
1374
|
function Jr() {
|
|
@@ -1437,10 +1437,10 @@ function Qr(e) {
|
|
|
1437
1437
|
if (Jr() === "virtual") {
|
|
1438
1438
|
let r = document.activeElement;
|
|
1439
1439
|
Mt(() => {
|
|
1440
|
-
document.activeElement === r && document.contains(e) &&
|
|
1440
|
+
document.activeElement === r && document.contains(e) && z(e);
|
|
1441
1441
|
});
|
|
1442
1442
|
} else
|
|
1443
|
-
|
|
1443
|
+
z(e);
|
|
1444
1444
|
}
|
|
1445
1445
|
function en(e, r) {
|
|
1446
1446
|
return r.some((n) => n.contains(e));
|
|
@@ -1500,7 +1500,7 @@ class _t {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
new Ye();
|
|
1503
|
-
let tn = /* @__PURE__ */
|
|
1503
|
+
let tn = /* @__PURE__ */ ae.createContext(null);
|
|
1504
1504
|
function rn(e) {
|
|
1505
1505
|
let r = Ct(tn) || {};
|
|
1506
1506
|
Kt(r, e);
|
|
@@ -1508,13 +1508,13 @@ function rn(e) {
|
|
|
1508
1508
|
return i;
|
|
1509
1509
|
}
|
|
1510
1510
|
function nn(e, r) {
|
|
1511
|
-
let { focusProps: n } = Yr(e), { keyboardProps: i } = Zr(e), o =
|
|
1511
|
+
let { focusProps: n } = Yr(e), { keyboardProps: i } = Zr(e), o = q(n, i), f = rn(r), u = e.isDisabled ? {} : f, h = Y(e.autoFocus);
|
|
1512
1512
|
return Pe(() => {
|
|
1513
1513
|
h.current && r.current && Qr(r.current), h.current = !1;
|
|
1514
1514
|
}, [
|
|
1515
1515
|
r
|
|
1516
1516
|
]), {
|
|
1517
|
-
focusableProps:
|
|
1517
|
+
focusableProps: q({
|
|
1518
1518
|
...o,
|
|
1519
1519
|
tabIndex: e.excludeFromTabOrder && !e.isDisabled ? -1 : void 0
|
|
1520
1520
|
}, u)
|
|
@@ -1527,11 +1527,11 @@ function an(e, r, n) {
|
|
|
1527
1527
|
!H && !j && console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
|
1528
1528
|
let { pressProps: A, isPressed: C } = jr({
|
|
1529
1529
|
isDisabled: i
|
|
1530
|
-
}), { focusableProps: P } = nn(e, n), O =
|
|
1530
|
+
}), { focusableProps: P } = nn(e, n), O = q(A, P), I = Pr(e, {
|
|
1531
1531
|
labelable: !0
|
|
1532
1532
|
});
|
|
1533
1533
|
return kr(n, r.isSelected, r.setSelected), {
|
|
1534
|
-
inputProps:
|
|
1534
|
+
inputProps: q(I, {
|
|
1535
1535
|
"aria-invalid": L || F === "invalid" || void 0,
|
|
1536
1536
|
"aria-errormessage": e["aria-errormessage"],
|
|
1537
1537
|
"aria-controls": e["aria-controls"],
|
|
@@ -1584,7 +1584,7 @@ function on(e = {}) {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
function sn(e) {
|
|
1586
1586
|
let { children: r, elementType: n = "div", isFocusable: i, style: o, ...f } = e, { visuallyHiddenProps: u } = on(e);
|
|
1587
|
-
return /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ ae.createElement(n, q(f, u), r);
|
|
1588
1588
|
}
|
|
1589
1589
|
function ln(e, r, n) {
|
|
1590
1590
|
let { inputProps: i, isSelected: o, isPressed: f, isDisabled: u, isReadOnly: h } = an(e, r, n);
|
|
@@ -1625,7 +1625,7 @@ function cn(e) {
|
|
|
1625
1625
|
setSelected: i,
|
|
1626
1626
|
toggle: () => i(!n)
|
|
1627
1627
|
}, { inputProps: f } = ln(e, o, r);
|
|
1628
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ B.jsxs(
|
|
1629
1629
|
"label",
|
|
1630
1630
|
{
|
|
1631
1631
|
"data-on": n || void 0,
|
|
@@ -1636,33 +1636,54 @@ function cn(e) {
|
|
|
1636
1636
|
opacity: e.isDisabled ? 0.4 : 1
|
|
1637
1637
|
},
|
|
1638
1638
|
children: [
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ B.jsx(sn, { children: /* @__PURE__ */ B.jsx("input", { ...f, ref: r }) }),
|
|
1640
|
+
/* @__PURE__ */ B.jsxs(
|
|
1641
1641
|
"div",
|
|
1642
1642
|
{
|
|
1643
1643
|
style: {
|
|
1644
|
-
|
|
1645
|
-
width: 50,
|
|
1646
|
-
height: 26,
|
|
1647
|
-
borderRadius: 50,
|
|
1648
|
-
backgroundColor: o.isSelected ? xt.Primary : xt.Grey,
|
|
1649
|
-
cursor: e.isDisabled ? "not-allowed" : "pointer"
|
|
1644
|
+
display: "flex"
|
|
1650
1645
|
},
|
|
1651
|
-
children:
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1646
|
+
children: [
|
|
1647
|
+
/* @__PURE__ */ B.jsx(
|
|
1648
|
+
"div",
|
|
1649
|
+
{
|
|
1650
|
+
style: {
|
|
1651
|
+
position: "relative",
|
|
1652
|
+
width: 50,
|
|
1653
|
+
height: 26,
|
|
1654
|
+
borderRadius: 50,
|
|
1655
|
+
backgroundColor: o.isSelected ? xt.Primary : xt.Grey,
|
|
1656
|
+
cursor: e.isDisabled ? "not-allowed" : "pointer"
|
|
1657
|
+
},
|
|
1658
|
+
children: /* @__PURE__ */ B.jsx(
|
|
1659
|
+
"div",
|
|
1660
|
+
{
|
|
1661
|
+
style: {
|
|
1662
|
+
position: "absolute",
|
|
1663
|
+
width: 22,
|
|
1664
|
+
height: 22,
|
|
1665
|
+
borderRadius: 22,
|
|
1666
|
+
backgroundColor: "white",
|
|
1667
|
+
top: 2,
|
|
1668
|
+
left: o.isSelected ? 26 : 2,
|
|
1669
|
+
transition: "left .2s ease"
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
)
|
|
1663
1673
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1674
|
+
),
|
|
1675
|
+
/* @__PURE__ */ B.jsx(
|
|
1676
|
+
"div",
|
|
1677
|
+
{
|
|
1678
|
+
style: {
|
|
1679
|
+
alignSelf: "center",
|
|
1680
|
+
paddingLeft: 8,
|
|
1681
|
+
fontFamily: "Akagi Pro"
|
|
1682
|
+
},
|
|
1683
|
+
children: e.children
|
|
1684
|
+
}
|
|
1685
|
+
)
|
|
1686
|
+
]
|
|
1666
1687
|
}
|
|
1667
1688
|
)
|
|
1668
1689
|
]
|