@shiflo/ui 0.0.5 → 0.0.6
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
|
|
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:
|
|
14
|
-
const
|
|
15
|
-
return Object.assign(
|
|
16
|
-
backgroundColor:
|
|
17
|
-
}),
|
|
18
|
-
borderColor:
|
|
19
|
-
}), e && Object.assign(
|
|
20
|
-
color:
|
|
21
|
-
}),
|
|
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
|
-
`,
|
|
23
|
+
`, h = (r) => /* @__PURE__ */ c(m, { ...r });
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
h as default
|
|
26
26
|
};
|
|
@@ -18,11 +18,17 @@ 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
|
+
|
|
21
27
|
${({
|
|
22
28
|
theme: {
|
|
23
29
|
mode: t,
|
|
24
30
|
palette: { primary: e, secondary: r, neutral: o },
|
|
25
|
-
typography: { body1: d, body2:
|
|
31
|
+
typography: { body1: d, body2: n, small1: a, small2: s },
|
|
26
32
|
spacing: c,
|
|
27
33
|
radius: l
|
|
28
34
|
},
|
|
@@ -137,11 +143,11 @@ const h = u.button`
|
|
|
137
143
|
Object.assign(i, {
|
|
138
144
|
padding: `${c[100]} ${c[150]}`,
|
|
139
145
|
borderRadius: l[200],
|
|
140
|
-
fontSize:
|
|
141
|
-
lineHeight:
|
|
146
|
+
fontSize: a.fontSize,
|
|
147
|
+
lineHeight: a.lineHeight,
|
|
142
148
|
"& svg": {
|
|
143
|
-
width:
|
|
144
|
-
height:
|
|
149
|
+
width: a.fontSize,
|
|
150
|
+
height: a.fontSize
|
|
145
151
|
}
|
|
146
152
|
});
|
|
147
153
|
break;
|
|
@@ -161,11 +167,11 @@ const h = u.button`
|
|
|
161
167
|
Object.assign(i, {
|
|
162
168
|
padding: `${c[200]} ${c[250]}`,
|
|
163
169
|
borderRadius: l[250],
|
|
164
|
-
fontSize:
|
|
165
|
-
lineHeight:
|
|
170
|
+
fontSize: n.fontSize,
|
|
171
|
+
lineHeight: n.lineHeight,
|
|
166
172
|
"& svg": {
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
173
|
+
width: n.fontSize,
|
|
174
|
+
height: n.fontSize
|
|
169
175
|
}
|
|
170
176
|
});
|
|
171
177
|
break;
|
|
@@ -179,22 +185,22 @@ function C({
|
|
|
179
185
|
variant: r = "filled",
|
|
180
186
|
size: o = "medium",
|
|
181
187
|
color: d = "primary",
|
|
182
|
-
startIcon:
|
|
183
|
-
endIcon:
|
|
188
|
+
startIcon: n,
|
|
189
|
+
endIcon: a,
|
|
184
190
|
...s
|
|
185
191
|
}) {
|
|
186
192
|
return r === "text" ? /* @__PURE__ */ g(h, { ref: t, variant: "text", size: o, color: "secondary", ...s, children: [
|
|
187
|
-
|
|
193
|
+
n,
|
|
188
194
|
e,
|
|
189
|
-
|
|
195
|
+
a
|
|
190
196
|
] }) : r === "ghost" ? /* @__PURE__ */ g(h, { ref: t, variant: "ghost", size: o, color: "primary", ...s, children: [
|
|
191
|
-
|
|
197
|
+
n,
|
|
192
198
|
e,
|
|
193
|
-
|
|
199
|
+
a
|
|
194
200
|
] }) : /* @__PURE__ */ g(h, { ref: t, variant: r, size: o, color: d, ...s, children: [
|
|
195
|
-
|
|
201
|
+
n,
|
|
196
202
|
e,
|
|
197
|
-
|
|
203
|
+
a
|
|
198
204
|
] });
|
|
199
205
|
}
|
|
200
206
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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:
|
|
15
|
-
const { fontSize: a, lineHeight: c } = o[s || "body2"],
|
|
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(
|
|
21
|
-
borderColor:
|
|
22
|
-
}), Object.assign(
|
|
23
|
-
color:
|
|
24
|
-
}),
|
|
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__ */
|
|
43
|
+
`, u = (o) => /* @__PURE__ */ h(f, { ...o });
|
|
40
44
|
export {
|
|
41
45
|
u as default
|
|
42
46
|
};
|