@ledgerhq/react-ui 0.14.18-nightly.0 → 0.15.0-nightly.0

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 (57) hide show
  1. package/lib/cjs/components/asorted/Text/Text.stories.js.map +2 -2
  2. package/lib/cjs/components/form/Radio/RadioListElement.js.map +2 -2
  3. package/lib/cjs/components/index.js +0 -2
  4. package/lib/cjs/components/index.js.map +2 -2
  5. package/lib/cjs/components/layout/List/VerticalTimeline/TimelineItem.js.map +2 -2
  6. package/lib/components/Table/index.js.map +1 -1
  7. package/lib/components/Tag/index.js.map +1 -1
  8. package/lib/components/animations/GlitchText/index.js.map +1 -1
  9. package/lib/components/asorted/Icon/CryptoIcon.js.map +1 -1
  10. package/lib/components/asorted/Icon/Icon.js.map +1 -1
  11. package/lib/components/cta/Button/index.js.map +1 -1
  12. package/lib/components/cta/Link/index.d.ts +1 -39
  13. package/lib/components/form/BaseInput/index.d.ts +2 -36
  14. package/lib/components/form/BaseInput/index.js.map +1 -1
  15. package/lib/components/form/DropdownGeneric/index.js.map +1 -1
  16. package/lib/components/form/NumberInput/index.js.map +1 -1
  17. package/lib/components/form/Radio/RadioListElement.js.map +1 -1
  18. package/lib/components/form/SelectInput/Option.js.map +1 -1
  19. package/lib/components/form/SelectInput/VirtualMenuList.js.map +1 -1
  20. package/lib/components/form/SplitInput/index.js.map +1 -1
  21. package/lib/components/index.d.ts +0 -1
  22. package/lib/components/index.js +0 -1
  23. package/lib/components/index.js.map +1 -1
  24. package/lib/components/layout/Box/index.d.ts +1 -5
  25. package/lib/components/layout/Carousel/Footer/Pagination/utils.js.map +1 -1
  26. package/lib/components/layout/Drawer/index.js.map +1 -1
  27. package/lib/components/layout/List/VerticalTimeline/TimelineIndicator.js.map +1 -1
  28. package/lib/components/layout/List/VerticalTimeline/TimelineItem.js.map +1 -1
  29. package/lib/components/layout/Popin/index.js.map +1 -1
  30. package/lib/components/layout/Side/index.js.map +1 -1
  31. package/lib/components/message/Alert/index.js.map +1 -1
  32. package/lib/components/message/Tip/index.js.map +1 -1
  33. package/lib/components/message/Tooltip/index.js.map +1 -1
  34. package/lib/components/navigation/FlowStepper/index.js.map +1 -1
  35. package/lib/components/navigation/progress/Stepper/index.js.map +1 -1
  36. package/lib/components/styled.js.map +1 -1
  37. package/lib/components/tabs/Tabs/index.js.map +1 -1
  38. package/lib/styles/helpers.js.map +1 -1
  39. package/lib/styles/styled/fontFamily.js.map +1 -1
  40. package/package.json +3 -7
  41. package/lib/cjs/components/Chart/Chart.stories.js +0 -116
  42. package/lib/cjs/components/Chart/Chart.stories.js.map +0 -7
  43. package/lib/cjs/components/Chart/index.js +0 -150
  44. package/lib/cjs/components/Chart/index.js.map +0 -7
  45. package/lib/cjs/components/Chart/types.js +0 -17
  46. package/lib/cjs/components/Chart/types.js.map +0 -7
  47. package/lib/cjs/components/Chart/utils.js +0 -42
  48. package/lib/cjs/components/Chart/utils.js.map +0 -7
  49. package/lib/components/Chart/index.d.ts +0 -17
  50. package/lib/components/Chart/index.js +0 -125
  51. package/lib/components/Chart/index.js.map +0 -1
  52. package/lib/components/Chart/types.d.ts +0 -14
  53. package/lib/components/Chart/types.js +0 -2
  54. package/lib/components/Chart/types.js.map +0 -1
  55. package/lib/components/Chart/utils.d.ts +0 -19
  56. package/lib/components/Chart/utils.js +0 -30
  57. package/lib/components/Chart/utils.js.map +0 -1
