@cronocode/react-box 1.2.6 → 1.2.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.
@@ -1,8 +1,8 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as a } from "react";
3
- import m from "../box.mjs";
4
- import { O as s } from "../utils/utils.mjs";
5
- import { T as i } from "../theme.mjs";
3
+ import i from "../box.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
+ import { useTheme as s } from "../theme.mjs";
6
6
  import "../box.module.css.mjs";
7
7
  const u = [
8
8
  "name",
@@ -19,8 +19,8 @@ const u = [
19
19
  "pattern"
20
20
  ];
21
21
  function p(t, e) {
22
- const o = i.useTheme("textbox", t), r = s.buildProps(t, u, o);
23
- return /* @__PURE__ */ n(m, { ref: e, tag: "input", inline: !0, ...r });
22
+ const o = s("textbox", t), r = m.buildProps(t, u, o);
23
+ return /* @__PURE__ */ n(i, { ref: e, tag: "input", inline: !0, ...r });
24
24
  }
25
25
  const h = a(p);
26
26
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "main": "./box.mjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",
package/theme.d.ts CHANGED
@@ -19,7 +19,7 @@ declare namespace Theme {
19
19
  }
20
20
  export let Styles: ThemeComponentStyles;
21
21
  export function setup(styles: ThemeComponentStyles): void;
22
- export function useTheme(component: keyof ThemeComponentStyles, props: ThemeComponentProps): BoxStyles;
23
22
  export {};
24
23
  }
25
24
  export default Theme;
25
+ export declare function useTheme(component: keyof Theme.ThemeComponentStyles, props: Theme.ThemeComponentProps): BoxStyles;
package/theme.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { useMemo as f } from "react";
2
- var n;
1
+ import { useMemo as m } from "react";
2
+ var r;
3
3
  ((t) => {
4
4
  t.Styles = {};
5
- function y(l) {
5
+ function n(l) {
6
6
  t.Styles = l;
7
7
  }
8
- t.setup = y;
9
- function a(l, m) {
10
- const { clean: u, disabled: i, theme: s } = m;
11
- return f(() => {
12
- var d, o;
13
- if (u)
14
- return {};
15
- let e = t.Styles[l];
16
- if (!e)
17
- return {};
18
- let r = s ? { ...e.styles, ...(d = e.themes) == null ? void 0 : d[s].styles } : e.styles;
19
- return i ? s ? { ...r, ...e.disabled, ...(o = e.themes) == null ? void 0 : o[s].disabled } : { ...r, ...e.disabled } : r;
20
- }, [l, u, i, s]);
21
- }
22
- t.useTheme = a;
23
- })(n || (n = {}));
24
- const S = n;
8
+ t.setup = n;
9
+ })(r || (r = {}));
10
+ const y = r;
11
+ function f(t, n) {
12
+ const { clean: l, disabled: i, theme: s } = n;
13
+ return m(() => {
14
+ var d, a;
15
+ if (l)
16
+ return {};
17
+ let e = r.Styles[t];
18
+ if (!e)
19
+ return {};
20
+ let u = s ? { ...e.styles, ...(d = e.themes) == null ? void 0 : d[s].styles } : e.styles;
21
+ return i ? s ? { ...u, ...e.disabled, ...(a = e.themes) == null ? void 0 : a[s].disabled } : { ...u, ...e.disabled } : u;
22
+ }, [t, l, i, s]);
23
+ }
25
24
  export {
26
- S as T
25
+ y as default,
26
+ f as useTheme
27
27
  };