@ledgerhq/lumen-ui-react 0.0.66 → 0.0.67

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,5 +1,5 @@
1
- import { jsxs as F, jsx as l } from "react/jsx-runtime";
2
- import { getFontSize as V, cn as a, textFormatter as j } from "../../../libs/utils-shared/dist/index.js";
1
+ import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
+ import { getFontSize as V, cn as a, textFormatter as F } from "../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as z } from "class-variance-authority";
4
4
  import M, { useRef as p, useState as h, useMemo as _, useLayoutEffect as q, useEffect as D } from "react";
5
5
  const L = z(
@@ -42,8 +42,8 @@ const L = z(
42
42
  onChange: C,
43
43
  ...N
44
44
  }, A) => {
45
- const c = p(null), s = p(null), [n, f] = h(u.toString()), [I, m] = h(!1), g = p(n);
46
- function k(...t) {
45
+ const c = p(null), s = p(null), [n, f] = h(u.toString()), [E, m] = h(!1), g = p(n);
46
+ function j(...t) {
47
47
  return (e) => {
48
48
  t.forEach((o) => {
49
49
  o && (typeof o == "function" ? o(e) : o.current = e);
@@ -62,8 +62,8 @@ const L = z(
62
62
  }, [n]), D(() => {
63
63
  f(u.toString());
64
64
  }, [u]);
65
- const E = (t) => {
66
- const e = j(t.target.value, {
65
+ const k = (t) => {
66
+ const e = F(t.target.value, {
67
67
  allowDecimals: y,
68
68
  thousandsSeparator: R,
69
69
  maxIntegerLength: S,
@@ -71,7 +71,7 @@ const L = z(
71
71
  });
72
72
  f(e), C({ ...t, target: { ...t.target, value: e } }), e !== g.current && m(!0), g.current = e;
73
73
  };
74
- return /* @__PURE__ */ F(
74
+ return /* @__PURE__ */ I(
75
75
  "div",
76
76
  {
77
77
  className: "group relative flex items-center justify-center transition-transform",
@@ -103,14 +103,14 @@ const L = z(
103
103
  /* @__PURE__ */ l(
104
104
  "input",
105
105
  {
106
- ref: k(A, s),
106
+ ref: j(A, s),
107
107
  type: "text",
108
108
  inputMode: "decimal",
109
109
  disabled: w,
110
110
  value: n,
111
- onChange: E,
111
+ onChange: k,
112
112
  onAnimationEnd: () => m(!1),
113
- className: a(L({ isChanging: I }), x),
113
+ className: a(L({ isChanging: E }), x),
114
114
  ...N,
115
115
  style: { fontSize: i, letterSpacing: "normal" }
116
116
  }
@@ -30,11 +30,11 @@ const q = a(
30
30
  inputClassName: S,
31
31
  labelClassName: k,
32
32
  label: u,
33
- id: z,
33
+ id: j,
34
34
  disabled: f,
35
35
  errorMessage: i,
36
36
  suffix: E,
37
- prefix: j,
37
+ prefix: z,
38
38
  onClear: p,
39
39
  hideClearButton: B = !1,
40
40
  "aria-invalid": m,
@@ -42,7 +42,7 @@ const q = a(
42
42
  ...o
43
43
  }, C) => {
44
44
  var x;
45
- const { t: D } = _(), r = l.useRef(null), F = l.useId(), b = z || `input-${F}`, L = m || (i ? !0 : void 0), c = o.value !== void 0, [T, v] = l.useState(
45
+ const { t: D } = _(), r = l.useRef(null), F = l.useId(), b = j || `input-${F}`, L = m || (i ? !0 : void 0), c = o.value !== void 0, [T, v] = l.useState(
46
46
  ((x = o.defaultValue) == null ? void 0 : x.toString()) || ""
47
47
  ), V = l.useCallback(
48
48
  (t) => {
@@ -86,7 +86,7 @@ const q = a(
86
86
  });
87
87
  },
88
88
  children: [
89
- j,
89
+ z,
90
90
  /* @__PURE__ */ n(
91
91
  "input",
92
92
  {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqDzC,eAAO,MAAM,UAAU;;;;;;;;;YAxCf,CAAF;iBACI,CAAH;;;2FAkHN,CAAC"}
1
+ {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAyDzC,eAAO,MAAM,UAAU;;;;;;;;;YA3CP,CAAC;iBAAqB,CAAC;;;2FAyGtC,CAAC"}
@@ -1,11 +1,11 @@
1
- import { jsxs as x, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as t } from "react/jsx-runtime";
2
2
  import { cn as h } from "../../../libs/utils-shared/dist/index.js";
3
- import { Slot as z, Slottable as S } from "@radix-ui/react-slot";
3
+ import { Slot as y, Slottable as z } from "@radix-ui/react-slot";
4
4
  import { cva as l } from "class-variance-authority";
5
- import y, { useCallback as B } from "react";
5
+ import B from "react";
6
6
  import { Spinner as N } from "../Spinner/Spinner.js";
7
- const j = l(
8
- 'inline-flex size-fit cursor-pointer items-center justify-center rounded-full body-1-semi-bold transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus data-[disabled="true"]:bg-disabled data-[disabled="true"]:text-disabled',
7
+ const S = l(
8
+ 'inline-flex size-fit items-center justify-center rounded-full body-1-semi-bold transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus data-[disabled="true"]:bg-disabled data-[disabled="true"]:text-disabled',
9
9
  {
10
10
  variants: {
11
11
  appearance: {
@@ -16,6 +16,10 @@ const j = l(
16
16
  "no-background": "bg-transparent text-base hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-base-transparent",
17
17
  red: "bg-error text-error hover:bg-error-hover active:bg-error-pressed"
18
18
  },
19
+ disabled: {
20
+ true: "cursor-default",
21
+ false: "cursor-pointer"
22
+ },
19
23
  size: {
20
24
  xs: "p-8",
21
25
  sm: "p-10",
@@ -32,7 +36,7 @@ const j = l(
32
36
  isFull: !1
33
37
  }
34
38
  }
35
- ), u = l("shrink-0", {
39
+ ), d = l("shrink-0", {
36
40
  variants: {
37
41
  appearance: {
38
42
  base: "text-on-interactive",
@@ -46,69 +50,60 @@ const j = l(
46
50
  true: "text-disabled"
47
51
  }
48
52
  }
49
- }), V = y.forwardRef(
53
+ }), j = B.forwardRef(
50
54
  ({
51
- className: d,
52
- appearance: s = "base",
53
- size: n,
54
- isFull: m,
55
- disabled: e,
56
- asChild: i = !1,
57
- icon: c,
58
- loading: t,
59
- children: o,
60
- onClick: a,
55
+ className: u,
56
+ appearance: a = "base",
57
+ size: r,
58
+ isFull: p,
59
+ disabled: e = !1,
60
+ asChild: o = !1,
61
+ icon: i,
62
+ loading: s,
63
+ children: n,
64
+ onClick: m,
61
65
  ...v
62
66
  }, f) => {
63
- const g = B(
64
- (p) => {
65
- if (e || t) {
66
- p.preventDefault();
67
- return;
68
- }
69
- a == null || a(p);
70
- },
71
- [e, t, a]
72
- ), b = n ? {
67
+ const g = {
73
68
  xs: 16,
74
69
  sm: 20,
75
70
  md: 24,
76
71
  lg: 24
77
- }[n] : 24;
72
+ }, c = s || e, b = r ? g[r] : 24;
78
73
  return /* @__PURE__ */ x(
79
- i ? z : "button",
74
+ o ? y : "button",
80
75
  {
81
76
  className: h(
82
- j({ appearance: s, size: n, isFull: m }),
83
- d
77
+ S({ disabled: e, appearance: a, size: r, isFull: p }),
78
+ u
84
79
  ),
85
80
  ref: f,
86
- "data-disabled": e || void 0,
87
- disabled: e,
88
- onClick: g,
81
+ "data-disabled": c || void 0,
82
+ disabled: c,
83
+ onClick: m,
89
84
  ...v,
90
85
  children: [
91
- t && /* @__PURE__ */ r(
86
+ s && /* @__PURE__ */ t(
92
87
  N,
93
88
  {
94
89
  size: b,
95
- className: u({ appearance: s, disabled: e })
90
+ className: d({ appearance: a, disabled: e })
96
91
  }
97
92
  ),
98
- !t && c && /* @__PURE__ */ r(
99
- c,
93
+ !s && i && /* @__PURE__ */ t(
94
+ i,
100
95
  {
101
96
  size: b,
102
- className: u({ appearance: s, disabled: e })
97
+ className: d({ appearance: a, disabled: e })
103
98
  }
104
99
  ),
105
- o && (i ? /* @__PURE__ */ r(S, { children: o }) : /* @__PURE__ */ r("span", { className: "line-clamp-2 text-left", children: o }))
100
+ n && (o ? /* @__PURE__ */ t(z, { children: n }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: n }))
106
101
  ]
107
102
  }
108
103
  );
109
104
  }
110
105
  );
111
- V.displayName = "BaseButton";
106
+ j.displayName = "BaseButton";
112
107
  export {
113
- V as BaseButton
108
+ j as BaseButton
114
109
  };
@@ -47,7 +47,7 @@ const d = n.forwardRef(
47
47
  )
48
48
  );
49
49
  d.displayName = "DialogOverlay";
50
- function O({
50
+ function j({
51
51
  className: a,
52
52
  children: t,
53
53
  ...e
@@ -109,7 +109,7 @@ D.displayName = "DialogFooter";
109
109
  export {
110
110
  C as Dialog,
111
111
  y as DialogBody,
112
- O as DialogContent,
112
+ j as DialogContent,
113
113
  D as DialogFooter,
114
114
  R as DialogTrigger
115
115
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe;;;2FAW1B,CAAC"}
1
+ {"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe;;;2FAY1B,CAAC"}
@@ -1,23 +1,28 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { cn as i } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as a } from "class-variance-authority";
4
- import n from "react";
5
- const c = a(
6
- "inline-flex size-fit cursor-pointer items-center justify-center rounded-full text-muted transition-colors hover:text-muted-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:text-muted-pressed disabled:text-disabled",
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { cn as a } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as n } from "class-variance-authority";
4
+ import l from "react";
5
+ const c = n(
6
+ "inline-flex size-fit items-center justify-center rounded-full text-muted transition-colors hover:text-muted-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:text-muted-pressed disabled:text-disabled",
7
7
  {
8
8
  variants: {
9
9
  iconType: {
10
10
  filled: "",
11
11
  stroked: "bg-base-transparent hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-disabled"
12
+ },
13
+ disabled: {
14
+ true: "cursor-default",
15
+ false: "cursor-pointer"
12
16
  }
13
17
  }
14
18
  }
15
- ), d = n.forwardRef(({ className: e, iconType: t, ...r }, s) => /* @__PURE__ */ o(
19
+ ), d = l.forwardRef(({ className: t, iconType: r, disabled: e = !1, ...s }, o) => /* @__PURE__ */ i(
16
20
  "button",
17
21
  {
18
- ref: s,
19
- className: i(e, c({ iconType: t })),
20
- ...r
22
+ ...s,
23
+ ref: o,
24
+ disabled: e,
25
+ className: a(t, c({ disabled: e, iconType: r }))
21
26
  }
22
27
  ));
23
28
  d.displayName = "InteractiveIcon";
@@ -4,7 +4,7 @@ import { Slot as b } from "@radix-ui/react-slot";
4
4
  import { cva as h } from "class-variance-authority";
5
5
  import x from "react";
6
6
  import { ExternalLink as k } from "../../Symbols/Icons/ExternalLink.js";
7
- const z = h(
7
+ const N = h(
8
8
  "inline-flex w-fit max-w-full items-center justify-center transition-colors focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-focus",
9
9
  {
10
10
  variants: {
@@ -29,7 +29,7 @@ const z = h(
29
29
  underline: !0
30
30
  }
31
31
  }
32
- ), N = x.forwardRef(
32
+ ), w = x.forwardRef(
33
33
  ({
34
34
  className: l,
35
35
  children: r,
@@ -51,7 +51,7 @@ const z = h(
51
51
  ref: d,
52
52
  className: v(
53
53
  l,
54
- z({
54
+ N({
55
55
  appearance: m,
56
56
  size: i,
57
57
  underline: f
@@ -79,7 +79,7 @@ const z = h(
79
79
  );
80
80
  }
81
81
  );
82
- N.displayName = "Link";
82
+ w.displayName = "Link";
83
83
  export {
84
- N as Link
84
+ w as Link
85
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACV,SAAS,EAET,gBAAgB,EAChB,aAAa,EAOb,cAAc,EACd,mBAAmB,EACpB,MAAM,SAAS,CAAC;AA0BjB,iBAAS,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAEpC;AAED,QAAA,MAAM,WAAW;;oJASf,CAAC;AAGH,iBAAS,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAE9C;AAED,iBAAS,UAAU,CAAC,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,2CAE3D;AAED,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,2CAExD;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAIxD;AAED,QAAA,MAAM,cAAc;;;;;;qIAalB,CAAC;AAGH,QAAA,MAAM,cAAc;;6MAUlB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;qIAcf,CAAC;AAGH,QAAA,MAAM,QAAQ;;;;;;;qIAUZ,CAAC;AAGH,QAAA,MAAM,gBAAgB;;;0EAkBpB,CAAC;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AM,QAAQ;;;;;;;qIAUZ,CAAC;AAGH,QAAA,MAAM,gBAAgB;;;0EAkBpB,CAAC;AAGH,QAAA,MAAM,aAAa;;0EAiBjB,CAAC;AAGH,QAAA,MAAM,SAAS;;;;qIAUb,CAAC;AAGH,QAAA,MAAM,aAAa;;;qIAQlB,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,cAAc,GACf,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
- import { cn as o } from "../../../libs/utils-shared/dist/index.js";
2
+ import { cn as r } from "../../../libs/utils-shared/dist/index.js";
3
3
  import * as t from "@radix-ui/react-dropdown-menu";
4
4
  import * as i from "react";
5
- import { Check as u } from "../../Symbols/Icons/Check.js";
6
- import { Divider as p } from "../Divider/Divider.js";
7
- import { ChevronRight as f } from "../../Symbols/Icons/ChevronRight.js";
8
- const c = o(
5
+ import { Check as p } from "../../Symbols/Icons/Check.js";
6
+ import { Divider as b } from "../Divider/Divider.js";
7
+ import { ChevronRight as N } from "../../Symbols/Icons/ChevronRight.js";
8
+ const f = r(
9
9
  "z-menu min-w-160 overflow-hidden rounded-sm bg-muted p-8",
10
10
  "shadow-sm",
11
11
  "data-[state=open]:animate-fade-in",
12
12
  "data-[state=closed]:animate-fade-out"
13
- ), d = o(
13
+ ), d = r(
14
14
  "relative flex cursor-default items-center gap-12 select-none",
15
15
  "h-44 rounded-sm px-8 outline-hidden",
16
16
  "body-2-semi-bold text-base",
@@ -18,147 +18,151 @@ const c = o(
18
18
  "focus:bg-base-transparent-hover",
19
19
  "active:bg-base-transparent-pressed",
20
20
  "data-disabled:pointer-events-none data-disabled:text-disabled"
21
- ), b = o("px-8 py-4 body-3-semi-bold text-muted"), N = o(
21
+ ), g = r("px-8 py-4 body-3-semi-bold text-muted"), y = r(
22
22
  d,
23
23
  "data-[state=open]:bg-base-transparent-hover"
24
24
  );
25
- function j({ ...e }) {
25
+ function G({ ...e }) {
26
26
  return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
27
27
  }
28
- const y = i.forwardRef(({ ...e }, s) => /* @__PURE__ */ a(
28
+ const h = i.forwardRef(({ ...e }, n) => /* @__PURE__ */ a(
29
29
  t.Trigger,
30
30
  {
31
- ref: s,
31
+ ref: n,
32
32
  "data-slot": "menu-trigger",
33
33
  ...e
34
34
  }
35
35
  ));
36
- y.displayName = t.Trigger.displayName;
37
- function G({ ...e }) {
36
+ h.displayName = t.Trigger.displayName;
37
+ function L({ ...e }) {
38
38
  return /* @__PURE__ */ a(t.Group, { "data-slot": "menu-group", ...e });
39
39
  }
40
- function P({
40
+ function D({
41
41
  ...e
42
42
  }) {
43
43
  return /* @__PURE__ */ a(t.Portal, { ...e });
44
44
  }
45
- function L({
45
+ function q({
46
46
  ...e
47
47
  }) {
48
48
  return /* @__PURE__ */ a(t.Sub, { ...e });
49
49
  }
50
- function D({ ...e }) {
50
+ function A({ ...e }) {
51
51
  return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
52
52
  }
53
- const g = i.forwardRef(({ className: e, inset: s, children: n, ...r }, m) => /* @__PURE__ */ l(
53
+ const x = i.forwardRef(({ className: e, inset: n, children: o, ...s }, m) => /* @__PURE__ */ l(
54
54
  t.SubTrigger,
55
55
  {
56
56
  ref: m,
57
57
  "data-slot": "menu-sub-trigger",
58
- className: o(N, s && "pl-32", e),
59
- ...r,
58
+ className: r(y, n && "pl-32", e),
59
+ ...s,
60
60
  children: [
61
- n,
62
- /* @__PURE__ */ a(f, { size: 20, className: "ml-auto text-muted" })
61
+ o,
62
+ /* @__PURE__ */ a(N, { size: 20, className: "ml-auto text-muted" })
63
63
  ]
64
64
  }
65
65
  ));
66
- g.displayName = t.SubTrigger.displayName;
67
- const h = i.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ a(
66
+ x.displayName = t.SubTrigger.displayName;
67
+ const R = i.forwardRef(({ className: e, ...n }, o) => /* @__PURE__ */ a(
68
68
  t.SubContent,
69
69
  {
70
- ref: n,
70
+ ref: o,
71
71
  "data-slot": "menu-sub-content",
72
- className: o(c, e),
73
- ...s
72
+ className: r(f, e),
73
+ ...n
74
74
  }
75
75
  ));
76
- h.displayName = t.SubContent.displayName;
77
- const x = i.forwardRef(({ className: e, sideOffset: s = 4, align: n = "start", ...r }, m) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ a(
76
+ R.displayName = t.SubContent.displayName;
77
+ const M = i.forwardRef(({ className: e, sideOffset: n = 4, align: o = "start", ...s }, m) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ a(
78
78
  t.Content,
79
79
  {
80
80
  ref: m,
81
81
  "data-slot": "menu-content",
82
- sideOffset: s,
83
- className: o(c, e),
84
- align: n,
85
- ...r
82
+ sideOffset: n,
83
+ className: r(f, e),
84
+ onClick: (u) => {
85
+ var c;
86
+ u.stopPropagation(), (c = s.onClick) == null || c.call(s, u);
87
+ },
88
+ align: o,
89
+ ...s
86
90
  }
87
91
  ) }));
88
- x.displayName = t.Content.displayName;
89
- const R = i.forwardRef(({ className: e, inset: s, ...n }, r) => /* @__PURE__ */ a(
92
+ M.displayName = t.Content.displayName;
93
+ const w = i.forwardRef(({ className: e, inset: n, ...o }, s) => /* @__PURE__ */ a(
90
94
  t.Item,
91
95
  {
92
- ref: r,
96
+ ref: s,
93
97
  "data-slot": "menu-item",
94
- className: o(d, s && "pl-32", e),
95
- ...n
98
+ className: r(d, n && "pl-32", e),
99
+ ...o
96
100
  }
97
101
  ));
98
- R.displayName = t.Item.displayName;
99
- const M = i.forwardRef(({ className: e, children: s, checked: n, ...r }, m) => /* @__PURE__ */ l(
102
+ w.displayName = t.Item.displayName;
103
+ const S = i.forwardRef(({ className: e, children: n, checked: o, ...s }, m) => /* @__PURE__ */ l(
100
104
  t.CheckboxItem,
101
105
  {
102
106
  ref: m,
103
107
  "data-slot": "menu-checkbox-item",
104
- className: o(d, e),
105
- checked: n,
106
- ...r,
108
+ className: r(d, e),
109
+ checked: o,
110
+ ...s,
107
111
  children: [
108
- s,
109
- /* @__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" }) }) })
112
+ n,
113
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(p, { size: 24, className: "text-active" }) }) })
110
114
  ]
111
115
  }
112
116
  ));
113
- M.displayName = t.CheckboxItem.displayName;
114
- const w = i.forwardRef(({ className: e, children: s, ...n }, r) => /* @__PURE__ */ l(
117
+ S.displayName = t.CheckboxItem.displayName;
118
+ const C = i.forwardRef(({ className: e, children: n, ...o }, s) => /* @__PURE__ */ l(
115
119
  t.RadioItem,
116
120
  {
117
- ref: r,
121
+ ref: s,
118
122
  "data-slot": "menu-radio-item",
119
- className: o(d, e),
120
- ...n,
123
+ className: r(d, e),
124
+ ...o,
121
125
  children: [
122
- s,
123
- /* @__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" }) }) })
126
+ n,
127
+ /* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(p, { size: 24, className: "text-active" }) }) })
124
128
  ]
125
129
  }
126
130
  ));
127
- w.displayName = t.RadioItem.displayName;
128
- const S = i.forwardRef(({ className: e, inset: s, ...n }, r) => /* @__PURE__ */ a(
131
+ C.displayName = t.RadioItem.displayName;
132
+ const I = i.forwardRef(({ className: e, inset: n, ...o }, s) => /* @__PURE__ */ a(
129
133
  t.Label,
130
134
  {
131
- ref: r,
135
+ ref: s,
132
136
  "data-slot": "menu-label",
133
- className: o(b, s && "pl-32", e),
134
- ...n
137
+ className: r(g, n && "pl-32", e),
138
+ ...o
135
139
  }
136
140
  ));
137
- S.displayName = t.Label.displayName;
138
- const I = i.forwardRef(
139
- ({ className: e, ...s }, n) => /* @__PURE__ */ a(
140
- p,
141
+ I.displayName = t.Label.displayName;
142
+ const v = i.forwardRef(
143
+ ({ className: e, ...n }, o) => /* @__PURE__ */ a(
144
+ b,
141
145
  {
142
- ref: n,
143
- className: o("mx-8 my-4 w-auto", e),
144
- ...s
146
+ ref: o,
147
+ className: r("mx-8 my-4 w-auto", e),
148
+ ...n
145
149
  }
146
150
  )
147
151
  );
148
- I.displayName = "MenuSeparator";
152
+ v.displayName = "MenuSeparator";
149
153
  export {
150
- j as Menu,
151
- M as MenuCheckboxItem,
152
- x as MenuContent,
153
- G as MenuGroup,
154
- R as MenuItem,
155
- S as MenuLabel,
156
- P as MenuPortal,
157
- D as MenuRadioGroup,
158
- w as MenuRadioItem,
159
- I as MenuSeparator,
160
- L as MenuSub,
161
- h as MenuSubContent,
162
- g as MenuSubTrigger,
163
- y as MenuTrigger
154
+ G as Menu,
155
+ S as MenuCheckboxItem,
156
+ M as MenuContent,
157
+ L as MenuGroup,
158
+ w as MenuItem,
159
+ I as MenuLabel,
160
+ D as MenuPortal,
161
+ A as MenuRadioGroup,
162
+ C as MenuRadioItem,
163
+ v as MenuSeparator,
164
+ q as MenuSub,
165
+ R as MenuSubContent,
166
+ x as MenuSubTrigger,
167
+ h as MenuTrigger
164
168
  };
@@ -97,9 +97,9 @@ const x = c(
97
97
  position: r,
98
98
  ...i,
99
99
  children: [
100
- /* @__PURE__ */ e(R, {}),
100
+ /* @__PURE__ */ e(j, {}),
101
101
  /* @__PURE__ */ e(a.Viewport, { className: y({ position: r }), children: o }),
102
- /* @__PURE__ */ e(C, {})
102
+ /* @__PURE__ */ e(z, {})
103
103
  ]
104
104
  }
105
105
  ) }));
@@ -147,7 +147,7 @@ const I = s.forwardRef(
147
147
  )
148
148
  );
149
149
  I.displayName = "SelectSeparator";
150
- const z = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e(
150
+ const R = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e(
151
151
  a.ItemText,
152
152
  {
153
153
  ref: r,
@@ -156,8 +156,8 @@ const z = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e(
156
156
  ...o
157
157
  }
158
158
  ));
159
- z.displayName = a.ItemText.displayName;
160
- function R({
159
+ R.displayName = a.ItemText.displayName;
160
+ function j({
161
161
  className: t,
162
162
  ...o
163
163
  }) {
@@ -174,7 +174,7 @@ function R({
174
174
  }
175
175
  );
176
176
  }
177
- function C({
177
+ function z({
178
178
  className: t,
179
179
  ...o
180
180
  }) {
@@ -196,7 +196,7 @@ export {
196
196
  N as SelectContent,
197
197
  G as SelectGroup,
198
198
  v as SelectItem,
199
- z as SelectItemText,
199
+ R as SelectItemText,
200
200
  w as SelectLabel,
201
201
  I as SelectSeparator,
202
202
  h as SelectTrigger
@@ -4,8 +4,8 @@ import { cva as h } from "class-variance-authority";
4
4
  import { useMemo as f } from "react";
5
5
  import { Spinner as b } from "../Spinner/Spinner.js";
6
6
  import { InformationFill as g } from "../../Symbols/Icons/InformationFill.js";
7
- import { WarningFill as z } from "../../Symbols/Icons/WarningFill.js";
8
- import { DeleteCircleFill as x } from "../../Symbols/Icons/DeleteCircleFill.js";
7
+ import { WarningFill as x } from "../../Symbols/Icons/WarningFill.js";
8
+ import { DeleteCircleFill as z } from "../../Symbols/Icons/DeleteCircleFill.js";
9
9
  import { CheckmarkCircleFill as w } from "../../Symbols/Icons/CheckmarkCircleFill.js";
10
10
  import { BluetoothCircleFill as y } from "../../Symbols/Icons/BluetoothCircleFill.js";
11
11
  const F = h(
@@ -57,9 +57,9 @@ const F = h(
57
57
  case "check":
58
58
  return /* @__PURE__ */ e(w, { size: t });
59
59
  case "error":
60
- return /* @__PURE__ */ e(x, { size: t });
61
- case "warning":
62
60
  return /* @__PURE__ */ e(z, { size: t });
61
+ case "warning":
62
+ return /* @__PURE__ */ e(x, { size: t });
63
63
  case "info":
64
64
  return /* @__PURE__ */ e(g, { size: t });
65
65
  case "loader":
@@ -19,7 +19,7 @@ const [x, p] = i("ThemeProvider"), D = ({
19
19
  [t, o]
20
20
  );
21
21
  return /* @__PURE__ */ r(x, { value: d, children: /* @__PURE__ */ r(h, { locale: o, children: e }) });
22
- }, O = () => {
22
+ }, P = () => {
23
23
  const e = p({
24
24
  consumerName: "useTheme",
25
25
  contextRequired: !0
@@ -31,5 +31,5 @@ const [x, p] = i("ThemeProvider"), D = ({
31
31
  };
32
32
  export {
33
33
  D as ThemeProvider,
34
- O as useTheme
34
+ P as useTheme
35
35
  };
@@ -1,4 +1,3 @@
1
- import { MouseEventHandler } from 'react';
2
1
  import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps } from './types';
3
2
  /**
4
3
  * A flexible tile component that uses a composite pattern for maximum customization.
@@ -30,11 +29,12 @@ import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps }
30
29
  export declare const Tile: import('react').ForwardRefExoticComponent<{
31
30
  appearance?: "no-background" | "card";
32
31
  disabled?: boolean;
33
- onClick?: MouseEventHandler<HTMLButtonElement>;
32
+ onClick?: import('react').MouseEventHandler<HTMLButtonElement>;
34
33
  children: import('react').ReactNode;
35
34
  className?: string;
36
35
  'aria-label'?: string;
37
- } & Omit<import('react').HTMLAttributes<HTMLDivElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
36
+ secondaryAction?: import('react').ReactNode;
37
+ } & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
38
38
  /**
39
39
  * A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
40
40
  * Always renders at a fixed size of 48.
@@ -85,7 +85,7 @@ export declare const TileDescription: {
85
85
  * </Tile>
86
86
  */
87
87
  export declare const TileSecondaryAction: import('react').ForwardRefExoticComponent<{
88
- onClick?: MouseEventHandler;
88
+ onClick?: import('react').MouseEventHandler;
89
89
  icon: React.ComponentType<Omit<import('../Icon').IconProps, "children">>;
90
90
  className?: string;
91
91
  } & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAc,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAG7E,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAGpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAgEjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;;;;;;;oHAsGhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW;wCAIrB,gBAAgB;;CASlB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,SAAS;wCAInB,cAAc;;CAiBhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,eAAe;wCAIzB,oBAAoB;;CAiBtB,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;;;;0HAuC9B,CAAC"}
1
+ {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAGpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAkCjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;;;;;;;;uHAuChB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW;wCAIrB,gBAAgB;;CASlB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,SAAS;wCAInB,cAAc;;CAiBhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,eAAe;wCAIzB,oBAAoB;;CAiBtB,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;;;;0HAsC9B,CAAC"}
@@ -1,242 +1,175 @@
1
- import { jsx as s, jsxs as q } from "react/jsx-runtime";
2
- import { extractSlottable as C, createSafeContext as I, cn as u } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as v } from "class-variance-authority";
4
- import { forwardRef as x, useState as w, useCallback as d } from "react";
5
- import { Spot as z } from "../Spot/Spot.js";
6
- import { InteractiveIcon as V } from "../InteractiveIcon/InteractiveIcon.js";
7
- const [j, p] = I("Tile"), T = {
8
- root: v(
1
+ import { jsx as a, jsxs as T } from "react/jsx-runtime";
2
+ import { createSafeContext as v, cn as s } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as m } from "class-variance-authority";
4
+ import { forwardRef as f, useCallback as x } from "react";
5
+ import { Spot as y } from "../Spot/Spot.js";
6
+ import { InteractiveIcon as N } from "../InteractiveIcon/InteractiveIcon.js";
7
+ const [g, n] = v("Tile"), b = {
8
+ root: m([
9
+ "group relative flex flex-col items-center rounded-md text-base transition-colors focus-visible:outline-2 focus-visible:outline-focus"
10
+ ]),
11
+ inner: m(
9
12
  [
10
- "group relative flex flex-col items-center gap-8 text-base transition-colors",
13
+ "flex w-full flex-col items-center gap-8 px-8 py-12",
11
14
  "rounded-md focus-visible:outline-2 focus-visible:outline-focus"
12
15
  ],
13
16
  {
14
17
  variants: {
15
18
  appearance: {
16
- "no-background": "bg-base-transparent",
17
- card: "bg-surface"
18
- },
19
- isActive: {
20
- true: "",
21
- false: ""
19
+ "no-background": "bg-base-transparent hover:not-disabled:bg-base-transparent-hover active:not-disabled:bg-base-transparent-pressed",
20
+ card: "bg-surface hover:not-disabled:bg-surface-hover active:not-disabled:bg-surface-pressed"
22
21
  },
23
22
  disabled: {
24
- true: "",
25
- false: ""
23
+ true: "cursor-default",
24
+ false: "cursor-pointer"
26
25
  }
27
26
  },
28
- compoundVariants: [
29
- {
30
- appearance: "no-background",
31
- isActive: !1,
32
- disabled: !1,
33
- className: "hover:bg-base-transparent-hover"
34
- },
35
- {
36
- appearance: "no-background",
37
- isActive: !0,
38
- disabled: !1,
39
- className: "bg-base-transparent-pressed"
40
- },
41
- {
42
- appearance: "card",
43
- isActive: !1,
44
- disabled: !1,
45
- className: "hover:bg-surface-hover"
46
- },
47
- {
48
- appearance: "card",
49
- isActive: !0,
50
- disabled: !1,
51
- className: "bg-surface-pressed"
52
- }
53
- ],
54
27
  defaultVariants: {
55
28
  appearance: "no-background",
56
- isActive: !1,
57
29
  disabled: !1
58
30
  }
59
31
  }
60
- ),
61
- button: v(
62
- "flex w-full cursor-pointer flex-col items-center gap-8 rounded-md px-8 py-12 focus-visible:outline-2 focus-visible:outline-focus"
63
32
  )
64
- }, P = x(
33
+ }, h = f(
65
34
  ({
66
35
  className: e,
67
- onClick: i,
36
+ onClick: t,
37
+ secondaryAction: o,
68
38
  appearance: r = "no-background",
69
- disabled: t = !1,
70
- "aria-label": f,
71
- children: m,
72
- onMouseDown: l,
73
- onMouseUp: o,
74
- onMouseLeave: c,
75
- ...n
76
- }, N) => {
77
- const [g, b] = w(!1), { slotElement: h, remainingChildren: A } = C(
78
- m,
79
- y
80
- ), S = d(
81
- (a) => {
82
- a.target.closest(
83
- "[data-secondary-button-container]"
84
- ) || (l == null || l(a), b(!0));
85
- },
86
- [l]
87
- ), k = d(
88
- (a) => {
89
- b(!1), o == null || o(a);
90
- },
91
- [o]
92
- ), R = d(
93
- (a) => {
94
- b(!1), c == null || c(a);
95
- },
96
- [c]
97
- );
98
- return /* @__PURE__ */ s(j, { value: { disabled: t }, children: /* @__PURE__ */ q(
99
- "div",
100
- {
101
- ...n,
102
- ref: N,
103
- className: T.root({
104
- appearance: r,
105
- isActive: g,
106
- disabled: t,
107
- className: e
108
- }),
109
- onMouseDown: t ? void 0 : (a) => {
110
- S(a);
111
- },
112
- onMouseUp: t ? void 0 : (a) => {
113
- k(a);
114
- },
115
- onMouseLeave: t ? void 0 : (a) => {
116
- R(a);
117
- },
118
- children: [
119
- /* @__PURE__ */ s(
120
- "button",
121
- {
122
- "aria-label": f,
123
- onClick: t ? void 0 : i,
124
- disabled: t,
125
- "data-disabled": t || void 0,
126
- className: T.button(),
127
- children: A
128
- }
129
- ),
130
- h
131
- ]
132
- }
133
- ) });
134
- }
39
+ disabled: i = !1,
40
+ children: l,
41
+ style: c,
42
+ ...d
43
+ }, u) => /* @__PURE__ */ a(g, { value: { disabled: i }, children: /* @__PURE__ */ T(
44
+ "div",
45
+ {
46
+ ref: u,
47
+ style: c,
48
+ className: b.root({
49
+ className: e
50
+ }),
51
+ children: [
52
+ /* @__PURE__ */ a(
53
+ "button",
54
+ {
55
+ ...d,
56
+ onClick: t,
57
+ disabled: i,
58
+ className: b.inner({
59
+ appearance: r,
60
+ disabled: i
61
+ }),
62
+ children: l
63
+ }
64
+ ),
65
+ o
66
+ ]
67
+ }
68
+ ) })
135
69
  );
136
- P.displayName = "Tile";
137
- const D = (e) => {
138
- const { disabled: i } = p({
70
+ h.displayName = "Tile";
71
+ const S = (e) => {
72
+ const { disabled: t } = n({
139
73
  consumerName: "TileSpot",
140
74
  contextRequired: !0
141
75
  });
142
- return /* @__PURE__ */ s(z, { ...e, size: 48, disabled: i });
76
+ return /* @__PURE__ */ a(y, { ...e, size: 48, disabled: t });
143
77
  };
144
- D.displayName = "TileSpot";
145
- const E = ({
78
+ S.displayName = "TileSpot";
79
+ const w = ({
146
80
  children: e,
147
- className: i,
148
- ...r
149
- }) => /* @__PURE__ */ s(
81
+ className: t,
82
+ ...o
83
+ }) => /* @__PURE__ */ a(
150
84
  "div",
151
85
  {
152
- className: u("flex w-full flex-col items-center text-center", i),
153
- ...r,
86
+ className: s("flex w-full flex-col items-center text-center", t),
87
+ ...o,
154
88
  children: e
155
89
  }
156
90
  );
157
- E.displayName = "TileContent";
158
- const O = ({
91
+ w.displayName = "TileContent";
92
+ const R = ({
159
93
  children: e,
160
- className: i,
161
- ...r
94
+ className: t,
95
+ ...o
162
96
  }) => {
163
- const { disabled: t } = p({
97
+ const { disabled: r } = n({
164
98
  consumerName: "TileTitle",
165
99
  contextRequired: !0
166
100
  });
167
- return /* @__PURE__ */ s(
101
+ return /* @__PURE__ */ a(
168
102
  "div",
169
103
  {
170
- className: u(
104
+ className: s(
171
105
  "w-full truncate body-2-semi-bold",
172
- t && "text-disabled",
173
- i
106
+ r && "text-disabled",
107
+ t
174
108
  ),
175
- ...r,
109
+ ...o,
176
110
  children: e
177
111
  }
178
112
  );
179
113
  };
180
- O.displayName = "TileTitle";
181
- const B = ({
114
+ R.displayName = "TileTitle";
115
+ const q = ({
182
116
  children: e,
183
- className: i,
184
- ...r
117
+ className: t,
118
+ ...o
185
119
  }) => {
186
- const { disabled: t } = p({
120
+ const { disabled: r } = n({
187
121
  consumerName: "TileDescription",
188
122
  contextRequired: !0
189
123
  });
190
- return /* @__PURE__ */ s(
124
+ return /* @__PURE__ */ a(
191
125
  "div",
192
126
  {
193
- className: u(
127
+ className: s(
194
128
  "w-full truncate body-3",
195
- t ? "text-disabled" : "text-muted",
196
- i
129
+ r ? "text-disabled" : "text-muted",
130
+ t
197
131
  ),
198
- ...r,
132
+ ...o,
199
133
  children: e
200
134
  }
201
135
  );
202
136
  };
203
- B.displayName = "TileDescription";
204
- const y = x(({ onClick: e, icon: i, className: r, "aria-label": t, ...f }, m) => {
205
- const { disabled: l } = p({
137
+ q.displayName = "TileDescription";
138
+ const D = f(({ onClick: e, icon: t, className: o, "aria-label": r, ...i }, l) => {
139
+ const { disabled: c } = n({
206
140
  consumerName: "TileSecondaryAction",
207
141
  contextRequired: !0
208
- }), o = d(
209
- (n) => {
210
- n.stopPropagation(), n.preventDefault(), e == null || e(n);
142
+ }), d = x(
143
+ (p) => {
144
+ p.stopPropagation(), p.preventDefault(), e == null || e(p);
211
145
  },
212
146
  [e]
213
147
  );
214
- if (l) return null;
215
- const c = i;
216
- return /* @__PURE__ */ s(
217
- V,
148
+ if (c) return null;
149
+ const u = t;
150
+ return /* @__PURE__ */ a(
151
+ N,
218
152
  {
219
- "data-slot": "tile-secondary-action",
220
- className: u(
153
+ className: s(
221
154
  "absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
222
- r
155
+ o
223
156
  ),
224
157
  "data-secondary-button-container": !0,
225
158
  iconType: "stroked",
226
- onClick: o,
227
- "aria-label": t,
228
- ref: m,
229
- ...f,
230
- children: /* @__PURE__ */ s(c, { size: 24 })
159
+ onClick: d,
160
+ "aria-label": r,
161
+ ref: l,
162
+ ...i,
163
+ children: /* @__PURE__ */ a(u, { size: 24 })
231
164
  }
232
165
  );
233
166
  });
234
- y.displayName = "TileSecondaryAction";
167
+ D.displayName = "TileSecondaryAction";
235
168
  export {
236
- P as Tile,
237
- E as TileContent,
238
- B as TileDescription,
239
- y as TileSecondaryAction,
240
- D as TileSpot,
241
- O as TileTitle
169
+ h as Tile,
170
+ w as TileContent,
171
+ q as TileDescription,
172
+ D as TileSecondaryAction,
173
+ S as TileSpot,
174
+ R as TileTitle
242
175
  };
@@ -36,7 +36,12 @@ export type TileProps = {
36
36
  * Aria label for accessibility.
37
37
  */
38
38
  'aria-label'?: string;
39
- } & Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>;
39
+ /**
40
+ * The secondary action to display inside the tile.
41
+ * Typically contains a TileSecondaryAction component.
42
+ */
43
+ secondaryAction?: ReactNode;
44
+ } & Omit<HTMLAttributes<HTMLButtonElement>, 'onClick'>;
40
45
  export type TileSpotProps = DiscriminatedSpotProps;
41
46
  export type TileContentProps = {
42
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"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,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACvD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC"}
@@ -1,84 +1,76 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { createContext as h, Children as g, isValidElement as m, useMemo as x, useContext as $ } from "react";
3
- import { clsx as C } from "clsx";
4
- import { twMerge as w } from "tailwind-merge";
5
- function S(t) {
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { createContext as d, useMemo as h, useContext as g } from "react";
3
+ import { clsx as x } from "clsx";
4
+ import { twMerge as $ } from "tailwind-merge";
5
+ function P(t) {
6
6
  return t ? t.split(/[-_ ]+/).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join("") : "";
7
7
  }
8
- const v = 48, j = 17, y = 2;
9
- function b(t) {
8
+ const w = 48, C = 17, v = 2;
9
+ function S(t) {
10
10
  const n = t.replace(/\D/g, "").length;
11
11
  return Math.max(
12
- j,
13
- v - n * y
12
+ C,
13
+ w - n * v
14
14
  );
15
15
  }
16
- function p(t, n = !0) {
16
+ function m(t, n = !0) {
17
17
  if (!t) return "";
18
- const a = t.includes("."), [i, r] = t.split("."), s = i.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
- return a && n ? r ? `${s}.${r}` : `${s}.` : s;
18
+ const a = t.includes("."), [c, r] = t.split("."), o = c.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
+ return a && n ? r ? `${o}.${r}` : `${o}.` : o;
20
20
  }
21
- function F(t, n = {}) {
21
+ function b(t, n = {}) {
22
22
  const {
23
23
  allowDecimals: a = !0,
24
- thousandsSeparator: i = !0,
24
+ thousandsSeparator: c = !0,
25
25
  maxIntegerLength: r = 9,
26
- maxDecimalLength: s = 9
27
- } = n, o = t.replace(",", ".").replace(/[^\d.]/g, "");
28
- let e = o;
26
+ maxDecimalLength: o = 9
27
+ } = n, i = t.replace(",", ".").replace(/[^\d.]/g, "");
28
+ let e = i;
29
29
  if (e = e.replace(/^0+(?=\d)/, ""), !a)
30
- return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), i ? p(e) : e;
30
+ return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), c ? m(e) : e;
31
31
  e === "." && (e = "0.");
32
32
  const u = e.indexOf(".");
33
33
  if (u !== -1) {
34
- let l = e.slice(0, u), c = e.slice(u + 1).replace(/\./g, "");
35
- r > 0 && l.length > r && (l = l.slice(0, r)), c = c.slice(0, s), l === "" && (l = "0");
36
- const f = o.endsWith(".") || e.endsWith(".");
37
- e = c.length > 0 ? `${l}.${c}` : f ? `${l}.` : l;
34
+ let s = e.slice(0, u), l = e.slice(u + 1).replace(/\./g, "");
35
+ r > 0 && s.length > r && (s = s.slice(0, r)), l = l.slice(0, o), s === "" && (s = "0");
36
+ const f = i.endsWith(".") || e.endsWith(".");
37
+ e = l.length > 0 ? `${s}.${l}` : f ? `${s}.` : s;
38
38
  } else
39
39
  r > 0 && e.length > r && (e = e.slice(0, r));
40
- return i ? p(e) : e;
40
+ return c ? m(e) : e;
41
41
  }
42
- function O(t, n) {
43
- const a = h(n), i = ({ children: s, value: o }) => {
44
- const e = x(
45
- () => o,
46
- Object.values(o ?? {})
42
+ function A(t, n) {
43
+ const a = d(n), c = ({ children: o, value: i }) => {
44
+ const e = h(
45
+ () => i,
46
+ Object.values(i ?? {})
47
47
  );
48
- return /* @__PURE__ */ d(a.Provider, { value: e, children: s });
48
+ return /* @__PURE__ */ p(a.Provider, { value: e, children: o });
49
49
  };
50
- i.displayName = t + "Provider";
50
+ c.displayName = t + "Provider";
51
51
  function r({
52
- consumerName: s,
53
- contextRequired: o
52
+ consumerName: o,
53
+ contextRequired: i
54
54
  }) {
55
- const e = $(a);
55
+ const e = g(a);
56
56
  if (e)
57
57
  return e;
58
- if (o)
58
+ if (i)
59
59
  throw new Error(
60
- `${s} must be used within ${t}`
60
+ `${o} must be used within ${t}`
61
61
  );
62
62
  return n || {};
63
63
  }
64
- return [i, r];
64
+ return [c, r];
65
65
  }
66
- function P(...t) {
67
- return w(C(t));
68
- }
69
- function z(t, n) {
70
- const a = g.toArray(t), i = typeof n == "string" ? (o) => m(o) && o.props["data-slot"] === n : (o) => m(o) && o.type === n, r = a.find(i), s = a.filter((o) => !i(o));
71
- return {
72
- slotElement: r ?? null,
73
- remainingChildren: s
74
- };
66
+ function E(...t) {
67
+ return $(x(t));
75
68
  }
76
69
  export {
77
- P as cn,
78
- O as createSafeContext,
79
- z as extractSlottable,
80
- p as formatThousands,
81
- b as getFontSize,
82
- F as textFormatter,
83
- S as toPascalCase
70
+ E as cn,
71
+ A as createSafeContext,
72
+ m as formatThousands,
73
+ S as getFontSize,
74
+ b as textFormatter,
75
+ P as toPascalCase
84
76
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.66",
3
+ "version": "0.0.67",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@ledgerhq/lumen-utils-shared": "0.0.15",
44
+ "@ledgerhq/lumen-utils-shared": "0.0.16",
45
45
  "i18next": "^23.7.0",
46
46
  "react-i18next": "^14.0.0"
47
47
  },