@ledgerhq/lumen-ui-react 0.1.11 → 0.1.13

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 (136) hide show
  1. package/dist/i18n/locales/de.json.d.ts +3 -0
  2. package/dist/i18n/locales/de.json.js +4 -2
  3. package/dist/i18n/locales/en.json.d.ts +3 -0
  4. package/dist/i18n/locales/en.json.js +6 -4
  5. package/dist/i18n/locales/es.json.d.ts +3 -0
  6. package/dist/i18n/locales/es.json.js +6 -4
  7. package/dist/i18n/locales/fr.json.d.ts +3 -0
  8. package/dist/i18n/locales/fr.json.js +6 -4
  9. package/dist/i18n/locales/ja.json.d.ts +3 -0
  10. package/dist/i18n/locales/ja.json.js +6 -4
  11. package/dist/i18n/locales/ko.json.d.ts +3 -0
  12. package/dist/i18n/locales/ko.json.js +6 -4
  13. package/dist/i18n/locales/pt.json.d.ts +3 -0
  14. package/dist/i18n/locales/pt.json.js +6 -4
  15. package/dist/i18n/locales/ru.json.d.ts +3 -0
  16. package/dist/i18n/locales/ru.json.js +6 -4
  17. package/dist/i18n/locales/th.json.d.ts +3 -0
  18. package/dist/i18n/locales/th.json.js +6 -4
  19. package/dist/i18n/locales/tr.json.d.ts +3 -0
  20. package/dist/i18n/locales/tr.json.js +6 -4
  21. package/dist/i18n/locales/zh.json.d.ts +3 -0
  22. package/dist/i18n/locales/zh.json.js +6 -4
  23. package/dist/index.js +114 -113
  24. package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  25. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +41 -41
  26. package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  27. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  28. package/dist/lib/Components/AmountInput/AmountInput.js +35 -32
  29. package/dist/lib/Components/Banner/Banner.js +5 -5
  30. package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
  31. package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
  32. package/dist/lib/Components/BaseInput/BaseInput.js +44 -41
  33. package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
  34. package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
  35. package/dist/lib/Components/Button/BaseButton.js +28 -25
  36. package/dist/lib/Components/Button/Button.js +9 -9
  37. package/dist/lib/Components/Card/Card.d.ts.map +1 -1
  38. package/dist/lib/Components/Card/Card.js +110 -107
  39. package/dist/lib/Components/Card/types.d.ts +1 -0
  40. package/dist/lib/Components/Card/types.d.ts.map +1 -1
  41. package/dist/lib/Components/CardButton/CardButton.d.ts +1 -1
  42. package/dist/lib/Components/CardButton/CardButton.d.ts.map +1 -1
  43. package/dist/lib/Components/CardButton/CardButton.js +28 -24
  44. package/dist/lib/Components/Checkbox/Checkbox.d.ts +1 -1
  45. package/dist/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
  46. package/dist/lib/Components/Checkbox/Checkbox.js +26 -14
  47. package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +2 -2
  48. package/dist/lib/Components/Dialog/types.d.ts +1 -1
  49. package/dist/lib/Components/Icon/Icon.js +4 -4
  50. package/dist/lib/Components/Icon/createIcon.js +4 -4
  51. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -1
  52. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
  53. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +40 -20
  54. package/dist/lib/Components/InteractiveIcon/types.d.ts +14 -1
  55. package/dist/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
  56. package/dist/lib/Components/Link/Link.d.ts +1 -1
  57. package/dist/lib/Components/Link/Link.d.ts.map +1 -1
  58. package/dist/lib/Components/Link/Link.js +44 -33
  59. package/dist/lib/Components/Link/types.d.ts +5 -0
  60. package/dist/lib/Components/Link/types.d.ts.map +1 -1
  61. package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  62. package/dist/lib/Components/ListItem/ListItem.js +72 -65
  63. package/dist/lib/Components/MediaCard/MediaCard.d.ts +33 -0
  64. package/dist/lib/Components/MediaCard/MediaCard.d.ts.map +1 -0
  65. package/dist/lib/Components/MediaCard/MediaCard.js +128 -0
  66. package/dist/lib/Components/MediaCard/index.d.ts +3 -0
  67. package/dist/lib/Components/MediaCard/index.d.ts.map +1 -0
  68. package/dist/lib/Components/MediaCard/types.d.ts +30 -0
  69. package/dist/lib/Components/MediaCard/types.d.ts.map +1 -0
  70. package/dist/lib/Components/Menu/Menu.d.ts +3 -3
  71. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  72. package/dist/lib/Components/Menu/Menu.js +133 -104
  73. package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
  74. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  75. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  76. package/dist/lib/Components/SegmentedControl/SegmentedControl.js +88 -51
  77. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -1
  78. package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  79. package/dist/lib/Components/Select/Select.d.ts +5 -5
  80. package/dist/lib/Components/Select/Select.d.ts.map +1 -1
  81. package/dist/lib/Components/Select/Select.js +94 -76
  82. package/dist/lib/Components/Select/index.d.ts +1 -1
  83. package/dist/lib/Components/Select/types.d.ts +4 -4
  84. package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
  85. package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
  86. package/dist/lib/Components/SideBar/SideBar.js +77 -74
  87. package/dist/lib/Components/SideBar/types.d.ts +12 -4
  88. package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
  89. package/dist/lib/Components/Spot/Spot.js +3 -3
  90. package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
  91. package/dist/lib/Components/Stepper/Stepper.js +34 -24
  92. package/dist/lib/Components/Subheader/Subheader.d.ts +2 -7
  93. package/dist/lib/Components/Subheader/Subheader.d.ts.map +1 -1
  94. package/dist/lib/Components/Subheader/Subheader.js +31 -49
  95. package/dist/lib/Components/Subheader/index.d.ts +1 -1
  96. package/dist/lib/Components/Subheader/index.d.ts.map +1 -1
  97. package/dist/lib/Components/Subheader/types.d.ts +1 -11
  98. package/dist/lib/Components/Subheader/types.d.ts.map +1 -1
  99. package/dist/lib/Components/Switch/Switch.d.ts +1 -1
  100. package/dist/lib/Components/Switch/Switch.d.ts.map +1 -1
  101. package/dist/lib/Components/Switch/Switch.js +30 -22
  102. package/dist/lib/Components/Table/Table.js +49 -49
  103. package/dist/lib/Components/Tag/Tag.d.ts +1 -1
  104. package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
  105. package/dist/lib/Components/Tag/Tag.js +17 -14
  106. package/dist/lib/Components/Tile/Tile.d.ts +5 -12
  107. package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
  108. package/dist/lib/Components/Tile/Tile.js +79 -82
  109. package/dist/lib/Components/Tile/index.d.ts +1 -1
  110. package/dist/lib/Components/Tile/index.d.ts.map +1 -1
  111. package/dist/lib/Components/Tile/types.d.ts +1 -10
  112. package/dist/lib/Components/Tile/types.d.ts.map +1 -1
  113. package/dist/lib/Components/TileButton/TileButton.d.ts +1 -1
  114. package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -1
  115. package/dist/lib/Components/TileButton/TileButton.js +26 -23
  116. package/dist/lib/Components/{ButtonTrigger/ButtonTrigger.d.ts → TriggerButton/TriggerButton.d.ts} +10 -10
  117. package/dist/lib/Components/TriggerButton/TriggerButton.d.ts.map +1 -0
  118. package/dist/lib/Components/TriggerButton/TriggerButton.js +76 -0
  119. package/dist/lib/Components/TriggerButton/index.d.ts +3 -0
  120. package/dist/lib/Components/{ButtonTrigger → TriggerButton}/index.d.ts.map +1 -1
  121. package/dist/lib/Components/{ButtonTrigger → TriggerButton}/types.d.ts +1 -1
  122. package/dist/lib/Components/{ButtonTrigger → TriggerButton}/types.d.ts.map +1 -1
  123. package/dist/lib/Components/index.d.ts +2 -1
  124. package/dist/lib/Components/index.d.ts.map +1 -1
  125. package/dist/lib/Symbols/Icons/NanoGen5.d.ts +29 -0
  126. package/dist/lib/Symbols/Icons/NanoGen5.d.ts.map +1 -0
  127. package/dist/lib/Symbols/Icons/NanoGen5.js +27 -0
  128. package/dist/lib/Symbols/index.d.ts +1 -0
  129. package/dist/lib/Symbols/index.d.ts.map +1 -1
  130. package/dist/lib/Symbols/index.js +194 -192
  131. package/dist/libs/utils-shared/dist/index.js +95 -90
  132. package/dist/package.json +2 -2
  133. package/package.json +2 -2
  134. package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts.map +0 -1
  135. package/dist/lib/Components/ButtonTrigger/ButtonTrigger.js +0 -73
  136. package/dist/lib/Components/ButtonTrigger/index.d.ts +0 -3
