@shiflo/ui 0.0.4 → 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 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
  };
@@ -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: a, small1: n, small2: s },
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: n.fontSize,
141
- lineHeight: n.lineHeight,
146
+ fontSize: a.fontSize,
147
+ lineHeight: a.lineHeight,
142
148
  "& svg": {
143
- width: n.fontSize,
144
- height: n.fontSize
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: a.fontSize,
165
- lineHeight: a.lineHeight,
170
+ fontSize: n.fontSize,
171
+ lineHeight: n.lineHeight,
166
172
  "& svg": {
167
- width: a.fontSize,
168
- height: a.fontSize
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: a,
183
- endIcon: n,
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
- a,
193
+ n,
188
194
  e,
189
- n
195
+ a
190
196
  ] }) : r === "ghost" ? /* @__PURE__ */ g(h, { ref: t, variant: "ghost", size: o, color: "primary", ...s, children: [
191
- a,
197
+ n,
192
198
  e,
193
- n
199
+ a
194
200
  ] }) : /* @__PURE__ */ g(h, { ref: t, variant: r, size: o, color: d, ...s, children: [
195
- a,
201
+ n,
196
202
  e,
197
- n
203
+ a
198
204
  ] });
199
205
  }
200
206
  export {
@@ -1,27 +1,30 @@
1
- import { jsx as h } from "react/jsx-runtime";
2
- import { Children as l, isValidElement as p } from "react";
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Children as p, isValidElement as l } from "react";
3
3
  import { S as a } from "../../assets/icons/index.ts-BL4wFg6B.js";
4
4
  import c from "basic-styled";
5
- import f from "../../utils/getValueByPath.mjs";
6
- const d = c.svg`
5
+ import d from "../../utils/getValueByPath.mjs";
6
+ const f = c.svg`
7
7
  transition:
8
8
  width 0.2s,
9
9
  height 0.2s,
10
10
  color 0.2s;
