@ledgerhq/lumen-ui-react 0.0.66 → 0.0.68

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 (31) hide show
  1. package/dist/index.js +10 -8
  2. package/dist/lib/Components/AmountInput/AmountInput.js +10 -10
  3. package/dist/lib/Components/BaseInput/BaseInput.js +4 -4
  4. package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
  5. package/dist/lib/Components/Button/BaseButton.js +37 -42
  6. package/dist/lib/Components/Dialog/Dialog.js +2 -2
  7. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
  8. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +15 -10
  9. package/dist/lib/Components/Link/Link.js +5 -5
  10. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  11. package/dist/lib/Components/Menu/Menu.js +81 -77
  12. package/dist/lib/Components/Select/Select.js +7 -7
  13. package/dist/lib/Components/Spot/Spot.js +4 -4
  14. package/dist/lib/Components/ThemeProvider/ThemeProvider.js +2 -2
  15. package/dist/lib/Components/Tile/Tile.d.ts +5 -4
  16. package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
  17. package/dist/lib/Components/Tile/Tile.js +105 -165
  18. package/dist/lib/Components/Tile/types.d.ts +12 -1
  19. package/dist/lib/Components/Tile/types.d.ts.map +1 -1
  20. package/dist/lib/Components/TileButton/TileButton.d.ts +37 -0
  21. package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -0
  22. package/dist/lib/Components/TileButton/TileButton.js +81 -0
  23. package/dist/lib/Components/TileButton/index.d.ts +3 -0
  24. package/dist/lib/Components/TileButton/index.d.ts.map +1 -0
  25. package/dist/lib/Components/TileButton/types.d.ts +45 -0
  26. package/dist/lib/Components/TileButton/types.d.ts.map +1 -0
  27. package/dist/lib/Components/index.d.ts +1 -0
  28. package/dist/lib/Components/index.d.ts.map +1 -1
  29. package/dist/libs/utils-shared/dist/index.js +44 -52
  30. package/dist/package.json +2 -2
  31. package/package.json +2 -2
@@ -0,0 +1,45 @@
1
+ import { ButtonHTMLAttributes, MouseEventHandler, ReactNode } from 'react';
2
+ import { IconSize } from '../Icon/types';
3
+ export type TileButtonProps = {
4
+ /**
5
+ * The icon component to render above the label.
6
+ * Will be rendered at 20px size.
7
+ */
8
+ icon: React.ComponentType<{
9
+ size?: IconSize;
10
+ className?: string;
11
+ }>;
12
+ /**
13
+ * The content of the button (label text).
14
+ */
15
+ children: ReactNode;
16
+ /**
17
+ * Click handler for the button.
18
+ */
19
+ onClick?: MouseEventHandler<HTMLButtonElement>;
20
+ /**
21
+ * Whether the button is disabled.
22
+ * @default false
23
+ */
24
+ disabled?: boolean;
25
+ /**
26
+ * If true, the button expands to full width of its container.
27
+ * @default false
28
+ */
29
+ isFull?: boolean;
30
+ /**
31
+ * Additional CSS classes for layout adjustments.
32
+ */
33
+ className?: string;
34
+ /**
35
+ * Accessible label for the button.
36
+ */
37
+ 'aria-label'?: string;
38
+ /**
39
+ * Optional prop to render the button as a child element.
40
+ * When true, TileButton merges its props with its child element.
41
+ * @default false
42
+ */
43
+ asChild?: boolean;
44
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children'>;
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/TileButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC"}
@@ -21,6 +21,7 @@ export * from './Switch';
21
21
  export * from './Tag';
22
22
  export * from './TextInput';
23
23
  export * from './Tile';
24
+ export * from './TileButton';
24
25
  export * from './Tooltip';
25
26
  export * from './ThemeProvider';
26
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,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.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
  },
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.68",
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
  },