@ledgerhq/lumen-ui-rnative-visualization 0.1.1
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.
- package/dist/module/index.js +5 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChart.js +36 -0
- package/dist/module/lib/Components/LineChart/LineChart.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChart.stories.js +15 -0
- package/dist/module/lib/Components/LineChart/LineChart.stories.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js +17 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/index.js +4 -0
- package/dist/module/lib/Components/LineChart/index.js.map +1 -0
- package/dist/module/lib/Components/index.js +4 -0
- package/dist/module/lib/Components/index.js.map +1 -0
- package/dist/module/lib/utils/index.js +4 -0
- package/dist/module/lib/utils/index.js.map +1 -0
- package/dist/module/lib/utils/math/index.js +4 -0
- package/dist/module/lib/utils/math/index.js.map +1 -0
- package/dist/module/lib/utils/types.js +2 -0
- package/dist/module/lib/utils/types.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/typescript/package.json +1 -0
- package/dist/typescript/src/index.d.ts +3 -0
- package/dist/typescript/src/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts +9 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/LineChart/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/utils/index.d.ts +2 -0
- package/dist/typescript/src/lib/utils/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/utils/math/index.d.ts +1 -0
- package/dist/typescript/src/lib/utils/math/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/utils/types.d.ts +11 -0
- package/dist/typescript/src/lib/utils/types.d.ts.map +1 -0
- package/package.json +68 -0
- package/src/index.ts +2 -0
- package/src/lib/Components/LineChart/LineChart.stories.tsx +17 -0
- package/src/lib/Components/LineChart/LineChart.test.tsx +10 -0
- package/src/lib/Components/LineChart/LineChart.tsx +38 -0
- package/src/lib/Components/LineChart/index.ts +1 -0
- package/src/lib/Components/index.ts +1 -0
- package/src/lib/utils/index.ts +1 -0
- package/src/lib/utils/math/index.ts +2 -0
- package/src/lib/utils/types.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,2BAAkB;AAChC,cAAc,sBAAa","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { Rect, Svg, Text as SvgText } from 'react-native-svg';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function LineChart({
|
|
7
|
+
series: _series,
|
|
8
|
+
width = 400,
|
|
9
|
+
height = 300
|
|
10
|
+
}) {
|
|
11
|
+
return /*#__PURE__*/_jsx(View, {
|
|
12
|
+
testID: "line-chart",
|
|
13
|
+
accessibilityRole: "image",
|
|
14
|
+
accessibilityLabel: "Line chart",
|
|
15
|
+
children: /*#__PURE__*/_jsxs(Svg, {
|
|
16
|
+
width: width,
|
|
17
|
+
height: height,
|
|
18
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
19
|
+
width: width,
|
|
20
|
+
height: height,
|
|
21
|
+
rx: 8,
|
|
22
|
+
fill: "#F3F0FA"
|
|
23
|
+
}), /*#__PURE__*/_jsx(SvgText, {
|
|
24
|
+
x: width / 2,
|
|
25
|
+
y: height / 2,
|
|
26
|
+
textAnchor: "middle",
|
|
27
|
+
alignmentBaseline: "central",
|
|
28
|
+
fill: "#7e4ea5",
|
|
29
|
+
fontSize: 14,
|
|
30
|
+
fontFamily: "Inter",
|
|
31
|
+
children: "LineChart placeholder"
|
|
32
|
+
})]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=LineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Rect","Svg","Text","SvgText","jsx","_jsx","jsxs","_jsxs","LineChart","series","_series","width","height","testID","accessibilityRole","accessibilityLabel","children","rx","fill","x","y","textAnchor","alignmentBaseline","fontSize","fontFamily"],"sourceRoot":"../../../../../src","sources":["lib/Components/LineChart/LineChart.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,IAAIC,OAAO,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS9D,OAAO,SAASC,SAASA,CAAC;EACxBC,MAAM,EAAEC,OAAO;EACfC,KAAK,GAAG,GAAG;EACXC,MAAM,GAAG;AACK,CAAC,EAAE;EACjB,oBACEP,IAAA,CAACN,IAAI;IACHc,MAAM,EAAC,YAAY;IACnBC,iBAAiB,EAAC,OAAO;IACzBC,kBAAkB,EAAC,YAAY;IAAAC,QAAA,eAE/BT,KAAA,CAACN,GAAG;MAACU,KAAK,EAAEA,KAAM;MAACC,MAAM,EAAEA,MAAO;MAAAI,QAAA,gBAChCX,IAAA,CAACL,IAAI;QAACW,KAAK,EAAEA,KAAM;QAACC,MAAM,EAAEA,MAAO;QAACK,EAAE,EAAE,CAAE;QAACC,IAAI,EAAC;MAAS,CAAE,CAAC,eAC5Db,IAAA,CAACF,OAAO;QACNgB,CAAC,EAAER,KAAK,GAAG,CAAE;QACbS,CAAC,EAAER,MAAM,GAAG,CAAE;QACdS,UAAU,EAAC,QAAQ;QACnBC,iBAAiB,EAAC,SAAS;QAC3BJ,IAAI,EAAC,SAAS;QACdK,QAAQ,EAAE,EAAG;QACbC,UAAU,EAAC,OAAO;QAAAR,QAAA,EACnB;MAED,CAAS,CAAC;IAAA,CACP;EAAC,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { LineChart } from "./LineChart.js";
|
|
4
|
+
const meta = {
|
|
5
|
+
component: LineChart,
|
|
6
|
+
title: 'Visualization/LineChart',
|
|
7
|
+
tags: ['experimental']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Base = {
|
|
11
|
+
args: {
|
|
12
|
+
series: []
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=LineChart.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LineChart","meta","component","title","tags","Base","args","series"],"sourceRoot":"../../../../../src","sources":["lib/Components/LineChart/LineChart.stories.tsx"],"mappings":";;AACA,SAASA,SAAS,QAAQ,gBAAa;AAEvC,MAAMC,IAA4B,GAAG;EACnCC,SAAS,EAAEF,SAAS;EACpBG,KAAK,EAAE,yBAAyB;EAChCC,IAAI,EAAE,CAAC,cAAc;AACvB,CAAC;AAED,eAAeH,IAAI;AAGnB,OAAO,MAAMI,IAAW,GAAG;EACzBC,IAAI,EAAE;IACJC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { describe, it, expect } from '@jest/globals';
|
|
4
|
+
import { render } from '@testing-library/react-native';
|
|
5
|
+
import { LineChart } from "./LineChart.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
describe('LineChart', () => {
|
|
8
|
+
it('renders the chart container', () => {
|
|
9
|
+
const {
|
|
10
|
+
getByTestId
|
|
11
|
+
} = render(/*#__PURE__*/_jsx(LineChart, {
|
|
12
|
+
series: []
|
|
13
|
+
}));
|
|
14
|
+
expect(getByTestId('line-chart')).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=LineChart.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","it","expect","render","LineChart","jsx","_jsx","getByTestId","series","toBeTruthy"],"sourceRoot":"../../../../../src","sources":["lib/Components/LineChart/LineChart.test.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,eAAe;AACpD,SAASC,MAAM,QAAQ,+BAA+B;AACtD,SAASC,SAAS,QAAQ,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExCN,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1BC,EAAE,CAAC,6BAA6B,EAAE,MAAM;IACtC,MAAM;MAAEM;IAAY,CAAC,GAAGJ,MAAM,cAACG,IAAA,CAACF,SAAS;MAACI,MAAM,EAAE;IAAG,CAAE,CAAC,CAAC;IACzDN,MAAM,CAACK,WAAW,CAAC,YAAY,CAAC,CAAC,CAACE,UAAU,CAAC,CAAC;EAChD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LineChart"],"sourceRoot":"../../../../../src","sources":["lib/Components/LineChart/index.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/Components/index.ts"],"mappings":";;AAAA,cAAc,sBAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/utils/index.ts"],"mappings":";;AAAA,cAAc,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["lib/utils/math/index.ts"],"mappings":"AAAA;AACA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/utils/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Series } from '../../utils';
|
|
2
|
+
type LineChartProps = {
|
|
3
|
+
series: Series[];
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function LineChart({ series: _series, width, height, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,MAAM,EAAE,OAAO,EACf,KAAW,EACX,MAAY,GACb,EAAE,cAAc,2CAuBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/math/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ledgerhq/lumen-ui-rnative-visualization",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react-native",
|
|
8
|
+
"ui",
|
|
9
|
+
"visualization",
|
|
10
|
+
"charts",
|
|
11
|
+
"design-system",
|
|
12
|
+
"mobile"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"react-native": "./src/index.ts",
|
|
16
|
+
"main": "./dist/module/index.js",
|
|
17
|
+
"module": "./dist/module/index.js",
|
|
18
|
+
"types": "./dist/typescript/src/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"react-native": "./src/index.ts",
|
|
23
|
+
"types": "./dist/typescript/src/index.d.ts",
|
|
24
|
+
"import": "./dist/module/index.js",
|
|
25
|
+
"default": "./dist/module/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"src",
|
|
31
|
+
"!**/*.tsbuildinfo"
|
|
32
|
+
],
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^19.0.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@types/react": "^19.0.0",
|
|
38
|
+
"@ledgerhq/lumen-design-core": "0.1.10",
|
|
39
|
+
"react": "^19.0.0",
|
|
40
|
+
"react-native": "~0.79.7",
|
|
41
|
+
"react-native-svg": "^15.0.0"
|
|
42
|
+
},
|
|
43
|
+
"nx": {
|
|
44
|
+
"tags": [
|
|
45
|
+
"scope:react-native",
|
|
46
|
+
"type:ui"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"react-native-builder-bob": {
|
|
50
|
+
"source": "src",
|
|
51
|
+
"output": "dist",
|
|
52
|
+
"targets": [
|
|
53
|
+
[
|
|
54
|
+
"module",
|
|
55
|
+
{
|
|
56
|
+
"esm": true,
|
|
57
|
+
"configFile": "./babel.config.bob.cjs"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"typescript",
|
|
62
|
+
{
|
|
63
|
+
"project": "tsconfig.lib.json"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
+
import { LineChart } from './LineChart';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof LineChart> = {
|
|
5
|
+
component: LineChart,
|
|
6
|
+
title: 'Visualization/LineChart',
|
|
7
|
+
tags: ['experimental'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Base: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
series: [],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
import { render } from '@testing-library/react-native';
|
|
3
|
+
import { LineChart } from './LineChart';
|
|
4
|
+
|
|
5
|
+
describe('LineChart', () => {
|
|
6
|
+
it('renders the chart container', () => {
|
|
7
|
+
const { getByTestId } = render(<LineChart series={[]} />);
|
|
8
|
+
expect(getByTestId('line-chart')).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import { Rect, Svg, Text as SvgText } from 'react-native-svg';
|
|
3
|
+
import type { Series } from '../../utils';
|
|
4
|
+
|
|
5
|
+
type LineChartProps = {
|
|
6
|
+
series: Series[];
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function LineChart({
|
|
12
|
+
series: _series,
|
|
13
|
+
width = 400,
|
|
14
|
+
height = 300,
|
|
15
|
+
}: LineChartProps) {
|
|
16
|
+
return (
|
|
17
|
+
<View
|
|
18
|
+
testID='line-chart'
|
|
19
|
+
accessibilityRole='image'
|
|
20
|
+
accessibilityLabel='Line chart'
|
|
21
|
+
>
|
|
22
|
+
<Svg width={width} height={height}>
|
|
23
|
+
<Rect width={width} height={height} rx={8} fill='#F3F0FA' />
|
|
24
|
+
<SvgText
|
|
25
|
+
x={width / 2}
|
|
26
|
+
y={height / 2}
|
|
27
|
+
textAnchor='middle'
|
|
28
|
+
alignmentBaseline='central'
|
|
29
|
+
fill='#7e4ea5'
|
|
30
|
+
fontSize={14}
|
|
31
|
+
fontFamily='Inter'
|
|
32
|
+
>
|
|
33
|
+
LineChart placeholder
|
|
34
|
+
</SvgText>
|
|
35
|
+
</Svg>
|
|
36
|
+
</View>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LineChart } from './LineChart';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LineChart';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|