@companix/uikit 0.1.41 → 0.1.43
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/CounterInput/CounterInput.scss +29 -0
- package/dist/CounterInput/index.d.ts +14 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/bundle.es.js +122 -120
- package/dist/bundle.es10.js +1 -1
- package/dist/bundle.es11.js +28 -27
- package/dist/bundle.es13.js +4 -4
- package/dist/bundle.es14.js +4 -4
- package/dist/bundle.es15.js +2 -2
- package/dist/bundle.es16.js +1 -1
- package/dist/bundle.es17.js +1 -1
- package/dist/bundle.es18.js +105 -19
- package/dist/bundle.es19.js +21 -34
- package/dist/bundle.es20.js +33 -24
- package/dist/bundle.es21.js +24 -45
- package/dist/bundle.es22.js +46 -26
- package/dist/bundle.es23.js +24 -259
- package/dist/bundle.es24.js +260 -13
- package/dist/bundle.es25.js +14 -21
- package/dist/bundle.es26.js +20 -37
- package/dist/bundle.es27.js +38 -21
- package/dist/bundle.es28.js +20 -18
- package/dist/bundle.es29.js +18 -21
- package/dist/bundle.es30.js +21 -43
- package/dist/bundle.es31.js +37 -114
- package/dist/bundle.es32.js +119 -72
- package/dist/bundle.es33.js +68 -38
- package/dist/bundle.es34.js +42 -10
- package/dist/bundle.es35.js +11 -85
- package/dist/bundle.es36.js +85 -19
- package/dist/bundle.es37.js +20 -7
- package/dist/bundle.es38.js +7 -3
- package/dist/bundle.es39.js +3 -23
- package/dist/bundle.es40.js +16 -45
- package/dist/bundle.es41.js +51 -56
- package/dist/bundle.es42.js +57 -162
- package/dist/bundle.es43.js +160 -79
- package/dist/bundle.es44.js +81 -7
- package/dist/bundle.es45.js +7 -59
- package/dist/bundle.es46.js +58 -33
- package/dist/bundle.es47.js +33 -20
- package/dist/bundle.es48.js +19 -47
- package/dist/bundle.es49.js +49 -11
- package/dist/bundle.es50.js +11 -13
- package/dist/bundle.es51.js +13 -13
- package/dist/bundle.es52.js +13 -30
- package/dist/bundle.es53.js +30 -11
- package/dist/bundle.es54.js +10 -25
- package/dist/bundle.es55.js +17 -29
- package/dist/bundle.es56.js +36 -48
- package/dist/bundle.es57.js +49 -55
- package/dist/bundle.es58.js +56 -8
- package/dist/bundle.es59.js +8 -26
- package/dist/bundle.es60.js +27 -5
- package/dist/bundle.es61.js +5 -66
- package/dist/bundle.es62.js +66 -23
- package/dist/bundle.es63.js +22 -23
- package/dist/bundle.es64.js +24 -90
- package/dist/bundle.es65.js +90 -18
- package/dist/bundle.es66.js +17 -93
- package/dist/bundle.es67.js +93 -73
- package/dist/bundle.es68.js +73 -23
- package/dist/bundle.es69.js +20 -35
- package/dist/bundle.es70.js +39 -24
- package/dist/bundle.es71.js +24 -79
- package/dist/bundle.es72.js +71 -85
- package/dist/bundle.es73.js +93 -10
- package/dist/bundle.es74.js +10 -6
- package/dist/bundle.es75.js +5 -69
- package/dist/bundle.es76.js +68 -10
- package/dist/bundle.es77.js +11 -42
- package/dist/bundle.es78.js +42 -32
- package/dist/bundle.es79.js +31 -64
- package/dist/bundle.es80.js +65 -40
- package/dist/bundle.es81.js +40 -14
- package/dist/bundle.es82.js +15 -32
- package/dist/bundle.es83.js +23 -61
- package/dist/bundle.es84.js +69 -13
- package/dist/bundle.es85.js +12 -12
- package/dist/bundle.es86.js +3 -3
- package/dist/bundle.es87.js +2 -2
- package/dist/bundle.es88.js +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.scss +1 -0
- package/package.json +1 -1
package/dist/bundle.es19.js
CHANGED
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className: "checkbox-box",
|
|
22
|
-
checked: a,
|
|
23
|
-
onCheckedChange: l,
|
|
24
|
-
disabled: o,
|
|
25
|
-
id: i,
|
|
26
|
-
children: /* @__PURE__ */ e(s.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ e(x, { icon: k, size: "xxxs" }) })
|
|
27
|
-
}
|
|
28
|
-
),
|
|
29
|
-
r && /* @__PURE__ */ e("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(o), children: r })
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
};
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Scrollable as n } from "./bundle.es8.js";
|
|
3
|
+
const s = ({
|
|
4
|
+
children: o,
|
|
5
|
+
maxHeight: t,
|
|
6
|
+
scrollboxRef: i,
|
|
7
|
+
optionsWrapperRef: e
|
|
8
|
+
}) => /* @__PURE__ */ r(
|
|
9
|
+
n,
|
|
10
|
+
{
|
|
11
|
+
ref: i,
|
|
12
|
+
implementation: "inner",
|
|
13
|
+
padding: 10,
|
|
14
|
+
thumbPadding: 3,
|
|
15
|
+
thumbColor: "#0000002b",
|
|
16
|
+
maxHeight: t,
|
|
17
|
+
scrollY: !0,
|
|
18
|
+
children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
34
21
|
export {
|
|
35
|
-
|
|
22
|
+
s as OptionsList
|
|
36
23
|
};
|
package/dist/bundle.es20.js
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import b from "classnames";
|
|
3
|
+
import * as s from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Icon as x } from "./bundle.es37.js";
|
|
5
|
+
import { faCheck as k } from "@companix/icons-solid";
|
|
6
|
+
import { useId as f } from "react";
|
|
7
|
+
import { attr as c } from "@companix/utils-browser";
|
|
8
|
+
const j = (d) => {
|
|
9
|
+
const { checked: a, className: m, required: t, disabled: o, onCheckedChange: l, size: h, label: r } = d, i = f();
|
|
10
|
+
return /* @__PURE__ */ n(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: b("checkbox", m),
|
|
14
|
+
"data-size": h ?? "md",
|
|
15
|
+
"data-required": c(t && !a),
|
|
16
|
+
"data-disabled": c(o),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
s.Root,
|
|
20
|
+
{
|
|
21
|
+
className: "checkbox-box",
|
|
22
|
+
checked: a,
|
|
23
|
+
onCheckedChange: l,
|
|
24
|
+
disabled: o,
|
|
25
|
+
id: i,
|
|
26
|
+
children: /* @__PURE__ */ e(s.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ e(x, { icon: k, size: "xxxs" }) })
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
r && /* @__PURE__ */ e("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(o), children: r })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
24
33
|
};
|
|
25
34
|
export {
|
|
26
|
-
|
|
35
|
+
j as Checkbox
|
|
27
36
|
};
|
package/dist/bundle.es21.js
CHANGED
|
@@ -1,48 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
`radio-${d.value}-${u}`
|
|
26
|
-
))
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}, f = ({ value: t, label: m, size: a = "md", disabled: r, required: i }) => {
|
|
30
|
-
const e = N();
|
|
31
|
-
return /* @__PURE__ */ p(
|
|
32
|
-
"span",
|
|
33
|
-
{
|
|
34
|
-
className: "radio",
|
|
35
|
-
"data-disabled": s(r),
|
|
36
|
-
"data-size": a,
|
|
37
|
-
"data-required": s(i),
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
|
|
40
|
-
/* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
);
|
|
1
|
+
import { jsxs as d, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-switch";
|
|
3
|
+
import { attr as a } from "@companix/utils-browser";
|
|
4
|
+
import { useId as n } from "react";
|
|
5
|
+
const u = (m) => {
|
|
6
|
+
const { checked: e, disabled: s, onCheckedChange: o, uncheckedIcon: i, checkedIcon: t, label: h } = m, l = n();
|
|
7
|
+
return /* @__PURE__ */ d("div", { className: "switch", "data-disabled": a(s), children: [
|
|
8
|
+
/* @__PURE__ */ c(
|
|
9
|
+
r.Root,
|
|
10
|
+
{
|
|
11
|
+
className: "switch-track",
|
|
12
|
+
checked: e,
|
|
13
|
+
onCheckedChange: o,
|
|
14
|
+
disabled: s,
|
|
15
|
+
id: l,
|
|
16
|
+
children: /* @__PURE__ */ d(r.Thumb, { className: "switch-thumb", children: [
|
|
17
|
+
i && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(!e), children: i }),
|
|
18
|
+
t && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(e), children: t })
|
|
19
|
+
] })
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
h && /* @__PURE__ */ c("label", { className: "switch-label", htmlFor: l, "data-disabled": s, children: h })
|
|
23
|
+
] });
|
|
44
24
|
};
|
|
45
25
|
export {
|
|
46
|
-
|
|
47
|
-
R as RadioGroup
|
|
26
|
+
u as Switch
|
|
48
27
|
};
|
package/dist/bundle.es22.js
CHANGED
|
@@ -1,28 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { useId as N } from "react";
|
|
4
|
+
import * as l from "@radix-ui/react-radio-group";
|
|
5
|
+
import { attr as s } from "@companix/utils-browser";
|
|
6
|
+
const R = (t) => {
|
|
7
|
+
const { options: m, value: a, onChange: r, disabled: i, required: e, size: n, className: c } = t;
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
|
+
l.Root,
|
|
10
|
+
{
|
|
11
|
+
className: h("radio-group", c),
|
|
12
|
+
disabled: i,
|
|
13
|
+
"data-required": s(e && !a),
|
|
14
|
+
"data-v": a,
|
|
15
|
+
value: a,
|
|
16
|
+
onValueChange: (d) => r(d),
|
|
17
|
+
children: m.map((d, u) => /* @__PURE__ */ o(
|
|
18
|
+
f,
|
|
19
|
+
{
|
|
20
|
+
...d,
|
|
21
|
+
size: n,
|
|
22
|
+
disabled: i,
|
|
23
|
+
required: e && !a
|
|
24
|
+
},
|
|
25
|
+
`radio-${d.value}-${u}`
|
|
26
|
+
))
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}, f = ({ value: t, label: m, size: a = "md", disabled: r, required: i }) => {
|
|
30
|
+
const e = N();
|
|
31
|
+
return /* @__PURE__ */ p(
|
|
32
|
+
"span",
|
|
33
|
+
{
|
|
34
|
+
className: "radio",
|
|
35
|
+
"data-disabled": s(r),
|
|
36
|
+
"data-size": a,
|
|
37
|
+
"data-required": s(i),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
|
|
40
|
+
/* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
26
45
|
export {
|
|
27
|
-
|
|
46
|
+
f as Radio,
|
|
47
|
+
R as RadioGroup
|
|
28
48
|
};
|
package/dist/bundle.es23.js
CHANGED
|
@@ -1,263 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import r from "classnames";
|
|
3
|
+
import { customCSS as i } from "@companix/utils-browser";
|
|
4
|
+
import { PopupLayout as o } from "./bundle.es26.js";
|
|
5
|
+
const l = ({
|
|
6
|
+
direction: e,
|
|
7
|
+
children: t,
|
|
8
|
+
size: a,
|
|
9
|
+
overlayClassName: m,
|
|
10
|
+
className: s,
|
|
11
|
+
...p
|
|
12
|
+
}) => /* @__PURE__ */ c(
|
|
13
|
+
o,
|
|
14
|
+
{
|
|
15
|
+
...p,
|
|
16
|
+
overlay: { className: r("drawer-overlay", m) },
|
|
17
|
+
content: {
|
|
18
|
+
className: r("popup drawer", s),
|
|
19
|
+
style: i({ "--drawer-size": a ?? "50%" }),
|
|
20
|
+
"data-direction": e
|
|
16
21
|
},
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
de({
|
|
20
|
-
isDisabled: !w || T || _ || !M
|
|
21
|
-
});
|
|
22
|
-
const ee = (r) => {
|
|
23
|
-
e.current && !e.current.contains(r.target) || (O.current = e.current?.getBoundingClientRect().height || 0, v(!0), I.current = /* @__PURE__ */ new Date(), le() && window.addEventListener("touchend", () => d.current = !1, { once: !0 }), r.target.setPointerCapture(r.pointerId), h.current = r.pageY);
|
|
24
|
-
}, z = (r, c) => {
|
|
25
|
-
let n = r;
|
|
26
|
-
const u = window.getSelection()?.toString(), i = e.current ? W(e.current) : null, a = /* @__PURE__ */ new Date();
|
|
27
|
-
if (n.tagName === "SELECT" || n.hasAttribute("data-no-drag") || n.closest("[data-no-drag]") || H.current && a.getTime() - H.current.getTime() < 500)
|
|
28
|
-
return !1;
|
|
29
|
-
if (i !== null && i > 0)
|
|
30
|
-
return !0;
|
|
31
|
-
if (u && u.length > 0)
|
|
32
|
-
return !1;
|
|
33
|
-
if (o.current && a.getTime() - o.current.getTime() < pe && i === 0 || c)
|
|
34
|
-
return o.current = a, !1;
|
|
35
|
-
for (; n; ) {
|
|
36
|
-
if (n.scrollHeight > n.clientHeight) {
|
|
37
|
-
if (n.scrollTop !== 0)
|
|
38
|
-
return o.current = /* @__PURE__ */ new Date(), !1;
|
|
39
|
-
if (n.getAttribute("role") === "dialog")
|
|
40
|
-
return !0;
|
|
41
|
-
}
|
|
42
|
-
n = n.parentNode;
|
|
43
|
-
}
|
|
44
|
-
return !0;
|
|
45
|
-
}, te = (r) => {
|
|
46
|
-
if (e.current && T) {
|
|
47
|
-
const c = h.current - r.pageY, n = c > 0, u = Math.abs(c), i = O.current, a = u / i;
|
|
48
|
-
if (!d.current && !z(r.target, n)) return;
|
|
49
|
-
if (e.current.classList.add(j), d.current = !0, R(e.current, {
|
|
50
|
-
transition: "none"
|
|
51
|
-
}), R(x.current, {
|
|
52
|
-
transition: "none"
|
|
53
|
-
}), n) {
|
|
54
|
-
const F = fe(c), U = Math.min(F * -1, 0) * 1;
|
|
55
|
-
R(e.current, {
|
|
56
|
-
transform: `translate3d(0, ${U}px, 0)`
|
|
57
|
-
});
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const k = 1 - a;
|
|
61
|
-
R(
|
|
62
|
-
x.current,
|
|
63
|
-
{
|
|
64
|
-
opacity: `${k}`,
|
|
65
|
-
transition: "none"
|
|
66
|
-
},
|
|
67
|
-
!0
|
|
68
|
-
);
|
|
69
|
-
const $ = u;
|
|
70
|
-
R(e.current, {
|
|
71
|
-
transform: `translate3d(0, ${$}px, 0)`
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
t.useEffect(() => {
|
|
76
|
-
window.requestAnimationFrame(() => {
|
|
77
|
-
N.current = !0;
|
|
78
|
-
});
|
|
79
|
-
}, []), t.useEffect(() => {
|
|
80
|
-
const r = () => {
|
|
81
|
-
if (!e.current) return;
|
|
82
|
-
const c = document.activeElement;
|
|
83
|
-
if (ce(c) || b.current) {
|
|
84
|
-
const n = window.visualViewport?.height || 0, u = window.innerHeight, i = u - n, a = e.current.getBoundingClientRect().height || 0, k = a > u * 0.8;
|
|
85
|
-
g.current || (g.current = a);
|
|
86
|
-
const $ = e.current.getBoundingClientRect().top;
|
|
87
|
-
if (Math.abs(C.current - i) > 60 && (b.current = !b.current), C.current = i, a > n || b.current) {
|
|
88
|
-
const F = e.current.getBoundingClientRect().height;
|
|
89
|
-
let U = F;
|
|
90
|
-
F > n && (U = n - (k ? $ : he)), e.current.style.height = `${Math.max(
|
|
91
|
-
U,
|
|
92
|
-
n - $
|
|
93
|
-
)}px`;
|
|
94
|
-
} else ue() || (e.current.style.height = `${g.current}px`);
|
|
95
|
-
e.current.style.bottom = `${Math.max(i, 0)}px`;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return window.visualViewport?.addEventListener("resize", r), () => window.visualViewport?.removeEventListener("resize", r);
|
|
99
|
-
}, []);
|
|
100
|
-
const B = (r) => {
|
|
101
|
-
re(), r || V(!1);
|
|
102
|
-
}, X = () => {
|
|
103
|
-
e.current && (R(e.current, {
|
|
104
|
-
transform: "translate3d(0, 0, 0)",
|
|
105
|
-
transition: `transform ${Y.DURATION}s cubic-bezier(${Y.EASE.join(",")})`
|
|
106
|
-
}), R(x.current, {
|
|
107
|
-
transition: `opacity ${Y.DURATION}s cubic-bezier(${Y.EASE.join(",")})`,
|
|
108
|
-
opacity: "1"
|
|
109
|
-
}));
|
|
110
|
-
}, re = () => {
|
|
111
|
-
!T || !e.current || (e.current.classList.remove(j), d.current = !1, v(!1), L.current = /* @__PURE__ */ new Date());
|
|
112
|
-
}, ne = (r) => {
|
|
113
|
-
if (!T || !e.current) return;
|
|
114
|
-
e.current.classList.remove(j), d.current = !1, v(!1), L.current = /* @__PURE__ */ new Date();
|
|
115
|
-
const c = W(e.current);
|
|
116
|
-
if (!r || !z(r.target, !1) || !c || Number.isNaN(c) || I.current === null) return;
|
|
117
|
-
const n = L.current.getTime() - I.current.getTime(), u = h.current - r.pageY, i = Math.abs(u) / n;
|
|
118
|
-
if (i > 0.05 && (A(!0), setTimeout(() => {
|
|
119
|
-
A(!1);
|
|
120
|
-
}, 200)), u > 0) {
|
|
121
|
-
X();
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (i > ge) {
|
|
125
|
-
B();
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const a = Math.min(
|
|
129
|
-
e.current.getBoundingClientRect().height ?? 0,
|
|
130
|
-
window.innerHeight
|
|
131
|
-
);
|
|
132
|
-
if (Math.abs(c) >= a * me) {
|
|
133
|
-
B();
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
X();
|
|
137
|
-
};
|
|
138
|
-
return t.useEffect(() => (w && (P(!0), R(document.documentElement, {
|
|
139
|
-
scrollBehavior: "auto"
|
|
140
|
-
}), H.current = /* @__PURE__ */ new Date()), () => {
|
|
141
|
-
ae(document.documentElement, "scrollBehavior");
|
|
142
|
-
}), [w]), /* @__PURE__ */ s(
|
|
143
|
-
E.Root,
|
|
144
|
-
{
|
|
145
|
-
defaultOpen: S,
|
|
146
|
-
onOpenChange: (r) => {
|
|
147
|
-
r ? P(!0) : B(!0), V(r);
|
|
148
|
-
},
|
|
149
|
-
open: w,
|
|
150
|
-
modal: !0,
|
|
151
|
-
children: /* @__PURE__ */ s(
|
|
152
|
-
ie.Provider,
|
|
153
|
-
{
|
|
154
|
-
value: {
|
|
155
|
-
drawerRef: e,
|
|
156
|
-
overlayRef: x,
|
|
157
|
-
onPress: ee,
|
|
158
|
-
onRelease: ne,
|
|
159
|
-
onDrag: te,
|
|
160
|
-
isOpen: w,
|
|
161
|
-
isDragging: T,
|
|
162
|
-
keyboardIsOpen: b,
|
|
163
|
-
closeDrawer: () => B(),
|
|
164
|
-
shouldAnimate: N,
|
|
165
|
-
onClosed: D,
|
|
166
|
-
disableEsc: f
|
|
167
|
-
},
|
|
168
|
-
children: y
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
}, Re = t.forwardRef(
|
|
174
|
-
({ className: m, ...p }, l) => {
|
|
175
|
-
const { overlayRef: D, onRelease: y, shouldAnimate: S } = J(), f = Q(l, D), M = t.useCallback(
|
|
176
|
-
(P) => y(P),
|
|
177
|
-
[y]
|
|
178
|
-
);
|
|
179
|
-
return /* @__PURE__ */ s(
|
|
180
|
-
E.Overlay,
|
|
181
|
-
{
|
|
182
|
-
onMouseUp: M,
|
|
183
|
-
ref: f,
|
|
184
|
-
"data-animate": S?.current ? "true" : "false",
|
|
185
|
-
className: G("popup-overlay drawer-overlay", m),
|
|
186
|
-
...p
|
|
187
|
-
}
|
|
188
|
-
);
|
|
22
|
+
children: t
|
|
189
23
|
}
|
|
190
|
-
)
|
|
191
|
-
|
|
192
|
-
const {
|
|
193
|
-
drawerRef: P,
|
|
194
|
-
onPress: T,
|
|
195
|
-
onRelease: v,
|
|
196
|
-
onDrag: _,
|
|
197
|
-
keyboardIsOpen: A,
|
|
198
|
-
shouldAnimate: x,
|
|
199
|
-
onClosed: H,
|
|
200
|
-
disableEsc: I
|
|
201
|
-
} = J(), L = Q(M, P), o = t.useRef(null), d = t.useRef(null), h = t.useRef(!1), b = (e, O = 0) => {
|
|
202
|
-
if (h.current) return !0;
|
|
203
|
-
const g = Math.abs(e.y), w = Math.abs(e.x) > g;
|
|
204
|
-
return !(e.y * 1 < 0) && g >= 0 && g <= O ? !w : (h.current = !0, !0);
|
|
205
|
-
}, N = (e) => {
|
|
206
|
-
o.current = null, h.current = !1, v(e);
|
|
207
|
-
};
|
|
208
|
-
return /* @__PURE__ */ q(
|
|
209
|
-
E.Content,
|
|
210
|
-
{
|
|
211
|
-
"data-direction": "bottom",
|
|
212
|
-
"data-animate": x?.current ? "true" : "false",
|
|
213
|
-
className: G("popup drawer drawer-mobile", D),
|
|
214
|
-
style: { ...oe({ "--drawer-size": y ?? "50%" }), ...p },
|
|
215
|
-
...f,
|
|
216
|
-
ref: L,
|
|
217
|
-
onPointerDown: (e) => {
|
|
218
|
-
f.onPointerDown?.(e), o.current = { x: e.pageX, y: e.pageY }, T(e);
|
|
219
|
-
},
|
|
220
|
-
onOpenAutoFocus: (e) => {
|
|
221
|
-
l?.(e), e.preventDefault();
|
|
222
|
-
},
|
|
223
|
-
onEscapeKeyDown: (e) => {
|
|
224
|
-
I && e.preventDefault();
|
|
225
|
-
},
|
|
226
|
-
onPointerDownOutside: (e) => {
|
|
227
|
-
m?.(e), !e.defaultPrevented && A.current && (A.current = !1);
|
|
228
|
-
},
|
|
229
|
-
onPointerMove: (e) => {
|
|
230
|
-
if (d.current = e, f.onPointerMove?.(e), !o.current) return;
|
|
231
|
-
const O = e.pageY - o.current.y, g = e.pageX - o.current.x, C = e.pointerType === "touch" ? 10 : 2;
|
|
232
|
-
b({ x: g, y: O }, C) ? _(e) : (Math.abs(g) > C || Math.abs(O) > C) && (o.current = null);
|
|
233
|
-
},
|
|
234
|
-
onPointerUp: (e) => {
|
|
235
|
-
f.onPointerUp?.(e), o.current = null, h.current = !1, v(e);
|
|
236
|
-
},
|
|
237
|
-
onPointerOut: (e) => {
|
|
238
|
-
f.onPointerOut?.(e), N(d.current);
|
|
239
|
-
},
|
|
240
|
-
onContextMenu: (e) => {
|
|
241
|
-
f.onContextMenu?.(e), d.current && N(d.current);
|
|
242
|
-
},
|
|
243
|
-
children: [
|
|
244
|
-
/* @__PURE__ */ s(se, { callback: H }),
|
|
245
|
-
/* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(E.Title, {}) }),
|
|
246
|
-
/* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(E.Description, {}) }),
|
|
247
|
-
S
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
), Te = t.forwardRef(
|
|
253
|
-
({ children: m, ...p }, l) => /* @__PURE__ */ s("div", { className: "drawer-handle", "aria-hidden": "true", ref: l, ...p, children: /* @__PURE__ */ s("span", { className: "drawer-handle-hitarea", "aria-hidden": "true", children: m }) })
|
|
254
|
-
), Z = ({ children: m, className: p, size: l, ...D }) => /* @__PURE__ */ s(we, { ...D, children: /* @__PURE__ */ q(E.Portal, { children: [
|
|
255
|
-
/* @__PURE__ */ s(Re, {}),
|
|
256
|
-
/* @__PURE__ */ s(De, { className: p, size: l, children: m })
|
|
257
|
-
] }) });
|
|
258
|
-
Z.Close = E.Close;
|
|
259
|
-
Z.Handle = Te;
|
|
24
|
+
);
|
|
25
|
+
l.Close = o.Close;
|
|
260
26
|
export {
|
|
261
|
-
|
|
262
|
-
Z as MobileDrawer
|
|
27
|
+
l as Drawer
|
|
263
28
|
};
|