@cronocode/react-box 1.1.9 → 1.2.1

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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ColorType, Hovered } from '../types';
2
+ import { Activated, ColorType, Focused, Hovered } from '../types';
3
3
  import ClassNameUtils from '../utils/className/classNameUtils';
4
4
  interface SvgNormalStyles {
5
5
  fill?: ColorType | string;
@@ -7,7 +7,7 @@ interface SvgNormalStyles {
7
7
  rotate?: 0 | 90 | 180 | 270;
8
8
  flip?: 'xAxis' | 'yAxis';
9
9
  }
10
- export type SvgStyles = SvgNormalStyles & Hovered<SvgNormalStyles>;
10
+ export type SvgStyles = SvgNormalStyles & Hovered<SvgNormalStyles> & Focused<SvgNormalStyles> & Activated<SvgNormalStyles>;
11
11
  type AllSvgProps = React.SVGProps<SVGElement>;
12
12
  type SvgPropsType = Omit<AllSvgProps, 'className' | 'style' | 'width' | 'height'>;
13
13
  type SvgStyleType = Omit<React.CSSProperties, 'width' | 'height'>;
@@ -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 H, { useState as g } from "react";
2
+ import { C as w, t as p } 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" };
4
+ function A(c) {
5
+ const { children: s, props: G, className: r, style: m, viewBox: h, width: u, height: v } = c, e = r ? w.classNames(r, a.base) : [a.base];
6
+ Object.entries(c).forEach(([o, l]) => {
7
+ const f = a[o + l];
8
+ f ? e.push(f) : o in p && e.push(`${p[o]}${l}`);
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
+ ...G,
12
+ style: { ...m, width: u, height: v },
13
+ className: e.join(" "),
14
+ viewBox: h || "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
+ }, [x, i] = g(!1), n = typeof s == "function";
18
+ return n && (t.onMouseEnter = () => i(!0), t.onMouseLeave = () => i(!1)), H.createElement("svg", t, n ? s({ isHover: x }) : 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.1",
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",