@cronocode/react-box 1.3.3 → 1.3.5

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.
package/theme.mjs CHANGED
@@ -1,27 +1,76 @@
1
- import { useMemo as c } from "react";
2
- let m = {};
1
+ import { useMemo as y } from "react";
2
+ const r = {
3
+ button: {
4
+ styles: {
5
+ inline: !0,
6
+ p: 3,
7
+ cursor: "pointer",
8
+ b: 1,
9
+ borderRadius: 1
10
+ },
11
+ disabled: {
12
+ cursor: "default"
13
+ }
14
+ },
15
+ checkbox: {
16
+ styles: {
17
+ inline: !0,
18
+ b: 1,
19
+ p: 2
20
+ }
21
+ },
22
+ radioButton: {
23
+ styles: {
24
+ inline: !0,
25
+ b: 1,
26
+ p: 2
27
+ }
28
+ },
29
+ textbox: {
30
+ styles: {
31
+ inline: !0,
32
+ b: 1,
33
+ borderRadius: 1,
34
+ p: 3
35
+ }
36
+ },
37
+ textarea: {
38
+ styles: {
39
+ inline: !0,
40
+ b: 1,
41
+ borderRadius: 1
42
+ }
43
+ }
44
+ };
45
+ let n = r;
3
46
  var u;
4
- ((l) => {
5
- function s(n) {
6
- m = n;
47
+ ((d) => {
48
+ function i(t) {
49
+ n = t, o();
50
+ }
51
+ d.setup = i;
52
+ function o() {
53
+ Object.keys(r).forEach((s) => {
54
+ const e = n[s], l = r[s];
55
+ e ? (e.styles = { ...l.styles, ...e.styles }, e.disabled && l.disabled && (e.disabled = { ...l.disabled, ...e.disabled })) : n[s] = r[s];
56
+ });
7
57
  }
8
- l.setup = s;
9
58
  })(u || (u = {}));
10
- const h = u;
11
- function p(l) {
12
- const { clean: s, disabled: n, theme: t, component: o } = l;
13
- return c(() => {
14
- var i, d, a;
15
- if (s)
59
+ const m = u;
60
+ function p(d) {
61
+ const { clean: i, disabled: o, theme: t, component: s } = d;
62
+ return y(() => {
63
+ var a, b, c;
64
+ if (i)
16
65
  return {};
17
- let e = m[o] ?? ((i = m.components) == null ? void 0 : i[o]);
66
+ let e = n[s] ?? ((a = n.components) == null ? void 0 : a[s]);
18
67
  if (!e)
19
68
  return {};
20
- let r = t ? { ...e.styles, ...(d = e.themes) == null ? void 0 : d[t].styles } : e.styles;
21
- return n ? t ? { ...r, ...e.disabled, ...(a = e.themes) == null ? void 0 : a[t].disabled } : { ...r, ...e.disabled } : r;
22
- }, [o, s, n, t]);
69
+ let l = t ? { ...e.styles, ...(b = e.themes) == null ? void 0 : b[t].styles } : e.styles;
70
+ return o ? t ? { ...l, ...e.disabled, ...(c = e.themes) == null ? void 0 : c[t].disabled } : { ...l, ...e.disabled } : l;
71
+ }, [s, i, o, t]);
23
72
  }
24
73
  export {
25
- h as default,
74
+ m as default,
26
75
  p as useTheme
27
76
  };
package/types.d.ts CHANGED
@@ -195,10 +195,14 @@ interface BoxText {
195
195
  interface BoxFlex {
196
196
  flexWrap?: (typeof styleVariables.flexWrap)[number];
197
197
  justifyContent?: (typeof styleVariables.justifyContent)[number];
198
+ jc?: (typeof styleVariables.justifyContent)[number];
198
199
  alignItems?: (typeof styleVariables.alignItems)[number];
200
+ ai?: (typeof styleVariables.alignItems)[number];
199
201
  alignContent?: (typeof styleVariables.alignContent)[number];
202
+ ac?: (typeof styleVariables.alignContent)[number];
200
203
  flex1?: boolean;
201
204
  flexDirection?: (typeof styleVariables.flexDirection)[number];
205
+ d?: (typeof styleVariables.flexDirection)[number];
202
206
  gap?: GapType;
203
207
  rowGap?: GapType;
204
208
  columnGap?: GapType;