@pantheon-systems/pds-toolkit-react 2.0.0-beta.15 → 2.0.0-beta.17

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,19 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ import type { BaseChartProps } from '../shared/types';
3
+ import '../shared/chart-wrapper.css';
4
+ import './area-chart.css';
5
+ export type AreaChartVariant = 'overlapping' | 'stacked';
6
+ export type AreaChartLineStyle = 'smooth' | 'straight';
7
+ export interface AreaChartProps extends BaseChartProps, Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
8
+ /** Line curve style (default: 'smooth') */
9
+ lineStyle?: AreaChartLineStyle;
10
+ /** Area layout variant — stacked (default) sums series on top of each other, overlapping draws each series from the baseline */
11
+ variant?: AreaChartVariant;
12
+ }
13
+ /**
14
+ * AreaChart UI component
15
+ *
16
+ * Renders a responsive area chart with support for stacked or overlapping
17
+ * series, tooltips, and an accessible data table.
18
+ */
19
+ export declare const AreaChart: ({ chartHeight, chartWidth, className, colorPalette, data, isLoading, isThumbnail, labelStrings, legendVariant, lineStyle, onTimePeriodChange, selectedTimePeriod, series, showAccessibleTable, showAxisLines, showGrid, showLegend, showTooltip, timePeriodOptions, tooltipContent, variant, xAxisLabel, xAxisTickInterval, yAxisDomain, yAxisFormatter, yAxisLabel, yAxisTickInterval, ...props }: AreaChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export interface ScatterTableRow {
2
+ /** Point label, when the data provides one */
3
+ label?: string;
4
+ /** Series display name */
5
+ series: string;
6
+ /** Dot size value, when the data is size-driven */
7
+ size?: number;
8
+ /** Formatted X value */
9
+ x: string;
10
+ /** Formatted Y value */
11
+ y: string;
12
+ }
13
+ interface ScatterAccessibleTableProps {
14
+ /** Accessible description for the table */
15
+ description: string;
16
+ /** Header for the point label column, shown when any row has a label */
17
+ labelHeader: string;
18
+ /** Rows, one per data point */
19
+ rows: ScatterTableRow[];
20
+ /** Header for the size column, shown when any row has a size */
21
+ sizeHeader: string;
22
+ /** Header for the X column */
23
+ xHeader: string;
24
+ /** Header for the Y column */
25
+ yHeader: string;
26
+ }
27
+ /**
28
+ * Renders a visually-hidden HTML table containing scatter plot points
29
+ * for screen reader accessibility.
30
+ */
31
+ export declare const ScatterAccessibleTable: ({ description, labelHeader, rows, sizeHeader, xHeader, yHeader, }: ScatterAccessibleTableProps) => import("react/jsx-runtime").JSX.Element;
32
+ export {};
@@ -0,0 +1,59 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import type { BaseChartProps, ChartLabelStrings, SeriesConfig, YAxisDomain } from '../shared/types';
3
+ import '../shared/chart-wrapper.css';
4
+ import './scatter-plot.css';
5
+ export interface ScatterDataPoint {
6
+ /** Tooltip heading for this point */
7
+ label?: string;
8
+ /** Key of the series this point belongs to (matches `series[].dataKey`). Defaults to the first series. */
9
+ series?: string;
10
+ /** Value that drives the dot size. When any point sets it, dots scale between `sizeRange`. */
11
+ size?: number;
12
+ /** X value */
13
+ x: number;
14
+ /** Y value */
15
+ y: number;
16
+ }
17
+ export interface ScatterTooltipPayload {
18
+ /** Color of the hovered point's series */
19
+ color: string;
20
+ /** The hovered data point */
21
+ point: ScatterDataPoint;
22
+ /** Config of the hovered point's series */
23
+ series: SeriesConfig;
24
+ }
25
+ export interface ScatterPlotProps extends Omit<BaseChartProps, 'data' | 'isThumbnail' | 'labelStrings' | 'legendVariant' | 'onTimePeriodChange' | 'selectedTimePeriod' | 'showAccessibleTable' | 'showAxisLines' | 'showGrid' | 'showLegend' | 'showTooltip' | 'timePeriodOptions' | 'tooltipContent' | 'xAxisTickInterval'>, Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
26
+ /** Scatter plot points. Each point's `series` picks which series it belongs to. */
27
+ data: ScatterDataPoint[];
28
+ /** Dot diameter in pixels when no point sets `size` (default: 8) */
29
+ dotSize?: number;
30
+ /** Translatable UI strings. Provide overrides for i18n. */
31
+ labelStrings?: Omit<ChartLabelStrings, 'legendTableHeader'>;
32
+ /** Show accessible data table (visually hidden). Defaults to true. */
33
+ showAccessibleTable?: boolean;
34
+ /** Show axis baseline lines. Defaults to true. */
35
+ showAxisLines?: boolean;
36
+ /** Show grid lines. Defaults to true. */
37
+ showGrid?: boolean;
38
+ /** Show legend. Defaults to true. */
39
+ showLegend?: boolean;
40
+ /** Show tooltip on hover. Defaults to true. */
41
+ showTooltip?: boolean;
42
+ /** Name of the `size` value in the tooltip and accessible table (default: 'Size') */
43
+ sizeLabel?: string;
44
+ /** Min and max dot diameters in pixels when dots are sized by `size` (default: [6, 20]) */
45
+ sizeRange?: [number, number];
46
+ /** Custom tooltip renderer. Receives the hovered point and replaces the built-in tooltip. */
47
+ tooltipContent?: (payload: ScatterTooltipPayload) => ReactNode;
48
+ /** Override the X-axis scale bounds. Accepts a tuple of [min, max]. */
49
+ xAxisDomain?: YAxisDomain;
50
+ /** Custom X-axis tick formatter */
51
+ xAxisFormatter?: (value: number) => string;
52
+ }
53
+ /**
54
+ * ScatterPlot UI component
55
+ *
56
+ * Renders a responsive scatter plot for comparing two numeric variables, with
57
+ * optional series, data-driven dot sizes, tooltips, and an accessible data table.
58
+ */
59
+ export declare const ScatterPlot: ({ chartHeight, chartWidth, className, colorPalette, data, dotSize, isLoading, labelStrings, series, showAccessibleTable, showAxisLines, showGrid, showLegend, showTooltip, sizeLabel, sizeRange, tooltipContent, xAxisDomain, xAxisFormatter, xAxisLabel, yAxisDomain, yAxisFormatter, yAxisLabel, yAxisTickInterval, ...props }: ScatterPlotProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ interface ChartActiveDotProps {
2
+ /** Series color */
3
+ color: string;
4
+ /** Center x position, supplied by Recharts */
5
+ cx?: number;
6
+ /** Center y position, supplied by Recharts */
7
+ cy?: number;
8
+ /** Lighten the outline toward the surface color */
9
+ isTinted?: boolean;
10
+ }
11
+ /**
12
+ * Hover dot for line and area charts. The white ring separates the dot from
13
+ * a same-colored line or band, and the series-colored outline keeps the dot's
14
+ * edge visible against the white chart background.
15
+ */
16
+ export declare const ChartActiveDot: ({ color, cx, cy, isTinted, }: ChartActiveDotProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ChartDataPoint, SeriesConfig } from './types';
1
+ import type { ChartDataPoint, ColorPalette, SeriesConfig } from './types';
2
2
  import './chart-legend.css';
3
3
  export type LegendVariant = 'inline' | 'table';
4
4
  interface ChartLegendProps {
@@ -8,6 +8,8 @@ interface ChartLegendProps {
8
8
  * visible legend table purely a sighted-user convenience.
9
9
  */
10
10
  ariaHidden?: boolean;
11
+ /** Palette the series colors come from — needed to map `paletteIndex` onto palettes with fill-only steps removed */
12
+ colorPalette?: ColorPalette;
11
13
  /** Chart data — used to calculate totals for table variant */
12
14
  data?: ChartDataPoint[];
13
15
  /** Series definitions */
@@ -27,5 +29,5 @@ interface ChartLegendProps {
27
29
  * Renders a chart legend in either inline (horizontal list) or
28
30
  * table (rows with totals) format.
29
31
  */
30
- export declare const ChartLegend: ({ ariaHidden, data, series, seriesColors, tableHeader, valueFormatter, variant, }: ChartLegendProps) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const ChartLegend: ({ ariaHidden, colorPalette, data, series, seriesColors, tableHeader, valueFormatter, variant, }: ChartLegendProps) => import("react/jsx-runtime").JSX.Element;
31
33
  export {};
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generated by: npm run generate:icon-data
5
5
  * Source: icon-registry.ts + Font Awesome packages + custom-icons.tsx
6
- * Generated: 2026-10-30T00:48:37.600Z
6
+ * Generated: 2026-11-02T19:18:20.983Z
7
7
  */
8
8
  import { customIcons } from './custom-icons';
9
9
  export { customIcons };
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generated by: npm run generate:illustration-data
5
5
  * Source: illustration-registry.ts + illustrations/*.svg
6
- * Generated: 2026-10-30T00:48:38.188Z
6
+ * Generated: 2026-11-02T19:18:21.420Z
7
7
  */
8
8
  import React from 'react';
9
9
  export interface IllustrationData {
@@ -0,0 +1 @@
1
+ @layer pds-v1, pds-v2;@layer pds-v2{.pds-area-chart{font-family:var(--pds-typography-ff-default);position:relative;width:100%}.pds-area-chart__header{align-items:center;display:flex;justify-content:flex-end;margin-block-end:var(--pds-spacing-m)}.pds-area-chart--empty,.pds-area-chart--loading{align-items:center;display:flex;justify-content:center}}
@@ -2,7 +2,7 @@
2
2
  --pds-color-button-primary-background-hover
3
3
  );--button-background-color-active:var(
4
4
  --pds-color-button-primary-background-active
5
- );--button-foreground-color:var(--pds-color-button-primary-foreground);--button-foreground-color-hover:var(--button-foreground-color);--button-border-color:var(--pds-color-button-primary-background-default);--button-border-color-hover:var(--pds-color-button-primary-background-hover);--button-border-color-active:var(--button-background-color-active);--button-box-shadow-active:var(--pds-elevation-button-primary-active);align-items:center;background-color:var(--button-background-color);border-color:var(--button-border-color);border-radius:var(--pds-border-radius-button);border-style:solid;border-width:var(--pds-border-width-default);color:var(--button-foreground-color);cursor:pointer;display:inline-flex;font-family:var(--pds-typography-ff-default);font-size:var(--button-font-size);font-weight:var(--pds-typography-fw-medium);gap:var(--button-gap-inline);height:var(--button-height);justify-content:center;line-height:1;max-height:var(--button-height);padding-block:0;padding-inline:var(--button-padding-inline);text-decoration:none;transition:var(--pds-animation-transition-button);white-space:nowrap}.pds-button:has(>.pds-button__leading>.pds-button__working-indicator){padding-inline-start:calc(var(--button-padding-inline) - var(--pds-spacing-4xs))}.pds-button__working-indicator{margin-inline-end:var(--pds-spacing-4xs)}.pds-button__leading{display:contents}.pds-button:disabled{cursor:not-allowed;opacity:.4}.pds-button:hover:enabled,a.pds-button:hover{--button-background-color:var(--button-background-color-hover);--button-border-color:var(--button-border-color-hover);color:var(--button-foreground-color-hover);text-decoration:none}.pds-button:active:enabled,a.pds-button:active{--button-background-color:var(--button-background-color-active);--button-border-color:var(--button-border-color-active);box-shadow:var(--button-box-shadow-active);color:var(--button-foreground-color-hover);text-decoration:none}.pds-button:focus-visible{outline:var(--pds-border-width-outline) solid var(--pds-color-interactive-focus);outline-offset:1px;transition:var(--pds-animation-transition-focus)}.pds-button__icon,.pds-button__tally{flex-shrink:0}.pds-button--l .pds-button__icon:not(.pds-status-dot){height:var(--button-font-size);width:var(--button-font-size)}.pds-button--highlight .pds-button__tally,.pds-button--primary .pds-button__tally{box-shadow:0 0 0 1px hsla(0,0%,100%,.75)}.pds-button--xs .pds-status-dot{--dot-size:8px}.pds-button--s .pds-status-dot{--dot-size:10px}.pds-button--m .pds-status-dot{--dot-size:12px;margin-inline-end:2px}.pds-button--l .pds-status-dot{--dot-size:14px;margin-inline-end:4px}.pds-button--full-width{width:100%}.pds-button--xs{--button-font-size:var(--pds-typography-size-xs);--button-height:var(--pds-spacing-button-height-xs);--button-padding-inline:var(--pds-spacing-button-padding-inline-xs);--button-gap-inline:var(--pds-spacing-button-gap-inline-xs)}.pds-button--s{--button-font-size:var(--pds-typography-size-s);--button-height:var(--pds-spacing-button-height-s);--button-padding-inline:var(--pds-spacing-button-padding-inline-s);-button-gap-inline:var(--pds-spacing-button-gap-inline-s)}.pds-button--m{--button-font-size:var(--pds-typography-size-m);--button-height:var(--pds-spacing-button-height-m);--button-padding-inline:var(--pds-spacing-button-padding-inline-m);--button-gap-inline:var(--pds-spacing-button-gap-inline-m)}.pds-button--l{--button-font-size:var(--pds-typography-size-l);--button-height:var(--pds-spacing-button-height-l);--button-padding-inline:var(--pds-spacing-button-padding-inline-l);--button-gap-inline:var(--pds-spacing-button-gap-inline-l)}.pds-button--secondary{--button-background-color:var(
5
+ );--button-foreground-color:var(--pds-color-button-primary-foreground);--button-foreground-color-hover:var(--button-foreground-color);--button-border-color:var(--pds-color-button-primary-background-default);--button-border-color-hover:var(--pds-color-button-primary-background-hover);--button-border-color-active:var(--button-background-color-active);--button-box-shadow-active:var(--pds-elevation-button-primary-active);align-items:center;background-color:var(--button-background-color);border-color:var(--button-border-color);border-radius:var(--pds-border-radius-button);border-style:solid;border-width:var(--pds-border-width-default);color:var(--button-foreground-color);cursor:pointer;display:inline-flex;font-family:var(--pds-typography-ff-default);font-size:var(--button-font-size);font-weight:var(--pds-typography-fw-medium);gap:var(--button-gap-inline);height:var(--button-height);justify-content:center;line-height:1;max-height:var(--button-height);padding-block:0;padding-inline:var(--button-padding-inline);text-decoration:none;transition:var(--pds-animation-transition-button);white-space:nowrap}.pds-button:has(>.pds-button__leading>.pds-button__working-indicator){padding-inline-start:calc(var(--button-padding-inline) - var(--pds-spacing-4xs))}.pds-button__working-indicator{margin-inline-end:var(--pds-spacing-4xs)}.pds-button__leading{display:contents}.pds-button:disabled{cursor:not-allowed;opacity:.4}.pds-button:hover:enabled,a.pds-button:hover{--button-background-color:var(--button-background-color-hover);--button-border-color:var(--button-border-color-hover);color:var(--button-foreground-color-hover);text-decoration:none}.pds-button:active:enabled,a.pds-button:active{--button-background-color:var(--button-background-color-active);--button-border-color:var(--button-border-color-active);box-shadow:var(--button-box-shadow-active);color:var(--button-foreground-color-hover);text-decoration:none}.pds-button:focus-visible{outline:var(--pds-border-width-outline) solid var(--pds-color-interactive-focus);outline-offset:1px;transition:var(--pds-animation-transition-focus)}.pds-button__icon,.pds-button__tally{flex-shrink:0}.pds-button--l .pds-button__icon:not(.pds-status-dot){height:var(--button-font-size);width:var(--button-font-size)}.pds-button--highlight .pds-button__tally,.pds-button--primary .pds-button__tally{box-shadow:0 0 0 1px hsla(0,0%,100%,.75)}.pds-button--xs .pds-status-dot{--dot-size:8px}.pds-button--s .pds-status-dot{--dot-size:10px}.pds-button--m .pds-status-dot{--dot-size:12px;margin-inline-end:2px}.pds-button--l .pds-status-dot{--dot-size:14px;margin-inline-end:4px}.pds-button--full-width{width:100%}.pds-button--xs{--button-font-size:var(--pds-typography-size-xs);--button-height:var(--pds-spacing-button-height-xs);--button-padding-inline:var(--pds-spacing-button-padding-inline-xs);--button-gap-inline:var(--pds-spacing-button-gap-inline-xs)}.pds-button--s{--button-font-size:var(--pds-typography-size-s);--button-height:var(--pds-spacing-button-height-s);--button-padding-inline:var(--pds-spacing-button-padding-inline-s);--button-gap-inline:var(--pds-spacing-button-gap-inline-s)}.pds-button--m{--button-font-size:var(--pds-typography-size-m);--button-height:var(--pds-spacing-button-height-m);--button-padding-inline:var(--pds-spacing-button-padding-inline-m);--button-gap-inline:var(--pds-spacing-button-gap-inline-m)}.pds-button--l{--button-font-size:var(--pds-typography-size-l);--button-height:var(--pds-spacing-button-height-l);--button-padding-inline:var(--pds-spacing-button-padding-inline-l);--button-gap-inline:var(--pds-spacing-button-gap-inline-l)}.pds-button--secondary{--button-background-color:var(
6
6
  --pds-color-button-secondary-background-default
7
7
  );--button-background-color-hover:var(
8
8
  --pds-color-button-secondary-background-hover