@cronocode/react-box 1.1.5 → 1.1.7

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,15 +1,15 @@
1
1
  import g, { useState as w } from "react";
2
2
  import { C as v } from "../utils/utils.mjs";
3
- const s = { base: "cLD", fillnone: "cLE", fillHnone: "cLF", hovertrue: "d", filltransparent: "cLG", fillHtransparent: "cLH", fillblack: "cLI", fillHblack: "cLJ", fillwhite: "cLK", fillHwhite: "cLL", fillblue: "cLM", fillHblue: "cLN", fillred: "cLO", fillHred: "cLP", fillpurple: "cLQ", fillHpurple: "cLR", fillyellow: "cLS", fillHyellow: "cLT", fillpink: "cLU", fillHpink: "cLV", fillgreen: "cLW", fillHgreen: "cLX", fillorange: "cLY", fillHorange: "cLZ", fillnavy: "cL0", fillHnavy: "cL1", fillteal: "cL2", fillHteal: "cL3", fillviolet: "cL4", fillHviolet: "cL5", fillgray: "cL6", fillHgray: "cL7", fillbrown: "cL8", fillHbrown: "cL9", strokenone: "cMa", strokeHnone: "cMb", stroketransparent: "cMc", strokeHtransparent: "cMd", strokeblack: "cMe", strokeHblack: "cMf", strokewhite: "cMg", strokeHwhite: "cMh", strokeblue: "cMi", strokeHblue: "cMj", strokered: "cMk", strokeHred: "cMl", strokepurple: "cMm", strokeHpurple: "cMn", strokeyellow: "cMo", strokeHyellow: "cMp", strokepink: "cMq", strokeHpink: "cMr", strokegreen: "cMs", strokeHgreen: "cMt", strokeorange: "cMu", strokeHorange: "cMv", strokenavy: "cMw", strokeHnavy: "cMx", stroketeal: "cMy", strokeHteal: "cMz", strokeviolet: "cMA", strokeHviolet: "cMB", strokegray: "cMC", strokeHgray: "cMD", strokebrown: "cME", strokeHbrown: "cMF", rotate0: "cMG", rotateH0: "cMH", rotate90: "cMI", rotateH90: "cMJ", rotate180: "cMK", rotateH180: "cML", rotate270: "cMM", rotateH270: "cMN", flipxAxis: "cMO", flipHxAxis: "cMP", flipyAxis: "cMQ", flipHyAxis: "cMR" }, b = ["fill", "fillH", "stroke", "strokeH"];
3
+ const s = { base: "cLL", fillnone: "cLM", fillHnone: "cLN", hovertrue: "d", filltransparent: "cLO", fillHtransparent: "cLP", fillblack: "cLQ", fillHblack: "cLR", fillwhite: "cLS", fillHwhite: "cLT", fillblue: "cLU", fillHblue: "cLV", fillred: "cLW", fillHred: "cLX", fillpurple: "cLY", fillHpurple: "cLZ", fillyellow: "cL0", fillHyellow: "cL1", fillpink: "cL2", fillHpink: "cL3", fillgreen: "cL4", fillHgreen: "cL5", fillorange: "cL6", fillHorange: "cL7", fillnavy: "cL8", fillHnavy: "cL9", fillteal: "cMa", fillHteal: "cMb", fillviolet: "cMc", fillHviolet: "cMd", fillgray: "cMe", fillHgray: "cMf", fillbrown: "cMg", fillHbrown: "cMh", strokenone: "cMi", strokeHnone: "cMj", stroketransparent: "cMk", strokeHtransparent: "cMl", strokeblack: "cMm", strokeHblack: "cMn", strokewhite: "cMo", strokeHwhite: "cMp", strokeblue: "cMq", strokeHblue: "cMr", strokered: "cMs", strokeHred: "cMt", strokepurple: "cMu", strokeHpurple: "cMv", strokeyellow: "cMw", strokeHyellow: "cMx", strokepink: "cMy", strokeHpink: "cMz", strokegreen: "cMA", strokeHgreen: "cMB", strokeorange: "cMC", strokeHorange: "cMD", strokenavy: "cME", strokeHnavy: "cMF", stroketeal: "cMG", strokeHteal: "cMH", strokeviolet: "cMI", strokeHviolet: "cMJ", strokegray: "cMK", strokeHgray: "cML", strokebrown: "cMM", strokeHbrown: "cMN", rotate0: "cMO", rotateH0: "cMP", rotate90: "cMQ", rotateH90: "cMR", rotate180: "cMS", rotateH180: "cMT", rotate270: "cMU", rotateH270: "cMV", flipxAxis: "cMW", flipHxAxis: "cMX", flipyAxis: "cMY", flipHyAxis: "cMZ" }, b = ["fill", "fillH", "stroke", "strokeH"];
4
4
  function m(o) {
5
- const { children: e, props: M, className: r, style: H, viewBox: k, width: L, height: p } = o, l = r ? v.classNames(r, s.base) : [s.base];
5
+ const { children: e, props: f, className: r, style: H, viewBox: k, width: p, height: L } = o, l = r ? v.classNames(r, s.base) : [s.base];
6
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}`);
7
+ const M = s[c + n];
8
+ M ? l.push(M) : b.includes(c) && l.push(`${c}${n}`);
9
9
  });
10
10
  const t = {
11
- ...M,
12
- style: { ...H, width: L, height: p },
11
+ ...f,
12
+ style: { ...H, width: p, height: L },
13
13
  className: l.join(" "),
14
14
  viewBox: k || "0 0 24 24",
15
15
  xmlns: "http://www.w3.org/2000/svg",
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import Box from '../box';
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'input'>>, 'ref' | 'tag'>;
4
+ declare type BoxTagProps = Required<BoxProps>['props'];
5
+ declare type RadioButtonCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'type' | 'placeholder' | 'disabled' | 'value' | 'autoFocus' | 'readOnly' | 'required' | 'checked' | 'defaultChecked'>;
6
+ interface Props extends Omit<BoxProps, 'props'> {
7
+ name?: string;
8
+ props?: RadioButtonCoreTagProps;
9
+ onInput?: (e: React.FormEvent<HTMLInputElement>) => void;
10
+ onChange?: (e: React.FormEvent<HTMLInputElement>) => void;
11
+ disabled?: boolean;
12
+ value?: string | number;
13
+ autoFocus?: boolean;
14
+ readOnly?: boolean;
15
+ required?: boolean;
16
+ checked?: boolean;
17
+ defaultChecked?: boolean;
18
+ }
19
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
20
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import i from "../box.mjs";
4
+ import { O as p } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function u(o, r) {
7
+ const [t, e] = p.moveToTagProps(
8
+ o,
9
+ "name",
10
+ "onInput",
11
+ "onChange",
12
+ "disabled",
13
+ "value",
14
+ "autoFocus",
15
+ "readOnly",
16
+ "required",
17
+ "checked",
18
+ "defaultChecked"
19
+ );
20
+ return /* @__PURE__ */ a(i, { ref: r, tag: "input", inline: !0, ...e, props: { ...o.props, ...t, type: "radio" } });
21
+ }
22
+ const l = n(u);
23
+ export {
24
+ l as default
25
+ };
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import Box from '../box';
3
+ declare type BoxProps = Omit<React.ComponentProps<typeof Box<'textarea'>>, 'ref' | 'tag'>;
4
+ declare type BoxTagProps = Required<BoxProps>['props'];
5
+ declare type TextareaCoreTagProps = Omit<BoxTagProps, 'name' | 'onInput' | 'onChange' | 'placeholder' | 'disabled' | 'value' | 'defaultValue' | 'rows' | 'cols' | 'autoFocus' | 'maxLength' | 'minLength' | 'readOnly' | 'required'>;
6
+ interface Props extends Omit<BoxProps, 'props'> {
7
+ name?: string;
8
+ props?: TextareaCoreTagProps;
9
+ onInput?: (e: React.FormEvent<HTMLTextAreaElement>) => void;
10
+ onChange?: (e: React.FormEvent<HTMLTextAreaElement>) => void;
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ value?: string;
14
+ defaultValue?: string;
15
+ rows?: number;
16
+ cols?: number;
17
+ autoFocus?: boolean;
18
+ maxLength?: number;
19
+ minLength?: number;
20
+ readOnly?: boolean;
21
+ required?: boolean;
22
+ }
23
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLTextAreaElement>>;
24
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import s from "../box.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
+ import "../box.module.css.mjs";
6
+ function p(e, o) {
7
+ const [r, t] = m.moveToTagProps(
8
+ e,
9
+ "name",
10
+ "onInput",
11
+ "onChange",
12
+ "placeholder",
13
+ "disabled",
14
+ "value",
15
+ "defaultValue",
16
+ "rows",
17
+ "cols",
18
+ "autoFocus",
19
+ "maxLength",
20
+ "minLength",
21
+ "readOnly",
22
+ "required"
23
+ );
24
+ return /* @__PURE__ */ a(s, { ref: o, tag: "textarea", inline: !0, ...t, props: { ...e.props, ...r } });
25
+ }
26
+ const c = n(p);
27
+ export {
28
+ c as default
29
+ };
@@ -1,11 +1,12 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
3
  import n from "../box.mjs";
4
4
  import { O as s } from "../utils/utils.mjs";
5
5
  import "../box.module.css.mjs";
6
- function i(o, t) {
7
- const [e, r] = s.moveToTagProps(
6
+ function i(o, e) {
7
+ const [t, r] = s.moveToTagProps(
8
8
  o,
9
+ "name",
9
10
  "onInput",
10
11
  "onChange",
11
12
  "type",
@@ -19,9 +20,9 @@ function i(o, t) {
19
20
  "required",
20
21
  "step"
21
22
  );
22
- return /* @__PURE__ */ p(n, { ref: t, tag: "input", inline: !0, ...r, props: { ...o.props, ...e } });
23
+ return /* @__PURE__ */ a(n, { ref: e, tag: "input", inline: !0, ...r, props: { ...o.props, ...t } });
23
24
  }
24
- const x = a(i);
25
+ const x = p(i);
25
26
  export {
26
27
  x as default
27
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "main": "./box.mjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",