@ledgerhq/lumen-ui-react 0.1.11 → 0.1.12

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.
Files changed (89) hide show
  1. package/dist/index.js +53 -55
  2. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +10 -10
  3. package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  4. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  5. package/dist/lib/Components/AmountInput/AmountInput.js +35 -32
  6. package/dist/lib/Components/Banner/Banner.js +5 -5
  7. package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
  8. package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  9. package/dist/lib/Components/BaseInput/BaseInput.js +44 -41
  10. package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
  11. package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
  12. package/dist/lib/Components/Button/BaseButton.js +28 -25
  13. package/dist/lib/Components/Button/Button.js +9 -9
  14. package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts +1 -1
  15. package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts.map +1 -1
  16. package/dist/lib/Components/ButtonTrigger/ButtonTrigger.js +37 -34
  17. package/dist/lib/Components/Card/Card.d.ts.map +1 -1
  18. package/dist/lib/Components/Card/Card.js +132 -129
  19. package/dist/lib/Components/Card/types.d.ts +1 -0
  20. package/dist/lib/Components/Card/types.d.ts.map +1 -1
  21. package/dist/lib/Components/CardButton/CardButton.d.ts +1 -1
  22. package/dist/lib/Components/CardButton/CardButton.d.ts.map +1 -1
  23. package/dist/lib/Components/CardButton/CardButton.js +28 -24
  24. package/dist/lib/Components/Checkbox/Checkbox.d.ts +1 -1
  25. package/dist/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
  26. package/dist/lib/Components/Checkbox/Checkbox.js +26 -14
  27. package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +2 -2
  28. package/dist/lib/Components/Dialog/types.d.ts +1 -1
  29. package/dist/lib/Components/Icon/Icon.js +4 -4
  30. package/dist/lib/Components/Icon/createIcon.js +4 -4
  31. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -1
  32. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
  33. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +24 -18
  34. package/dist/lib/Components/InteractiveIcon/types.d.ts +6 -1
  35. package/dist/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
  36. package/dist/lib/Components/Link/Link.d.ts +1 -1
  37. package/dist/lib/Components/Link/Link.d.ts.map +1 -1
  38. package/dist/lib/Components/Link/Link.js +44 -33
  39. package/dist/lib/Components/Link/types.d.ts +5 -0
  40. package/dist/lib/Components/Link/types.d.ts.map +1 -1
  41. package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  42. package/dist/lib/Components/ListItem/ListItem.js +72 -65
  43. package/dist/lib/Components/Menu/Menu.d.ts +3 -3
  44. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  45. package/dist/lib/Components/Menu/Menu.js +133 -104
  46. package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
  47. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  48. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  49. package/dist/lib/Components/SegmentedControl/SegmentedControl.js +88 -51
  50. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -1
  51. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  52. package/dist/lib/Components/Select/Select.d.ts +2 -2
  53. package/dist/lib/Components/Select/Select.d.ts.map +1 -1
  54. package/dist/lib/Components/Select/Select.js +94 -76
  55. package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
  56. package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
  57. package/dist/lib/Components/SideBar/SideBar.js +77 -74
  58. package/dist/lib/Components/SideBar/types.d.ts +12 -4
  59. package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
  60. package/dist/lib/Components/Spot/Spot.js +3 -3
  61. package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
  62. package/dist/lib/Components/Stepper/Stepper.js +34 -24
  63. package/dist/lib/Components/Subheader/Subheader.d.ts +2 -7
  64. package/dist/lib/Components/Subheader/Subheader.d.ts.map +1 -1
  65. package/dist/lib/Components/Subheader/Subheader.js +31 -49
  66. package/dist/lib/Components/Subheader/index.d.ts +1 -1
  67. package/dist/lib/Components/Subheader/index.d.ts.map +1 -1
  68. package/dist/lib/Components/Subheader/types.d.ts +1 -11
  69. package/dist/lib/Components/Subheader/types.d.ts.map +1 -1
  70. package/dist/lib/Components/Switch/Switch.d.ts +1 -1
  71. package/dist/lib/Components/Switch/Switch.d.ts.map +1 -1
  72. package/dist/lib/Components/Switch/Switch.js +30 -22
  73. package/dist/lib/Components/Table/Table.js +49 -49
  74. package/dist/lib/Components/Tag/Tag.d.ts +1 -1
  75. package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
  76. package/dist/lib/Components/Tag/Tag.js +17 -14
  77. package/dist/lib/Components/Tile/Tile.d.ts +5 -12
  78. package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
  79. package/dist/lib/Components/Tile/Tile.js +79 -82
  80. package/dist/lib/Components/Tile/index.d.ts +1 -1
  81. package/dist/lib/Components/Tile/index.d.ts.map +1 -1
  82. package/dist/lib/Components/Tile/types.d.ts +1 -10
  83. package/dist/lib/Components/Tile/types.d.ts.map +1 -1
  84. package/dist/lib/Components/TileButton/TileButton.d.ts +1 -1
  85. package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -1
  86. package/dist/lib/Components/TileButton/TileButton.js +26 -23
  87. package/dist/libs/utils-shared/dist/index.js +95 -90
  88. package/dist/package.json +1 -1
  89. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { jsx as n, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as m } from "react/jsx-runtime";
