@shiflo/ui 0.0.19 → 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.
Files changed (45) hide show
  1. package/dist/components/BottomSheet/BottomSheet.d.ts +1 -1
  2. package/dist/components/BottomSheet/BottomSheet.mjs +61 -76
  3. package/dist/components/BottomSheet/BottomSheet.typing.d.ts +4 -2
  4. package/dist/components/Box/Box.mjs +15 -20
  5. package/dist/components/Box/Box.typing.d.ts +4 -4
  6. package/dist/components/Button/Button.mjs +176 -86
  7. package/dist/components/Button/Button.typing.d.ts +7 -2
  8. package/dist/components/Dialog/Dialog.mjs +34 -32
  9. package/dist/components/Dialog/Dialog.typing.d.ts +3 -2
  10. package/dist/components/FPSMonitor/FPSMonitor.d.ts +11 -0
  11. package/dist/components/FPSMonitor/FPSMonitor.mjs +201 -0
  12. package/dist/components/FPSMonitor/FPSTMonitor.utils.d.ts +69 -0
  13. package/dist/components/FPSMonitor/FPSTMonitor.utils.mjs +116 -0
  14. package/dist/components/FPSMonitor/index.d.ts +3 -0
  15. package/dist/components/FPSMonitor/index.mjs +4 -0
  16. package/dist/components/Icon/Icon.mjs +1 -1
  17. package/dist/components/Icon/Icon.typing.d.ts +4 -4
  18. package/dist/components/Overlay/Overlay.d.ts +1 -1
  19. package/dist/components/Overlay/Overlay.mjs +45 -42
  20. package/dist/components/Overlay/Overlay.typing.d.ts +2 -3
  21. package/dist/components/Snackbar/Snackbar.mjs +64 -60
  22. package/dist/components/Snackbar/Snackbar.typing.d.ts +3 -3
  23. package/dist/components/Switch/Switch.mjs +52 -39
  24. package/dist/components/Switch/Switch.typing.d.ts +3 -3
  25. package/dist/components/Tag/Tag.mjs +12 -13
  26. package/dist/components/Tag/Tag.typing.d.ts +2 -3
  27. package/dist/components/TextField/TextField.d.ts +1 -1
  28. package/dist/components/TextField/TextField.mjs +24 -30
  29. package/dist/components/TextField/TextField.typing.d.ts +3 -3
  30. package/dist/components/Typography/Typography.mjs +21 -26
  31. package/dist/components/Typography/Typography.typing.d.ts +4 -4
  32. package/dist/components/index.d.ts +23 -0
  33. package/dist/components/index.mjs +24 -0
  34. package/dist/theme/GlobalStyle.mjs +68 -37
  35. package/dist/theme/ThemeProvider.mjs +10 -16
  36. package/dist/theme/dark.d.ts +2 -2
  37. package/dist/theme/dark.mjs +19 -2
  38. package/dist/theme/light.d.ts +2 -2
  39. package/dist/theme/light.mjs +28 -11
  40. package/dist/theme/typing.d.ts +87 -68
  41. package/dist/typings/utility.d.ts +3 -2
  42. package/dist/utils/getUtilityProps.mjs +9 -9
  43. package/dist/utils/index.d.ts +3 -0
  44. package/dist/utils/index.mjs +8 -0
  45. package/package.json +26 -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("react").JSX.Element;
3
3
  export default BottomSheet;
