@shiflo/ui 0.0.19 → 0.1.1
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/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 +16 -21
- package/dist/components/Box/Box.typing.d.ts +4 -4
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.mjs +176 -86
- package/dist/components/Button/Button.typing.d.ts +7 -2
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- 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/FPSMonitor.utils.d.ts +69 -0
- package/dist/components/FPSMonitor/FPSMonitor.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.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/components/Switch/Switch.mjs +53 -40
- package/dist/components/Switch/Switch.typing.d.ts +3 -3
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.mjs +13 -14
- 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 +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.d.ts +1 -1
- package/dist/theme/GlobalStyle.mjs +69 -38
- package/dist/theme/ThemeProvider.d.ts +1 -1
- 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 +27 -24
|
@@ -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("@emotion/react/jsx-runtime").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 "@emotion/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
2
|
import { UtilityProps } from '../../typings/utility';
|
|
3
|
-
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
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
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
1
|
+
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
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
|
+
import { ShifloTheme } from '../../theme/typing';
|
|
2
3
|
import { PolymorphicComponentProps } from '../../typings/component';
|
|
3
4
|
import { RecursionPath, UtilityProps } from '../../typings/utility';
|
|
4
|
-
import { BasicTheme } from 'basic-styled';
|
|
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;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ButtonProps } from './Button.typing';
|
|
2
|
-
declare function Button({ ref, children, variant, size, color, startIcon, endIcon, ...props }: ButtonProps): import("react").JSX.Element;
|
|
2
|
+
declare function Button({ ref, children, variant, size, color, startIcon, endIcon, ...props }: ButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Button;
|
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { jsxs as k } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import f from "@emotion/styled";
|
|
3
|
+
import { motion as v } from "motion/react";
|
|
4
|
+
const m = f(v.button)`
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
align-items: center;
|
|
6
7
|
justify-content: center;
|
|
7
|
-
gap: ${({ theme: { spacing:
|
|
8
|
+
gap: ${({ theme: { spacing: t } }) => t[100]};
|
|
8
9
|
font-weight: 500;
|
|
9
|
-
transition:
|
|
10
|
-
transform 0.2s ease-out,
|
|
11
|
-
background-color 0.2s,
|
|
12
|
-
padding 0.2s,
|
|
13
|
-
font-size 0.2s,
|
|
14
|
-
font-weight 0.2s,
|
|
15
|
-
border-width 0.2s,
|
|
16
|
-
border-radius 0.2s,
|
|
17
|
-
border-color 0.2s,
|
|
18
|
-
color 0.2s;
|
|
19
|
-
border: 1px solid transparent;
|
|
10
|
+
transition: all 0.2s;
|
|
20
11
|
|
|
21
|
-
${({
|
|
22
|
-
|
|
23
|
-
mode:
|
|
24
|
-
palette: { primary: e, secondary:
|
|
25
|
-
typography: { body1: c, body2:
|
|
26
|
-
spacing:
|
|
27
|
-
radius:
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
size: f,
|
|
31
|
-
color: k
|
|
32
|
-
}) => {
|
|
33
|
-
const i = {};
|
|
34
|
-
switch (b) {
|
|
12
|
+
${({ theme: t, variant: l, size: s, color: d }) => {
|
|
13
|
+
const {
|
|
14
|
+
mode: a,
|
|
15
|
+
palette: { primary: e, secondary: r, neutral: o, gradient: p },
|
|
16
|
+
typography: { body1: c, body2: g, small1: h, small2: u },
|
|
17
|
+
spacing: n,
|
|
18
|
+
radius: b
|
|
19
|
+
} = t, i = {};
|
|
20
|
+
switch (l) {
|
|
35
21
|
case "ghost":
|
|
36
22
|
Object.assign(i, {
|
|
37
23
|
backgroundColor: e.alpha[10],
|
|
@@ -45,11 +31,10 @@ const h = v.button`
|
|
|
45
31
|
}
|
|
46
32
|
},
|
|
47
33
|
"&:active": {
|
|
48
|
-
transform: "scale(0.9)",
|
|
49
34
|
backgroundColor: e.alpha[30]
|
|
50
35
|
},
|
|
51
36
|
"&:disabled": {
|
|
52
|
-
backgroundColor:
|
|
37
|
+
backgroundColor: a === "dark" ? e.alpha[10] : e.alpha[5],
|
|
53
38
|
color: o[500],
|
|
54
39
|
cursor: "not-allowed"
|
|
55
40
|
}
|
|
@@ -58,10 +43,10 @@ const h = v.button`
|
|
|
58
43
|
case "text":
|
|
59
44
|
Object.assign(i, {
|
|
60
45
|
backgroundColor: "transparent",
|
|
61
|
-
color:
|
|
46
|
+
color: a === "dark" ? o[800] : o[700],
|
|
62
47
|
// 기본 텍스트 색상 (더 강조된 중립색)
|
|
63
48
|
"& svg": {
|
|
64
|
-
color:
|
|
49
|
+
color: a === "dark" ? o[800] : o[700]
|
|
65
50
|
},
|
|
66
51
|
"@media (hover: hover)": {
|
|
67
52
|
"&:hover": {
|
|
@@ -69,7 +54,6 @@ const h = v.button`
|
|
|
69
54
|
}
|
|
70
55
|
},
|
|
71
56
|
"&:active": {
|
|
72
|
-
transform: "scale(0.9)",
|
|
73
57
|
backgroundColor: o[300]
|
|
74
58
|
},
|
|
75
59
|
"&:disabled": {
|
|
@@ -80,22 +64,45 @@ const h = v.button`
|
|
|
80
64
|
}
|
|
81
65
|
});
|
|
82
66
|
break;
|
|
67
|
+
case "gradient":
|
|
68
|
+
Object.assign(i, {
|
|
69
|
+
background: p.primaryToAccent,
|
|
70
|
+
color: a === "dark" ? o[900] : r.main,
|
|
71
|
+
"& svg": {
|
|
72
|
+
color: a === "dark" ? o[900] : r.main
|
|
73
|
+
},
|
|
74
|
+
"@media (hover: hover)": {
|
|
75
|
+
"&:hover": {
|
|
76
|
+
background: p.primaryToAccent
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"&:active": {
|
|
80
|
+
background: p.primaryToAccent,
|
|
81
|
+
boxShadow: `inset 0 0 0 100px ${e.dark}`
|
|
82
|
+
},
|
|
83
|
+
"&:disabled": {
|
|
84
|
+
background: o[200],
|
|
85
|
+
color: o[500],
|
|
86
|
+
cursor: "not-allowed",
|
|
87
|
+
boxShadow: "none"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
break;
|
|
83
91
|
default:
|
|
84
|
-
if (
|
|
92
|
+
if (d === "secondary") {
|
|
85
93
|
Object.assign(i, {
|
|
86
|
-
backgroundColor:
|
|
87
|
-
color:
|
|
94
|
+
backgroundColor: r.main,
|
|
95
|
+
color: a === "dark" ? o[900] : o[700],
|
|
88
96
|
"& svg": {
|
|
89
|
-
color:
|
|
97
|
+
color: a === "dark" ? o[900] : o[700]
|
|
90
98
|
},
|
|
91
99
|
"@media (hover: hover)": {
|
|
92
100
|
"&:hover": {
|
|
93
|
-
backgroundColor:
|
|
101
|
+
backgroundColor: r.light
|
|
94
102
|
}
|
|
95
103
|
},
|
|
96
104
|
"&:active": {
|
|
97
|
-
|
|
98
|
-
backgroundColor: t.dark
|
|
105
|
+
backgroundColor: r.dark
|
|
99
106
|
},
|
|
100
107
|
"&:disabled": {
|
|
101
108
|
backgroundColor: o[200],
|
|
@@ -107,9 +114,9 @@ const h = v.button`
|
|
|
107
114
|
}
|
|
108
115
|
Object.assign(i, {
|
|
109
116
|
backgroundColor: e.main,
|
|
110
|
-
color:
|
|
117
|
+
color: a === "dark" ? o[900] : r.main,
|
|
111
118
|
"& svg": {
|
|
112
|
-
color:
|
|
119
|
+
color: a === "dark" ? o[900] : r.main
|
|
113
120
|
},
|
|
114
121
|
"@media (hover: hover)": {
|
|
115
122
|
"&:hover": {
|
|
@@ -117,7 +124,6 @@ const h = v.button`
|
|
|
117
124
|
}
|
|
118
125
|
},
|
|
119
126
|
"&:active": {
|
|
120
|
-
transform: "scale(0.9)",
|
|
121
127
|
backgroundColor: e.active
|
|
122
128
|
},
|
|
123
129
|
"&:disabled": {
|
|
@@ -128,11 +134,11 @@ const h = v.button`
|
|
|
128
134
|
});
|
|
129
135
|
break;
|
|
130
136
|
}
|
|
131
|
-
switch (
|
|
137
|
+
switch (s) {
|
|
132
138
|
case "large":
|
|
133
139
|
Object.assign(i, {
|
|
134
|
-
padding: `${
|
|
135
|
-
borderRadius:
|
|
140
|
+
padding: `${n[300]} ${n[350]}`,
|
|
141
|
+
borderRadius: b[300],
|
|
136
142
|
fontSize: c.fontSize,
|
|
137
143
|
lineHeight: c.lineHeight,
|
|
138
144
|
"& svg": {
|
|
@@ -143,37 +149,37 @@ const h = v.button`
|
|
|
143
149
|
break;
|
|
144
150
|
case "small":
|
|
145
151
|
Object.assign(i, {
|
|
146
|
-
padding: `${
|
|
147
|
-
borderRadius:
|
|
148
|
-
fontSize:
|
|
149
|
-
lineHeight:
|
|
152
|
+
padding: `${n[100]} ${n[150]}`,
|
|
153
|
+
borderRadius: b[200],
|
|
154
|
+
fontSize: h.fontSize,
|
|
155
|
+
lineHeight: h.lineHeight,
|
|
150
156
|
"& svg": {
|
|
151
|
-
width:
|
|
152
|
-
height:
|
|
157
|
+
width: h.fontSize,
|
|
158
|
+
height: h.fontSize
|
|
153
159
|
}
|
|
154
160
|
});
|
|
155
161
|
break;
|
|
156
162
|
case "xSmall":
|
|
157
163
|
Object.assign(i, {
|
|
158
|
-
padding: `${
|
|
159
|
-
borderRadius:
|
|
160
|
-
fontSize:
|
|
161
|
-
lineHeight:
|
|
164
|
+
padding: `${n[50]} ${n[100]}`,
|
|
165
|
+
borderRadius: b[150],
|
|
166
|
+
fontSize: u.fontSize,
|
|
167
|
+
lineHeight: u.lineHeight,
|
|
162
168
|
"& svg": {
|
|
163
|
-
width:
|
|
164
|
-
height:
|
|
169
|
+
width: u.fontSize,
|
|
170
|
+
height: u.fontSize
|
|
165
171
|
}
|
|
166
172
|
});
|
|
167
173
|
break;
|
|
168
174
|
default:
|
|
169
175
|
Object.assign(i, {
|
|
170
|
-
padding: `${
|
|
171
|
-
borderRadius:
|
|
172
|
-
fontSize:
|
|
173
|
-
lineHeight:
|
|
176
|
+
padding: `${n[200]} ${n[250]}`,
|
|
177
|
+
borderRadius: b[250],
|
|
178
|
+
fontSize: g.fontSize,
|
|
179
|
+
lineHeight: g.lineHeight,
|
|
174
180
|
"& svg": {
|
|
175
|
-
width:
|
|
176
|
-
height:
|
|
181
|
+
width: g.fontSize,
|
|
182
|
+
height: g.fontSize
|
|
177
183
|
}
|
|
178
184
|
});
|
|
179
185
|
break;
|
|
@@ -182,28 +188,112 @@ const h = v.button`
|
|
|
182
188
|
}}
|
|
183
189
|
`;
|
|
184
190
|
function C({
|
|
185
|
-
ref:
|
|
186
|
-
children:
|
|
187
|
-
variant:
|
|
188
|
-
size:
|
|
189
|
-
color:
|
|
190
|
-
startIcon:
|
|
191
|
-
endIcon:
|
|
192
|
-
...
|
|
191
|
+
ref: t,
|
|
192
|
+
children: l,
|
|
193
|
+
variant: s = "filled",
|
|
194
|
+
size: d = "medium",
|
|
195
|
+
color: a = "primary",
|
|
196
|
+
startIcon: e,
|
|
197
|
+
endIcon: r,
|
|
198
|
+
...o
|
|
193
199
|
}) {
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
return s === "text" ? /* @__PURE__ */ k(
|
|
201
|
+
m,
|
|
202
|
+
{
|
|
203
|
+
ref: t,
|
|
204
|
+
variant: "text",
|
|
205
|
+
size: d,
|
|
206
|
+
color: "secondary",
|
|
207
|
+
layout: !0,
|
|
208
|
+
whileHover: {
|
|
209
|
+
scale: 1.02
|
|
210
|
+
},
|
|
211
|
+
whileTap: { scale: 0.98 },
|
|
212
|
+
transition: {
|
|
213
|
+
type: "spring",
|
|
214
|
+
stiffness: 400,
|
|
215
|
+
damping: 25
|
|
216
|
+
},
|
|
217
|
+
...o,
|
|
218
|
+
children: [
|
|
219
|
+
e,
|
|
220
|
+
l,
|
|
221
|
+
r
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
) : s === "ghost" ? /* @__PURE__ */ k(
|
|
225
|
+
m,
|
|
226
|
+
{
|
|
227
|
+
ref: t,
|
|
228
|
+
variant: "ghost",
|
|
229
|
+
size: d,
|
|
230
|
+
color: "primary",
|
|
231
|
+
layout: !0,
|
|
232
|
+
whileHover: {
|
|
233
|
+
scale: 1.02
|
|
234
|
+
},
|
|
235
|
+
whileTap: { scale: 0.98 },
|
|
236
|
+
transition: {
|
|
237
|
+
type: "spring",
|
|
238
|
+
stiffness: 400,
|
|
239
|
+
damping: 25
|
|
240
|
+
},
|
|
241
|
+
...o,
|
|
242
|
+
children: [
|
|
243
|
+
e,
|
|
244
|
+
l,
|
|
245
|
+
r
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
) : s === "gradient" ? /* @__PURE__ */ k(
|
|
249
|
+
m,
|
|
250
|
+
{
|
|
251
|
+
ref: t,
|
|
252
|
+
variant: "gradient",
|
|
253
|
+
size: d,
|
|
254
|
+
color: "primary",
|
|
255
|
+
layout: !0,
|
|
256
|
+
whileHover: {
|
|
257
|
+
scale: 1.02
|
|
258
|
+
},
|
|
259
|
+
whileTap: { scale: 0.98 },
|
|
260
|
+
transition: {
|
|
261
|
+
type: "spring",
|
|
262
|
+
stiffness: 400,
|
|
263
|
+
damping: 25
|
|
264
|
+
},
|
|
265
|
+
...o,
|
|
266
|
+
children: [
|
|
267
|
+
e,
|
|
268
|
+
l,
|
|
269
|
+
r
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
) : /* @__PURE__ */ k(
|
|
273
|
+
m,
|
|
274
|
+
{
|
|
275
|
+
ref: t,
|
|
276
|
+
variant: s,
|
|
277
|
+
size: d,
|
|
278
|
+
color: a,
|
|
279
|
+
layout: !0,
|
|
280
|
+
whileHover: {
|
|
281
|
+
scale: 1.02
|
|
282
|
+
},
|
|
283
|
+
whileTap: { scale: 0.98 },
|
|
284
|
+
transition: {
|
|
285
|
+
type: "spring",
|
|
286
|
+
stiffness: 400,
|
|
287
|
+
damping: 25
|
|
288
|
+
},
|
|
289
|
+
...o,
|
|
290
|
+
children: [
|
|
291
|
+
e,
|
|
292
|
+
l,
|
|
293
|
+
r
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
207
297
|
}
|
|
208
298
|
export {
|
|
209
299
|
C as default
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { UtilityProps } from '../../typings/utility';
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
4
|
export interface BaseButtonProps extends Pick<UtilityProps, "css"> {
|
|
4
5
|
size?: "xSmall" | "small" | "medium" | "large";
|
|
5
6
|
startIcon?: ReactNode;
|
|
@@ -17,4 +18,8 @@ export interface TextButtonProps extends BaseButtonProps {
|
|
|
17
18
|
variant?: "text";
|
|
18
19
|
color?: "secondary";
|
|
19
20
|
}
|
|
20
|
-
export
|
|
21
|
+
export interface GradientButtonProps extends BaseButtonProps {
|
|
22
|
+
variant?: "gradient";
|
|
23
|
+
color?: "primary";
|
|
24
|
+
}
|
|
25
|
+
export type ButtonProps = (FilledButtonProps | GhostButtonProps | TextButtonProps | GradientButtonProps) & PropsWithChildren<HTMLMotionProps<"button">>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DialogProps } from './Dialog.typing';
|
|
2
|
-
declare function Dialog({ open, onClose, children, transitionDuration, onClick, style, maxWidth, ...props }: DialogProps): import("react").JSX.Element;
|
|
2
|
+
declare function Dialog({ open, onClose, children, transitionDuration, onClick, style, maxWidth, ...props }: DialogProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Dialog;
|