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