@cronocode/react-box 1.0.1 → 1.0.3

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
@@ -21,14 +21,8 @@ export declare const styleVariables: {
21
21
  cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
22
22
  sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100];
23
23
  sizeMultiplier: number;
24
- baseColors: readonly ["none", "transparent", "black", "white", "primary", "primaryLight", "primaryDark", "secondary", "secondaryLight", "secondaryDark", "tertiary", "tertiaryLight", "tertiaryDark", "blue", "blueLight", "blueDark", "red", "redLight", "redDark", "purple", "purpleLight", "purpleDark", "yellow", "yellowLight", "yellowDark", "pink", "pinkLight", "pinkDark", "green", "greenLight", "greenDark", "orange", "orangeLight", "orangeDark", "navy", "navyLight", "navyDark", "teal", "tealLight", "tealDark", "violet", "violetLight", "violetDark", "gray", "grayLight", "grayDark", "brown", "brownLight", "brownDark", "orange", "orangeLight", "orangeDark"];
24
+ baseColors: readonly ["none", "transparent", "black", "white", "blue", "red", "purple", "yellow", "pink", "green", "orange", "navy", "teal", "violet", "gray", "brown", "orange"];
25
25
  borderSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
26
- fontColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
27
- bgColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
28
- borderColors: readonly [1, 2, 3, 4, 5];
29
- outlineColors: readonly [1, 2, 3, 4, 5];
30
- backgrounds: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
31
- shadows: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
32
26
  fontSizes: readonly [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 58, 64, 70, 78, 86, 96];
33
27
  fontWeight: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
34
28
  zIndexSizes: readonly [1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 100, 101, 102, 103, 104, 105, 1000, 1001, 1002, 1003, 1004, 1005];
@@ -49,12 +43,6 @@ declare type BoxSizeValue = (typeof styleVariables.sizeSpecialValues)[number];
49
43
  declare type BorderSizeType = (typeof styleVariables.borderSizes)[number];
50
44
  declare type SizeType = (typeof styleVariables.sizes)[number];
51
45
  declare type ColorType = (typeof styleVariables.baseColors)[number];
52
- declare type BaseFontColorType = (typeof styleVariables.fontColors)[number];
53
- declare type BaseBgColorType = (typeof styleVariables.bgColors)[number];
54
- declare type BaseBorderColorType = (typeof styleVariables.borderColors)[number];
55
- declare type BaseOutlineColorType = (typeof styleVariables.outlineColors)[number];
56
- declare type BackgroundType = (typeof styleVariables.backgrounds)[number];
57
- declare type ShadowType = (typeof styleVariables.shadows)[number];
58
46
  declare type CursorType = (typeof styleVariables.cursors)[number];
59
47
  declare type OverflowType = (typeof styleVariables.overflows)[number];
60
48
  declare type FontSizeType = (typeof styleVariables.fontSizes)[number];
@@ -156,18 +144,18 @@ interface BoxBorder {
156
144
  borderRadiusBottomRight?: SizeType;
157
145
  }
158
146
  interface BoxShadow {
159
- shadow?: ShadowType;
147
+ shadow?: string;
160
148
  }
161
149
  interface BoxBackground {
162
- background?: BackgroundType;
163
- bg?: BackgroundType;
150
+ background?: string;
151
+ bg?: string;
164
152
  }
165
153
  interface BoxColors {
166
- color?: ColorType | BaseFontColorType;
167
- backgroundColor?: ColorType | BaseBgColorType;
168
- bgColor?: ColorType | BaseBgColorType;
169
- borderColor?: ColorType | BaseBorderColorType;
170
- outlineColor?: ColorType | BaseOutlineColorType;
154
+ color?: ColorType | string;
155
+ backgroundColor?: ColorType | string;
156
+ bgColor?: ColorType | string;
157
+ borderColor?: ColorType | string;
158
+ outlineColor?: ColorType | string;
171
159
  }
