@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.
Files changed (52) hide show
  1. package/dist/assets/icons/index.mjs +24 -18
  2. package/dist/assets/icons/{index.ts-B1HxCidp.js → index.ts-Bfm0GTNS.js} +16 -10
  3. package/dist/assets/icons/solid/briefcase-blank-solid.svg-6ppQL_Z4.js +5 -0
  4. package/dist/assets/icons/solid/chart-simple-horizontal-solid.svg-znTJSeQj.js +5 -0
  5. package/dist/assets/icons/solid/clock-desk-solid.svg-Dvm3Xip1.js +5 -0
  6. package/dist/assets/icons/solid/index.d.ts +3 -0
  7. package/dist/assets/icons/solid/index.mjs +22 -16
  8. package/dist/components/BottomSheet/BottomSheet.d.ts +1 -1
  9. package/dist/components/BottomSheet/BottomSheet.mjs +61 -76
  10. package/dist/components/BottomSheet/BottomSheet.typing.d.ts +4 -2
  11. package/dist/components/Box/Box.mjs +15 -20
  12. package/dist/components/Box/Box.typing.d.ts +4 -4
  13. package/dist/components/Button/Button.mjs +176 -86
  14. package/dist/components/Button/Button.typing.d.ts +7 -2
  15. package/dist/components/Dialog/Dialog.mjs +34 -32
  16. package/dist/components/Dialog/Dialog.typing.d.ts +3 -2
  17. package/dist/components/FPSMonitor/FPSMonitor.d.ts +11 -0
  18. package/dist/components/FPSMonitor/FPSMonitor.mjs +201 -0
  19. package/dist/components/FPSMonitor/FPSTMonitor.utils.d.ts +69 -0
  20. package/dist/components/FPSMonitor/FPSTMonitor.utils.mjs +116 -0
  21. package/dist/components/FPSMonitor/index.d.ts +3 -0
  22. package/dist/components/FPSMonitor/index.mjs +4 -0
  23. package/dist/components/Icon/Icon.mjs +2 -2
  24. package/dist/components/Icon/Icon.typing.d.ts +4 -4
  25. package/dist/components/Overlay/Overlay.d.ts +1 -1
  26. package/dist/components/Overlay/Overlay.mjs +45 -42
  27. package/dist/components/Overlay/Overlay.typing.d.ts +2 -3
  28. package/dist/components/Snackbar/Snackbar.mjs +64 -60
  29. package/dist/components/Snackbar/Snackbar.typing.d.ts +3 -3
  30. package/dist/components/Switch/Switch.mjs +52 -39
  31. package/dist/components/Switch/Switch.typing.d.ts +3 -3
  32. package/dist/components/Tag/Tag.mjs +12 -13
  33. package/dist/components/Tag/Tag.typing.d.ts +2 -3
  34. package/dist/components/TextField/TextField.d.ts +1 -1
  35. package/dist/components/TextField/TextField.mjs +24 -30
  36. package/dist/components/TextField/TextField.typing.d.ts +3 -3
  37. package/dist/components/Typography/Typography.mjs +21 -26
  38. package/dist/components/Typography/Typography.typing.d.ts +4 -4
  39. package/dist/components/index.d.ts +23 -0
  40. package/dist/components/index.mjs +24 -0
  41. package/dist/theme/GlobalStyle.mjs +68 -37
  42. package/dist/theme/ThemeProvider.mjs +10 -16
  43. package/dist/theme/dark.d.ts +2 -2
  44. package/dist/theme/dark.mjs +19 -2
  45. package/dist/theme/light.d.ts +2 -2
  46. package/dist/theme/light.mjs +28 -11
  47. package/dist/theme/typing.d.ts +87 -68
  48. package/dist/typings/utility.d.ts +3 -2
  49. package/dist/utils/getUtilityProps.mjs +9 -9
  50. package/dist/utils/index.d.ts +3 -0
  51. package/dist/utils/index.mjs +8 -0
  52. package/package.json +26 -24
@@ -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">>;
@@ -1,8 +1,9 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useState as $, useRef as p, useEffect as h } from "react";
3
- import g from "basic-styled";
4
- import y from "../Overlay/Overlay.mjs";
5
- const x = g.div`
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as d, useRef as u, useEffect as h } from "react";
3
+ import g from "@emotion/styled";
4
+ import { motion as y } from "motion/react";
5
+ import $ from "../Overlay/Overlay.mjs";
6
+ const x = g(y.div)`
6
7
  width: calc(100% - ${({ theme: { spacing: e } }) => e[800]});
