@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.
- 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 +1 -1
- 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,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface OverlayProps extends ComponentPropsWithRef<"div">, Pick<UtilityProps, "css"> {
|
|
1
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
export interface OverlayProps extends HTMLMotionProps<"div"> {
|
|
4
3
|
open?: boolean;
|
|
5
4
|
onClose?: () => void;
|
|
6
5
|
transitionDuration?: number;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { jsxs as E, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as b, useImperativeHandle as z, useLayoutEffect as A, useEffect as g } from "react";
|
|
3
|
+
import { createPortal as I } from "react-dom";
|
|
4
|
+
import i from "@emotion/styled";
|
|
5
|
+
import { motion as L } from "motion/react";
|
|
6
|
+
const R = i(L.div)`
|
|
6
7
|
position: fixed;
|
|
7
|
-
bottom: ${({ theme: { spacing: e } }) => `calc(${e[800]} + var(--safe-area-inset-bottom, 0px))`};
|
|
8
8
|
left: 50%;
|
|
9
|
+
bottom: ${({ theme: { spacing: e } }) => `calc(${e[800]} + var(--safe-area-inset-bottom, 0px))`};
|
|
9
10
|
display: flex;
|
|
10
11
|
align-items: center;
|
|
11
12
|
gap: ${({ theme: { spacing: e } }) => e[400]};
|
|
@@ -20,15 +21,9 @@ const T = a.div`
|
|
|
20
21
|
}) => e[900]};
|
|
21
22
|
border-radius: ${({ theme: { radius: e } }) => e[400]};
|
|
22
23
|
z-index: 1;
|
|
23
|
-
|
|
24
|
-
transition:
|
|
25
|
-
opacity ${({ transitionDuration: e }) => `${e}ms`}
|
|
26
|
-
${({ ease: e }) => e === "in" ? "ease-in" : "ease-out"},
|
|
27
|
-
transform ${({ transitionDuration: e }) => `${e}ms`},
|
|
28
|
-
background-color 0.2s;
|
|
29
|
-
`, j = a.div`
|
|
24
|
+
`, T = i.div`
|
|
30
25
|
white-space: nowrap;
|
|
31
|
-
`,
|
|
26
|
+
`, j = i.div`
|
|
32
27
|
flex-grow: 1;
|
|
33
28
|
display: -webkit-box;
|
|
34
29
|
overflow: hidden;
|
|
@@ -38,70 +33,79 @@ const T = a.div`
|
|
|
38
33
|
${({
|
|
39
34
|
theme: {
|
|
40
35
|
palette: { common: e },
|
|
41
|
-
typography: { body2:
|
|
36
|
+
typography: { body2: t }
|
|
42
37
|
}
|
|
43
38
|
}) => ({
|
|
44
|
-
fontSize:
|
|
45
|
-
lineHeight:
|
|
39
|
+
fontSize: t.fontSize,
|
|
40
|
+
lineHeight: t.lineHeight,
|
|
46
41
|
color: e.surface
|
|
47
42
|
})}
|
|
48
|
-
`, F =
|
|
43
|
+
`, F = i.div`
|
|
49
44
|
white-space: nowrap;
|
|
50
45
|
`;
|
|
51
|
-
function
|
|
46
|
+
function B({
|
|
52
47
|
children: e,
|
|
53
|
-
open:
|
|
54
|
-
onClose:
|
|
55
|
-
transitionDuration:
|
|
56
|
-
style:
|
|
57
|
-
ref:
|
|
58
|
-
startIcon:
|
|
59
|
-
action:
|
|
60
|
-
maxWidth:
|
|
48
|
+
open: t,
|
|
49
|
+
onClose: l,
|
|
50
|
+
transitionDuration: a = 0.2,
|
|
51
|
+
style: O,
|
|
52
|
+
ref: v,
|
|
53
|
+
startIcon: m,
|
|
54
|
+
action: f,
|
|
55
|
+
maxWidth: w = "375px",
|
|
61
56
|
autoHideDuration: d = 3e3,
|
|
62
|
-
disableAutoHide:
|
|
63
|
-
|
|
57
|
+
disableAutoHide: p,
|
|
58
|
+
...$
|
|
64
59
|
}) {
|
|
65
|
-
const [k,
|
|
66
|
-
return
|
|
67
|
-
let
|
|
68
|
-
return
|
|
60
|
+
const [k, u] = y(!0), [r, h] = y(!1), o = b(null), s = b(null);
|
|
61
|
+
return z(v, () => o.current), A(() => {
|
|
62
|
+
let n;
|
|
63
|
+
return t ? (u(!1), n = requestAnimationFrame(() => {
|
|
69
64
|
h(!0);
|
|
70
65
|
})) : h(!1), () => {
|
|
71
|
-
|
|
66
|
+
n && cancelAnimationFrame(n);
|
|
72
67
|
};
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
75
|
-
|
|
68
|
+
}, [t, a]), g(() => {
|
|
69
|
+
const n = o.current, x = (S) => {
|
|
70
|
+
t || S.propertyName === "opacity" && u(!0);
|
|
76
71
|
};
|
|
77
|
-
return
|
|
78
|
-
|
|
72
|
+
return n?.addEventListener("transitionend", x), () => {
|
|
73
|
+
n?.removeEventListener("transitionend", x);
|
|
79
74
|
};
|
|
80
|
-
}, [
|
|
81
|
-
if (!(
|
|
82
|
-
return
|
|
83
|
-
|
|
75
|
+
}, [t]), g(() => {
|
|
76
|
+
if (!(p || !r))
|
|
77
|
+
return s.current = setTimeout(() => {
|
|
78
|
+
l?.();
|
|
84
79
|
}, d), () => {
|
|
85
|
-
|
|
80
|
+
s.current && clearTimeout(s.current);
|
|
86
81
|
};
|
|
87
|
-
}, [
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
82
|
+
}, [p, d, r, l]), k ? null : I(
|
|
83
|
+
/* @__PURE__ */ E(
|
|
84
|
+
R,
|
|
90
85
|
{
|
|
91
|
-
ref:
|
|
92
|
-
transitionDuration:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
ref: o,
|
|
87
|
+
transitionDuration: a,
|
|
88
|
+
maxWidth: w,
|
|
89
|
+
initial: {
|
|
90
|
+
x: "-50%",
|
|
91
|
+
scale: 0.97,
|
|
92
|
+
opacity: 0
|
|
93
|
+
},
|
|
94
|
+
animate: {
|
|
95
|
+
x: "-50%",
|
|
96
|
+
scale: r ? 1 : 0.97,
|
|
97
|
+
opacity: r ? 1 : 0
|
|
98
|
+
},
|
|
99
|
+
transition: {
|
|
100
|
+
type: "spring",
|
|
101
|
+
duration: a,
|
|
102
|
+
damping: 10
|
|
99
103
|
},
|
|
100
|
-
|
|
104
|
+
...$,
|
|
101
105
|
children: [
|
|
102
|
-
|
|
103
|
-
/* @__PURE__ */ c(
|
|
104
|
-
|
|
106
|
+
m && /* @__PURE__ */ c(T, { children: m }),
|
|
107
|
+
/* @__PURE__ */ c(j, { children: e }),
|
|
108
|
+
f && /* @__PURE__ */ c(F, { children: f })
|
|
105
109
|
]
|
|
106
110
|
}
|
|
107
111
|
),
|
|
@@ -109,5 +113,5 @@ function N({
|
|
|
109
113
|
);
|
|
110
114
|
}
|
|
111
115
|
export {
|
|
112
|
-
|
|
116
|
+
B as default
|
|
113
117
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode,
|
|
2
|
-
import {
|
|
3
|
-
export interface SnackbarProps extends
|
|
1
|
+
import { ReactNode, PropsWithChildren } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
export interface SnackbarProps extends PropsWithChildren<HTMLMotionProps<"div">> {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
transitionDuration?: number;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import s from "@emotion/styled";
|
|
3
|
+
import { motion as l } from "motion/react";
|
|
4
|
+
const d = s(l.button)`
|
|
4
5
|
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 0 ${({ theme: { spacing: t } }) => t[100]};
|
|
5
9
|
border-radius: 9999px;
|
|
6
|
-
transition:
|
|
7
|
-
width 0.2s,
|
|
8
|
-
height 0.2s,
|
|
9
|
-
background-color 0.2s;
|
|
10
|
+
transition: background-color 0.2s;
|
|
10
11
|
cursor: pointer;
|
|
11
12
|
|
|
12
|
-
${({ theme: { palette: t }, checked:
|
|
13
|
+
${({ theme: { palette: t }, checked: i, disabled: r, size: a }) => {
|
|
13
14
|
const e = {};
|
|
14
|
-
switch (
|
|
15
|
+
switch (a) {
|
|
15
16
|
case "small":
|
|
16
17
|
Object.assign(e, {
|
|
17
18
|
width: "40px",
|
|
@@ -43,60 +44,72 @@ const c = l.button`
|
|
|
43
44
|
});
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return i ? Object.assign(e, {
|
|
47
48
|
backgroundColor: t.primary.main
|
|
48
49
|
}) : Object.assign(e, {
|
|
49
50
|
backgroundColor: t.neutral[300]
|
|
50
|
-
}),
|
|
51
|
+
}), r && Object.assign(e, {
|
|
51
52
|
backgroundColor: t.neutral[200]
|
|
52
53
|
}), e;
|
|
53
54
|
}};
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
background-color: ${({
|
|
56
|
+
&:disabled {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
`, c = s(l.div)`
|
|
60
|
+
background-color: ${({
|
|
61
61
|
theme: {
|
|
62
62
|
palette: { common: t }
|
|
63
63
|
}
|
|
64
64
|
}) => t.background};
|
|
65
|
-
|
|
66
|
-
transition:
|
|
67
|
-
width 0.2s,
|
|
68
|
-
height 0.2s,
|
|
69
|
-
background-color 0.2s,
|
|
70
|
-
transform 0.2s ${({ ease: t }) => t === "in" ? "ease-in" : "ease-out"};
|
|
71
|
-
transform: ${({ theme: { spacing: t }, checked: r }) => r ? `translate3d(calc(100% + ${t[100]}), -50%, 0)` : `translate3d(${t[100]}, -50%, 0)`};
|
|
72
|
-
}
|
|
65
|
+
border-radius: 50%;
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
${({ size: t }) => {
|
|
68
|
+
switch (t) {
|
|
69
|
+
case "small":
|
|
70
|
+
return {
|
|
71
|
+
width: "16px",
|
|
72
|
+
height: "16px"
|
|
73
|
+
};
|
|
74
|
+
case "large":
|
|
75
|
+
return {
|
|
76
|
+
width: "24px",
|
|
77
|
+
height: "24px"
|
|
78
|
+
};
|
|
79
|
+
default:
|
|
80
|
+
return {
|
|
81
|
+
width: "20px",
|
|
82
|
+
height: "20px"
|
|
83
|
+
};
|
|
76
84
|
}
|
|
85
|
+
}}
|
|
77
86
|
`;
|
|
78
|
-
function
|
|
87
|
+
function x({
|
|
79
88
|
checked: t = !1,
|
|
80
|
-
disabled:
|
|
81
|
-
size:
|
|
82
|
-
onChange:
|
|
89
|
+
disabled: i = !1,
|
|
90
|
+
size: r = "medium",
|
|
91
|
+
onChange: a,
|
|
83
92
|
onClick: e,
|
|
84
|
-
...
|
|
93
|
+
...h
|
|
85
94
|
}) {
|
|
86
95
|
return /* @__PURE__ */ n(
|
|
87
|
-
|
|
96
|
+
d,
|
|
88
97
|
{
|
|
89
|
-
size:
|
|
98
|
+
size: r,
|
|
90
99
|
checked: t,
|
|
91
|
-
disabled:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
disabled: i,
|
|
101
|
+
onClick: (o) => {
|
|
102
|
+
!i && typeof a == "function" && a(o, !t), typeof e == "function" && e(o);
|
|
103
|
+
},
|
|
104
|
+
layout: !0,
|
|
105
|
+
style: {
|
|
106
|
+
justifyContent: t ? "flex-end" : "flex-start"
|
|
95
107
|
},
|
|
96
|
-
...
|
|
108
|
+
...h,
|
|
109
|
+
children: /* @__PURE__ */ n(c, { layout: !0, size: r })
|
|
97
110
|
}
|
|
98
111
|
);
|
|
99
112
|
}
|
|
100
113
|
export {
|
|
101
|
-
|
|
114
|
+
x as default
|
|
102
115
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface SwitchProps extends Omit<
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
export interface SwitchProps extends Omit<HTMLMotionProps<"button">, "onChange"> {
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
size?: "small" | "medium" | "large";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color 0.2s;
|
|
2
|
+
import g from "@emotion/styled";
|
|
3
|
+
import { motion as b } from "motion/react";
|
|
4
|
+
const k = g(b.span)`
|
|
5
|
+
transition: all 0.2s;
|
|
7
6
|
cursor: default;
|
|
8
7
|
|
|
9
8
|
padding: ${({ theme: { spacing: r } }) => r[100]};
|
|
@@ -16,13 +15,13 @@ const m = b.span`
|
|
|
16
15
|
primary: e,
|
|
17
16
|
secondary: o,
|
|
18
17
|
text: i,
|
|
19
|
-
feedback: { warning: n, error: t, info:
|
|
18
|
+
feedback: { warning: n, error: t, info: s, success: c }
|
|
20
19
|
}
|
|
21
20
|
},
|
|
22
|
-
color:
|
|
21
|
+
color: m
|
|
23
22
|
}) => {
|
|
24
23
|
const a = {};
|
|
25
|
-
switch (
|
|
24
|
+
switch (m) {
|
|
26
25
|
case "warning":
|
|
27
26
|
Object.assign(a, {
|
|
28
27
|
backgroundColor: n.main,
|
|
@@ -37,13 +36,13 @@ const m = b.span`
|
|
|
37
36
|
break;
|
|
38
37
|
case "info":
|
|
39
38
|
Object.assign(a, {
|
|
40
|
-
backgroundColor:
|
|
39
|
+
backgroundColor: s.main,
|
|
41
40
|
color: r === "dark" ? o.main : i.primary
|
|
42
41
|
});
|
|
43
42
|
break;
|
|
44
43
|
case "success":
|
|
45
44
|
Object.assign(a, {
|
|
46
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: c.main,
|
|
47
46
|
color: r === "dark" ? o.main : i.primary
|
|
48
47
|
});
|
|
49
48
|
break;
|
|
@@ -67,9 +66,9 @@ const m = b.span`
|
|
|
67
66
|
lineHeight: r.lineHeight
|
|
68
67
|
})};
|
|
69
68
|
`;
|
|
70
|
-
function
|
|
71
|
-
return /* @__PURE__ */ l(
|
|
69
|
+
function f(r) {
|
|
70
|
+
return /* @__PURE__ */ l(k, { ...r });
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
|
-
|
|
73
|
+
f as default
|
|
75
74
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface TagProps extends ComponentPropsWithRef<"span">, Pick<UtilityProps, "css"> {
|
|
1
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
export interface TagProps extends HTMLMotionProps<"span"> {
|
|
4
3
|
color?: "primary" | "warning" | "error" | "info" | "success";
|
|
5
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TextFieldProps } from './TextField.typing';
|
|
2
|
-
declare function TextField({ variant, size, fullWidth, disabled, startIcon, endIcon,
|
|
2
|
+
declare function TextField({ variant, size, fullWidth, disabled, startIcon, endIcon, onFocus, onBlur, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
3
3
|
export default TextField;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import l from "@emotion/styled";
|
|
4
|
+
import { motion as c } from "motion/react";
|
|
5
|
+
const b = l(c.div)`
|
|
5
6
|
display: flex;
|
|
6
7
|
align-items: center;
|
|
7
8
|
gap: ${({ theme: { spacing: e } }) => e[200]};
|
|
8
9
|
border: 1px solid transparent;
|
|
9
10
|
border-radius: ${({ theme: { radius: e } }) => e[200]};
|
|
10
|
-
transition:
|
|
11
|
-
background-color 0.2s,
|
|
12
|
-
border-color 0.2s,
|
|
13
|
-
padding 0.2s,
|
|
14
|
-
font-size 0.2s,
|
|
15
|
-
font-weight 0.2s,
|
|
16
|
-
color 0.2s;
|
|
11
|
+
transition: all 0.2s;
|
|
17
12
|
background-color: ${({
|
|
18
13
|
theme: {
|
|
19
14
|
palette: { common: e }
|
|
@@ -124,7 +119,7 @@ const b = s.div`
|
|
|
124
119
|
color: e[500],
|
|
125
120
|
cursor: "not-allowed"
|
|
126
121
|
} : {}};
|
|
127
|
-
`, w =
|
|
122
|
+
`, w = l(c.input)`
|
|
128
123
|
flex-grow: 1;
|
|
129
124
|
border: none;
|
|
130
125
|
outline: none;
|
|
@@ -141,51 +136,50 @@ const b = s.div`
|
|
|
141
136
|
&:disabled {
|
|
142
137
|
cursor: not-allowed;
|
|
143
138
|
}
|
|
144
|
-
`, S =
|
|
139
|
+
`, S = l.div`
|
|
145
140
|
display: flex;
|
|
146
141
|
align-items: center;
|
|
147
142
|
justify-content: center;
|
|
148
143
|
white-space: nowrap;
|
|
149
|
-
`, $ =
|
|
144
|
+
`, $ = l.div`
|
|
150
145
|
display: flex;
|
|
151
146
|
align-items: center;
|
|
152
147
|
justify-content: center;
|
|
153
148
|
white-space: nowrap;
|
|
154
149
|
`;
|
|
155
|
-
function
|
|
150
|
+
function y({
|
|
156
151
|
variant: e = "outlined",
|
|
157
152
|
size: n = "medium",
|
|
158
153
|
fullWidth: o,
|
|
159
154
|
disabled: t,
|
|
160
155
|
startIcon: r,
|
|
161
156
|
endIcon: i,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
...g
|
|
157
|
+
onFocus: h,
|
|
158
|
+
onBlur: u,
|
|
159
|
+
...f
|
|
166
160
|
}) {
|
|
167
|
-
const [
|
|
168
|
-
return /* @__PURE__ */
|
|
161
|
+
const [g, d] = p(!1);
|
|
162
|
+
return /* @__PURE__ */ m(
|
|
169
163
|
b,
|
|
170
164
|
{
|
|
171
165
|
variant: e,
|
|
172
166
|
size: n,
|
|
173
|
-
focused:
|
|
167
|
+
focused: g,
|
|
174
168
|
fullWidth: o,
|
|
175
169
|
disabled: t,
|
|
176
|
-
|
|
170
|
+
layout: !0,
|
|
177
171
|
children: [
|
|
178
|
-
r && /* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
181
|
-
}, onBlur: (
|
|
182
|
-
|
|
172
|
+
r && /* @__PURE__ */ a(S, { children: r }),
|
|
173
|
+
/* @__PURE__ */ a(w, { ...f, onFocus: (s) => {
|
|
174
|
+
d(!0), h?.(s);
|
|
175
|
+
}, onBlur: (s) => {
|
|
176
|
+
d(!1), u?.(s);
|
|
183
177
|
}, disabled: t }),
|
|
184
|
-
i && /* @__PURE__ */
|
|
178
|
+
i && /* @__PURE__ */ a($, { children: i })
|
|
185
179
|
]
|
|
186
180
|
}
|
|
187
181
|
);
|
|
188
182
|
}
|
|
189
183
|
export {
|
|
190
|
-
|
|
184
|
+
y as default
|
|
191
185
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface TextFieldProps extends Omit<
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
export interface TextFieldProps extends Omit<HTMLMotionProps<"input">, "size"> {
|
|
4
4
|
variant?: "contained" | "outlined";
|
|
5
5
|
startIcon?: ReactNode;
|
|
6
6
|
endIcon?: ReactNode;
|
|
@@ -1,46 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import f from "@emotion/styled";
|
|
3
|
+
import { motion as y } from "motion/react";
|
|
4
|
+
import d from "../../utils/getUtilityProps.mjs";
|
|
4
5
|
import r from "../../utils/getValueByPath.mjs";
|
|
5
|
-
const
|
|
6
|
-
transition:
|
|
7
|
-
font-size 0.2s,
|
|
8
|
-
line-height 0.2s,
|
|
9
|
-
border-width 0.2s,
|
|
10
|
-
border-radius 0.2s,
|
|
11
|
-
border-color 0.2s,
|
|
12
|
-
color 0.2s;
|
|
6
|
+
const h = f(y.div)`
|
|
7
|
+
transition: all 0.2s;
|
|
13
8
|
|
|
14
|
-
${({ theme: { typography:
|
|
15
|
-
const { fontSize:
|
|
16
|
-
fontSize:
|
|
17
|
-
lineHeight:
|
|
9
|
+
${({ theme: { typography: t, palette: i }, variant: s, color: n, fontWeight: l, borderColor: e, ...a }) => {
|
|
10
|
+
const { fontSize: p, lineHeight: m } = t[s || "body2"], o = {
|
|
11
|
+
fontSize: p,
|
|
12
|
+
lineHeight: m,
|
|
18
13
|
fontWeight: l
|
|
19
14
|
};
|
|
20
|
-
return Object.assign(
|
|
21
|
-
borderColor: r(
|
|
22
|
-
}), Object.assign(
|
|
23
|
-
color: r(
|
|
24
|
-
}),
|
|
15
|
+
return Object.assign(o, d(a)), e && Object.assign(o, {
|
|
16
|
+
borderColor: r(i, e) || "inherit"
|
|
17
|
+
}), Object.assign(o, {
|
|
18
|
+
color: r(i, n) || "inherit"
|
|
19
|
+
}), o;
|
|
25
20
|
}};
|
|
26
21
|
|
|
27
|
-
${({ textAlign:
|
|
28
|
-
textAlign:
|
|
22
|
+
${({ textAlign: t }) => t ? {
|
|
23
|
+
textAlign: t
|
|
29
24
|
} : {}};
|
|
30
25
|
|
|
31
|
-
${({ noWrap:
|
|
26
|
+
${({ noWrap: t }) => t ? {
|
|
32
27
|
whiteSpace: "nowrap",
|
|
33
28
|
overflow: "hidden",
|
|
34
29
|
textOverflow: "ellipsis"
|
|
35
30
|
} : {}};
|
|
36
31
|
|
|
37
|
-
${({ lineClamp:
|
|
32
|
+
${({ lineClamp: t }) => t ? {
|
|
38
33
|
display: "-webkit-box",
|
|
39
34
|
overflow: "hidden",
|
|
40
|
-
"-webkit-line-clamp":
|
|
35
|
+
"-webkit-line-clamp": t,
|
|
41
36
|
"-webkit-box-orient": "vertical"
|
|
42
37
|
} : {}};
|
|
43
|
-
`, u = (
|
|
38
|
+
`, u = (t) => /* @__PURE__ */ c(h, { ...t });
|
|
44
39
|
export {
|
|
45
40
|
u as default
|
|
46
41
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactNode, ElementType } from 'react';
|
|
2
2
|
import { PolymorphicComponentProps } from '../../typings/component';
|
|
3
3
|
import { UtilityProps, RecursionPath } from '../../typings/utility';
|
|
4
|
-
import {
|
|
4
|
+
import { ShifloTheme } from '../../theme/typing';
|
|
5
5
|
export interface BaseTypographyProps extends UtilityProps {
|
|
6
|
-
variant?: keyof
|
|
6
|
+
variant?: keyof ShifloTheme["typography"];
|
|
7
7
|
fontWeight?: 400 | 500 | 700;
|
|
8
|
-
color?: RecursionPath<
|
|
9
|
-
borderColor?: RecursionPath<
|
|
8
|
+
color?: RecursionPath<ShifloTheme["palette"]> | "inherit";
|
|
9
|
+
borderColor?: RecursionPath<ShifloTheme["palette"]>;
|
|
10
10
|
textAlign?: "left" | "center" | "right";
|
|
11
11
|
noWrap?: boolean;
|
|
12
12
|
lineClamp?: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as BottomSheet } from './BottomSheet';
|
|
2
|
+
import { default as Box } from './Box';
|
|
3
|
+
import { default as Button } from './Button';
|
|
4
|
+
import { default as Dialog } from './Dialog';
|
|
5
|
+
import { default as Icon } from './Icon';
|
|
6
|
+
import { default as Overlay } from './Overlay';
|
|
7
|
+
import { default as Snackbar } from './Snackbar';
|
|
8
|
+
import { default as Switch } from './Switch';
|
|
9
|
+
import { default as Tag } from './Tag';
|
|
10
|
+
import { default as TextField } from './TextField';
|
|
11
|
+
import { default as Typography } from './Typography';
|
|
12
|
+
export * from './BottomSheet';
|
|
13
|
+
export * from './Box';
|
|
14
|
+
export * from './Button';
|
|
15
|
+
export * from './Dialog';
|
|
16
|
+
export * from './Icon';
|
|
17
|
+
export * from './Overlay';
|
|
18
|
+
export * from './Snackbar';
|
|
19
|
+
export * from './Switch';
|
|
20
|
+
export * from './Tag';
|
|
21
|
+
export * from './TextField';
|
|
22
|
+
export * from './Typography';
|
|
23
|
+
export { Button, Box, Typography, TextField, Overlay, BottomSheet, Dialog, Icon, Snackbar, Switch, Tag };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as a } from "./BottomSheet/BottomSheet.mjs";
|
|
2
|
+
import { default as r } from "./Box/Box.mjs";
|
|
3
|
+
import { default as l } from "./Button/Button.mjs";
|
|
4
|
+
import { default as x } from "./Dialog/Dialog.mjs";
|
|
5
|
+
import { default as m } from "./Icon/Icon.mjs";
|
|
6
|
+
import { default as s } from "./Overlay/Overlay.mjs";
|
|
7
|
+
import { default as g } from "./Snackbar/Snackbar.mjs";
|
|
8
|
+
import { default as i } from "./Switch/Switch.mjs";
|
|
9
|
+
import { default as y } from "./Tag/Tag.mjs";
|
|
10
|
+
import { default as S } from "./TextField/TextField.mjs";
|
|
11
|
+
import { default as b } from "./Typography/Typography.mjs";
|
|
12
|
+
export {
|
|
13
|
+
a as BottomSheet,
|
|
14
|
+
r as Box,
|
|
15
|
+
l as Button,
|
|
16
|
+
x as Dialog,
|
|
17
|
+
m as Icon,
|
|
18
|
+
s as Overlay,
|
|
19
|
+
g as Snackbar,
|
|
20
|
+
i as Switch,
|
|
21
|
+
y as Tag,
|
|
22
|
+
S as TextField,
|
|
23
|
+
b as Typography
|
|
24
|
+
};
|