@@ -1,33 +1,33 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
2
  import { useSplitText as y, buildAriaLabel as x, cn as p } from "../../../libs/utils-shared/dist/index.js";
3
3
  import { memo as d } from "react";
4
4
  import { DIGITS as b } from "./types.js";
5
5
  import { useCommonTranslation as D } from "../../../i18n/useCommonTranslation.js";
6
6
  const N = {
7
- 0: 24.5,
8
- 1: 15,
9
- 2: 23,
10
- 3: 24,
11
- 4: 25,
12
- 5: 23,
13
- 6: 24.5,
14
- 7: 21.5,
15
- 8: 24,
16
- 9: 24
7
+ 0: 25,
8
+ 1: 15.5,
9
+ 2: 23.5,
10
+ 3: 24.5,
11
+ 4: 25.5,
12
+ 5: 23.5,
13
+ 6: 25,
14
+ 7: 22,
15
+ 8: 24.5,
16
+ 9: 24.5
17
17
  }, I = {
18
- 0: 17,
19
- 1: 10.5,
20
- 2: 16,
21
- 3: 16.5,
22
- 4: 17.2,
23
- 5: 15.7,
24
- 6: 17,
25
- 7: 14.7,
26
- 8: 16.5,
27
- 9: 16.5
18
+ 0: 17.5,
19
+ 1: 11,
20
+ 2: 16.5,
21
+ 3: 17,
22
+ 4: 18,
23
+ 5: 16,
24
+ 6: 17.5,
25
+ 7: 15,
26
+ 8: 17,
27
+ 9: 17
28
28
  }, T = d(({ value: a, animate: l, type: i }) => {
29
29
  const s = (i === "integer" ? N : I)[a];
30
- return /* @__PURE__ */ o(
30
+ return /* @__PURE__ */ c(
31
31
  "div",
32
32
  {
33
33
  className: "relative overflow-hidden mask-fade-y transition-[width] duration-600",
@@ -44,50 +44,50 @@ const N = {
44
44
  style: {
45
45
  transform: `translateY(-${a * 10}%)`
46
46
  },
47
- children: b.map((r, n) => /* @__PURE__ */ e("span", { inert: r !== a, children: r }, n))
47
+ children: b.map((n, r) => /* @__PURE__ */ e("span", { inert: n !== a, children: n }, r))
48
48
  }
49
49
  )
50
50
  ]
51
51
  }
52
52
  );
53
- }), m = d(({ items: a, type: l, animate: i }) => a.map((s, r) => {
54
- const n = a.length - r;
55
- return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value }, n) : /* @__PURE__ */ e(
53
+ }), m = d(({ items: a, type: l, animate: i }) => a.map((s, n) => {
54
+ const r = a.length - n;
55
+ return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value }, r) : /* @__PURE__ */ e(
56
56
  T,
57
57
  {
58
58
  value: Number(s.value),
59
59
  animate: i,
60
60
  type: l
61
61
  },
62
- n
62
+ r
63
63
  );
64
64
  })), g = ({
65
65
  value: a,
66
66
  formatter: l,
67
67
  hidden: i = !1,
68
68
  loading: s = !1,
69
- animate: r = !0,
70
- className: n,
69
+ animate: n = !0,
70
+ className: r,
71
71
  ...u
72
72
  }) => {
73
- const t = l(a), c = y(t), { t: f } = D(), h = x(
73
+ const t = l(a), o = y(t), { t: f } = D(), h = x(
74
74
  t,
75
75
  i,
76
76
  f("components.amountDisplay.amountHiddenAriaLabel")
77
77
  );
78
- return /* @__PURE__ */ o(
78
+ return /* @__PURE__ */ e(
79
79
  "div",
80
80
  {
81
81
  className: p(
82
82
  s && "animate-pulse",
83
- "relative inline-flex items-baseline",
84
- n
83
+ "relative inline-flex",
84
+ r
85
85
  ),
86
86
  "aria-label": h,
87
87
  "aria-busy": s,
88
88
  ...u,
89
- children: [
90
- /* @__PURE__ */ o(
89
+ children: /* @__PURE__ */ c("div", { className: "flex items-baseline", children: [
90
+ /* @__PURE__ */ c(
91
91
  "span",
92
92
  {
93
93
  className: "inline-flex heading-1-semi-bold text-base",
@@ -97,15 +97,15 @@ const N = {
97
97
  i ? /* @__PURE__ */ e("span", { children: "••••" }) : /* @__PURE__ */ e(
98
98
  m,
99
99
  {
100
- items: c.integerPart,
101
- animate: r,
100
+ items: o.integerPart,
101
+ animate: n,
102
102
  type: "integer"
103
103
  }
104
104
  )
105
105
  ]
106
106
  }
107
107
  ),
108
- /* @__PURE__ */ o(
108
+ /* @__PURE__ */ c(
109
109
  "span",
110
110
  {
111
111
  className: "inline-flex heading-2-semi-bold text-muted",
@@ -115,8 +115,8 @@ const N = {
115
115
  t.decimalPart && !i && /* @__PURE__ */ e(
116
116
  m,
117
117
  {
118
- items: c.decimalPart,
119
- animate: r,
118
+ items: o.decimalPart,
119
+ animate: n,
120
120
  type: "decimal"
121
121
  }
122
122
  ),
@@ -124,7 +124,7 @@ const N = {
124
124
  ]
125
125
  }
126
126
  )
127
- ]
127
+ ] })
128
128
  }
129
129
  );
130
130
  };
@@ -5,7 +5,7 @@ import { AmountInputProps } from './types';
5
5
  * The currency text can be positioned either on the left or right side of the input.
6
6
  */
7
7
  export declare const AmountInput: {
8
- ({ ref, className, currencyText, currencyPosition, disabled, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
8
+ ({ ref, className, currencyText, currencyPosition, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
9
9
  displayName: string;
10
10
  };
11
11
  //# sourceMappingURL=AmountInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgC3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;qKAarB,gBAAgB;;CA8GlB,CAAC"}
1
+ {"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgC3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;mLAarB,gBAAgB;;CAkHlB,CAAC"}
@@ -1,8 +1,8 @@
1
- import { jsxs as V, jsx as l } from "react/jsx-runtime";
2
- import { getFontSize as j, cn as a, textFormatter as F } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as z } from "class-variance-authority";
4
- import { useRef as p, useState as h, useMemo as M, useLayoutEffect as q, useEffect as D } from "react";
5
- const H = z(
1
+ import { jsxs as j, jsx as l } from "react/jsx-runtime";
2
+ import { useDisabledContext as F, getFontSize as z, cn as a, textFormatter as D } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as M } from "class-variance-authority";
4
+ import { useRef as d, useState as h, useMemo as W, useLayoutEffect as q, useEffect as L } from "react";
5
+ const Q = M(
6
6
  [
7
7
  "bg-transparent heading-0 caret-active outline-hidden transition-colors",
8
8
  "text-base placeholder:text-muted-subtle",
@@ -28,11 +28,11 @@ const H = z(
28
28
  "group-has-[input:placeholder-shown]:text-muted-subtle",
29
29
  "group-has-[input:disabled]:cursor-not-allowed group-has-[input:disabled]:text-disabled",
30
30
  'group-has-[input[aria-invalid="true"]]:text-error'
31
- ), J = ({
31
+ ), Y = ({
32
32
  ref: x,
33
33
  className: S,
34
- currencyText: r,
35
- currencyPosition: d = "left",
34
+ currencyText: s,
35
+ currencyPosition: p = "left",
36
36
  disabled: v,
37
37
  maxIntegerLength: w = 9,
38
38
  maxDecimalLength: y = 9,
@@ -40,9 +40,12 @@ const H = z(
40
40
  thousandsSeparator: N = !0,
41
41
  value: u,
42
42
  onChange: A,
43
- ...R
43
+ ...I
44
44
  }) => {
45
- const c = p(null), s = p(null), [n, f] = h(u.toString()), [k, m] = h(!1), g = p(n);
45
+ const R = F({
46
+ consumerName: "AmountInput",
47
+ mergeWith: { disabled: v }
48
+ }), c = d(null), r = d(null), [n, m] = h(u.toString()), [k, f] = h(!1), g = d(n);
46
49
  function E(...t) {
47
50
  return (e) => {
48
51
  t.forEach((o) => {
@@ -50,41 +53,41 @@ const H = z(
50
53
  });
51
54
  };
52
55
  }
53
- const i = M(() => j(n) + "px", [n]);
56
+ const i = W(() => z(n) + "px", [n]);
54
57
  q(() => {
55
- if (c.current && s.current) {
58
+ if (c.current && r.current) {
56
59
  const t = c.current.offsetWidth, e = n === "" ? 33 : 8;
57
- s.current.style.width = `${t + e}px`;
60
+ r.current.style.width = `${t + e}px`;
58
61
  }
59
- }, [n]), D(() => {
60
- f(u.toString());
62
+ }, [n]), L(() => {
63
+ m(u.toString());
61
64
  }, [u]);
62
- const I = (t) => {
63
- const e = F(t.target.value, {
65
+ const V = (t) => {
66
+ const e = D(t.target.value, {
64
67
  allowDecimals: C,
65
68
  thousandsSeparator: N,
66
69
  maxIntegerLength: w,
67
70
  maxDecimalLength: y
68
71
  });
69
- f(e), A({ ...t, target: { ...t.target, value: e } }), e !== g.current && m(!0), g.current = e;
72
+ m(e), A({ ...t, target: { ...t.target, value: e } }), e !== g.current && f(!0), g.current = e;
70
73
  };
71
- return /* @__PURE__ */ V(
74
+ return /* @__PURE__ */ j(
72
75
  "div",
73
76
  {
74
77
  className: "group relative flex items-center justify-center transition-transform",
75
78
  onPointerDown: () => {
76
- const t = s.current;
79
+ const t = r.current;
77
80
  t && window.requestAnimationFrame(() => {
78
81
  t.focus();
79
82
  });
80
83
  },
81
84
  children: [
82
- r && d === "left" && /* @__PURE__ */ l(
85
+ s && p === "left" && /* @__PURE__ */ l(
83
86
  "span",
84
87
  {
85
88
  className: a(b, "shrink-0"),
86
89
  style: { fontSize: i, letterSpacing: "normal" },
87
- children: r
90
+ children: s
88
91
  }
89
92
  ),
90
93
  /* @__PURE__ */ l(
@@ -100,31 +103,31 @@ const H = z(
100
103
  /* @__PURE__ */ l(
101
104
  "input",
102
105
  {
103
- ref: E(x, s),
106
+ ref: E(x, r),
104
107
  type: "text",
105
108
  inputMode: "decimal",
106
- disabled: v,
109
+ disabled: R,
107
110
  value: n,
108
- onChange: I,
109
- onAnimationEnd: () => m(!1),
110
- className: a(H({ isChanging: k }), S),
111
- ...R,
111
+ onChange: V,
112
+ onAnimationEnd: () => f(!1),
113
+ className: a(Q({ isChanging: k }), S),
114
+ ...I,
112
115
  style: { fontSize: i, letterSpacing: "normal" }
113
116
  }
114
117
  ),
115
- r && d === "right" && /* @__PURE__ */ l(
118
+ s && p === "right" && /* @__PURE__ */ l(
116
119
  "span",
117
120
  {
118
121
  className: a(b, "shrink-0"),
119
122
  style: { fontSize: i, letterSpacing: "normal" },
120
- children: r
123
+ children: s
121
124
  }
122
125
  )
123
126
  ]
124
127
  }
125
128
  );
126
129
  };
127
- J.displayName = "AmountInput";
130
+ Y.displayName = "AmountInput";
128
131
  export {
129
- J as AmountInput
132
+ Y as AmountInput
130
133
  };
@@ -29,8 +29,8 @@ const k = {
29
29
  appearance: s = "info",
30
30
  title: a,
31
31
  description: o,
32
- primaryAction: l,
33
- secondaryAction: n,
32
+ primaryAction: n,
33
+ secondaryAction: l,
34
34
  className: t,
35
35
  onClose: i,
36
36
  closeAriaLabel: f,
@@ -50,9 +50,9 @@ const k = {
50
50
  a && /* @__PURE__ */ r("h3", { className: "line-clamp-2 body-1-semi-bold", children: a }),
51
51
  o && /* @__PURE__ */ r("div", { className: c("line-clamp-5 body-2", !a && "mt-2"), children: o })
52
52
  ] }),
53
- (l || n) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
54
- l,
55
- n
53
+ (n || l) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
54
+ n,
55
+ l
56
56
  ] })
57
57
  ] }),
58
58
  i && /* @__PURE__ */ r(
@@ -19,7 +19,7 @@ import { BaseInputProps } from './types';
19
19
  * @internal
20
20
  */
21
21
  export declare const BaseInput: {
22
- ({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
22
+ ({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled: disabledProp, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
23
23
  displayName: string;
24
24
  };
25
25
  //# sourceMappingURL=BaseInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;6NAiBnB,cAAc;;CAqKhB,CAAC"}
1
+ {"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;2OAiBnB,cAAc;;CAyKhB,CAAC"}
@@ -1,63 +1,66 @@
1
1
  import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { cn as a } from "../../../libs/utils-shared/dist/index.js";
3
- import c from "react";
4
- import { useCommonTranslation as O } from "../../../i18n/useCommonTranslation.js";
5
- import { InteractiveIcon as $ } from "../InteractiveIcon/InteractiveIcon.js";
2
+ import { useDisabledContext as $, cn as a } from "../../../libs/utils-shared/dist/index.js";
3
+ import d from "react";
4
+ import { useCommonTranslation as q } from "../../../i18n/useCommonTranslation.js";
5
+ import { InteractiveIcon as H } from "../InteractiveIcon/InteractiveIcon.js";
6
6
  import { DeleteCircleFill as x } from "../../Symbols/Icons/DeleteCircleFill.js";
7
- const q = a(
7
+ const P = 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
- ), H = a(
13
+ ), U = 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
- ), P = a(
20
+ ), W = 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 = ({
26
+ ), G = ({
27
27
  ref: y,
28
28
  className: I,
29
29
  containerClassName: C,
30
30
  inputClassName: S,
31
31
  labelClassName: N,
32
- label: d,
32
+ label: u,
33
33
  id: k,
34
- disabled: h,
34
+ disabled: R,
35
35
  errorMessage: o,
36
- suffix: R,
37
- prefix: E,
38
- onClear: j,
39
- hideClearButton: z = !1,
36
+ suffix: B,
37
+ prefix: D,
38
+ onClear: E,
39
+ hideClearButton: j = !1,
40
40
  "aria-invalid": b,
41
- onChange: m,
41
+ onChange: h,
42
42
  ...i
43
43
  }) => {
44
- const { t: B } = O(), n = c.useRef(null), D = c.useId(), u = k || `input-${D}`, F = b || (o ? !0 : void 0), s = i.value !== void 0, [L, v] = c.useState(
44
+ const m = $({
45
+ consumerName: "BaseInput",
46
+ mergeWith: { disabled: R }
47
+ }), { t: z } = q(), n = d.useRef(null), F = d.useId(), c = k || `input-${F}`, L = b || (o ? !0 : void 0), s = i.value !== void 0, [T, v] = d.useState(
45
48
  i.defaultValue?.toString() || ""
46
- ), T = c.useCallback(
49
+ ), V = d.useCallback(
47
50
  (t) => {
48
- s || v(t.target.value), m?.(t);
51
+ s || v(t.target.value), h?.(t);
49
52
  },
50
- [s, m]
51
- ), f = (s ? !!i.value && i.value.toString().length > 0 : L.length > 0) && !h && !z, g = `${u}-error`, V = () => {
53
+ [s, h]
54
+ ), f = (s ? !!i.value && i.value.toString().length > 0 : T.length > 0) && !m && !j, g = `${c}-error`, A = () => {
52
55
  if (!n.current) return;
53
56
  Object.getOwnPropertyDescriptor(
54
57
  window.HTMLInputElement.prototype,
55
58
  "value"
56
59
  )?.set?.call(n.current, ""), s || v("");
57
60
  const l = new Event("input", { bubbles: !0 });
58
- n.current.dispatchEvent(l), n.current.focus(), j?.();
61
+ n.current.dispatchEvent(l), n.current.focus(), E?.();
59
62
  };
60
- function A(...t) {
63
+ function O(...t) {
61
64
  return (l) => {
62
65
  t.forEach((e) => {
63
66
  e && (typeof e == "function" ? e(l) : e.current = l);
@@ -68,7 +71,7 @@ const q = a(
68
71
  /* @__PURE__ */ p(
69
72
  "div",
70
73
  {
71
- className: a(q, C),
74
+ className: a(P, C),
72
75
  onPointerDown: (t) => {
73
76
  if (t.target.closest("input, button, a")) return;
74
77
  const e = n.current;
@@ -83,47 +86,47 @@ const q = a(
83
86
  });
84
87
  },
85
88
  children: [
86
- E,
89
+ D,
87
90
  /* @__PURE__ */ r(
88
91
  "input",
89
92
  {
90
- ref: A(y, n),
91
- id: u,
92
- disabled: h,
93
+ ref: O(y, n),
94
+ id: c,
95
+ disabled: m,
93
96
  placeholder: " ",
94
- "aria-invalid": F,
97
+ "aria-invalid": L,
95
98
  "aria-describedby": o ? g : void 0,
96
99
  className: a(
97
- H,
98
- d && "pt-12 body-2",
100
+ U,
101
+ u && "pt-12 body-2",
99
102
  S
100
103
  ),
101
- onChange: T,
104
+ onChange: V,
102
105
  ...i
103
106
  }
104
107
  ),
105
- d && /* @__PURE__ */ r(
108
+ u && /* @__PURE__ */ r(
106
109
  "label",
107
110
  {
108
- htmlFor: u,
111
+ htmlFor: c,
109
112
  className: a(
110
- P,
113
+ W,
111
114
  o && "text-error",
112
115
  N
113
116
  ),
114
- children: d
117
+ children: u
115
118
  }
116
119
  ),
117
120
  f && /* @__PURE__ */ r(
118
- $,
121
+ H,
119
122
  {
120
123
  iconType: "filled",
121
- onClick: V,
122
- "aria-label": B("components.baseInput.clearInputAriaLabel"),
124
+ onClick: A,
125
+ "aria-label": z("components.baseInput.clearInputAriaLabel"),
123
126
  children: /* @__PURE__ */ r(x, { size: 20 })
124
127
  }
125
128
  ),
126
- !f && R
129
+ !f && B
127
130
  ]
128
131
  }
129
132
  ),
@@ -141,7 +144,7 @@ const q = a(
141
144
  )
142
145
  ] });
143
146
  };
144
- U.displayName = "BaseInput";
147
+ G.displayName = "BaseInput";
145
148
  export {
146
- U as BaseInput
149
+ G as BaseInput
147
150
  };
@@ -7,7 +7,7 @@ export declare const baseButtonVariants: (props?: ({
7
7
  isFull?: boolean | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  export declare const BaseButton: {
10
- ({ ref, className, appearance, size, isFull, disabled, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ ({ ref, className, appearance, size, isFull, disabled: disabledProp, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //# sourceMappingURL=BaseButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;wHAapB,eAAe;;CA4CjB,CAAC"}
1
+ {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;sIAapB,eAAe;;CAgDjB,CAAC"}
@@ -1,8 +1,8 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { cn as x } from "../../../libs/utils-shared/dist/index.js";
3
- import { Slot as f, Slottable as h } from "@radix-ui/react-slot";
1
+ import { jsxs as x, jsx as t } from "react/jsx-runtime";
2
+ import { useDisabledContext as f, cn as h } from "../../../libs/utils-shared/dist/index.js";
3
+ import { Slot as B, Slottable as z } from "@radix-ui/react-slot";
4
4
  import { cva as l } from "class-variance-authority";
5
- import { Spinner as z } from "../Spinner/Spinner.js";
5
+ import { Spinner as N } from "../Spinner/Spinner.js";
6
6
  const S = l(
7
7
  "inline-flex size-fit cursor-pointer items-center justify-center rounded-full transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
8
8
  {
@@ -65,60 +65,63 @@ const S = l(
65
65
  true: "text-disabled"
66
66
  }
67
67
  }
68
- }), B = ({
69
- ref: d,
68
+ }), y = ({
69
+ ref: c,
70
70
  className: u,
71
71
  appearance: a = "base",
72
72
  size: s,
73
73
  isFull: v,
74
- disabled: e = !1,
75
- asChild: n = !1,
76
- icon: i,
74
+ disabled: p = !1,
75
+ asChild: o = !1,
76
+ icon: n,
77
77
  loading: r = !1,
78
- children: o,
79
- onClick: p,
78
+ children: i,
79
+ onClick: m,
80
80
  ...g
81
81
  }) => {
82
- const c = s ? {
82
+ const e = f({
83
+ consumerName: "BaseButton",
84
+ mergeWith: { disabled: p }
85
+ }), d = s ? {
83
86
  xs: 16,
84
87
  sm: 20,
85
88
  md: 24,
86
89
  lg: 24
87
90
  }[s] : 24;
88
- return /* @__PURE__ */ m(
89
- n ? f : "button",
91
+ return /* @__PURE__ */ x(
92
+ o ? B : "button",
90
93
  {
91
- className: x(
94
+ className: h(
92
95
  S({ disabled: e, loading: r, appearance: a, size: s, isFull: v }),
93
96
  u
94
97
  ),
95
- ref: d,
98
+ ref: c,
96
99
  "data-disabled": e || void 0,
97
100
  disabled: e,
98
- onClick: p,
101
+ onClick: m,
99
102
  ...g,
100
103
  children: [
101
104
  r && /* @__PURE__ */ t(
102
- z,
105
+ N,
103
106
  {
104
- size: c,
107
+ size: d,
105
108
  className: b({ appearance: a, disabled: e })
106
109
  }
107
110
  ),
108
- !r && i && /* @__PURE__ */ t(
109
- i,
111
+ !r && n && /* @__PURE__ */ t(
112
+ n,
110
113
  {
111
- size: c,
114
+ size: d,
112
115
  className: b({ appearance: a, disabled: e })
113
116
  }
114
117
  ),
115
- o && (n ? /* @__PURE__ */ t(h, { children: o }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: o }))
118
+ i && (o ? /* @__PURE__ */ t(z, { children: i }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: i }))
116
119
  ]
117
120
  }
118
121
  );
119
122
  };
120
- B.displayName = "BaseButton";
123
+ y.displayName = "BaseButton";
121
124
  export {
122
- B as BaseButton,
125
+ y as BaseButton,
123
126
  S as baseButtonVariants
124
127
  };