@@ -1,8 +1,9 @@
1
- import { jsx as y, jsxs as z } from "react/jsx-runtime";
2
- import { useState as G, useRef as o, useImperativeHandle as J, useEffect as S } from "react";
3
- import b from "basic-styled";
4
- import K from "../Overlay/Overlay.mjs";
5
- const N = b.div`
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
- transition:
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
- `, U = b.div`
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 E({
45
+ function z({
49
46
  open: t,
50
- onClose: c,
51
- children: T,
52
- transitionDuration: s = 200,
53
- maxWidth: j = "375px",
54
- onClick: $,
55
- ref: I,
56
- hideDragHandleBar: O,
57
- hideOverlay: A,
58
- style: F,
59
- ...W
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 [h, L] = G(!1), l = o(null), x = o(null), i = o(null), d = o(!1), v = o(0), f = o(0), m = o(0), p = o(0), g = o(0), q = o(0.25);
62
- J(I, () => l.current);
63
- const P = (r) => {
64
- r.stopPropagation(), typeof $ == "function" && $(r);
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 S(() => {
67
- let r;
68
- return t ? r = requestAnimationFrame(() => {
69
- L(!0);
70
- }) : L(!1), () => {
71
- r && cancelAnimationFrame(r);
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]), S(() => {
74
- const r = l.current, n = x.current, k = (e) => {
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: c,
102
- transitionDuration: s,
79
+ onClose: r,
80
+ transitionDuration: i,
103
81
  placement: "center-bottom",
104
- css: A ? {
105
- pointerEvents: "none",
106
- backgroundColor: "transparent !important"
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
- ease: t ? "in" : "out",
113
- transitionDuration: s,
114
- maxWidth: j,
115
- onClick: P,
116
- ...W,
117
- style: {
118
- transform: `translate3d(0, ${h ? "0" : "200%"}, 0)`,
119
- ...F
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
- !O && /* @__PURE__ */ y(Q, { ref: i, children: /* @__PURE__ */ y(U, {}) }),
123
- T
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
- E as default
116
+ z as default
132
117
  };
@@ -1,10 +1,12 @@
1
- import { ComponentPropsWithRef } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
+ import { HTMLMotionProps } from 'motion/react';
2
3
  import { UtilityProps } from '../../typings/utility';
3
- export interface BottomSheetProps extends ComponentPropsWithRef<"div">, Pick<UtilityProps, "css"> {
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 d from "basic-styled";
2
+ import m from "@emotion/styled";
3
3
  import a from "../../utils/getUtilityProps.mjs";
4
- import t from "../../utils/getValueByPath.mjs";
5
- const m = d.div`
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: r }, backgroundColor: i, borderColor: s, color: e, ...n }) => {
14
- const o = {};
15
- return Object.assign(o, a(n)), i && Object.assign(o, {
16
- backgroundColor: t(r, i) || "inherit"
17
- }), s && Object.assign(o, {
18
- borderColor: t(r, s) || "inherit"
19
- }), e && Object.assign(o, {
20
- color: t(r, e) || "inherit"
21
- }), o;
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
- `, h = (r) => /* @__PURE__ */ c(m, { ...r });
18
+ `, y = (t) => /* @__PURE__ */ c(f, { ...t, css: t.css });
24
19
  export {
25
- h as default
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 { BasicTheme } from 'basic-styled';
4
+ import { ShifloTheme } from '../../theme/typing';
5
5
  export interface BaseBoxProps extends UtilityProps {
6
- backgroundColor?: RecursionPath<BasicTheme["palette"]>;
7
- color?: RecursionPath<BasicTheme["palette"]> | "inherit";
8
- borderColor?: RecursionPath<BasicTheme["palette"]>;
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,37 +1,23 @@
1
- import { jsxs as g } from "react/jsx-runtime";
2
- import v from "basic-styled";
3
- const h = v.button`
1
+ import { jsxs as k } from "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: r } }) => r[100]};
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
- theme: {
23
- mode: r,
24
- palette: { primary: e, secondary: t, neutral: o },
25
- typography: { body1: c, body2: a, small1: n, small2: d },
26
- spacing: s,
27
- radius: l
28
- },
29
- variant: b,
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: r === "dark" ? e.alpha[10] : e.alpha[5],
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: r === "dark" ? o[800] : o[700],
46
+ color: a === "dark" ? o[800] : o[700],
62
47
  // 기본 텍스트 색상 (더 강조된 중립색)
63
48
  "& svg": {
64
- color: r === "dark" ? o[800] : o[700]
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 (k === "secondary") {
92
+ if (d === "secondary") {
85
93
  Object.assign(i, {
86
- backgroundColor: t.main,
87
- color: r === "dark" ? o[900] : o[700],
94
+ backgroundColor: r.main,
95
+ color: a === "dark" ? o[900] : o[700],
88
96
  "& svg": {
89
- color: r === "dark" ? o[900] : o[700]
97
+ color: a === "dark" ? o[900] : o[700]
90
98
  },
91
99
  "@media (hover: hover)": {
92
100
  "&:hover": {
93
- backgroundColor: t.light
101
+ backgroundColor: r.light
94
102
  }
95
103
  },
96
104
  "&:active": {
97
- transform: "scale(0.9)",
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: r === "dark" ? o[900] : t.main,
117
+ color: a === "dark" ? o[900] : r.main,
111
118
  "& svg": {
112
- color: r === "dark" ? o[900] : t.main
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 (f) {
137
+ switch (s) {
132
138
  case "large":
133
139
  Object.assign(i, {
134
- padding: `${s[300]} ${s[350]}`,
135
- borderRadius: l[300],
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: `${s[100]} ${s[150]}`,
147
- borderRadius: l[200],
148
- fontSize: n.fontSize,
149
- lineHeight: n.lineHeight,
152
+ padding: `${n[100]} ${n[150]}`,
153
+ borderRadius: b[200],
154
+ fontSize: h.fontSize,
155
+ lineHeight: h.lineHeight,
150
156
  "& svg": {
151
- width: n.fontSize,
152
- height: n.fontSize
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: `${s[50]} ${s[100]}`,
159
- borderRadius: l[150],
160
- fontSize: d.fontSize,
161
- lineHeight: d.lineHeight,
164
+ padding: `${n[50]} ${n[100]}`,
165
+ borderRadius: b[150],
166
+ fontSize: u.fontSize,
167
+ lineHeight: u.lineHeight,
162
168
  "& svg": {
163
- width: d.fontSize,
164
- height: d.fontSize
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: `${s[200]} ${s[250]}`,
171
- borderRadius: l[250],
172
- fontSize: a.fontSize,
173
- lineHeight: a.lineHeight,
176
+ padding: `${n[200]} ${n[250]}`,
177
+ borderRadius: b[250],
178
+ fontSize: g.fontSize,
179
+ lineHeight: g.lineHeight,
174
180
  "& svg": {
175
- width: a.fontSize,
176
- height: a.fontSize
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: r,
186
- children: e,
187
- variant: t = "filled",
188
- size: o = "medium",
189
- color: c = "primary",
190
- startIcon: a,
191
- endIcon: n,
192
- ...d
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 t === "text" ? /* @__PURE__ */ g(h, { ref: r, variant: "text", size: o, color: "secondary", ...d, children: [
195
- a,
196
- e,
197
- n
198
- ] }) : t === "ghost" ? /* @__PURE__ */ g(h, { ref: r, variant: "ghost", size: o, color: "primary", ...d, children: [
199
- a,
200
- e,
201
- n
202
- ] }) : /* @__PURE__ */ g(h, { ref: r, variant: t, size: o, color: c, ...d, children: [
203
- a,
204
- e,
205
- n
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 { ComponentPropsWithRef, ReactNode } from 'react';
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 type ButtonProps = (FilledButtonProps | GhostButtonProps | TextButtonProps) & ComponentPropsWithRef<"button">;
21
+ export interface GradientButtonProps extends BaseButtonProps {
22
+ variant?: "gradient";
23
+ color?: "primary";
24
+ }
25
+ export type ButtonProps = (FilledButtonProps | GhostButtonProps | TextButtonProps | GradientButtonProps) & PropsWithChildren<HTMLMotionProps<"button">>;