@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
@@ -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"}
@@ -1,84 +1,85 @@
1
- import { jsx as t, jsxs as D, Fragment as C } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as E, Fragment as u } from "react/jsx-runtime";
2
2
  import { useMemo as d } from "react";
3
- import { ChartEmptyLabel as R } from "../CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js";
4
- import { useShimmerAnimation as q } from "../CartesianChart/hooks/useShimmerAnimation.js";
5
- import { chartConfig as h } from "../config.js";
6
- import { mergeDefaults as b, computeAxisPadding as z, canRenderLine as J, getChartAriaLabel as K, getChartDisplayStates as Q } from "./utils.js";
7
- import { CartesianChart as U } from "../CartesianChart/CartesianChart.js";
8
- import { LineChartEmptyState as V } from "./LineChartEmptyState/LineChartEmptyState.js";
9
- import { XAxis as X } from "../Axis/XAxis/XAxis.js";
10
- import { YAxis as Y } from "../Axis/YAxis/YAxis.js";
11
- import { Line as Z } from "../Line/Line.js";
12
- import { useTheme as _ } from "../../core/ThemeProvider/ThemeProvider.js";
13
- import { getContrastSafeColor as $ } from "../../../../libs/design-core/dist/lib/colorContrast/colorContrast.js";
14
- import { primitiveColorTokens as v } from "../../../../libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js";
15
- const N = {
3
+ import { ChartEmptyLabel as z } from "../CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js";
4
+ import { useShimmerAnimation as J } from "../CartesianChart/hooks/useShimmerAnimation.js";
5
+ import { chartConfig as C } from "../config.js";
6
+ import { mergeDefaults as v, computeAxisPadding as K, canRenderLine as Q, getChartAriaLabel as U, getChartDisplayStates as V } from "./utils.js";
7
+ import { useCommonTranslation as X } from "../../../../translations/translations.js";
8
+ import { CartesianChart as Y } from "../CartesianChart/CartesianChart.js";
9
+ import { LineChartEmptyState as Z } from "./LineChartEmptyState/LineChartEmptyState.js";
10
+ import { XAxis as _ } from "../Axis/XAxis/XAxis.js";
11
+ import { YAxis as $ } from "../Axis/YAxis/YAxis.js";
12
+ import { Line as N } from "../Line/Line.js";
13
+ import { useTheme as tt } from "../../core/ThemeProvider/ThemeProvider.js";
14
+ import { getContrastSafeColor as ot } from "../../../../libs/design-core/dist/lib/colorContrast/colorContrast.js";
15
+ import { primitiveColorTokens as D } from "../../../../libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js";
16
+ const et = {
16
17
  position: "bottom",
17
18
  showGrid: !1,
18
19
  showLine: !1,
19
20
  showTickMark: !1,
20
21
  scaleType: "linear",
21
22
  nice: !1
22
- }, tt = {
23
+ }, it = {
23
24
  position: "start",
24
25
  showGrid: !1,
25
26
  showLine: !1,
26
27
  showTickMark: !1,
27
28
  scaleType: "linear",
28
29
  nice: !0,
29
- width: h.axis.defaultWidth
30
- }, E = ({
30
+ width: C.axis.defaultWidth
31
+ }, M = ({
31
32
  series: e,
32
33
  showArea: r,
33
34
  areaType: s,
34
35
  connectNulls: a,
35
- stroke: o
36
- }) => /* @__PURE__ */ t(C, { children: e.map((i) => /* @__PURE__ */ t(
37
- Z,
36
+ stroke: i
37
+ }) => /* @__PURE__ */ t(u, { children: e.map((o) => /* @__PURE__ */ t(
38
+ N,
38
39
  {
39
- seriesId: i.id,
40
- stroke: o ?? i.stroke,
40
+ seriesId: o.id,
41
+ stroke: i ?? o.stroke,
41
42
  showArea: r,
42
43
  areaType: s,
43
44
  connectNulls: a
44
45
  },
45
- i.id
46
- )) }), it = ({
46
+ o.id
47
+ )) }), rt = ({
47
48
  series: e,
48
49
  showArea: r,
49
50
  areaType: s,
50
51
  connectNulls: a
51
52
  }) => {
52
- const { animationStyle: o, keyframe: i } = q();
53
- return /* @__PURE__ */ D(C, { children: [
54
- /* @__PURE__ */ t("style", { children: i }),
55
- /* @__PURE__ */ t("g", { style: { animation: o }, children: /* @__PURE__ */ t(
56
- E,
53
+ const { animationStyle: i, keyframe: o } = J();
54
+ return /* @__PURE__ */ E(u, { children: [
55
+ /* @__PURE__ */ t("style", { children: o }),
56
+ /* @__PURE__ */ t("g", { style: { animation: i }, children: /* @__PURE__ */ t(
57
+ M,
57
58
  {
58
59
  series: e,
59
60
  showArea: r,
60
61
  areaType: s,
61
62
  connectNulls: a,
62
- stroke: h.color.mutedLine
63
+ stroke: C.color.mutedLine
63
64
  }
64
65
  ) })
65
66
  ] });
66
- }, et = ({
67
+ }, st = ({
67
68
  series: e,
68
69
  showArea: r,
69
70
  areaType: s,
70
71
  connectNulls: a,
71
- showXAxis: o,
72
- showYAxis: i,
72
+ showXAxis: i,
73
+ showYAxis: o,
73
74
  xAxisConfig: n,
74
75
  yAxisConfig: m,
75
76
  isTransitionLoading: p,
76
- children: g
77
- }) => /* @__PURE__ */ D(C, { children: [
78
- o && /* @__PURE__ */ t(X, { ...n }),
79
- i && /* @__PURE__ */ t(Y, { ...m }),
77
+ children: h
78
+ }) => /* @__PURE__ */ E(u, { children: [
79
+ i && /* @__PURE__ */ t(_, { ...n }),
80
+ o && /* @__PURE__ */ t($, { ...m }),
80
81
  p ? /* @__PURE__ */ t(
81
- it,
82
+ rt,
82
83
  {
83
84
  series: e,
84
85
  showArea: r,
@@ -86,7 +87,7 @@ const N = {
86
87
  connectNulls: a
87
88
  }
88
89
  ) : /* @__PURE__ */ t(
89
- E,
90
+ M,
90
91
  {
91
92
  series: e,
92
93
  showArea: r,
@@ -94,88 +95,93 @@ const N = {
94
95
  connectNulls: a
95
96
  }
96
97
  ),
97
- g
98
+ h
98
99
  ] });
99
- function ut({
100
+ function xt({
100
101
  series: e,
101
102
  showArea: r = !1,
102
103
  areaType: s = "gradient",
103
104
  connectNulls: a,
104
- showXAxis: o = !1,
105
- showYAxis: i = !1,
105
+ showXAxis: i = !1,
106
+ showYAxis: o = !1,
106
107
  xAxis: n,
107
108
  yAxis: m,
108
109
  width: p = "100%",
109
- height: g = h.root.defaultHeight,
110
- inset: M,
111
- enableScrubbing: j,
112
- onScrubberPositionChange: G,
113
- animate: W,
114
- magnetRadius: B,
110
+ height: h = C.root.defaultHeight,
111
+ inset: j,
112
+ enableScrubbing: G,
113
+ onScrubberPositionChange: W,
114
+ animate: B,
115
+ magnetRadius: F,
115
116
  loading: L = !1,
116
- emptyLabel: k = h.emptyState.defaultLabel,
117
- enableColorContrast: x = !1,
118
- children: F
117
+ emptyLabel: H,
118
+ enableColorContrast: k = !1,
119
+ children: I
119
120
  }) {
120
- const { colorScheme: H } = _(), T = H === "dark" ? v.dark.grey["050"] : v.light.grey["050"], u = d(
121
+ const { t: x } = X(), { colorScheme: O } = tt(), b = O === "dark" ? D.dark.grey["050"] : D.light.grey["050"], g = d(
121
122
  () => e?.map((y) => ({
122
123
  ...y,
123
- ...y.stroke && x && {
124
- stroke: $(y.stroke, T)
124
+ ...y.stroke && k && {
125
+ stroke: ot(y.stroke, b)
125
126
  }
126
127
  })),
127
- [e, x, T]
128
+ [e, k, b]
128
129
  ), l = d(
129
- () => b(N, n),
130
+ () => v(et, n),
130
131
  [n]
131
132
  ), c = d(
132
- () => b(tt, m),
133
+ () => v(it, m),
133
134
  [m]
134
- ), A = l.position, S = c.position, P = c.width, I = d(
135
- () => z({
136
- showXAxis: o,
137
- showYAxis: i,
138
- xAxisPosition: A,
139
- yAxisPosition: S,
135
+ ), T = l.position, A = c.position, P = c.width, R = d(
136
+ () => K({
137
+ showXAxis: i,
138
+ showYAxis: o,
139
+ xAxisPosition: T,
140
+ yAxisPosition: A,
140
141
  yAxisWidth: P
141
142
  }),
142
- [o, i, A, S, P]
143
- ), w = J(u, l.data), f = Q({ loading: L, hasData: w }), O = K({ loading: L, hasData: w, emptyLabel: k });
143
+ [i, o, T, A, P]
144
+ ), S = Q(g, l.data), f = V({ loading: L, hasData: S }), w = H ?? x("components.chart.emptyLabel"), q = U({
145
+ loading: L,
146
+ hasData: S,
147
+ emptyLabel: w,
148
+ loadingLabel: x("components.chart.loadingAriaLabel")
149
+ });
144
150
  return /* @__PURE__ */ t(
145
- U,
151
+ Y,
146
152
  {
147
- series: u ?? [],
153
+ series: g ?? [],
148
154
  xAxis: l,
149
155
  yAxis: c,
150
156
  width: p,
151
- height: g,
152
- inset: M,
153
- axisPadding: I,
154
- enableScrubbing: j,
155
- onScrubberPositionChange: G,
156
- animate: W,
157
- magnetRadius: B,
158
- ariaLabel: O,
157
+ height: h,
158
+ inset: j,
159
+ axisPadding: R,
160
+ enableScrubbing: G,
161
+ onScrubberPositionChange: W,
162
+ animate: B,
163
+ magnetRadius: F,
164
+ ariaLabel: q,
159
165
  ariaBusy: L,
160
- overlay: f.showEmptyOverlay ? /* @__PURE__ */ t(R, { children: k }) : void 0,
161
- children: f.showPlaceholder ? /* @__PURE__ */ t(V, { loading: f.placeholderLoading }) : /* @__PURE__ */ t(
162
- et,
166
+ overlay: f.showEmptyOverlay ? /* @__PURE__ */ t(z, { children: w }) : void 0,
167
+ children: f.showPlaceholder ? /* @__PURE__ */ t(Z, { loading: f.placeholderLoading }) : /* @__PURE__ */ t(
168
+ st,
163
169
  {
164
- series: u ?? [],
170
+ series: g ?? [],
165
171
  showArea: r,
166
172
  areaType: s,
167
173
  connectNulls: a,
168
- showXAxis: o,
169
- showYAxis: i,
174
+ showXAxis: i,
175
+ showYAxis: o,
170
176
  xAxisConfig: l,
171
177
  yAxisConfig: c,
172
178
  isTransitionLoading: f.isTransitionLoading,
173
- children: F
179
+ children: I
174
180
  }
175
181
  )
176
182
  }
177
183
  );
178
184
  }
179
185
  export {
180
- ut as LineChart
186
+ xt as LineChart
181
187
  };
@@ -50,7 +50,7 @@ export type LineChartProps = LineRenderOptions & Pick<CartesianChartProps, 'widt
50
50
  /**
51
51
  * Text shown in the centre of the chart when there is no data and the chart
52
52
  * is not loading.
53
- * @default 'No data'
53
+ * @default 'No data' (translated)
54
54
  */
55
55
  emptyLabel?: string;
56
56
  /**
@@ -31,10 +31,11 @@ export declare const getChartDisplayStates: ({ loading, hasData, }: {
31
31
  * Accessibility label matching the chart's current state: the loading label
32
32
  * while loading, the empty label when there is nothing to draw, otherwise none.
33
33
  */
34
- export declare const getChartAriaLabel: ({ loading, hasData, emptyLabel, }: {
34
+ export declare const getChartAriaLabel: ({ loading, hasData, emptyLabel, loadingLabel, }: {
35
35
  loading: boolean;
36
36
  hasData: boolean;
37
37
  emptyLabel: string;
38
+ loadingLabel: string;
38
39
  }) => string | undefined;
39
40
  /**
40
41
  * Whether any series has at least `emptyState.minDrawablePoints` finite points,
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/utils.ts"],"names":[],"mappings":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Number as d } from "../utils/numbers.js";
3
- const { axis: l, emptyState: c } = f, g = ({
1
+ import { chartConfig as c } from "../config.js";
2
+ import { isFiniteNumber as f } from "../utils/numbers.js";
3
+ const { axis: a, emptyState: u } = c, g = ({
4
4
  showXAxis: e,
5
5
  showYAxis: t,
6
- xAxisPosition: r,
7
- yAxisPosition: n,
6
+ xAxisPosition: n,
7
+ yAxisPosition: r,
8
8
  yAxisWidth: o
9
9
  }) => {
10
10
  if (!e && !t)
11
11
  return;
12
- const i = o ?? l.defaultWidth;
12
+ const i = o ?? a.defaultWidth;
13
13
  return {
14
- top: e && r === "top" ? l.defaultHeight : 0,
15
- bottom: e && r === "bottom" ? l.defaultHeight : 0,
16
- left: t && n === "start" ? i : 0,
17
- right: t && n === "end" ? i : 0
14
+ top: e && n === "top" ? a.defaultHeight : 0,
15
+ bottom: e && n === "bottom" ? a.defaultHeight : 0,
16
+ left: t && r === "start" ? i : 0,
17
+ right: t && r === "end" ? i : 0
18
18
  };
19
19
  }, s = ({
20
20
  loading: e,
@@ -27,26 +27,27 @@ const { axis: l, emptyState: c } = f, g = ({
27
27
  }), p = ({
28
28
  loading: e,
29
29
  hasData: t,
30
- emptyLabel: r
30
+ emptyLabel: n,
31
+ loadingLabel: r
31
32
  }) => {
32
33
  if (e)
33
- return c.loadingAriaLabel;
34
- if (!t)
35
34
  return r;
36
- }, h = (e, t) => (e ?? []).some((r) => {
37
- const n = r.data ?? [], o = t ? Math.min(n.length, t.length) : n.length;
35
+ if (!t)
36
+ return n;
37
+ }, h = (e, t) => (e ?? []).some((n) => {
38
+ const r = n.data ?? [], o = t ? Math.min(r.length, t.length) : r.length;
38
39
  let i = 0;
39
- for (let a = 0; a < o; a++)
40
- if (d(n[a]) && i++, i >= c.minDrawablePoints) return !0;
40
+ for (let l = 0; l < o; l++)
41
+ if (f(r[l]) && i++, i >= u.minDrawablePoints) return !0;
41
42
  return !1;
42
43
  }), b = (e, t) => {
43
44
  if (!t) return e;
44
- const r = { ...e };
45
- for (const n of Object.keys(t)) {
46
- const o = t[n];
47
- o !== void 0 && (r[n] = o);
45
+ const n = { ...e };
46
+ for (const r of Object.keys(t)) {
47
+ const o = t[r];
48
+ o !== void 0 && (n[r] = o);
48
49
  }
49
- return r;
50
+ return n;
50
51
  };
51
52
  export {
52
53
  h as canRenderLine,
@@ -84,8 +84,6 @@ export declare const chartConfig: {
84
84
  };
85
85
  readonly emptyState: {
86
86
  readonly minDrawablePoints: 2;
87
- readonly loadingAriaLabel: "Loading chart";
88
- readonly defaultLabel: "No data";
89
87
  readonly gridLineRatios: readonly [0.3, 0.5, 0.7];
90
88
  readonly placeholderViewWidth: 728;
91
89
  readonly placeholderViewHeight: 208;
@@ -135,7 +133,6 @@ export declare const chartConfig: {
135
133
  readonly durationInSeconds: 2;
136
134
  readonly minOpacity: 0.5;
137
135
  readonly easing: "cubic-bezier(0.4, 0, 0.6, 1)";
138
- readonly ariaLabel: "Loading donut chart";
139
136
  };
140
137
  readonly size: {
141
138
  readonly md: {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/visualization/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;8BAwBqC,UAAU;;;;;;;;;;;;;;;;;;;;;;;QA2BnE,yDAAyD;;;;;;;;;;;;;;QAezD,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8CpE,2EAA2E;;;;;QAE3E,wEAAwE;;;;YAItE,8EAA8E;;YAE9E;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/visualization/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;8BAwBqC,UAAU;;;;;;;;;;;;;;;;;;;;;;;QA2BnE,yDAAyD;;;;;;;;;;;;;;QAezD,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4CpE,2EAA2E;;;;;QAE3E,wEAAwE;;;;YAItE,8EAA8E;;YAE9E;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { cssVar as e } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
2
- const t = {
2
+ const a = {
3
3
  color: {
4
4
  stroke: e("var(--border-muted)"),
5
5
  gridLine: e("var(--border-muted-subtle-transparent)"),
@@ -79,8 +79,6 @@ const t = {
79
79
  },
80
80
  emptyState: {
81
81
  minDrawablePoints: 2,
82
- loadingAriaLabel: "Loading chart",
83
- defaultLabel: "No data",
84
82
  gridLineRatios: [0.3, 0.5, 0.7],
85
83
  placeholderViewWidth: 728,
86
84
  placeholderViewHeight: 208,
@@ -126,8 +124,7 @@ const t = {
126
124
  loading: {
127
125
  durationInSeconds: 2,
128
126
  minOpacity: 0.5,
129
- easing: "cubic-bezier(0.4, 0, 0.6, 1)",
130
- ariaLabel: "Loading donut chart"
127
+ easing: "cubic-bezier(0.4, 0, 0.6, 1)"
131
128
  },
132
129
  size: {
133
130
  md: {
@@ -152,5 +149,5 @@ const t = {
152
149
  }
153
150
  };
154
151
  export {
155
- t as chartConfig
152
+ a as chartConfig
156
153
  };