@ledgerhq/lumen-ui-react 0.1.62 → 0.1.64

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 (179) hide show
  1. package/ai-rules/RULES.md +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +80 -78
  5. package/dist/lib/Components/core/AddressInput/AddressInput.js +1 -1
  6. package/dist/lib/Components/core/AmountDisplay/AmountDisplay.js +1 -1
  7. package/dist/lib/Components/core/AmountInput/AmountInput.js +22 -22
  8. package/dist/lib/Components/core/Avatar/Avatar.js +7 -7
  9. package/dist/lib/Components/core/AvatarButton/AvatarButton.js +8 -8
  10. package/dist/lib/Components/core/Banner/Banner.js +1 -1
  11. package/dist/lib/Components/core/Button/Button.js +6 -6
  12. package/dist/lib/Components/core/Card/Card.js +17 -17
  13. package/dist/lib/Components/core/ContentBanner/ContentBanner.d.ts +1 -1
  14. package/dist/lib/Components/core/ContentBanner/ContentBanner.js +1 -1
  15. package/dist/lib/Components/core/DataTable/DataTable.js +45 -45
  16. package/dist/lib/Components/core/Dialog/DialogHeader/DialogHeader.js +1 -1
  17. package/dist/lib/Components/core/Divider/Divider.js +4 -4
  18. package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
  19. package/dist/lib/Components/core/DotIcon/DotIcon.js +4 -4
  20. package/dist/lib/Components/core/DotSymbol/DotSymbol.js +18 -18
  21. package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
  22. package/dist/lib/Components/core/Link/Link.js +25 -24
  23. package/dist/lib/Components/core/ListItem/ListItem.d.ts +1 -1
  24. package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
  25. package/dist/lib/Components/core/MediaBanner/MediaBanner.js +16 -16
  26. package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
  27. package/dist/lib/Components/core/MediaCard/MediaCard.js +1 -1
  28. package/dist/lib/Components/core/MediaImage/MediaImage.js +5 -5
  29. package/dist/lib/Components/core/Menu/Menu.js +25 -25
  30. package/dist/lib/Components/core/NavBar/CoinCapsule.js +4 -4
  31. package/dist/lib/Components/core/NavBar/NavBar.js +3 -3
  32. package/dist/lib/Components/core/PageIndicator/PageIndicator.js +5 -5
  33. package/dist/lib/Components/core/Pagination/Pagination.js +15 -15
  34. package/dist/lib/Components/core/Popover/Popover.js +13 -13
  35. package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
  36. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  37. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +78 -82
  38. package/dist/lib/Components/core/Select/Select.d.ts.map +1 -1
  39. package/dist/lib/Components/core/Select/Select.js +105 -104
  40. package/dist/lib/Components/core/SideBar/SideBar.js +28 -28
  41. package/dist/lib/Components/core/Spinner/Spinner.js +5 -5
  42. package/dist/lib/Components/core/Spot/Spot.d.ts +7 -25
  43. package/dist/lib/Components/core/Spot/Spot.d.ts.map +1 -1
  44. package/dist/lib/Components/core/Spot/Spot.js +33 -102
  45. package/dist/lib/Components/core/Spot/SpotNumber.d.ts +16 -0
  46. package/dist/lib/Components/core/Spot/SpotNumber.d.ts.map +1 -0
  47. package/dist/lib/Components/core/Spot/SpotNumber.js +46 -0
  48. package/dist/lib/Components/core/Spot/index.d.ts +1 -0
  49. package/dist/lib/Components/core/Spot/index.d.ts.map +1 -1
  50. package/dist/lib/Components/core/Spot/styles.d.ts +14 -0
  51. package/dist/lib/Components/core/Spot/styles.d.ts.map +1 -0
  52. package/dist/lib/Components/core/Spot/styles.js +275 -0
  53. package/dist/lib/Components/core/Spot/types.d.ts +27 -38
  54. package/dist/lib/Components/core/Spot/types.d.ts.map +1 -1
  55. package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
  56. package/dist/lib/Components/core/Stepper/Stepper.js +51 -48
  57. package/dist/lib/Components/core/Subheader/Subheader.d.ts.map +1 -1
  58. package/dist/lib/Components/core/Subheader/Subheader.js +33 -29
  59. package/dist/lib/Components/core/Switch/Switch.js +5 -5
  60. package/dist/lib/Components/core/Table/Table.d.ts.map +1 -1
  61. package/dist/lib/Components/core/Table/Table.js +64 -63
  62. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.js +6 -6
  63. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts +1 -1
  64. package/dist/lib/Components/core/ThemeProvider/ThemeProvider.types.d.ts.map +1 -1
  65. package/dist/lib/Components/core/Tile/Tile.d.ts +2 -2
  66. package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
  67. package/dist/lib/Components/core/Timeline/Timeline.js +16 -16
  68. package/dist/lib/Components/core/Toast/Toast.js +4 -4
  69. package/dist/lib/Components/core/Toast/Toaster.js +9 -9
  70. package/dist/lib/Components/core/Trend/Trend.js +3 -3
  71. package/dist/lib/Components/internal/BaseButton/BaseButton.js +9 -9
  72. package/dist/lib/Components/internal/BaseInput/BaseInput.js +21 -21
  73. package/dist/lib/Components/internal/BaseInput/useAutosizeTextarea/useAutosizeTextarea.js +4 -4
  74. package/dist/lib/Components/internal/BaseTag/BaseTag.js +4 -4
  75. package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
  76. package/dist/lib/Components/symbols/Icon/createIcon.js +5 -5
  77. package/dist/lib/Components/symbols/icons/AiBubble.d.ts +29 -0
  78. package/dist/lib/Components/symbols/icons/AiBubble.d.ts.map +1 -0
  79. package/dist/lib/Components/symbols/icons/AiBubble.js +30 -0
  80. package/dist/lib/Components/symbols/icons/ArrowBottomLeft.d.ts +29 -0
  81. package/dist/lib/Components/symbols/icons/ArrowBottomLeft.d.ts.map +1 -0
  82. package/dist/lib/Components/symbols/icons/ArrowBottomLeft.js +27 -0
  83. package/dist/lib/Components/symbols/icons/Bug.js +3 -3
  84. package/dist/lib/Components/symbols/icons/Hourglass.d.ts +29 -0
  85. package/dist/lib/Components/symbols/icons/Hourglass.d.ts.map +1 -0
  86. package/dist/lib/Components/symbols/icons/Hourglass.js +27 -0
  87. package/dist/lib/Components/symbols/icons/Repeat.d.ts +29 -0
  88. package/dist/lib/Components/symbols/icons/Repeat.d.ts.map +1 -0
  89. package/dist/lib/Components/symbols/icons/Repeat.js +27 -0
  90. package/dist/lib/Components/symbols/icons/Robot.d.ts +29 -0
  91. package/dist/lib/Components/symbols/icons/Robot.d.ts.map +1 -0
  92. package/dist/lib/Components/symbols/icons/Robot.js +29 -0
  93. package/dist/lib/Components/symbols/icons/Switch.d.ts.map +1 -1
  94. package/dist/lib/Components/symbols/icons/Switch.js +24 -12
  95. package/dist/lib/Components/symbols/icons/Wifi.d.ts +29 -0
  96. package/dist/lib/Components/symbols/icons/Wifi.d.ts.map +1 -0
  97. package/dist/lib/Components/symbols/icons/Wifi.js +36 -0
  98. package/dist/lib/Components/symbols/index.d.ts +6 -0
  99. package/dist/lib/Components/symbols/index.d.ts.map +1 -1
  100. package/dist/lib/Components/symbols/index.js +610 -598
  101. package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -1
  102. package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +36 -35
  103. package/dist/lib/Components/visualization/CartesianChart/types.d.ts +1 -1
  104. package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -1
  105. package/dist/lib/Components/visualization/DonutChart/DonutChart.js +31 -31
  106. package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +4 -4
  107. package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -1
  108. package/dist/lib/Components/visualization/DonutChart/DonutRing.js +13 -12
  109. package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
  110. package/dist/lib/Components/visualization/DonutChart/types.d.ts +1 -1
  111. package/dist/lib/Components/visualization/Legend/Legend.d.ts +1 -1
  112. package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -1
  113. package/dist/lib/Components/visualization/Legend/Legend.js +7 -11
  114. package/dist/lib/Components/visualization/Legend/types.d.ts +2 -2
  115. package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +1 -1
  116. package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -1
  117. package/dist/lib/Components/visualization/LineChart/LineChart.js +90 -84
  118. package/dist/lib/Components/visualization/LineChart/types.d.ts +1 -1
  119. package/dist/lib/Components/visualization/LineChart/utils.d.ts +2 -1
  120. package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -1
  121. package/dist/lib/Components/visualization/LineChart/utils.js +23 -22
  122. package/dist/lib/Components/visualization/config.d.ts +0 -3
  123. package/dist/lib/Components/visualization/config.d.ts.map +1 -1
  124. package/dist/lib/Components/visualization/config.js +3 -6
  125. package/dist/libs/utils-shared/dist/index.js +191 -143
  126. package/dist/package.json +4 -6
  127. package/dist/translations/index.d.ts +3 -0
  128. package/dist/translations/index.d.ts.map +1 -0
  129. package/dist/{i18n → translations}/languages.d.ts +0 -5
  130. package/dist/translations/languages.d.ts.map +1 -0
  131. package/dist/{i18n → translations}/languages.js +1 -2
  132. package/dist/{i18n → translations}/locales/en.json.d.ts +11 -0
  133. package/dist/{i18n → translations}/locales/en.json.js +2 -2
  134. package/dist/translations/translations.d.ts +727 -0
  135. package/dist/translations/translations.d.ts.map +1 -0
  136. package/dist/translations/translations.js +22 -0
  137. package/package.json +4 -6
  138. package/dist/_virtual/dynamic-import-helper.js +0 -9
  139. package/dist/i18n/I18nProvider.d.ts +0 -8
  140. package/dist/i18n/I18nProvider.d.ts.map +0 -1
  141. package/dist/i18n/I18nProvider.js +0 -14
  142. package/dist/i18n/i18n.d.ts +0 -12
  143. package/dist/i18n/i18n.d.ts.map +0 -1
  144. package/dist/i18n/i18n.js +0 -42
  145. package/dist/i18n/index.d.ts +0 -4
  146. package/dist/i18n/index.d.ts.map +0 -1
  147. package/dist/i18n/languages.d.ts.map +0 -1
  148. package/dist/i18n/useCommonTranslation.d.ts +0 -2
  149. package/dist/i18n/useCommonTranslation.d.ts.map +0 -1
  150. package/dist/i18n/useCommonTranslation.js +0 -6
  151. package/dist/node_modules/i18next/dist/esm/i18next.js +0 -1479
  152. package/dist/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -19
  153. package/dist/node_modules/react-i18next/dist/es/context.js +0 -17
  154. package/dist/node_modules/react-i18next/dist/es/defaults.js +0 -22
  155. package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +0 -8
  156. package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +0 -11
  157. package/dist/node_modules/react-i18next/dist/es/unescape.js +0 -25
  158. package/dist/node_modules/react-i18next/dist/es/useTranslation.js +0 -65
  159. package/dist/node_modules/react-i18next/dist/es/utils.js +0 -57
  160. /package/dist/{i18n → translations}/locales/de.json.d.ts +0 -0
  161. /package/dist/{i18n → translations}/locales/de.json.js +0 -0
  162. /package/dist/{i18n → translations}/locales/es.json.d.ts +0 -0
  163. /package/dist/{i18n → translations}/locales/es.json.js +0 -0
  164. /package/dist/{i18n → translations}/locales/fr.json.d.ts +0 -0
  165. /package/dist/{i18n → translations}/locales/fr.json.js +0 -0
  166. /package/dist/{i18n → translations}/locales/ja.json.d.ts +0 -0
  167. /package/dist/{i18n → translations}/locales/ja.json.js +0 -0
  168. /package/dist/{i18n → translations}/locales/ko.json.d.ts +0 -0
  169. /package/dist/{i18n → translations}/locales/ko.json.js +0 -0
  170. /package/dist/{i18n → translations}/locales/pt.json.d.ts +0 -0
  171. /package/dist/{i18n → translations}/locales/pt.json.js +0 -0
  172. /package/dist/{i18n → translations}/locales/ru.json.d.ts +0 -0
  173. /package/dist/{i18n → translations}/locales/ru.json.js +0 -0
  174. /package/dist/{i18n → translations}/locales/th.json.d.ts +0 -0
  175. /package/dist/{i18n → translations}/locales/th.json.js +0 -0
  176. /package/dist/{i18n → translations}/locales/tr.json.d.ts +0 -0
  177. /package/dist/{i18n → translations}/locales/tr.json.js +0 -0
  178. /package/dist/{i18n → translations}/locales/zh.json.d.ts +0 -0
  179. /package/dist/{i18n → translations}/locales/zh.json.js +0 -0
