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