11
- color: ${({ theme: { palette: o }, color: r }) => f(o, r || "") || "inherit"};
11
+
12
+ width: ${({ width: t }) => t || "24px"};
13
+ height: ${({ height: t }) => t || "24px"};
14
+ color: ${({ theme: { palette: t }, color: r }) => d(t, r || "") || "inherit"};
12
15
  `;
13
- function y({ ref: o, name: r, width: i = 24, height: n = 24, ...s }) {
14
- const m = a[r];
15
- return l.map(m(), (e) => {
16
- if (!p(e))
16
+ function v({ ref: t, name: r, width: e = 24, height: n = 24, ...s }) {
17
+ const h = a[r];
18
+ return p.map(h(), (i) => {
19
+ if (!l(i))
17
20
  return null;
18
- const t = {
21
+ const o = {
19
22
  ...s,
20
- ...e.props
23
+ ...i.props
21
24
  };
22
- return t.width = i ?? t.width, t.height = n ?? t.height, /* @__PURE__ */ h(d, { ref: o, ...t });
25
+ return o.width = e ?? o.width, o.height = n ?? o.height, /* @__PURE__ */ m(f, { ref: t, ...o });
23
26
  });
24
27
  }
25
28
  export {
26
- y as default
29
+ v as default
27
30
  };
@@ -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
  };
@@ -1,7 +1,7 @@
1
- import g from "../theme/radius.mjs";
1
+ import a from "../theme/radius.mjs";
2
2
  import s from "../theme/spacing.mjs";
3
3
  function Q({
4
- display: a,
4
+ display: g,
5
5
  flex: t,
6
6
  flexBasis: n,
7
7
  flexDirection: c,
@@ -11,30 +11,30 @@ function Q({
11
11
  flexWrap: e,
12
12
  justifyContent: b,
13
13
  alignItems: d,
14
- m: R,
15
- mt: o,
14
+ m: o,
15
+ mt: R,
16
16
  mr: u,
17
17
  mb: p,
18
18
  ml: h,
19
- p: L,
20
- pt: T,
21
- pr: m,
19
+ p: m,
20
+ pt: L,
21
+ pr: T,
22
22
  pb: r,
23
- pl: P,
24
- border: U,
25
- borderTop: q,
26
- borderBottom: v,
27
- borderRight: y,
28
- borderLeft: z,
29
- br: A,
30
- brtl: B,
23
+ pl: B,
24
+ border: P,
25
+ borderTop: U,
26
+ borderBottom: q,
27
+ borderRight: v,
28
+ borderLeft: y,
29
+ br: z,
30
+ brtl: A,
31
31
  brtr: E,
32
32
  brml: H,
33
33
  brmr: J,
34
34
  gap: K
35
35
  }) {
36
36
  const i = {};
37
- return a && Object.assign(i, { display: a }), t && Object.assign(i, { flex: t }), n && Object.assign(i, { flexBasis: n }), c && Object.assign(i, { flexDirection: c }), O && Object.assign(i, { flexFlow: O }), f && Object.assign(i, { flexGrow: f }), j && Object.assign(i, { flexShrink: j }), e && Object.assign(i, { flexWrap: e }), b && Object.assign(i, { justifyContent: b }), d && Object.assign(i, { alignItems: d }), R && Object.assign(i, { margin: s[R] }), o && Object.assign(i, { marginTop: s[o] }), p && Object.assign(i, { marginRight: s[p] }), h && Object.assign(i, { marginLeft: s[h] }), u && Object.assign(i, { marginRight: s[u] }), L && Object.assign(i, { padding: s[L] }), T && Object.assign(i, { paddingTop: s[T] }), r && Object.assign(i, { paddingRight: s[r] }), P && Object.assign(i, { paddingLeft: s[P] }), m && Object.assign(i, { paddingRight: s[m] }), K && Object.assign(i, { gap: s[K] }), U && Object.assign(i, { border: U }), q && Object.assign(i, { borderTop: q }), v && Object.assign(i, { borderBottom: v }), y && Object.assign(i, { borderRight: y }), z && Object.assign(i, { borderLeft: z }), A && Object.assign(i, { borderRadius: g[A] }), B && Object.assign(i, { borderTopLeftRadius: g[B] }), E && Object.assign(i, { borderTopRightRadius: g[E] }), H && Object.assign(i, { borderBottomLeftRadius: g[H] }), J && Object.assign(i, { borderBottomRightRadius: g[J] }), i;
37
+ return g && Object.assign(i, { display: g }), t && Object.assign(i, { flex: t }), n && Object.assign(i, { flexBasis: n }), c && Object.assign(i, { flexDirection: c }), O && Object.assign(i, { flexFlow: O }), f && Object.assign(i, { flexGrow: f }), j && Object.assign(i, { flexShrink: j }), e && Object.assign(i, { flexWrap: e }), b && Object.assign(i, { justifyContent: b }), d && Object.assign(i, { alignItems: d }), o && Object.assign(i, { margin: s[o] }), R && Object.assign(i, { marginTop: s[R] }), p && Object.assign(i, { marginRight: s[p] }), h && Object.assign(i, { marginLeft: s[h] }), u && Object.assign(i, { marginRight: s[u] }), m && Object.assign(i, { padding: s[m] }), L && Object.assign(i, { paddingTop: s[L] }), r && Object.assign(i, { paddingBottom: s[r] }), B && Object.assign(i, { paddingLeft: s[B] }), T && Object.assign(i, { paddingRight: s[T] }), K && Object.assign(i, { gap: s[K] }), P && Object.assign(i, { border: P }), U && Object.assign(i, { borderTop: U }), q && Object.assign(i, { borderBottom: q }), v && Object.assign(i, { borderRight: v }), y && Object.assign(i, { borderLeft: y }), z && Object.assign(i, { borderRadius: a[z] }), A && Object.assign(i, { borderTopLeftRadius: a[A] }), E && Object.assign(i, { borderTopRightRadius: a[E] }), H && Object.assign(i, { borderBottomLeftRadius: a[H] }), J && Object.assign(i, { borderBottomRightRadius: a[J] }), i;
38
38
  }
39
39
  export {
40
40
  Q as default
@@ -1,6 +1,6 @@
1
1
  function i(t, e = "") {
2
2
  if (e)
3
- return e.split(".").reduce((r, u) => r && r[u], t) || e;
3
+ return e.split(".").reduce((r, u) => r && r[u], t) || e || void 0;
4
4
  }
5
5
  export {
6
6
  i as default
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",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"