@cronocode/react-box 1.0.2 → 1.0.5

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.
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { ColorType, Hovered } from '../types';
3
+ import ClassNameUtils from '../utils/className/classNameUtils';
4
+ interface SvgNormalStyles {
5
+ fill?: ColorType | string;
6
+ stroke?: ColorType | string;
7
+ rotate?: 0 | 90 | 180 | 270;
8
+ flip?: 'xAxis' | 'yAxis';
9
+ }
10
+ export declare type SvgStyles = SvgNormalStyles & Hovered<SvgNormalStyles>;
11
+ declare type AllSvgProps = React.SVGProps<SVGElement>;
12
+ declare type SvgPropsType = Omit<AllSvgProps, 'className' | 'style' | 'width' | 'height'>;
13
+ declare type SvgStyleType = Omit<React.CSSProperties, 'width' | 'height'>;
14
+ interface Props extends SvgStyles {
15
+ children?: React.ReactNode | ((props: {
16
+ isHover: boolean;
17
+ }) => React.ReactNode);
18
+ props?: SvgPropsType;
19
+ style?: SvgStyleType;
20
+ className?: ClassNameUtils.ClassNameType;
21
+ viewBox?: string;
22
+ width?: string;
23
+ height?: string;
24
+ }
25
+ export default function BaseSvg(props: Props): React.ReactSVGElement;
26
+ export {};
@@ -0,0 +1,22 @@
1
+ import g, { useState as w } from "react";
2
+ import { C as v } from "../utils/utils.js";
3
+ const s = { base: "cLz", fillnone: "cLA", fillHnone: "cLB", hovertrue: "d", filltransparent: "cLC", fillHtransparent: "cLD", fillblack: "cLE", fillHblack: "cLF", fillwhite: "cLG", fillHwhite: "cLH", fillblue: "cLI", fillHblue: "cLJ", fillred: "cLK", fillHred: "cLL", fillpurple: "cLM", fillHpurple: "cLN", fillyellow: "cLO", fillHyellow: "cLP", fillpink: "cLQ", fillHpink: "cLR", fillgreen: "cLS", fillHgreen: "cLT", fillorange: "cLU", fillHorange: "cLV", fillnavy: "cLW", fillHnavy: "cLX", fillteal: "cLY", fillHteal: "cLZ", fillviolet: "cL0", fillHviolet: "cL1", fillgray: "cL2", fillHgray: "cL3", fillbrown: "cL4", fillHbrown: "cL5", strokenone: "cL6", strokeHnone: "cL7", stroketransparent: "cL8", strokeHtransparent: "cL9", strokeblack: "cMa", strokeHblack: "cMb", strokewhite: "cMc", strokeHwhite: "cMd", strokeblue: "cMe", strokeHblue: "cMf", strokered: "cMg", strokeHred: "cMh", strokepurple: "cMi", strokeHpurple: "cMj", strokeyellow: "cMk", strokeHyellow: "cMl", strokepink: "cMm", strokeHpink: "cMn", strokegreen: "cMo", strokeHgreen: "cMp", strokeorange: "cMq", strokeHorange: "cMr", strokenavy: "cMs", strokeHnavy: "cMt", stroketeal: "cMu", strokeHteal: "cMv", strokeviolet: "cMw", strokeHviolet: "cMx", strokegray: "cMy", strokeHgray: "cMz", strokebrown: "cMA", strokeHbrown: "cMB", rotate0: "cMC", rotateH0: "cMD", rotate90: "cME", rotateH90: "cMF", rotate180: "cMG", rotateH180: "cMH", rotate270: "cMI", rotateH270: "cMJ", flipxAxis: "cMK", flipHxAxis: "cML", flipyAxis: "cMM", flipHyAxis: "cMN" }, b = ["fill", "fillH", "stroke", "strokeH"];
4
+ function m(o) {
5
+ const { children: e, props: H, className: r, style: M, viewBox: k, width: L, height: p } = o, l = r ? v.classNames(r, s.base) : [s.base];
6
+ Object.entries(o).forEach(([c, n]) => {
7
+ const f = s[c + n];
8
+ f ? l.push(f) : b.includes(c) && l.push(`${c}${n}`);
9
+ });
10
+ const t = {
11
+ ...H,
12
+ style: { ...M, width: L, height: p },
13
+ className: l.join(" "),
14
+ viewBox: k || "0 0 24 24",
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ fill: "none"
17
+ }, [u, i] = w(!1), a = typeof e == "function";
18
+ return a && (t.onMouseEnter = () => i(!0), t.onMouseLeave = () => i(!1)), g.createElement("svg", t, a ? e({ isHover: u }) : e);
19
+ }
20
+ export {
21
+ m as default
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "main": "./box.js",
5
5
  "module": "./box.js",
6
6
  "types": "./box.d.ts",