@shiflo/ui 0.0.18 → 0.1.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 +24 -18
- package/dist/assets/icons/{index.ts-B1HxCidp.js → index.ts-Bfm0GTNS.js} +16 -10
- package/dist/assets/icons/solid/briefcase-blank-solid.svg-6ppQL_Z4.js +5 -0
- package/dist/assets/icons/solid/chart-simple-horizontal-solid.svg-znTJSeQj.js +5 -0
- package/dist/assets/icons/solid/clock-desk-solid.svg-Dvm3Xip1.js +5 -0
- package/dist/assets/icons/solid/index.d.ts +3 -0
- package/dist/assets/icons/solid/index.mjs +22 -16
- package/dist/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/components/BottomSheet/BottomSheet.mjs +61 -76
- package/dist/components/BottomSheet/BottomSheet.typing.d.ts +4 -2
- package/dist/components/Box/Box.mjs +15 -20
- package/dist/components/Box/Box.typing.d.ts +4 -4
- package/dist/components/Button/Button.mjs +176 -86
- package/dist/components/Button/Button.typing.d.ts +7 -2
- package/dist/components/Dialog/Dialog.mjs +34 -32
- package/dist/components/Dialog/Dialog.typing.d.ts +3 -2
- package/dist/components/FPSMonitor/FPSMonitor.d.ts +11 -0
- package/dist/components/FPSMonitor/FPSMonitor.mjs +201 -0
- package/dist/components/FPSMonitor/FPSTMonitor.utils.d.ts +69 -0
- package/dist/components/FPSMonitor/FPSTMonitor.utils.mjs +116 -0
- package/dist/components/FPSMonitor/index.d.ts +3 -0
- package/dist/components/FPSMonitor/index.mjs +4 -0
- package/dist/components/Icon/Icon.mjs +2 -2
- package/dist/components/Icon/Icon.typing.d.ts +4 -4
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.mjs +45 -42
- package/dist/components/Overlay/Overlay.typing.d.ts +2 -3
- package/dist/components/Snackbar/Snackbar.mjs +64 -60
- package/dist/components/Snackbar/Snackbar.typing.d.ts +3 -3
- package/dist/components/Switch/Switch.mjs +52 -39
- package/dist/components/Switch/Switch.typing.d.ts +3 -3
- package/dist/components/Tag/Tag.mjs +12 -13
- package/dist/components/Tag/Tag.typing.d.ts +2 -3
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.mjs +24 -30
- package/dist/components/TextField/TextField.typing.d.ts +3 -3
- package/dist/components/Typography/Typography.mjs +21 -26
- package/dist/components/Typography/Typography.typing.d.ts +4 -4
- package/dist/components/index.d.ts +23 -0
- package/dist/components/index.mjs +24 -0
- package/dist/theme/GlobalStyle.mjs +68 -37
- package/dist/theme/ThemeProvider.mjs +10 -16
- package/dist/theme/dark.d.ts +2 -2
- package/dist/theme/dark.mjs +19 -2
- package/dist/theme/light.d.ts +2 -2
- package/dist/theme/light.mjs +28 -11
- package/dist/theme/typing.d.ts +87 -68
- package/dist/typings/utility.d.ts +3 -2
- package/dist/utils/getUtilityProps.mjs +9 -9
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.mjs +8 -0
- package/package.json +26 -24
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { S as a } 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
|
|
3
|
+
import { S as s } from "./solid/calendar-lines-solid.svg-D2qG_E7t.js";
|
|
4
|
+
import { S as d } from "./solid/calendar-week-solid.svg-CVmrJtif.js";
|
|
5
5
|
import { S as m } 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
|
|
12
|
-
import { S as
|
|
13
|
-
import { S as
|
|
14
|
-
import { S as
|
|
8
|
+
import { S as k } from "./solid/pen-to-square-solid.svg-DUdNcuTM.js";
|
|
9
|
+
import { S as c } from "./solid/plus-solid.svg-piiaS3kO.js";
|
|
10
|
+
import { S as B } from "./solid/rotate-right-solid.svg-CYW200XH.js";
|
|
11
|
+
import { S as G } from "./solid/xmark-solid.svg-Ce8xHlZn.js";
|
|
12
|
+
import { S as P } from "./solid/check-solid.svg-C41sTTzR.js";
|
|
13
|
+
import { S as T } from "./solid/trash-solid.svg-iJSf_6Y3.js";
|
|
14
|
+
import { S as q } from "./solid/minus-solid.svg-BBiGvc-2.js";
|
|
15
|
+
import { S as z } from "./solid/briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
16
|
+
import { S as M } from "./solid/chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
17
|
+
import { S as X } from "./solid/clock-desk-solid.svg-Dvm3Xip1.js";
|
|
15
18
|
export {
|
|
19
|
+
z as BriefcaseBlankSolid,
|
|
16
20
|
S as CalendarDaysSolid,
|
|
17
21
|
a as CalendarLine,
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
s as CalendarLinesSolid,
|
|
23
|
+
d as CalendarWeekSolid,
|
|
20
24
|
m as CalendarsSolid,
|
|
21
|
-
|
|
25
|
+
M as ChartSimpleHorizontalSolid,
|
|
26
|
+
P as CheckSolid,
|
|
27
|
+
X as ClockDeskSolid,
|
|
22
28
|
p as GearSolid,
|
|
23
29
|
n as Grid2Solid,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
q as MinusSolid,
|
|
31
|
+
k as PenToSquareSolid,
|
|
32
|
+
c as PlusSolid,
|
|
33
|
+
B as RotateRightSolid,
|
|
34
|
+
T as TrashSolid,
|
|
35
|
+
G as XmarkSolid
|
|
30
36
|
};
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import { S as o } 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
|
|
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
5
|
import { S as a } from "./solid/calendars-solid.svg-rClh_xBu.js";
|
|
6
6
|
import { S as l } from "./solid/gear-solid.svg-C6vEx0Wx.js";
|
|
7
|
-
import { S as
|
|
8
|
-
import { S as
|
|
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
9
|
import { S as m } from "./solid/plus-solid.svg-piiaS3kO.js";
|
|
10
10
|
import { S as s } from "./solid/rotate-right-solid.svg-CYW200XH.js";
|
|
11
11
|
import { S as t } from "./solid/xmark-solid.svg-Ce8xHlZn.js";
|
|
12
12
|
import { S as n } from "./solid/check-solid.svg-C41sTTzR.js";
|
|
13
13
|
import { S as g } from "./solid/trash-solid.svg-iJSf_6Y3.js";
|
|
14
14
|
import { S as p } from "./solid/minus-solid.svg-BBiGvc-2.js";
|
|
15
|
-
|
|
15
|
+
import { S as f } from "./solid/briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
16
|
+
import { S as v } from "./solid/chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
17
|
+
import { S as C } from "./solid/clock-desk-solid.svg-Dvm3Xip1.js";
|
|
18
|
+
const q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16
19
|
__proto__: null,
|
|
20
|
+
BriefcaseBlankSolid: f,
|
|
17
21
|
CalendarDaysSolid: S,
|
|
18
22
|
CalendarLine: o,
|
|
19
|
-
CalendarLinesSolid:
|
|
20
|
-
CalendarWeekSolid:
|
|
23
|
+
CalendarLinesSolid: i,
|
|
24
|
+
CalendarWeekSolid: r,
|
|
21
25
|
CalendarsSolid: a,
|
|
26
|
+
ChartSimpleHorizontalSolid: v,
|
|
22
27
|
CheckSolid: n,
|
|
28
|
+
ClockDeskSolid: C,
|
|
23
29
|
GearSolid: l,
|
|
24
|
-
Grid2Solid:
|
|
30
|
+
Grid2Solid: e,
|
|
25
31
|
MinusSolid: p,
|
|
26
|
-
PenToSquareSolid:
|
|
32
|
+
PenToSquareSolid: d,
|
|
27
33
|
PlusSolid: m,
|
|
28
34
|
RotateRightSolid: s,
|
|
29
35
|
TrashSolid: g,
|
|
30
36
|
XmarkSolid: t
|
|
31
37
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
32
38
|
export {
|
|
33
|
-
|
|
39
|
+
q as S
|
|
34
40
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M8.25 2.625V4.5H15.75V2.625C15.75 2.41875 15.5813 2.25 15.375 2.25H8.625C8.41875 2.25 8.25 2.41875 8.25 2.625ZM6 4.5V2.625C6 1.17656 7.17656 0 8.625 0H15.375C16.8234 0 18 1.17656 18 2.625V4.5H21C22.6547 4.5 24 5.84531 24 7.5V19.5C24 21.1547 22.6547 22.5 21 22.5H3C1.34531 22.5 0 21.1547 0 19.5V7.5C0 5.84531 1.34531 4.5 3 4.5H6Z", fill: "currentColor" }));
|
|
3
|
+
export {
|
|
4
|
+
l as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const C = (e) => /* @__PURE__ */ t.createElement("svg", { width: 24, height: 28, viewBox: "0 0 24 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("path", { d: "M21.4286 17.375C22.8482 17.375 24 16.2412 24 14.8438V13.1562C24 11.7588 22.8482 10.625 21.4286 10.625H2.57143C1.15179 10.625 0 11.7588 0 13.1562V14.8438C0 16.2412 1.15179 17.375 2.57143 17.375H21.4286ZM11.1429 25.8125C12.5625 25.8125 13.7143 24.6787 13.7143 23.2812V21.5938C13.7143 20.1963 12.5625 19.0625 11.1429 19.0625H2.57143C1.15179 19.0625 0 20.1963 0 21.5938V23.2812C0 24.6787 1.15179 25.8125 2.57143 25.8125H11.1429ZM20.5714 6.40625V4.71875C20.5714 3.32129 19.4196 2.1875 18 2.1875H2.57143C1.15179 2.1875 0 3.32129 0 4.71875V6.40625C0 7.80371 1.15179 8.9375 2.57143 8.9375H18C19.4196 8.9375 20.5714 7.80371 20.5714 6.40625Z", fill: "currentColor" }));
|
|
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", { width: 24, height: 28, viewBox: "0 0 24 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("g", { clipPath: "url(#clip0_308_55)" }, /* @__PURE__ */ e.createElement("path", { d: "M0 12.3125C0 9.17963 1.26428 6.17507 3.51472 3.9598C5.76516 1.74453 8.8174 0.5 12 0.5C15.1826 0.5 18.2348 1.74453 20.4853 3.9598C22.7357 6.17507 24 9.17963 24 12.3125C24 15.4454 22.7357 18.4499 20.4853 20.6652C18.2348 22.8805 15.1826 24.125 12 24.125C8.8174 24.125 5.76516 22.8805 3.51472 20.6652C1.26428 18.4499 0 15.4454 0 12.3125ZM12 5.5625C11.2875 5.5625 10.7143 6.12676 10.7143 6.82812V12.3125C10.7143 12.65 10.8482 12.9717 11.0893 13.209L13.6607 15.7402C14.1643 16.2359 14.9786 16.2359 15.4768 15.7402C15.975 15.2445 15.9804 14.443 15.4768 13.9525L13.2804 11.7904V6.82812C13.2804 6.12676 12.7071 5.5625 11.9946 5.5625H12ZM12 25.8125C17.1643 25.8125 21.6589 23.0018 24 18.8516V24.9688C24 26.3662 22.8482 27.5 21.4286 27.5H2.57143C1.15179 27.5 0 26.3662 0 24.9688V18.8516C2.34107 23.0018 6.83571 25.8125 12 25.8125Z", fill: "currentColor" })), /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("clipPath", { id: "clip0_308_55" }, /* @__PURE__ */ e.createElement("rect", { width: 24, height: 27, fill: "currentColor", transform: "translate(0 0.5)" }))));
|
|
3
|
+
export {
|
|
4
|
+
l as S
|
|
5
|
+
};
|
|
@@ -11,3 +11,6 @@ export { default as XmarkSolid } from './xmark-solid.svg';
|
|
|
11
11
|
export { default as CheckSolid } from './check-solid.svg';
|
|
12
12
|
export { default as TrashSolid } from './trash-solid.svg';
|
|
13
13
|
export { default as MinusSolid } from './minus-solid.svg';
|
|
14
|
+
export { default as BriefcaseBlankSolid } from './briefcase-blank-solid.svg';
|
|
15
|
+
export { default as ChartSimpleHorizontalSolid } from './chart-simple-horizontal-solid.svg';
|
|
16
|
+
export { default as ClockDeskSolid } from './clock-desk-solid.svg';
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
import { S as a } from "./calendar-days-solid.svg-CIj8vf6t.js";
|
|
2
2
|
import { S as e } from "./calendar-lines-solid.svg-D2qG_E7t.js";
|
|
3
|
-
import { S as
|
|
4
|
-
import { S as
|
|
3
|
+
import { S as s } from "./calendar-week-solid.svg-CVmrJtif.js";
|
|
4
|
+
import { S as d } from "./calendars-solid.svg-rClh_xBu.js";
|
|
5
5
|
import { S as m } 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
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import { S as
|
|
13
|
-
import { S as
|
|
8
|
+
import { S as k } from "./plus-solid.svg-piiaS3kO.js";
|
|
9
|
+
import { S as c } from "./rotate-right-solid.svg-CYW200XH.js";
|
|
10
|
+
import { S as B } from "./xmark-solid.svg-Ce8xHlZn.js";
|
|
11
|
+
import { S as G } from "./check-solid.svg-C41sTTzR.js";
|
|
12
|
+
import { S as R } from "./trash-solid.svg-iJSf_6Y3.js";
|
|
13
|
+
import { S as g } from "./minus-solid.svg-BBiGvc-2.js";
|
|
14
|
+
import { S as y } from "./briefcase-blank-solid.svg-6ppQL_Z4.js";
|
|
15
|
+
import { S as H } from "./chart-simple-horizontal-solid.svg-znTJSeQj.js";
|
|
16
|
+
import { S as M } from "./clock-desk-solid.svg-Dvm3Xip1.js";
|
|
14
17
|
export {
|
|
18
|
+
y as BriefcaseBlankSolid,
|
|
15
19
|
a as CalendarDaysSolid,
|
|
16
20
|
e as CalendarLinesSolid,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
s as CalendarWeekSolid,
|
|
22
|
+
d as CalendarsSolid,
|
|
23
|
+
H as ChartSimpleHorizontalSolid,
|
|
24
|
+
G as CheckSolid,
|
|
25
|
+
M as ClockDeskSolid,
|
|
20
26
|
m as GearSolid,
|
|
21
27
|
p as Grid2Solid,
|
|
22
|
-
|
|
28
|
+
g as MinusSolid,
|
|
23
29
|
n as PenToSquareSolid,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
k as PlusSolid,
|
|
31
|
+
c as RotateRightSolid,
|
|
32
|
+
R as TrashSolid,
|
|
33
|
+
B as XmarkSolid
|
|
28
34
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BottomSheetProps } from './BottomSheet.typing';
|
|
2
|
-
declare function BottomSheet({ open, onClose, children, transitionDuration, maxWidth, onClick, ref, hideDragHandleBar, hideOverlay, style, ...props }: BottomSheetProps): import("react").JSX.Element;
|
|
2
|
+
declare function BottomSheet({ open, onClose, children, transitionDuration, maxWidth, onClick, ref, hideDragHandleBar, hideOverlay, style, dragThreshold, ...props }: BottomSheetProps): import("react").JSX.Element;
|
|
3
3
|
export default BottomSheet;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { jsx as o, jsxs as H } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as a, useImperativeHandle as S, useEffect as j } from "react";
|
|
3
|
+
import n from "@emotion/styled";
|
|
4
|
+
import { motion as D } from "motion/react";
|
|
5
|
+
import I from "../Overlay/Overlay.mjs";
|
|
6
|
+
const O = n(D.div)`
|
|
6
7
|
width: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
7
8
|
max-width: ${({ maxWidth: t = "375px" }) => t};
|
|
8
9
|
max-height: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
@@ -15,11 +16,7 @@ const N = b.div`
|
|
|
15
16
|
palette: { common: t }
|
|
16
17
|
}
|
|
17
18
|
}) => t.background};
|
|
18
|
-
|
|
19
|
-
transform ${({ transitionDuration: t }) => `${t}ms`}
|
|
20
|
-
${({ ease: t }) => t === "in" ? "ease-out" : "ease-in"},
|
|
21
|
-
background-color 0.2s;
|
|
22
|
-
`, Q = b.div`
|
|
19
|
+
`, A = n.div`
|
|
23
20
|
position: sticky;
|
|
24
21
|
top: 0;
|
|
25
22
|
left: 0;
|
|
@@ -34,7 +31,7 @@ const N = b.div`
|
|
|
34
31
|
}
|
|
35
32
|
}) => t.background};
|
|
36
33
|
transition: background-color 0.2s;
|
|
37
|
-
`,
|
|
34
|
+
`, F = n.div`
|
|
38
35
|
width: 24px;
|
|
39
36
|
height: 4px;
|
|
40
37
|
border-radius: ${({ theme: { radius: t } }) => t[100]};
|
|
@@ -45,82 +42,70 @@ const N = b.div`
|
|
|
45
42
|
}) => t.main};
|
|
46
43
|
transition: background-color 0.2s;
|
|
47
44
|
`;
|
|
48
|
-
function
|
|
45
|
+
function z({
|
|
49
46
|
open: t,
|
|
50
|
-
onClose:
|
|
51
|
-
children:
|
|
52
|
-
transitionDuration:
|
|
53
|
-
maxWidth:
|
|
54
|
-
onClick:
|
|
55
|
-
ref:
|
|
56
|
-
hideDragHandleBar:
|
|
57
|
-
hideOverlay:
|
|
58
|
-
style:
|
|
59
|
-
|
|
47
|
+
onClose: r,
|
|
48
|
+
children: m,
|
|
49
|
+
transitionDuration: i = 0.2,
|
|
50
|
+
maxWidth: d = "375px",
|
|
51
|
+
onClick: c,
|
|
52
|
+
ref: f,
|
|
53
|
+
hideDragHandleBar: p,
|
|
54
|
+
hideOverlay: u,
|
|
55
|
+
style: g,
|
|
56
|
+
dragThreshold: h = 100,
|
|
57
|
+
...y
|
|
60
58
|
}) {
|
|
61
|
-
const [
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
59
|
+
const [b, s] = R(!1), l = a(null), x = a(null), $ = a(null);
|
|
60
|
+
S(f, () => l.current);
|
|
61
|
+
const v = (e) => {
|
|
62
|
+
e.stopPropagation(), typeof c == "function" && c(e);
|
|
63
|
+
}, k = (e, B) => {
|
|
64
|
+
const { offset: w, velocity: E } = B;
|
|
65
|
+
(w.y > h || E.y > 500) && typeof r == "function" && r();
|
|
65
66
|
};
|
|
66
|
-
return
|
|
67
|
-
let
|
|
68
|
-
return t ?
|
|
69
|
-
|
|
70
|
-
}) :
|
|
71
|
-
|
|
67
|
+
return j(() => {
|
|
68
|
+
let e;
|
|
69
|
+
return t ? e = requestAnimationFrame(() => {
|
|
70
|
+
s(!0);
|
|
71
|
+
}) : s(!1), () => {
|
|
72
|
+
e && cancelAnimationFrame(e);
|
|
72
73
|
};
|
|
73
|
-
}, [t]),
|
|
74
|
-
|
|
75
|
-
r && (r.scrollTop > 0 || (d.current = !0, v.current = e, f.current = e, m.current = r.offsetHeight, g.current = Date.now(), r.style.transition = "none", r.style.cursor = "grabbing", n && (n.style.transition = "none"), i.current && (i.current.style.cursor = "grabbing")));
|
|
76
|
-
}, R = (e) => {
|
|
77
|
-
if (!r || !d.current) return;
|
|
78
|
-
const u = e - v.current;
|
|
79
|
-
if (u < 0) return;
|
|
80
|
-
f.current = e;
|
|
81
|
-
const D = Date.now(), M = D - g.current;
|
|
82
|
-
if (M > 0) {
|
|
83
|
-
const V = f.current;
|
|
84
|
-
p.current = (e - V) / M, g.current = D;
|
|
85
|
-
}
|
|
86
|
-
n && (n.style.opacity = `${Math.max(0, 1 - u / (m.current * 2))}`), r.style.transform = `translate3d(0, ${u}px, 0)`;
|
|
87
|
-
}, a = () => {
|
|
88
|
-
if (!r || !d.current) return;
|
|
89
|
-
d.current = !1, r.style.cursor = "default", i.current && (i.current.style.cursor = "grab");
|
|
90
|
-
const e = f.current - v.current, u = m.current * q.current;
|
|
91
|
-
r.style.transition = `transform ${s}ms ease-out`, n && (n.style.transition = `opacity ${s}ms ease-out`), e > u || p.current > 0.5 && p.current > 0 ? (r.style.transform = "translate3d(0, 200%, 0)", n && (n.style.opacity = "0"), c == null || c()) : (r.style.transform = "translate3d(0, 0, 0)", n && (n.style.opacity = "1"));
|
|
92
|
-
}, w = (e) => k(e.clientY), H = (e) => R(e.clientY), Y = (e) => k(e.touches[0].clientY), B = (e) => R(e.touches[0].clientY);
|
|
93
|
-
return r == null || r.addEventListener("mousedown", w), r == null || r.addEventListener("mousemove", H), r == null || r.addEventListener("mouseup", a), r == null || r.addEventListener("mouseleave", a), r == null || r.addEventListener("touchstart", Y), r == null || r.addEventListener("touchmove", B), r == null || r.addEventListener("touchend", a), r == null || r.addEventListener("touchcancel", a), () => {
|
|
94
|
-
r == null || r.removeEventListener("mousedown", w), r == null || r.removeEventListener("mousemove", H), r == null || r.removeEventListener("mouseup", a), r == null || r.removeEventListener("mouseleave", a), r == null || r.removeEventListener("touchstart", Y), r == null || r.removeEventListener("touchmove", B), r == null || r.removeEventListener("touchend", a), r == null || r.removeEventListener("touchcancel", a);
|
|
95
|
-
};
|
|
96
|
-
}, [h, c, s]), /* @__PURE__ */ y(
|
|
97
|
-
K,
|
|
74
|
+
}, [t]), /* @__PURE__ */ o(
|
|
75
|
+
I,
|
|
98
76
|
{
|
|
99
77
|
ref: x,
|
|
100
78
|
open: t,
|
|
101
|
-
onClose:
|
|
102
|
-
transitionDuration:
|
|
79
|
+
onClose: r,
|
|
80
|
+
transitionDuration: i,
|
|
103
81
|
placement: "center-bottom",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} : void 0,
|
|
108
|
-
children: /* @__PURE__ */ z(
|
|
109
|
-
N,
|
|
82
|
+
hideOverlay: u,
|
|
83
|
+
children: /* @__PURE__ */ H(
|
|
84
|
+
O,
|
|
110
85
|
{
|
|
111
86
|
ref: l,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
87
|
+
drag: "y",
|
|
88
|
+
dragConstraints: { top: 0, bottom: 0 },
|
|
89
|
+
dragElastic: { top: 0, bottom: 0.2 },
|
|
90
|
+
dragMomentum: !1,
|
|
91
|
+
onDragEnd: k,
|
|
92
|
+
maxWidth: d,
|
|
93
|
+
onClick: v,
|
|
94
|
+
initial: { y: "200%" },
|
|
95
|
+
animate: {
|
|
96
|
+
y: b ? 0 : "200%"
|
|
97
|
+
},
|
|
98
|
+
exit: { y: "200%" },
|
|
99
|
+
transition: {
|
|
100
|
+
type: "spring",
|
|
101
|
+
duration: i,
|
|
102
|
+
damping: 10
|
|
120
103
|
},
|
|
104
|
+
style: g,
|
|
105
|
+
...y,
|
|
121
106
|
children: [
|
|
122
|
-
!
|
|
123
|
-
|
|
107
|
+
!p && /* @__PURE__ */ o(A, { ref: $, children: /* @__PURE__ */ o(F, {}) }),
|
|
108
|
+
m
|
|
124
109
|
]
|
|
125
110
|
}
|
|
126
111
|
)
|
|
@@ -128,5 +113,5 @@ function E({
|
|
|
128
113
|
);
|
|
129
114
|
}
|
|
130
115
|
export {
|
|
131
|
-
|
|
116
|
+
z as default
|
|
132
117
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
2
3
|
import { UtilityProps } from '../../typings/utility';
|
|
3
|
-
export interface BottomSheetProps extends
|
|
4
|
+
export interface BottomSheetProps extends PropsWithChildren<HTMLMotionProps<"div"> & Pick<UtilityProps, "css">> {
|
|
4
5
|
open?: boolean;
|
|
5
6
|
onClose?: () => void;
|
|
6
7
|
transitionDuration?: number;
|
|
7
8
|
maxWidth?: string;
|
|
8
9
|
hideDragHandleBar?: boolean;
|
|
9
10
|
hideOverlay?: boolean;
|
|
11
|
+
dragThreshold?: number;
|
|
10
12
|
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import m from "@emotion/styled";
|
|
3
3
|
import a from "../../utils/getUtilityProps.mjs";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
transition:
|
|
7
|
-
background-color 0.2s,
|
|
8
|
-
border-width 0.2s,
|
|
9
|
-
border-radius 0.2s,
|
|
10
|
-
border-color 0.2s,
|
|
11
|
-
color 0.2s;
|
|
4
|
+
import s from "../../utils/getValueByPath.mjs";
|
|
5
|
+
const f = m.div`
|
|
6
|
+
transition: all 0.2s;
|
|
12
7
|
|
|
13
|
-
${({ theme: { palette:
|
|
14
|
-
const
|
|
15
|
-
return Object.assign(
|
|
16
|
-
backgroundColor: t
|
|
17
|
-
}),
|
|
18
|
-
borderColor: t
|
|
19
|
-
}),
|
|
20
|
-
color: t
|
|
21
|
-
}),
|
|
8
|
+
${({ theme: { palette: t }, backgroundColor: r, borderColor: e, color: o, ...n }) => {
|
|
9
|
+
const i = {};
|
|
10
|
+
return Object.assign(i, a(n)), r && Object.assign(i, {
|
|
11
|
+
backgroundColor: s(t, r) || "inherit"
|
|
12
|
+
}), e && Object.assign(i, {
|
|
13
|
+
borderColor: s(t, e) || "inherit"
|
|
14
|
+
}), o && Object.assign(i, {
|
|
15
|
+
color: s(t, o) || "inherit"
|
|
16
|
+
}), i;
|
|
22
17
|
}}
|
|
23
|
-
`,
|
|
18
|
+
`, y = (t) => /* @__PURE__ */ c(f, { ...t, css: t.css });
|
|
24
19
|
export {
|
|
25
|
-
|
|
20
|
+
y as default
|
|
26
21
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { PolymorphicComponentProps } from '../../typings/component';
|
|
3
3
|
import { RecursionPath, UtilityProps } from '../../typings/utility';
|
|
4
|
-
import {
|
|
4
|
+
import { ShifloTheme } from '../../theme/typing';
|
|
5
5
|
export interface BaseBoxProps extends UtilityProps {
|
|
6
|
-
backgroundColor?: RecursionPath<
|
|
7
|
-
color?: RecursionPath<
|
|
8
|
-
borderColor?: RecursionPath<
|
|
6
|
+
backgroundColor?: RecursionPath<ShifloTheme["palette"]>;
|
|
7
|
+
color?: RecursionPath<ShifloTheme["palette"]> | "inherit";
|
|
8
|
+
borderColor?: RecursionPath<ShifloTheme["palette"]>;
|
|
9
9
|
}
|
|
10
10
|
export type BoxProps<T extends ElementType> = BaseBoxProps & PolymorphicComponentProps<T>;
|
|
11
11
|
export type BoxComponent<DT extends ElementType = "div"> = <T extends ElementType = DT>(props: BoxProps<T>) => ReactNode;
|