@ledgerhq/lumen-ui-react 0.0.64 → 0.0.65

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.
@@ -27,6 +27,7 @@ export declare const BaseInput: React.ForwardRefExoticComponent<{
27
27
  onClear?: () => void;
28
28
  hideClearButton?: boolean;
29
29
  className?: string;
30
+ containerClassName?: string;
30
31
  inputClassName?: string;
31
32
  labelClassName?: string;
32
33
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & React.RefAttributes<HTMLInputElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;iHAyLrB,CAAC"}
1
+ {"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;iHA0LrB,CAAC"}
@@ -1,54 +1,55 @@
1
1
  import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
- import { cn as l } from "../../../libs/utils-shared/dist/index.js";
3
- import s from "react";
4
- import { useCommonTranslation as O } from "../../../i18n/useCommonTranslation.js";
5
- import { InteractiveIcon as _ } from "../InteractiveIcon/InteractiveIcon.js";
2
+ import { cn as a } from "../../../libs/utils-shared/dist/index.js";
3
+ import l from "react";
4
+ import { useCommonTranslation as _ } from "../../../i18n/useCommonTranslation.js";
5
+ import { InteractiveIcon as $ } from "../InteractiveIcon/InteractiveIcon.js";
6
6
  import { DeleteCircleFill as I } from "../../Symbols/Icons/DeleteCircleFill.js";
7
- const $ = l(
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
- ), q = l(
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
- ), H = l(
20
+ ), U = 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
- ), U = s.forwardRef(
26
+ ), G = l.forwardRef(
27
27
  ({
28
28
  className: N,
29
- inputClassName: R,
30
- labelClassName: S,
29
+ containerClassName: R,
30
+ inputClassName: S,
31
+ labelClassName: k,
31
32
  label: u,
32
- id: k,
33
+ id: z,
33
34
  disabled: f,
34
- errorMessage: a,
35
- suffix: z,
36
- prefix: E,
35
+ errorMessage: i,
36
+ suffix: E,
37
+ prefix: j,
37
38
  onClear: p,
38
- hideClearButton: j = !1,
39
+ hideClearButton: B = !1,
39
40
  "aria-invalid": m,
40
41
  onChange: d,
41
- ...i
42
- }, B) => {
42
+ ...o
43
+ }, C) => {
43
44
  var x;
44
- const { t: C } = O(), r = s.useRef(null), D = s.useId(), b = k || `input-${D}`, F = m || (a ? !0 : void 0), c = i.value !== void 0, [L, v] = s.useState(
45
- ((x = i.defaultValue) == null ? void 0 : x.toString()) || ""
46
- ), T = s.useCallback(
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(
46
+ ((x = o.defaultValue) == null ? void 0 : x.toString()) || ""
47
+ ), V = l.useCallback(
47
48
  (t) => {
48
49
  c || v(t.target.value), d == null || d(t);
49
50
  },
50
51
  [c, d]
51
- ), g = (c ? !!i.value && i.value.toString().length > 0 : L.length > 0) && !f && !j, w = `${b}-error`, V = () => {
52
+ ), g = (c ? !!o.value && o.value.toString().length > 0 : T.length > 0) && !f && !B, w = `${b}-error`, A = () => {
52
53
  var e;
53
54
  if (!r.current) return;
54
55
  const t = (e = Object.getOwnPropertyDescriptor(
@@ -56,13 +57,13 @@ const $ = l(
56
57
  "value"
57
58
  )) == null ? void 0 : e.set;
58
59
  t == null || t.call(r.current, ""), c || v("");
59
- const o = new Event("input", { bubbles: !0 });
60
- r.current.dispatchEvent(o), r.current.focus(), p == null || p();
60
+ const s = new Event("input", { bubbles: !0 });
61
+ r.current.dispatchEvent(s), r.current.focus(), p == null || p();
61
62
  };
62
- function A(...t) {
63
- return (o) => {
63
+ function O(...t) {
64
+ return (s) => {
64
65
  t.forEach((e) => {
65
- e && (typeof e == "function" ? e(o) : e.current = o);
66
+ e && (typeof e == "function" ? e(s) : e.current = s);
66
67
  });
67
68
  };
68
69
  }
@@ -70,7 +71,7 @@ const $ = l(
70
71
  /* @__PURE__ */ h(
71
72
  "div",
72
73
  {
73
- className: $,
74
+ className: a(q, R),
74
75
  onPointerDown: (t) => {
75
76
  if (t.target.closest("input, button, a")) return;
76
77
  const e = r.current;
@@ -85,51 +86,51 @@ const $ = l(
85
86
  });
86
87
  },
87
88
  children: [
88
- E,
89
+ j,
89
90
  /* @__PURE__ */ n(
90
91
  "input",
91
92
  {
92
- ref: A(B, r),
93
+ ref: O(C, r),
93
94
  id: b,
94
95
  disabled: f,
95
96
  placeholder: " ",
96
- "aria-invalid": F,
97
- "aria-describedby": a ? w : void 0,
98
- className: l(
99
- q,
97
+ "aria-invalid": L,
98
+ "aria-describedby": i ? w : void 0,
99
+ className: a(
100
+ H,
100
101
  u && "pt-12 body-2",
101
- R
102
+ S
102
103
  ),
103
- onChange: T,
104
- ...i
104
+ onChange: V,
105
+ ...o
105
106
  }
106
107
  ),
107
108
  u && /* @__PURE__ */ n(
108
109
  "label",
109
110
  {
110
111
  htmlFor: b,
111
- className: l(
112
- H,
113
- a && "text-error",
114
- S
112
+ className: a(
113
+ U,
114
+ i && "text-error",
115
+ k
115
116
  ),
116
117
  children: u
117
118
  }
118
119
  ),
119
120
  g && /* @__PURE__ */ n(
120
- _,
121
+ $,
121
122
  {
122
123
  iconType: "filled",
123
- onClick: V,
124
- "aria-label": C("components.baseInput.clearInputAriaLabel"),
124
+ onClick: A,
125
+ "aria-label": D("components.baseInput.clearInputAriaLabel"),
125
126
  children: /* @__PURE__ */ n(I, { size: 20 })
126
127
  }
127
128
  ),
128
- !g && z
129
+ !g && E
129
130
  ]
130
131
  }
131
132
  ),
132
- a && /* @__PURE__ */ h(
133
+ i && /* @__PURE__ */ h(
133
134
  "div",
134
135
  {
135
136
  id: w,
@@ -137,14 +138,14 @@ const $ = l(
137
138
  role: "alert",
138
139
  children: [
139
140
  /* @__PURE__ */ n(I, { size: 16, className: "shrink-0 text-error" }),
140
- /* @__PURE__ */ n("span", { children: a })
141
+ /* @__PURE__ */ n("span", { children: i })
141
142
  ]
142
143
  }
143
144
  )
144
145
  ] });
145
146
  }
146
147
  );
147
- U.displayName = "BaseInput";
148
+ G.displayName = "BaseInput";
148
149
  export {
149
- U as BaseInput
150
+ G as BaseInput
150
151
  };
@@ -32,9 +32,13 @@ export type BaseInputProps = {
32
32
  */
33
33
  hideClearButton?: boolean;
34
34
  /**
35
- * Additional class names to apply to the container element
35
+ * Additional class names to apply to the outer wrapper element
36
36
  */
37
37
  className?: string;
38
+ /**
39
+ * Additional class names to apply to the inner container element
40
+ */
41
+ containerClassName?: string;
38
42
  /**
39
43
  * Additional class names to apply to the input element
40
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { SearchInputProps } from './types';
3
2
  /**
4
3
  * A customizable search input component with built-in search icon, automatic clear button, error states, and focus/hover effects.
5
4
  *
@@ -54,5 +53,7 @@ import { SearchInputProps } from './types';
54
53
  * }}
55
54
  * />
56
55
  */
57
- export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
56
+ export declare const SearchInput: React.ForwardRefExoticComponent<Omit<import('..').BaseInputProps, "label" | "prefix" | "containerClassName" | "labelClassName"> & {
57
+ appearance?: "plain" | "transparent";
58
+ } & React.RefAttributes<HTMLInputElement>>;
58
59
  //# sourceMappingURL=SearchInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,WAAW,2FAcvB,CAAC"}
1
+ {"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,WAAW;;0CAuBvB,CAAC"}
@@ -1,18 +1,50 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import a from "react";
3
- import { BaseInput as o } from "../BaseInput/BaseInput.js";
4
- import { Search as s } from "../../Symbols/Icons/Search.js";
5
- const c = a.forwardRef(
6
- (r, t) => /* @__PURE__ */ e(o, { ref: t, prefix: /* @__PURE__ */ e(
7
- s,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { cn as i } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as t } from "class-variance-authority";
4
+ import o from "react";
5
+ import { BaseInput as d } from "../BaseInput/BaseInput.js";
6
+ import { Search as c } from "../../Symbols/Icons/Search.js";
7
+ const m = t("", {
8
+ variants: {
9
+ appearance: {
10
+ plain: "",
11
+ transparent: "bg-muted-transparent hover:bg-muted-transparent-hover has-disabled:bg-muted-transparent-disabled"
12
+ }
13
+ },
14
+ defaultVariants: {
15
+ appearance: "plain"
16
+ }
17
+ }), l = t("", {
18
+ variants: {
19
+ appearance: {
20
+ plain: "",
21
+ transparent: "bg-transparent group-hover:bg-transparent-hover group-has-disabled:bg-transparent-disabled"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ appearance: "plain"
26
+ }
27
+ }), u = o.forwardRef(
28
+ ({ appearance: a = "plain", className: e, inputClassName: n, ...s }, p) => /* @__PURE__ */ r(
29
+ d,
8
30
  {
9
- size: 20,
10
- className: "text-muted group-has-disabled:text-disabled",
11
- "aria-hidden": "true"
31
+ ref: p,
32
+ prefix: /* @__PURE__ */ r(
33
+ c,
34
+ {
35
+ size: 20,
36
+ className: "text-muted group-has-disabled:text-disabled",
37
+ "aria-hidden": "true"
38
+ }
39
+ ),
40
+ className: e,
41
+ containerClassName: m({ appearance: a }),
42
+ inputClassName: i(l({ appearance: a }), n),
43
+ ...s
12
44
  }
13
- ), ...r })
45
+ )
14
46
  );
15
- c.displayName = "SearchInput";
47
+ u.displayName = "SearchInput";
16
48
  export {
17
- c as SearchInput
49
+ u as SearchInput
18
50
  };
@@ -1,3 +1,9 @@
1
1
  import { BaseInputProps } from '../BaseInput/types';
2
- export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label' | 'labelClassName' | 'inputClassName'>;
2
+ export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label' | 'labelClassName' | 'containerClassName'> & {
3
+ /**
4
+ * The visual appearance of the search input
5
+ * @default 'plain'
6
+ */
7
+ appearance?: 'plain' | 'transparent';
8
+ };
3
9
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,gBAAgB,CACzD,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,oBAAoB,CAC7D,GAAG;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACtC,CAAC"}
@@ -1,4 +1,5 @@
1
- import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionProps, TileSpotProps, TileTitleProps } from './types';
1
+ import { MouseEventHandler } from 'react';
2
+ import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps } from './types';
2
3
  /**
3
4
  * A flexible tile component that uses a composite pattern for maximum customization.
4
5
  * Displays content in a vertical layout with support for spots, text, and custom content.
@@ -26,10 +27,14 @@ import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionP
26
27
  * <div>Custom content</div>
27
28
  * </Tile>
28
29
  */
29
- export declare const Tile: {
30
- ({ className, onClick, appearance, disabled, "aria-label": ariaLabel, children, onMouseDown, onMouseUp, onMouseLeave, ...props }: TileProps): import("react/jsx-runtime").JSX.Element;
31
- displayName: string;
32
- };
30
+ export declare const Tile: import('react').ForwardRefExoticComponent<{
31
+ appearance?: "no-background" | "card";
32
+ disabled?: boolean;
33
+ onClick?: MouseEventHandler<HTMLButtonElement>;
34
+ children: import('react').ReactNode;
35
+ className?: string;
36
+ 'aria-label'?: string;
37
+ } & Omit<import('react').HTMLAttributes<HTMLDivElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
33
38
  /**
34
39
  * A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
35
40
  * Always renders at a fixed size of 48.
@@ -79,8 +84,9 @@ export declare const TileDescription: {
79
84
  * </TileContent>
80
85
  * </Tile>
81
86
  */
82
- export declare const TileSecondaryAction: {
83
- ({ onClick, icon, className, "aria-label": ariaLabel, ...props }: TileSecondaryActionProps): import("react/jsx-runtime").JSX.Element | null;
84
- displayName: string;
85
- };
87
+ export declare const TileSecondaryAction: import('react').ForwardRefExoticComponent<{
88
+ onClick?: MouseEventHandler;
89
+ icon: React.ComponentType<Omit<import('../Icon').IconProps, "children">>;
90
+ className?: string;
91
+ } & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLButtonElement>>;
86
92
  //# sourceMappingURL=Tile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACpB,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAgEjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;sIAWd,SAAS;;CAqFX,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;sEAM7B,wBAAwB;;CAmC1B,CAAC"}
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,11 +1,11 @@
1
- import { jsx as l, jsxs as k } from "react/jsx-runtime";
2
- import { extractSlottable as q, createSafeContext as C, cn as d } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as b } from "class-variance-authority";
4
- import { useState as I, useCallback as n } from "react";
5
- import { Spot as R } from "../Spot/Spot.js";
6
- import { InteractiveIcon as z } from "../InteractiveIcon/InteractiveIcon.js";
7
- const [V, u] = C("Tile"), v = {
8
- root: b(
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(
9
9
  [
10
10
  "group relative flex flex-col items-center gap-8 text-base transition-colors",
11
11
  "rounded-md focus-visible:outline-2 focus-visible:outline-focus"
@@ -58,113 +58,116 @@ const [V, u] = C("Tile"), v = {
58
58
  }
59
59
  }
60
60
  ),
61
- button: b(
61
+ button: v(
62
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
63
  )
64
- }, j = ({
65
- className: e,
66
- onClick: i,
67
- appearance: r = "no-background",
68
- disabled: t = !1,
69
- "aria-label": p,
70
- children: m,
71
- onMouseDown: o,
72
- onMouseUp: c,
73
- onMouseLeave: s,
74
- ...x
75
- }) => {
76
- const [y, f] = I(!1), { slotElement: N, remainingChildren: g } = q(
77
- m,
78
- T
79
- ), h = n(
80
- (a) => {
81
- a.target.closest(
82
- "[data-secondary-button-container]"
83
- ) || (o == null || o(a), f(!0));
84
- },
85
- [o]
86
- ), A = n(
87
- (a) => {
88
- f(!1), c == null || c(a);
89
- },
90
- [c]
91
- ), S = n(
92
- (a) => {
93
- f(!1), s == null || s(a);
94
- },
95
- [s]
96
- );
97
- return /* @__PURE__ */ l(V, { value: { disabled: t }, children: /* @__PURE__ */ k(
98
- "div",
99
- {
100
- ...x,
101
- className: v.root({
102
- appearance: r,
103
- isActive: y,
104
- disabled: t,
105
- className: e
106
- }),
107
- onMouseDown: t ? void 0 : (a) => {
108
- h(a);
64
+ }, P = x(
65
+ ({
66
+ className: e,
67
+ onClick: i,
68
+ 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));
109
85
  },
110
- onMouseUp: t ? void 0 : (a) => {
111
- A(a);
86
+ [l]
87
+ ), k = d(
88
+ (a) => {
89
+ b(!1), o == null || o(a);
112
90
  },
113
- onMouseLeave: t ? void 0 : (a) => {
114
- S(a);
91
+ [o]
92
+ ), R = d(
93
+ (a) => {
94
+ b(!1), c == null || c(a);
115
95
  },
116
- children: [
117
- /* @__PURE__ */ l(
118
- "button",
119
- {
120
- "aria-label": p,
121
- onClick: t ? void 0 : i,
122
- disabled: t,
123
- "data-disabled": t || void 0,
124
- className: v.button(),
125
- children: g
126
- }
127
- ),
128
- N
129
- ]
130
- }
131
- ) });
132
- };
133
- j.displayName = "Tile";
134
- const w = (e) => {
135
- const { disabled: i } = u({
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
+ }
135
+ );
136
+ P.displayName = "Tile";
137
+ const D = (e) => {
138
+ const { disabled: i } = p({
136
139
  consumerName: "TileSpot",
137
140
  contextRequired: !0
138
141
  });
139
- return /* @__PURE__ */ l(R, { ...e, size: 48, disabled: i });
142
+ return /* @__PURE__ */ s(z, { ...e, size: 48, disabled: i });
140
143
  };
141
- w.displayName = "TileSpot";
142
- const P = ({
144
+ D.displayName = "TileSpot";
145
+ const E = ({
143
146
  children: e,
144
147
  className: i,
145
148
  ...r
146
- }) => /* @__PURE__ */ l(
149
+ }) => /* @__PURE__ */ s(
147
150
  "div",
148
151
  {
149
- className: d("flex w-full flex-col items-center text-center", i),
152
+ className: u("flex w-full flex-col items-center text-center", i),
150
153
  ...r,
151
154
  children: e
152
155
  }
153
156
  );
154
- P.displayName = "TileContent";
155
- const D = ({
157
+ E.displayName = "TileContent";
158
+ const O = ({
156
159
  children: e,
157
160
  className: i,
158
161
  ...r
159
162
  }) => {
160
- const { disabled: t } = u({
163
+ const { disabled: t } = p({
161
164
  consumerName: "TileTitle",
162
165
  contextRequired: !0
163
166
  });
164
- return /* @__PURE__ */ l(
167
+ return /* @__PURE__ */ s(
165
168
  "div",
166
169
  {
167
- className: d(
170
+ className: u(
168
171
  "w-full truncate body-2-semi-bold",
169
172
  t && "text-disabled",
170
173
  i
@@ -174,20 +177,20 @@ const D = ({
174
177
  }
175
178
  );
176
179
  };
177
- D.displayName = "TileTitle";
178
- const E = ({
180
+ O.displayName = "TileTitle";
181
+ const B = ({
179
182
  children: e,
180
183
  className: i,
181
184
  ...r
182
185
  }) => {
183
- const { disabled: t } = u({
186
+ const { disabled: t } = p({
184
187
  consumerName: "TileDescription",
185
188
  contextRequired: !0
186
189
  });
187
- return /* @__PURE__ */ l(
190
+ return /* @__PURE__ */ s(
188
191
  "div",
189
192
  {
190
- className: d(
193
+ className: u(
191
194
  "w-full truncate body-3",
192
195
  t ? "text-disabled" : "text-muted",
193
196
  i
@@ -197,30 +200,24 @@ const E = ({
197
200
  }
198
201
  );
199
202
  };
200
- E.displayName = "TileDescription";
201
- const T = ({
202
- onClick: e,
203
- icon: i,
204
- className: r,
205
- "aria-label": t,
206
- ...p
207
- }) => {
208
- const { disabled: m } = u({
203
+ B.displayName = "TileDescription";
204
+ const y = x(({ onClick: e, icon: i, className: r, "aria-label": t, ...f }, m) => {
205
+ const { disabled: l } = p({
209
206
  consumerName: "TileSecondaryAction",
210
207
  contextRequired: !0
211
- }), o = n(
212
- (s) => {
213
- s.stopPropagation(), s.preventDefault(), e == null || e(s);
208
+ }), o = d(
209
+ (n) => {
210
+ n.stopPropagation(), n.preventDefault(), e == null || e(n);
214
211
  },
215
212
  [e]
216
213
  );
217
- if (m) return null;
214
+ if (l) return null;
218
215
  const c = i;
219
- return /* @__PURE__ */ l(
220
- z,
216
+ return /* @__PURE__ */ s(
217
+ V,
221
218
  {
222
219
  "data-slot": "tile-secondary-action",
223
- className: d(
220
+ className: u(
224
221
  "absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
225
222
  r
226
223
  ),
@@ -228,17 +225,18 @@ const T = ({
228
225
  iconType: "stroked",
229
226
  onClick: o,
230
227
  "aria-label": t,
231
- ...p,
232
- children: /* @__PURE__ */ l(c, { size: 24 })
228
+ ref: m,
229
+ ...f,
230
+ children: /* @__PURE__ */ s(c, { size: 24 })
233
231
  }
234
232
  );
235
- };
236
- T.displayName = "TileSecondaryAction";
233
+ });
234
+ y.displayName = "TileSecondaryAction";
237
235
  export {
238
- j as Tile,
239
- P as TileContent,
240
- E as TileDescription,
241
- T as TileSecondaryAction,
242
- w as TileSpot,
243
- D as TileTitle
236
+ P as Tile,
237
+ E as TileContent,
238
+ B as TileDescription,
239
+ y as TileSecondaryAction,
240
+ D as TileSpot,
241
+ O as TileTitle
244
242
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
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.64",
3
+ "version": "0.0.65",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [