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