@spscommerce/ds-react-charts 0.0.0-20260319-8230915ce

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.
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import type { ScaleConfig } from "@visx/scale";
3
+ import type { CommonProps, AxisScale } from "@visx/axis/lib/types";
4
+ import type { AxisScaleOutput } from "@visx/axis";
5
+ import type { GridProps } from "@visx/xychart/lib/components/grid/Grid";
6
+ import type { LineChartColors } from "@spscommerce/ds-shared";
7
+ export interface LinesChartProps {
8
+ data: LineChartData[];
9
+ name: string;
10
+ color: LineChartColors;
11
+ strokeDashArray?: boolean;
12
+ }
13
+ export interface LineChartData {
14
+ x: number;
15
+ y: number;
16
+ }
17
+ export interface LineTooltipProps {
18
+ yAxisName?: string;
19
+ xLineName?: string;
20
+ value?: number;
21
+ }
22
+ export 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>;
32
+ export declare function SpsLineChart(props: SpsLineChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { DSReactExamples } from "@spscommerce/ds-shared";
2
+ export declare const SpsLineChartExamples: DSReactExamples;
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifest } from "@spscommerce/ds-shared";
2
+ export declare const MANIFEST: ComponentManifest;
@@ -0,0 +1,22 @@
1
+ import type { MutableRefObject, HTMLProps } from "react";
2
+ import * as PropTypes from "prop-types";
3
+ export type Deprecated<T> = PropTypes.Requireable<T>;
4
+ export declare function deprecated<T>(type: PropTypes.Requireable<T>): Deprecated<T>;
5
+ export declare function enumValue<T>(e: any): PropTypes.Requireable<T>;
6
+ export declare function fun<T extends (...args: any[]) => any>(): PropTypes.Requireable<T>;
7
+ export declare function impl<T>(): PropTypes.Requireable<T>;
8
+ export declare function ref<T>(): PropTypes.Requireable<MutableRefObject<T>>;
9
+ export type ReactNodeOrRenderFn = PropTypes.ReactNodeLike | (() => PropTypes.ReactNodeLike);
10
+ export declare const nodeOrRenderFn: PropTypes.Requireable<NonNullable<ReactNodeOrRenderFn>>;
11
+ export type TypeDoc = Record<string, string | {
12
+ type: string;
13
+ required?: boolean;
14
+ deprecated?: boolean;
15
+ }>;
16
+ export type InferTS<T, K extends HTMLElement> = PropTypes.InferProps<T> & Omit<HTMLProps<K>, keyof T>;
17
+ export declare const spsGlobalPropTypes: {
18
+ children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
19
+ className: PropTypes.Requireable<string>;
20
+ "data-testid": PropTypes.Requireable<string>;
21
+ unsafelyReplaceClassName: PropTypes.Requireable<string>;
22
+ };
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import type { StackedBarChartMilestone } from "@spscommerce/ds-shared";
3
+ export interface ChartDataProps {
4
+ label: string;
5
+ value: number;
6
+ color: string;
7
+ }
8
+ export interface MilestonesType {
9
+ label: string;
10
+ value: number;
11
+ color: StackedBarChartMilestone;
12
+ }
13
+ export interface BarTooltipProps {
14
+ label: string;
15
+ absoluteValue: number;
16
+ relativeValue: number;
17
+ }
18
+ export 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>;
26
+ export declare function SpsStackedHorizontalBarChart(props: SpsStackedHorizontalBarChartProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { DSReactExamples } from "@spscommerce/ds-shared";
2
+ export declare const SpsStackedHorizontalBarChartExamples: DSReactExamples;
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@spscommerce/ds-react-charts",
3
+ "description": "SPS Design System React Chart components",
4
+ "version": "0.0.0-20260319-8230915ce",
5
+ "author": "SPS Commerce",
6
+ "license": "UNLICENSED",
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
+ "type": "module",
10
+ "module": "./lib/index.js",
11
+ "main": "./lib/index.umd.cjs",
12
+ "types": "./lib/index.d.ts",
13
+ "exports": {
14
+ "types": "./lib/index.d.ts",
15
+ "require": "./lib/index.umd.cjs",
16
+ "import": "./lib/index.js",
17
+ "default": "./lib/index.js"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@juggle/resize-observer": "^3.3.1",
24
+ "@visx/axis": "^3.10.1",
25
+ "@visx/glyph": "^2.1.2",
26
+ "@visx/gradient": "^2.1.0",
27
+ "@visx/grid": "^3.5.0",
28
+ "@visx/group": "^2.1.0",
29
+ "@visx/legend": "^3.10.3",
30
+ "@visx/scale": "^3.5.0",
31
+ "@visx/shape": "^3.5.0",
32
+ "@visx/xychart": "^3.11.0",
33
+ "nanoid": "^5.1.5",
34
+ "react-spring": "^8.0.27"
35
+ },
36
+ "peerDependencies": {
37
+ "@spscommerce/utils": "^7.0.0 || ^8.0.0",
38
+ "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
39
+ "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
40
+ "@spscommerce/ds-colors": "0.0.0-20260319-8230915ce",
41
+ "@spscommerce/ds-react": "0.0.0-20260319-8230915ce",
42
+ "@spscommerce/ds-shared": "0.0.0-20260319-8230915ce"
43
+ },
44
+ "devDependencies": {
45
+ "@spscommerce/utils": "^8.1.1",
46
+ "@testing-library/react": "^12.0.0",
47
+ "@types/prop-types": "^15.7.1",
48
+ "axe-prop-types": "^1.0.9",
49
+ "clsx": "^2.1.1",
50
+ "prop-types": "^15.7.2",
51
+ "react": "^16.9.0",
52
+ "react-dom": "^16.9.0",
53
+ "@spscommerce/ds-colors": "0.0.0-20260319-8230915ce",
54
+ "@spscommerce/ds-react": "0.0.0-20260319-8230915ce",
55
+ "@spscommerce/ds-shared": "0.0.0-20260319-8230915ce",
56
+ "test": "0.0.0-20260319-8230915ce"
57
+ },
58
+ "scripts": {
59
+ "build": "pnpm run build:js && pnpm run build:types",
60
+ "build:js": "vite build",
61
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
62
+ "watch": "vite build --watch",
63
+ "clean": "git clean -fdX",
64
+ "pub": "node ../../scripts/publish-package.mjs"
65
+ }
66
+ }
@@ -0,0 +1,20 @@
1
+ import path from "node:path";
2
+
3
+ import { defineConfig } from "vite";
4
+
5
+ import pkg from "./package.json";
6
+
7
+ export default defineConfig({
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.ts"),
11
+ name: "DSReactCharts",
12
+ fileName: "index",
13
+ },
14
+ outDir: path.resolve(__dirname, "./lib"),
15
+ emptyOutDir: false,
16
+ rollupOptions: {
17
+ external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
18
+ },
19
+ },
20
+ });