@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 u from "basic-styled";
3
- const h = u.button`
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: 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,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: 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: 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
- "&:hover": {
49
- backgroundColor: e.alpha[20]
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: t === "dark" ? e.alpha[10] : e.alpha[5],
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: t === "dark" ? o[800] : o[700],
61
+ color: r === "dark" ? o[800] : o[700],
66
62
  // 기본 텍스트 색상 (더 강조된 중립색)
67
63
  "& svg": {
68
- color: t === "dark" ? o[800] : o[700]
64
+ color: r === "dark" ? o[800] : o[700]
69
65
  },
70
- "&:hover": {
71
- backgroundColor: o[200]
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: r.main,
89
- color: t === "dark" ? o[900] : o[700],
86
+ backgroundColor: t.main,
87
+ color: r === "dark" ? o[900] : o[700],
90
88
  "& svg": {
91
- color: t === "dark" ? o[900] : o[700]
89
+ color: r === "dark" ? o[900] : o[700]
92
90
  },
93
- "&:hover": {
94
- backgroundColor: r.light
91
+ "@media (hover: hover)": {
92
+ "&:hover": {
93
+ backgroundColor: t.light
94
+ }
95
95
  },
96
96
  "&:active": {
97
97
  transform: "scale(0.9)",
98
- backgroundColor: r.dark
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: t === "dark" ? o[900] : r.main,
110
+ color: r === "dark" ? o[900] : t.main,
111
111
  "& svg": {
112
- color: t === "dark" ? o[900] : r.main
112
+ color: r === "dark" ? o[900] : t.main
113
113
  },
114
- "&:hover": {
115
- backgroundColor: e.hover
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: `${c[300]} ${c[350]}`,
134
+ padding: `${s[300]} ${s[350]}`,
133
135
  borderRadius: l[300],
134
- fontSize: d.fontSize,
135
- lineHeight: d.lineHeight,
136
+ fontSize: c.fontSize,
137
+ lineHeight: c.lineHeight,
136
138
  "& svg": {
137
- width: d.fontSize,
138
- height: d.fontSize
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: `${c[100]} ${c[150]}`,
146
+ padding: `${s[100]} ${s[150]}`,
145
147
  borderRadius: l[200],
146
- fontSize: a.fontSize,
147
- lineHeight: a.lineHeight,
148
+ fontSize: n.fontSize,
149
+ lineHeight: n.lineHeight,
148
150
  "& svg": {
149
- width: a.fontSize,
150
- height: a.fontSize
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: `${c[50]} ${c[100]}`,
158
+ padding: `${s[50]} ${s[100]}`,
157
159
  borderRadius: l[150],
158
- fontSize: s.fontSize,
159
- lineHeight: s.lineHeight,
160
+ fontSize: d.fontSize,
161
+ lineHeight: d.lineHeight,
160
162
  "& svg": {
161
- width: s.fontSize,
162
- height: s.fontSize
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: `${c[200]} ${c[250]}`,
170
+ padding: `${s[200]} ${s[250]}`,
169
171
  borderRadius: l[250],
170
- fontSize: n.fontSize,
171
- lineHeight: n.lineHeight,
172
+ fontSize: a.fontSize,
173
+ lineHeight: a.lineHeight,
172
174
  "& svg": {
173
- width: n.fontSize,
174
- height: n.fontSize
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: t,
185
+ ref: r,
184
186
  children: e,
185
- variant: r = "filled",
187
+ variant: t = "filled",
186
188
  size: o = "medium",
187
- color: d = "primary",
188
- startIcon: n,
189
- endIcon: a,
190
- ...s
189
+ color: c = "primary",
190
+ startIcon: a,
191
+ endIcon: n,
192
+ ...d
191
193
  }) {
192
- return r === "text" ? /* @__PURE__ */ g(h, { ref: t, variant: "text", size: o, color: "secondary", ...s, children: [
193
- n,
194
+ return t === "text" ? /* @__PURE__ */ g(h, { ref: r, variant: "text", size: o, color: "secondary", ...d, children: [
195
+ a,
194
196
  e,
195
- a
196
- ] }) : r === "ghost" ? /* @__PURE__ */ g(h, { ref: t, variant: "ghost", size: o, color: "primary", ...s, children: [
197
- n,
197
+ n
198
+ ] }) : t === "ghost" ? /* @__PURE__ */ g(h, { ref: r, variant: "ghost", size: o, color: "primary", ...d, children: [
199
+ a,
198
200
  e,
199
- a
200
- ] }) : /* @__PURE__ */ g(h, { ref: t, variant: r, size: o, color: d, ...s, children: [
201
- n,
201
+ n
202
+ ] }) : /* @__PURE__ */ g(h, { ref: r, variant: t, size: o, color: c, ...d, children: [
203
+ a,
202
204
  e,
203
- a
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.6",
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.10",
88
+ "basic-styled": ">=0.1.11",
89
89
  "react": "^19.0.0",
90
90
  "react-dom": "^19.0.0"
91
91
  },