@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: t } }) => t[100]};
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: t,
30
- palette: { primary: e, secondary: r, neutral: o },
31
- typography: { body1: d, body2: n, small1: a, small2: s },
32
- spacing: c,
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: f,
37
- color: k
30
+ size: k,
31
+ color: f
38
32
  }) => {
39
- const i = {};
33
+ const a = {};
40
34
  switch (b) {
41
35
  case "ghost":
42
- Object.assign(i, {
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: t === "dark" ? e.alpha[10] : e.alpha[5],
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(i, {
62
+ Object.assign(a, {
64
63
  backgroundColor: "transparent",
65
- color: t === "dark" ? o[800] : o[700],
64
+ color: r === "dark" ? o[800] : o[700],
66
65
  // 기본 텍스트 색상 (더 강조된 중립색)
67
66
  "& svg": {
68
- color: t === "dark" ? o[800] : o[700]
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 (k === "secondary") {
87
- Object.assign(i, {
88
- backgroundColor: r.main,
89
- color: t === "dark" ? o[900] : o[700],
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: t === "dark" ? o[900] : o[700]
95
+ color: r === "dark" ? o[900] : o[700]
92
96
  },
93
97
  "&:hover": {
94
- backgroundColor: r.light
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: r.dark
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(i, {
117
+ Object.assign(a, {
109
118
  backgroundColor: e.main,
110
- color: t === "dark" ? o[900] : r.main,
119
+ color: r === "dark" ? o[900] : t.main,
111
120
  "& svg": {
112
- color: t === "dark" ? o[900] : r.main
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 (f) {
143
+ switch (k) {
130
144
  case "large":
131
- Object.assign(i, {
132
- padding: `${c[300]} ${c[350]}`,
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(i, {
144
- padding: `${c[100]} ${c[150]}`,
157
+ Object.assign(a, {
158
+ padding: `${s[100]} ${s[150]}`,
145
159
  borderRadius: l[200],
146
- fontSize: a.fontSize,
147
- lineHeight: a.lineHeight,
160
+ fontSize: n.fontSize,
161
+ lineHeight: n.lineHeight,
148
162
  "& svg": {
149
- width: a.fontSize,
150
- height: a.fontSize
163
+ width: n.fontSize,
164
+ height: n.fontSize
151
165
  }
152
166
  });
153
167
  break;
154
168
  case "xSmall":
155
- Object.assign(i, {
156
- padding: `${c[50]} ${c[100]}`,
169
+ Object.assign(a, {
170
+ padding: `${s[50]} ${s[100]}`,
157
171
  borderRadius: l[150],
158
- fontSize: s.fontSize,
159
- lineHeight: s.lineHeight,
172
+ fontSize: c.fontSize,
173
+ lineHeight: c.lineHeight,
160
174
  "& svg": {
161
- width: s.fontSize,
162
- height: s.fontSize
175
+ width: c.fontSize,
176
+ height: c.fontSize
163
177
  }
164
178
  });
165
179
  break;
166
180
  default:
167
- Object.assign(i, {
168
- padding: `${c[200]} ${c[250]}`,
181
+ Object.assign(a, {
182
+ padding: `${s[200]} ${s[250]}`,
169
183
  borderRadius: l[250],
170
- fontSize: n.fontSize,
171
- lineHeight: n.lineHeight,
184
+ fontSize: i.fontSize,
185
+ lineHeight: i.lineHeight,
172
186
  "& svg": {
173
- width: n.fontSize,
174
- height: n.fontSize
187
+ width: i.fontSize,
188
+ height: i.fontSize
175
189
  }
176
190
  });
177
191
  break;
178
192
  }
179
- return i;
193
+ return a;
180
194
  }}
181
195
  `;
182
- function C({
183
- ref: t,
196
+ function S({
197
+ ref: r,
184
198
  children: e,
185
- variant: r = "filled",
199
+ variant: t = "filled",
186
200
  size: o = "medium",
187
201
  color: d = "primary",
188
- startIcon: n,
189
- endIcon: a,
190
- ...s
202
+ startIcon: i,
203
+ endIcon: n,
204
+ ...c
191
205
  }) {
192
- return r === "text" ? /* @__PURE__ */ g(h, { ref: t, variant: "text", size: o, color: "secondary", ...s, children: [
193
- n,
206
+ return t === "text" ? /* @__PURE__ */ g(h, { ref: r, variant: "text", size: o, color: "secondary", ...c, children: [
207
+ i,
194
208
  e,
195
- a
196
- ] }) : r === "ghost" ? /* @__PURE__ */ g(h, { ref: t, variant: "ghost", size: o, color: "primary", ...s, children: [
197
- n,
209
+ n
210
+ ] }) : t === "ghost" ? /* @__PURE__ */ g(h, { ref: r, variant: "ghost", size: o, color: "primary", ...c, children: [
211
+ i,
198
212
  e,
199
- a
200
- ] }) : /* @__PURE__ */ g(h, { ref: t, variant: r, size: o, color: d, ...s, children: [
201
- n,
213
+ n
214
+ ] }) : /* @__PURE__ */ g(h, { ref: r, variant: t, size: o, color: d, ...c, children: [
215
+ i,
202
216
  e,
203
- a
217
+ n
204
218
  ] });
205
219
  }
206
220
  export {
207
- C as default
221
+ S as default
208
222
  };
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.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"