7
8
  max-width: ${({ maxWidth: e = "375px" }) => e};
8
9
  max-height: calc(100% - ${({ theme: { spacing: e } }) => e[800]});
@@ -15,24 +16,18 @@ const x = g.div`
15
16
  palette: { common: e }
16
17
  }
17
18
  }) => e.background};
18
- transition:
19
- transform ${({ transitionDuration: e }) => `${e}ms`}
20
- ${({ ease: e }) => e === "in" ? "ease-out" : "ease-in"},
21
- opacity ${({ transitionDuration: e }) => `${e}ms`}
22
- ${({ ease: e }) => e === "in" ? "ease-out" : "ease-in"},
23
- background-color 0.2s;
24
19
  `;
25
- function O({
20
+ function F({
26
21
  open: e,
27
- onClose: n,
28
- children: m,
29
- transitionDuration: a = 200,
22
+ onClose: l,
23
+ children: n,
24
+ transitionDuration: a = 0.2,
30
25
  onClick: o,
31
- style: l,
26
+ style: b,
32
27
  maxWidth: c = "375px",
33
- ...f
28
+ ...s
34
29
  }) {
35
- const [r, i] = $(!1), u = p(null), d = (t) => {
30
+ const [r, i] = d(!1), f = u(null), p = (t) => {
36
31
  t.stopPropagation(), typeof o == "function" && o(t);
37
32
  };
38
33
  return h(() => {
@@ -42,33 +37,40 @@ function O({
42
37
  }) : i(!1), () => {
43
38
  t && cancelAnimationFrame(t);
44
39
  };
45
- }, [e]), /* @__PURE__ */ s(
46
- y,
40
+ }, [e]), /* @__PURE__ */ m(
41
+ $,
47
42
  {
48
- ref: u,
43
+ ref: f,
49
44
  open: e,
50
- onClose: n,
45
+ onClose: l,
51
46
  transitionDuration: a,
52
47
  placement: "center-middle",
53
- children: /* @__PURE__ */ s(
48
+ children: /* @__PURE__ */ m(
54
49
  x,
55
50
  {
56
- ease: e ? "in" : "out",
57
51
  transitionDuration: a,
58
52
  maxWidth: c,
59
- onClick: d,
60
- ...f,
61
- style: {
62
- transform: `scale(${r ? 1 : 0.9})`,
63
- opacity: r ? 1 : 0,
64
- ...l
53
+ onClick: p,
54
+ initial: {
55
+ scale: 0.9,
56
+ opacity: 0
65
57
  },
66
- children: m
58
+ animate: {
59
+ scale: r ? 1 : 0.9,
60
+ opacity: r ? 1 : 0
61
+ },
62
+ transition: {
63
+ type: "spring",
64
+ duration: a,
65
+ damping: 10
66
+ },
67
+ ...s,
68
+ children: n
67
69
  }
68
70
  )
69
71
  }
70
72
  );
71
73
  }
72
74
  export {
73
- O as default
75
+ F as default
74
76
  };
@@ -1,6 +1,7 @@
1
- import { ComponentPropsWithRef } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { UtilityProps } from '../../typings/utility';
3
- export interface DialogProps extends ComponentPropsWithRef<"div">, Pick<UtilityProps, "css"> {
3
+ import { HTMLMotionProps } from 'motion/react';
4
+ export interface DialogProps extends PropsWithChildren<HTMLMotionProps<"div"> & Pick<UtilityProps, "css">> {
4
5
  open?: boolean;
5
6
  onClose?: () => void;
6
7
  transitionDuration?: number;
@@ -0,0 +1,11 @@
1
+ import { FPSMetrics } from './FPSTMonitor.utils';
2
+ export interface FPSMonitorProps {
3
+ trigger?: boolean;
4
+ duration?: number;
5
+ updateInterval?: number;
6
+ threshold?: number;
7
+ onComplete?: (metrics: FPSMetrics) => void;
8
+ on60FPSAchieved?: (achieved: boolean) => void;
9
+ }
10
+ declare function FPSMonitor({ trigger, duration, updateInterval, threshold, onComplete, on60FPSAchieved }: FPSMonitorProps): import("react").JSX.Element;
11
+ export default FPSMonitor;