@cronocode/react-box 1.2.7 → 1.3.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.
Files changed (37) hide show
  1. package/baseSvg.module.css.mjs +4 -0
  2. package/box.d.ts +2 -1
  3. package/box.mjs +18 -14
  4. package/box.module.css.mjs +1 -1
  5. package/components/baseSvg.mjs +14 -14
  6. package/components/{buttonCore.d.ts → button.d.ts} +3 -2
  7. package/components/button.mjs +15 -0
  8. package/components/{radioButtonCore.d.ts → checkbox.d.ts} +7 -5
  9. package/components/checkbox.mjs +30 -0
  10. package/components/dataGrid.d.ts +2 -0
  11. package/components/dataGrid.mjs +36 -0
  12. package/components/flex.mjs +1 -0
  13. package/components/form.d.ts +10 -0
  14. package/components/{formAsync.mjs → form.mjs} +6 -5
  15. package/components/{checkboxCore.d.ts → radioButton.d.ts} +7 -5
  16. package/components/radioButton.mjs +26 -0
  17. package/components/{textareaCore.d.ts → textarea.d.ts} +6 -4
  18. package/components/textarea.mjs +30 -0
  19. package/components/textbox.d.ts +3 -4
  20. package/components/textbox.mjs +11 -11
  21. package/components/tooltip.d.ts +8 -0
  22. package/components/tooltip.mjs +55 -0
  23. package/hooks/usePortalContainer.d.ts +1 -0
  24. package/package.json +5 -2
  25. package/style.css +1 -1
  26. package/theme.d.ts +30 -21
  27. package/theme.mjs +20 -20
  28. package/types.d.ts +12 -2
  29. package/utils/object/objectUtils.d.ts +1 -439
  30. package/utils/utils.mjs +55 -44
  31. package/components/buttonCore.mjs +0 -13
  32. package/components/checkboxCore.mjs +0 -25
  33. package/components/formAsync.d.ts +0 -10
  34. package/components/radioButtonCore.mjs +0 -25
  35. package/components/textareaCore.mjs +0 -29
  36. package/components/textboxCore.d.ts +0 -24
  37. package/components/textboxCore.mjs +0 -28
@@ -0,0 +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" };
2
+ export {
3
+ t as c
4
+ };
package/box.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import React, { Ref } from 'react';
2
2
  import { BoxStyles } from './types';
3
3
  import ClassNameUtils from './utils/className/classNameUtils';
4
+ import { ThemeComponentProps } from './theme';
4
5
  type AllProps<TTag extends keyof React.ReactHTML> = React.ComponentProps<TTag>;
5
6
  type TagPropsType<TTag extends keyof React.ReactHTML> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
6
- interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles {
7
+ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles, ThemeComponentProps {
7
8
  children?: React.ReactNode | ((props: {
8
9
  isHover: boolean;
9
10
  }) => React.ReactNode);
package/box.mjs CHANGED
@@ -1,18 +1,22 @@
1
- import N, { forwardRef as v, useState as b } from "react";
2
- import { c as a } from "./box.module.css.mjs";
3
- import { C as g, a as u } from "./utils/utils.mjs";
4
- function C(n, r) {
5
- const { tag: d, children: e, props: h, className: c, style: l } = n, o = c ? g.classNames(a.box, c) : [a.box];
6
- Object.entries(n).forEach(([t, m]) => {
7
- const p = a[t + m];
8
- p ? o.push(p) : t in u && o.push(`${u[t]}${m}`);
1
+ import $, { forwardRef as b, useState as E } from "react";
2
+ import { c } from "./box.module.css.mjs";
3
+ import { C as T, a as n } from "./utils/utils.mjs";
4
+ import { useTheme as g } from "./theme.mjs";
5
+ function j(r, f) {
6
+ const { tag: p, children: i, props: d, className: l, style: m } = r, e = l ? T.classNames(c.box, l) : [c.box], x = g(r);
7
+ Object.entries(x).forEach(([s, o]) => {
8
+ const a = c[s + o];
9
+ a ? e.push(a) : s in n && e.push(`${n[s]}${o}`);
10
+ }), Object.entries(r).forEach(([s, o]) => {
11
+ const a = c[s + o];
12
+ a ? e.push(a) : s in n && e.push(`${n[s]}${o}`);
9
13
  });
10
- const s = { ...h, className: o.join(" ") };
11
- l && (s.style = l), r && (s.ref = r);
12
- const [x, f] = b(!1), i = typeof e == "function";
13
- return i && (s.onMouseEnter = () => f(!0), s.onMouseLeave = () => f(!1)), N.createElement(d || "div", s, i ? e({ isHover: x }) : e);
14
+ const t = { ...d, className: e.join(" ") };
15
+ m && (t.style = m), f && (t.ref = f);
16
+ const [N, u] = E(!1), h = typeof i == "function";
17
+ return h && (t.onMouseEnter = () => u(!0), t.onMouseLeave = () => u(!1)), $.createElement(p || "div", t, h ? i({ isHover: N }) : i);
14
18
  }
15
- const j = v(C);
19
+ const A = b(j);
16
20
  export {
17
- j as default
21
+ A as default
18
22
  };