@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.
- package/box.mjs +1 -1
- package/box.module.css.mjs +1 -1
- package/components/baseSvg.mjs +6 -6
- package/components/radioButtonCore.d.ts +20 -0
- package/components/radioButtonCore.mjs +25 -0
- package/components/textareaCore.d.ts +24 -0
- package/components/textareaCore.mjs +29 -0
- package/components/textboxCore.mjs +7 -6
- package/package.json +1 -1
- package/style.css +1 -1
- package/types.d.ts +4 -2
- package/components/uncontrolledRadioButtonCore.d.ts +0 -20
- package/components/uncontrolledRadioButtonCore.mjs +0 -27
- package/components/uncontrolledTextareaCore.d.ts +0 -23
- package/components/uncontrolledTextareaCore.mjs +0 -44
package/components/baseSvg.mjs
CHANGED
|
@@ -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: "
|
|
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:
|
|
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
|
|
8
|
-
|
|
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
|
-
...
|
|
12
|
-
style: { ...H, width:
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
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,
|
|
7
|
-
const [
|
|
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__ */
|
|
23
|
+
return /* @__PURE__ */ a(n, { ref: e, tag: "input", inline: !0, ...r, props: { ...o.props, ...t } });
|
|
23
24
|
}
|
|
24
|
-
const x =
|
|
25
|
+
const x = p(i);
|
|
25
26
|
export {
|
|
26
27
|
x as default
|
|
27
28
|
};
|