172
160
  interface BoxCursor {
173
161
  cursor?: CursorType;
@@ -212,4 +200,5 @@ interface BoxFlex {
212
200
  }
213
201
  declare type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline;
214
202
  export declare type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
203
+ export declare const themeClasses: Array<keyof BoxStyles>;
215
204
  export {};
package/utils/utils.js CHANGED
@@ -1,36 +1,63 @@
1
- var f;
2
- ((s) => {
3
- function u(...o) {
4
- return o.reduce((c, r) => typeof r == "string" ? (c.push(r), c) : Array.isArray(r) ? (c.push(...u(...r)), c) : (Object.entries(r).forEach(([t, e]) => {
5
- e && c.push(t);
6
- }), c), []);
7
- }
8
- s.classNames = u;
9
- })(f || (f = {}));
10
- const d = f;
1
+ const a = [
2
+ "shadow",
3
+ "shadowH",
4
+ "shadowA",
5
+ "background",
6
+ "backgroundH",
7
+ "backgroundA",
8
+ "bg",
9
+ "bgH",
10
+ "bgA",
11
+ "color",
12
+ "colorH",
13
+ "colorA",
14
+ "backgroundColor",
15
+ "backgroundColorH",
16
+ "backgroundColorA",
17
+ "bgColor",
18
+ "bgColorH",
19
+ "bgColorA",
20
+ "borderColor",
21
+ "borderColorH",
22
+ "borderColorA",
23
+ "outlineColor",
24
+ "outlineColorH",
25
+ "outlineColorA"
26
+ ];
11
27
  var n;
12
- ((s) => {
13
- function u(o) {
14
- const c = Array.from(o.elements).reduce((r, t) => {
15
- const e = t.name;
16
- return e && (r[e] || (r[e] = []), r[e].push(t)), r;
28
+ ((i) => {
29
+ function u(...s) {
30
+ return s.reduce((t, r) => typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...u(...r)), t) : (Object.entries(r).forEach(([e, o]) => {
31
+ o && t.push(e);
32
+ }), t), []);
33
+ }
34
+ i.classNames = u;
35
+ })(n || (n = {}));
36
+ const g = n;
37
+ var l;
38
+ ((i) => {
39
+ function u(s) {
40
+ const t = Array.from(s.elements).reduce((r, e) => {
41
+ const o = e.name;
42
+ return o && (r[o] || (r[o] = []), r[o].push(e)), r;
17
43
  }, {});
18
- return Object.entries(c).reduce((r, [t, e]) => {
19
- if (e.length === 1) {
20
- const i = e[0];
21
- r[t] = i.type === "checkbox" || i.type === "radio" ? i.checked : i.value;
44
+ return Object.entries(t).reduce((r, [e, o]) => {
45
+ if (o.length === 1) {
46
+ const c = o[0];
47
+ r[e] = c.type === "checkbox" || c.type === "radio" ? c.checked : c.value;
22
48
  } else
23
- r[t] = [], e.forEach((i) => {
24
- var h;
25
- i.type === "checkbox" ? i.checked && r[t].push(i.value) : i.type === "radio" ? r[t] = (h = e.find((p) => p.checked)) == null ? void 0 : h.value : r[t].push(i.value);
49
+ r[e] = [], o.forEach((c) => {
50
+ var d;
51
+ c.type === "checkbox" ? c.checked && r[e].push(c.value) : c.type === "radio" ? r[e] = (d = o.find((h) => h.checked)) == null ? void 0 : d.value : r[e].push(c.value);
26
52
  });
27
53
  return r;
28
54
  }, {});
29
55
  }
30
- s.getFormEntries = u;
31
- })(n || (n = {}));
32
- const y = n;
56
+ i.getFormEntries = u;
57
+ })(l || (l = {}));
58
+ const C = l;
33
59
  export {
34
- d as C,
35
- y as F
60
+ g as C,
61
+ C as F,
62
+ a as t
36
63
  };