@@ -1,125 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { useEffect, useMemo } from "react";
13
- import { Line, defaults } from "react-chartjs-2";
14
- import Color from "color";
15
- import { useTheme } from "styled-components";
16
- import "chartjs-adapter-moment";
17
- import { fontConfig, valueFormatter } from "./utils";
18
- /*
19
- ** Returns the correct config based on the variant
20
- */
21
- const getConfig = (variant, options) => {
22
- const config = {
23
- small: {
24
- gradient: { alpha: 0.3 },
25
- scales: { y: { display: false }, x: { display: false, type: "time" } },
26
- },
27
- default: {
28
- gradient: { alpha: 0.1 },
29
- scales: {
30
- y: {
31
- display: true,
32
- grid: {
33
- color: options.gridColor,
34
- borderDash: [4, 4],
35
- tickWidth: 0,
36
- tickLength: 18,
37
- // This is an hack to don't render a duplicate axis
38
- borderWidth: 0,
39
- },
40
- ticks: { callback: valueFormatter, labelOffset: -3 },
41
- },
42
- x: {
43
- display: true,
44
- grid: {
45
- color: options.gridColor,
46
- borderDash: [4, 4],
47
- tickWidth: 0,
48
- tickLength: 15,
49
- // Don't render a duplicate axis
50
- borderWidth: 0,
51
- },
52
- // always display first/last ticks
53
- bounds: "ticks",
54
- type: "time",
55
- // control how the tickers on the x-axis are formatted
56
- time: options.timeOptions,
57
- },
58
- },
59
- },
60
- };
61
- return config[variant];
62
- };
63
- const defaultValue = {
64
- variant: "default",
65
- valueKey: "value",
66
- timeOptions: { unit: "month", displayFormats: { month: "MMM." } },
67
- };
68
- /**
69
- * @remarks This component must have a parent that has only it as a child and it must be in relative position!
70
- * @privateRemarks Don't name this component "Chart", that will conflict with the Chart.js library cuz of the adapter
71
- */
72
- export default (_a) => {
73
- var { data, color, variant = defaultValue.variant, valueKey = defaultValue.valueKey, timeOptions = defaultValue.timeOptions } = _a, chartProps = __rest(_a, ["data", "color", "variant", "valueKey", "timeOptions"]);
74
- const theme = useTheme();
75
- const config = useMemo(() => getConfig(variant, { gridColor: theme.colors.neutral.c40, timeOptions }), [variant, theme.colors.neutral.c40, timeOptions]);
76
- // inject default font configuration at mount
77
- useEffect(() => {
78
- defaults.font = fontConfig;
79
- }, []);
80
- const chartData = useMemo(() => ({
81
- datasets: [
82
- {
83
- borderColor: color,
84
- borderWidth: 2,
85
- fill: "start",
86
- backgroundColor: (context) => {
87
- const chart = context.chart;
88
- const { ctx, chartArea } = chart;
89
- // This case happens on initial chart load
90
- if (!chartArea)
91
- return null;
92
- // Create gradient based on the props color
93
- const gradient = ctx.createLinearGradient(0, 0, 0, chartArea.height / 1.2);
94
- gradient.addColorStop(0, Color(color).alpha(config.gradient.alpha).string());
95
- gradient.addColorStop(1, Color(color).alpha(0.0).string());
96
- return gradient;
97
- },
98
- // prevent points rendering
99
- pointRadius: 0,
100
- pointHitRadius: 0,
101
- data: data.map(({ date: x, [`${valueKey}`]: y }) => ({ x, y })),
102
- },
103
- ],
104
- }),
105
- // eslint-disable-next-line react-hooks/exhaustive-deps
106
- [color, data, valueKey, variant]);
107
- const options = useMemo(() => ({
108
- // Responsive options use the parent element to create the canvas
109
- responsive: true,
110
- maintainAspectRatio: false,
111
- plugins: { tooltips: { enabled: false }, legend: { display: false } },
112
- animation: false,
113
- elements: {
114
- points: { radius: 0 },
115
- line: {
116
- // Bezier curve tension of the line. Set to 0 to draw straightlines.
117
- tension: 0.2,
118
- },
119
- },
120
- scales: config.scales,
121
- }), [config.scales]);
122
- // The redraw is needed to allow the chart to be updated with new value
123
- return React.createElement(Line, Object.assign({ data: chartData, options: options }, chartProps, { redraw: true }));
124
- };
125
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Chart/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAc,MAAM,iBAAiB,CAAC;AAE7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,wBAAwB,CAAC;AAGhC,O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F;QACD,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,EACF,CAAC,MAAM,CAAC,MAAM,CAAC,CACmB,CAAC;IAErC,uEAAuE;IACvE,OAAO,oBAAC,IAAI,kBAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,IAAM,UAAU,IAAE,MAAM,UAAG,CAAC;AAC5E,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export type Item = {
2
- date: Date;
3
- value?: number | string;
4
- } & {
5
- [key: string]: number | string;
6
- };
7
- type Unit = "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year";
8
- export type timeOptions = {
9
- unit?: Unit;
10
- displayFormats?: {
11
- [unit in Unit]?: string;
12
- };
13
- };
14
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Chart/types.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- /**
2
- * Returns the value fixed to 1 decimals when needed with his associated unit (e.g. "1.5K" or "1.5M")
3
- * @param value - Value displayed on the y-axis as a tick
4
- * @example
5
- * ```
6
- * valueFormatter(1500) // "1.5K"
7
- * valueFormatter(1567) // "1.5K"
8
- * valueFormatter(1567657) // "1.5M"
9
- * valueFormatter(156) // "156"
10
- * ```
11
- */
12
- export declare const valueFormatter: (value: string | number) => string;
13
- export declare const fontConfig: {
14
- family: string;
15
- size: number;
16
- weight: string;
17
- lineHeight: number;
18
- style: "normal" | "italic";
19
- };
@@ -1,30 +0,0 @@
1
- /**
2
- * Returns the value fixed to 1 decimals when needed with his associated unit (e.g. "1.5K" or "1.5M")
3
- * @param value - Value displayed on the y-axis as a tick
4
- * @example
5
- * ```
6
- * valueFormatter(1500) // "1.5K"
7
- * valueFormatter(1567) // "1.5K"
8
- * valueFormatter(1567657) // "1.5M"
9
- * valueFormatter(156) // "156"
10
- * ```
11
- */
12
- export const valueFormatter = (value) => {
13
- const breakpoints = [
14
- { value: 1e6, unit: "M" },
15
- { value: 1e3, unit: "K" },
16
- { value: 1, unit: "" },
17
- ];
18
- const formattedValue = typeof value === "number" ? value : parseFloat(value);
19
- const item = breakpoints.find(item => formattedValue >= item.value);
20
- return item ? `${(formattedValue / item.value).toFixed(1).replace(".0", "")} ${item.unit}` : "0";
21
- };
22
- // set default font configuration for the chart - I used ll-text_subTitle class from our theme
23
- export const fontConfig = {
24
- family: "Inter, Arial",
25
- size: 11,
26
- weight: "600",
27
- lineHeight: 1.21,
28
- style: "normal",
29
- };
30
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Chart/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAsB,EAAU,EAAE;IAC/D,MAAM,WAAW,GAAG;QAClB,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;QACzB,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE;QACzB,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;KACvB,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACnG,CAAC,CAAC;AAEF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,UAAU,GAMnB;IACF,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,QAAQ;CAChB,CAAC"}