@shiflo/ui 0.2.1 → 0.2.4
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 +25 -23
- package/dist/components/BottomSheet/BottomSheet.typing.d.ts +1 -0
- package/dist/components/Button/Button.mjs +72 -69
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.mjs +16 -14
- package/dist/components/Dialog/Dialog.typing.d.ts +1 -0
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.mjs +69 -55
- package/dist/components/Overlay/Overlay.typing.d.ts +1 -0
- package/dist/components/Snackbar/Snackbar.mjs +23 -18
- package/dist/components/TextField/TextField.mjs +20 -20
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.mjs +10 -12
- package/dist/theme/GlobalStyle.mjs +1 -0
- package/dist/theme/dark.mjs +5 -5
- package/dist/theme/light.mjs +3 -3
- package/dist/theme/typography.mjs +6 -6
- package/package.json +4 -2
- package/dist/assets/icons/index.d.ts +0 -2
- package/dist/assets/icons/index.mjs +0 -48
- package/dist/assets/icons/index.ts-BhlTWUs_.js +0 -52
- package/dist/assets/icons/line/calendar-line.svg-DHsuXoUL.js +0 -5
- package/dist/assets/icons/line/index.d.ts +0 -1
- package/dist/assets/icons/line/index.mjs +0 -4
- package/dist/assets/icons/solid/arrow-left-solid.svg-C16XJbK9.js +0 -5
- package/dist/assets/icons/solid/briefcase-blank-solid.svg-6ppQL_Z4.js +0 -5
- package/dist/assets/icons/solid/calendar-days-solid.svg-CIj8vf6t.js +0 -5
- package/dist/assets/icons/solid/calendar-lines-solid.svg-D2qG_E7t.js +0 -5
- package/dist/assets/icons/solid/calendar-week-solid.svg-CVmrJtif.js +0 -5
- package/dist/assets/icons/solid/calendars-solid.svg-rClh_xBu.js +0 -5
- package/dist/assets/icons/solid/chart-simple-horizontal-solid.svg-znTJSeQj.js +0 -5
- package/dist/assets/icons/solid/check-solid.svg-C41sTTzR.js +0 -5
- package/dist/assets/icons/solid/chevron-left-solid.svg-CrKzZ71H.js +0 -5
- package/dist/assets/icons/solid/circle-check-solid.svg-D2Pv_oiO.js +0 -5
- package/dist/assets/icons/solid/circle-exclamation-solid.svg-CuZt_q4T.js +0 -5
- package/dist/assets/icons/solid/circle-info-solid.svg-eMJtJJRm.js +0 -5
- package/dist/assets/icons/solid/circle-plus-solid.svg-wYCF_uVS.js +0 -5
- package/dist/assets/icons/solid/clock-desk-solid.svg-Dvm3Xip1.js +0 -5
- package/dist/assets/icons/solid/gear-solid.svg-C6vEx0Wx.js +0 -5
- package/dist/assets/icons/solid/grid-2-solid.svg-BRtzwK6Y.js +0 -5
- package/dist/assets/icons/solid/index.d.ts +0 -22
- package/dist/assets/icons/solid/index.mjs +0 -46
- package/dist/assets/icons/solid/minus-solid.svg-BBiGvc-2.js +0 -5
- package/dist/assets/icons/solid/pen-to-square-solid.svg-DUdNcuTM.js +0 -5
- package/dist/assets/icons/solid/plus-solid.svg-piiaS3kO.js +0 -5
- package/dist/assets/icons/solid/rotate-right-solid.svg-CYW200XH.js +0 -5
- package/dist/assets/icons/solid/trash-solid.svg-iJSf_6Y3.js +0 -5
- package/dist/assets/icons/solid/xmark-solid.svg-Ce8xHlZn.js +0 -5
- package/dist/components/Icon/Icon.d.ts +0 -3
- package/dist/components/Icon/Icon.mjs +0 -18
- package/dist/components/Icon/Icon.typing.d.ts +0 -11
- package/dist/components/Icon/index.d.ts +0 -4
- package/dist/components/Icon/index.mjs +0 -4
|
@@ -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("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function BottomSheet({ open, onClose, children, transitionDuration, maxWidth, onClick, ref, hideDragHandleBar, hideOverlay, disablePortal, style, ...props }: BottomSheetProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BottomSheet;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as g, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as g, jsxs as z } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as o, useImperativeHandle as G, useEffect as M } from "react";
|
|
3
3
|
import y from "@emotion/styled";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import J from "../Overlay/Overlay.mjs";
|
|
5
|
+
const K = y.div`
|
|
6
6
|
width: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
7
7
|
max-width: ${({ maxWidth: t = "375px" }) => t};
|
|
8
8
|
max-height: calc(100% - ${({ theme: { spacing: t } }) => t[800]});
|
|
@@ -19,7 +19,7 @@ const J = y.div`
|
|
|
19
19
|
transform ${({ transitionDuration: t }) => `${t}ms`}
|
|
20
20
|
${({ ease: t }) => t === "in" ? "ease-out" : "ease-in"},
|
|
21
21
|
background-color 0.2s;
|
|
22
|
-
`,
|
|
22
|
+
`, N = y.div`
|
|
23
23
|
position: sticky;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
@@ -34,7 +34,7 @@ const J = y.div`
|
|
|
34
34
|
}
|
|
35
35
|
}) => t.background};
|
|
36
36
|
transition: background-color 0.2s;
|
|
37
|
-
`,
|
|
37
|
+
`, Q = y.div`
|
|
38
38
|
width: 24px;
|
|
39
39
|
height: 4px;
|
|
40
40
|
border-radius: ${({ theme: { radius: t } }) => t[100]};
|
|
@@ -45,7 +45,7 @@ const J = y.div`
|
|
|
45
45
|
}) => t.main};
|
|
46
46
|
transition: background-color 0.2s;
|
|
47
47
|
`;
|
|
48
|
-
function
|
|
48
|
+
function ee({
|
|
49
49
|
open: t,
|
|
50
50
|
onClose: d,
|
|
51
51
|
children: S,
|
|
@@ -55,12 +55,13 @@ function _({
|
|
|
55
55
|
ref: j,
|
|
56
56
|
hideDragHandleBar: I,
|
|
57
57
|
hideOverlay: O,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
disablePortal: A,
|
|
59
|
+
style: F,
|
|
60
|
+
...W
|
|
60
61
|
}) {
|
|
61
|
-
const [E, $] =
|
|
62
|
-
|
|
63
|
-
const
|
|
62
|
+
const [E, $] = C(!1), m = o(null), L = o(null), c = o(null), u = o(!1), f = o(0), l = o(0), h = o(0), v = o(0), p = o(0), q = o(0.25);
|
|
63
|
+
G(j, () => m.current);
|
|
64
|
+
const P = (e) => {
|
|
64
65
|
e.stopPropagation(), typeof b == "function" && b(e);
|
|
65
66
|
};
|
|
66
67
|
return M(() => {
|
|
@@ -80,46 +81,47 @@ function _({
|
|
|
80
81
|
l.current = r;
|
|
81
82
|
const B = Date.now(), D = B - p.current;
|
|
82
83
|
if (D > 0) {
|
|
83
|
-
const
|
|
84
|
-
v.current = (r -
|
|
84
|
+
const V = l.current;
|
|
85
|
+
v.current = (r - V) / D, p.current = B;
|
|
85
86
|
}
|
|
86
87
|
n && (n.style.opacity = `${Math.max(0, 1 - i / (h.current * 2))}`), e.style.transform = `translate3d(0, ${i}px, 0)`;
|
|
87
88
|
}, s = () => {
|
|
88
89
|
if (!e || !u.current) return;
|
|
89
90
|
u.current = !1, e.style.cursor = "default", c.current && (c.current.style.cursor = "grab");
|
|
90
|
-
const r = l.current - f.current, i = h.current *
|
|
91
|
+
const r = l.current - f.current, i = h.current * q.current;
|
|
91
92
|
e.style.transition = `transform ${a}ms ease-out`, n && (n.style.transition = `opacity ${a}ms ease-out`), r > i || v.current > 0.5 && v.current > 0 ? (e.style.transform = "translate3d(0, 200%, 0)", n && (n.style.opacity = "0"), d?.()) : (e.style.transform = "translate3d(0, 0, 0)", n && (n.style.opacity = "1"));
|
|
92
93
|
}, R = (r) => x(r.clientY), w = (r) => k(r.clientY), H = (r) => x(r.touches[0].clientY), Y = (r) => k(r.touches[0].clientY);
|
|
93
94
|
return e?.addEventListener("mousedown", R), e?.addEventListener("mousemove", w), e?.addEventListener("mouseup", s), e?.addEventListener("mouseleave", s), e?.addEventListener("touchstart", H), e?.addEventListener("touchmove", Y), e?.addEventListener("touchend", s), e?.addEventListener("touchcancel", s), () => {
|
|
94
95
|
e?.removeEventListener("mousedown", R), e?.removeEventListener("mousemove", w), e?.removeEventListener("mouseup", s), e?.removeEventListener("mouseleave", s), e?.removeEventListener("touchstart", H), e?.removeEventListener("touchmove", Y), e?.removeEventListener("touchend", s), e?.removeEventListener("touchcancel", s);
|
|
95
96
|
};
|
|
96
97
|
}, [E, d, a]), /* @__PURE__ */ g(
|
|
97
|
-
|
|
98
|
+
J,
|
|
98
99
|
{
|
|
99
100
|
ref: L,
|
|
100
101
|
open: t,
|
|
101
102
|
onClose: d,
|
|
102
103
|
transitionDuration: a,
|
|
103
104
|
placement: "center-bottom",
|
|
105
|
+
disablePortal: A,
|
|
104
106
|
css: O ? {
|
|
105
107
|
pointerEvents: "none",
|
|
106
108
|
backgroundColor: "transparent !important"
|
|
107
109
|
} : void 0,
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
|
|
110
|
+
children: /* @__PURE__ */ z(
|
|
111
|
+
K,
|
|
110
112
|
{
|
|
111
113
|
ref: m,
|
|
112
114
|
ease: t ? "in" : "out",
|
|
113
115
|
transitionDuration: a,
|
|
114
116
|
maxWidth: T,
|
|
115
|
-
onClick:
|
|
116
|
-
...
|
|
117
|
+
onClick: P,
|
|
118
|
+
...W,
|
|
117
119
|
style: {
|
|
118
120
|
transform: `translate3d(0, ${E ? "0" : "200%"}, 0)`,
|
|
119
|
-
...
|
|
121
|
+
...F
|
|
120
122
|
},
|
|
121
123
|
children: [
|
|
122
|
-
!I && /* @__PURE__ */ g(
|
|
124
|
+
!I && /* @__PURE__ */ g(N, { ref: c, children: /* @__PURE__ */ g(Q, {}) }),
|
|
123
125
|
S
|
|
124
126
|
]
|
|
125
127
|
}
|
|
@@ -128,5 +130,5 @@ function _({
|
|
|
128
130
|
);
|
|
129
131
|
}
|
|
130
132
|
export {
|
|
131
|
-
|
|
133
|
+
ee as default
|
|
132
134
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsxs as s } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
const b =
|
|
2
|
+
import x from "@emotion/styled";
|
|
3
|
+
const b = x.button`
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
|
-
gap: ${({ theme: { spacing: e } }) => e[100]};
|
|
8
7
|
font-weight: 500;
|
|
9
8
|
transition: all 0.2s;
|
|
10
9
|
border: 1px solid transparent;
|
|
11
10
|
|
|
12
11
|
${({
|
|
13
12
|
theme: {
|
|
14
|
-
mode:
|
|
15
|
-
palette: { primary:
|
|
16
|
-
typography: { body1:
|
|
17
|
-
spacing:
|
|
13
|
+
mode: r,
|
|
14
|
+
palette: { primary: e, secondary: a, neutral: o, gradient: d },
|
|
15
|
+
typography: { body1: c, body2: n, small1: l, small2: g },
|
|
16
|
+
spacing: t,
|
|
18
17
|
radius: h
|
|
19
18
|
},
|
|
20
19
|
variant: k,
|
|
@@ -25,22 +24,22 @@ const b = S.button`
|
|
|
25
24
|
switch (k) {
|
|
26
25
|
case "ghost":
|
|
27
26
|
Object.assign(i, {
|
|
28
|
-
backgroundColor:
|
|
29
|
-
color:
|
|
27
|
+
backgroundColor: e.alpha[10],
|
|
28
|
+
color: e.main,
|
|
30
29
|
"& svg": {
|
|
31
|
-
color:
|
|
30
|
+
color: e.main
|
|
32
31
|
},
|
|
33
32
|
"@media (hover: hover)": {
|
|
34
33
|
"&:hover": {
|
|
35
|
-
backgroundColor:
|
|
34
|
+
backgroundColor: e.alpha[20]
|
|
36
35
|
}
|
|
37
36
|
},
|
|
38
37
|
"&:active": {
|
|
39
38
|
transform: "scale(0.9)",
|
|
40
|
-
backgroundColor:
|
|
39
|
+
backgroundColor: e.alpha[30]
|
|
41
40
|
},
|
|
42
41
|
"&:disabled": {
|
|
43
|
-
backgroundColor:
|
|
42
|
+
backgroundColor: r === "dark" ? e.alpha[10] : e.alpha[5],
|
|
44
43
|
color: o[500],
|
|
45
44
|
cursor: "not-allowed"
|
|
46
45
|
}
|
|
@@ -48,20 +47,20 @@ const b = S.button`
|
|
|
48
47
|
break;
|
|
49
48
|
case "gradient":
|
|
50
49
|
Object.assign(i, {
|
|
51
|
-
background:
|
|
52
|
-
color:
|
|
50
|
+
background: d.primaryToAccent,
|
|
51
|
+
color: r === "dark" ? o[900] : a.main,
|
|
53
52
|
"& svg": {
|
|
54
|
-
color:
|
|
53
|
+
color: r === "dark" ? o[900] : a.main
|
|
55
54
|
},
|
|
56
55
|
"@media (hover: hover)": {
|
|
57
56
|
"&:hover": {
|
|
58
|
-
background:
|
|
57
|
+
background: d.primaryToAccent
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"&:active": {
|
|
62
61
|
transform: "scale(0.9)",
|
|
63
|
-
background:
|
|
64
|
-
boxShadow: `inset 0 0 0 100px ${
|
|
62
|
+
background: d.primaryToAccent,
|
|
63
|
+
boxShadow: `inset 0 0 0 100px ${e.dark}`
|
|
65
64
|
},
|
|
66
65
|
"&:disabled": {
|
|
67
66
|
background: o[200],
|
|
@@ -74,10 +73,10 @@ const b = S.button`
|
|
|
74
73
|
case "text":
|
|
75
74
|
Object.assign(i, {
|
|
76
75
|
backgroundColor: "transparent",
|
|
77
|
-
color:
|
|
76
|
+
color: r === "dark" ? o[800] : o[700],
|
|
78
77
|
// 기본 텍스트 색상 (더 강조된 중립색)
|
|
79
78
|
"& svg": {
|
|
80
|
-
color:
|
|
79
|
+
color: r === "dark" ? o[800] : o[700]
|
|
81
80
|
},
|
|
82
81
|
"@media (hover: hover)": {
|
|
83
82
|
"&:hover": {
|
|
@@ -99,19 +98,19 @@ const b = S.button`
|
|
|
99
98
|
default:
|
|
100
99
|
if (v === "secondary") {
|
|
101
100
|
Object.assign(i, {
|
|
102
|
-
backgroundColor:
|
|
103
|
-
color:
|
|
101
|
+
backgroundColor: a.main,
|
|
102
|
+
color: r === "dark" ? o[900] : o[700],
|
|
104
103
|
"& svg": {
|
|
105
|
-
color:
|
|
104
|
+
color: r === "dark" ? o[900] : o[700]
|
|
106
105
|
},
|
|
107
106
|
"@media (hover: hover)": {
|
|
108
107
|
"&:hover": {
|
|
109
|
-
backgroundColor:
|
|
108
|
+
backgroundColor: a.light
|
|
110
109
|
}
|
|
111
110
|
},
|
|
112
111
|
"&:active": {
|
|
113
112
|
transform: "scale(0.9)",
|
|
114
|
-
backgroundColor:
|
|
113
|
+
backgroundColor: a.dark
|
|
115
114
|
},
|
|
116
115
|
"&:disabled": {
|
|
117
116
|
backgroundColor: o[200],
|
|
@@ -122,19 +121,19 @@ const b = S.button`
|
|
|
122
121
|
break;
|
|
123
122
|
}
|
|
124
123
|
Object.assign(i, {
|
|
125
|
-
backgroundColor:
|
|
126
|
-
color:
|
|
124
|
+
backgroundColor: e.main,
|
|
125
|
+
color: r === "dark" ? o[900] : a.main,
|
|
127
126
|
"& svg": {
|
|
128
|
-
color:
|
|
127
|
+
color: r === "dark" ? o[900] : a.main
|
|
129
128
|
},
|
|
130
129
|
"@media (hover: hover)": {
|
|
131
130
|
"&:hover": {
|
|
132
|
-
backgroundColor:
|
|
131
|
+
backgroundColor: e.hover
|
|
133
132
|
}
|
|
134
133
|
},
|
|
135
134
|
"&:active": {
|
|
136
135
|
transform: "scale(0.9)",
|
|
137
|
-
backgroundColor:
|
|
136
|
+
backgroundColor: e.active
|
|
138
137
|
},
|
|
139
138
|
"&:disabled": {
|
|
140
139
|
backgroundColor: o[200],
|
|
@@ -147,49 +146,53 @@ const b = S.button`
|
|
|
147
146
|
switch (f) {
|
|
148
147
|
case "large":
|
|
149
148
|
Object.assign(i, {
|
|
150
|
-
padding: `${
|
|
149
|
+
padding: `${t[300]} ${t[350]}`,
|
|
151
150
|
borderRadius: h[300],
|
|
152
|
-
fontSize:
|
|
153
|
-
lineHeight:
|
|
151
|
+
fontSize: c.fontSize,
|
|
152
|
+
lineHeight: c.lineHeight,
|
|
153
|
+
gap: t[200],
|
|
154
154
|
"& svg": {
|
|
155
|
-
width:
|
|
156
|
-
height:
|
|
155
|
+
width: `calc(${c.fontSize} + 4px)`,
|
|
156
|
+
height: `calc(${c.fontSize} + 4px)`
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
break;
|
|
160
160
|
case "small":
|
|
161
161
|
Object.assign(i, {
|
|
162
|
-
padding: `${
|
|
162
|
+
padding: `${t[100]} ${t[150]}`,
|
|
163
163
|
borderRadius: h[200],
|
|
164
|
-
fontSize:
|
|
165
|
-
lineHeight:
|
|
164
|
+
fontSize: l.fontSize,
|
|
165
|
+
lineHeight: l.lineHeight,
|
|
166
|
+
gap: t[100],
|
|
166
167
|
"& svg": {
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
168
|
+
width: `calc(${l.fontSize} + 4px)`,
|
|
169
|
+
height: `calc(${l.fontSize} + 4px)`
|
|
169
170
|
}
|
|
170
171
|
});
|
|
171
172
|
break;
|
|
172
173
|
case "xSmall":
|
|
173
174
|
Object.assign(i, {
|
|
174
|
-
padding: `${
|
|
175
|
+
padding: `${t[50]} ${t[100]}`,
|
|
175
176
|
borderRadius: h[150],
|
|
176
|
-
fontSize:
|
|
177
|
-
lineHeight:
|
|
177
|
+
fontSize: g.fontSize,
|
|
178
|
+
lineHeight: g.lineHeight,
|
|
179
|
+
gap: t[100],
|
|
178
180
|
"& svg": {
|
|
179
|
-
width:
|
|
180
|
-
height:
|
|
181
|
+
width: `calc(${g.fontSize} + 4px)`,
|
|
182
|
+
height: `calc(${g.fontSize} + 4px)`
|
|
181
183
|
}
|
|
182
184
|
});
|
|
183
185
|
break;
|
|
184
186
|
default:
|
|
185
187
|
Object.assign(i, {
|
|
186
|
-
padding: `${
|
|
188
|
+
padding: `${t[200]} ${t[250]}`,
|
|
187
189
|
borderRadius: h[250],
|
|
188
190
|
fontSize: n.fontSize,
|
|
189
191
|
lineHeight: n.lineHeight,
|
|
192
|
+
gap: t[150],
|
|
190
193
|
"& svg": {
|
|
191
|
-
width: n.fontSize
|
|
192
|
-
height: n.fontSize
|
|
194
|
+
width: `calc(${n.fontSize} + 4px)`,
|
|
195
|
+
height: `calc(${n.fontSize} + 4px)`
|
|
193
196
|
}
|
|
194
197
|
});
|
|
195
198
|
break;
|
|
@@ -197,34 +200,34 @@ const b = S.button`
|
|
|
197
200
|
return i;
|
|
198
201
|
}}
|
|
199
202
|
`;
|
|
200
|
-
function
|
|
201
|
-
ref:
|
|
202
|
-
children:
|
|
203
|
-
variant:
|
|
203
|
+
function $({
|
|
204
|
+
ref: r,
|
|
205
|
+
children: e,
|
|
206
|
+
variant: a = "filled",
|
|
204
207
|
size: o = "medium",
|
|
205
|
-
color:
|
|
206
|
-
startIcon:
|
|
208
|
+
color: d = "primary",
|
|
209
|
+
startIcon: c,
|
|
207
210
|
endIcon: n,
|
|
208
|
-
...
|
|
211
|
+
...l
|
|
209
212
|
}) {
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
return a === "text" ? /* @__PURE__ */ s(b, { ref: r, variant: "text", size: o, color: "secondary", ...l, children: [
|
|
214
|
+
c,
|
|
215
|
+
e,
|
|
213
216
|
n
|
|
214
|
-
] }) :
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
] }) : a === "ghost" ? /* @__PURE__ */ s(b, { ref: r, variant: "ghost", size: o, color: "primary", ...l, children: [
|
|
218
|
+
c,
|
|
219
|
+
e,
|
|
217
220
|
n
|
|
218
|
-
] }) :
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
] }) : a === "gradient" ? /* @__PURE__ */ s(b, { ref: r, variant: "gradient", size: o, color: "primary", ...l, children: [
|
|
222
|
+
c,
|
|
223
|
+
e,
|
|
221
224
|
n
|
|
222
|
-
] }) : /* @__PURE__ */ s(b, { ref:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
+
] }) : /* @__PURE__ */ s(b, { ref: r, variant: a, size: o, color: d, ...l, children: [
|
|
226
|
+
c,
|
|
227
|
+
e,
|
|
225
228
|
n
|
|
226
229
|
] });
|
|
227
230
|
}
|
|
228
231
|
export {
|
|
229
|
-
|
|
232
|
+
$ as default
|
|
230
233
|
};
|
|
@@ -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("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function Dialog({ open, onClose, children, transitionDuration, onClick, style, maxWidth, disablePortal, ...props }: DialogProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Dialog;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
2
|
+
import { useState as p, useRef as h, useEffect as g } from "react";
|
|
3
|
+
import y from "@emotion/styled";
|
|
4
|
+
import x from "../Overlay/Overlay.mjs";
|
|
5
|
+
const b = y.div`
|
|
6
6
|
width: calc(100% - ${({ theme: { spacing: e } }) => e[800]});
|
|
7
7
|
max-width: ${({ maxWidth: e = "375px" }) => e};
|
|
8
8
|
max-height: calc(100% - ${({ theme: { spacing: e } }) => e[800]});
|
|
@@ -22,7 +22,7 @@ const x = g.div`
|
|
|
22
22
|
${({ ease: e }) => e === "in" ? "ease-out" : "ease-in"},
|
|
23
23
|
background-color 0.2s;
|
|
24
24
|
`;
|
|
25
|
-
function
|
|
25
|
+
function A({
|
|
26
26
|
open: e,
|
|
27
27
|
onClose: n,
|
|
28
28
|
children: m,
|
|
@@ -30,12 +30,13 @@ function O({
|
|
|
30
30
|
onClick: o,
|
|
31
31
|
style: l,
|
|
32
32
|
maxWidth: c = "375px",
|
|
33
|
-
|
|
33
|
+
disablePortal: f,
|
|
34
|
+
...u
|
|
34
35
|
}) {
|
|
35
|
-
const [r, i] =
|
|
36
|
+
const [r, i] = p(!1), d = h(null), $ = (t) => {
|
|
36
37
|
t.stopPropagation(), typeof o == "function" && o(t);
|
|
37
38
|
};
|
|
38
|
-
return
|
|
39
|
+
return g(() => {
|
|
39
40
|
let t;
|
|
40
41
|
return e ? t = requestAnimationFrame(() => {
|
|
41
42
|
i(!0);
|
|
@@ -43,21 +44,22 @@ function O({
|
|
|
43
44
|
t && cancelAnimationFrame(t);
|
|
44
45
|
};
|
|
45
46
|
}, [e]), /* @__PURE__ */ s(
|
|
46
|
-
|
|
47
|
+
x,
|
|
47
48
|
{
|
|
48
|
-
ref:
|
|
49
|
+
ref: d,
|
|
49
50
|
open: e,
|
|
50
51
|
onClose: n,
|
|
51
52
|
transitionDuration: a,
|
|
52
53
|
placement: "center-middle",
|
|
54
|
+
disablePortal: f,
|
|
53
55
|
children: /* @__PURE__ */ s(
|
|
54
|
-
|
|
56
|
+
b,
|
|
55
57
|
{
|
|
56
58
|
ease: e ? "in" : "out",
|
|
57
59
|
transitionDuration: a,
|
|
58
60
|
maxWidth: c,
|
|
59
|
-
onClick:
|
|
60
|
-
...
|
|
61
|
+
onClick: $,
|
|
62
|
+
...u,
|
|
61
63
|
style: {
|
|
62
64
|
transform: `scale(${r ? 1 : 0.9})`,
|
|
63
65
|
opacity: r ? 1 : 0,
|
|
@@ -70,5 +72,5 @@ function O({
|
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
74
|
export {
|
|
73
|
-
|
|
75
|
+
A as default
|
|
74
76
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OverlayProps } from './Overlay.typing';
|
|
2
|
-
declare function Overlay({ children, open, onClose, transitionDuration, placement, style, ref, onClick, ...props }: OverlayProps): import(
|
|
2
|
+
declare function Overlay({ children, open, onClose, transitionDuration, placement, style, ref, onClick, disablePortal, ...props }: OverlayProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default Overlay;
|