@pantheon-systems/pds-toolkit-react 2.0.0-beta.2 → 2.0.0-beta.20
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/codemods/v1-to-v2/css-token-renames.js +4 -4
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/basic.output.tsx +1 -1
- package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/basic.output.tsx +7 -2
- package/codemods/v1-to-v2/transforms/component-renames.js +2 -1
- package/codemods/v1-to-v2/transforms/icon-name-updates.js +1 -0
- package/codemods/v1-to-v2/transforms/prop-renames.js +1 -0
- package/codemods/v1-to-v2/transforms/prop-value-standardization.js +2 -1
- package/codemods/v1-to-v2/transforms/removed-prop-values.js +2 -1
- package/dist/components/badges/Badge/Badge.d.ts +7 -2
- package/dist/components/badges/StatusBadge/StatusBadge.d.ts +1 -1
- package/dist/components/buttons/Button/Button.d.ts +15 -5
- package/dist/components/buttons/ButtonLink/ButtonLink.d.ts +9 -4
- package/dist/components/buttons/ClipboardButton/ClipboardButton.d.ts +6 -1
- package/dist/components/buttons/FilterButton/FilterButton.d.ts +3 -2
- package/dist/components/buttons/IconButton/IconButton.d.ts +3 -3
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +5 -5
- package/dist/components/buttons/MenuButton/menu-button-sample-data.d.ts +1 -1
- package/dist/components/buttons/SSOButton/SSOButton.d.ts +8 -2
- package/dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +1 -1
- package/dist/components/buttons/SelectButton/SelectButton.d.ts +3 -2
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +2 -2
- package/dist/components/buttons/UtilityButton/UtilityButton.d.ts +11 -3
- package/dist/components/cards/ActionCard/ActionCard.d.ts +2 -2
- package/dist/components/cards/Card/Card.d.ts +1 -1
- package/dist/components/cards/CardSelect/CardSelect.d.ts +1 -1
- package/dist/components/charts/AreaChart/AreaChart.d.ts +19 -0
- package/dist/components/charts/ScatterPlot/ScatterAccessibleTable.d.ts +32 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +59 -0
- package/dist/components/charts/Sparkline/Sparkline.d.ts +62 -0
- package/dist/components/charts/shared/ChartActiveDot.d.ts +17 -0
- package/dist/components/charts/shared/ChartLegend.d.ts +4 -2
- package/dist/components/empty-states/CompactEmptyState/CompactEmptyState.d.ts +2 -2
- package/dist/components/empty-states/HorizontalEmptyState/HorizontalEmptyState.d.ts +2 -2
- package/dist/components/empty-states/VerticalEmptyState/VerticalEmptyState.d.ts +46 -8
- package/dist/components/icons/Icon/Icon.d.ts +1 -1
- package/dist/components/icons/Icon/generated-icon-data.d.ts +44 -2
- package/dist/components/identity/AgentAvatar/AgentAvatar.d.ts +44 -0
- package/dist/components/identity/Avatar/Avatar.d.ts +9 -1
- package/dist/components/identity/AvatarLabel/AvatarLabel.d.ts +32 -5
- package/dist/components/identity/IdentityBlock/IdentityBlock.d.ts +18 -4
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/inputs/CheckboxFieldset/CheckboxFieldset.d.ts +1 -1
- package/dist/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/inputs/Combobox/Combobox.d.ts +1 -1
- package/dist/components/inputs/Datepicker/Datepicker.d.ts +19 -19
- package/dist/components/inputs/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/inputs/Select/Select.d.ts +2 -2
- package/dist/components/{SiteSearch → inputs/SiteSearch}/SiteSearch.d.ts +1 -1
- package/dist/components/inputs/Switch/Switch.d.ts +7 -0
- package/dist/components/inputs/TagsInput/TagsInput.d.ts +1 -1
- package/dist/components/inputs/TextInput/TextInput.d.ts +1 -1
- package/dist/components/inputs/Textarea/Textarea.d.ts +1 -1
- package/dist/components/{ThemeSwitcher → inputs/ThemeSwitcher}/ThemeSwitcher.d.ts +1 -1
- package/dist/components/inputs/Timepicker/Timepicker.d.ts +4 -4
- package/dist/components/inputs/WorkspacePicker/WorkspacePicker.d.ts +90 -0
- package/dist/components/inputs/input-utilities.d.ts +1 -1
- package/dist/components/lists/Timeline/Timeline.d.ts +29 -0
- package/dist/components/lists/Timeline/TimelineItem.d.ts +68 -0
- package/dist/components/lists/Timeline/timeline-context.d.ts +6 -0
- package/dist/components/loading-indicators/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/loading-indicators/ThinkingState/ThinkingState.d.ts +49 -0
- package/dist/components/media/Illustration/Illustration.d.ts +37 -0
- package/dist/components/media/Illustration/generated-illustration-data.d.ts +16 -0
- package/dist/components/media/Illustration/illustration-registry.d.ts +19 -0
- package/dist/components/navigation/BASwitcher/BASwitcher.d.ts +104 -0
- package/dist/components/navigation/BookmarksMenu/BookmarksMenu.d.ts +1 -1
- package/dist/components/navigation/ButtonNav/ButtonNav.d.ts +1 -1
- package/dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/dist/components/navigation/Navbar/Navbar.d.ts +2 -2
- package/dist/components/navigation/SideNav/SideNav.d.ts +7 -2
- package/dist/components/navigation/SideNavGlobal/SideNavGlobalItem.d.ts +2 -2
- package/dist/components/{SiteFooter → navigation/SiteFooter}/SiteFooter.d.ts +1 -1
- package/dist/components/navigation/SiteMenu/SiteMenu.d.ts +2 -2
- package/dist/components/navigation/SiteMenu/SiteMenuDropdown.d.ts +1 -1
- package/dist/components/navigation/TabMenu/TabMenu.d.ts +2 -2
- package/dist/components/navigation/TabMenu/TabMenuDropdown.d.ts +1 -1
- package/dist/components/{TableOfContents → navigation/TableOfContents}/TableOfContents.d.ts +4 -1
- package/dist/components/{Tabs → navigation/Tabs}/Tabs.d.ts +1 -1
- package/dist/components/navigation/TreeNav/TreeNav.d.ts +1 -1
- package/dist/components/navigation/UserMenu/UserMenu.d.ts +2 -2
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +1 -1
- package/dist/components/navigation/navigation-utilities.d.ts +2 -2
- package/dist/components/notifications/Banner/Banner.d.ts +2 -2
- package/dist/components/{Callout → notifications/Callout}/Callout.d.ts +1 -1
- package/dist/components/notifications/InlineMessage/InlineMessage.d.ts +1 -1
- package/dist/components/notifications/SectionMessage/SectionMessage.d.ts +32 -7
- package/dist/components/notifications/Toaster/Toast.d.ts +1 -1
- package/dist/components/notifications/Toaster/Toaster.d.ts +2 -2
- package/dist/components/{Dropdown → overlays/Dropdown}/Dropdown.d.ts +3 -3
- package/dist/components/overlays/FullScreenOverlay/FullScreenOverlay.d.ts +1 -1
- package/dist/components/{Popover → overlays/Popover}/Popover.d.ts +1 -1
- package/dist/components/{Tooltip → overlays/Tooltip}/Tooltip.d.ts +1 -1
- package/dist/components/pagination/Pagination/Pagination.d.ts +1 -1
- package/dist/components/pagination/PaginationChapter/PaginationChapter.d.ts +1 -1
- package/dist/components/pagination/PaginationCompact/PaginationCompact.d.ts +1 -1
- package/dist/components/panels/BASelectorPanel/BASelectorPanel.d.ts +39 -0
- package/dist/components/panels/BookmarksPanel/BookmarksPanel.d.ts +14 -2
- package/dist/components/panels/FeaturePanel/FeaturePanel.d.ts +3 -3
- package/dist/components/panels/Panel/Panel.d.ts +13 -4
- package/dist/components/panels/PanelList/PanelRow.d.ts +1 -1
- package/dist/components/{StatPanel → panels/StatPanel}/StatPanel.d.ts +12 -3
- package/dist/components/panels/WidgetPanel/WidgetPanel.d.ts +1 -1
- package/dist/components/panels/WorkspaceSelectorPanel/WorkspaceSelectorPanel.d.ts +1 -1
- package/dist/components/progress-indicators/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/progress-indicators/ProgressRing/ProgressRing.d.ts +1 -1
- package/dist/components/{StatusChecker → status/StatusChecker}/StatusChecker.d.ts +8 -1
- package/dist/components/{StatusIndicator → status/StatusIndicator}/StatusIndicator.d.ts +1 -1
- package/dist/components/steppers/VerticalStepper/VerticalStep.d.ts +1 -1
- package/dist/components/{RowActionsMenu → tables/RowActionsMenu}/RowActionsMenu.d.ts +1 -1
- package/dist/components/{Table → tables/Table}/Table.d.ts +38 -10
- package/dist/components/{UtilityBar → tables/UtilityBar}/UtilityBar.d.ts +1 -1
- package/dist/css/component-css/pds-agent-avatar.css +1 -0
- package/dist/css/component-css/pds-area-chart.css +1 -0
- package/dist/css/component-css/pds-avatar-label.css +1 -1
- package/dist/css/component-css/pds-avatar.css +1 -1
- package/dist/css/component-css/pds-ba-selector-panel.css +1 -0
- package/dist/css/component-css/pds-ba-switcher.css +1 -0
- package/dist/css/component-css/pds-badge.css +1 -1
- package/dist/css/component-css/pds-banner.css +1 -1
- package/dist/css/component-css/pds-bookmarks-menu.css +1 -1
- package/dist/css/component-css/pds-bookmarks-panel.css +1 -1
- package/dist/css/component-css/pds-bottom-sheet.css +1 -1
- package/dist/css/component-css/pds-branch-diff.css +1 -1
- package/dist/css/component-css/pds-bulk-action-bar.css +1 -1
- package/dist/css/component-css/pds-button-link.css +1 -1
- package/dist/css/component-css/pds-button.css +5 -5
- package/dist/css/component-css/pds-callout.css +1 -1
- package/dist/css/component-css/pds-card-select.css +1 -2
- package/dist/css/component-css/pds-checkbox.css +1 -1
- package/dist/css/component-css/pds-combobox-multiselect.css +1 -3
- package/dist/css/component-css/pds-compact-empty-state.css +1 -1
- package/dist/css/component-css/pds-datepicker.css +1 -1
- package/dist/css/component-css/pds-drawer.css +1 -1
- package/dist/css/component-css/pds-dropdown-menu.css +1 -2
- package/dist/css/component-css/pds-dropdown.css +1 -3
- package/dist/css/component-css/pds-expansion-panel.css +1 -2
- package/dist/css/component-css/pds-feature-panel.css +1 -15
- package/dist/css/component-css/pds-file-diff.css +1 -1
- package/dist/css/component-css/pds-filter-button.css +1 -1
- package/dist/css/component-css/pds-horizontal-empty-state.css +1 -1
- package/dist/css/component-css/pds-icon-button.css +2 -4
- package/dist/css/component-css/pds-identity-block.css +1 -1
- package/dist/css/component-css/pds-illustration.css +1 -0
- package/dist/css/component-css/pds-index.css +25 -136
- package/dist/css/component-css/pds-inline-message.css +1 -1
- package/dist/css/component-css/pds-input-utilities.css +1 -1
- package/dist/css/component-css/pds-menu-button.css +1 -11
- package/dist/css/component-css/pds-modal.css +1 -1
- package/dist/css/component-css/pds-nav-menu.css +1 -1
- package/dist/css/component-css/pds-navbar.css +1 -4
- package/dist/css/component-css/pds-pagination-chapter.css +1 -3
- package/dist/css/component-css/pds-panel-list.css +1 -1
- package/dist/css/component-css/pds-panel.css +1 -2
- package/dist/css/component-css/pds-pantheon-logo.css +1 -1
- package/dist/css/component-css/pds-pie-chart.css +1 -1
- package/dist/css/component-css/pds-popover.css +1 -1
- package/dist/css/component-css/pds-proportion-bar.css +1 -1
- package/dist/css/component-css/pds-radio-group.css +1 -1
- package/dist/css/component-css/pds-row-actions-menu.css +1 -2
- package/dist/css/component-css/pds-scatter-plot.css +1 -0
- package/dist/css/component-css/pds-section-message.css +5 -1
- package/dist/css/component-css/pds-segmented-button.css +1 -2
- package/dist/css/component-css/pds-select-button.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +1 -1
- package/dist/css/component-css/pds-side-nav.css +9 -3
- package/dist/css/component-css/pds-site-footer.css +1 -1
- package/dist/css/component-css/pds-site-search.css +1 -1
- package/dist/css/component-css/pds-sortable-list.css +1 -8
- package/dist/css/component-css/pds-sparkline.css +1 -0
- package/dist/css/component-css/pds-spinner.css +1 -1
- package/dist/css/component-css/pds-split-button.css +1 -1
- package/dist/css/component-css/pds-sso-button.css +1 -1
- package/dist/css/component-css/pds-stat-panel.css +1 -1
- package/dist/css/component-css/pds-status-badge.css +1 -1
- package/dist/css/component-css/pds-status-checker.css +1 -1
- package/dist/css/component-css/pds-status-scrim.css +1 -1
- package/dist/css/component-css/pds-stepper.css +2 -4
- package/dist/css/component-css/pds-switch.css +2 -12
- package/dist/css/component-css/pds-tab-menu.css +1 -2
- package/dist/css/component-css/pds-table-of-contents.css +1 -1
- package/dist/css/component-css/pds-table.css +1 -7
- package/dist/css/component-css/pds-tabs.css +1 -1
- package/dist/css/component-css/pds-tag.css +1 -1
- package/dist/css/component-css/pds-tags-input.css +2 -1
- package/dist/css/component-css/pds-tally.css +1 -1
- package/dist/css/component-css/pds-thinking-state.css +1 -0
- package/dist/css/component-css/pds-timeline.css +1 -0
- package/dist/css/component-css/pds-toaster.css +1 -1
- package/dist/css/component-css/pds-tooltip.css +1 -1
- package/dist/css/component-css/pds-user-menu-story-only.css +1 -1
- package/dist/css/component-css/pds-user-menu.css +1 -32
- package/dist/css/component-css/pds-utility-button.css +1 -3
- package/dist/css/component-css/pds-vertical-empty-state.css +1 -1
- package/dist/css/component-css/pds-vertical-stepper.css +1 -1
- package/dist/css/component-css/pds-workspace-picker.css +1 -0
- package/dist/css/component-css/pds-workspace-selector-panel.css +1 -1
- package/dist/css/component-css/pds-workspace-selector.css +1 -23
- package/dist/css/design-tokens/variables.dark.css +3 -0
- package/dist/css/design-tokens/variables.light.css +3 -0
- package/dist/css/layout-css/pds-app-layout.css +1 -3
- package/dist/css/layout-css/pds-docs-layout.css +1 -1
- package/dist/css/layout-css/pds-index.css +1 -3
- package/dist/css/layout-css/pds-sidebar-layout.css +1 -13
- package/dist/css/layout-css/pds-stat-panel-group.css +1 -1
- package/dist/css/layout-css/pds-stepper-layout.css +1 -1
- package/dist/css/pds-components.css +25 -136
- package/dist/css/pds-core.css +2 -2
- package/dist/css/pds-layouts.css +1 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +39 -28
- package/dist/index.js +7989 -5734
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +39 -28
- package/dist/layouts/AppLayout/AppLayout.d.ts +1 -1
- package/dist/layouts/DocsLayout/DocsLayout.d.ts +9 -1
- package/dist/layouts/SidebarLayout/SidebarLayout.d.ts +1 -1
- package/dist/layouts/StepperLayout/StepperLayout.d.ts +4 -2
- package/dist/layouts/ThreeItemLayout/ThreeItemLayout.d.ts +1 -1
- package/dist/layouts/TwoItemLayout/TwoItemLayout.d.ts +1 -1
- package/dist/libs/components/DocsLayoutContext.d.ts +8 -0
- package/dist/libs/components/SelectorPanel/SelectorPanel.d.ts +52 -0
- package/dist/libs/components/SiteOptionDisplay/SiteOptionDisplay.d.ts +1 -1
- package/dist/libs/components/StatusDot/StatusDot.d.ts +1 -1
- package/dist/libs/components/WorkspaceListItem/WorkspaceListItem.d.ts +8 -7
- package/dist/libs/components/utility-components.d.ts +1 -1
- package/dist/libs/components/utils.d.ts +1 -0
- package/dist/libs/types/custom-types.d.ts +2 -1
- package/dist/libs/types/layout-types.d.ts +1 -1
- package/dist/svg/arrowRightArrowLeft.svg +3 -0
- package/dist/svg/badgePercent.svg +3 -0
- package/dist/svg/circleDollar.svg +3 -0
- package/dist/svg/gaugeSimpleHigh.svg +3 -0
- package/dist/svg/handWave.svg +3 -0
- package/dist/svg/sparklesSolid.svg +3 -0
- package/dist/utilities/Container/Container.d.ts +1 -1
- package/dist/utilities/FlexContainer/FlexContainer.d.ts +1 -1
- package/dist/utilities/GlobalWrapper/GlobalWrapper.d.ts +1 -1
- package/dist/utilities/auto-grid/AutoGrid.d.ts +1 -1
- package/dist/utilities/grid/Grid.d.ts +1 -1
- package/dist/utilities/hooks/useBreakpoint/useBreakpoint.d.ts +3 -0
- package/dist/utilities/hooks/useDropdown/useDropdown.d.ts +7 -1
- package/dist/utilities/hooks/useKeyboardShortcut/useKeyboardShortcut.d.ts +5 -1
- package/dist/utilities/hooks/useMediaQuery/subscribeToMediaQuery.d.ts +6 -0
- package/dist/utilities/hooks/useMediaQuery/useMediaQuery.d.ts +0 -16
- package/package.json +45 -39
- /package/dist/components/{Tag → badges/Tag}/Tag.d.ts +0 -0
- /package/dist/components/{BranchDiff → code-display/BranchDiff}/BranchDiff.d.ts +0 -0
- /package/dist/components/{CodeBlock → code-display/CodeBlock}/CodeBlock.d.ts +0 -0
- /package/dist/components/{CodeBlock → code-display/CodeBlock}/code-examples.d.ts +0 -0
- /package/dist/components/{CodeBlock → code-display/CodeBlock}/prism-setup.d.ts +0 -0
- /package/dist/components/{CodeBlock → code-display/CodeBlock}/themes/index.d.ts +0 -0
- /package/dist/components/{CodeBlock → code-display/CodeBlock}/themes/pds.d.ts +0 -0
- /package/dist/components/{FileDiff → code-display/FileDiff}/FileDiff.d.ts +0 -0
- /package/dist/components/{ComparisonList → lists/ComparisonList}/ComparisonList.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/SortableList.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/SortableListHeader.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/SortableRow.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/sortable-utils.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/types.d.ts +0 -0
- /package/dist/components/{SortableList → lists/SortableList}/useSortableTree.d.ts +0 -0
- /package/dist/components/{steppers → lists}/StepList/StepList.d.ts +0 -0
- /package/dist/components/{steppers → lists}/StepList/example-steps.d.ts +0 -0
- /package/dist/components/{PantheonLogo → media/PantheonLogo}/PantheonLogo.d.ts +0 -0
- /package/dist/components/{PantheonLogo → media/PantheonLogo}/pantheon-logo-data.d.ts +0 -0
- /package/dist/components/{Callout → notifications/Callout}/sample-callout-content.d.ts +0 -0
- /package/dist/components/{Dropdown → overlays/Dropdown}/DropdownSelectedIcon.d.ts +0 -0
- /package/dist/components/{StatusScrim → status/StatusScrim}/StatusScrim.d.ts +0 -0
- /package/dist/components/{ResultCount → tables/ResultCount}/ResultCount.d.ts +0 -0
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import fs from 'fs';
|
|
29
|
-
import path from 'path';
|
|
30
|
-
import { createRequire } from 'module';
|
|
31
29
|
import { globSync } from 'glob';
|
|
30
|
+
import { createRequire } from 'module';
|
|
31
|
+
import path from 'path';
|
|
32
32
|
|
|
33
33
|
// JSON imports via createRequire — works in both CJS and ESM contexts
|
|
34
34
|
const require = createRequire(import.meta.url);
|
|
@@ -136,7 +136,7 @@ function applyRenames(content) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// Wildcard patterns
|
|
139
|
-
for (const { regex, replacement
|
|
139
|
+
for (const { from, regex, replacement } of PATTERNS) {
|
|
140
140
|
regex.lastIndex = 0;
|
|
141
141
|
const next = result.replace(regex, replacement);
|
|
142
142
|
if (next !== result) {
|
|
@@ -164,7 +164,7 @@ if (allFiles.length === 0) {
|
|
|
164
164
|
|
|
165
165
|
for (const filePath of allFiles) {
|
|
166
166
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
167
|
-
const {
|
|
167
|
+
const { appliedRenames, changed, result } = applyRenames(content);
|
|
168
168
|
|
|
169
169
|
totalFiles++;
|
|
170
170
|
if (!changed) continue;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
const A = () => <Button variant="secondary">Click</Button>;
|
|
16
16
|
const B = () => <Button variant="subtle">Click</Button>;
|
|
17
17
|
const C = () => (
|
|
18
|
-
<MenuButton variant=
|
|
18
|
+
<MenuButton variant='navbar' id='menu' label='Menu' menuItems={[]} />
|
|
19
19
|
);
|
|
20
20
|
const D = () => (
|
|
21
21
|
<IconButton variant="critical" iconName='x' label='Close' />
|
|
@@ -32,7 +32,12 @@ const I = () => (
|
|
|
32
32
|
<Panel />
|
|
33
33
|
);
|
|
34
34
|
const J = () => (
|
|
35
|
-
<Switch
|
|
35
|
+
<Switch
|
|
36
|
+
showStatusLabel
|
|
37
|
+
statusLabelPlacement='end'
|
|
38
|
+
onLabel='On'
|
|
39
|
+
offLabel='Off'
|
|
40
|
+
/>
|
|
36
41
|
);
|
|
37
42
|
|
|
38
43
|
// Conditional removal — remove only deprecated gradient values, leave valid values alone
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
const path = require('path');
|
|
34
|
+
|
|
34
35
|
const mappings = require(path.join(__dirname, '../mappings.json'));
|
|
35
36
|
|
|
36
37
|
// Build lookup for root package imports: { 'OldName': 'NewName' }
|
|
@@ -116,7 +117,7 @@ module.exports = function transform(file, api, options) {
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
// 1b. Deep path imports
|
|
119
|
-
for (const { from,
|
|
120
|
+
for (const { from, newName, oldName, to } of pathChanges) {
|
|
120
121
|
if (!source.includes(from)) continue;
|
|
121
122
|
|
|
122
123
|
nodePath.node.source = j.stringLiteral(source.replace(from, to));
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
const path = require('path');
|
|
30
|
+
|
|
30
31
|
const mappings = require(path.join(__dirname, '../mappings.json'));
|
|
31
32
|
|
|
32
33
|
// Build lookup: { 'ComponentName.propName': { oldValue: newValue } }
|
|
@@ -35,7 +36,7 @@ function buildMigrationLookup() {
|
|
|
35
36
|
const lookup = {};
|
|
36
37
|
|
|
37
38
|
for (const entry of mappings.props.typeChanges) {
|
|
38
|
-
const { component,
|
|
39
|
+
const { component, migration, prop } = entry;
|
|
39
40
|
if (!migration || typeof migration !== 'object' || Array.isArray(migration))
|
|
40
41
|
continue;
|
|
41
42
|
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
const path = require('path');
|
|
42
|
+
|
|
42
43
|
const mappings = require(path.join(__dirname, '../mappings.json'));
|
|
43
44
|
|
|
44
45
|
// Entries that are too complex to automate
|
|
@@ -81,7 +82,7 @@ function buildLookups() {
|
|
|
81
82
|
return { valueRewrites, propRemovals };
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
const {
|
|
85
|
+
const { propRemovals: ALL_PROP_REMOVALS, valueRewrites: ALL_VALUE_REWRITES } =
|
|
85
86
|
buildLookups();
|
|
86
87
|
|
|
87
88
|
module.exports = function transform(file, api, options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
2
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
3
3
|
import './badge.css';
|
|
4
4
|
export type BadgeColor = 'ai-active' | 'brand' | 'brand-muted' | 'critical' | 'critical-muted' | 'discovery' | 'discovery-muted' | 'gold' | 'gold-muted' | 'indigo' | 'indigo-muted' | 'info' | 'info-muted' | 'ink' | 'ink-muted' | 'lime' | 'lime-muted' | 'orange' | 'orange-muted' | 'rose' | 'rose-muted' | 'silver' | 'silver-muted' | 'sky' | 'sky-muted' | 'slate' | 'slate-muted' | 'stone' | 'stone-muted' | 'success' | 'success-muted' | 'warning' | 'warning-muted';
|
|
5
5
|
export type BadgeSize = 'xs' | 's' | 'm';
|
|
@@ -20,6 +20,11 @@ export interface BadgeProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
20
20
|
* colored to match the badge's foreground color.
|
|
21
21
|
*/
|
|
22
22
|
iconName?: PDSIcon;
|
|
23
|
+
/**
|
|
24
|
+
* Let a long label wrap onto multiple lines within its container instead
|
|
25
|
+
* of staying on one line and overflowing.
|
|
26
|
+
*/
|
|
27
|
+
isWrappable?: boolean;
|
|
23
28
|
/**
|
|
24
29
|
* Badge text or content.
|
|
25
30
|
*/
|
|
@@ -32,4 +37,4 @@ export interface BadgeProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
32
37
|
/**
|
|
33
38
|
* Badge UI component
|
|
34
39
|
*/
|
|
35
|
-
export declare const Badge: ({ className, color, iconName, label, size, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const Badge: ({ className, color, iconName, isWrappable, label, size, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { StatusDotType } from '../../../libs/components/StatusDot/StatusDot';
|
|
3
|
-
import { ButtonDisplayType, ButtonSize, ButtonType, ButtonVariant } from '../../../libs/types/custom-types';
|
|
4
|
-
import { TallyProps } from '../../badges/Tally/Tally';
|
|
5
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
2
|
+
import { StatusDotType } from '../../../libs/components/StatusDot/StatusDot.js';
|
|
3
|
+
import { ButtonDisplayType, ButtonSize, ButtonType, ButtonVariant } from '../../../libs/types/custom-types.js';
|
|
4
|
+
import { TallyProps } from '../../badges/Tally/Tally.js';
|
|
5
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
6
6
|
import './button.css';
|
|
7
7
|
interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
8
8
|
/**
|
|
@@ -21,6 +21,14 @@ interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
21
21
|
* Is the button disabled?
|
|
22
22
|
*/
|
|
23
23
|
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether `isWorking` disables the button. Defaults to `true`, matching the
|
|
26
|
+
* one-off "action in flight" use case (e.g. a submit button mid-request).
|
|
27
|
+
* Set to `false` for an ongoing, interactive working state — such as a
|
|
28
|
+
* toggle that starts/stops a live process and must stay clickable while
|
|
29
|
+
* it runs.
|
|
30
|
+
*/
|
|
31
|
+
disableWhenWorking?: boolean;
|
|
24
32
|
/**
|
|
25
33
|
* How the button is displayed.
|
|
26
34
|
*/
|
|
@@ -42,7 +50,9 @@ interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
42
50
|
*/
|
|
43
51
|
isSplitButton?: boolean;
|
|
44
52
|
/**
|
|
45
|
-
* Is the button in a working state?
|
|
53
|
+
* Is the button in a working state? Renders a leading spinner (colored and
|
|
54
|
+
* sized to match the button) while keeping the label and icon visible.
|
|
55
|
+
* Disables the button unless `disableWhenWorking` is set to `false`.
|
|
46
56
|
*/
|
|
47
57
|
isWorking?: boolean;
|
|
48
58
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { ButtonDisplayType, ButtonSize, ButtonVariant } from '../../../libs/types/custom-types';
|
|
3
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
2
|
+
import { ButtonDisplayType, ButtonSize, ButtonVariant } from '../../../libs/types/custom-types.js';
|
|
3
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
4
4
|
import '../Button/button.css';
|
|
5
5
|
import './button-link.css';
|
|
6
6
|
/**
|
|
@@ -23,6 +23,11 @@ export interface ButtonLinkProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
23
23
|
* Icon to render in the button. Only necessary if `displayType` is 'icon-start' or 'icon-end'.
|
|
24
24
|
*/
|
|
25
25
|
iconName?: PDSIcon;
|
|
26
|
+
/**
|
|
27
|
+
* Show the loading state. Renders a non-interactive loading button in place
|
|
28
|
+
* of the link until the destination is ready.
|
|
29
|
+
*/
|
|
30
|
+
isLoading?: boolean;
|
|
26
31
|
/**
|
|
27
32
|
* A link element using the router of your choice.
|
|
28
33
|
*/
|
|
@@ -32,7 +37,7 @@ export interface ButtonLinkProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
32
37
|
*/
|
|
33
38
|
size?: ButtonSize;
|
|
34
39
|
/**
|
|
35
|
-
* Text for an optional tooltip to be displayed when the button is `disabled`.
|
|
40
|
+
* Text for an optional tooltip to be displayed when the button is `disabled` or `isLoading`.
|
|
36
41
|
*/
|
|
37
42
|
tooltipText?: string;
|
|
38
43
|
/**
|
|
@@ -43,4 +48,4 @@ export interface ButtonLinkProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
43
48
|
/**
|
|
44
49
|
* ButtonLink UI component
|
|
45
50
|
*/
|
|
46
|
-
export declare const ButtonLink: ({ className, disabled, displayType, iconName, linkContent, size, tooltipText, variant, ...props }: ButtonLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare const ButtonLink: ({ className, disabled, displayType, iconName, isLoading, linkContent, size, tooltipText, variant, ...props }: ButtonLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { IconButtonSize } from '../IconButton/IconButton.js';
|
|
2
3
|
/**
|
|
3
4
|
* Prop types for ClipboardButton
|
|
4
5
|
*/
|
|
@@ -23,6 +24,10 @@ export interface ClipboardButtonProps extends ComponentPropsWithoutRef<'button'>
|
|
|
23
24
|
* Show a visible border around the button.
|
|
24
25
|
*/
|
|
25
26
|
hasBorder?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Which size of button to render.
|
|
29
|
+
*/
|
|
30
|
+
size?: IconButtonSize;
|
|
26
31
|
/**
|
|
27
32
|
* Which variant of button to render.
|
|
28
33
|
*/
|
|
@@ -31,4 +36,4 @@ export interface ClipboardButtonProps extends ComponentPropsWithoutRef<'button'>
|
|
|
31
36
|
/**
|
|
32
37
|
* ClipboardButton UI component
|
|
33
38
|
*/
|
|
34
|
-
export declare const ClipboardButton: ({ ariaLabel, className, clipboardText, disabled, hasBorder, variant, ...props }: ClipboardButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const ClipboardButton: ({ ariaLabel, className, clipboardText, disabled, hasBorder, size, variant, ...props }: ClipboardButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
1
2
|
import './filter-button.css';
|
|
2
3
|
/**
|
|
3
4
|
* A single option the FilterButton can filter by.
|
|
@@ -19,7 +20,7 @@ export interface FilterButtonOption {
|
|
|
19
20
|
/**
|
|
20
21
|
* Prop types for FilterButton
|
|
21
22
|
*/
|
|
22
|
-
export interface FilterButtonProps {
|
|
23
|
+
export interface FilterButtonProps extends Omit<ComponentPropsWithoutRef<'div'>, 'role'> {
|
|
23
24
|
/**
|
|
24
25
|
* Additional class names.
|
|
25
26
|
*/
|
|
@@ -89,4 +90,4 @@ export interface FilterButtonProps {
|
|
|
89
90
|
* Selection is controlled: pass `selectedValues` and handle `onSelectionChange`.
|
|
90
91
|
* The consuming app owns filtering the data with those values.
|
|
91
92
|
*/
|
|
92
|
-
export declare const FilterButton: ({ className, clearLabel, disabled, filterKey, id, minFilterItems, noResultsText, onSelectionChange, options, searchLabel, searchPlaceholder, selectedValues, singleSelect, }: FilterButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export declare const FilterButton: ({ className, clearLabel, disabled, filterKey, id, minFilterItems, noResultsText, onSelectionChange, options, searchLabel, searchPlaceholder, selectedValues, singleSelect, ...props }: FilterButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, MouseEvent } from 'react';
|
|
2
|
-
import { ButtonType } from '../../../libs/types/custom-types';
|
|
3
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
2
|
+
import { ButtonType } from '../../../libs/types/custom-types.js';
|
|
3
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
4
4
|
import './icon-button.css';
|
|
5
|
-
type IconButtonSize = 'xs' | 's' | 'm';
|
|
5
|
+
export type IconButtonSize = 'xs' | 's' | 'm';
|
|
6
6
|
interface IconButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
7
7
|
/**
|
|
8
8
|
* Aria-label attribute.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { type Placement } from '@floating-ui/react';
|
|
3
|
-
import { StatusDotType } from '../../../libs/components/StatusDot/StatusDot';
|
|
4
|
-
import { ButtonVariant, HeadingItemType, LinkItemType, MenuItemType, NodeItemType, SeparatorItemType } from '../../../libs/types/custom-types';
|
|
5
|
-
import { TallyProps } from '../../badges/Tally/Tally';
|
|
6
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
7
|
-
import '@components/Dropdown/dropdown.css';
|
|
3
|
+
import { StatusDotType } from '../../../libs/components/StatusDot/StatusDot.js';
|
|
4
|
+
import { ButtonVariant, HeadingItemType, LinkItemType, MenuItemType, NodeItemType, SeparatorItemType } from '../../../libs/types/custom-types.js';
|
|
5
|
+
import { TallyProps } from '../../badges/Tally/Tally.js';
|
|
6
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
7
|
+
import '@components/overlays/Dropdown/dropdown.css';
|
|
8
8
|
import './menu-button.css';
|
|
9
9
|
type MenuButtonSize = 'xs' | 's' | 'm';
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HeadingItemType, LinkItemType, MenuItemType, SeparatorItemType } from '../../../libs/types/custom-types';
|
|
1
|
+
import { HeadingItemType, LinkItemType, MenuItemType, SeparatorItemType } from '../../../libs/types/custom-types.js';
|
|
2
2
|
export declare const dialogMsgBase = "Activated menu item => ";
|
|
3
3
|
export declare const simpleMenuItems: (MenuItemType | LinkItemType)[];
|
|
4
4
|
export declare const iconMenuItems: MenuItemType[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, MouseEvent } from 'react';
|
|
2
|
-
import { ButtonType } from '../../../libs/types/custom-types';
|
|
2
|
+
import { ButtonType } from '../../../libs/types/custom-types.js';
|
|
3
3
|
import './sso-button.css';
|
|
4
4
|
type SSOButtonSize = 'm' | 'l';
|
|
5
5
|
type PlatformType = 'google' | 'microsoft';
|
|
@@ -16,6 +16,12 @@ interface SSOButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
16
16
|
* Is the button disabled?
|
|
17
17
|
*/
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `isWorking` disables the button. Defaults to `true`. Set to
|
|
21
|
+
* `false` for an ongoing, interactive working state that must stay
|
|
22
|
+
* clickable while it runs.
|
|
23
|
+
*/
|
|
24
|
+
disableWhenWorking?: boolean;
|
|
19
25
|
/**
|
|
20
26
|
* Is the button in a working state?
|
|
21
27
|
*/
|
|
@@ -45,5 +51,5 @@ interface SSOButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
45
51
|
/**
|
|
46
52
|
* A Component used to render an SSO Button
|
|
47
53
|
*/
|
|
48
|
-
export declare const SSOButton: ({ buttonType, className, disabled, isWorking, label, onClick, platform, size, tooltipText, ...props }: SSOButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const SSOButton: ({ buttonType, className, disabled, disableWhenWorking, isWorking, label, onClick, platform, size, tooltipText, ...props }: SSOButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
55
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
1
2
|
import './select-button.css';
|
|
2
3
|
/**
|
|
3
4
|
* A single option the SelectButton can choose between.
|
|
@@ -19,7 +20,7 @@ export interface SelectButtonOption {
|
|
|
19
20
|
/**
|
|
20
21
|
* Prop types for SelectButton
|
|
21
22
|
*/
|
|
22
|
-
export interface SelectButtonProps {
|
|
23
|
+
export interface SelectButtonProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onChange' | 'role'> {
|
|
23
24
|
/**
|
|
24
25
|
* Additional class names.
|
|
25
26
|
*/
|
|
@@ -78,4 +79,4 @@ export interface SelectButtonProps {
|
|
|
78
79
|
*
|
|
79
80
|
* Selection is controlled: pass `value` and handle `onChange`.
|
|
80
81
|
*/
|
|
81
|
-
export declare const SelectButton: ({ className, disabled, id, keyLabel, minFilterItems, noResultsText, onChange, options, searchLabel, searchPlaceholder, value, }: SelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export declare const SelectButton: ({ className, disabled, id, keyLabel, minFilterItems, noResultsText, onChange, options, searchLabel, searchPlaceholder, value, ...props }: SelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import type { Placement } from '@floating-ui/react';
|
|
3
|
-
import { ButtonVariant, LinkItemType, MenuItemType } from '../../../libs/types/custom-types';
|
|
4
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
3
|
+
import { ButtonVariant, LinkItemType, MenuItemType } from '../../../libs/types/custom-types.js';
|
|
4
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
5
5
|
import './split-button.css';
|
|
6
6
|
type SplitButtonSize = 's' | 'm';
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { PDSIcon } from '../../icons/Icon/Icon';
|
|
2
|
+
import { PDSIcon } from '../../icons/Icon/Icon.js';
|
|
3
3
|
import './utility-button.css';
|
|
4
4
|
/**
|
|
5
5
|
* Prop types for UtilityButton
|
|
@@ -17,6 +17,12 @@ export interface UtilityButtonProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
17
17
|
* Is the button disabled?
|
|
18
18
|
*/
|
|
19
19
|
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether `isWorking` disables the button. Defaults to `true`. Set to
|
|
22
|
+
* `false` for an ongoing, interactive working state that must stay
|
|
23
|
+
* clickable while it runs.
|
|
24
|
+
*/
|
|
25
|
+
disableWhenWorking?: boolean;
|
|
20
26
|
/**
|
|
21
27
|
* Should the button have a border?
|
|
22
28
|
*/
|
|
@@ -42,7 +48,9 @@ export interface UtilityButtonProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
42
48
|
*/
|
|
43
49
|
isMonospace?: boolean;
|
|
44
50
|
/**
|
|
45
|
-
* Is the button in the process of performing a task
|
|
51
|
+
* Is the button in the process of performing a task? Renders a spinner in
|
|
52
|
+
* place of the icon, and disables the button unless `disableWhenWorking`
|
|
53
|
+
* is set to `false`.
|
|
46
54
|
*/
|
|
47
55
|
isWorking?: boolean;
|
|
48
56
|
/**
|
|
@@ -67,4 +75,4 @@ export interface UtilityButtonProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
67
75
|
/**
|
|
68
76
|
* UtilityButton UI component
|
|
69
77
|
*/
|
|
70
|
-
export declare const UtilityButton: ({ buttonProps, className, disabled, hasBorder, iconName, iconPosition, isCritical, isLoading, isMonospace, isWorking, label, linkContent, onClick, tooltipText, ...props }: UtilityButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare const UtilityButton: ({ buttonProps, className, disabled, disableWhenWorking, hasBorder, iconName, iconPosition, isCritical, isLoading, isMonospace, isWorking, label, linkContent, onClick, tooltipText, ...props }: UtilityButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { CardBackground, CardPaddingScale } from '../../../libs/types/layout-types';
|
|
3
|
-
import { CardImageVariant } from '
|
|
2
|
+
import { CardBackground, CardPaddingScale } from '../../../libs/types/layout-types.js';
|
|
3
|
+
import { CardImageVariant } from '../Card/Card.js';
|
|
4
4
|
import './action-card.css';
|
|
5
5
|
export interface ActionCardPrimaryAction {
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { CardBackground, CardPaddingScale, ImageDisplayVariant } from '../../../libs/types/layout-types';
|
|
2
|
+
import { CardBackground, CardPaddingScale, ImageDisplayVariant } from '../../../libs/types/layout-types.js';
|
|
3
3
|
import './card.css';
|
|
4
4
|
export type CardImageVariant = ImageDisplayVariant;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { CardBackground, CardPaddingScale } from '../../../libs/types/layout-types';
|
|
2
|
+
import { CardBackground, CardPaddingScale } from '../../../libs/types/layout-types.js';
|
|
3
3
|
import './card-select.css';
|
|
4
4
|
export interface CardOption {
|
|
5
5
|
/**
|
|
@@ -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,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;
|