@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 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
- styles?: React.ComponentProps<TTag>['style'];
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 E(t) {
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
- ...f,
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
- E as default
14
+ H as default
27
15
  };