@cronocode/react-box 0.4.9 → 1.0.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.
- package/box.d.ts +4 -1
- package/box.js +5 -17
- package/box.module.css.js +1 -1
- package/components/buttonCore.d.ts +1 -1
- package/components/buttonCore.js +4 -21
- package/components/flex.js +4 -9
- package/components/formAsync.d.ts +6 -2
- package/components/formAsync.js +12 -39
- package/components/uncontrolledCheckboxCore.d.ts +1 -1
- package/components/uncontrolledCheckboxCore.js +4 -21
- package/components/uncontrolledRadioButtonCore.d.ts +1 -1
- package/components/uncontrolledRadioButtonCore.js +4 -21
- package/components/uncontrolledTextareaCore.d.ts +1 -1
- package/components/uncontrolledTextareaCore.js +3 -8
- package/components/uncontrolledTextboxCore.d.ts +1 -1
- package/components/uncontrolledTextboxCore.js +3 -8
- package/package.json +11 -11
- package/style.css +1 -1
- package/types.d.ts +36 -36
- package/utils/form/formUtils.d.ts +5 -0
- package/utils/utils.js +33 -10
package/box.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles {
|
|
|
8
8
|
}) => React.ReactNode);
|
|
9
9
|
tag?: TTag;
|
|
10
10
|
props?: TagPropsType<TTag>;
|
|
11
|
-
|
|
11
|
+
style?: React.ComponentProps<TTag>['style'];
|
|
12
12
|
className?: ClassNameUtils.ClassNameType;
|
|
13
13
|
}
|
|
14
14
|
export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: Props<TTag>): React.DetailedReactHTMLElement<{
|
|
@@ -32,6 +32,7 @@ export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: P
|
|
|
32
32
|
hidden?: React.ComponentProps<TTag>["hidden"] | undefined;
|
|
33
33
|
id?: React.ComponentProps<TTag>["id"] | undefined;
|
|
34
34
|
lang?: React.ComponentProps<TTag>["lang"] | undefined;
|
|
35
|
+
nonce?: React.ComponentProps<TTag>["nonce"] | undefined;
|
|
35
36
|
placeholder?: React.ComponentProps<TTag>["placeholder"] | undefined;
|
|
36
37
|
spellCheck?: React.ComponentProps<TTag>["spellCheck"] | undefined;
|
|
37
38
|
tabIndex?: React.ComponentProps<TTag>["tabIndex"] | undefined;
|
|
@@ -176,6 +177,8 @@ export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: P
|
|
|
176
177
|
onProgressCapture?: React.ComponentProps<TTag>["onProgressCapture"] | undefined;
|
|
177
178
|
onRateChange?: React.ComponentProps<TTag>["onRateChange"] | undefined;
|
|
178
179
|
onRateChangeCapture?: React.ComponentProps<TTag>["onRateChangeCapture"] | undefined;
|
|
180
|
+
onResize?: React.ComponentProps<TTag>["onResize"] | undefined;
|
|
181
|
+
onResizeCapture?: React.ComponentProps<TTag>["onResizeCapture"] | undefined;
|
|
179
182
|
onSeeked?: React.ComponentProps<TTag>["onSeeked"] | undefined;
|
|
180
183
|
onSeekedCapture?: React.ComponentProps<TTag>["onSeekedCapture"] | undefined;
|
|
181
184
|
onSeeking?: React.ComponentProps<TTag>["onSeeking"] | undefined;
|
package/box.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import x, { useState as N } from "react";
|
|
2
2
|
import { c as o } from "./box.module.css.js";
|
|
3
3
|
import { C as b } from "./utils/utils.js";
|
|
4
|
-
function
|
|
5
|
-
const {
|
|
6
|
-
tag: i,
|
|
7
|
-
children: s,
|
|
8
|
-
props: f,
|
|
9
|
-
className: a,
|
|
10
|
-
styles: m
|
|
11
|
-
} = t, c = a ? b.classNames(a, o.box) : [o.box];
|
|
4
|
+
function H(t) {
|
|
5
|
+
const { tag: i, children: s, props: f, className: a, style: m } = t, c = a ? b.classNames(a, o.box) : [o.box];
|
|
12
6
|
Object.entries(t).forEach(([d, v]) => {
|
|
13
7
|
const l = o[d + v];
|
|
14
8
|
l && c.push(l);
|
|
15
9
|
});
|
|
16
|
-
const u = i || "div", e = {
|
|
17
|
-
|
|
18
|
-
style: m,
|
|
19
|
-
className: c.join(" ")
|
|
20
|
-
}, [p, n] = N(!1), r = typeof s == "function";
|
|
21
|
-
return r && (e.onMouseEnter = () => n(!0), e.onMouseLeave = () => n(!1)), x.createElement(u, e, r ? s({
|
|
22
|
-
isHover: p
|
|
23
|
-
}) : s);
|
|
10
|
+
const u = i || "div", e = { ...f, style: m, className: c.join(" ") }, [p, n] = N(!1), r = typeof s == "function";
|
|
11
|
+
return r && (e.onMouseEnter = () => n(!0), e.onMouseLeave = () => n(!1)), x.createElement(u, e, r ? s({ isHover: p }) : s);
|
|
24
12
|
}
|
|
25
13
|
export {
|
|
26
|
-
|
|
14
|
+
H as default
|
|
27
15
|
};
|