2
2
  import { createSafeContext as N, cn as c } from "../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as s } from "class-variance-authority";
4
4
  import { useThrottledScrollBottom as T } from "./utils/useThrottledScrollBottom.js";
@@ -23,16 +23,16 @@ const [A, u] = N("Table"), I = s(
23
23
  children: t,
24
24
  appearance: e = "no-background",
25
25
  className: a,
26
- onScrollBottom: l,
26
+ onScrollBottom: n,
27
27
  loading: r,
28
28
  ref: o,
29
29
  ...i
30
30
  }) => {
31
31
  const d = T({
32
- onScrollBottom: l,
32
+ onScrollBottom: n,
33
33
  loading: r
34
34
  });
35
- return /* @__PURE__ */ n(A, { value: { appearance: e, loading: r }, children: /* @__PURE__ */ n(
35
+ return /* @__PURE__ */ l(A, { value: { appearance: e, loading: r }, children: /* @__PURE__ */ l(
36
36
  "div",
37
37
  {
38
38
  ...i,
@@ -44,10 +44,10 @@ const [A, u] = N("Table"), I = s(
44
44
  ) });
45
45
  };
46
46
  L.displayName = "TableRoot";
47
- const S = ({ children: t, className: e, ref: a, ...l }) => /* @__PURE__ */ n(
47
+ const S = ({ children: t, className: e, ref: a, ...n }) => /* @__PURE__ */ l(
48
48
  "table",
49
49
  {
50
- ...l,
50
+ ...n,
51
51
  className: c("w-full max-w-full table-fixed", e),
52
52
  ref: a,
53
53
  children: t
@@ -58,28 +58,28 @@ const V = ({
58
58
  children: t,
59
59
  className: e,
60
60
  ref: a,
61
- ...l
62
- }) => /* @__PURE__ */ n("thead", { ref: a, className: e, ...l, children: t });
61
+ ...n
62
+ }) => /* @__PURE__ */ l("thead", { ref: a, className: e, ...n, children: t });
63
63
  V.displayName = "TableHeader";
64
64
  const k = ({
65
65
  children: t,
66
66
  className: e,
67
67
  ref: a,
68
- ...l
69
- }) => /* @__PURE__ */ n("tbody", { ref: a, className: e, ...l, children: t });
68
+ ...n
69
+ }) => /* @__PURE__ */ l("tbody", { ref: a, className: e, ...n, children: t });
70
70
  k.displayName = "TableBody";
71
71
  const z = ({
72
72
  children: t,
73
73
  className: e,
74
74
  clickable: a = !1,
75
- onClick: l,
75
+ onClick: n,
76
76
  ref: r,
77
77
  ...o
78
- }) => /* @__PURE__ */ n(
78
+ }) => /* @__PURE__ */ l(
79
79
  "tr",
80
80
  {
81
81
  ref: r,
82
- onClick: l,
82
+ onClick: n,
83
83
  role: a ? "button" : void 0,
84
84
  className: c(
85
85
  a && "cursor-pointer outline-none select-none hover:bg-base-transparent-hover active:bg-base-transparent-pressed",
@@ -101,18 +101,18 @@ const q = s("sticky top-0", {
101
101
  children: t,
102
102
  className: e,
103
103
  ref: a,
104
- ...l
104
+ ...n
105
105
  }) => {
106
106
  const { appearance: r } = u({
107
107
  consumerName: "TableHeaderRow",
108
108
  contextRequired: !0
109
109
  });
110
- return /* @__PURE__ */ n(
110
+ return /* @__PURE__ */ l(
111
111
  "tr",
112
112
  {
113
113
  ref: a,
114
114
  className: q({ appearance: r, className: e }),
115
- ...l,
115
+ ...n,
116
116
  children: t
117
117
  }
118
118
  );
@@ -122,14 +122,14 @@ const M = ({
122
122
  children: t,
123
123
  className: e,
124
124
  colSpan: a = 1,
125
- ref: l,
125
+ ref: n,
126
126
  ...r
127
127
  }) => {
128
128
  const { appearance: o } = u({
129
129
  consumerName: "TableGroupHeaderRow",
130
130
  contextRequired: !0
131
131
  });
132
- return /* @__PURE__ */ n("tr", { ref: l, className: c("h-40", e), ...r, children: /* @__PURE__ */ n("td", { colSpan: a, children: /* @__PURE__ */ n(
132
+ return /* @__PURE__ */ l("tr", { ref: n, className: c("h-40", e), ...r, children: /* @__PURE__ */ l("td", { colSpan: a, children: /* @__PURE__ */ l(
133
133
  "div",
134
134
  {
135
135
  className: c(
@@ -168,16 +168,16 @@ const p = {
168
168
  children: t,
169
169
  className: e,
170
170
  hideBelow: a,
171
- align: l = "start",
171
+ align: n = "start",
172
172
  ref: r,
173
173
  ...o
174
- }) => /* @__PURE__ */ n(
174
+ }) => /* @__PURE__ */ l(
175
175
  "td",
176
176
  {
177
177
  ref: r,
178
178
  className: p.root({ hideBelow: a, className: e }),
179
179
  ...o,
180
- children: /* @__PURE__ */ n("div", { className: p.inner({ align: l }), children: t })
180
+ children: /* @__PURE__ */ l("div", { className: p.inner({ align: n }), children: t })
181
181
  }
182
182
  );
183
183
  P.displayName = "TableCell";
@@ -192,7 +192,7 @@ const U = s("flex items-center gap-12 truncate", {
192
192
  className: t,
193
193
  align: e = "start",
194
194
  leadingContent: a,
195
- title: l,
195
+ title: n,
196
196
  description: r,
197
197
  ref: o,
198
198
  ...i
@@ -203,10 +203,10 @@ const U = s("flex items-center gap-12 truncate", {
203
203
  className: U({ align: e, className: t }),
204
204
  ...i,
205
205
  children: [
206
- /* @__PURE__ */ n("div", { children: a }),
206
+ /* @__PURE__ */ l("div", { children: a }),
207
207
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-4 truncate", children: [
208
- /* @__PURE__ */ n("div", { className: "truncate body-2 text-base", children: l }),
209
- /* @__PURE__ */ n("div", { className: "truncate body-3 text-muted", children: r })
208
+ /* @__PURE__ */ l("div", { className: "truncate body-2 text-base", children: n }),
209
+ /* @__PURE__ */ l("div", { className: "truncate body-3 text-muted", children: r })
210
210
  ] })
211
211
  ]
212
212
  }
@@ -239,21 +239,21 @@ const f = {
239
239
  children: t,
240
240
  className: e,
241
241
  scope: a = "col",
242
- hideBelow: l,
242
+ hideBelow: n,
243
243
  align: r = "start",
244
244
  trailingContent: o,
245
245
  ref: i,
246
246
  ...d
247
- }) => /* @__PURE__ */ n(
247
+ }) => /* @__PURE__ */ l(
248
248
  "th",
249
249
  {
250
250
  ref: i,
251
251
  scope: a,
252
- className: f.root({ hideBelow: l, className: e }),
252
+ className: f.root({ hideBelow: n, className: e }),
253
253
  ...d,
254
- children: /* @__PURE__ */ n("div", { className: "min-w-0", children: /* @__PURE__ */ m("div", { className: f.content({ align: r }), children: [
255
- /* @__PURE__ */ n("span", { className: c("truncate", r === "end" && "order-1"), children: t }),
256
- /* @__PURE__ */ n("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: o })
254
+ children: /* @__PURE__ */ l("div", { className: "min-w-0", children: /* @__PURE__ */ m("div", { className: f.content({ align: r }), children: [
255
+ /* @__PURE__ */ l("span", { className: c("truncate", r === "end" && "order-1"), children: t }),
256
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: o })
257
257
  ] }) })
258
258
  }
259
259
  );
@@ -262,13 +262,13 @@ const J = ({
262
262
  children: t,
263
263
  className: e,
264
264
  ref: a,
265
- ...l
266
- }) => /* @__PURE__ */ n(
265
+ ...n
266
+ }) => /* @__PURE__ */ l(
267
267
  "div",
268
268
  {
269
269
  ref: a,
270
270
  className: c("flex items-center gap-8 py-12", e),
271
- ...l,
271
+ ...n,
272
272
  children: t
273
273
  }
274
274
  );
@@ -277,13 +277,13 @@ const K = ({
277
277
  children: t,
278
278
  className: e,
279
279
  ref: a,
280
- ...l
281
- }) => /* @__PURE__ */ n(
280
+ ...n
281
+ }) => /* @__PURE__ */ l(
282
282
  "div",
283
283
  {
284
284
  ref: a,
285
285
  className: c("flex items-center gap-8", e),
286
- ...l,
286
+ ...n,
287
287
  children: t
288
288
  }
289
289
  );
@@ -292,13 +292,13 @@ const O = ({
292
292
  children: t,
293
293
  className: e,
294
294
  ref: a,
295
- ...l
296
- }) => /* @__PURE__ */ n(
295
+ ...n
296
+ }) => /* @__PURE__ */ l(
297
297
  "div",
298
298
  {
299
299
  ref: a,
300
300
  className: c("ml-auto flex items-center gap-8", e),
301
- ...l,
301
+ ...n,
302
302
  children: t
303
303
  }
304
304
  );
@@ -308,11 +308,11 @@ const Q = ({
308
308
  ref: e,
309
309
  ...a
310
310
  }) => {
311
- const { loading: l } = u({
311
+ const { loading: n } = u({
312
312
  consumerName: "TableLoadingRow",
313
313
  contextRequired: !0
314
314
  });
315
- return l ? /* @__PURE__ */ n(
315
+ return n ? /* @__PURE__ */ l(
316
316
  "div",
317
317
  {
318
318
  ...a,
@@ -321,7 +321,7 @@ const Q = ({
321
321
  "flex h-80 w-full items-center justify-center p-12",
322
322
  t
323
323
  ),
324
- children: /* @__PURE__ */ n(g, { appearance: "loader", size: 48 })
324
+ children: /* @__PURE__ */ l(g, { appearance: "loader", size: 48 })
325
325
  }
326
326
  ) : null;
327
327
  };
@@ -330,14 +330,14 @@ const W = ({
330
330
  className: t,
331
331
  ref: e,
332
332
  ...a
333
- }) => /* @__PURE__ */ n(
333
+ }) => /* @__PURE__ */ l(
334
334
  H,
335
335
  {
336
336
  ...a,
337
337
  iconType: "filled",
338
338
  className: t,
339
339
  ref: e,
340
- children: /* @__PURE__ */ n(w, { size: 20 })
340
+ children: /* @__PURE__ */ l(w, { size: 20 })
341
341
  }
342
342
  );
343
343
  W.displayName = "TableInfoIcon";
@@ -372,7 +372,7 @@ const X = {
372
372
  children: t,
373
373
  sortDirection: e,
374
374
  align: a = "start",
375
- onToggleSort: l,
375
+ onToggleSort: n,
376
376
  className: r,
377
377
  onClick: o,
378
378
  ref: i,
@@ -391,11 +391,11 @@ const X = {
391
391
  className: v.root({ align: a, className: r }),
392
392
  "aria-label": e ? h[e] : void 0,
393
393
  onClick: (y) => {
394
- o?.(y), l?.(e === "asc" ? "desc" : "asc");
394
+ o?.(y), n?.(e === "asc" ? "desc" : "asc");
395
395
  },
396
396
  children: [
397
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t }),
398
- /* @__PURE__ */ n(
397
+ /* @__PURE__ */ l("span", { className: "min-w-0 truncate", children: t }),
398
+ /* @__PURE__ */ l(
399
399
  x,
400
400
  {
401
401
  size: 20,
@@ -1,6 +1,6 @@
1
1
  import { TagProps } from './types';
2
2
  export declare const Tag: {
3
- ({ ref, className, appearance, size, icon, label, disabled, ...props }: TagProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ ref, className, appearance, size, icon, label, disabled: disabledProp, ...props }: TagProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  //# sourceMappingURL=Tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tag/Tag.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA+BnC,eAAO,MAAM,GAAG;4EASb,QAAQ;;CAqBV,CAAC"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tag/Tag.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA+BnC,eAAO,MAAM,GAAG;0FASb,QAAQ;;CAyBV,CAAC"}
@@ -1,7 +1,7 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { cn as l } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as b } from "class-variance-authority";
4
- const g = b(
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { useDisabledContext as b, cn as g } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as x } from "class-variance-authority";
4
+ const u = x(
5
5
  "inline-flex items-center justify-center gap-4 rounded-xs",
6
6
  {
7
7
  variants: {
@@ -28,34 +28,37 @@ const g = b(
28
28
  disabled: !1
29
29
  }
30
30
  }
31
- ), x = ({
31
+ ), f = ({
32
32
  ref: s,
33
33
  className: n,
34
34
  appearance: r,
35
35
  size: e,
36
36
  icon: c,
37
37
  label: i,
38
- disabled: o,
39
- ...d
38
+ disabled: d,
39
+ ...o
40
40
  }) => {
41
- const p = e ? {
41
+ const m = b({
42
+ consumerName: "Tag",
43
+ mergeWith: { disabled: d }
44
+ }), l = e ? {
42
45
  md: 16,
43
46
  sm: 12
44
47
  }[e] : 16, a = c;
45
- return /* @__PURE__ */ m(
48
+ return /* @__PURE__ */ p(
46
49
  "div",
47
50
  {
48
- className: l(n, g({ appearance: r, size: e, disabled: o })),
51
+ className: g(n, u({ appearance: r, size: e, disabled: m })),
49
52
  ref: s,
50
- ...d,
53
+ ...o,
51
54
  children: [
52
- a && /* @__PURE__ */ t(a, { size: p, className: "shrink-0" }),
55
+ a && /* @__PURE__ */ t(a, { size: l, className: "shrink-0" }),
53
56
  /* @__PURE__ */ t("span", { children: i })
54
57
  ]
55
58
  }
56
59
  );
57
60
  };
58
- x.displayName = "Tag";
61
+ f.displayName = "Tag";
59
62
  export {
60
- x as Tag
63
+ f as Tag
61
64
  };
@@ -1,4 +1,4 @@
1
- import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionProps, TileSpotProps, TileTitleProps, TileTrailingContentProps } from './types';
1
+ import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionProps, TileTitleProps, TileTrailingContentProps } from './types';
2
2
  /**
3
3
  * A flexible tile component that uses a composite pattern for maximum customization.
4
4
  * Displays content in a vertical layout with support for spots, text, and custom content.
@@ -9,17 +9,17 @@ import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionP
9
9
  * @example
10
10
  * import {
11
11
  * Tile,
12
- * TileSpot,
13
12
  * TileContent,
14
13
  * TileTitle,
15
14
  * TileSecondaryAction,
16
15
  * Tag
17
16
  * } from '@ledgerhq/lumen-ui-react';
17
+ * import { Spot } from '@ledgerhq/lumen-ui-react';
18
18
  * import { Bitcoin, MoreVertical } from '@ledgerhq/lumen-ui-react/symbols';
19
19
  *
20
20
  * <Tile appearance="card">
21
21
  * <TileSecondaryAction icon={MoreVertical} onClick={() => console.log('More')} />
22
- * <TileSpot appearance="icon" icon={Bitcoin} />
22
+ * <Spot appearance="icon" icon={Bitcoin} />
23
23
  * <TileContent>
24
24
  * <TileTitle>Bitcoin</TileTitle>
25
25
  * </TileContent>
@@ -27,14 +27,7 @@ import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionP
27
27
  * </Tile>
28
28
  */
29
29
  export declare const Tile: {
30
- ({ ref, className, onClick, secondaryAction, appearance, disabled, centered, children, style, ...props }: TileProps): import("react/jsx-runtime").JSX.Element;
31
- displayName: string;
32
- };
33
- /**
34
- * A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
35
- */
36
- export declare const TileSpot: {
37
- ({ size, ...props }: TileSpotProps): import("react/jsx-runtime").JSX.Element;
30
+ ({ ref, className, onClick, secondaryAction, appearance, disabled: disabledProp, centered, children, style, ...props }: TileProps): import("react/jsx-runtime").JSX.Element;
38
31
  displayName: string;
39
32
  };
40
33
  /**
@@ -68,7 +61,7 @@ export declare const TileDescription: {
68
61
  *
69
62
  * @example
70
63
  * <Tile>
71
- * <TileSpot appearance="icon" icon={Settings} />
64
+ * <Spot appearance="icon" icon={Settings} />
72
65
  * <TileContent>
73
66
  * <TileTitle>My Title</TileTitle>
74
67
  * <TileDescription>Description</TileDescription>
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACpB,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAuCjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;8GAWd,SAAS;;CA0BX,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,QAAQ;yBAA6B,aAAa;;CAM9D,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;wCAI7B,wBAAwB;;CAS1B,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;2EAO7B,wBAAwB;;CAmC1B,CAAC"}
1
+ {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACT,wBAAwB,EACxB,cAAc,EACd,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAoCjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;4HAWd,SAAS;;CA+BX,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;wCAI7B,wBAAwB;;CAS1B,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;2EAO7B,wBAAwB;;CAqC1B,CAAC"}
@@ -1,14 +1,13 @@
1
- import { jsx as i, jsxs as b } from "react/jsx-runtime";
2
- import { createSafeContext as T, cn as l } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as f } from "class-variance-authority";
4
- import { useCallback as x } from "react";
5
- import { Spot as v } from "../Spot/Spot.js";
1
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
2
+ import { useDisabledContext as o, DisabledProvider as m, cn as s } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as p } from "class-variance-authority";
4
+ import { useCallback as T } from "react";
6
5
  import { InteractiveIcon as y } from "../InteractiveIcon/InteractiveIcon.js";
7
- const [N, s] = T("Tile"), m = {
8
- root: f([
6
+ const v = {
7
+ root: p([
9
8
  "group relative flex flex-col items-center rounded-md text-base transition-colors focus-visible:outline-2 focus-visible:outline-focus"
10
9
  ]),
11
- inner: f(
10
+ inner: p(
12
11
  [
13
12
  "flex w-full flex-1 flex-col items-center gap-8 px-8 py-12",
14
13
  "rounded-md focus-visible:outline-2 focus-visible:outline-focus"
@@ -39,77 +38,75 @@ const [N, s] = T("Tile"), m = {
39
38
  ref: t,
40
39
  className: e,
41
40
  onClick: a,
42
- secondaryAction: o,
41
+ secondaryAction: r,
43
42
  appearance: c = "no-background",
44
- disabled: r = !1,
45
- centered: d = !1,
46
- children: u,
47
- style: p,
43
+ disabled: d = !1,
44
+ centered: u = !1,
45
+ children: b,
46
+ style: f,
48
47
  ...n
49
- }) => /* @__PURE__ */ i(N, { value: { disabled: r }, children: /* @__PURE__ */ b(
50
- "div",
51
- {
52
- ref: t,
53
- style: p,
54
- className: m.root({
55
- className: e
56
- }),
57
- children: [
58
- /* @__PURE__ */ i(
59
- "button",
60
- {
61
- ...n,
62
- onClick: a,
63
- disabled: r,
64
- className: m.inner({
65
- appearance: c,
66
- disabled: r,
67
- centered: d
68
- }),
69
- children: u
70
- }
71
- ),
72
- o
73
- ]
74
- }
75
- ) });
76
- g.displayName = "Tile";
77
- const h = ({ size: t = 48, ...e }) => {
78
- const { disabled: a } = s({
79
- consumerName: "TileSpot",
80
- contextRequired: !0
48
+ }) => {
49
+ const l = o({
50
+ consumerName: "Tile",
51
+ mergeWith: { disabled: d }
81
52
  });
82
- return /* @__PURE__ */ i(v, { ...e, size: t, disabled: a });
53
+ return /* @__PURE__ */ i(m, { value: { disabled: l }, children: /* @__PURE__ */ x(
54
+ "div",
55
+ {
56
+ ref: t,
57
+ style: f,
58
+ className: v.root({
59
+ className: e
60
+ }),
61
+ children: [
62
+ /* @__PURE__ */ i(
63
+ "button",
64
+ {
65
+ ...n,
66
+ onClick: a,
67
+ disabled: l,
68
+ className: v.inner({
69
+ appearance: c,
70
+ disabled: l,
71
+ centered: u
72
+ }),
73
+ children: /* @__PURE__ */ i(m, { value: { disabled: l }, children: b })
74
+ }
75
+ ),
76
+ r
77
+ ]
78
+ }
79
+ ) });
83
80
  };
84
- h.displayName = "TileSpot";
85
- const C = ({
81
+ g.displayName = "Tile";
82
+ const N = ({
86
83
  children: t,
87
84
  className: e,
88
85
  ...a
89
86
  }) => /* @__PURE__ */ i(
90
87
  "div",
91
88
  {
92
- className: l("flex w-full flex-col items-center text-center", e),
89
+ className: s("flex w-full flex-col items-center text-center", e),
93
90
  ...a,
94
91
  children: t
95
92
  }
96
93
  );
97
- C.displayName = "TileContent";
98
- const S = ({
94
+ N.displayName = "TileContent";
95
+ const h = ({
99
96
  children: t,
100
97
  className: e,
101
98
  ...a
102
99
  }) => {
103
- const { disabled: o } = s({
100
+ const r = o({
104
101
  consumerName: "TileTitle",
105
102
  contextRequired: !0
106
103
  });
107
104
  return /* @__PURE__ */ i(
108
105
  "div",
109
106
  {
110
- className: l(
107
+ className: s(
111
108
  "w-full truncate body-2-semi-bold",
112
- o && "text-disabled",
109
+ r && "text-disabled",
113
110
  e
114
111
  ),
115
112
  ...a,
@@ -117,22 +114,22 @@ const S = ({
117
114
  }
118
115
  );
119
116
  };
120
- S.displayName = "TileTitle";
121
- const k = ({
117
+ h.displayName = "TileTitle";
118
+ const C = ({
122
119
  children: t,
123
120
  className: e,
124
121
  ...a
125
122
  }) => {
126
- const { disabled: o } = s({
123
+ const r = o({
127
124
  consumerName: "TileDescription",
128
125
  contextRequired: !0
129
126
  });
130
127
  return /* @__PURE__ */ i(
131
128
  "div",
132
129
  {
133
- className: l(
130
+ className: s(
134
131
  "w-full truncate body-3",
135
- o ? "text-disabled" : "text-muted",
132
+ r ? "text-disabled" : "text-muted",
136
133
  e
137
134
  ),
138
135
  ...a,
@@ -140,63 +137,63 @@ const k = ({
140
137
  }
141
138
  );
142
139
  };
143
- k.displayName = "TileDescription";
144
- const w = ({
140
+ C.displayName = "TileDescription";
141
+ const k = ({
145
142
  children: t,
146
143
  className: e,
147
144
  ...a
148
145
  }) => /* @__PURE__ */ i(
149
146
  "div",
150
147
  {
151
- className: l("mt-4 flex w-full flex-col items-center gap-8", e),
148
+ className: s("mt-4 flex w-full flex-col items-center gap-8", e),
152
149
  ...a,
153
150
  children: t
154
151
  }
155
152
  );
156
- w.displayName = "TileTrailingContent";
157
- const q = ({
153
+ k.displayName = "TileTrailingContent";
154
+ const w = ({
158
155
  ref: t,
159
156
  onClick: e,
160
157
  icon: a,
161
- className: o,
158
+ className: r,
162
159
  "aria-label": c,
163
- ...r
160
+ ...d
164
161
  }) => {
165
- const { disabled: d } = s({
162
+ const u = o({
166
163
  consumerName: "TileSecondaryAction",
167
164
  contextRequired: !0
168
- }), u = x(
165
+ }), b = T(
169
166
  (n) => {
170
167
  n.stopPropagation(), n.preventDefault(), e?.(n);
171
168
  },
172
169
  [e]
173
170
  );
174
- if (d) return null;
175
- const p = a;
171
+ if (u)
172
+ return null;
173
+ const f = a;
176
174
  return /* @__PURE__ */ i(
177
175
  y,
178
176
  {
179
- className: l(
177
+ className: s(
180
178
  "absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
181
- o
179
+ r
182
180
  ),
183
181
  "data-secondary-button-container": !0,
184
182
  iconType: "stroked",
185
- onClick: u,
183
+ onClick: b,
186
184
  "aria-label": c,
187
185
  ref: t,
188
- ...r,
189
- children: /* @__PURE__ */ i(p, { size: 24 })
186
+ ...d,
187
+ children: /* @__PURE__ */ i(f, { size: 24 })
190
188
  }
191
189
  );
192
190
  };
193
- q.displayName = "TileSecondaryAction";
191
+ w.displayName = "TileSecondaryAction";
194
192
  export {
195
193
  g as Tile,
196
- C as TileContent,
197
- k as TileDescription,
198
- q as TileSecondaryAction,
199
- h as TileSpot,
200
- S as TileTitle,
201
- w as TileTrailingContent
194
+ N as TileContent,
195
+ C as TileDescription,
196
+ w as TileSecondaryAction,
197
+ h as TileTitle,
198
+ k as TileTrailingContent
202
199
  };