@shiflo/ui 0.0.5 → 0.0.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import d from "basic-styled";
|
|
3
3
|
import a from "../../utils/getUtilityProps.mjs";
|
|
4
|
-
import
|
|
4
|
+
import t from "../../utils/getValueByPath.mjs";
|
|
5
5
|
const m = d.div`
|
|
6
6
|
transition:
|
|
7
7
|
background-color 0.2s,
|
|
@@ -10,17 +10,17 @@ const m = d.div`
|
|
|
10
10
|
border-color 0.2s,
|
|
11
11
|
color 0.2s;
|
|
12
12
|
|
|
13
|
-
${({ theme: { palette:
|
|
14
|
-
const
|
|
15
|
-
return Object.assign(
|
|
16
|
-
backgroundColor:
|
|
17
|
-
}),
|
|
18
|
-
borderColor:
|
|
19
|
-
}), e && Object.assign(
|
|
20
|
-
color:
|
|
21
|
-
}),
|
|
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;
|
|
22
22
|
}}
|
|
23
|
-
`,
|
|
23
|
+
`, h = (r) => /* @__PURE__ */ c(m, { ...r });
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
h as default
|
|
26
26
|
};
|
|
@@ -4,7 +4,7 @@ const h = u.button`
|
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
|
-
gap: ${({ theme: { spacing:
|
|
7
|
+
gap: ${({ theme: { spacing: r } }) => r[100]};
|
|
8
8
|
font-weight: 500;
|
|
9
9
|
transition:
|
|
10
10
|
transform 0.2s ease-out,
|
|
@@ -20,20 +20,20 @@ const h = u.button`
|
|
|
20
20
|
|
|
21
21
|
${({
|
|
22
22
|
theme: {
|
|
23
|
-
mode:
|
|
24
|
-
palette: { primary: e, secondary:
|
|
25
|
-
typography: { body1: d, body2:
|
|
26
|
-
spacing:
|
|
23
|
+
mode: r,
|
|
24
|
+
palette: { primary: e, secondary: t, neutral: o },
|
|
25
|
+
typography: { body1: d, body2: i, small1: n, small2: c },
|
|
26
|
+
spacing: s,
|
|
27
27
|
radius: l
|
|
28
28
|
},
|
|
29
29
|
variant: b,
|
|
30
|
-
size:
|
|
31
|
-
color:
|
|
30
|
+
size: k,
|
|
31
|
+
color: f
|
|
32
32
|
}) => {
|
|
33
|
-
const
|
|
33
|
+
const a = {};
|
|
34
34
|
switch (b) {
|
|
35
35
|
case "ghost":
|
|
36
|
-
Object.assign(
|
|
36
|
+
Object.assign(a, {
|
|
37
37
|
backgroundColor: e.alpha[10],
|
|
38
38
|
color: e.main,
|
|
39
39
|
"& svg": {
|
|
@@ -42,28 +42,38 @@ const h = u.button`
|
|
|
42
42
|
"&:hover": {
|
|
43
43
|
backgroundColor: e.alpha[20]
|
|
44
44
|
},
|
|
45
|
+
"@media (pointer: coarse), (any-pointer: coarse)": {
|
|
46
|
+
"&:hover": {
|
|
47
|
+
backgroundColor: e.alpha[10]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
45
50
|
"&:active": {
|
|
46
51
|
transform: "scale(0.9)",
|
|
47
52
|
backgroundColor: e.alpha[30]
|
|
48
53
|
},
|
|
49
54
|
"&:disabled": {
|
|
50
|
-
backgroundColor:
|
|
55
|
+
backgroundColor: r === "dark" ? e.alpha[10] : e.alpha[5],
|
|
51
56
|
color: o[500],
|
|
52
57
|
cursor: "not-allowed"
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
break;
|
|
56
61
|
case "text":
|
|
57
|
-
Object.assign(
|
|
62
|
+
Object.assign(a, {
|
|
58
63
|
backgroundColor: "transparent",
|
|
59
|
-
color:
|
|
64
|
+
color: r === "dark" ? o[800] : o[700],
|
|
60
65
|
// 기본 텍스트 색상 (더 강조된 중립색)
|
|
61
66
|
"& svg": {
|
|
62
|
-
color:
|
|
67
|
+
color: r === "dark" ? o[800] : o[700]
|
|
63
68
|
},
|
|
64
69
|
"&:hover": {
|
|
65
70
|
backgroundColor: o[200]
|
|
66
71
|
},
|
|
72
|
+
"@media (pointer: coarse), (any-pointer: coarse)": {
|
|
73
|
+
"&:hover": {
|
|
74
|
+
backgroundColor: "transparent"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
67
77
|
"&:active": {
|
|
68
78
|
transform: "scale(0.9)",
|
|
69
79
|
backgroundColor: o[300]
|
|
@@ -77,19 +87,24 @@ const h = u.button`
|
|
|
77
87
|
});
|
|
78
88
|
break;
|
|
79
89
|
default:
|
|
80
|
-
if (
|
|
81
|
-
Object.assign(
|
|
82
|
-
backgroundColor:
|
|
83
|
-
color:
|
|
90
|
+
if (f === "secondary") {
|
|
91
|
+
Object.assign(a, {
|
|
92
|
+
backgroundColor: t.main,
|
|
93
|
+
color: r === "dark" ? o[900] : o[700],
|
|
84
94
|
"& svg": {
|
|
85
|
-
color:
|
|
95
|
+
color: r === "dark" ? o[900] : o[700]
|
|
86
96
|
},
|
|
87
97
|
"&:hover": {
|
|
88
|
-
backgroundColor:
|
|
98
|
+
backgroundColor: t.light
|
|
99
|
+
},
|
|
100
|
+
"@media (pointer: coarse), (any-pointer: coarse)": {
|
|
101
|
+
"&:hover": {
|
|
102
|
+
backgroundColor: t.main
|
|
103
|
+
}
|
|
89
104
|
},
|
|
90
105
|
"&:active": {
|
|
91
106
|
transform: "scale(0.9)",
|
|
92
|
-
backgroundColor:
|
|
107
|
+
backgroundColor: t.dark
|
|
93
108
|
},
|
|
94
109
|
"&:disabled": {
|
|
95
110
|
backgroundColor: o[200],
|
|
@@ -99,15 +114,20 @@ const h = u.button`
|
|
|
99
114
|
});
|
|
100
115
|
break;
|
|
101
116
|
}
|
|
102
|
-
Object.assign(
|
|
117
|
+
Object.assign(a, {
|
|
103
118
|
backgroundColor: e.main,
|
|
104
|
-
color:
|
|
119
|
+
color: r === "dark" ? o[900] : t.main,
|
|
105
120
|
"& svg": {
|
|
106
|
-
color:
|
|
121
|
+
color: r === "dark" ? o[900] : t.main
|
|
107
122
|
},
|
|
108
123
|
"&:hover": {
|
|
109
124
|
backgroundColor: e.hover
|
|
110
125
|
},
|
|
126
|
+
"@media (pointer: coarse), (any-pointer: coarse)": {
|
|
127
|
+
"&:hover": {
|
|
128
|
+
backgroundColor: e.main
|
|
129
|
+
}
|
|
130
|
+
},
|
|
111
131
|
"&:active": {
|
|
112
132
|
transform: "scale(0.9)",
|
|
113
133
|
backgroundColor: e.active
|
|
@@ -120,10 +140,10 @@ const h = u.button`
|
|
|
120
140
|
});
|
|
121
141
|
break;
|
|
122
142
|
}
|
|
123
|
-
switch (
|
|
143
|
+
switch (k) {
|
|
124
144
|
case "large":
|
|
125
|
-
Object.assign(
|
|
126
|
-
padding: `${
|
|
145
|
+
Object.assign(a, {
|
|
146
|
+
padding: `${s[300]} ${s[350]}`,
|
|
127
147
|
borderRadius: l[300],
|
|
128
148
|
fontSize: d.fontSize,
|
|
129
149
|
lineHeight: d.lineHeight,
|
|
@@ -134,8 +154,8 @@ const h = u.button`
|
|
|
134
154
|
});
|
|
135
155
|
break;
|
|
136
156
|
case "small":
|
|
137
|
-
Object.assign(
|
|
138
|
-
padding: `${
|
|
157
|
+
Object.assign(a, {
|
|
158
|
+
padding: `${s[100]} ${s[150]}`,
|
|
139
159
|
borderRadius: l[200],
|
|
140
160
|
fontSize: n.fontSize,
|
|
141
161
|
lineHeight: n.lineHeight,
|
|
@@ -146,57 +166,57 @@ const h = u.button`
|
|
|
146
166
|
});
|
|
147
167
|
break;
|
|
148
168
|
case "xSmall":
|
|
149
|
-
Object.assign(
|
|
150
|
-
padding: `${
|
|
169
|
+
Object.assign(a, {
|
|
170
|
+
padding: `${s[50]} ${s[100]}`,
|
|
151
171
|
borderRadius: l[150],
|
|
152
|
-
fontSize:
|
|
153
|
-
lineHeight:
|
|
172
|
+
fontSize: c.fontSize,
|
|
173
|
+
lineHeight: c.lineHeight,
|
|
154
174
|
"& svg": {
|
|
155
|
-
width:
|
|
156
|
-
height:
|
|
175
|
+
width: c.fontSize,
|
|
176
|
+
height: c.fontSize
|
|
157
177
|
}
|
|
158
178
|
});
|
|
159
179
|
break;
|
|
160
180
|
default:
|
|
161
|
-
Object.assign(
|
|
162
|
-
padding: `${
|
|
181
|
+
Object.assign(a, {
|
|
182
|
+
padding: `${s[200]} ${s[250]}`,
|
|
163
183
|
borderRadius: l[250],
|
|
164
|
-
fontSize:
|
|
165
|
-
lineHeight:
|
|
184
|
+
fontSize: i.fontSize,
|
|
185
|
+
lineHeight: i.lineHeight,
|
|
166
186
|
"& svg": {
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
187
|
+
width: i.fontSize,
|
|
188
|
+
height: i.fontSize
|
|
169
189
|
}
|
|
170
190
|
});
|
|
171
191
|
break;
|
|
172
192
|
}
|
|
173
|
-
return
|
|
193
|
+
return a;
|
|
174
194
|
}}
|
|
175
195
|
`;
|
|
176
|
-
function
|
|
177
|
-
ref:
|
|
196
|
+
function S({
|
|
197
|
+
ref: r,
|
|
178
198
|
children: e,
|
|
179
|
-
variant:
|
|
199
|
+
variant: t = "filled",
|
|
180
200
|
size: o = "medium",
|
|
181
201
|
color: d = "primary",
|
|
182
|
-
startIcon:
|
|
202
|
+
startIcon: i,
|
|
183
203
|
endIcon: n,
|
|
184
|
-
...
|
|
204
|
+
...c
|
|
185
205
|
}) {
|
|
186
|
-
return
|
|
187
|
-
|
|
206
|
+
return t === "text" ? /* @__PURE__ */ g(h, { ref: r, variant: "text", size: o, color: "secondary", ...c, children: [
|
|
207
|
+
i,
|
|
188
208
|
e,
|
|
189
209
|
n
|
|
190
|
-
] }) :
|
|
191
|
-
|
|
210
|
+
] }) : t === "ghost" ? /* @__PURE__ */ g(h, { ref: r, variant: "ghost", size: o, color: "primary", ...c, children: [
|
|
211
|
+
i,
|
|
192
212
|
e,
|
|
193
213
|
n
|
|
194
|
-
] }) : /* @__PURE__ */ g(h, { ref:
|
|
195
|
-
|
|
214
|
+
] }) : /* @__PURE__ */ g(h, { ref: r, variant: t, size: o, color: d, ...c, children: [
|
|
215
|
+
i,
|
|
196
216
|
e,
|
|
197
217
|
n
|
|
198
218
|
] });
|
|
199
219
|
}
|
|
200
220
|
export {
|
|
201
|
-
|
|
221
|
+
S as default
|
|
202
222
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import p from "basic-styled";
|
|
3
|
+
import b from "../../utils/getUtilityProps.mjs";
|
|
4
|
+
import r from "../../utils/getValueByPath.mjs";
|
|
5
|
+
const f = p.div`
|
|
6
6
|
transition:
|
|
7
7
|
font-size 0.2s,
|
|
8
8
|
line-height 0.2s,
|
|
@@ -11,19 +11,23 @@ const h = b.div`
|
|
|
11
11
|
border-color 0.2s,
|
|
12
12
|
color 0.2s;
|
|
13
13
|
|
|
14
|
-
${({ theme: { typography: o, palette:
|
|
15
|
-
const { fontSize: a, lineHeight: c } = o[s || "body2"],
|
|
14
|
+
${({ theme: { typography: o, palette: t }, variant: s, color: n, fontWeight: l, borderColor: i, ...d }) => {
|
|
15
|
+
const { fontSize: a, lineHeight: c } = o[s || "body2"], e = {
|
|
16
16
|
fontSize: a,
|
|
17
17
|
lineHeight: c,
|
|
18
18
|
fontWeight: l
|
|
19
19
|
};
|
|
20
|
-
return Object.assign(
|
|
21
|
-
borderColor:
|
|
22
|
-
}), Object.assign(
|
|
23
|
-
color:
|
|
24
|
-
}),
|
|
20
|
+
return Object.assign(e, b(d)), i && Object.assign(e, {
|
|
21
|
+
borderColor: r(t, i) || "inherit"
|
|
22
|
+
}), Object.assign(e, {
|
|
23
|
+
color: r(t, n) || "inherit"
|
|
24
|
+
}), e;
|
|
25
25
|
}};
|
|
26
26
|
|
|
27
|
+
${({ textAlign: o }) => o ? {
|
|
28
|
+
textAlign: o
|
|
29
|
+
} : {}};
|
|
30
|
+
|
|
27
31
|
${({ noWrap: o }) => o ? {
|
|
28
32
|
whiteSpace: "nowrap",
|
|
29
33
|
overflow: "hidden",
|
|
@@ -36,7 +40,7 @@ const h = b.div`
|
|
|
36
40
|
"-webkit-line-clamp": o,
|
|
37
41
|
"-webkit-box-orient": "vertical"
|
|
38
42
|
} : {}};
|
|
39
|
-
`, u = (o) => /* @__PURE__ */
|
|
43
|
+
`, u = (o) => /* @__PURE__ */ h(f, { ...o });
|
|
40
44
|
export {
|
|
41
45
|
u as default
|
|
42
46
|
};
|