@cronocode/react-box 1.2.0 → 1.2.2

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
@@ -1,3 +1,4 @@
1
+ import { SvgStyles } from './components/baseSvg/baseSvg';
1
2
  export type Hovered<T> = {
2
3
  [K in keyof T as K extends string ? `${K}H` : never]: T[K];
3
4
  };
@@ -212,4 +213,5 @@ interface BoxUserSelect {
212
213
  type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition & BoxUserSelect;
213
214
  export type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
214
215
  export declare const themeClasses: Partial<Record<keyof BoxStyles, string>>;
216
+ export declare const themeSvgClasses: Partial<Record<keyof SvgStyles, string>>;
215
217
  export {};
package/utils/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const h = {
1
+ const C = {
2
2
  hover: "_h",
3
3
  focus: "_f",
4
4
  shadow: "shadow_",
@@ -33,70 +33,80 @@ const h = {
33
33
  outlineColorH: "outlineColor_h_",
34
34
  outlineColorF: "outlineColor_f_",
35
35
  outlineColorA: "outlineColor_a_"
36
+ }, d = {
37
+ fill: "fill_",
38
+ fillH: "fill_h_",
39
+ fillF: "fill_f_",
40
+ fillA: "fill_a_",
41
+ stroke: "stroke_",
42
+ strokeH: "stroke_h_",
43
+ strokeF: "stroke_f_",
44
+ strokeA: "stroke_a_"
36
45
  };
37
- var a;
38
- ((b) => {
39
- function s(...n) {
40
- return n.reduce((l, r) => r ? typeof r == "string" ? (l.push(r), l) : Array.isArray(r) ? (l.push(...s(...r)), l) : (Object.entries(r).forEach(([e, t]) => {
41
- t && l.push(e);
42
- }), l) : l, []);
46
+ var g;
47
+ ((n) => {
48
+ function c(...i) {
49
+ return i.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...c(...r)), t) : (Object.entries(r).forEach(([e, l]) => {
50
+ l && t.push(e);
51
+ }), t) : t, []);
43
52
  }
44
- b.classNames = s;
45
- })(a || (a = {}));
46
- const f = a;
47
- var d;
48
- ((b) => {
49
- function s(n, ...l) {
50
- const r = { ...n }, e = {};
51
- return l.forEach((t) => {
52
- t in r && (e[t] = r[t], delete r[t]);
53
+ n.classNames = c;
54
+ })(g || (g = {}));
55
+ const p = g;
56
+ var u;
57
+ ((n) => {
58
+ function c(i, ...t) {
59
+ const r = { ...i }, e = {};
60
+ return t.forEach((l) => {
61
+ l in r && (e[l] = r[l], delete r[l]);
53
62
  }), [e, r];
54
63
  }
55
- b.moveToTagProps = s;
56
- })(d || (d = {}));
57
- const p = d;
58
- var C;
59
- ((b) => {
60
- function s(l) {
61
- const r = Array.from(l.elements).reduce((e, t) => {
62
- const o = t.name;
63
- return o && (e[o] || (e[o] = []), e[o].push(t)), e;
64
+ n.moveToTagProps = c;
65
+ })(u || (u = {}));
66
+ const k = u;
67
+ var h;
68
+ ((n) => {
69
+ function c(t) {
70
+ const r = Array.from(t.elements).reduce((e, l) => {
71
+ const o = l.name;
72
+ return o && (e[o] || (e[o] = []), e[o].push(l)), e;
64
73
  }, {});
65
- return Object.entries(r).reduce((e, [t, o]) => {
74
+ return Object.entries(r).reduce((e, [l, o]) => {
66
75
  if (o.length === 1) {
67
76
  const _ = o[0];
68
- n(e, t, _.type === "checkbox" || _.type === "radio" ? _.checked : _.value);
77
+ i(e, l, _.type === "checkbox" || _.type === "radio" ? _.checked : _.value);
69
78
  } else {
70
- const _ = o.reduce((i, c) => (c.type === "checkbox" || c.type === "radio" ? c.checked && i.push(c.value) : i.push(c.value), i), []);
71
- n(e, t, _);
79
+ const _ = o.reduce((b, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && b.push(s.value) : b.push(s.value), b), []);
80
+ i(e, l, _);
72
81
  }
73
82
  return e;
74
83
  }, {});
75
84
  }
76
- b.getFormEntries = s;
77
- function n(l, r, e) {
85
+ n.getFormEntries = c;
86
+ function i(t, r, e) {
78
87
  if (r.includes(".")) {
79
- const t = r.split(".");
80
- let o = l;
81
- t.forEach((_, i) => {
82
- if (t.length > i + 1) {
83
- const c = _.match(/^(.+)\[(\d)\]$/);
84
- if (c) {
85
- const [, u, g] = c;
86
- o[u] = o[u] || [], o[u][g] = o[u][g] || {}, o = o[u][g];
88
+ const l = r.split(".");
89
+ let o = t;
90
+ l.forEach((_, b) => {
91
+ if (l.length > b + 1) {
92
+ const s = _.match(/^(.+)\[(\d)\]$/);
93
+ if (s) {
94
+ const [, a, f] = s;
95
+ o[a] = o[a] || [], o[a][f] = o[a][f] || {}, o = o[a][f];
87
96
  } else
88
97
  o[_] = o[_] || {}, o = o[_];
89
98
  } else
90
99
  o[_] = e;
91
100
  });
92
101
  } else
93
- l[r] = e;
102
+ t[r] = e;
94
103
  }
95
- })(C || (C = {}));
96
- const F = C;
104
+ })(h || (h = {}));
105
+ const F = h;
97
106
  export {
98
- f as C,
107
+ p as C,
99
108
  F,
100
- p as O,
101
- h as t
109
+ k as O,
110
+ C as a,
111
+ d as t
102
112
  };