@cronocode/react-box 1.3.4 → 1.3.6

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,4 +1,4 @@
1
- const t = { base: "cGQ", rotate0: "cGR", rotateH0: "cGS", hovertrue: "_h", rotate90: "cGT", rotateH90: "cGU", rotate180: "cGV", rotateH180: "cGW", rotate270: "cGX", rotateH270: "cGY", flipxAxis: "cGZ", flipHxAxis: "cG0", flipyAxis: "cG1", flipHyAxis: "cG2", rotateF0: "cG3", focustrue: "_f", rotateF90: "cG4", rotateF180: "cG5", rotateF270: "cG6", flipFxAxis: "cG7", flipFyAxis: "cG8", rotateA0: "cG9", rotateA90: "cHa", rotateA180: "cHb", rotateA270: "cHc", flipAxAxis: "cHd", flipAyAxis: "cHe" };
1
+ const t = { base: "bDG", rotate0: "bDH", rotateH0: "bDI", hovertrue: "_h", rotate90: "bDJ", rotateH90: "bDK", rotate180: "bDL", rotateH180: "bDM", rotate270: "bDN", rotateH270: "bDO", flipxAxis: "bDP", flipHxAxis: "bDQ", flipyAxis: "bDR", flipHyAxis: "bDS", rotateF0: "bDT", focustrue: "_f", rotateF90: "bDU", rotateF180: "bDV", rotateF270: "bDW", flipFxAxis: "bDX", flipFyAxis: "bDY", rotateA0: "bDZ", rotateA90: "bD0", rotateA180: "bD1", rotateA270: "bD2", flipAxAxis: "bD3", flipAyAxis: "bD4" };
2
2
  export {
3
3
  t as c
4
4
  };
package/box.d.ts CHANGED
@@ -4,7 +4,11 @@ import ClassNameUtils from './utils/className/classNameUtils';
4
4
  import { ThemeComponentProps } from './theme';
5
5
  type AllProps<TTag extends keyof React.ReactHTML> = React.ComponentProps<TTag>;
6
6
  type TagPropsType<TTag extends keyof React.ReactHTML> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
7
- interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles, ThemeComponentProps {
7
+ export declare namespace Augmented {
8
+ interface Props {
9
+ }
10
+ }
11
+ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles, ThemeComponentProps, Augmented.Props {
8
12
  children?: React.ReactNode | ((props: {
9
13
  isHover: boolean;
10
14
  }) => React.ReactNode);
package/box.mjs CHANGED
@@ -1,20 +1,54 @@
1
- import b, { forwardRef as g, useMemo as E, useState as H } from "react";
2
- import { c as n } from "./box.module.css.mjs";
3
- import { C as M, a as d } from "./utils/utils.mjs";
4
- import { useTheme as P } from "./theme.mjs";
5
- function S(e, r) {
6
- const { tag: h, children: t, props: p, className: c, style: l } = e, N = P(e), x = E(() => {
7
- const o = c ? M.classNames(n.box, c) : [n.box], C = { ...N, ...e };
8
- return Object.entries(C).forEach(([a, i]) => {
9
- const u = n[a + i];
10
- u ? o.push(u) : a in d && o.push(`${d[a]}${i}`);
11
- }), o.join(" ");
12
- }, [e]), s = { ...p, className: x };
13
- l && (s.style = l), r && (s.ref = r);
14
- const [v, m] = H(!1), f = typeof t == "function";
15
- return f && (s.onMouseEnter = () => m(!0), s.onMouseLeave = () => m(!1)), b.createElement(h || "div", s, f ? t({ isHover: v }) : t);
1
+ import T, { forwardRef as j, useMemo as C, useState as N } from "react";
2
+ import { c as m } from "./box.module.css.mjs";
3
+ import { C as y, a as p } from "./utils/utils.mjs";
4
+ import { useTheme as B } from "./theme.mjs";
5
+ function P(t, e) {
6
+ const { tag: s, children: o, props: n, className: c, style: l } = t, h = B(t), x = C(() => {
7
+ const a = c ? y.classNames(m.box, c) : [m.box], H = { ...u(h), ...u(t) };
8
+ return Object.entries(H).forEach(([i, b]) => {
9
+ const g = m[i + b];
10
+ g ? a.push(g) : i in p && a.push(`${p[i]}${b}`);
11
+ }), a.join(" ");
12
+ }, [t]), r = { ...n, className: x };
13
+ l && (r.style = l), e && (r.ref = e);
14
+ const [$, d] = N(!1), f = typeof o == "function";
15
+ return f && (r.onMouseEnter = () => d(!0), r.onMouseLeave = () => d(!1)), T.createElement(s || "div", r, f ? o({ isHover: $ }) : o);
16
+ }
17
+ const z = j(P), R = {
18
+ m: "margin",
19
+ mx: "marginHorizontal",
20
+ my: "marginVertical",
21
+ mt: "marginTop",
22
+ mr: "marginRight",
23
+ mb: "marginBottom",
24
+ ml: "marginLeft",
25
+ p: "padding",
26
+ px: "paddingHorizontal",
27
+ py: "paddingVertical",
28
+ pt: "paddingTop",
29
+ pr: "paddingRight",
30
+ pb: "paddingBottom",
31
+ pl: "paddingLeft",
32
+ b: "border",
33
+ bx: "borderHorizontal",
34
+ by: "borderVertical",
35
+ bt: "borderTop",
36
+ br: "borderRight",
37
+ bb: "borderBottom",
38
+ bl: "borderLeft",
39
+ bg: "background",
40
+ jc: "justifyContent",
41
+ ai: "alignItems",
42
+ ac: "alignContent",
43
+ d: "flexDirection"
44
+ }, v = Object.entries(R).reduce((t, [e, s]) => (t[e] = s, t[`${e}H`] = `${s}H`, t[`${e}F`] = `${s}F`, t[`${e}A`] = `${s}A`, t), {});
45
+ function u(t) {
46
+ const e = { ...t };
47
+ return Object.keys(e).forEach((o) => {
48
+ const n = v[o];
49
+ n && (n in e || (e[n] = e[o]), delete e[o]);
50
+ }), e;
16
51
  }
17
- const y = g(S);
18
52
  export {
19
- y as default
53
+ z as default
20
54
  };