@shiflo/ui 0.1.6 → 0.2.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/assets/icons/index.mjs +30 -22
- package/dist/assets/icons/index.ts-Cv-GsCPN.js +48 -0
- package/dist/assets/icons/solid/arrow-left-solid.svg-C16XJbK9.js +5 -0
- package/dist/assets/icons/solid/circle-check-solid.svg-D2Pv_oiO.js +5 -0
- package/dist/assets/icons/solid/circle-exclamation-solid.svg-CuZt_q4T.js +5 -0
- package/dist/assets/icons/solid/circle-info-solid.svg-eMJtJJRm.js +5 -0
- package/dist/assets/icons/solid/index.d.ts +4 -0
- package/dist/assets/icons/solid/index.mjs +32 -24
- package/dist/components/BottomSheet/BottomSheet.d.ts +2 -2
- package/dist/components/BottomSheet/BottomSheet.mjs +78 -62
- package/dist/components/BottomSheet/BottomSheet.typing.d.ts +2 -4
- package/dist/components/Button/Button.mjs +112 -178
- package/dist/components/Button/Button.typing.d.ts +2 -3
- package/dist/components/Dialog/Dialog.mjs +37 -38
- package/dist/components/Dialog/Dialog.typing.d.ts +2 -3
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.mjs +11 -23
- package/dist/components/Icon/Icon.typing.d.ts +2 -2
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.mjs +55 -53
- package/dist/components/Overlay/Overlay.typing.d.ts +3 -2
- package/dist/components/Snackbar/Snackbar.mjs +59 -60
- package/dist/components/Snackbar/Snackbar.typing.d.ts +3 -3
- package/dist/components/Switch/Switch.mjs +35 -50
- package/dist/components/Switch/Switch.typing.d.ts +3 -3
- package/dist/components/Tag/Tag.mjs +8 -9
- package/dist/components/Tag/Tag.typing.d.ts +2 -2
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.mjs +15 -14
- package/dist/components/TextField/TextField.typing.d.ts +3 -3
- package/dist/components/Typography/Typography.mjs +14 -15
- package/dist/theme/dark.mjs +10 -10
- package/dist/theme/light.mjs +8 -8
- package/package.json +1 -3
- package/dist/assets/icons/index.ts-Bfm0GTNS.js +0 -40
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as e } from "./line/calendar-line.svg-DHsuXoUL.js";
|
|
2
2
|
import { S } from "./solid/calendar-days-solid.svg-CIj8vf6t.js";
|
|
3
|
-
import { S as
|
|
4
|
-
import { S as
|
|
5
|
-
import { S as
|
|
3
|
+
import { S as i } from "./solid/calendar-lines-solid.svg-D2qG_E7t.js";
|
|
4
|
+
import { S as t } from "./solid/calendar-week-solid.svg-CVmrJtif.js";
|
|
5
|
+
import { S as f } from "./solid/calendars-solid.svg-rClh_xBu.js";
|
|
6
6
|
import { S as p } from "./solid/gear-solid.svg-C6vEx0Wx.js";
|
|
7
7
|
import { S as n } from "./solid/grid-2-solid.svg-BRtzwK6Y.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { S as
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
8
|
+
import { S as c } from "./solid/pen-to-square-solid.svg-DUdNcuTM.js";
|
|
9
|
+
import { S as h } from "./solid/plus-solid.svg-piiaS3kO.js";
|
|
10
|
+
import { S as L } from "./solid/rotate-right-solid.svg-CYW200XH.js";
|
|
11
|
+
import { S as D } from "./solid/xmark-solid.svg-Ce8xHlZn.js";
|
|
12
12
|
import { S as P } from "./solid/check-solid.svg-C41sTTzR.js";
|
|
13
13
|
import { S as T } from "./solid/trash-solid.svg-iJSf_6Y3.js";
|
|
14
14
|
import { S as q } from "./solid/minus-solid.svg-BBiGvc-2.js";
|
|
15
|
-
import { S as
|
|
16
|
-
import { S as
|
|
17
|
-
import { S as
|
|
15
|
+
import { S as y } from "./solid/briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
16
|
+
import { S as A } from "./solid/chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
17
|
+
import { S as H } from "./solid/clock-desk-solid.svg-Dvm3Xip1.js";
|
|
18
|
+
import { S as M } from "./solid/circle-check-solid.svg-D2Pv_oiO.js";
|
|
19
|
+
import { S as X } from "./solid/arrow-left-solid.svg-C16XJbK9.js";
|
|
20
|
+
import { S as j } from "./solid/circle-info-solid.svg-eMJtJJRm.js";
|
|
21
|
+
import { S as F } from "./solid/circle-exclamation-solid.svg-CuZt_q4T.js";
|
|
18
22
|
export {
|
|
19
|
-
|
|
23
|
+
X as ArrowLeftSolid,
|
|
24
|
+
y as BriefcaseBlankSolid,
|
|
20
25
|
S as CalendarDaysSolid,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
e as CalendarLine,
|
|
27
|
+
i as CalendarLinesSolid,
|
|
28
|
+
t as CalendarWeekSolid,
|
|
29
|
+
f as CalendarsSolid,
|
|
30
|
+
A as ChartSimpleHorizontalSolid,
|
|
26
31
|
P as CheckSolid,
|
|
27
|
-
|
|
32
|
+
M as CircleCheckSolid,
|
|
33
|
+
F as CircleExclamationSolid,
|
|
34
|
+
j as CircleInfoSolid,
|
|
35
|
+
H as ClockDeskSolid,
|
|
28
36
|
p as GearSolid,
|
|
29
37
|
n as Grid2Solid,
|
|
30
38
|
q as MinusSolid,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
c as PenToSquareSolid,
|
|
40
|
+
h as PlusSolid,
|
|
41
|
+
L as RotateRightSolid,
|
|
34
42
|
T as TrashSolid,
|
|
35
|
-
|
|
43
|
+
D as XmarkSolid
|
|
36
44
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { S as o } from "./line/calendar-line.svg-DHsuXoUL.js";
|
|
2
|
+
import { S } from "./solid/calendar-days-solid.svg-CIj8vf6t.js";
|
|
3
|
+
import { S as i } from "./solid/calendar-lines-solid.svg-D2qG_E7t.js";
|
|
4
|
+
import { S as r } from "./solid/calendar-week-solid.svg-CVmrJtif.js";
|
|
5
|
+
import { S as l } from "./solid/calendars-solid.svg-rClh_xBu.js";
|
|
6
|
+
import { S as a } from "./solid/gear-solid.svg-C6vEx0Wx.js";
|
|
7
|
+
import { S as e } from "./solid/grid-2-solid.svg-BRtzwK6Y.js";
|
|
8
|
+
import { S as d } from "./solid/pen-to-square-solid.svg-DUdNcuTM.js";
|
|
9
|
+
import { S as m } from "./solid/plus-solid.svg-piiaS3kO.js";
|
|
10
|
+
import { S as t } from "./solid/rotate-right-solid.svg-CYW200XH.js";
|
|
11
|
+
import { S as s } from "./solid/xmark-solid.svg-Ce8xHlZn.js";
|
|
12
|
+
import { S as n } from "./solid/check-solid.svg-C41sTTzR.js";
|
|
13
|
+
import { S as f } from "./solid/trash-solid.svg-iJSf_6Y3.js";
|
|
14
|
+
import { S as g } from "./solid/minus-solid.svg-BBiGvc-2.js";
|
|
15
|
+
import { S as p } from "./solid/briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
16
|
+
import { S as C } from "./solid/chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
17
|
+
import { S as v } from "./solid/clock-desk-solid.svg-Dvm3Xip1.js";
|
|
18
|
+
import { S as c } from "./solid/circle-check-solid.svg-D2Pv_oiO.js";
|
|
19
|
+
import { S as k } from "./solid/arrow-left-solid.svg-C16XJbK9.js";
|
|
20
|
+
import { S as h } from "./solid/circle-info-solid.svg-eMJtJJRm.js";
|
|
21
|
+
import { S as u } from "./solid/circle-exclamation-solid.svg-CuZt_q4T.js";
|
|
22
|
+
const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
23
|
+
__proto__: null,
|
|
24
|
+
ArrowLeftSolid: k,
|
|
25
|
+
BriefcaseBlankSolid: p,
|
|
26
|
+
CalendarDaysSolid: S,
|
|
27
|
+
CalendarLine: o,
|
|
28
|
+
CalendarLinesSolid: i,
|
|
29
|
+
CalendarWeekSolid: r,
|
|
30
|
+
CalendarsSolid: l,
|
|
31
|
+
ChartSimpleHorizontalSolid: C,
|
|
32
|
+
CheckSolid: n,
|
|
33
|
+
CircleCheckSolid: c,
|
|
34
|
+
CircleExclamationSolid: u,
|
|
35
|
+
CircleInfoSolid: h,
|
|
36
|
+
ClockDeskSolid: v,
|
|
37
|
+
GearSolid: a,
|
|
38
|
+
Grid2Solid: e,
|
|
39
|
+
MinusSolid: g,
|
|
40
|
+
PenToSquareSolid: d,
|
|
41
|
+
PlusSolid: m,
|
|
42
|
+
RotateRightSolid: t,
|
|
43
|
+
TrashSolid: f,
|
|
44
|
+
XmarkSolid: s
|
|
45
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
46
|
+
export {
|
|
47
|
+
W as S
|
|
48
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const r = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", ...t }, /* @__PURE__ */ e.createElement("path", { fill: "currentColor", d: "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" }));
|
|
3
|
+
export {
|
|
4
|
+
r as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const c = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...t }, /* @__PURE__ */ e.createElement("path", { fill: "currentColor", d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" }));
|
|
3
|
+
export {
|
|
4
|
+
c as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const l = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...t }, /* @__PURE__ */ e.createElement("path", { fill: "currentColor", d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" }));
|
|
3
|
+
export {
|
|
4
|
+
l as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...l }, /* @__PURE__ */ e.createElement("path", { fill: "currentColor", d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" }));
|
|
3
|
+
export {
|
|
4
|
+
t as S
|
|
5
|
+
};
|
|
@@ -14,3 +14,7 @@ export { default as MinusSolid } from './minus-solid.svg';
|
|
|
14
14
|
export { default as BriefcaseBlankSolid } from './briefcase-blank-solid.svg';
|
|
15
15
|
export { default as ChartSimpleHorizontalSolid } from './chart-simple-horizontal-solid.svg';
|
|
16
16
|
export { default as ClockDeskSolid } from './clock-desk-solid.svg';
|
|
17
|
+
export { default as CircleCheckSolid } from './circle-check-solid.svg';
|
|
18
|
+
export { default as ArrowLeftSolid } from './arrow-left-solid.svg';
|
|
19
|
+
export { default as CircleInfoSolid } from './circle-info-solid.svg';
|
|
20
|
+
export { default as CircleExclamationSolid } from './circle-exclamation-solid.svg';
|
|
@@ -1,34 +1,42 @@
|
|
|
1
|
-
import { S
|
|
2
|
-
import { S as
|
|
3
|
-
import { S as
|
|
4
|
-
import { S as
|
|
5
|
-
import { S as
|
|
1
|
+
import { S } from "./calendar-days-solid.svg-CIj8vf6t.js";
|
|
2
|
+
import { S as a } from "./calendar-lines-solid.svg-D2qG_E7t.js";
|
|
3
|
+
import { S as i } from "./calendar-week-solid.svg-CVmrJtif.js";
|
|
4
|
+
import { S as t } from "./calendars-solid.svg-rClh_xBu.js";
|
|
5
|
+
import { S as f } from "./gear-solid.svg-C6vEx0Wx.js";
|
|
6
6
|
import { S as p } from "./grid-2-solid.svg-BRtzwK6Y.js";
|
|
7
7
|
import { S as n } from "./pen-to-square-solid.svg-DUdNcuTM.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { S as
|
|
8
|
+
import { S as c } from "./plus-solid.svg-piiaS3kO.js";
|
|
9
|
+
import { S as h } from "./rotate-right-solid.svg-CYW200XH.js";
|
|
10
10
|
import { S as B } from "./xmark-solid.svg-Ce8xHlZn.js";
|
|
11
11
|
import { S as G } from "./check-solid.svg-C41sTTzR.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { S as
|
|
14
|
-
import { S as
|
|
15
|
-
import { S as
|
|
16
|
-
import { S as
|
|
12
|
+
import { S as P } from "./trash-solid.svg-iJSf_6Y3.js";
|
|
13
|
+
import { S as T } from "./minus-solid.svg-BBiGvc-2.js";
|
|
14
|
+
import { S as q } from "./briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
15
|
+
import { S as y } from "./chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
16
|
+
import { S as A } from "./clock-desk-solid.svg-Dvm3Xip1.js";
|
|
17
|
+
import { S as H } from "./circle-check-solid.svg-D2Pv_oiO.js";
|
|
18
|
+
import { S as M } from "./arrow-left-solid.svg-C16XJbK9.js";
|
|
19
|
+
import { S as X } from "./circle-info-solid.svg-eMJtJJRm.js";
|
|
20
|
+
import { S as j } from "./circle-exclamation-solid.svg-CuZt_q4T.js";
|
|
17
21
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
M as ArrowLeftSolid,
|
|
23
|
+
q as BriefcaseBlankSolid,
|
|
24
|
+
S as CalendarDaysSolid,
|
|
25
|
+
a as CalendarLinesSolid,
|
|
26
|
+
i as CalendarWeekSolid,
|
|
27
|
+
t as CalendarsSolid,
|
|
28
|
+
y as ChartSimpleHorizontalSolid,
|
|
24
29
|
G as CheckSolid,
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
H as CircleCheckSolid,
|
|
31
|
+
j as CircleExclamationSolid,
|
|
32
|
+
X as CircleInfoSolid,
|
|
33
|
+
A as ClockDeskSolid,
|
|
34
|
+
f as GearSolid,
|
|
27
35
|
p as Grid2Solid,
|
|
28
|
-
|
|
36
|
+
T as MinusSolid,
|
|
29
37
|
n as PenToSquareSolid,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
c as PlusSolid,
|
|
39
|
+
h as RotateRightSolid,
|
|
40
|
+
P as TrashSolid,
|
|
33
41
|
B as XmarkSolid
|
|
34
42
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BottomSheetProps } from '.';
|
|
2
|
-
declare function BottomSheet({ open, onClose, children, transitionDuration, maxWidth, onClick, ref, hideDragHandleBar, hideOverlay, style,
|
|
1
|
+
import { BottomSheetProps } from './BottomSheet.typing';
|
|
2
|
+
declare function BottomSheet({ open, onClose, children, transitionDuration, maxWidth, onClick, ref, hideDragHandleBar, hideOverlay, style, ...props }: BottomSheetProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BottomSheet;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const O = n(I.div)`
|
|
1
|
+
import { jsx as g, jsxs as V } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as o, useImperativeHandle as C, useEffect as M } from "react";
|
|
3
|
+
import y from "@emotion/styled";
|
|
4
|
+
import G from "../Overlay/Overlay.mjs";
|
|
5
|
+
const J = y.div`
|
|
7
6
|
width: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
8
7
|
max-width: ${({ maxWidth: t = "375px" }) => t};
|
|
9
8
|
max-height: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
10
9
|
overflow-y: auto;
|
|
11
10
|
margin: ${({ theme: { spacing: t } }) => t[400]};
|
|
12
11
|
margin-bottom: ${({ theme: { spacing: t } }) => `calc(${t[400]} + var(--safe-area-inset-bottom, 0px))`};
|
|
13
|
-
border-radius: ${({ theme: { radius: t } }) => t[
|
|
12
|
+
border-radius: ${({ theme: { radius: t } }) => t[350]};
|
|
14
13
|
background-color: ${({
|
|
15
14
|
theme: {
|
|
16
15
|
palette: { common: t }
|
|
17
16
|
}
|
|
18
17
|
}) => t.background};
|
|
19
|
-
|
|
18
|
+
transition:
|
|
19
|
+
transform ${({ transitionDuration: t }) => `${t}ms`}
|
|
20
|
+
${({ ease: t }) => t === "in" ? "ease-out" : "ease-in"},
|
|
21
|
+
background-color 0.2s;
|
|
22
|
+
`, K = y.div`
|
|
20
23
|
position: sticky;
|
|
21
24
|
top: 0;
|
|
22
25
|
left: 0;
|
|
@@ -30,8 +33,8 @@ const O = n(I.div)`
|
|
|
30
33
|
palette: { common: t }
|
|
31
34
|
}
|
|
32
35
|
}) => t.background};
|
|
33
|
-
transition: background-color 0.
|
|
34
|
-
`,
|
|
36
|
+
transition: background-color 0.2s;
|
|
37
|
+
`, N = y.div`
|
|
35
38
|
width: 24px;
|
|
36
39
|
height: 4px;
|
|
37
40
|
border-radius: ${({ theme: { radius: t } }) => t[100]};
|
|
@@ -40,71 +43,84 @@ const O = n(I.div)`
|
|
|
40
43
|
palette: { border: t }
|
|
41
44
|
}
|
|
42
45
|
}) => t.main};
|
|
43
|
-
transition: background-color 0.
|
|
46
|
+
transition: background-color 0.2s;
|
|
44
47
|
`;
|
|
45
|
-
function
|
|
48
|
+
function _({
|
|
46
49
|
open: t,
|
|
47
|
-
onClose:
|
|
48
|
-
children:
|
|
49
|
-
transitionDuration:
|
|
50
|
-
maxWidth:
|
|
51
|
-
onClick:
|
|
52
|
-
ref:
|
|
53
|
-
hideDragHandleBar:
|
|
54
|
-
hideOverlay:
|
|
55
|
-
style:
|
|
56
|
-
|
|
57
|
-
...y
|
|
50
|
+
onClose: d,
|
|
51
|
+
children: S,
|
|
52
|
+
transitionDuration: a = 200,
|
|
53
|
+
maxWidth: T = "375px",
|
|
54
|
+
onClick: b,
|
|
55
|
+
ref: j,
|
|
56
|
+
hideDragHandleBar: I,
|
|
57
|
+
hideOverlay: O,
|
|
58
|
+
style: A,
|
|
59
|
+
...F
|
|
58
60
|
}) {
|
|
59
|
-
const [
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
e.stopPropagation(), typeof
|
|
63
|
-
}, k = (e, B) => {
|
|
64
|
-
const { offset: w, velocity: E } = B;
|
|
65
|
-
(w.y > h || E.y > 500) && typeof r == "function" && r();
|
|
61
|
+
const [E, $] = z(!1), m = o(null), L = o(null), c = o(null), u = o(!1), f = o(0), l = o(0), h = o(0), v = o(0), p = o(0), W = o(0.25);
|
|
62
|
+
C(j, () => m.current);
|
|
63
|
+
const q = (e) => {
|
|
64
|
+
e.stopPropagation(), typeof b == "function" && b(e);
|
|
66
65
|
};
|
|
67
|
-
return
|
|
66
|
+
return M(() => {
|
|
68
67
|
let e;
|
|
69
68
|
return t ? e = requestAnimationFrame(() => {
|
|
70
|
-
|
|
71
|
-
}) :
|
|
69
|
+
$(!0);
|
|
70
|
+
}) : $(!1), () => {
|
|
72
71
|
e && cancelAnimationFrame(e);
|
|
73
72
|
};
|
|
74
|
-
}, [t]),
|
|
75
|
-
|
|
73
|
+
}, [t]), M(() => {
|
|
74
|
+
const e = m.current, n = L.current, x = (r) => {
|
|
75
|
+
e && (e.scrollTop > 0 || (u.current = !0, f.current = r, l.current = r, h.current = e.offsetHeight, p.current = Date.now(), e.style.transition = "none", e.style.cursor = "grabbing", n && (n.style.transition = "none"), c.current && (c.current.style.cursor = "grabbing")));
|
|
76
|
+
}, k = (r) => {
|
|
77
|
+
if (!e || !u.current) return;
|
|
78
|
+
const i = r - f.current;
|
|
79
|
+
if (i < 0) return;
|
|
80
|
+
l.current = r;
|
|
81
|
+
const B = Date.now(), D = B - p.current;
|
|
82
|
+
if (D > 0) {
|
|
83
|
+
const P = l.current;
|
|
84
|
+
v.current = (r - P) / D, p.current = B;
|
|
85
|
+
}
|
|
86
|
+
n && (n.style.opacity = `${Math.max(0, 1 - i / (h.current * 2))}`), e.style.transform = `translate3d(0, ${i}px, 0)`;
|
|
87
|
+
}, s = () => {
|
|
88
|
+
if (!e || !u.current) return;
|
|
89
|
+
u.current = !1, e.style.cursor = "default", c.current && (c.current.style.cursor = "grab");
|
|
90
|
+
const r = l.current - f.current, i = h.current * W.current;
|
|
91
|
+
e.style.transition = `transform ${a}ms ease-out`, n && (n.style.transition = `opacity ${a}ms ease-out`), r > i || v.current > 0.5 && v.current > 0 ? (e.style.transform = "translate3d(0, 200%, 0)", n && (n.style.opacity = "0"), d?.()) : (e.style.transform = "translate3d(0, 0, 0)", n && (n.style.opacity = "1"));
|
|
92
|
+
}, R = (r) => x(r.clientY), w = (r) => k(r.clientY), H = (r) => x(r.touches[0].clientY), Y = (r) => k(r.touches[0].clientY);
|
|
93
|
+
return e?.addEventListener("mousedown", R), e?.addEventListener("mousemove", w), e?.addEventListener("mouseup", s), e?.addEventListener("mouseleave", s), e?.addEventListener("touchstart", H), e?.addEventListener("touchmove", Y), e?.addEventListener("touchend", s), e?.addEventListener("touchcancel", s), () => {
|
|
94
|
+
e?.removeEventListener("mousedown", R), e?.removeEventListener("mousemove", w), e?.removeEventListener("mouseup", s), e?.removeEventListener("mouseleave", s), e?.removeEventListener("touchstart", H), e?.removeEventListener("touchmove", Y), e?.removeEventListener("touchend", s), e?.removeEventListener("touchcancel", s);
|
|
95
|
+
};
|
|
96
|
+
}, [E, d, a]), /* @__PURE__ */ g(
|
|
97
|
+
G,
|
|
76
98
|
{
|
|
77
|
-
ref:
|
|
99
|
+
ref: L,
|
|
78
100
|
open: t,
|
|
79
|
-
onClose:
|
|
80
|
-
transitionDuration:
|
|
101
|
+
onClose: d,
|
|
102
|
+
transitionDuration: a,
|
|
81
103
|
placement: "center-bottom",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
css: O ? {
|
|
105
|
+
pointerEvents: "none",
|
|
106
|
+
backgroundColor: "transparent !important"
|
|
107
|
+
} : void 0,
|
|
108
|
+
children: /* @__PURE__ */ V(
|
|
109
|
+
J,
|
|
85
110
|
{
|
|
86
|
-
ref:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
animate: {
|
|
96
|
-
y: b ? 0 : "200%"
|
|
97
|
-
},
|
|
98
|
-
transition: {
|
|
99
|
-
type: "spring",
|
|
100
|
-
duration: i,
|
|
101
|
-
bounce: 0.2
|
|
111
|
+
ref: m,
|
|
112
|
+
ease: t ? "in" : "out",
|
|
113
|
+
transitionDuration: a,
|
|
114
|
+
maxWidth: T,
|
|
115
|
+
onClick: q,
|
|
116
|
+
...F,
|
|
117
|
+
style: {
|
|
118
|
+
transform: `translate3d(0, ${E ? "0" : "200%"}, 0)`,
|
|
119
|
+
...A
|
|
102
120
|
},
|
|
103
|
-
style: g,
|
|
104
|
-
...y,
|
|
105
121
|
children: [
|
|
106
|
-
!
|
|
107
|
-
|
|
122
|
+
!I && /* @__PURE__ */ g(K, { ref: c, children: /* @__PURE__ */ g(N, {}) }),
|
|
123
|
+
S
|
|
108
124
|
]
|
|
109
125
|
}
|
|
110
126
|
)
|
|
@@ -112,5 +128,5 @@ function z({
|
|
|
112
128
|
);
|
|
113
129
|
}
|
|
114
130
|
export {
|
|
115
|
-
|
|
131
|
+
_ as default
|
|
116
132
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { UtilityProps } from '../../typings/utility';
|
|
3
|
-
|
|
4
|
-
export interface BottomSheetProps extends PropsWithChildren<HTMLMotionProps<"div"> & Pick<UtilityProps, "css">> {
|
|
3
|
+
export interface BottomSheetProps extends ComponentPropsWithRef<"div">, Pick<UtilityProps, "css"> {
|
|
5
4
|
open?: boolean;
|
|
6
5
|
onClose?: () => void;
|
|
7
6
|
transitionDuration?: number;
|
|
8
7
|
maxWidth?: string;
|
|
9
8
|
hideDragHandleBar?: boolean;
|
|
10
9
|
hideOverlay?: boolean;
|
|
11
|
-
dragThreshold?: number;
|
|
12
10
|
}
|