@cronocode/react-box 1.1.9 → 1.2.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.
@@ -1,22 +1,22 @@
1
- import w, { useState as L } from "react";
2
- import { C as v } from "../utils/utils.mjs";
3
- const s = { base: "cLT", fillnone: "cLU", fillHnone: "cLV", hovertrue: "d", filltransparent: "cLW", fillHtransparent: "cLX", fillblack: "cLY", fillHblack: "cLZ", fillwhite: "cL0", fillHwhite: "cL1", fillblue: "cL2", fillHblue: "cL3", fillred: "cL4", fillHred: "cL5", fillpurple: "cL6", fillHpurple: "cL7", fillyellow: "cL8", fillHyellow: "cL9", fillpink: "cMa", fillHpink: "cMb", fillgreen: "cMc", fillHgreen: "cMd", fillorange: "cMe", fillHorange: "cMf", fillnavy: "cMg", fillHnavy: "cMh", fillteal: "cMi", fillHteal: "cMj", fillviolet: "cMk", fillHviolet: "cMl", fillgray: "cMm", fillHgray: "cMn", fillbrown: "cMo", fillHbrown: "cMp", strokenone: "cMq", strokeHnone: "cMr", stroketransparent: "cMs", strokeHtransparent: "cMt", strokeblack: "cMu", strokeHblack: "cMv", strokewhite: "cMw", strokeHwhite: "cMx", strokeblue: "cMy", strokeHblue: "cMz", strokered: "cMA", strokeHred: "cMB", strokepurple: "cMC", strokeHpurple: "cMD", strokeyellow: "cME", strokeHyellow: "cMF", strokepink: "cMG", strokeHpink: "cMH", strokegreen: "cMI", strokeHgreen: "cMJ", strokeorange: "cMK", strokeHorange: "cML", strokenavy: "cMM", strokeHnavy: "cMN", stroketeal: "cMO", strokeHteal: "cMP", strokeviolet: "cMQ", strokeHviolet: "cMR", strokegray: "cMS", strokeHgray: "cMT", strokebrown: "cMU", strokeHbrown: "cMV", rotate0: "cMW", rotateH0: "cMX", rotate90: "cMY", rotateH90: "cMZ", rotate180: "cM0", rotateH180: "cM1", rotate270: "cM2", rotateH270: "cM3", flipxAxis: "cM4", flipHxAxis: "cM5", flipyAxis: "cM6", flipHyAxis: "cM7" }, b = ["fill", "fillH", "stroke", "strokeH"];
4
- function m(o) {
5
- const { children: e, props: f, className: r, style: H, viewBox: k, width: p, height: u } = o, l = r ? v.classNames(r, s.base) : [s.base];
6
- Object.entries(o).forEach(([c, n]) => {
7
- const M = s[c + n];
8
- M ? l.push(M) : b.includes(c) && l.push(`${c}${n}`);
1
+ import x, { useState as v } from "react";
2
+ import { C as d } from "../utils/utils.mjs";
3
+ const a = { base: "cGH", rotate0: "cGI", rotateH0: "cGJ", hovertrue: "_h", rotate90: "cGK", rotateH90: "cGL", rotate180: "cGM", rotateH180: "cGN", rotate270: "cGO", rotateH270: "cGP", flipxAxis: "cGQ", flipHxAxis: "cGR", flipyAxis: "cGS", flipHyAxis: "cGT" }, g = ["fill", "fillH", "stroke", "strokeH"];
4
+ function A(c) {
5
+ const { children: s, props: m, className: r, style: p, viewBox: G, width: u, height: H } = c, e = r ? d.classNames(r, a.base) : [a.base];
6
+ Object.entries(c).forEach(([o, n]) => {
7
+ const f = a[o + n];
8
+ f ? e.push(f) : g.includes(o) && e.push(`${o}${n}`);
9
9
  });
10
10
  const t = {
11
- ...f,
12
- style: { ...H, width: p, height: u },
13
- className: l.join(" "),
14
- viewBox: k || "0 0 24 24",
11
+ ...m,
12
+ style: { ...p, width: u, height: H },
13
+ className: e.join(" "),
14
+ viewBox: G || "0 0 24 24",
15
15
  xmlns: "http://www.w3.org/2000/svg",
16
16
  fill: "none"
17
- }, [g, i] = L(!1), a = typeof e == "function";
18
- return a && (t.onMouseEnter = () => i(!0), t.onMouseLeave = () => i(!1)), w.createElement("svg", t, a ? e({ isHover: g }) : e);
17
+ }, [h, i] = v(!1), l = typeof s == "function";
18
+ return l && (t.onMouseEnter = () => i(!0), t.onMouseLeave = () => i(!1)), x.createElement("svg", t, l ? s({ isHover: h }) : s);
19
19
  }
20
20
  export {
21
- m as default
21
+ A as default
22
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "main": "./box.mjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",
@@ -50,8 +50,10 @@
50
50
  "@vitejs/plugin-react": "^3.1.0",
51
51
  "autoprefixer": "^10.4.14",
52
52
  "postcss": "^8.4.21",
53
+ "postcss-each": "^1.1.0",
53
54
  "postcss-mixins": "^9.0.4",
54
55
  "postcss-nested": "^6.0.1",
56
+ "postcss-simple-vars": "^7.0.1",
55
57
  "prettier": "^2.8.7",
56
58
  "react": "^18.1.0",
57
59
  "react-dom": "^18.2.0",