@ledgerhq/lumen-ui-react 0.1.4 → 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,10 +1,10 @@
1
1
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
2
  import { cn as o } from "../../../libs/utils-shared/dist/index.js";
3
3
  import * as t from "@radix-ui/react-dropdown-menu";
4
- import { Check as c } from "../../Symbols/Icons/Check.js";
5
- import { Divider as b } from "../Divider/Divider.js";
6
- import { ChevronRight as N } from "../../Symbols/Icons/ChevronRight.js";
7
- const p = o(
4
+ import { Check as u } from "../../Symbols/Icons/Check.js";
5
+ import { Divider as p } from "../Divider/Divider.js";
6
+ import { ChevronRight as b } from "../../Symbols/Icons/ChevronRight.js";
7
+ const c = o(
8
8
  "z-menu min-w-160 overflow-hidden rounded-sm bg-muted p-8",
9
9
  "shadow-sm",
10
10
  "data-[state=open]:animate-fade-in",
@@ -17,14 +17,14 @@ const p = o(
17
17
  "focus:bg-base-transparent-hover",
18
18
  "active:bg-base-transparent-pressed",
19
19
  "data-disabled:pointer-events-none data-disabled:text-disabled"
20
- ), g = o("px-8 py-4 body-3-semi-bold text-muted"), y = o(
20
+ ), N = o("px-8 py-4 body-3-semi-bold text-muted"), g = o(
21
21
  m,
22
22
  "data-[state=open]:bg-base-transparent-hover"
23
23
  );
24
- function j({ ...e }) {
24
+ function P({ ...e }) {
25
25
  return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
26
26
  }
27
- const f = ({ ref: e, ...n }) => /* @__PURE__ */ a(
27
+ const y = ({ ref: e, ...n }) => /* @__PURE__ */ a(
28
28
  t.Trigger,
29
29
  {
30
30
  ref: e,
@@ -32,24 +32,24 @@ const f = ({ ref: e, ...n }) => /* @__PURE__ */ a(
32
32
  ...n
33
33
  }
34
34
  );
35
- f.displayName = t.Trigger.displayName;
36
- function G({ ...e }) {
35
+ y.displayName = t.Trigger.displayName;
36
+ function j({ ...e }) {
37
37
  return /* @__PURE__ */ a(t.Group, { "data-slot": "menu-group", ...e });
38
38
  }
39
- function L({
39
+ function G({
40
40
  ...e
41
41
  }) {
42
42
  return /* @__PURE__ */ a(t.Portal, { ...e });
43
43
  }
44
- function D({
44
+ function L({
45
45
  ...e
46
46
  }) {
47
47
  return /* @__PURE__ */ a(t.Sub, { ...e });
48
48
  }
49
- function K({ ...e }) {
49
+ function D({ ...e }) {
50
50
  return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
51
51
  }
52
- const h = ({
52
+ const f = ({
53
53
  ref: e,
54
54
  className: n,
55
55
  inset: s,
@@ -60,26 +60,26 @@ const h = ({
60
60
  {
61
61
  ref: e,
62
62
  "data-slot": "menu-sub-trigger",
63
- className: o(y, s && "pl-32", n),
63
+ className: o(g, s && "pl-32", n),
64
64
  ...r,
65
65
  children: [
66
66
  i,
67
- /* @__PURE__ */ a(N, { size: 20, className: "ml-auto text-muted" })
67
+ /* @__PURE__ */ a(b, { size: 20, className: "ml-auto text-muted" })
68
68
  ]
69
69
  }
70
70
  );
71
- h.displayName = t.SubTrigger.displayName;
72
- const x = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(
71
+ f.displayName = t.SubTrigger.displayName;
72
+ const h = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(
73
73
  t.SubContent,
74
74
  {
75
75
  ref: e,
76
76
  "data-slot": "menu-sub-content",
77
- className: o(p, n),
77
+ className: o(c, n),
78
78
  ...s
79
79
  }
80
80
  );
81
- x.displayName = t.SubContent.displayName;
82
- const M = ({
81
+ h.displayName = t.SubContent.displayName;
82
+ const x = ({
83
83
  ref: e,
84
84
  className: n,
85
85
  sideOffset: s = 4,
@@ -91,17 +91,16 @@ const M = ({
91
91
  ref: e,
92
92
  "data-slot": "menu-content",
93
93
  sideOffset: s,
94
- className: o(p, n),
94
+ className: o(c, n),
95
95
  onClick: (d) => {
96
- var u;
97
- d.stopPropagation(), (u = r.onClick) == null || u.call(r, d);
96
+ d.stopPropagation(), r.onClick?.(d);
98
97
  },
99
98
  align: i,
100
99
  ...r
101
100
  }
102
101
  ) });
103
- M.displayName = t.Content.displayName;
104
- const S = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
102
+ x.displayName = t.Content.displayName;
103
+ const M = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
105
104
  t.Item,
106
105
  {
107
106
  ref: e,
@@ -110,8 +109,8 @@ const S = ({ ref: e, className: n, inset: s, ...i }) => /* @__PURE__ */ a(
110
109
  ...i
111
110
  }
112
111
  );
113
- S.displayName = t.Item.displayName;
114
- const C = ({
112
+ M.displayName = t.Item.displayName;
113
+ const S = ({
115
114
  ref: e,
116
115
  className: n,
117
116
  children: s,
@@ -127,12 +126,12 @@ const C = ({
127
126
  ...r,
128
127
  children: [
129
128
  s,
130
- /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(c, { size: 24, className: "text-active" }) }) })
129
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(u, { size: 24, className: "text-active" }) }) })
131
130
  ]
132
131
  }
133
132
  );
134
- C.displayName = t.CheckboxItem.displayName;
135
- const I = ({
133
+ S.displayName = t.CheckboxItem.displayName;
134
+ const C = ({
136
135
  ref: e,
137
136
  className: n,
138
137
  children: s,
@@ -146,12 +145,12 @@ const I = ({
146
145
  ...i,
147
146
  children: [
148
147
  s,
149
- /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(c, { size: 24, className: "text-active" }) }) })
148
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(u, { size: 24, className: "text-active" }) }) })
150
149
  ]
151
150
  }
152
151
  );
153
- I.displayName = t.RadioItem.displayName;
154
- const v = ({
152
+ C.displayName = t.RadioItem.displayName;
153
+ const I = ({
155
154
  ref: e,
156
155
  className: n,
157
156
  inset: s,
@@ -161,26 +160,26 @@ const v = ({
161
160
  {
162
161
  ref: e,
163
162
  "data-slot": "menu-label",
164
- className: o(g, s && "pl-32", n),
163
+ className: o(N, s && "pl-32", n),
165
164
  ...i
166
165
  }
167
166
  );
168
- v.displayName = t.Label.displayName;
169
- const k = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(b, { ref: e, className: o("mx-8 my-4 w-auto", n), ...s });
170
- k.displayName = "MenuSeparator";
167
+ I.displayName = t.Label.displayName;
168
+ const v = ({ ref: e, className: n, ...s }) => /* @__PURE__ */ a(p, { ref: e, className: o("mx-8 my-4 w-auto", n), ...s });
169
+ v.displayName = "MenuSeparator";
171
170
  export {
172
- j as Menu,
173
- C as MenuCheckboxItem,
174
- M as MenuContent,
175
- G as MenuGroup,
176
- S as MenuItem,
177
- v as MenuLabel,
178
- L as MenuPortal,
179
- K as MenuRadioGroup,
180
- I as MenuRadioItem,
181
- k as MenuSeparator,
182
- D as MenuSub,
183
- x as MenuSubContent,
184
- h as MenuSubTrigger,
185
- f as MenuTrigger
171
+ P as Menu,
172
+ S as MenuCheckboxItem,
173
+ x as MenuContent,
174
+ j as MenuGroup,
175
+ M as MenuItem,
176
+ I as MenuLabel,
177
+ G as MenuPortal,
178
+ D as MenuRadioGroup,
179
+ C as MenuRadioItem,
180
+ v as MenuSeparator,
181
+ L as MenuSub,
182
+ h as MenuSubContent,
183
+ f as MenuSubTrigger,
184
+ y as MenuTrigger
186
185
  };
@@ -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,