@taiv/ui 1.10.8 → 1.10.10
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/components/Data/Chart/Chart.d.ts +9 -3
- package/dist/components/Data/Chart/Chart.d.ts.map +1 -1
- package/dist/components/Data/Chart/Chart.js +14 -2
- package/dist/components/Data/Chart/Chart.stories.d.ts +17 -0
- package/dist/components/Data/Chart/Chart.stories.d.ts.map +1 -0
- package/dist/components/Data/Chart/Chart.stories.js +192 -0
- package/dist/components/Misc/Skeleton/Skeleton.d.ts +5 -0
- package/dist/components/Misc/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Misc/Skeleton/Skeleton.js +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/types/types.d.ts +5 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/charts.d.ts +3 -8
- package/dist/utils/charts.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { formats } from '../../../constants/data';
|
|
3
|
-
import { ChartSeries } from '../../../types/types';
|
|
3
|
+
import { ChartFormatOptions, ChartSeries } from '../../../types/types';
|
|
4
|
+
type ChartFormat = keyof typeof formats;
|
|
5
|
+
interface AxisFormat {
|
|
6
|
+
format: ChartFormat;
|
|
7
|
+
options?: ChartFormatOptions;
|
|
8
|
+
}
|
|
4
9
|
export interface ChartProps {
|
|
5
10
|
series: ChartSeries[];
|
|
6
|
-
yAxisFormat?:
|
|
7
|
-
xAxisFormat?:
|
|
11
|
+
yAxisFormat?: ChartFormat | AxisFormat;
|
|
12
|
+
xAxisFormat?: ChartFormat | AxisFormat;
|
|
8
13
|
height?: string | number;
|
|
9
14
|
showLegend?: boolean;
|
|
10
15
|
loading?: boolean;
|
|
11
16
|
}
|
|
12
17
|
export declare const Chart: React.FC<ChartProps>;
|
|
18
|
+
export {};
|
|
13
19
|
//# sourceMappingURL=Chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIlD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,KAAK,WAAW,GAAG,MAAM,OAAO,OAAO,CAAC;AAExC,UAAU,UAAU;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwLtC,CAAC"}
|
|
@@ -10,8 +10,20 @@ import { fontStyle } from '../../../constants/font';
|
|
|
10
10
|
import { primary, neutral } from '../../../constants/colors';
|
|
11
11
|
import { createStyles } from '@mantine/core';
|
|
12
12
|
export const Chart = ({ series, yAxisFormat = 'decimal', xAxisFormat = 'string', showLegend = true, loading = false, height = '100%' }) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const parseFormat = (format) => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (typeof format === 'string') {
|
|
16
|
+
return { format: format, options: {} };
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
format: format.format,
|
|
20
|
+
options: (_a = format.options) !== null && _a !== void 0 ? _a : {}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const parsedYAxis = parseFormat(yAxisFormat);
|
|
24
|
+
const parsedXAxis = parseFormat(xAxisFormat);
|
|
25
|
+
const formatYAxisValue = getChartFormatter(parsedYAxis.format, parsedYAxis.options);
|
|
26
|
+
const formatXAxisValue = getChartFormatter(parsedXAxis.format, parsedXAxis.options);
|
|
15
27
|
const hasData = series.some((s) => s.data.length > 0);
|
|
16
28
|
// Transform our ChartSeries array to match the Recharts format (just a singular data array keyed by the series name)
|
|
17
29
|
const transformedData = (() => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import type { ChartProps } from "./Chart";
|
|
3
|
+
declare const meta: Meta<ChartProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<ChartProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const SeriesTypes: Story;
|
|
8
|
+
export declare const MultiSeries: Story;
|
|
9
|
+
export declare const MixedBarAndLine: Story;
|
|
10
|
+
export declare const YAxisFormats: Story;
|
|
11
|
+
export declare const YAxisDecimalPlaces: Story;
|
|
12
|
+
export declare const YAxisTruncation: Story;
|
|
13
|
+
export declare const XAxisNumericFormats: Story;
|
|
14
|
+
export declare const WithoutLegend: Story;
|
|
15
|
+
export declare const Loading: Story;
|
|
16
|
+
export declare const Empty: Story;
|
|
17
|
+
//# sourceMappingURL=Chart.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA8D1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA0D1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAmBhC,CAAC;AAgBF,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC;AAgBF,eAAO,MAAM,mBAAmB,EAAE,KAuCjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { formats } from "../../../constants/data";
|
|
3
|
+
import { primary, success, warning } from "../../../constants/colors";
|
|
4
|
+
import { Box } from "../../Layout/Box/Box";
|
|
5
|
+
import { Group } from "../../Layout/Group/Group";
|
|
6
|
+
import { Stack } from "../../Layout/Stack/Stack";
|
|
7
|
+
import { Chart } from "./Chart";
|
|
8
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"];
|
|
9
|
+
const sampleLineSeries = [
|
|
10
|
+
{
|
|
11
|
+
name: "Units sold",
|
|
12
|
+
type: "line",
|
|
13
|
+
data: months.map((m, i) => ({ key: m, value: 100 + i * 25 })),
|
|
14
|
+
color: primary[200],
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
const sampleAreaSeries = [
|
|
18
|
+
{
|
|
19
|
+
name: "Revenue",
|
|
20
|
+
type: "area",
|
|
21
|
+
data: months.map((m, i) => ({ key: m, value: 1200 + i * 180 })),
|
|
22
|
+
color: primary[200],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
const sampleBarSeries = [
|
|
26
|
+
{
|
|
27
|
+
name: "Orders",
|
|
28
|
+
type: "bar",
|
|
29
|
+
data: months.map((m, i) => ({ key: m, value: 42 + i * 8 })),
|
|
30
|
+
color: success[200],
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const sampleMultiSeries = [
|
|
34
|
+
{
|
|
35
|
+
name: "Product A",
|
|
36
|
+
type: "line",
|
|
37
|
+
data: months.map((m, i) => ({ key: m, value: 120 + i * 20 })),
|
|
38
|
+
color: primary[200],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "Product B",
|
|
42
|
+
type: "line",
|
|
43
|
+
data: months.map((m, i) => ({ key: m, value: 80 + i * 15 })),
|
|
44
|
+
color: success[200],
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const sampleMixedSeries = [
|
|
48
|
+
{
|
|
49
|
+
name: "Actuals",
|
|
50
|
+
type: "bar",
|
|
51
|
+
data: months.map((m, i) => ({ key: m, value: 55 + i * 6 })),
|
|
52
|
+
color: primary[200],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Target",
|
|
56
|
+
type: "line",
|
|
57
|
+
data: months.map((m, i) => ({ key: m, value: 50 + i * 7 })),
|
|
58
|
+
color: warning[200],
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
const meta = {
|
|
62
|
+
title: "Components/Data/Chart",
|
|
63
|
+
component: Chart,
|
|
64
|
+
parameters: {
|
|
65
|
+
layout: "padded",
|
|
66
|
+
docs: {
|
|
67
|
+
description: {
|
|
68
|
+
component: "A composed chart (line, area, bar) built on Recharts with shared X/Y axes, tooltips, and optional legend. `yAxisFormat` and `xAxisFormat` accept either a `formats` key string (e.g. `'currency'`) or `{ format, options? }` for `decimalPlaces` / `truncateAt`; the chart normalizes both via an internal `parseFormat` before calling `getChartFormatter`.",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
argTypes: {
|
|
73
|
+
series: {
|
|
74
|
+
control: { type: "object" },
|
|
75
|
+
description: "ChartSeries[] — each series: name, data (DataPoint[]), optional color and type (line | area | bar)",
|
|
76
|
+
table: { type: { summary: "ChartSeries[]" } },
|
|
77
|
+
},
|
|
78
|
+
yAxisFormat: {
|
|
79
|
+
control: { type: "select" },
|
|
80
|
+
options: Object.keys(formats),
|
|
81
|
+
description: "Format key string (default formatting) or pass `{ format, options }` in code for `decimalPlaces` / `truncateAt`. Tooltip values use the Y formatter.",
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: "ChartFormat | AxisFormat" },
|
|
84
|
+
defaultValue: { summary: "'decimal'" },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
xAxisFormat: {
|
|
88
|
+
control: { type: "select" },
|
|
89
|
+
options: Object.keys(formats),
|
|
90
|
+
description: "Format key string or `{ format, options }`. Use `string` for categorical X keys; numeric `formats` when keys parse as numbers.",
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: "ChartFormat | AxisFormat" },
|
|
93
|
+
defaultValue: { summary: "'string'" },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
height: {
|
|
97
|
+
control: { type: "text" },
|
|
98
|
+
description: "Chart height (CSS length or number)",
|
|
99
|
+
table: {
|
|
100
|
+
type: { summary: "string | number" },
|
|
101
|
+
defaultValue: { summary: "'100%'" },
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
showLegend: {
|
|
105
|
+
control: { type: "boolean" },
|
|
106
|
+
description: "Show Recharts legend below the chart",
|
|
107
|
+
table: { defaultValue: { summary: "true" } },
|
|
108
|
+
},
|
|
109
|
+
loading: {
|
|
110
|
+
control: { type: "boolean" },
|
|
111
|
+
description: "Placeholder state while data is loading",
|
|
112
|
+
table: { defaultValue: { summary: "false" } },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
export default meta;
|
|
117
|
+
export const Default = {
|
|
118
|
+
args: {
|
|
119
|
+
series: sampleLineSeries,
|
|
120
|
+
yAxisFormat: "decimal",
|
|
121
|
+
xAxisFormat: "string",
|
|
122
|
+
height: "100%",
|
|
123
|
+
showLegend: true,
|
|
124
|
+
loading: false,
|
|
125
|
+
},
|
|
126
|
+
render: (args) => (_jsx(Box, { w: "100%", maw: 720, h: 360, children: _jsx(Chart, { ...args }) })),
|
|
127
|
+
};
|
|
128
|
+
export const SeriesTypes = {
|
|
129
|
+
render: () => (_jsxs(Stack, { gap: "2.4rem", children: [_jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: "integer" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleAreaSeries, height: "100%", yAxisFormat: "currency" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleBarSeries, height: "100%", yAxisFormat: "integer" }) })] })),
|
|
130
|
+
};
|
|
131
|
+
export const MultiSeries = {
|
|
132
|
+
render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMultiSeries, height: "100%", yAxisFormat: "decimal" }) })),
|
|
133
|
+
};
|
|
134
|
+
export const MixedBarAndLine = {
|
|
135
|
+
render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMixedSeries, height: "100%", yAxisFormat: "integer" }) })),
|
|
136
|
+
};
|
|
137
|
+
export const YAxisFormats = {
|
|
138
|
+
render: () => (_jsx(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: ["integer", "decimal", "currency", "percentage", "multiple"].map((fmt) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: fmt, showLegend: false }) }, fmt))) })),
|
|
139
|
+
};
|
|
140
|
+
export const YAxisDecimalPlaces = {
|
|
141
|
+
render: () => (_jsx(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [1, 2, 3].map((dp) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: { format: "decimal", options: { decimalPlaces: dp } }, showLegend: false }) }, dp))) })),
|
|
142
|
+
};
|
|
143
|
+
const largeValueSeries = [
|
|
144
|
+
{
|
|
145
|
+
name: "Volume",
|
|
146
|
+
type: "line",
|
|
147
|
+
data: [
|
|
148
|
+
{ key: "Q1", value: 850 },
|
|
149
|
+
{ key: "Q2", value: 4200 },
|
|
150
|
+
{ key: "Q3", value: 1550000 },
|
|
151
|
+
{ key: "Q4", value: 2100000 },
|
|
152
|
+
],
|
|
153
|
+
color: primary[200],
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
export const YAxisTruncation = {
|
|
157
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
|
|
158
|
+
format: "decimal",
|
|
159
|
+
options: { truncateAt: "thousand" },
|
|
160
|
+
}, showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
|
|
161
|
+
format: "decimal",
|
|
162
|
+
options: { truncateAt: "million" },
|
|
163
|
+
}, showLegend: false }) })] })),
|
|
164
|
+
};
|
|
165
|
+
const numericKeySeries = [
|
|
166
|
+
{
|
|
167
|
+
name: "Score",
|
|
168
|
+
type: "bar",
|
|
169
|
+
data: [
|
|
170
|
+
{ key: "1000", value: 12 },
|
|
171
|
+
{ key: "2500", value: 24 },
|
|
172
|
+
{ key: "5000", value: 18 },
|
|
173
|
+
{ key: "10000", value: 30 },
|
|
174
|
+
],
|
|
175
|
+
color: success[200],
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
export const XAxisNumericFormats = {
|
|
179
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: "integer", yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: { format: "currency", options: { decimalPlaces: 0 } }, yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: {
|
|
180
|
+
format: "decimal",
|
|
181
|
+
options: { truncateAt: "thousand" },
|
|
182
|
+
}, yAxisFormat: "integer", showLegend: false }) })] })),
|
|
183
|
+
};
|
|
184
|
+
export const WithoutLegend = {
|
|
185
|
+
render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: sampleMultiSeries, height: "100%", showLegend: false }) })),
|
|
186
|
+
};
|
|
187
|
+
export const Loading = {
|
|
188
|
+
render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", loading: true }) })),
|
|
189
|
+
};
|
|
190
|
+
export const Empty = {
|
|
191
|
+
render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: [{ name: "Empty", data: [], color: primary[200] }], height: "100%" }) })),
|
|
192
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SkeletonProps as MantineSkeletonProps } from "@mantine/core";
|
|
2
|
+
export interface SkeletonProps extends MantineSkeletonProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const Skeleton: ({ ...props }: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Skeleton/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,aAAa,IAAI,oBAAoB,EAC1C,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,aAAc,SAAQ,oBAAoB;CAAG;AAE9D,eAAO,MAAM,QAAQ,GAAI,cAAc,aAAa,4CAEnD,CAAC"}
|
|
@@ -58,4 +58,5 @@ export { Formula } from './Typography/Formula/Formula';
|
|
|
58
58
|
export { Transition } from './Misc/Transition/Transition';
|
|
59
59
|
export { IconBadge } from './Misc/IconBadge/IconBadge';
|
|
60
60
|
export { LoadingOverlay } from './Misc/LoadingOverlay/LoadingOverlay';
|
|
61
|
+
export { Skeleton } from './Misc/Skeleton/Skeleton';
|
|
61
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC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E,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -63,3 +63,4 @@ export { Formula } from './Typography/Formula/Formula';
|
|
|
63
63
|
export { Transition } from './Misc/Transition/Transition';
|
|
64
64
|
export { IconBadge } from './Misc/IconBadge/IconBadge';
|
|
65
65
|
export { LoadingOverlay } from './Misc/LoadingOverlay/LoadingOverlay';
|
|
66
|
+
export { Skeleton } from './Misc/Skeleton/Skeleton';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { truncation } from "../constants";
|
|
1
2
|
export type SelectOption = {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
@@ -17,4 +18,8 @@ export type ChartSeries = {
|
|
|
17
18
|
color?: string;
|
|
18
19
|
type?: 'line' | 'area' | 'bar';
|
|
19
20
|
};
|
|
21
|
+
export type ChartFormatOptions = {
|
|
22
|
+
truncateAt?: keyof typeof truncation;
|
|
23
|
+
decimalPlaces?: number;
|
|
24
|
+
};
|
|
20
25
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;CAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA"}
|
package/dist/utils/charts.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { formats
|
|
2
|
-
import { DataPoint } from '../types/types';
|
|
3
|
-
|
|
4
|
-
truncateAt?: keyof typeof truncation;
|
|
5
|
-
decimalPlaces?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const getChartFormatter: (format: keyof typeof formats, options?: FormatOptions) => ((value: string | number) => string);
|
|
1
|
+
import { formats } from '../constants/data';
|
|
2
|
+
import { ChartFormatOptions, DataPoint } from '../types/types';
|
|
3
|
+
export declare const getChartFormatter: (format: keyof typeof formats, options?: ChartFormatOptions) => ((value: string | number) => string);
|
|
8
4
|
export declare const aggregateDataByDate: (data: DataPoint[]) => {
|
|
9
5
|
key: string;
|
|
10
6
|
value: number;
|
|
11
7
|
}[];
|
|
12
|
-
export {};
|
|
13
8
|
//# sourceMappingURL=charts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/utils/charts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/utils/charts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA6B,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAe/D,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,OAAO,OAAO,EAAE,UAAU,kBAAkB,KAAG,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAajI,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,EAAE;;;GAmBpD,CAAC"}
|