@@ -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"}
@@ -2,14 +2,14 @@ import { jsx as i, jsxs as v, Fragment as b } from "react/jsx-runtime";
2
2
  import { useRef as h, useMemo as f, useCallback as x } from "react";
3
3
  import { chartConfig as c } from "../config.js";
4
4
  import { useDonutLoadingAnimation as R } from "./hooks/useDonutLoadingAnimation.js";
5
- import { RevealAnimation as $ } from "./RevealAnimation.js";
6
- import { getDonutViewBox as g, buildPlaceholderSegments as m } from "./utils.js";
7
- const { hover: s } = c.donut, D = ({
5
+ import { RevealAnimation as g } from "./RevealAnimation.js";
6
+ import { getDonutViewBox as $, buildPlaceholderSegments as m } from "./utils.js";
7
+ const { hover: d } = c.donut, D = ({
8
8
  segment: t,
9
9
  activeId: o,
10
10
  onSegmentEnter: n
11
11
  }) => {
12
- const a = o === t.id, e = !t.hoverEnabled || o == null || a ? 1 : s.dimOpacity, { x: r, y: l } = a ? t.hoverTranslate : { x: 0, y: 0 }, d = x(() => {
12
+ const a = o === t.id, e = !t.hoverEnabled || o == null || a ? 1 : d.dimOpacity, { x: r, y: l } = a ? t.hoverTranslate : { x: 0, y: 0 }, s = x(() => {
13
13
  n(t.id);
14
14
  }, [t.id, n]);
15
15
  return /* @__PURE__ */ i(
@@ -20,16 +20,17 @@ const { hover: s } = c.donut, D = ({
20
20
  d: t.path,
21
21
  fill: t.color,
22
22
  role: "button",
23
- "aria-label": a ? `${t.id}, selected` : t.id,
23
+ "aria-label": t.id,
24
+ "aria-pressed": a,
24
25
  tabIndex: 0,
25
26
  className: "outline-none focus-visible:outline-2 focus-visible:outline-focus",
26
- onMouseEnter: d,
27
- onFocus: d,
27
+ onMouseEnter: s,
28
+ onFocus: s,
28
29
  style: {
29
30
  cursor: "pointer",
30
31
  opacity: e,
31
32
  transform: `translate(${r}px, ${l}px)`,
32
- transition: t.hoverEnabled ? `${s.opacityTransition}, ${s.popTransition}` : void 0
33
+ transition: t.hoverEnabled ? `${d.opacityTransition}, ${d.popTransition}` : void 0
33
34
  }
34
35
  }
35
36
  );
@@ -81,19 +82,19 @@ const F = ({
81
82
  loading: e = !1,
82
83
  onSegmentEnter: r
83
84
  }) => {
84
- const { box: l } = o, d = l / 2, u = t.length > 0, y = w(e);
85
- return /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(
85
+ const { box: l } = o, s = l / 2, u = t.length > 0, y = w(e);
86
+ return /* @__PURE__ */ i(g, { children: /* @__PURE__ */ i(
86
87
  "svg",
87
88
  {
88
89
  "data-testid": "donut-ring",
89
90
  width: l,
90
91
  height: l,
91
- viewBox: g(o),
92
+ viewBox: $(o),
92
93
  role: e || !u ? "img" : "group",
93
94
  "aria-label": n,
94
95
  "aria-busy": e || void 0,
95
96
  style: { display: "block", overflow: "visible" },
96
- children: /* @__PURE__ */ i("g", { transform: `translate(${d}, ${d})`, children: e ? /* @__PURE__ */ i(k, { geometry: o }) : u ? t.map((p) => /* @__PURE__ */ i(
97
+ children: /* @__PURE__ */ i("g", { transform: `translate(${s}, ${s})`, children: e ? /* @__PURE__ */ i(k, { geometry: o }) : u ? t.map((p) => /* @__PURE__ */ i(
97
98
  D,
98
99
  {
99
100
  segment: p,
@@ -1,5 +1,5 @@
1
- import { createSafeContext as e } from "../../../../libs/utils-shared/dist/index.js";
2
- const [o, r] = e("DonutChart", { size: "md" });
1
+ import { createSafeContext as t } from "../../../../libs/utils-shared/dist/index.js";
2
+ const [o, r] = t("DonutChart", { size: "md" });
3
3
  export {
4
4
  o as DonutSizeProvider,
5
5
  r as useDonutSizeContext
@@ -115,7 +115,7 @@ export type DonutChartProps = {
115
115
  /**
116
116
  * Accessible label describing what the chart represents, exposed to
117
117
  * assistive tech via the SVG `role="img"`.
118
- * @default 'Donut chart'
118
+ * @default 'Chart' (translated)
119
119
  */
120
120
  ariaLabel?: string;
121
121
  /**
@@ -1,3 +1,3 @@
1
1
  import { LegendProps } from './types';
2
- export declare function Legend({ series, ariaLabel, className, }: LegendProps): import("react/jsx-runtime").JSX.Element | null;
2
+ export declare function Legend({ series, ariaLabel, className }: LegendProps): import("react/jsx-runtime").JSX.Element | null;
3
3
  //# sourceMappingURL=Legend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Legend/Legend.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAoB,EACpB,SAAS,GACV,EAAE,WAAW,kDAkBb"}
1
+ {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Legend/Legend.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,WAAW,kDAkBnE"}
@@ -1,20 +1,16 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { cn as m } from "../../../../libs/utils-shared/dist/index.js";
3
- import { LegendItem as o } from "./LegendItem.js";
4
- function i({
5
- series: e,
6
- ariaLabel: l = "Legend",
7
- className: a
8
- }) {
9
- return e.length === 0 ? null : /* @__PURE__ */ r(
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { cn as t } from "../../../../libs/utils-shared/dist/index.js";
3
+ import { LegendItem as m } from "./LegendItem.js";
4
+ function i({ series: r, ariaLabel: l, className: a }) {
5
+ return r.length === 0 ? null : /* @__PURE__ */ n(
10
6
  "ul",
11
7
  {
12
8
  "aria-label": l,
13
- className: m(
9
+ className: t(
14
10
  "m-0 flex list-none flex-wrap gap-x-16 gap-y-6 p-0",
15
11
  a
16
12
  ),
17
- children: e.map((n) => /* @__PURE__ */ r(o, { item: n }, n.id))
13
+ children: r.map((e) => /* @__PURE__ */ n(m, { item: e }, e.id))
18
14
  }
19
15
  );
20
16
  }
@@ -20,8 +20,8 @@ export type LegendProps = {
20
20
  */
21
21
  series: LegendItem[];
22
22
  /**
23
- * Accessible label for the legend group.
24
- * @default 'Legend'
23
+ * Accessible label for the legend list. Optional: each item already carries
24
+ * its own visible text.
25
25
  */
26
26
  ariaLabel?: string;
27
27
  /**
@@ -1,3 +1,3 @@
1
1
  import { LineChartProps } from './types';
2
- export declare function LineChart({ series: seriesProp, showArea, areaType, connectNulls, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, loading, emptyLabel, enableColorContrast, children, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function LineChart({ series: seriesProp, showArea, areaType, connectNulls, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, loading, emptyLabel: emptyLabelProp, enableColorContrast, children, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=LineChart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/LineChart.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA+GjB,wBAAgB,SAAS,CAAC,EACxB,MAAM,EAAE,UAAU,EAClB,QAAgB,EAChB,QAAqB,EACrB,YAAY,EACZ,SAAiB,EACjB,SAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuC,EACvC,KAAK,EACL,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,YAAY,EACZ,OAAe,EACf,UAAgD,EAChD,mBAA2B,EAC3B,QAAQ,GACT,EAAE,cAAc,2CAuFhB"}
1
+ {"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/LineChart.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA+GjB,wBAAgB,SAAS,CAAC,EACxB,MAAM,EAAE,UAAU,EAClB,QAAgB,EAChB,QAAqB,EACrB,YAAY,EACZ,SAAiB,EACjB,SAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuC,EACvC,KAAK,EACL,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,YAAY,EACZ,OAAe,EACf,UAAU,EAAE,cAAc,EAC1B,mBAA2B,EAC3B,QAAQ,GACT,EAAE,cAAc,2CA8FhB"}