@cronocode/react-box 1.0.8 → 1.1.0

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/types.d.ts CHANGED
@@ -37,6 +37,7 @@ export declare const styleVariables: {
37
37
  flexShrink: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
38
38
  flexSelf: readonly ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
39
39
  outlineOffset: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
40
+ transition: readonly ["none"];
40
41
  };
41
42
  declare type GapType = (typeof styleVariables.gap)[number];
42
43
  declare type BoxSizeValue = (typeof styleVariables.sizeSpecialValues)[number];
@@ -53,6 +54,7 @@ declare type TextDecorationType = (typeof styleVariables.textDecoration)[number]
53
54
  declare type TextTransformType = (typeof styleVariables.textTransform)[number];
54
55
  declare type TextAlignType = (typeof styleVariables.textAlign)[number];
55
56
  declare type BorderAndOutlineStyleType = (typeof styleVariables.borderAndOutlineStyles)[number];
57
+ declare type TransitionType = (typeof styleVariables.transition)[number];
56
58
  interface BoxPseudoClasses {
57
59
  hover?: boolean;
58
60
  focus?: boolean;
@@ -198,7 +200,10 @@ interface BoxFlex {
198
200
  alignSelf?: (typeof styleVariables.flexSelf)[number];
199
201
  justifySelf?: (typeof styleVariables.flexSelf)[number];
200
202
  }
201
- declare type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline;
203
+ interface BoxTransition {
204
+ transition?: TransitionType;
205
+ }
206
+ declare type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition;
202
207
  export declare type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
203
208
  export declare const themeClasses: Array<keyof BoxStyles>;
204
209
  export {};
@@ -1,5 +1,5 @@
1
1
  declare namespace ClassNameUtils {
2
- type ClassNameType = string | string[] | Record<string, boolean> | ClassNameType[];
2
+ type ClassNameType = undefined | string | string[] | Record<string, boolean> | ClassNameType[];
3
3
  function classNames(...classNameRules: ClassNameType[]): string[];
4
4
  }
5
5
  export default ClassNameUtils;
package/utils/utils.js CHANGED
@@ -24,55 +24,55 @@ const g = [
24
24
  "outlineColorH",
25
25
  "outlineColorA"
26
26
  ];
27
- var b;
28
- ((a) => {
27
+ var a;
28
+ ((h) => {
29
29
  function l(...d) {
30
- return d.reduce((t, c) => typeof c == "string" ? (t.push(c), t) : Array.isArray(c) ? (t.push(...l(...c)), t) : (Object.entries(c).forEach(([o, s]) => {
31
- s && t.push(o);
32
- }), t), []);
30
+ return d.reduce((e, t) => t ? typeof t == "string" ? (e.push(t), e) : Array.isArray(t) ? (e.push(...l(...t)), e) : (Object.entries(t).forEach(([o, s]) => {
31
+ s && e.push(o);
32
+ }), e) : e, []);
33
33
  }
34
- a.classNames = l;
35
- })(b || (b = {}));
36
- const C = b;
37
- var f;
38
- ((a) => {
39
- function l(t) {
40
- const c = Array.from(t.elements).reduce((o, s) => {
34
+ h.classNames = l;
35
+ })(a || (a = {}));
36
+ const C = a;
37
+ var b;
38
+ ((h) => {
39
+ function l(e) {
40
+ const t = Array.from(e.elements).reduce((o, s) => {
41
41
  const r = s.name;
42
42
  return r && (o[r] || (o[r] = []), o[r].push(s)), o;
43
43
  }, {});
44
- return Object.entries(c).reduce((o, [s, r]) => {
44
+ return Object.entries(t).reduce((o, [s, r]) => {
45
45
  if (r.length === 1) {
46
- const e = r[0];
47
- d(o, s, e.type === "checkbox" || e.type === "radio" ? e.checked : e.value);
46
+ const c = r[0];
47
+ d(o, s, c.type === "checkbox" || c.type === "radio" ? c.checked : c.value);
48
48
  } else {
49
- const e = r.reduce((i, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && i.push(n.value) : i.push(n.value), i), []);
50
- d(o, s, e);
49
+ const c = r.reduce((i, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && i.push(n.value) : i.push(n.value), i), []);
50
+ d(o, s, c);
51
51
  }
52
52
  return o;
53
53
  }, {});
54
54
  }
55
- a.getFormEntries = l;
56
- function d(t, c, o) {
57
- if (c.includes(".")) {
58
- const s = c.split(".");
59
- let r = t;
60
- s.forEach((e, i) => {
55
+ h.getFormEntries = l;
56
+ function d(e, t, o) {
57
+ if (t.includes(".")) {
58
+ const s = t.split(".");
59
+ let r = e;
60
+ s.forEach((c, i) => {
61
61
  if (s.length > i + 1) {
62
- const n = e.match(/^(.+)\[(\d)\]$/);
62
+ const n = c.match(/^(.+)\[(\d)\]$/);
63
63
  if (n) {
64
- const [, u, h] = n;
65
- r[u] = r[u] || [], r[u][h] = r[u][h] || {}, r = r[u][h];
64
+ const [, u, f] = n;
65
+ r[u] = r[u] || [], r[u][f] = r[u][f] || {}, r = r[u][f];
66
66
  } else
67
- r[e] = r[e] || {}, r = r[e];
67
+ r[c] = r[c] || {}, r = r[c];
68
68
  } else
69
- r[e] = o;
69
+ r[c] = o;
70
70
  });
71
71
  } else
72
- t[c] = o;
72
+ e[t] = o;
73
73
  }
74
- })(f || (f = {}));
75
- const p = f;
74
+ })(b || (b = {}));
75
+ const p = b;
76
76
  export {
77
77
  C,
78
78
  p as F,