@spscommerce/ds-react-charts 6.37.3 → 7.0.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/lib/bar/SpsBarChart.d.ts +14 -21
- package/lib/bar/SpsHorizontalBarChart.d.ts +15 -22
- package/lib/index.cjs.js +37 -39
- package/lib/index.es.js +8391 -17458
- package/lib/lineChart/SpsLineChart.d.ts +11 -14
- package/lib/prop-types.d.ts +2 -2
- package/lib/stackedHorizontalBarChart/SpsStackedHorizontalBarChart.d.ts +9 -12
- package/package.json +18 -20
- package/vite.config.js +6 -6
- package/lib/setup-jest.d.ts +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { ScaleConfig } from "@visx/scale";
|
|
3
3
|
import type { CommonProps, AxisScale } from "@visx/axis/lib/types";
|
|
4
4
|
import type { AxisScaleOutput } from "@visx/axis";
|
|
5
5
|
import type { GridProps } from "@visx/xychart/lib/components/grid/Grid";
|
|
6
6
|
import type { LineChartColors } from "@spscommerce/ds-shared";
|
|
7
|
-
import * as PropTypes from "../prop-types";
|
|
8
7
|
export interface LinesChartProps {
|
|
9
8
|
data: LineChartData[];
|
|
10
9
|
name: string;
|
|
@@ -15,21 +14,19 @@ export interface LineChartData {
|
|
|
15
14
|
x: number;
|
|
16
15
|
y: number;
|
|
17
16
|
}
|
|
18
|
-
declare const propTypes: {
|
|
19
|
-
barTooltip: PropTypes.Requireable<(props: LineTooltipProps) => JSX.Element>;
|
|
20
|
-
grid: PropTypes.Requireable<GridProps>;
|
|
21
|
-
labels: PropTypes.Validator<string[]>;
|
|
22
|
-
lines: PropTypes.Requireable<LinesChartProps[]>;
|
|
23
|
-
xAxis: PropTypes.Requireable<CommonProps<AxisScale<AxisScaleOutput>>>;
|
|
24
|
-
xScale: PropTypes.Validator<ScaleConfig<AxisScaleOutput, any, any>>;
|
|
25
|
-
yAxis: PropTypes.Requireable<CommonProps<AxisScale<AxisScaleOutput>>>;
|
|
26
|
-
yScale: PropTypes.Validator<ScaleConfig<AxisScaleOutput, any, any>>;
|
|
27
|
-
};
|
|
28
17
|
export interface LineTooltipProps {
|
|
29
18
|
yAxisName?: string;
|
|
30
19
|
xLineName?: string;
|
|
31
20
|
value?: number;
|
|
32
21
|
}
|
|
33
|
-
export declare type SpsLineChartProps =
|
|
22
|
+
export declare type SpsLineChartProps = React.PropsWithChildren<{
|
|
23
|
+
barTooltip?: (props: LineTooltipProps) => JSX.Element;
|
|
24
|
+
grid?: GridProps;
|
|
25
|
+
labels: string[];
|
|
26
|
+
lines?: LinesChartProps[];
|
|
27
|
+
xAxis?: CommonProps<AxisScale>;
|
|
28
|
+
xScale: ScaleConfig<AxisScaleOutput, any, any>;
|
|
29
|
+
yAxis?: CommonProps<AxisScale>;
|
|
30
|
+
yScale: ScaleConfig<AxisScaleOutput, any, any>;
|
|
31
|
+
}> & React.HTMLAttributes<HTMLDivElement>;
|
|
34
32
|
export declare function SpsLineChart(props: SpsLineChartProps): JSX.Element;
|
|
35
|
-
export {};
|
package/lib/prop-types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare function fun<T extends (...args: any[]) => any>(): PropTypes.Requ
|
|
|
7
7
|
export declare function impl<T>(): PropTypes.Requireable<T>;
|
|
8
8
|
export declare function ref<T>(): PropTypes.Requireable<MutableRefObject<T>>;
|
|
9
9
|
export declare type ReactNodeOrRenderFn = PropTypes.ReactNodeLike | (() => PropTypes.ReactNodeLike);
|
|
10
|
-
export declare const nodeOrRenderFn: PropTypes.Requireable<ReactNodeOrRenderFn
|
|
10
|
+
export declare const nodeOrRenderFn: PropTypes.Requireable<NonNullable<ReactNodeOrRenderFn>>;
|
|
11
11
|
export declare type TypeDoc = Record<string, string | {
|
|
12
12
|
type: string;
|
|
13
13
|
required?: boolean;
|
|
@@ -15,7 +15,7 @@ export declare type TypeDoc = Record<string, string | {
|
|
|
15
15
|
}>;
|
|
16
16
|
export declare type InferTS<T, K extends HTMLElement> = PropTypes.InferProps<T> & Omit<React.HTMLProps<K>, keyof T>;
|
|
17
17
|
export declare const spsGlobalPropTypes: {
|
|
18
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
18
|
+
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
19
19
|
className: PropTypes.Requireable<string>;
|
|
20
20
|
"data-testid": PropTypes.Requireable<string>;
|
|
21
21
|
unsafelyReplaceClassName: PropTypes.Requireable<string>;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { StackedBarChartMilestone } from "@spscommerce/ds-shared";
|
|
3
|
-
import * as PropTypes from "../prop-types";
|
|
4
|
-
declare const propTypes: {
|
|
5
|
-
chartData: PropTypes.Requireable<ChartDataProps[]>;
|
|
6
|
-
chartHeight: PropTypes.Requireable<number>;
|
|
7
|
-
chartWidth: PropTypes.Requireable<number>;
|
|
8
|
-
milestones: PropTypes.Requireable<MilestonesType[]>;
|
|
9
|
-
useAbsoluteLegend: PropTypes.Requireable<boolean>;
|
|
10
|
-
barTooltip: PropTypes.Requireable<(props: BarTooltipProps) => JSX.Element>;
|
|
11
|
-
};
|
|
12
3
|
export interface ChartDataProps {
|
|
13
4
|
label: string;
|
|
14
5
|
value: number;
|
|
@@ -24,6 +15,12 @@ export interface BarTooltipProps {
|
|
|
24
15
|
absoluteValue: number;
|
|
25
16
|
relativeValue: number;
|
|
26
17
|
}
|
|
27
|
-
export declare type SpsStackedHorizontalBarChartProps =
|
|
18
|
+
export declare type SpsStackedHorizontalBarChartProps = React.PropsWithChildren<{
|
|
19
|
+
chartData?: ChartDataProps[];
|
|
20
|
+
chartHeight?: number;
|
|
21
|
+
chartWidth?: number;
|
|
22
|
+
milestones?: MilestonesType[];
|
|
23
|
+
useAbsoluteLegend?: boolean;
|
|
24
|
+
barTooltip?: (props: BarTooltipProps) => JSX.Element;
|
|
25
|
+
}> & React.HTMLAttributes<HTMLDivElement>;
|
|
28
26
|
export declare function SpsStackedHorizontalBarChart(props: SpsStackedHorizontalBarChartProps): JSX.Element;
|
|
29
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react-charts",
|
|
3
3
|
"description": "SPS Design System React Chart components",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.1",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
-
"repository": "https://github.com/spscommerce/
|
|
8
|
-
"homepage": "https://github.com/spscommerce/
|
|
9
|
-
"main": "./lib/index.
|
|
7
|
+
"repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-react-charts",
|
|
8
|
+
"homepage": "https://github.com/spscommerce/woodland/tree/master/packages/@spscommerce/ds-react-charts#readme",
|
|
9
|
+
"main": "./lib/index.es.js",
|
|
10
10
|
"module": "./lib/index.es.js",
|
|
11
11
|
"types": "./lib/index.d.ts",
|
|
12
12
|
"publishConfig": {
|
|
@@ -27,27 +27,26 @@
|
|
|
27
27
|
"react-spring": "^8.0.27"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@spscommerce/ds-colors": "
|
|
31
|
-
"@spscommerce/ds-react": "
|
|
32
|
-
"@spscommerce/ds-shared": "
|
|
30
|
+
"@spscommerce/ds-colors": "7.0.1",
|
|
31
|
+
"@spscommerce/ds-react": "7.0.1",
|
|
32
|
+
"@spscommerce/ds-shared": "7.0.1",
|
|
33
33
|
"@spscommerce/utils": "^6.11.3",
|
|
34
|
-
"react": "^16.9.0"
|
|
34
|
+
"react": "^16.9.0",
|
|
35
|
+
"react-dom": "^16.9.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@spscommerce/ds-colors": "
|
|
38
|
-
"@spscommerce/ds-react": "
|
|
39
|
-
"@spscommerce/ds-shared": "
|
|
40
|
-
"@spscommerce/utils": "^6.
|
|
41
|
-
"@testing-library/
|
|
42
|
-
"@testing-library/react": "^9.3.2",
|
|
38
|
+
"@spscommerce/ds-colors": "7.0.1",
|
|
39
|
+
"@spscommerce/ds-react": "7.0.1",
|
|
40
|
+
"@spscommerce/ds-shared": "7.0.1",
|
|
41
|
+
"@spscommerce/utils": "^6.12.1",
|
|
42
|
+
"@testing-library/react": "^10.0.0",
|
|
43
43
|
"@types/prop-types": "^15.7.1",
|
|
44
|
-
"@types/react": "^16.9.0",
|
|
45
44
|
"axe-prop-types": "^1.0.9",
|
|
46
45
|
"clsx": "^1.0.3",
|
|
47
|
-
"expect": "^24.1.0",
|
|
48
46
|
"prop-types": "^15.7.2",
|
|
49
47
|
"react": "^16.9.0",
|
|
50
|
-
"
|
|
48
|
+
"react-dom": "^16.9.0",
|
|
49
|
+
"test": "7.0.1"
|
|
51
50
|
},
|
|
52
51
|
"scripts": {
|
|
53
52
|
"build": "pnpm run build:js && pnpm run build:types",
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
56
55
|
"watch": "vite build --watch",
|
|
57
56
|
"clean": "git clean -fdX",
|
|
58
|
-
"pub": "
|
|
59
|
-
}
|
|
60
|
-
"readme": "[//]: # \"START_AUTOGENERATED\"\n\n## [@spscommerce/ds-react-charts](https://github.com/spscommerce/ui-angular/tree/master/packages/@spscommerce/ds-react-charts#readme)\n\n\n\n\n\nSPS Design System React components \n \n ### Installation \n \n ```shell\nnpm install --save @spscommerce/ds-react-charts\n```\n\n#### Peer Dependencies\n\n<div class=\"row\">\n <div class=\"col-5\"> \n <table class=\"sps-table\">\n <thead class=\"sps-table__head\">\n <tr class=\"sps-table__row\">\n <th class=\"sps-table__header\">\n <span class=\"sps-table__header-cell-body\"> \n Package\n </span>\n </th>\n <th class=\"sps-table__header text-right\">\n <span class=\"sps-table__header-cell-body\"> \n Version\n </span>\n </th>\n </tr>\n </thead>\n <tbody class=\"sps-table__body\">\n <tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-colors#readme\">@spscommerce/ds-colors</a></td><td class=\"sps-table__cell text-right\">^1.1.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/utils#readme\">@spscommerce/utils</a></td><td class=\"sps-table__cell text-right\">^1.1.0</td></tr>\n<tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://reactjs.org/\">react</a></td><td class=\"sps-table__cell text-right\">^16.9.0</td></tr>\n </tbody>\n </table>\n </div>\n <div class=\"col-7\">\n \n </div>\n</div>\n\n[//]: # \"END_AUTOGENERATED\"\n"
|
|
57
|
+
"pub": "node ../../scripts/publish-package.js"
|
|
58
|
+
}
|
|
61
59
|
}
|
package/vite.config.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import path from
|
|
1
|
+
import path from "path";
|
|
2
2
|
|
|
3
|
-
import { defineConfig } from
|
|
3
|
+
import { defineConfig } from "vite";
|
|
4
4
|
|
|
5
|
-
import pkg from
|
|
5
|
+
import pkg from "./package.json";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
build: {
|
|
9
9
|
lib: {
|
|
10
|
-
entry: path.resolve(__dirname,
|
|
11
|
-
formats: [
|
|
10
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
11
|
+
formats: ["es", "cjs"],
|
|
12
12
|
fileName: (format) => `index.${format}.js`,
|
|
13
13
|
},
|
|
14
|
-
outDir: path.resolve(__dirname,
|
|
14
|
+
outDir: path.resolve(__dirname, "./lib"),
|
|
15
15
|
emptyOutDir: false,
|
|
16
16
|
rollupOptions: {
|
|
17
17
|
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
package/lib/setup-jest.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|