@pantheon-systems/pds-toolkit-react 2.0.0-alpha.10 → 2.0.0-alpha.12
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/Dropdown/Dropdown.d.ts +140 -0
- package/dist/components/Dropdown/DropdownSelectedIcon.d.ts +7 -0
- package/dist/components/Popover/Popover.d.ts +5 -1
- package/dist/components/Table/Table.d.ts +9 -18
- package/dist/components/buttons/IconButton/IconButton.d.ts +4 -0
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +1 -0
- package/dist/components/charts/BarChart/BarChart.d.ts +21 -0
- package/dist/components/charts/LineChart/LineChart.d.ts +22 -0
- package/dist/components/charts/shared/ChartAccessibleTable.d.ts +17 -0
- package/dist/components/charts/shared/ChartLegend.d.ts +25 -0
- package/dist/components/charts/shared/chart-colors.d.ts +18 -0
- package/dist/components/charts/shared/chart-styles.d.ts +16 -0
- package/dist/components/charts/shared/formatters.d.ts +12 -0
- package/dist/components/charts/shared/types.d.ts +97 -0
- package/dist/components/icons/Icon/generated-icon-data.d.ts +1 -1
- package/dist/components/inputs/Combobox/Combobox.d.ts +16 -6
- package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +9 -4
- package/dist/components/inputs/Select/Select.d.ts +6 -1
- package/dist/components/inputs/input-utilities.d.ts +1 -0
- package/dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/components/navigation/{NavMenu/NavMenu.d.ts → SiteMenu/SiteMenu.d.ts} +5 -4
- package/dist/components/navigation/SiteMenu/SiteMenuDropdown.d.ts +26 -0
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +1 -0
- package/dist/css/component-css/pds-bar-chart.css +1 -0
- package/dist/css/component-css/pds-breadcrumb.css +1 -1
- package/dist/css/component-css/pds-chart-legend.css +1 -0
- package/dist/css/component-css/pds-chart-tokens.css +1 -0
- package/dist/css/component-css/pds-chart-wrapper.css +1 -0
- package/dist/css/component-css/pds-combobox-multiselect.css +4 -2
- package/dist/css/component-css/pds-combobox.css +1 -1
- package/dist/css/component-css/pds-dropdown-menu.css +2 -2
- package/dist/css/component-css/pds-dropdown.css +2 -0
- package/dist/css/component-css/pds-icon-button.css +2 -2
- package/dist/css/component-css/pds-index.css +19 -16
- package/dist/css/component-css/pds-input-utilities.css +1 -1
- package/dist/css/component-css/pds-line-chart.css +1 -0
- package/dist/css/component-css/pds-menu-button.css +1 -1
- package/dist/css/component-css/pds-nav-menu.css +2 -2
- package/dist/css/component-css/pds-pantheon-logo.css +1 -1
- package/dist/css/component-css/pds-popover.css +1 -1
- package/dist/css/component-css/pds-select.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +6 -6
- package/dist/css/component-css/pds-table.css +1 -1
- package/dist/css/component-css/pds-text-input.css +1 -1
- package/dist/css/component-css/pds-textarea.css +1 -1
- package/dist/css/component-css/pds-tooltip.css +1 -1
- package/dist/css/component-css/pds-workspace-selector.css +1 -1
- package/dist/css/design-tokens/variables.dark.css +11 -2
- package/dist/css/design-tokens/variables.light.css +11 -2
- package/dist/css/layout-css/pds-app-layout.css +2 -2
- package/dist/css/layout-css/pds-index.css +2 -2
- package/dist/css/pds-components.css +19 -16
- package/dist/css/pds-core.css +2 -2
- package/dist/css/pds-layouts.css +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +4724 -2359
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +6 -1
- package/dist/layouts/AppLayout/AppLayout.d.ts +5 -1
- package/dist/utilities/hooks/useDropdown/index.d.ts +1 -0
- package/dist/utilities/hooks/useDropdown/useDropdown.d.ts +121 -0
- package/package.json +4 -3
- package/dist/components/navigation/NavMenu/NavMenuDropdown.d.ts +0 -24
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { UseDropdownOptions } from '../../utilities/hooks/useDropdown';
|
|
3
|
+
import './dropdown.css';
|
|
4
|
+
export interface DropdownProps extends UseDropdownOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Dropdown sub-components (Trigger, Panel, etc.).
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Additional class names for the root wrapper.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Use inline-block display instead of block.
|
|
15
|
+
* Useful when the dropdown trigger should size to its content
|
|
16
|
+
* (e.g., UserMenu, MenuButton) rather than fill the parent width.
|
|
17
|
+
*/
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Root Dropdown component. Provides dropdown context to sub-components.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Dropdown: {
|
|
24
|
+
({ children, className, inline, ...options }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
Trigger: ({ children, className, showTriggerIcon, ...props }: DropdownTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
Panel: ({ children, className, ...props }: DropdownPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
Item: ({ children, className, description, disabled, icon, index, isActive, isCritical, onClick, trailingIcon, ...props }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Heading: ({ children, className, ...props }: DropdownHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
Separator: ({ className, ...props }: DropdownSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
Filter: ({ className, filterIcon, label, noResultsText, onFilterChange, placeholder, showNoResults, ...props }: DropdownFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
export interface DropdownTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
33
|
+
/**
|
|
34
|
+
* Trigger content (label text, icon, etc.).
|
|
35
|
+
*/
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Additional class names.
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Show a directional icon on the trigger that indicates the dropdown can be expanded.
|
|
43
|
+
*/
|
|
44
|
+
showTriggerIcon?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface DropdownPanelProps extends ComponentPropsWithoutRef<'ul'> {
|
|
47
|
+
/**
|
|
48
|
+
* Panel content (Items, Headings, Separators, Filter, etc.).
|
|
49
|
+
*/
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Additional class names.
|
|
53
|
+
*/
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface DropdownItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
57
|
+
/**
|
|
58
|
+
* Item content — label text, or a link element for navigation items.
|
|
59
|
+
*/
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Additional class names.
|
|
63
|
+
*/
|
|
64
|
+
className?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Secondary text displayed below the label.
|
|
67
|
+
*/
|
|
68
|
+
description?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Disabled state.
|
|
71
|
+
*/
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Leading content — PDSIcon name, or custom ReactNode (Avatar, etc.).
|
|
75
|
+
*/
|
|
76
|
+
icon?: ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* Index of this item in the list (required for keyboard navigation).
|
|
79
|
+
*/
|
|
80
|
+
index: number;
|
|
81
|
+
/**
|
|
82
|
+
* Selected or current state.
|
|
83
|
+
*/
|
|
84
|
+
isActive?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Destructive action styling.
|
|
87
|
+
*/
|
|
88
|
+
isCritical?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Trailing content — check icon, lock icon, or custom ReactNode.
|
|
91
|
+
*/
|
|
92
|
+
trailingIcon?: ReactNode;
|
|
93
|
+
}
|
|
94
|
+
export interface DropdownHeadingProps extends ComponentPropsWithoutRef<'li'> {
|
|
95
|
+
/**
|
|
96
|
+
* Heading text.
|
|
97
|
+
*/
|
|
98
|
+
children?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Additional class names.
|
|
101
|
+
*/
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DropdownSeparatorProps extends ComponentPropsWithoutRef<'li'> {
|
|
105
|
+
/**
|
|
106
|
+
* Additional class names.
|
|
107
|
+
*/
|
|
108
|
+
className?: string;
|
|
109
|
+
}
|
|
110
|
+
export type DropdownFilterIcon = 'filter' | 'none' | 'search';
|
|
111
|
+
export interface DropdownFilterProps extends ComponentPropsWithoutRef<'li'> {
|
|
112
|
+
/**
|
|
113
|
+
* Additional class names.
|
|
114
|
+
*/
|
|
115
|
+
className?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Icon to display inside the filter input.
|
|
118
|
+
*/
|
|
119
|
+
filterIcon?: DropdownFilterIcon;
|
|
120
|
+
/**
|
|
121
|
+
* Label for the filter input (screen readers).
|
|
122
|
+
*/
|
|
123
|
+
label?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Text shown when no items match the filter.
|
|
126
|
+
*/
|
|
127
|
+
noResultsText?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Callback when the filter value changes.
|
|
130
|
+
*/
|
|
131
|
+
onFilterChange?: (value: string) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Placeholder text for the filter input.
|
|
134
|
+
*/
|
|
135
|
+
placeholder?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Whether to show the "no results" message.
|
|
138
|
+
*/
|
|
139
|
+
showNoResults?: boolean;
|
|
140
|
+
}
|
|
@@ -58,8 +58,12 @@ export interface PopoverProps extends Omit<ComponentPropsWithoutRef<'div'>, 'con
|
|
|
58
58
|
* The icon to use as the trigger.
|
|
59
59
|
*/
|
|
60
60
|
triggerIcon?: 'circleInfo' | 'circleQuestion';
|
|
61
|
+
/**
|
|
62
|
+
* Size of the trigger icon. Uses PDS Icon sizing.
|
|
63
|
+
*/
|
|
64
|
+
triggerIconSize?: 's' | 'm' | 'l';
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
67
|
* Popover UI component
|
|
64
68
|
*/
|
|
65
|
-
export declare const Popover: ({ className, classNameContainer, closeButtonLabel, content, customTrigger, hasCloseButton, offsetValue, onClose, placement, popoverIsOpen, setPopoverIsOpen, title, triggerAccessibleText, triggerIcon, ...props }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export declare const Popover: ({ className, classNameContainer, closeButtonLabel, content, customTrigger, hasCloseButton, offsetValue, onClose, placement, popoverIsOpen, setPopoverIsOpen, title, triggerAccessibleText, triggerIcon, triggerIconSize, ...props }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import './table.css';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
interface TableProps extends ComponentPropsWithoutRef<'table'> {
|
|
7
|
-
/**
|
|
8
|
-
* Additional class names
|
|
9
|
-
*/
|
|
3
|
+
export interface TableProps extends ComponentPropsWithoutRef<'table'> {
|
|
4
|
+
/** Additional class names */
|
|
10
5
|
className?: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
/** Column index (0-based) to sort by on initial render. */
|
|
7
|
+
defaultSortKey?: number;
|
|
8
|
+
/** Initial sort direction when defaultSortKey is set. Defaults to 'asc'. */
|
|
9
|
+
defaultSortOrder?: 'asc' | 'desc';
|
|
10
|
+
/** Table headers */
|
|
14
11
|
headers?: Array<{
|
|
15
12
|
sortable?: boolean;
|
|
16
13
|
title: ReactNode;
|
|
17
14
|
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Table row data - array of rows, where each row is an array of cell values
|
|
20
|
-
*/
|
|
15
|
+
/** Table row data - array of rows, where each row is an array of cell values */
|
|
21
16
|
rowData?: Array<Array<string | ReactNode>>;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
* Table UI component
|
|
25
|
-
*/
|
|
26
|
-
export declare const Table: ({ className, headers, rowData, ...props }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export {};
|
|
18
|
+
export declare const Table: ({ className, defaultSortKey, defaultSortOrder, headers, rowData, ...props }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,6 +20,10 @@ interface IconButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
20
20
|
* Is the button disabled?
|
|
21
21
|
*/
|
|
22
22
|
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Show a visible border around the button.
|
|
25
|
+
*/
|
|
26
|
+
hasBorder?: boolean;
|
|
23
27
|
/**
|
|
24
28
|
* Show tooltip on hover. If false, the title attribute will be used.
|
|
25
29
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import { ButtonVariant, HeadingItemType, LinkItemType, MenuItemType, NodeItemType, SeparatorItemType } from '../../../libs/types/custom-types';
|
|
3
3
|
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
4
|
+
import '@components/Dropdown/dropdown.css';
|
|
4
5
|
import './menu-button.css';
|
|
5
6
|
type MenuButtonSize = 's' | 'm';
|
|
6
7
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { BaseChartProps } from '../shared/types';
|
|
3
|
+
import '../shared/chart-wrapper.css';
|
|
4
|
+
import './bar-chart.css';
|
|
5
|
+
export type BarChartLayout = 'horizontal' | 'vertical';
|
|
6
|
+
export type BarChartVariant = 'grouped' | 'stacked';
|
|
7
|
+
export interface BarChartProps extends BaseChartProps, Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
8
|
+
/** Border radius on bars (default: 2) */
|
|
9
|
+
barRadius?: number;
|
|
10
|
+
/** Bar orientation — horizontal (default, bars go up) or vertical (bars go sideways) */
|
|
11
|
+
layout?: BarChartLayout;
|
|
12
|
+
/** Bar layout variant (default: 'stacked') */
|
|
13
|
+
variant?: BarChartVariant;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* BarChart UI component
|
|
17
|
+
*
|
|
18
|
+
* Renders a responsive bar chart with support for stacked or grouped layouts,
|
|
19
|
+
* multiple series, tooltips, and an accessible data table.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BarChart: ({ accessibleDescription, barRadius, chartHeight, chartWidth, className, colorPalette, data, emptyStateHeading, emptyStateMessage, isLoading, isThumbnail, layout, legendTableHeader, legendVariant, loadingLabel, onTimePeriodChange, selectedTimePeriod, series, showAccessibleTable, showAxisLines, showGrid, showLegend, showTooltip, timePeriodOptions, variant, xAxisLabel, yAxisFormatter, yAxisLabel, ...props }: BarChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { AnnotationConfig, BaseChartProps, ReferenceLineConfig } from '../shared/types';
|
|
3
|
+
import '../shared/chart-wrapper.css';
|
|
4
|
+
import './line-chart.css';
|
|
5
|
+
export type LineStyle = 'smooth' | 'straight';
|
|
6
|
+
export interface LineChartProps extends BaseChartProps, Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
7
|
+
/** Annotation markers (e.g., "TODAY") */
|
|
8
|
+
annotations?: AnnotationConfig[];
|
|
9
|
+
/** Line curve style (default: 'smooth') */
|
|
10
|
+
lineStyle?: LineStyle;
|
|
11
|
+
/** Reference lines (e.g., contract limit) */
|
|
12
|
+
referenceLines?: ReferenceLineConfig[];
|
|
13
|
+
/** Show data points on lines (default: true) */
|
|
14
|
+
showDataPoints?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* LineChart UI component
|
|
18
|
+
*
|
|
19
|
+
* Renders a responsive line chart with support for multiple series,
|
|
20
|
+
* reference lines, annotations, tooltips, and an accessible data table.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LineChart: ({ accessibleDescription, annotations, chartHeight, chartWidth, className, colorPalette, data, emptyStateHeading, emptyStateMessage, isLoading, isThumbnail, legendTableHeader, legendVariant, lineStyle, loadingLabel, onTimePeriodChange, referenceLines, selectedTimePeriod, series, showAccessibleTable, showAxisLines, showDataPoints, showGrid, showLegend, showTooltip, timePeriodOptions, xAxisLabel, yAxisFormatter, yAxisLabel, ...props }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChartDataPoint, SeriesConfig } from './types';
|
|
2
|
+
interface ChartAccessibleTableProps {
|
|
3
|
+
/** Chart data points */
|
|
4
|
+
data: ChartDataPoint[];
|
|
5
|
+
/** Accessible description for the table */
|
|
6
|
+
description: string;
|
|
7
|
+
/** Series definitions */
|
|
8
|
+
series: SeriesConfig[];
|
|
9
|
+
/** Optional value formatter */
|
|
10
|
+
valueFormatter?: (value: number) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders a visually-hidden HTML table containing chart data
|
|
14
|
+
* for screen reader accessibility.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ChartAccessibleTable: ({ data, description, series, valueFormatter, }: ChartAccessibleTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ChartDataPoint, SeriesConfig } from './types';
|
|
2
|
+
import './chart-legend.css';
|
|
3
|
+
export type LegendVariant = 'inline' | 'table';
|
|
4
|
+
interface ChartLegendProps {
|
|
5
|
+
/** Chart data — used to calculate totals for table variant */
|
|
6
|
+
data?: ChartDataPoint[];
|
|
7
|
+
/** Series definitions */
|
|
8
|
+
series: SeriesConfig[];
|
|
9
|
+
/** Colors resolved from tokens */
|
|
10
|
+
seriesColors: string[];
|
|
11
|
+
/** Table header for the totals column */
|
|
12
|
+
tableHeader?: string;
|
|
13
|
+
/** Formatter for total values in table variant */
|
|
14
|
+
valueFormatter?: (value: number) => string;
|
|
15
|
+
/** Legend display style (default: 'inline') */
|
|
16
|
+
variant?: LegendVariant;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* ChartLegend component
|
|
20
|
+
*
|
|
21
|
+
* Renders a chart legend in either inline (horizontal list) or
|
|
22
|
+
* table (rows with totals) format.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ChartLegend: ({ data, series, seriesColors, tableHeader, valueFormatter, variant, }: ChartLegendProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import type { ColorPalette } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get color for a series by index, cycling through palette if needed.
|
|
5
|
+
* Priority: customColor (hex) > paletteIndex (theme-aware) > auto-assigned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getSeriesColor: (index: number, palette: string[], customColor?: string, paletteIndex?: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve palette token colors from computed styles on an element.
|
|
10
|
+
* Falls back to hex values if tokens are not available.
|
|
11
|
+
*/
|
|
12
|
+
export declare const resolveTokenColors: (element: HTMLElement | null, paletteName: ColorPalette) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* Hook to resolve chart colors from design tokens at runtime.
|
|
15
|
+
* Falls back to hex values when tokens are not loaded (e.g., SSR).
|
|
16
|
+
* Re-resolves when the theme changes (via data-theme attribute).
|
|
17
|
+
*/
|
|
18
|
+
export declare const useChartColors: (containerRef: RefObject<HTMLElement | null>, paletteName?: ColorPalette) => string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Recharts style configuration using PDS design tokens.
|
|
3
|
+
* Keeps all chart styling in one place rather than split between CSS and JS.
|
|
4
|
+
*/
|
|
5
|
+
export declare const axisTickStyle: {
|
|
6
|
+
fill: string;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
fontSize: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const axisLabelStyle: {
|
|
11
|
+
fill: string;
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
fontSize: string;
|
|
14
|
+
fontWeight: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const gridStroke = "var(--pds-color-border-default)";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a number with K/M/B suffixes for chart axis labels.
|
|
3
|
+
*/
|
|
4
|
+
export declare const formatCompactNumber: (value: number) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Format a number with locale-aware thousand separators.
|
|
7
|
+
*/
|
|
8
|
+
export declare const formatLocaleNumber: (value: number) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Format a number as a percentage.
|
|
11
|
+
*/
|
|
12
|
+
export declare const formatPercent: (value: number) => string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export interface ChartDataPoint {
|
|
2
|
+
/** One or more numeric series values, keyed by series name */
|
|
3
|
+
[key: string]: number | string;
|
|
4
|
+
/** X-axis label */
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export type StrokeStyle = 'dashed' | 'solid';
|
|
8
|
+
export interface SeriesConfig {
|
|
9
|
+
/** Override default token color (CSS custom property or hex). Not theme-aware — use paletteIndex for theme-aware overrides. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Key matching a property in ChartDataPoint */
|
|
12
|
+
dataKey: string;
|
|
13
|
+
/** Display label for legend/tooltip */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Pick a specific color from the selected palette by position (1-based). Theme-aware — automatically adjusts for light/dark mode. */
|
|
16
|
+
paletteIndex?: number;
|
|
17
|
+
/** Line style (LineChart only) */
|
|
18
|
+
strokeStyle?: StrokeStyle;
|
|
19
|
+
}
|
|
20
|
+
export interface ReferenceLineConfig {
|
|
21
|
+
/** Color override */
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Display label */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Line style */
|
|
26
|
+
strokeStyle?: StrokeStyle;
|
|
27
|
+
/** Y-axis value where line appears */
|
|
28
|
+
value: number;
|
|
29
|
+
}
|
|
30
|
+
export interface AnnotationConfig {
|
|
31
|
+
/** X-axis label value to annotate */
|
|
32
|
+
atLabel: string;
|
|
33
|
+
/** Color override */
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Line style */
|
|
36
|
+
strokeStyle?: StrokeStyle;
|
|
37
|
+
/** Display text */
|
|
38
|
+
text: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TimePeriodOption {
|
|
41
|
+
/** Display label ("Last 30 Days") */
|
|
42
|
+
label: string;
|
|
43
|
+
/** Value identifier */
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
export type ColorPalette = 'alert' | 'brand' | 'categorical' | 'diverging' | 'sequential';
|
|
47
|
+
export type LegendVariant = 'inline' | 'table';
|
|
48
|
+
export interface BaseChartProps {
|
|
49
|
+
/** Accessible description for screen readers */
|
|
50
|
+
accessibleDescription?: string;
|
|
51
|
+
/** Height of the chart area in pixels. Does not include the legend, header, or accessible table. */
|
|
52
|
+
chartHeight?: number;
|
|
53
|
+
/** Maximum width of the chart component in pixels. The chart is responsive and will shrink within this constraint. */
|
|
54
|
+
chartWidth?: number;
|
|
55
|
+
/** Color palette to use for series colors (default: 'categorical') */
|
|
56
|
+
colorPalette?: ColorPalette;
|
|
57
|
+
/** Chart data points */
|
|
58
|
+
data: ChartDataPoint[];
|
|
59
|
+
/** Show empty state when data is empty */
|
|
60
|
+
emptyStateHeading?: string;
|
|
61
|
+
/** Empty state message */
|
|
62
|
+
emptyStateMessage?: string;
|
|
63
|
+
/** Show loading state */
|
|
64
|
+
isLoading?: boolean;
|
|
65
|
+
/** Thumbnail mode — hides grid, axes, legend, tooltips, and reduces chart height. Individual show* props can override. */
|
|
66
|
+
isThumbnail?: boolean;
|
|
67
|
+
/** Table header for the totals column when legendVariant is 'table' */
|
|
68
|
+
legendTableHeader?: string;
|
|
69
|
+
/** Legend display style (default: 'inline') */
|
|
70
|
+
legendVariant?: LegendVariant;
|
|
71
|
+
/** Loading label for screen readers */
|
|
72
|
+
loadingLabel?: string;
|
|
73
|
+
/** Callback when time period changes */
|
|
74
|
+
onTimePeriodChange?: (value: string) => void;
|
|
75
|
+
/** Currently selected time period */
|
|
76
|
+
selectedTimePeriod?: string;
|
|
77
|
+
/** Series definitions */
|
|
78
|
+
series: SeriesConfig[];
|
|
79
|
+
/** Show accessible data table (visually hidden, default: true) */
|
|
80
|
+
showAccessibleTable?: boolean;
|
|
81
|
+
/** Show axis baseline lines (default: true) */
|
|
82
|
+
showAxisLines?: boolean;
|
|
83
|
+
/** Show grid lines (default: true) */
|
|
84
|
+
showGrid?: boolean;
|
|
85
|
+
/** Show legend (default: true) */
|
|
86
|
+
showLegend?: boolean;
|
|
87
|
+
/** Show tooltip on hover (default: true) */
|
|
88
|
+
showTooltip?: boolean;
|
|
89
|
+
/** Time period options for built-in selector */
|
|
90
|
+
timePeriodOptions?: TimePeriodOption[];
|
|
91
|
+
/** X-axis label */
|
|
92
|
+
xAxisLabel?: string;
|
|
93
|
+
/** Custom Y-axis tick formatter */
|
|
94
|
+
yAxisFormatter?: (value: number) => string;
|
|
95
|
+
/** Y-axis label */
|
|
96
|
+
yAxisLabel?: string;
|
|
97
|
+
}
|
|
@@ -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-
|
|
6
|
+
* Generated: 2026-04-17T21:22:07.760Z
|
|
7
7
|
*/
|
|
8
8
|
import { customIcons } from './custom-icons';
|
|
9
9
|
export { customIcons };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { ChangeEvent, ComponentPropsWithoutRef,
|
|
1
|
+
import React, { ChangeEvent, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import { ValidationStatus } from '../../../libs/types/input-types';
|
|
3
3
|
import './combobox.css';
|
|
4
|
+
export type ComboboxSize = 's' | 'm' | 'l';
|
|
4
5
|
type LabelStrings = {
|
|
5
6
|
clearButton?: string;
|
|
6
7
|
inputInstructions?: string;
|
|
@@ -14,10 +15,15 @@ export type ComboboxOption = {
|
|
|
14
15
|
searchIndex?: string[];
|
|
15
16
|
value: string;
|
|
16
17
|
};
|
|
18
|
+
export type ComboboxOptionGroup = {
|
|
19
|
+
groupLabel: string;
|
|
20
|
+
options: ComboboxOption[];
|
|
21
|
+
};
|
|
22
|
+
export type ComboboxOptionsType = (ComboboxOption | ComboboxOptionGroup)[];
|
|
17
23
|
/**
|
|
18
24
|
* Prop types for Combobox
|
|
19
25
|
*/
|
|
20
|
-
export interface ComboboxProps extends ComponentPropsWithoutRef<'div'> {
|
|
26
|
+
export interface ComboboxProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onFocus' | 'onBlur'> {
|
|
21
27
|
/**
|
|
22
28
|
* Additional class names
|
|
23
29
|
*/
|
|
@@ -79,9 +85,9 @@ export interface ComboboxProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
79
85
|
*/
|
|
80
86
|
noResultsText?: string;
|
|
81
87
|
/**
|
|
82
|
-
* onBlur event handler.
|
|
88
|
+
* onBlur event handler to provide the current value of the input.
|
|
83
89
|
*/
|
|
84
|
-
onBlur?: (
|
|
90
|
+
onBlur?: (currentValue: string) => void;
|
|
85
91
|
/**
|
|
86
92
|
* onChange event handler.
|
|
87
93
|
*/
|
|
@@ -91,9 +97,9 @@ export interface ComboboxProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
91
97
|
*/
|
|
92
98
|
onClear?: () => void;
|
|
93
99
|
/**
|
|
94
|
-
* onFocus event handler.
|
|
100
|
+
* onFocus event handler to provide the current value of the input.
|
|
95
101
|
*/
|
|
96
|
-
onFocus?: (
|
|
102
|
+
onFocus?: (currentValue: string) => void;
|
|
97
103
|
/**
|
|
98
104
|
* Callback when an option is selected. Returns the selected option object.
|
|
99
105
|
*/
|
|
@@ -119,6 +125,10 @@ export interface ComboboxProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
119
125
|
* When true, clicking or focusing the input will show all available options before typing.
|
|
120
126
|
*/
|
|
121
127
|
showUnfilteredOptions?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Size of the combobox field.
|
|
130
|
+
*/
|
|
131
|
+
size?: ComboboxSize;
|
|
122
132
|
/**
|
|
123
133
|
* Optional tooltip text to display additional information.
|
|
124
134
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import './combobox-multiselect.css';
|
|
3
|
+
export type ComboboxMultiselectSize = 's' | 'm' | 'l';
|
|
3
4
|
type LabelStrings = {
|
|
4
5
|
aiBadgeLabel?: string;
|
|
5
6
|
aiPanelButton?: string;
|
|
@@ -16,7 +17,7 @@ export interface OptionProps {
|
|
|
16
17
|
id: string;
|
|
17
18
|
label: string;
|
|
18
19
|
}
|
|
19
|
-
interface
|
|
20
|
+
interface AiSuggestionsPanel {
|
|
20
21
|
content?: ReactNode;
|
|
21
22
|
disableRefresh?: boolean;
|
|
22
23
|
isFetching?: boolean;
|
|
@@ -30,9 +31,9 @@ type DivProps = Omit<ComponentPropsWithoutRef<'div'>, 'onChange'>;
|
|
|
30
31
|
*/
|
|
31
32
|
export interface ComboboxMultiselectProps extends DivProps {
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* AI suggestions panel configuration. When provided, shows a sparkle button that opens a floating suggestions panel.
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
+
aiSuggestions?: AiSuggestionsPanel;
|
|
36
37
|
/**
|
|
37
38
|
* Additional class names
|
|
38
39
|
*/
|
|
@@ -97,9 +98,13 @@ export interface ComboboxMultiselectProps extends DivProps {
|
|
|
97
98
|
* Should the label be visible? If false, it will render for screen readers only.
|
|
98
99
|
*/
|
|
99
100
|
showLabel?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Size of the combobox multiselect field.
|
|
103
|
+
*/
|
|
104
|
+
size?: ComboboxMultiselectSize;
|
|
100
105
|
}
|
|
101
106
|
/**
|
|
102
107
|
* ComboboxMultiselect UI component
|
|
103
108
|
*/
|
|
104
|
-
export declare const ComboboxMultiselect: ({
|
|
109
|
+
export declare const ComboboxMultiselect: ({ aiSuggestions, className, disabled, id, initialSelectedItems, inputWidth, isLoading, label, labelStrings, loadingText, noResultsText, onChange, options, placeholder, required, showAllTags, showLabel, size, ...props }: ComboboxMultiselectProps) => import("react/jsx-runtime").JSX.Element;
|
|
105
110
|
export {};
|
|
@@ -3,6 +3,7 @@ import { ValidationStatus } from '../../../libs/types/input-types';
|
|
|
3
3
|
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
4
4
|
import './select.css';
|
|
5
5
|
export type SelectIconType = PDSIcon | 'google' | 'microsoft';
|
|
6
|
+
export type SelectSize = 's' | 'm' | 'l';
|
|
6
7
|
type LabelStrings = {
|
|
7
8
|
selectOptionText: string;
|
|
8
9
|
triggerButton: string;
|
|
@@ -108,6 +109,10 @@ export interface SelectProps {
|
|
|
108
109
|
* Should the label be visible? If false, it will render for screen readers only.
|
|
109
110
|
*/
|
|
110
111
|
showLabel?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Size of the select field.
|
|
114
|
+
*/
|
|
115
|
+
size?: SelectSize;
|
|
111
116
|
/**
|
|
112
117
|
* Optional tooltip text to display additional information.
|
|
113
118
|
*/
|
|
@@ -132,5 +137,5 @@ export declare const SelectOptionGroup: ({ children, label, }: SelectOptionGroup
|
|
|
132
137
|
/**
|
|
133
138
|
* Select UI component
|
|
134
139
|
*/
|
|
135
|
-
export declare const Select: ({ autoWidth, className, defaultValue, disabled, icon, id, inputWidth, label, labelStrings, message, onBlur, onFocus, onOptionSelect, options, required, showLabel, tooltipText, validationMessage, validationStatus, value, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
140
|
+
export declare const Select: ({ autoWidth, className, defaultValue, disabled, icon, id, inputWidth, label, labelStrings, message, onBlur, onFocus, onOptionSelect, options, required, showLabel, size, tooltipText, validationMessage, validationStatus, value, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
136
141
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { SelectOptionGroupType, SelectOptionType } from './Select/Select';
|
|
3
|
+
import '@components/Dropdown/dropdown.css';
|
|
3
4
|
import './input-utilities.css';
|
|
4
5
|
export declare const inputCommonClasses: {
|
|
5
6
|
base: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { NavMenuItem } from '../../../libs/types/navigation-types';
|
|
3
|
+
import '@components/Dropdown/dropdown.css';
|
|
3
4
|
import './nav-menu.css';
|
|
4
5
|
/**
|
|
5
|
-
* Prop types for
|
|
6
|
+
* Prop types for SiteMenu
|
|
6
7
|
*/
|
|
7
|
-
interface
|
|
8
|
+
interface SiteMenuProps extends ComponentPropsWithoutRef<'nav'> {
|
|
8
9
|
/**
|
|
9
10
|
* Aria label for `nav` element.
|
|
10
11
|
*/
|
|
@@ -27,7 +28,7 @@ interface NavMenuProps extends ComponentPropsWithoutRef<'nav'> {
|
|
|
27
28
|
mobileMenuMaxWidth?: number;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* SiteMenu UI component
|
|
31
32
|
*/
|
|
32
|
-
export declare const
|
|
33
|
+
export declare const SiteMenu: ({ ariaLabel, className, colorType, menuItems, mobileMenuMaxWidth, ...props }: SiteMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
34
|
export {};
|