@ledgerhq/lumen-ui-react 0.1.4 → 0.1.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,13 +1,13 @@
1
- import { jsx as a, jsxs as x, Fragment as A } from "react/jsx-runtime";
2
- import { createSafeContext as j, cn as p } from "../../../libs/utils-shared/dist/index.js";
1
+ import { jsx as a, jsxs as C, Fragment as L } from "react/jsx-runtime";
2
+ import { createSafeContext as k, cn as c } from "../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as v } from "class-variance-authority";
4
4
  import { t as h } from "../../../node_modules/i18next/dist/esm/i18next.js";
5
- import { useCallback as S } from "react";
6
- import { Tooltip as P, TooltipTrigger as R, TooltipContent as V } from "../Tooltip/Tooltip.js";
7
- import { useControllableState as B } from "../../../utils/useControllableState/useControllableState.js";
8
- import { ExpandRight as q } from "../../Symbols/Icons/ExpandRight.js";
9
- import { ExpandLeft as z } from "../../Symbols/Icons/ExpandLeft.js";
10
- const [E, C] = j("SideBar"), m = {
5
+ import { useCallback as B } from "react";
6
+ import { Tooltip as j, TooltipTrigger as P, TooltipContent as R } from "../Tooltip/Tooltip.js";
7
+ import { useControllableState as x } from "../../../utils/useControllableState/useControllableState.js";
8
+ import { ExpandRight as V } from "../../Symbols/Icons/ExpandRight.js";
9
+ import { ExpandLeft as q } from "../../Symbols/Icons/ExpandLeft.js";
10
+ const [z, S] = k("SideBar"), d = {
11
11
  root: v(
12
12
  [
13
13
  "flex h-full flex-col justify-between gap-16 overflow-y-auto rounded-xl bg-muted-transparent p-16",
@@ -50,36 +50,36 @@ const [E, C] = j("SideBar"), m = {
50
50
  }
51
51
  }
52
52
  )
53
- }, k = ({
54
- ref: r,
53
+ }, E = ({
54
+ ref: n,
55
55
  collapsed: t,
56
56
  defaultCollapsed: e = !1,
57
57
  onCollapsedChange: o,
58
- active: n,
59
- defaultActive: c,
58
+ active: r,
59
+ defaultActive: i,
60
60
  onActiveChange: s,
61
61
  children: f,
62
- className: i,
62
+ className: p,
63
63
  ...b
64
64
  }) => {
65
- const [u, g] = B({
65
+ const [m, g] = x({
66
66
  prop: t,
67
67
  defaultProp: e,
68
68
  onChange: o
69
- }), [l, d] = B({
70
- prop: n,
71
- defaultProp: c ?? "",
69
+ }), [u, l] = x({
70
+ prop: r,
71
+ defaultProp: i ?? "",
72
72
  onChange: s
73
73
  });
74
74
  return /* @__PURE__ */ a(
75
- E,
75
+ z,
76
76
  {
77
- value: { collapsed: u, setCollapsed: g, active: l, onActiveChange: d },
77
+ value: { collapsed: m, setCollapsed: g, active: u, onActiveChange: l },
78
78
  children: /* @__PURE__ */ a(
79
79
  "nav",
80
80
  {
81
- ref: r,
82
- className: p(m.root({ collapsed: u }), i),
81
+ ref: n,
82
+ className: c(d.root({ collapsed: m }), p),
83
83
  "aria-label": h("components.sideBar.navigationAriaLabel"),
84
84
  ...b,
85
85
  children: f
@@ -88,110 +88,110 @@ const [E, C] = j("SideBar"), m = {
88
88
  }
89
89
  );
90
90
  };
91
- k.displayName = "SideBar";
91
+ E.displayName = "SideBar";
92
92
  const F = ({
93
- ref: r,
93
+ ref: n,
94
94
  children: t,
95
95
  className: e,
96
96
  ...o
97
97
  }) => /* @__PURE__ */ a(
98
98
  "div",
99
99
  {
100
- ref: r,
101
- className: p(m.section(), e),
100
+ ref: n,
101
+ className: c(d.section(), e),
102
102
  ...o,
103
103
  children: t
104
104
  }
105
105
  );
106
106
  F.displayName = "SideBarLeading";
107
107
  const J = ({
108
- ref: r,
108
+ ref: n,
109
109
  children: t,
110
110
  className: e,
111
111
  ...o
112
112
  }) => /* @__PURE__ */ a(
113
113
  "div",
114
114
  {
115
- ref: r,
116
- className: p("mt-auto", m.section(), e),
115
+ ref: n,
116
+ className: c("mt-auto", d.section(), e),
117
117
  ...o,
118
118
  children: t
119
119
  }
120
120
  );
121
121
  J.displayName = "SideBarTrailing";
122
122
  const K = ({
123
- ref: r,
123
+ ref: n,
124
124
  value: t,
125
125
  icon: e,
126
126
  activeIcon: o,
127
- label: n,
128
- tooltipContent: c,
127
+ label: r,
128
+ tooltipContent: i,
129
129
  disabled: s = !1,
130
130
  className: f,
131
- onClick: i,
131
+ onClick: p,
132
132
  ...b
133
133
  }) => {
134
- const { collapsed: u, active: g, onActiveChange: l } = C({
134
+ const { collapsed: m, active: g, onActiveChange: u } = S({
135
135
  consumerName: "SideBarItem",
136
136
  contextRequired: !0
137
- }), d = g === t, N = d ? o : e, y = c ?? n, T = S(
138
- (L) => {
139
- s || (i == null || i(L), l == null || l(t));
137
+ }), l = g === t, N = l ? o : e, y = i ?? r, T = B(
138
+ (I) => {
139
+ s || (p?.(I), u?.(t));
140
140
  },
141
- [s, i, l, t]
142
- ), w = /* @__PURE__ */ x(A, { children: [
141
+ [s, p, u, t]
142
+ ), w = /* @__PURE__ */ C(L, { children: [
143
143
  /* @__PURE__ */ a(N, { size: 20, className: "shrink-0" }),
144
- n != null && /* @__PURE__ */ a("span", { className: "translate-x-8 truncate", children: n })
145
- ] }), I = /* @__PURE__ */ a(
144
+ r != null && /* @__PURE__ */ a("span", { className: "translate-x-8 truncate", children: r })
145
+ ] }), A = /* @__PURE__ */ a(
146
146
  "button",
147
147
  {
148
- ref: r,
148
+ ref: n,
149
149
  type: "button",
150
150
  disabled: s,
151
151
  onClick: T,
152
- className: p(
153
- m.item({ active: d, disabled: s }),
152
+ className: c(
153
+ d.item({ active: l, disabled: s }),
154
154
  f
155
155
  ),
156
- "aria-current": d ? "page" : void 0,
156
+ "aria-current": l ? "page" : void 0,
157
157
  ...b,
158
158
  children: w
159
159
  }
160
160
  );
161
- return /* @__PURE__ */ x(P, { open: u ? void 0 : !1, children: [
162
- /* @__PURE__ */ a(R, { asChild: !0, children: I }),
163
- /* @__PURE__ */ a(V, { side: "right", sideOffset: 8, children: y })
161
+ return /* @__PURE__ */ C(j, { open: m ? void 0 : !1, children: [
162
+ /* @__PURE__ */ a(P, { asChild: !0, children: A }),
163
+ /* @__PURE__ */ a(R, { side: "right", sideOffset: 8, children: y })
164
164
  ] });
165
165
  };
166
166
  K.displayName = "SideBarItem";
167
167
  const O = ({
168
- className: r,
168
+ className: n,
169
169
  ...t
170
170
  }) => {
171
- const { collapsed: e, setCollapsed: o } = C({
171
+ const { collapsed: e, setCollapsed: o } = S({
172
172
  consumerName: "SideBarCollapseToggle",
173
173
  contextRequired: !0
174
- }), n = S(() => {
174
+ }), r = B(() => {
175
175
  o(!e);
176
- }, [e, o]), c = e ? q : z;
176
+ }, [e, o]), i = e ? V : q;
177
177
  return /* @__PURE__ */ a(
178
178
  "button",
179
179
  {
180
180
  type: "button",
181
- onClick: n,
182
- className: p(
183
- m.item({ active: !1, disabled: !1 }),
184
- r
181
+ onClick: r,
182
+ className: c(
183
+ d.item({ active: !1, disabled: !1 }),
184
+ n
185
185
  ),
186
186
  "aria-label": e ? h("components.sideBar.expandAriaLabel") : h("components.sideBar.collapseAriaLabel"),
187
187
  ...t,
188
- children: /* @__PURE__ */ a(c, { size: 20, className: "shrink-0" })
188
+ children: /* @__PURE__ */ a(i, { size: 20, className: "shrink-0" })
189
189
  }
190
190
  );
191
191
  };
192
192
  O.displayName = "SideBarCollapseToggle";
193
193
  export {
194
- k as SideBar,
194
+ E as SideBar,
195
195
  O as SideBarCollapseToggle,
196
196
  K as SideBarItem,
197
197
  F as SideBarLeading,
@@ -1,15 +1,15 @@
1
1
  import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
2
  import { createSafeContext as N, cn as c } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as o } from "class-variance-authority";
3
+ import { cva as s } from "class-variance-authority";
4
4
  import { useThrottledScrollBottom as T } from "./utils/useThrottledScrollBottom.js";
5
5
  import { Spot as g } from "../Spot/Spot.js";
6
6
  import { Information as w } from "../../Symbols/Icons/Information.js";
7
- import { useCommonTranslation as R } from "../../../i18n/useCommonTranslation.js";
8
- import { ChevronUpDown as B } from "../../Symbols/Icons/ChevronUpDown.js";
9
- import { ChevronDescending as C } from "../../Symbols/Icons/ChevronDescending.js";
7
+ import { useCommonTranslation as C } from "../../../i18n/useCommonTranslation.js";
8
+ import { ChevronUpDown as R } from "../../Symbols/Icons/ChevronUpDown.js";
9
+ import { ChevronDescending as B } from "../../Symbols/Icons/ChevronDescending.js";
10
10
  import { ChevronAscending as j } from "../../Symbols/Icons/ChevronAscending.js";
11
11
  import { InteractiveIcon as H } from "../InteractiveIcon/InteractiveIcon.js";
12
- const [A, u] = N("Table"), I = o(
12
+ const [A, u] = N("Table"), I = s(
13
13
  "relative scrollbar-none w-full max-w-full border-collapse overflow-x-auto rounded-lg",
14
14
  {
15
15
  variants: {
@@ -25,7 +25,7 @@ const [A, u] = N("Table"), I = o(
25
25
  className: a,
26
26
  onScrollBottom: l,
27
27
  loading: r,
28
- ref: s,
28
+ ref: o,
29
29
  ...i
30
30
  }) => {
31
31
  const d = T({
@@ -36,7 +36,7 @@ const [A, u] = N("Table"), I = o(
36
36
  "div",
37
37
  {
38
38
  ...i,
39
- ref: s,
39
+ ref: o,
40
40
  className: I({ appearance: e, className: a }),
41
41
  onScroll: d,
42
42
  children: t
@@ -44,7 +44,7 @@ const [A, u] = N("Table"), I = o(
44
44
  ) });
45
45
  };
46
46
  L.displayName = "TableRoot";
47
- const V = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
47
+ const S = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
48
48
  "table",
49
49
  {
50
50
  ...l,
@@ -53,28 +53,28 @@ const V = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
53
53
  children: t
54
54
  }
55
55
  );
56
- V.displayName = "Table";
57
- const S = ({
56
+ S.displayName = "Table";
57
+ const V = ({
58
58
  children: t,
59
59
  className: e,
60
60
  ref: a,
61
61
  ...l
62
62
  }) => /* @__PURE__ */ n("thead", { ref: a, className: e, ...l, children: t });
63
- S.displayName = "TableHeader";
64
- const q = ({
63
+ V.displayName = "TableHeader";
64
+ const k = ({
65
65
  children: t,
66
66
  className: e,
67
67
  ref: a,
68
68
  ...l
69
69
  }) => /* @__PURE__ */ n("tbody", { ref: a, className: e, ...l, children: t });
70
- q.displayName = "TableBody";
71
- const z = ({
70
+ k.displayName = "TableBody";
71
+ const q = ({
72
72
  children: t,
73
73
  className: e,
74
74
  clickable: a = !1,
75
75
  onClick: l,
76
76
  ref: r,
77
- ...s
77
+ ...o
78
78
  }) => /* @__PURE__ */ n(
79
79
  "tr",
80
80
  {
@@ -85,19 +85,19 @@ const z = ({
85
85
  a && "cursor-pointer outline-none select-none hover:bg-base-transparent-hover active:bg-base-transparent-pressed",
86
86
  e
87
87
  ),
88
- ...s,
88
+ ...o,
89
89
  children: t
90
90
  }
91
91
  );
92
- z.displayName = "TableRow";
93
- const G = o("sticky top-0", {
92
+ q.displayName = "TableRow";
93
+ const z = s("sticky top-0", {
94
94
  variants: {
95
95
  appearance: {
96
96
  "no-background": "bg-canvas",
97
97
  plain: "bg-surface"
98
98
  }
99
99
  }
100
- }), M = ({
100
+ }), G = ({
101
101
  children: t,
102
102
  className: e,
103
103
  ref: a,
@@ -111,21 +111,21 @@ const G = o("sticky top-0", {
111
111
  "tr",
112
112
  {
113
113
  ref: a,
114
- className: G({ appearance: r, className: e }),
114
+ className: z({ appearance: r, className: e }),
115
115
  ...l,
116
116
  children: t
117
117
  }
118
118
  );
119
119
  };
120
- M.displayName = "TableHeaderRow";
121
- const k = ({
120
+ G.displayName = "TableHeaderRow";
121
+ const M = ({
122
122
  children: t,
123
123
  className: e,
124
124
  colSpan: a = 1,
125
125
  ref: l,
126
126
  ...r
127
127
  }) => {
128
- const { appearance: s } = u({
128
+ const { appearance: o } = u({
129
129
  consumerName: "TableGroupHeaderRow",
130
130
  contextRequired: !0
131
131
  });
@@ -134,15 +134,15 @@ const k = ({
134
134
  {
135
135
  className: c(
136
136
  "flex h-32 w-full items-center bg-muted px-12 body-3 text-base",
137
- s === "no-background" && "rounded-sm"
137
+ o === "no-background" && "rounded-sm"
138
138
  ),
139
139
  children: t
140
140
  }
141
141
  ) }) });
142
142
  };
143
- k.displayName = "TableGroupHeaderRow";
143
+ M.displayName = "TableGroupHeaderRow";
144
144
  const p = {
145
- root: o(
145
+ root: s(
146
146
  "h-64 truncate p-12 body-3 text-base first:rounded-l-md last:rounded-r-md",
147
147
  {
148
148
  variants: {
@@ -156,7 +156,7 @@ const p = {
156
156
  }
157
157
  }
158
158
  ),
159
- inner: o("flex flex-1 justify-end", {
159
+ inner: s("flex flex-1 justify-end", {
160
160
  variants: {
161
161
  align: {
162
162
  start: "text-start justify-start",
@@ -170,18 +170,18 @@ const p = {
170
170
  hideBelow: a,
171
171
  align: l = "start",
172
172
  ref: r,
173
- ...s
173
+ ...o
174
174
  }) => /* @__PURE__ */ n(
175
175
  "td",
176
176
  {
177
177
  ref: r,
178
178
  className: p.root({ hideBelow: a, className: e }),
179
- ...s,
179
+ ...o,
180
180
  children: /* @__PURE__ */ n("div", { className: p.inner({ align: l }), children: t })
181
181
  }
182
182
  );
183
183
  J.displayName = "TableCell";
184
- const K = o("flex items-center gap-12 truncate", {
184
+ const K = s("flex items-center gap-12 truncate", {
185
185
  variants: {
186
186
  align: {
187
187
  start: "text-start",
@@ -194,12 +194,12 @@ const K = o("flex items-center gap-12 truncate", {
194
194
  leadingContent: a,
195
195
  title: l,
196
196
  description: r,
197
- ref: s,
197
+ ref: o,
198
198
  ...i
199
199
  }) => /* @__PURE__ */ m(
200
200
  "div",
201
201
  {
202
- ref: s,
202
+ ref: o,
203
203
  className: K({ align: e, className: t }),
204
204
  ...i,
205
205
  children: [
@@ -213,7 +213,7 @@ const K = o("flex items-center gap-12 truncate", {
213
213
  );
214
214
  P.displayName = "TableCellContent";
215
215
  const f = {
216
- root: o("group h-40 truncate p-12 body-3 text-base", {
216
+ root: s("group h-40 truncate p-12 body-3 text-base", {
217
217
  variants: {
218
218
  hideBelow: {
219
219
  xs: "hidden xs:table-cell",
@@ -224,7 +224,7 @@ const f = {
224
224
  }
225
225
  }
226
226
  }),
227
- content: o("flex min-w-0 items-center gap-4 truncate", {
227
+ content: s("flex min-w-0 items-center gap-4 truncate", {
228
228
  variants: {
229
229
  align: {
230
230
  start: "text-start justify-start",
@@ -232,7 +232,7 @@ const f = {
232
232
  }
233
233
  }
234
234
  }),
235
- trailingContent: o(
235
+ trailingContent: s(
236
236
  "flex items-center justify-center opacity-0 group-hover:opacity-100"
237
237
  )
238
238
  }, U = ({
@@ -241,7 +241,7 @@ const f = {
241
241
  scope: a = "col",
242
242
  hideBelow: l,
243
243
  align: r = "start",
244
- trailingContent: s,
244
+ trailingContent: o,
245
245
  ref: i,
246
246
  ...d
247
247
  }) => /* @__PURE__ */ n(
@@ -253,7 +253,7 @@ const f = {
253
253
  ...d,
254
254
  children: /* @__PURE__ */ n("div", { className: "min-w-0", children: /* @__PURE__ */ m("div", { className: f.content({ align: r }), children: [
255
255
  /* @__PURE__ */ n("span", { className: c("truncate", r === "end" && "order-1"), children: t }),
256
- /* @__PURE__ */ n("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: s })
256
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: o })
257
257
  ] }) })
258
258
  }
259
259
  );
@@ -343,10 +343,10 @@ const W = ({
343
343
  W.displayName = "TableInfoIcon";
344
344
  const X = {
345
345
  asc: j,
346
- desc: C,
347
- idle: B
346
+ desc: B,
347
+ idle: R
348
348
  }, v = {
349
- root: o(
349
+ root: s(
350
350
  [
351
351
  "flex min-w-0 cursor-pointer items-center gap-4",
352
352
  "rounded-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
@@ -360,7 +360,7 @@ const X = {
360
360
  }
361
361
  }
362
362
  ),
363
- icon: o("", {
363
+ icon: s("", {
364
364
  variants: {
365
365
  active: {
366
366
  true: "opacity-100",
@@ -374,11 +374,11 @@ const X = {
374
374
  align: a = "start",
375
375
  onToggleSort: l,
376
376
  className: r,
377
- onClick: s,
377
+ onClick: o,
378
378
  ref: i,
379
379
  ...d
380
380
  }) => {
381
- const { t: b } = R(), x = X[e || "idle"], h = {
381
+ const { t: b } = C(), x = X[e || "idle"], h = {
382
382
  asc: b("table.ascAriaLabel"),
383
383
  desc: b("table.descAriaLabel")
384
384
  };
@@ -391,7 +391,7 @@ const X = {
391
391
  className: v.root({ align: a, className: r }),
392
392
  "aria-label": e ? h[e] : void 0,
393
393
  onClick: (y) => {
394
- s == null || s(y), l == null || l(e === "asc" ? "desc" : "asc");
394
+ o?.(y), l?.(e === "asc" ? "desc" : "asc");
395
395
  },
396
396
  children: [
397
397
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t }),
@@ -410,20 +410,20 @@ const X = {
410
410
  };
411
411
  Y.displayName = "TableSortButton";
412
412
  export {
413
- V as Table,
413
+ S as Table,
414
414
  E as TableActionBar,
415
415
  F as TableActionBarLeading,
416
416
  O as TableActionBarTrailing,
417
- q as TableBody,
417
+ k as TableBody,
418
418
  J as TableCell,
419
419
  P as TableCellContent,
420
- k as TableGroupHeaderRow,
421
- S as TableHeader,
420
+ M as TableGroupHeaderRow,
421
+ V as TableHeader,
422
422
  U as TableHeaderCell,
423
- M as TableHeaderRow,
423
+ G as TableHeaderRow,
424
424
  W as TableInfoIcon,
425
425
  Q as TableLoadingRow,
426
426
  L as TableRoot,
427
- z as TableRow,
427
+ q as TableRow,
428
428
  Y as TableSortButton
429
429
  };
@@ -1,37 +1,36 @@
1
1
  import { throttle as h } from "../../../../libs/utils-shared/dist/index.js";
2
- import { useMemo as L, useRef as u, useEffect as _ } from "react";
2
+ import { useMemo as L, useRef as s, useEffect as _ } from "react";
3
3
  import { TABLE_SCROLL_BOTTOM_THRESHOLD_IN_ROW as R, TABLE_CELL_HEIGHT as a } from "../constants.js";
4
4
  const m = 150, E = ({
5
5
  element: t,
6
- threshold: c = 10
6
+ threshold: r = 10
7
7
  }) => {
8
- const { scrollTop: n, scrollHeight: o, clientHeight: e } = t;
9
- return n + e >= o - c;
8
+ const { scrollTop: c, scrollHeight: n, clientHeight: e } = t;
9
+ return c + e >= n - r;
10
10
  }, p = ({
11
11
  onScrollBottom: t,
12
- loading: c = !1,
13
- thresholdInRow: n = R
12
+ loading: r = !1,
13
+ thresholdInRow: c = R
14
14
  }) => {
15
- const o = L(
16
- () => n * a,
17
- [n]
18
- ), e = u(t), l = u(c);
19
- e.current = t, l.current = c;
20
- const f = u(null), i = L(() => {
15
+ const n = L(
16
+ () => c * a,
17
+ [c]
18
+ ), e = s(t), u = s(r);
19
+ e.current = t, u.current = r;
20
+ const l = s(null), f = L(() => {
21
21
  if (!t)
22
22
  return;
23
- const r = h((s) => {
24
- l.current || !e.current || E({ element: s, threshold: o }) && e.current();
23
+ const i = h((o) => {
24
+ u.current || !e.current || E({ element: o, threshold: n }) && e.current();
25
25
  }, m);
26
- return f.current = r, (s) => {
27
- const T = s.currentTarget;
28
- T && r(T);
26
+ return l.current = i, (o) => {
27
+ const T = o.currentTarget;
28
+ T && i(T);
29
29
  };
30
- }, [t, o]);
30
+ }, [t, n]);
31
31
  return _(() => () => {
32
- var r;
33
- (r = f.current) == null || r.cancel();
34
- }, [i]), i;
32
+ l.current?.cancel();
33
+ }, [f]), f;
35
34
  };
36
35
  export {
37
36
  E as isScrolledToBottom,
@@ -1,11 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { ThemeMode, ThemeProviderProps } from './ThemeProvider.types';
3
- declare const ThemeProvider: FC<ThemeProviderProps>;
4
- declare const useTheme: () => {
5
- toggleMode: () => void;
6
- mode: ThemeMode;
7
- setMode: (mode: ThemeMode) => void;
8
- locale: ThemeProviderProps["locale"];
9
- };
10
- export { ThemeProvider, useTheme };
2
+ import { ThemeProviderProps } from './ThemeProvider.types';
3
+ export declare const ThemeProvider: FC<ThemeProviderProps>;
11
4
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAiBtE,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAuBzC,CAAC;AAEF,QAAA,MAAM,QAAQ;;UAjCN,SAAS;aACN,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI;YAC1B,kBAAkB,CAAC,QAAQ,CAAC;CAyCrC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAU1E,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAoBhD,CAAC"}
@@ -1,35 +1,24 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import { createSafeContext as i } from "../../../libs/utils-shared/dist/index.js";
3
- import { useState as u, useMemo as c } from "react";
4
- import { SYSTEM_MODE as M, useRootColorModeSideEffect as f, LIGHT_MODE as T, DARK_MODE as m } from "./useRootColorModeSideEffect.js";
5
- import { I18nProvider as h } from "../../../i18n/I18nProvider.js";
6
- const [x, p] = i("ThemeProvider"), D = ({
7
- children: e,
8
- defaultMode: s = M,
3
+ import { useMemo as f } from "react";
4
+ import { COLOR_SCHEMES as s } from "./ThemeProvider.types.js";
5
+ import { useRootColorModeSideEffect as n } from "./useRootColorModeSideEffect.js";
6
+ import { I18nProvider as d } from "../../../i18n/I18nProvider.js";
7
+ const [p] = i("ThemeProvider"), M = ({
8
+ children: t,
9
+ colorScheme: r = s.system,
9
10
  locale: o
10
11
  }) => {
11
- const [t, n] = u(s);
12
- f({ mode: t });
13
- const d = c(
12
+ n({ colorScheme: r });
13
+ const m = f(
14
14
  () => ({
15
- mode: t,
16
- setMode: n,
15
+ colorScheme: r,
17
16
  locale: o
18
17
  }),
19
- [t, o]
18
+ [r, o]
20
19
  );
21
- return /* @__PURE__ */ r(x, { value: d, children: /* @__PURE__ */ r(h, { locale: o, children: e }) });
22
- }, P = () => {
23
- const e = p({
24
- consumerName: "useTheme",
25
- contextRequired: !0
26
- });
27
- return {
28
- ...e,
29
- toggleMode: () => e.setMode(e.mode === m ? T : m)
30
- };
20
+ return /* @__PURE__ */ e(p, { value: m, children: /* @__PURE__ */ e(d, { locale: o, children: t }) });
31
21
  };
32
22
  export {
33
- D as ThemeProvider,
34
- P as useTheme
23
+ M as ThemeProvider
35
24
  };