@orion-ds/react 5.3.0 → 5.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.
@@ -1,24 +1,40 @@
1
+ const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
2
+ async function i(e) {
3
+ const t = Array.isArray(e) ? e : [e];
4
+ return (await Promise.all(
5
+ t.map(async (s) => {
6
+ if (o.has(s))
7
+ return o.get(s) ?? !1;
8
+ if (a.has(s))
9
+ return a.get(s);
10
+ const n = (async () => {
11
+ try {
12
+ return await import(s), o.set(s, !0), !0;
13
+ } catch {
14
+ return o.set(s, !1), !1;
15
+ }
16
+ })();
17
+ a.set(s, n);
18
+ const c = await n;
19
+ return a.delete(s), c;
20
+ })
21
+ )).every(Boolean);
22
+ }
1
23
  function d(e) {
2
- return (Array.isArray(e) ? e : [e]).every((o) => {
3
- try {
4
- return require(o), !0;
5
- } catch {
6
- return !1;
7
- }
8
- });
24
+ return (Array.isArray(e) ? e : [e]).every((r) => o.has(r) ? o.get(r) ?? !1 : !0);
9
25
  }
10
- function n(e, r, o) {
11
- const s = (Array.isArray(r) ? r : [r]).join(" ");
26
+ async function l(e, t, r) {
27
+ const n = (Array.isArray(t) ? t : [t]).join(" ");
12
28
  return {
13
- available: d(r),
29
+ available: await i(t),
14
30
  componentName: e,
15
- depName: r,
16
- installCommand: `npm install ${s}`,
17
- pnpmCommand: `pnpm add ${s}`,
18
- docsUrl: o
31
+ depName: t,
32
+ installCommand: `npm install ${n}`,
33
+ pnpmCommand: `pnpm add ${n}`,
34
+ docsUrl: r
19
35
  };
20
36
  }
21
- const a = {
37
+ const p = {
22
38
  Chart: {
23
39
  depName: "recharts",
24
40
  docsUrl: "https://docs.orion-ds.dev/components/chart"
@@ -44,12 +60,15 @@ const a = {
44
60
  docsUrl: "https://docs.orion-ds.dev/components/collapsible-folder"
45
61
  }
46
62
  };
47
- function c(e) {
48
- const r = a[e], o = Array.isArray(r.depName) ? [...r.depName] : r.depName, t = n(e, o, r.docsUrl);
49
- return t.available ? void 0 : t;
63
+ function h(e) {
64
+ const t = p[e], r = Array.isArray(t.depName) ? [...t.depName] : t.depName;
65
+ if (!d(r))
66
+ return l(e, r, t.docsUrl).then(
67
+ (n) => n.available ? void 0 : n
68
+ );
50
69
  }
51
70
  export {
52
- a as OPTIONAL_DEP_COMPONENTS,
53
- c as checkComponent,
54
- n as getOptionalDepError
71
+ p as OPTIONAL_DEP_COMPONENTS,
72
+ h as checkComponent,
73
+ l as getOptionalDepError
55
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-ds/react",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "type": "module",
5
5
  "description": "Orion Design System - React component library with 40+ AI-ready components and 9 templates",
6
6
  "author": "Orion Design System Team",