@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,14 +1,7 @@
1
1
  const l = (r, n, t) => {
2
2
  const e = r[n];
3
3
  return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((i, o) => {
4
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
5
- o.bind(
6
- null,
7
- new Error(
8
- "Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
9
- )
10
- )
11
- );
4
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : ""))));
12
5
  });
13
6
  };
14
7
  export {
package/dist/index.js CHANGED
@@ -8,37 +8,38 @@ import { BaseInput as S } from "./lib/Components/BaseInput/BaseInput.js";
8
8
  import { Button as d } from "./lib/Components/Button/Button.js";
9
9
  import { BaseButton as c } from "./lib/Components/Button/BaseButton.js";
10
10
  import { ContentBanner as I, ContentBannerContent as C, ContentBannerDescription as s, ContentBannerTitle as L } from "./lib/Components/ContentBanner/ContentBanner.js";
11
- import { CardButton as h } from "./lib/Components/CardButton/CardButton.js";
11
+ import { CardButton as M } from "./lib/Components/CardButton/CardButton.js";
12
12
  import { Checkbox as v } from "./lib/Components/Checkbox/Checkbox.js";
13
- import { DataTable as R, DataTableGlobalSearchInput as w, DataTableRoot as k } from "./lib/Components/DataTable/DataTable.js";
14
- import { useLumenDataTable as H } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
13
+ import { DataTable as A, DataTableGlobalSearchInput as w, DataTableRoot as H } from "./lib/Components/DataTable/DataTable.js";
14
+ import { useLumenDataTable as G } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
15
15
  import { DialogClose as y } from "./lib/Components/Dialog/DialogClose/DialogClose.js";
16
- import { Dialog as F, DialogBody as j, DialogContent as q, DialogFooter as z, DialogTrigger as E } from "./lib/Components/Dialog/Dialog.js";
17
- import { DialogHeader as K } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
18
- import { Divider as Q } from "./lib/Components/Divider/Divider.js";
19
- import { IconButton as V } from "./lib/Components/IconButton/IconButton.js";
20
- import { InteractiveIcon as X } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
21
- import { Link as Z } from "./lib/Components/Link/Link.js";
16
+ import { Dialog as E, DialogBody as O, DialogContent as F, DialogFooter as _, DialogTrigger as j } from "./lib/Components/Dialog/Dialog.js";
17
+ import { DialogHeader as z } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
18
+ import { Divider as K } from "./lib/Components/Divider/Divider.js";
19
+ import { IconButton as U } from "./lib/Components/IconButton/IconButton.js";
20
+ import { InteractiveIcon as W } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
21
+ import { Link as Y } from "./lib/Components/Link/Link.js";
22
22
  import { ListItem as $, ListItemContent as ee, ListItemDescription as oe, ListItemIcon as te, ListItemLeading as re, ListItemSpot as ae, ListItemTitle as ne, ListItemTrailing as ie, ListItemTruncate as le } from "./lib/Components/ListItem/ListItem.js";
23
23
  import { Menu as me, MenuCheckboxItem as Te, MenuContent as ue, MenuGroup as xe, MenuItem as fe, MenuLabel as Se, MenuPortal as be, MenuRadioGroup as de, MenuRadioItem as ge, MenuSeparator as ce, MenuSub as Be, MenuSubContent as Ie, MenuSubTrigger as Ce, MenuTrigger as se } from "./lib/Components/Menu/Menu.js";
24
- import { NavBar as De, NavBarBackButton as he, NavBarCoinCapsule as Me, NavBarTitle as ve, NavBarTrailing as Ae } from "./lib/Components/NavBar/NavBar.js";
24
+ import { NavBar as De, NavBarBackButton as Me, NavBarCoinCapsule as he, NavBarTitle as ve, NavBarTrailing as Re } from "./lib/Components/NavBar/NavBar.js";
25
25
  import { PageIndicator as we } from "./lib/Components/PageIndicator/PageIndicator.js";
26
- import { SearchInput as Ge } from "./lib/Components/SearchInput/SearchInput.js";
27
- import { Select as Ne, SelectContent as ye, SelectGroup as Pe, SelectItem as Fe, SelectItemText as je, SelectLabel as qe, SelectSeparator as ze, SelectTrigger as Ee } from "./lib/Components/Select/Select.js";
28
- import { SideBar as Ke, SideBarCollapseToggle as Oe, SideBarItem as Qe, SideBarLeading as Ue, SideBarTrailing as Ve } from "./lib/Components/SideBar/SideBar.js";
29
- import { Skeleton as Xe } from "./lib/Components/Skeleton/Skeleton.js";
30
- import { Spinner as Ze } from "./lib/Components/Spinner/Spinner.js";
26
+ import { SearchInput as ke } from "./lib/Components/SearchInput/SearchInput.js";
27
+ import { Select as Ne, SelectContent as ye, SelectGroup as Pe, SelectItem as Ee, SelectItemText as Oe, SelectLabel as Fe, SelectSeparator as _e, SelectTrigger as je } from "./lib/Components/Select/Select.js";
28
+ import { SideBar as ze, SideBarCollapseToggle as Je, SideBarItem as Ke, SideBarLeading as Qe, SideBarTrailing as Ue } from "./lib/Components/SideBar/SideBar.js";
29
+ import { Skeleton as We } from "./lib/Components/Skeleton/Skeleton.js";
30
+ import { Spinner as Ye } from "./lib/Components/Spinner/Spinner.js";
31
31
  import { Spot as $e } from "./lib/Components/Spot/Spot.js";
32
32
  import { Stepper as oo } from "./lib/Components/Stepper/Stepper.js";
33
33
  import { Subheader as ro, SubheaderAction as ao, SubheaderCount as no, SubheaderDescription as io, SubheaderInfo as lo, SubheaderRow as po, SubheaderShowMore as mo, SubheaderTitle as To } from "./lib/Components/Subheader/Subheader.js";
34
34
  import { Switch as xo } from "./lib/Components/Switch/Switch.js";
35
- import { Table as So, TableActionBar as bo, TableActionBarLeading as go, TableActionBarTrailing as co, TableBody as Bo, TableCell as Io, TableCellContent as Co, TableGroupHeaderRow as so, TableHeader as Lo, TableHeaderCell as Do, TableHeaderRow as ho, TableInfoIcon as Mo, TableLoadingRow as vo, TableRoot as Ao, TableRow as Ro, TableSortButton as wo } from "./lib/Components/Table/Table.js";
36
- import { Tag as Go } from "./lib/Components/Tag/Tag.js";
35
+ import { Table as So, TableActionBar as bo, TableActionBarLeading as go, TableActionBarTrailing as co, TableBody as Bo, TableCell as Io, TableCellContent as Co, TableGroupHeaderRow as so, TableHeader as Lo, TableHeaderCell as Do, TableHeaderRow as Mo, TableInfoIcon as ho, TableLoadingRow as vo, TableRoot as Ro, TableRow as Ao, TableSortButton as wo } from "./lib/Components/Table/Table.js";
36
+ import { Tag as ko } from "./lib/Components/Tag/Tag.js";
37
37
  import { TextInput as No } from "./lib/Components/TextInput/TextInput.js";
38
- import { Tile as Po, TileContent as Fo, TileDescription as jo, TileSecondaryAction as qo, TileSpot as zo, TileTitle as Eo, TileTrailingContent as Jo } from "./lib/Components/Tile/Tile.js";
39
- import { TileButton as Oo } from "./lib/Components/TileButton/TileButton.js";
40
- import { Tooltip as Uo, TooltipContent as Vo, TooltipProvider as Wo, TooltipTrigger as Xo } from "./lib/Components/Tooltip/Tooltip.js";
41
- import { ThemeProvider as Zo, useTheme as _o } from "./lib/Components/ThemeProvider/ThemeProvider.js";
38
+ import { Tile as Po, TileContent as Eo, TileDescription as Oo, TileSecondaryAction as Fo, TileSpot as _o, TileTitle as jo, TileTrailingContent as qo } from "./lib/Components/Tile/Tile.js";
39
+ import { TileButton as Jo } from "./lib/Components/TileButton/TileButton.js";
40
+ import { Tooltip as Qo, TooltipContent as Uo, TooltipProvider as Vo, TooltipTrigger as Wo } from "./lib/Components/Tooltip/Tooltip.js";
41
+ import { ThemeProvider as Yo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
42
+ import { COLOR_SCHEMES as $o } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
42
43
  export {
43
44
  a as AddressInput,
44
45
  p as AmountDisplay,
@@ -48,27 +49,28 @@ export {
48
49
  c as BaseButton,
49
50
  S as BaseInput,
50
51
  d as Button,
51
- h as CardButton,
52
+ $o as COLOR_SCHEMES,
53
+ M as CardButton,
52
54
  v as Checkbox,
53
55
  I as ContentBanner,
54
56
  C as ContentBannerContent,
55
57
  s as ContentBannerDescription,
56
58
  L as ContentBannerTitle,
57
- R as DataTable,
59
+ A as DataTable,
58
60
  w as DataTableGlobalSearchInput,
59
- k as DataTableRoot,
60
- F as Dialog,
61
- j as DialogBody,
61
+ H as DataTableRoot,
62
+ E as Dialog,
63
+ O as DialogBody,
62
64
  y as DialogClose,
63
- q as DialogContent,
64
- z as DialogFooter,
65
- K as DialogHeader,
66
- E as DialogTrigger,
67
- Q as Divider,
68
- V as IconButton,
69
- X as InteractiveIcon,
65
+ F as DialogContent,
66
+ _ as DialogFooter,
67
+ z as DialogHeader,
68
+ j as DialogTrigger,
69
+ K as Divider,
70
+ U as IconButton,
71
+ W as InteractiveIcon,
70
72
  t as Languages,
71
- Z as Link,
73
+ Y as Link,
72
74
  $ as ListItem,
73
75
  ee as ListItemContent,
74
76
  oe as ListItemDescription,
@@ -93,27 +95,27 @@ export {
93
95
  Ce as MenuSubTrigger,
94
96
  se as MenuTrigger,
95
97
  De as NavBar,
96
- he as NavBarBackButton,
97
- Me as NavBarCoinCapsule,
98
+ Me as NavBarBackButton,
99
+ he as NavBarCoinCapsule,
98
100
  ve as NavBarTitle,
99
- Ae as NavBarTrailing,
101
+ Re as NavBarTrailing,
100
102
  we as PageIndicator,
101
- Ge as SearchInput,
103
+ ke as SearchInput,
102
104
  Ne as Select,
103
105
  ye as SelectContent,
104
106
  Pe as SelectGroup,
105
- Fe as SelectItem,
106
- je as SelectItemText,
107
- qe as SelectLabel,
108
- ze as SelectSeparator,
109
- Ee as SelectTrigger,
110
- Ke as SideBar,
111
- Oe as SideBarCollapseToggle,
112
- Qe as SideBarItem,
113
- Ue as SideBarLeading,
114
- Ve as SideBarTrailing,
115
- Xe as Skeleton,
116
- Ze as Spinner,
107
+ Ee as SelectItem,
108
+ Oe as SelectItemText,
109
+ Fe as SelectLabel,
110
+ _e as SelectSeparator,
111
+ je as SelectTrigger,
112
+ ze as SideBar,
113
+ Je as SideBarCollapseToggle,
114
+ Ke as SideBarItem,
115
+ Qe as SideBarLeading,
116
+ Ue as SideBarTrailing,
117
+ We as Skeleton,
118
+ Ye as Spinner,
117
119
  $e as Spot,
118
120
  oo as Stepper,
119
121
  ro as Subheader,
@@ -135,27 +137,26 @@ export {
135
137
  so as TableGroupHeaderRow,
136
138
  Lo as TableHeader,
137
139
  Do as TableHeaderCell,
138
- ho as TableHeaderRow,
139
- Mo as TableInfoIcon,
140
+ Mo as TableHeaderRow,
141
+ ho as TableInfoIcon,
140
142
  vo as TableLoadingRow,
141
- Ao as TableRoot,
142
- Ro as TableRow,
143
+ Ro as TableRoot,
144
+ Ao as TableRow,
143
145
  wo as TableSortButton,
144
- Go as Tag,
146
+ ko as Tag,
145
147
  No as TextInput,
146
- Zo as ThemeProvider,
148
+ Yo as ThemeProvider,
147
149
  Po as Tile,
148
- Oo as TileButton,
149
- Fo as TileContent,
150
- jo as TileDescription,
151
- qo as TileSecondaryAction,
152
- zo as TileSpot,
153
- Eo as TileTitle,
154
- Jo as TileTrailingContent,
155
- Uo as Tooltip,
156
- Vo as TooltipContent,
157
- Wo as TooltipProvider,
158
- Xo as TooltipTrigger,
159
- H as useLumenDataTable,
160
- _o as useTheme
150
+ Jo as TileButton,
151
+ Eo as TileContent,
152
+ Oo as TileDescription,
153
+ Fo as TileSecondaryAction,
154
+ _o as TileSpot,
155
+ jo as TileTitle,
156
+ qo as TileTrailingContent,
157
+ Qo as Tooltip,
158
+ Uo as TooltipContent,
159
+ Vo as TooltipProvider,
160
+ Wo as TooltipTrigger,
161
+ G as useLumenDataTable
161
162
  };
@@ -1,150 +1,147 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
2
  import { cn as a } from "../../../libs/utils-shared/dist/index.js";
3
- import d from "react";
4
- import { useCommonTranslation as $ } from "../../../i18n/useCommonTranslation.js";
5
- import { InteractiveIcon as q } from "../InteractiveIcon/InteractiveIcon.js";
6
- import { DeleteCircleFill as I } from "../../Symbols/Icons/DeleteCircleFill.js";
7
- const H = a(
3
+ import c from "react";
4
+ import { useCommonTranslation as O } from "../../../i18n/useCommonTranslation.js";
5
+ import { InteractiveIcon as $ } from "../InteractiveIcon/InteractiveIcon.js";
6
+ import { DeleteCircleFill as x } from "../../Symbols/Icons/DeleteCircleFill.js";
7
+ const q = a(
8
8
  "group relative flex h-48 w-full cursor-text items-center gap-8 rounded-sm bg-muted px-16 transition-colors",
9
9
  "focus-within:ring-2 focus-within:ring-active hover:bg-muted-hover",
10
10
  "has-disabled:cursor-not-allowed has-disabled:bg-disabled has-disabled:text-disabled",
11
11
  "has-invalid:border-error has-invalid:ring-1 has-invalid:ring-error",
12
12
  'has-[input[aria-invalid="true"]]:border-error has-[input[aria-invalid="true"]]:ring-1 has-[input[aria-invalid="true"]]:ring-error'
13
- ), K = a(
13
+ ), H = a(
14
14
  "peer w-full flex-1 bg-muted body-1 text-base caret-active outline-hidden transition-colors",
15
15
  "group-hover:bg-muted-hover group-disabled:bg-disabled",
16
16
  "group-has-disabled:cursor-not-allowed group-has-disabled:bg-disabled group-has-disabled:text-disabled",
17
17
  "placeholder:text-muted group-has-disabled:placeholder:text-disabled",
18
18
  "[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
19
19
  "truncate"
20
- ), U = a(
20
+ ), K = a(
21
21
  "pointer-events-none absolute top-6 left-16 origin-left body-4 text-muted transition-all duration-300",
22
22
  "peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-placeholder-shown:body-2",
23
23
  "group-has-disabled:text-disabled",
24
24
  "peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
25
25
  "w-[calc(100%-var(--size-56))] truncate"
26
- ), G = ({
27
- ref: N,
28
- className: S,
29
- containerClassName: k,
30
- inputClassName: R,
31
- labelClassName: E,
32
- label: u,
33
- id: j,
34
- disabled: m,
35
- errorMessage: i,
36
- suffix: z,
37
- prefix: B,
38
- onClear: p,
39
- hideClearButton: C = !1,
40
- "aria-invalid": f,
41
- onChange: l,
42
- ...o
26
+ ), P = ({
27
+ ref: y,
28
+ className: I,
29
+ containerClassName: C,
30
+ inputClassName: S,
31
+ labelClassName: N,
32
+ label: d,
33
+ id: k,
34
+ disabled: h,
35
+ errorMessage: o,
36
+ suffix: R,
37
+ prefix: E,
38
+ onClear: j,
39
+ hideClearButton: z = !1,
40
+ "aria-invalid": b,
41
+ onChange: m,
42
+ ...i
43
43
  }) => {
44
- var x;
45
- const { t: D } = $(), n = d.useRef(null), F = d.useId(), b = j || `input-${F}`, L = f || (i ? !0 : void 0), c = o.value !== void 0, [T, v] = d.useState(
46
- ((x = o.defaultValue) == null ? void 0 : x.toString()) || ""
47
- ), V = d.useCallback(
44
+ const { t: B } = O(), n = c.useRef(null), D = c.useId(), u = k || `input-${D}`, F = b || (o ? !0 : void 0), s = i.value !== void 0, [L, v] = c.useState(
45
+ i.defaultValue?.toString() || ""
46
+ ), T = c.useCallback(
48
47
  (t) => {
49
- c || v(t.target.value), l == null || l(t);
48
+ s || v(t.target.value), m?.(t);
50
49
  },
51
- [c, l]
52
- ), g = (c ? !!o.value && o.value.toString().length > 0 : T.length > 0) && !m && !C, w = `${b}-error`, A = () => {
53
- var e;
50
+ [s, m]
51
+ ), f = (s ? !!i.value && i.value.toString().length > 0 : L.length > 0) && !h && !z, g = `${u}-error`, V = () => {
54
52
  if (!n.current) return;
55
- const t = (e = Object.getOwnPropertyDescriptor(
53
+ Object.getOwnPropertyDescriptor(
56
54
  window.HTMLInputElement.prototype,
57
55
  "value"
58
- )) == null ? void 0 : e.set;
59
- t == null || t.call(n.current, ""), c || v("");
60
- const s = new Event("input", { bubbles: !0 });
61
- n.current.dispatchEvent(s), n.current.focus(), p == null || p();
56
+ )?.set?.call(n.current, ""), s || v("");
57
+ const l = new Event("input", { bubbles: !0 });
58
+ n.current.dispatchEvent(l), n.current.focus(), j?.();
62
59
  };
63
- function O(...t) {
64
- return (s) => {
60
+ function A(...t) {
61
+ return (l) => {
65
62
  t.forEach((e) => {
66
- e && (typeof e == "function" ? e(s) : e.current = s);
63
+ e && (typeof e == "function" ? e(l) : e.current = l);
67
64
  });
68
65
  };
69
66
  }
70
- return /* @__PURE__ */ h("div", { className: S, children: [
71
- /* @__PURE__ */ h(
67
+ return /* @__PURE__ */ p("div", { className: I, children: [
68
+ /* @__PURE__ */ p(
72
69
  "div",
73
70
  {
74
- className: a(H, k),
71
+ className: a(q, C),
75
72
  onPointerDown: (t) => {
76
73
  if (t.target.closest("input, button, a")) return;
77
74
  const e = n.current;
78
75
  if (!e) return;
79
- const y = e.value.length > 0 ? e.value.length : 0;
76
+ const w = e.value.length > 0 ? e.value.length : 0;
80
77
  window.requestAnimationFrame(() => {
81
78
  try {
82
- e.setSelectionRange(y, y);
79
+ e.setSelectionRange(w, w);
83
80
  } catch {
84
81
  }
85
82
  e.focus();
86
83
  });
87
84
  },
88
85
  children: [
89
- B,
86
+ E,
90
87
  /* @__PURE__ */ r(
91
88
  "input",
92
89
  {
93
- ref: O(N, n),
94
- id: b,
95
- disabled: m,
90
+ ref: A(y, n),
91
+ id: u,
92
+ disabled: h,
96
93
  placeholder: " ",
97
- "aria-invalid": L,
98
- "aria-describedby": i ? w : void 0,
94
+ "aria-invalid": F,
95
+ "aria-describedby": o ? g : void 0,
99
96
  className: a(
100
- K,
101
- u && "pt-12 body-2",
102
- R
97
+ H,
98
+ d && "pt-12 body-2",
99
+ S
103
100
  ),
104
- onChange: V,
105
- ...o
101
+ onChange: T,
102
+ ...i
106
103
  }
107
104
  ),
108
- u && /* @__PURE__ */ r(
105
+ d && /* @__PURE__ */ r(
109
106
  "label",
110
107
  {
111
- htmlFor: b,
108
+ htmlFor: u,
112
109
  className: a(
113
- U,
114
- i && "text-error",
115
- E
110
+ K,
111
+ o && "text-error",
112
+ N
116
113
  ),
117
- children: u
114
+ children: d
118
115
  }
119
116
  ),
120
- g && /* @__PURE__ */ r(
121
- q,
117
+ f && /* @__PURE__ */ r(
118
+ $,
122
119
  {
123
120
  iconType: "filled",
124
- onClick: A,
125
- "aria-label": D("components.baseInput.clearInputAriaLabel"),
126
- children: /* @__PURE__ */ r(I, { size: 20 })
121
+ onClick: V,
122
+ "aria-label": B("components.baseInput.clearInputAriaLabel"),
123
+ children: /* @__PURE__ */ r(x, { size: 20 })
127
124
  }
128
125
  ),
129
- !g && z
126
+ !f && R
130
127
  ]
131
128
  }
132
129
  ),
133
- i && /* @__PURE__ */ h(
130
+ o && /* @__PURE__ */ p(
134
131
  "div",
135
132
  {
136
- id: w,
133
+ id: g,
137
134
  className: "mt-8 flex items-center gap-2 body-3 text-error",
138
135
  role: "alert",
139
136
  children: [
140
- /* @__PURE__ */ r(I, { size: 16, className: "shrink-0 text-error" }),
141
- /* @__PURE__ */ r("span", { children: i })
137
+ /* @__PURE__ */ r(x, { size: 16, className: "shrink-0 text-error" }),
138
+ /* @__PURE__ */ r("span", { children: o })
142
139
  ]
143
140
  }
144
141
  )
145
142
  ] });
146
143
  };
147
- G.displayName = "BaseInput";
144
+ P.displayName = "BaseInput";
148
145
  export {
149
- G as BaseInput
146
+ P as BaseInput
150
147
  };