@ledgerhq/lumen-ui-react 0.1.3 → 0.1.5

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,20 +1,17 @@
1
- var c = Object.defineProperty;
2
- var o = (a, e, s) => e in a ? c(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s;
3
- var t = (a, e, s) => o(a, typeof e != "symbol" ? e + "" : e, s);
4
- import { createContext as p } from "react";
5
- const d = p();
6
- class N {
1
+ import { createContext as a } from "react";
2
+ const o = a();
3
+ class p {
7
4
  constructor() {
8
- t(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
9
5
  this.usedNamespaces = {};
10
6
  }
11
- addUsedNamespaces(e) {
12
- e.forEach((s) => {
13
- this.usedNamespaces[s] || (this.usedNamespaces[s] = !0);
7
+ addUsedNamespaces(s) {
8
+ s.forEach((e) => {
9
+ this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
14
10
  });
15
11
  }
12
+ getUsedNamespaces = () => Object.keys(this.usedNamespaces);
16
13
  }
17
14
  export {
18
- d as I18nContext,
19
- N as ReportNamespaces
15
+ o as I18nContext,
16
+ p as ReportNamespaces
20
17
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -1,25 +1,24 @@
1
- import { useState as d, useRef as i, useCallback as V, startTransition as b, useEffect as m } from "react";
2
- function y({
1
+ import { useState as S, useRef as l, useCallback as d, startTransition as C, useEffect as R } from "react";
2
+ function b({
3
3
  prop: t,
4
- defaultProp: f,
5
- onChange: r
4
+ defaultProp: i,
5
+ onChange: c
6
6
  }) {
7
- const [v, a] = d(t ?? f), n = t !== void 0, l = n ? t : v, e = i(r);
8
- e.current = r;
9
- const s = i(l), S = V(
10
- (u) => {
11
- var o;
12
- const c = typeof u == "function" ? u(s.current) : u;
13
- n || b(() => {
14
- a(c);
15
- }), (o = e.current) == null || o.call(e, c), s.current = c;
7
+ const [f, r] = S(t ?? i), e = t !== void 0, a = e ? t : f, o = l(c);
8
+ o.current = c;
9
+ const n = l(a), v = d(
10
+ (s) => {
11
+ const u = typeof s == "function" ? s(n.current) : s;
12
+ e || C(() => {
13
+ r(u);
14
+ }), o.current?.(u), n.current = u;
16
15
  },
17
- [n]
16
+ [e]
18
17
  );
19
- return m(() => {
20
- t !== void 0 && (a(t), s.current = t);
21
- }, [t]), [l, S];
18
+ return R(() => {
19
+ t !== void 0 && (r(t), n.current = t);
20
+ }, [t]), [a, v];
22
21
  }
23
22
  export {
24
- y as useControllableState
23
+ b as useControllableState
25
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [