@ledgerhq/lumen-ui-react 0.1.62 → 0.1.63

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 (138) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/lib/Components/core/AddressInput/AddressInput.js +1 -1
  5. package/dist/lib/Components/core/AmountDisplay/AmountDisplay.js +1 -1
  6. package/dist/lib/Components/core/AmountInput/AmountInput.js +22 -22
  7. package/dist/lib/Components/core/Avatar/Avatar.js +7 -7
  8. package/dist/lib/Components/core/AvatarButton/AvatarButton.js +8 -8
  9. package/dist/lib/Components/core/Banner/Banner.js +1 -1
  10. package/dist/lib/Components/core/Button/Button.js +6 -6
  11. package/dist/lib/Components/core/Card/Card.js +17 -17
  12. package/dist/lib/Components/core/ContentBanner/ContentBanner.js +1 -1
  13. package/dist/lib/Components/core/DataTable/DataTable.js +45 -45
  14. package/dist/lib/Components/core/Dialog/DialogHeader/DialogHeader.js +1 -1
  15. package/dist/lib/Components/core/Divider/Divider.js +4 -4
  16. package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
  17. package/dist/lib/Components/core/DotIcon/DotIcon.js +4 -4
  18. package/dist/lib/Components/core/DotSymbol/DotSymbol.js +18 -18
  19. package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
  20. package/dist/lib/Components/core/Link/Link.js +25 -24
  21. package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
  22. package/dist/lib/Components/core/MediaBanner/MediaBanner.js +16 -16
  23. package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
  24. package/dist/lib/Components/core/MediaCard/MediaCard.js +1 -1
  25. package/dist/lib/Components/core/MediaImage/MediaImage.js +5 -5
  26. package/dist/lib/Components/core/Menu/Menu.js +25 -25
  27. package/dist/lib/Components/core/NavBar/CoinCapsule.js +4 -4
  28. package/dist/lib/Components/core/NavBar/NavBar.js +3 -3
  29. package/dist/lib/Components/core/PageIndicator/PageIndicator.js +5 -5
  30. package/dist/lib/Components/core/Pagination/Pagination.js +15 -15
  31. package/dist/lib/Components/core/Popover/Popover.js +13 -13
  32. package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
  33. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  34. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +78 -82
  35. package/dist/lib/Components/core/Select/Select.d.ts.map +1 -1
  36. package/dist/lib/Components/core/Select/Select.js +105 -104
  37. package/dist/lib/Components/core/SideBar/SideBar.js +28 -28
  38. package/dist/lib/Components/core/Spinner/Spinner.js +5 -5
  39. package/dist/lib/Components/core/Spot/Spot.js +10 -10
  40. package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
  41. package/dist/lib/Components/core/Stepper/Stepper.js +51 -48
  42. package/dist/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
  43. package/dist/lib/Components/core/Subheader/Subheader.js +33 -29
  44. package/dist/lib/Components/core/Switch/Switch.js +5 -5
  45. package/dist/lib/Components/core/Table/Table.js +6 -6
  46. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.js +6 -6
  47. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts +1 -1
  48. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts.map +1 -1
  49. package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
  50. package/dist/lib/Components/core/Timeline/Timeline.js +16 -16
  51. package/dist/lib/Components/core/Toast/Toast.js +4 -4
  52. package/dist/lib/Components/core/Toast/Toaster.js +9 -9
  53. package/dist/lib/Components/core/Trend/Trend.js +3 -3
  54. package/dist/lib/Components/internal/BaseButton/BaseButton.js +9 -9
  55. package/dist/lib/Components/internal/BaseInput/BaseInput.js +21 -21
  56. package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.js +4 -4
  57. package/dist/lib/Components/internal/BaseTag/BaseTag.js +4 -4
  58. package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
  59. package/dist/lib/Components/symbols/Icon/createIcon.js +5 -5
  60. package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
  61. package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +36 -35
  62. package/dist/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
  63. package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
  64. package/dist/lib/Components/visualization/DonutChart/DonutChart.js +31 -31
  65. package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +4 -4
  66. package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
  67. package/dist/lib/Components/visualization/DonutChart/DonutRing.js +13 -12
  68. package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
  69. package/dist/lib/Components/visualization/DonutChart/types.d.ts +1 -1
  70. package/dist/lib/Components/visualization/Legend/Legend.d.ts +1 -1
  71. package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
  72. package/dist/lib/Components/visualization/Legend/Legend.js +7 -11
  73. package/dist/lib/Components/visualization/Legend/types.d.ts +2 -2
  74. package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
  75. package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
  76. package/dist/lib/Components/visualization/LineChart/LineChart.js +90 -84
  77. package/dist/lib/Components/visualization/LineChart/types.d.ts +1 -1
  78. package/dist/lib/Components/visualization/LineChart/utils.d.ts +2 -1
  79. package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
  80. package/dist/lib/Components/visualization/LineChart/utils.js +23 -22
  81. package/dist/lib/Components/visualization/config.d.ts +0 -3
  82. package/dist/lib/Components/visualization/config.d.ts.map +1 -1
  83. package/dist/lib/Components/visualization/config.js +3 -6
  84. package/dist/libs/utils-shared/dist/index.js +191 -143
  85. package/dist/package.json +4 -6
  86. package/dist/translations/index.d.ts +3 -0
  87. package/dist/translations/index.d.ts.map +1 -0
  88. package/dist/{i18n → translations}/languages.d.ts +0 -5
  89. package/dist/translations/languages.d.ts.map +1 -0
  90. package/dist/{i18n → translations}/languages.js +1 -2
  91. package/dist/{i18n → translations}/locales/en.json.d.ts +11 -0
  92. package/dist/{i18n → translations}/locales/en.json.js +2 -2
  93. package/dist/translations/translations.d.ts +727 -0
  94. package/dist/translations/translations.d.ts.map +1 -0
  95. package/dist/translations/translations.js +22 -0
  96. package/package.json +3 -5
  97. package/dist/_virtual/dynamic-import-helper.js +0 -9
  98. package/dist/i18n/I18nProvider.d.ts +0 -8
  99. package/dist/i18n/I18nProvider.d.ts.map +0 -1
  100. package/dist/i18n/I18nProvider.js +0 -14
  101. package/dist/i18n/i18n.d.ts +0 -12
  102. package/dist/i18n/i18n.d.ts.map +0 -1
  103. package/dist/i18n/i18n.js +0 -42
  104. package/dist/i18n/index.d.ts +0 -4
  105. package/dist/i18n/index.d.ts.map +0 -1
  106. package/dist/i18n/languages.d.ts.map +0 -1
  107. package/dist/i18n/useCommonTranslation.d.ts +0 -2
  108. package/dist/i18n/useCommonTranslation.d.ts.map +0 -1
  109. package/dist/i18n/useCommonTranslation.js +0 -6
  110. package/dist/node_modules/i18next/dist/esm/i18next.js +0 -1479
  111. package/dist/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -19
  112. package/dist/node_modules/react-i18next/dist/es/context.js +0 -17
  113. package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
  114. package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -8
  115. package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -11
  116. package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -25
  117. package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -65
  118. package/dist/node_modules/react-i18next/dist/es/utils.js +0 -57
  119. /package/dist/{i18n → translations}/locales/de.json.d.ts +0 -0
  120. /package/dist/{i18n → translations}/locales/de.json.js +0 -0
  121. /package/dist/{i18n → translations}/locales/es.json.d.ts +0 -0
  122. /package/dist/{i18n → translations}/locales/es.json.js +0 -0
  123. /package/dist/{i18n → translations}/locales/fr.json.d.ts +0 -0
  124. /package/dist/{i18n → translations}/locales/fr.json.js +0 -0
  125. /package/dist/{i18n → translations}/locales/ja.json.d.ts +0 -0
  126. /package/dist/{i18n → translations}/locales/ja.json.js +0 -0
  127. /package/dist/{i18n → translations}/locales/ko.json.d.ts +0 -0
  128. /package/dist/{i18n → translations}/locales/ko.json.js +0 -0
  129. /package/dist/{i18n → translations}/locales/pt.json.d.ts +0 -0
  130. /package/dist/{i18n → translations}/locales/pt.json.js +0 -0
  131. /package/dist/{i18n → translations}/locales/ru.json.d.ts +0 -0
  132. /package/dist/{i18n → translations}/locales/ru.json.js +0 -0
  133. /package/dist/{i18n → translations}/locales/th.json.d.ts +0 -0
  134. /package/dist/{i18n → translations}/locales/th.json.js +0 -0
  135. /package/dist/{i18n → translations}/locales/tr.json.d.ts +0 -0
  136. /package/dist/{i18n → translations}/locales/tr.json.js +0 -0
  137. /package/dist/{i18n → translations}/locales/zh.json.d.ts +0 -0
  138. /package/dist/{i18n → translations}/locales/zh.json.js +0 -0
@@ -4,9 +4,9 @@ import { useSyncExternalStore as S, useState as x, useEffect as y } from "react"
4
4
  import { createPortal as M } from "react-dom";
5
5
  import { useToastCollapse as V } from "./hooks/useToastCollapse.js";
6
6
  import { useToastViewportPause as E } from "./hooks/useToastViewportPause.js";
7
- import { positionVariants as w, collapseVariants as C, slideExitVariants as I, queuedEnterVariants as N, slideEnterVariants as P } from "./styles.js";
8
- import { Toast as W } from "./Toast.js";
9
- const q = ({
7
+ import { positionVariants as w, collapseVariants as q, slideExitVariants as C, queuedEnterVariants as I, slideEnterVariants as N } from "./styles.js";
8
+ import { Toast as P } from "./Toast.js";
9
+ const Q = ({
10
10
  item: t,
11
11
  durationMs: s,
12
12
  queued: o,
@@ -16,12 +16,12 @@ const q = ({
16
16
  }) => {
17
17
  const e = t.exiting ?? !1, { contentRef: u, height: p } = V();
18
18
  T({ durationMs: s, paused: c, exiting: e, onDismiss: d });
19
- const a = r.startsWith("top") ? "top" : "bottom", m = () => e ? I({ position: r }) : o ? N({ edge: a }) : P({ position: r });
19
+ const a = r.startsWith("top") ? "top" : "bottom", m = () => e ? C({ position: r }) : o ? I({ edge: a }) : N({ position: r });
20
20
  return /* @__PURE__ */ l(
21
21
  "div",
22
22
  {
23
23
  "data-slot": "toast-collapse",
24
- className: C({ edge: a, exiting: e }),
24
+ className: q({ edge: a, exiting: e }),
25
25
  style: { height: e ? 0 : p },
26
26
  children: /* @__PURE__ */ l(
27
27
  "div",
@@ -31,7 +31,7 @@ const q = ({
31
31
  className: m(),
32
32
  style: e ? { animationFillMode: "forwards" } : void 0,
33
33
  children: /* @__PURE__ */ l(
34
- W,
34
+ P,
35
35
  {
36
36
  appearance: t.appearance,
37
37
  loading: t.loading,
@@ -44,7 +44,7 @@ const q = ({
44
44
  )
45
45
  }
46
46
  );
47
- }, G = ({
47
+ }, H = ({
48
48
  maxItems: t = 3,
49
49
  position: s = "bottom-right",
50
50
  insets: o = {},
@@ -71,7 +71,7 @@ const q = ({
71
71
  },
72
72
  ...p,
73
73
  children: m.map((i) => /* @__PURE__ */ l(
74
- q,
74
+ Q,
75
75
  {
76
76
  item: i,
77
77
  durationMs: b(i, r),
@@ -88,5 +88,5 @@ const q = ({
88
88
  ) : null;
89
89
  };
90
90
  export {
91
- G as Toaster
91
+ H as Toaster
92
92
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
2
  import { useDisabledContext as u, cn as p } from "../../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as f } from "class-variance-authority";
4
- import { useCommonTranslation as b } from "../../../../i18n/useCommonTranslation.js";
4
+ import { useCommonTranslation as b } from "../../../../translations/translations.js";
5
5
  import { TriangleDown as v } from "../../symbols/icons/TriangleDown.js";
6
6
  import { TriangleUp as g } from "../../symbols/icons/TriangleUp.js";
7
7
  function x(e) {
@@ -40,7 +40,7 @@ const T = f("inline-flex items-center", {
40
40
  negative: v,
41
41
  neutral: null
42
42
  };
43
- function L({
43
+ function D({
44
44
  value: e,
45
45
  size: t = "md",
46
46
  disabled: r = !1,
@@ -67,5 +67,5 @@ function L({
67
67
  );
68
68
  }
69
69
  export {
70
- L as Trend
70
+ D as Trend
71
71
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as x, jsx as t } from "react/jsx-runtime";
2
2
  import { useDisabledContext as f, cn as h } from "../../../../libs/utils-shared/dist/index.js";
3
- import { Slot as z, Slottable as S } from "@radix-ui/react-slot";
3
+ import { Slot as z, Slottable as N } from "@radix-ui/react-slot";
4
4
  import { cva as l } from "class-variance-authority";
5
- import { Spinner as B } from "../../core/Spinner/Spinner.js";
6
- const N = l(
5
+ import { Spinner as S } from "../../core/Spinner/Spinner.js";
6
+ const B = 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
  {
9
9
  variants: {
@@ -65,7 +65,7 @@ const N = l(
65
65
  true: "text-disabled"
66
66
  }
67
67
  }
68
- }), M = ({
68
+ }), C = ({
69
69
  ref: c,
70
70
  className: u,
71
71
  appearance: a = "base",
@@ -92,7 +92,7 @@ const N = l(
92
92
  r ? z : "button",
93
93
  {
94
94
  className: h(
95
- N({ disabled: e, loading: n, appearance: a, size: s, isFull: p }),
95
+ B({ disabled: e, loading: n, appearance: a, size: s, isFull: p }),
96
96
  u
97
97
  ),
98
98
  ref: c,
@@ -103,7 +103,7 @@ const N = l(
103
103
  ...m,
104
104
  children: [
105
105
  n && /* @__PURE__ */ t(
106
- B,
106
+ S,
107
107
  {
108
108
  size: d,
109
109
  className: b({ appearance: a, disabled: e })
@@ -116,12 +116,12 @@ const N = l(
116
116
  className: b({ appearance: a, disabled: e })
117
117
  }
118
118
  ),
119
- i && (r ? /* @__PURE__ */ t(S, { children: i }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: i }))
119
+ i && (r ? /* @__PURE__ */ t(N, { children: i }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: i }))
120
120
  ]
121
121
  }
122
122
  );
123
123
  };
124
124
  export {
125
- M as BaseButton,
126
- N as baseButtonVariants
125
+ C as BaseButton,
126
+ B as baseButtonVariants
127
127
  };
@@ -8,7 +8,7 @@ import { BaseInputLabel as re } from "./BaseInputLabel.js";
8
8
  import { BaseInputMultiline as ne } from "./BaseInputMultiline.js";
9
9
  import { BaseInputSingleLine as se } from "./BaseInputSingleLine.js";
10
10
  import { useBaseInputValue as ie } from "./useBaseInputValue/useBaseInputValue.js";
11
- import { useCommonTranslation as oe } from "../../../../i18n/useCommonTranslation.js";
11
+ import { useCommonTranslation as oe } from "../../../../translations/translations.js";
12
12
  import { InteractiveIcon as le } from "../../core/InteractiveIcon/InteractiveIcon.js";
13
13
  import { DeleteCircleFill as ce } from "../../symbols/icons/DeleteCircleFill.js";
14
14
  const ue = O(
@@ -43,22 +43,22 @@ const ue = O(
43
43
  hasLabel: !1
44
44
  }
45
45
  }
46
- ), xe = ({
46
+ ), Ve = ({
47
47
  ref: w,
48
48
  className: B,
49
49
  containerClassName: C,
50
50
  inputClassName: L,
51
- labelClassName: V,
51
+ labelClassName: N,
52
52
  label: t,
53
- id: x,
54
- disabled: y,
53
+ id: V,
54
+ disabled: x,
55
55
  helperText: l,
56
56
  maxCount: r,
57
57
  status: n,
58
- suffix: N,
58
+ suffix: y,
59
59
  prefix: P,
60
- onClear: j,
61
- hideClearButton: F = !1,
60
+ onClear: F,
61
+ hideClearButton: j = !1,
62
62
  readOnly: m = !1,
63
63
  "aria-invalid": D,
64
64
  onChange: R,
@@ -72,24 +72,24 @@ const ue = O(
72
72
  }) => {
73
73
  const h = Z({
74
74
  consumerName: "BaseInput",
75
- mergeWith: { disabled: y }
75
+ mergeWith: { disabled: x }
76
76
  }), { t: k } = oe(), {
77
77
  inputRef: q,
78
78
  composedRef: f,
79
79
  currentValue: z,
80
80
  hasContent: M,
81
- handleChange: T,
82
- handleClear: X
81
+ handleChange: Q,
82
+ handleClear: T
83
83
  } = ie({
84
84
  value: i.value,
85
85
  defaultValue: i.defaultValue,
86
86
  onChange: R,
87
- onClear: j,
87
+ onClear: F,
88
88
  ref: w
89
- }), E = ee(), c = x || `input-${E}`, G = D ?? (n === "error" ? !0 : void 0), { inputPlaceholder: J, labelStaysFloatedWithPlaceholder: K } = _({
89
+ }), E = ee(), c = V || `input-${E}`, G = D ?? (n === "error" ? !0 : void 0), { inputPlaceholder: J, labelStaysFloatedWithPlaceholder: K } = _({
90
90
  label: t,
91
91
  placeholder: S
92
- }), Q = M && !h && !m && !F, U = z.length, p = !!(r && r > 0), g = `${c}-helper`, o = !!l, b = {
92
+ }), U = M && !h && !m && !j, X = z.length, p = !!(r && r > 0), g = `${c}-helper`, o = !!l, b = {
93
93
  id: c,
94
94
  disabled: h,
95
95
  readOnly: m,
@@ -98,17 +98,17 @@ const ue = O(
98
98
  "aria-describedby": o ? g : void 0,
99
99
  hasLabel: !!t,
100
100
  className: L,
101
- onChange: T
102
- }, u = Q ? /* @__PURE__ */ e(
101
+ onChange: Q
102
+ }, u = U ? /* @__PURE__ */ e(
103
103
  le,
104
104
  {
105
105
  iconType: "filled",
106
106
  icon: ce,
107
107
  size: 20,
108
- onClick: X,
108
+ onClick: T,
109
109
  "aria-label": k("components.baseInput.clearInputAriaLabel")
110
110
  }
111
- ) : N;
111
+ ) : y;
112
112
  return /* @__PURE__ */ d("div", { className: B, children: [
113
113
  /* @__PURE__ */ d(
114
114
  "div",
@@ -158,7 +158,7 @@ const ue = O(
158
158
  status: n,
159
159
  floated: K,
160
160
  multiline: s,
161
- className: V,
161
+ className: N,
162
162
  children: t
163
163
  }
164
164
  ),
@@ -182,12 +182,12 @@ const ue = O(
182
182
  status: n
183
183
  }
184
184
  ),
185
- p && r != null && /* @__PURE__ */ e(te, { count: U, maxCount: r })
185
+ p && r != null && /* @__PURE__ */ e(te, { count: X, maxCount: r })
186
186
  ]
187
187
  }
188
188
  )
189
189
  ] });
190
190
  };
191
191
  export {
192
- xe as BaseInput
192
+ Ve as BaseInput
193
193
  };
@@ -1,4 +1,4 @@
1
- import { debounce as E } from "../../../../../libs/utils-shared/dist/index.js";
1
+ import { debounce as y } from "../../../../../libs/utils-shared/dist/index.js";
2
2
  import { useRef as u, useCallback as g, useLayoutEffect as w } from "react";
3
3
  const z = 166, p = "x", d = (o) => Number.parseInt(o, 10) || 0, O = ({
4
4
  minLines: o,
@@ -16,9 +16,9 @@ const z = 166, p = "x", d = (o) => Number.parseInt(o, 10) || 0, O = ({
16
16
  const f = e.scrollHeight;
17
17
  let n = Math.max(o * f, b);
18
18
  h && (n = Math.min(h * f, n)), n = Math.max(n, f);
19
- const x = d(r.paddingTop) + d(r.paddingBottom), R = d(r.borderTopWidth) + d(r.borderBottomWidth), y = r.boxSizing === "border-box" ? x + R : 0;
19
+ const x = d(r.paddingTop) + d(r.paddingBottom), R = d(r.borderTopWidth) + d(r.borderBottomWidth), E = r.boxSizing === "border-box" ? x + R : 0;
20
20
  return {
21
- height: n + y,
21
+ height: n + E,
22
22
  // A pixel of tolerance absorbs subpixel rounding.
23
23
  fits: Math.abs(n - b) <= 1
24
24
  };
@@ -32,7 +32,7 @@ const z = 166, p = "x", d = (o) => Number.parseInt(o, 10) || 0, O = ({
32
32
  return w(a), w(() => {
33
33
  const t = i.current;
34
34
  if (!t) return;
35
- const e = E(a, z);
35
+ const e = y(a, z);
36
36
  window.addEventListener("resize", e);
37
37
  let r;
38
38
  return typeof ResizeObserver < "u" && (r = new ResizeObserver(() => {
@@ -41,8 +41,8 @@ const u = x(
41
41
  }
42
42
  }
43
43
  ), z = ({
44
- ref: e,
45
- className: a,
44
+ ref: a,
45
+ className: e,
46
46
  appearance: t,
47
47
  size: s,
48
48
  variant: r,
@@ -61,9 +61,9 @@ const u = x(
61
61
  {
62
62
  className: o(
63
63
  u({ appearance: t, size: s, variant: r, disabled: !!l }),
64
- a
64
+ e
65
65
  ),
66
- ref: e,
66
+ ref: a,
67
67
  ...b,
68
68
  children: [
69
69
  d,
@@ -22,8 +22,8 @@ const h = a("inline-block shrink-0", {
22
22
  size: n = 24,
23
23
  className: i = "",
24
24
  children: c,
25
- viewBox: e,
26
- xmlns: r,
25
+ viewBox: r,
26
+ xmlns: e,
27
27
  ...t
28
28
  }) => k(
29
29
  "svg",
@@ -31,8 +31,8 @@ const h = a("inline-block shrink-0", {
31
31
  ref: o,
32
32
  fill: "none",
33
33
  "aria-hidden": "true",
34
- xmlns: r,
35
- viewBox: e,
34
+ xmlns: e,
35
+ viewBox: r,
36
36
  className: s(h({ size: n }), "inline-block", i),
37
37
  ...t
38
38
  },
@@ -1,8 +1,8 @@
1
1
  import { useDisabledContext as c, cn as i } from "../../../../libs/utils-shared/dist/index.js";
2
2
  import { createElement as p } from "react";
3
3
  import { Icon as d } from "./Icon.js";
4
- const x = (e, r) => {
5
- const t = ({
4
+ const x = (e, t) => {
5
+ const r = ({
6
6
  ref: o,
7
7
  className: s,
8
8
  disabled: a,
@@ -15,12 +15,12 @@ const x = (e, r) => {
15
15
  return p(d, {
16
16
  ref: o,
17
17
  className: i(s, n && "text-disabled"),
18
- viewBox: r.props.viewBox,
18
+ viewBox: t.props.viewBox,
19
19
  ...m,
20
- children: r.props.children
20
+ children: t.props.children
21
21
  });
22
22
  };
23
- return t.displayName = e, t;
23
+ return r.displayName = e, r;
24
24
  };
25
25
  export {
26
26
  x as default
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuC,EACvC,KAAK,EACL,WAAW,EACX,SAAmB,EACnB,QAAgB,EAChB,OAAO,EAAE,WAAW,EACpB,eAAuB,EACvB,wBAAwB,EACxB,OAAc,EACd,YAAY,EACZ,QAAQ,GACT,EAAE,mBAAmB,2CAuGrB"}
1
+ {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuC,EACvC,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAgB,EAChB,OAAO,EAAE,WAAW,EACpB,eAAuB,EACvB,wBAAwB,EACxB,OAAc,EACd,YAAY,EACZ,QAAQ,GACT,EAAE,mBAAmB,2CAwGrB"}
@@ -1,21 +1,22 @@
1
- import { jsx as r, jsxs as k, Fragment as O } from "react/jsx-runtime";
2
- import { useRef as h, useState as B, useCallback as E, useEffect as F, useMemo as b } from "react";
3
- import { chartConfig as H } from "../config.js";
4
- import { ScrubberProvider as V } from "../Scrubber/ScrubberProvider.js";
5
- import { resolveInset as q, resolveAxisPadding as D } from "./utils.js";
1
+ import { jsx as r, jsxs as O, Fragment as B } from "react/jsx-runtime";
2
+ import { useRef as h, useState as E, useCallback as F, useEffect as H, useMemo as b } from "react";
3
+ import { chartConfig as L } from "../config.js";
4
+ import { ScrubberProvider as T } from "../Scrubber/ScrubberProvider.js";
5
+ import { resolveInset as V, resolveAxisPadding as q } from "./utils.js";
6
+ import { useCommonTranslation as D } from "../../../../translations/translations.js";
6
7
  import { useBuildChartContext as G } from "./context/useBuildChartContext.js";
7
8
  import { CartesianChartProvider as J } from "./context/cartesianChartContext.js";
8
9
  import { MagneticPointsProvider as K } from "../Point/pointContext/MagneticPointsProvider.js";
9
- import { RevealAnimationProvider as L } from "./RevealAnimation/RevealAnimationProvider.js";
10
- function $({
10
+ import { RevealAnimationProvider as N } from "./RevealAnimation/RevealAnimationProvider.js";
11
+ function te({
11
12
  series: d,
12
13
  xAxis: y,
13
- yAxis: C,
14
+ yAxis: g,
14
15
  width: e = "100%",
15
- height: n = H.root.defaultHeight,
16
+ height: i = L.root.defaultHeight,
16
17
  inset: l,
17
18
  axisPadding: c,
18
- ariaLabel: g = "Chart",
19
+ ariaLabel: C,
19
20
  ariaBusy: x = !1,
20
21
  overlay: R,
21
22
  enableScrubbing: s = !1,
@@ -24,29 +25,29 @@ function $({
24
25
  magnetRadius: w,
25
26
  children: M
26
27
  }) {
27
- const a = h(null), v = h(null), [W, z] = B(
28
+ const { t: W } = D(), a = h(null), f = h(null), [z, I] = E(
28
29
  typeof e == "number" ? e : void 0
29
- ), t = typeof e != "number", f = E((i) => {
30
- const [p] = i;
31
- p && z(p.contentRect.width);
30
+ ), t = typeof e != "number", m = F((n) => {
31
+ const [p] = n;
32
+ p && I(p.contentRect.width);
32
33
  }, []);
33
- F(() => {
34
+ H(() => {
34
35
  if (!t || !a.current || typeof ResizeObserver > "u")
35
36
  return;
36
- const i = new ResizeObserver(f);
37
- return i.observe(a.current), () => i.disconnect();
38
- }, [t, f]);
39
- const o = typeof e == "number" ? e : W ?? 0, m = o > 0 ? o : 0, I = b(() => q(l), [l]), j = b(
40
- () => D(c),
37
+ const n = new ResizeObserver(m);
38
+ return n.observe(a.current), () => n.disconnect();
39
+ }, [t, m]);
40
+ const o = typeof e == "number" ? e : z ?? 0, v = o > 0 ? o : 0, j = b(() => V(l), [l]), k = b(
41
+ () => q(c),
41
42
  [c]
42
43
  ), u = G({
43
44
  series: d,
44
45
  xAxis: y,
45
- yAxis: C,
46
- width: m,
47
- height: n,
48
- inset: I,
49
- axisPadding: j
46
+ yAxis: g,
47
+ width: v,
48
+ height: i,
49
+ inset: j,
50
+ axisPadding: k
50
51
  });
51
52
  return /* @__PURE__ */ r(
52
53
  "div",
@@ -55,20 +56,20 @@ function $({
55
56
  "data-testid": "chart-container",
56
57
  style: {
57
58
  width: t ? e : o,
58
- height: n,
59
+ height: i,
59
60
  overflow: "visible",
60
61
  position: "relative"
61
62
  },
62
- children: o > 0 && /* @__PURE__ */ k(O, { children: [
63
+ children: o > 0 && /* @__PURE__ */ O(B, { children: [
63
64
  /* @__PURE__ */ r(
64
65
  "svg",
65
66
  {
66
- ref: v,
67
+ ref: f,
67
68
  "data-testid": "chart-svg",
68
- width: m,
69
- height: n,
69
+ width: v,
70
+ height: i,
70
71
  role: "img",
71
- "aria-label": g || "Chart",
72
+ "aria-label": C || W("components.chart.defaultAriaLabel"),
72
73
  "aria-busy": x || void 0,
73
74
  tabIndex: s ? 0 : void 0,
74
75
  style: {
@@ -78,14 +79,14 @@ function $({
78
79
  outline: s ? "none" : void 0
79
80
  },
80
81
  children: /* @__PURE__ */ r(J, { value: u, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(
81
- V,
82
+ T,
82
83
  {
83
- svgRef: v,
84
+ svgRef: f,
84
85
  enableScrubbing: s,
85
86
  onScrubberPositionChange: P,
86
87
  magnetRadius: w,
87
88
  children: /* @__PURE__ */ r(
88
- L,
89
+ N,
89
90
  {
90
91
  drawingArea: u.drawingArea,
91
92
  series: d,
@@ -103,5 +104,5 @@ function $({
103
104
  );
104
105
  }
105
106
  export {
106
- $ as CartesianChart
107
+ te as CartesianChart
107
108
  };
@@ -65,7 +65,7 @@ export type CartesianChartProps = ScrubbingOptions & {
65
65
  axisPadding?: Partial<ChartInset>;
66
66
  /**
67
67
  * Accessible label for the chart SVG.
68
- * @default 'Chart'
68
+ * @default 'Chart' (translated)
69
69
  */
70
70
  ariaLabel?: string;
71
71
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ/C,wBAAgB,UAAU,CAAC,EACzB,MAAM,EAAE,UAAU,EAClB,IAAW,EACX,SAAyB,EACzB,OAAe,EACf,QAAQ,EAAE,YAAY,EACtB,eAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAA2B,GAC5B,EAAE,eAAe,2CA4FjB"}
1
+ {"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ/C,wBAAgB,UAAU,CAAC,EACzB,MAAM,EAAE,UAAU,EAClB,IAAW,EACX,SAAS,EACT,OAAe,EACf,QAAQ,EAAE,YAAY,EACtB,eAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAA2B,GAC5B,EAAE,eAAe,2CAiGjB"}
@@ -1,33 +1,33 @@
1
1
  import { jsxs as I, jsx as i } from "react/jsx-runtime";
2
2
  import { useMemo as g } from "react";
3
- import { chartConfig as P } from "../config.js";
4
3
  import { DonutChartAnimatedCenter as T } from "./DonutChartAnimatedCenter.js";
5
- import { DonutRing as j } from "./DonutRing.js";
6
- import { DonutSizeProvider as y } from "./donutSizeContext.js";
7
- import { useContrastSafeSeries as A } from "./hooks/useContrastSafeSeries.js";
4
+ import { DonutRing as P } from "./DonutRing.js";
5
+ import { DonutSizeProvider as j } from "./donutSizeContext.js";
6
+ import { useContrastSafeSeries as y } from "./hooks/useContrastSafeSeries.js";
8
7
  import { buildRingSegments as E, DONUT_GEOMETRY as M, getSegmentPercents as N, formatPercentLabel as B } from "./utils.js";
9
- import { useControllableState as O } from "../../../../utils/useControllableState/useControllableState.js";
10
- function H({
11
- series: p,
8
+ import { useCommonTranslation as O } from "../../../../translations/translations.js";
9
+ import { useControllableState as w } from "../../../../utils/useControllableState/useControllableState.js";
10
+ function J({
11
+ series: h,
12
12
  size: l = "md",
13
- ariaLabel: h = "Donut chart",
13
+ ariaLabel: v,
14
14
  loading: c = !1,
15
- activeId: v,
15
+ activeId: b,
16
16
  defaultActiveId: S = null,
17
- onActiveIdChange: b,
17
+ onActiveIdChange: x,
18
18
  renderCenter: s,
19
19
  renderCenterActive: a,
20
- enableColorContrast: x = !1
20
+ enableColorContrast: L = !1
21
21
  }) {
22
- const n = M[l], e = A(p, x), [o, u] = O({
23
- prop: v,
22
+ const { t: m } = O(), n = M[l], e = y(h, L), [o, u] = w({
23
+ prop: b,
24
24
  defaultProp: S,
25
- onChange: b
26
- }), L = g(
25
+ onChange: x
26
+ }), R = g(
27
27
  () => E(e, n),
28
28
  [e, n]
29
- ), m = g(() => {
30
- const t = e.findIndex((f) => f.id === o);
29
+ ), d = g(() => {
30
+ const t = e.findIndex((p) => p.id === o);
31
31
  if (o == null || t === -1)
32
32
  return null;
33
33
  const r = N(e)[t];
@@ -36,12 +36,12 @@ function H({
36
36
  percent: r,
37
37
  percentLabel: B(r)
38
38
  };
39
- }, [e, o]), d = () => {
39
+ }, [e, o]), f = () => {
40
40
  o !== null && u(null);
41
- }, R = (t) => {
41
+ }, A = (t) => {
42
42
  const { relatedTarget: r } = t;
43
- (!(r instanceof Node) || !t.currentTarget.contains(r)) && d();
44
- }, D = s != null || a != null, C = a != null;
43
+ (!(r instanceof Node) || !t.currentTarget.contains(r)) && f();
44
+ }, C = s != null || a != null, D = a != null;
45
45
  return /* @__PURE__ */ I(
46
46
  "div",
47
47
  {
@@ -52,33 +52,33 @@ function H({
52
52
  width: n.box,
53
53
  height: n.box
54
54
  },
55
- onMouseLeave: d,
56
- onBlur: R,
55
+ onMouseLeave: f,
56
+ onBlur: A,
57
57
  children: [
58
58
  /* @__PURE__ */ i(
59
- j,
59
+ P,
60
60
  {
61
- segments: L,
61
+ segments: R,
62
62
  geometry: n,
63
- ariaLabel: c ? P.donut.loading.ariaLabel : h,
63
+ ariaLabel: c ? m("components.chart.loadingAriaLabel") : v ?? m("components.chart.defaultAriaLabel"),
64
64
  activeId: o,
65
65
  loading: c,
66
66
  onSegmentEnter: u
67
67
  }
68
68
  ),
69
- D && /* @__PURE__ */ i(
69
+ C && /* @__PURE__ */ i(
70
70
  "div",
71
71
  {
72
72
  "data-testid": "donut-center",
73
73
  className: "pointer-events-none absolute inset-0 flex items-center justify-center",
74
- children: /* @__PURE__ */ i(y, { value: { size: l }, children: C ? /* @__PURE__ */ i(
74
+ children: /* @__PURE__ */ i(j, { value: { size: l }, children: D ? /* @__PURE__ */ i(
75
75
  T,
76
76
  {
77
- activeSegment: m,
77
+ activeSegment: d,
78
78
  renderResting: () => s?.({ series: e, activeSegment: null }) ?? null,
79
79
  renderActive: (t) => a({ activeSegment: t })
80
80
  }
81
- ) : s?.({ activeSegment: m, series: e }) })
81
+ ) : s?.({ activeSegment: d, series: e }) })
82
82
  }
83
83
  )
84
84
  ]
@@ -86,5 +86,5 @@ function H({
86
86
  );
87
87
  }
88
88
  export {
89
- H as DonutChart
89
+ J as DonutChart
90
90
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { cn as n } from "../../../../libs/utils-shared/dist/index.js";
3
3
  const i = ({
4
- ref: e,
5
- className: t,
4
+ ref: t,
5
+ className: e,
6
6
  ...r
7
7
  }) => /* @__PURE__ */ o(
8
8
  "div",
9
9
  {
10
- ref: e,
10
+ ref: t,
11
11
  className: n(
12
12
  "pointer-events-auto flex min-w-0 flex-col items-center",
13
- t
13
+ e
14
14
  ),
15
15
  ...r
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DonutRing.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutRing.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAoG/D,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AAaF,eAAO,MAAM,SAAS,GAAI,uEAOvB,cAAc,4CAqChB,CAAC"}
1
+ {"version":3,"file":"DonutRing.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutRing.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAqG/D,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC;AAaF,eAAO,MAAM,SAAS,GAAI,uEAOvB,cAAc,4CAqChB,CAAC"}