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