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