@pantheon-systems/pds-toolkit-react 2.0.0-beta.18 → 2.0.0-beta.19
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/Timeline/Timeline.d.ts +29 -0
- package/dist/components/Timeline/TimelineItem.d.ts +68 -0
- package/dist/components/Timeline/timeline-context.d.ts +6 -0
- package/dist/components/charts/Sparkline/Sparkline.d.ts +62 -0
- package/dist/components/icons/Icon/generated-icon-data.d.ts +1 -1
- package/dist/components/media/Illustration/generated-illustration-data.d.ts +1 -1
- package/dist/css/component-css/pds-button.css +1 -1
- package/dist/css/component-css/pds-index.css +3 -3
- package/dist/css/component-css/pds-sparkline.css +1 -0
- package/dist/css/component-css/pds-timeline.css +1 -0
- package/dist/css/pds-components.css +3 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +683 -474
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { TimelineSubtitlePosition, TimelineVariant } from './TimelineItem';
|
|
3
|
+
import './timeline.css';
|
|
4
|
+
/**
|
|
5
|
+
* Prop types for Timeline
|
|
6
|
+
*/
|
|
7
|
+
export interface TimelineProps extends ComponentPropsWithoutRef<'ol'> {
|
|
8
|
+
/**
|
|
9
|
+
* Children components. These should be TimelineItem components.
|
|
10
|
+
*/
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Additional class names
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Where each timeline item's subtitle goes: above or below its title.
|
|
18
|
+
*/
|
|
19
|
+
subtitlePosition?: TimelineSubtitlePosition;
|
|
20
|
+
/**
|
|
21
|
+
* Whether timeline items sit on a card or directly on the line. A timeline item can
|
|
22
|
+
* override this.
|
|
23
|
+
*/
|
|
24
|
+
variant?: TimelineVariant;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Timeline UI component
|
|
28
|
+
*/
|
|
29
|
+
export declare const Timeline: ({ children, className, subtitlePosition, variant, ...props }: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { HeadingLevelCommon } from '../../libs/types/custom-types.js';
|
|
3
|
+
import { BadgeColor } from '../badges/Badge/Badge.js';
|
|
4
|
+
import { PDSIcon } from '../icons/Icon/Icon.js';
|
|
5
|
+
import './timeline.css';
|
|
6
|
+
export type TimelineSubtitlePosition = 'above' | 'below';
|
|
7
|
+
export type TimelineVariant = 'card' | 'flat';
|
|
8
|
+
/**
|
|
9
|
+
* Prop types for TimelineItem
|
|
10
|
+
*/
|
|
11
|
+
export interface TimelineItemProps extends Omit<ComponentPropsWithoutRef<'li'>, 'title'> {
|
|
12
|
+
/**
|
|
13
|
+
* Color of the badge beside the subtitle. Only used when `badgeLabel` is set.
|
|
14
|
+
*/
|
|
15
|
+
badgeColor?: BadgeColor;
|
|
16
|
+
/**
|
|
17
|
+
* Optional leading icon for the badge. Only shown when `badgeLabel` is set.
|
|
18
|
+
*/
|
|
19
|
+
badgeIcon?: PDSIcon;
|
|
20
|
+
/**
|
|
21
|
+
* Optional badge text shown beside the subtitle, such as "You're here" or a
|
|
22
|
+
* status.
|
|
23
|
+
*/
|
|
24
|
+
badgeLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Content under the title. Plain text is styled as a paragraph. Blocks
|
|
27
|
+
* inside it sit a small, fixed distance apart.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Additional class names
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Heading level of the title. Pick the one that fits the page's outline, or
|
|
36
|
+
* `span` to render the title without a heading.
|
|
37
|
+
*/
|
|
38
|
+
headingLevel?: HeadingLevelCommon;
|
|
39
|
+
/**
|
|
40
|
+
* Whether this is the timeline item in focus, such as the current step. Gives
|
|
41
|
+
* the dot an accent fill and ring, and sets `aria-current='step'`.
|
|
42
|
+
*/
|
|
43
|
+
isActive?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Short label hanging beside the dot, left of the line, such as a date. The
|
|
46
|
+
* list makes room for it automatically. On small screens it moves above the
|
|
47
|
+
* title.
|
|
48
|
+
*/
|
|
49
|
+
sideLabel?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Quiet line next to the title, such as a stage or a description. Its
|
|
52
|
+
* position comes from the list's `subtitlePosition`.
|
|
53
|
+
*/
|
|
54
|
+
subtitle?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Title of the timeline item.
|
|
57
|
+
*/
|
|
58
|
+
title: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the timeline item sits on a card or directly on the line. Overrides
|
|
61
|
+
* the list's `variant`.
|
|
62
|
+
*/
|
|
63
|
+
variant?: TimelineVariant;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* TimelineItem UI component
|
|
67
|
+
*/
|
|
68
|
+
export declare const TimelineItem: ({ badgeColor, badgeIcon, badgeLabel, children, className, headingLevel, isActive, sideLabel, subtitle, title, variant: variantProp, ...props }: TimelineItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TimelineSubtitlePosition, TimelineVariant } from './TimelineItem';
|
|
2
|
+
export interface TimelineContextValue {
|
|
3
|
+
subtitlePosition: TimelineSubtitlePosition;
|
|
4
|
+
variant: TimelineVariant;
|
|
5
|
+
}
|
|
6
|
+
export declare const TimelineContext: import("react").Context<TimelineContextValue>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { ColorPalette, TooltipPayload } from '../shared/types';
|
|
3
|
+
import '../shared/chart-wrapper.css';
|
|
4
|
+
import './sparkline.css';
|
|
5
|
+
export interface SparklineDataPoint {
|
|
6
|
+
/** Label for this point, such as a date or time */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Numeric value at this point */
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SparklineScrubPayload extends SparklineDataPoint {
|
|
12
|
+
/** Position of the point in `data` */
|
|
13
|
+
index: number;
|
|
14
|
+
}
|
|
15
|
+
export interface SparklineLabelStrings {
|
|
16
|
+
/** Accessible description for the hidden data table. */
|
|
17
|
+
accessibleTableDescription?: string;
|
|
18
|
+
/** Loading label for screen readers. */
|
|
19
|
+
loadingLabel?: string;
|
|
20
|
+
/** Accessible name for the scrubber. */
|
|
21
|
+
scrubberLabel?: string;
|
|
22
|
+
/** Column header for the value in the hidden data table. */
|
|
23
|
+
valueLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SparklineProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
26
|
+
/** Position of the dot, as an index into `data`. Makes the position controlled. Defaults to the last point until the user scrubs. */
|
|
27
|
+
activeIndex?: number;
|
|
28
|
+
/** Height of the chart in pixels (default: 60) */
|
|
29
|
+
chartHeight?: number;
|
|
30
|
+
/** Maximum width of the chart in pixels. The chart is responsive and shrinks within this constraint. */
|
|
31
|
+
chartWidth?: number;
|
|
32
|
+
/** Line and dot color (CSS custom property or hex). Not theme-aware — use `paletteIndex` for theme-aware overrides. */
|
|
33
|
+
color?: string;
|
|
34
|
+
/** Color palette used to pick the line color (default: 'categorical') */
|
|
35
|
+
colorPalette?: ColorPalette;
|
|
36
|
+
/** Chart data points */
|
|
37
|
+
data: SparklineDataPoint[];
|
|
38
|
+
/** Show loading state */
|
|
39
|
+
isLoading?: boolean;
|
|
40
|
+
/** Translatable UI strings. Provide overrides for i18n. */
|
|
41
|
+
labelStrings?: SparklineLabelStrings;
|
|
42
|
+
/** Called when the user moves the dot to a different point */
|
|
43
|
+
onScrub?: (point: SparklineScrubPayload) => void;
|
|
44
|
+
/** Pick a specific color from the selected palette by position (1-based). Theme-aware. */
|
|
45
|
+
paletteIndex?: number;
|
|
46
|
+
/** Show accessible data table (visually hidden). Defaults to true. */
|
|
47
|
+
showAccessibleTable?: boolean;
|
|
48
|
+
/** Show the tooltip with the selected point's label and value (default: true) */
|
|
49
|
+
showTooltip?: boolean;
|
|
50
|
+
/** Custom tooltip renderer. Receives the selected point and replaces the built-in tooltip. */
|
|
51
|
+
tooltipContent?: (payload: TooltipPayload) => ReactNode;
|
|
52
|
+
/** Formats values for screen readers and the accessible table */
|
|
53
|
+
valueFormatter?: (value: number) => string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Sparkline UI component
|
|
57
|
+
*
|
|
58
|
+
* A compact trend line with a dot the user drags to read the value at any
|
|
59
|
+
* point. There is no tooltip; the consumer shows the scrubbed value elsewhere
|
|
60
|
+
* via `onScrub`.
|
|
61
|
+
*/
|
|
62
|
+
export declare const Sparkline: ({ activeIndex, chartHeight, chartWidth, className, color, colorPalette, data, isLoading, labelStrings, onScrub, paletteIndex, showAccessibleTable, showTooltip, tooltipContent, valueFormatter, ...props }: SparklineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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-11-
|
|
6
|
+
* Generated: 2026-11-05T20:09:05.109Z
|
|
7
7
|
*/
|
|
8
8
|
import { customIcons } from './custom-icons';
|
|
9
9
|
export { customIcons };
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
--pds-color-button-reverse-secondary-foreground
|
|
69
69
|
);--button-border-color:var(--pds-color-button-reverse-secondary-border);--button-border-color-hover:var(--pds-color-button-reverse-secondary-border);--button-border-color-active:var(
|
|
70
70
|
--pds-color-button-reverse-secondary-border
|
|
71
|
-
)}.pds-button--link{background-color:transparent;border:none;border-radius:0;color:var(--pds-color-interactive-link-default);height:unset;justify-content:unset;letter-spacing:0;max-height:unset;padding:0;transition:var(--pds-animation-transition-button)}.pds-button--link:hover:enabled,a.pds-button--link:hover{color:var(--pds-color-interactive-link-hover);text-decoration:underline}.pds-button--link:active:enabled,a.pds-button--link:active{box-shadow:none;color:var(--pds-color-interactive-link-active)}.pds-button--link .pds-button-link__icon,.pds-button--link .pds-button__icon{transform:scale(.9)}.pds-button--loading{cursor:not-allowed}.pds-button--loading:active,.pds-button--loading:hover:enabled{--button-background-color:var(--pulse-regular-base-color);--button-border-color:var(--pulse-regular-base-color)}.pds-button--loading.pds-pulse{background-color:var(--pulse-regular-base-color);border-color:var(--pulse-regular-base-color);color:transparent}.pds-button--loading .pds-button__icon,.pds-button--loading .pds-button__tally,.pds-button--loading .pds-button__working-indicator{opacity:0}.pds-button-group{display:flex;flex-direction:column;row-gap:var(--pds-spacing-m);width:100%}.pds-button-group--inline{column-gap:var(--pds-spacing-s);flex-direction:row;flex-wrap:wrap;row-gap:var(--pds-spacing-s);width:unset}@media(min-width:768px){.pds-button-group{column-gap:var(--pds-spacing-s);flex-direction:row;width:unset}.pds-button-group--l{column-gap:var(--pds-spacing-m)}}}
|
|
71
|
+
)}.pds-button--link{background-color:transparent;border:none;border-radius:0;color:var(--pds-color-interactive-link-default);height:unset;justify-content:unset;letter-spacing:0;max-height:unset;padding:0;transition:var(--pds-animation-transition-button)}.pds-button--link:hover:enabled,a.pds-button--link:hover{color:var(--pds-color-interactive-link-hover);text-decoration:underline}.pds-button--link:active:enabled,a.pds-button--link:active{box-shadow:none;color:var(--pds-color-interactive-link-active)}.pds-button--link .pds-button-link__icon,.pds-button--link .pds-button__icon{transform:scale(.9)}.pds-button--loading{cursor:not-allowed}.pds-button--loading:active,.pds-button--loading:hover:enabled{--button-background-color:var(--pulse-regular-base-color);--button-border-color:var(--pulse-regular-base-color)}.pds-button--loading.pds-pulse{background-color:var(--pulse-regular-base-color);border-color:var(--pulse-regular-base-color);color:transparent}.pds-button--loading .pds-button__icon,.pds-button--loading .pds-button__tally,.pds-button--loading .pds-button__working-indicator{opacity:0}.pds-button-group{display:flex;flex-direction:column;row-gap:var(--pds-spacing-m);width:100%}.pds-button-group--inline{column-gap:var(--pds-spacing-s);flex-direction:row;flex-wrap:wrap;row-gap:var(--pds-spacing-s);width:unset}.pds-button-group:not(.pds-button-group--inline) .pds-tooltip,.pds-button-group:not(.pds-button-group--inline) .pds-tooltip__trigger-custom{display:flex;width:100%}.pds-button-group:not(.pds-button-group--inline) .pds-tooltip__trigger-custom .pds-button{flex:1}@media(min-width:768px){.pds-button-group{column-gap:var(--pds-spacing-s);flex-direction:row;width:unset}.pds-button-group:not(.pds-button-group--inline) .pds-tooltip{display:inline-flex;width:unset}.pds-button-group:not(.pds-button-group--inline) .pds-tooltip__trigger-custom{display:revert;width:unset}.pds-button-group:not(.pds-button-group--inline) .pds-tooltip__trigger-custom .pds-button{flex:unset}.pds-button-group--l{column-gap:var(--pds-spacing-m)}}}
|