@pantheon-systems/pds-toolkit-react 2.0.0-alpha.9 → 2.0.0-alpha.91
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/bin/pds-codemod.cjs +58 -0
- package/codemods/v1-to-v2/css-token-renames.js +186 -0
- package/codemods/v1-to-v2/mappings.json +1824 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/basic.input.tsx +33 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/basic.output.tsx +33 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/only.input.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/component-renames/only.output.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-removals/basic.input.tsx +55 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-removals/basic.output.tsx +55 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-renames/basic.input.tsx +60 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/css-class-renames/basic.output.tsx +60 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/basic.input.tsx +35 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/basic.output.tsx +35 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/only.input.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/icon-name-updates/only.output.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/basic.input.tsx +28 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/basic.output.tsx +28 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/only.input.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-renames/only.output.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/basic.input.tsx +37 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/basic.output.tsx +37 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/only.input.tsx +21 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/prop-value-standardization/only.output.tsx +21 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/basic.input.tsx +60 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/basic.output.tsx +51 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/only.input.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__testfixtures__/removed-prop-values/only.output.tsx +8 -0
- package/codemods/v1-to-v2/transforms/__tests__/component-renames.test.js +15 -0
- package/codemods/v1-to-v2/transforms/__tests__/css-class-removals.test.js +6 -0
- package/codemods/v1-to-v2/transforms/__tests__/css-class-renames.test.js +6 -0
- package/codemods/v1-to-v2/transforms/__tests__/icon-name-updates.test.js +15 -0
- package/codemods/v1-to-v2/transforms/__tests__/prop-renames.test.js +15 -0
- package/codemods/v1-to-v2/transforms/__tests__/prop-value-standardization.test.js +16 -0
- package/codemods/v1-to-v2/transforms/__tests__/removed-prop-values.test.js +15 -0
- package/codemods/v1-to-v2/transforms/component-renames.js +166 -0
- package/codemods/v1-to-v2/transforms/css-class-removals.js +262 -0
- package/codemods/v1-to-v2/transforms/css-class-renames.js +178 -0
- package/codemods/v1-to-v2/transforms/icon-name-updates.js +124 -0
- package/codemods/v1-to-v2/transforms/prop-renames.js +109 -0
- package/codemods/v1-to-v2/transforms/prop-value-standardization.js +143 -0
- package/codemods/v1-to-v2/transforms/removed-prop-values.js +206 -0
- package/dist/components/Callout/Callout.d.ts +6 -2
- package/dist/components/CodeBlock/CodeBlock.d.ts +10 -5
- package/dist/components/CodeBlock/code-examples.d.ts +2 -1
- package/dist/components/CodeBlock/prism-setup.d.ts +2 -0
- package/dist/components/CodeBlock/themes/index.d.ts +1 -2
- package/dist/components/CodeBlock/themes/{pdsDark.d.ts → pds.d.ts} +1 -1
- package/dist/components/ComparisonList/ComparisonList.d.ts +6 -1
- package/dist/components/Dropdown/Dropdown.d.ts +257 -0
- package/dist/components/Dropdown/DropdownSelectedIcon.d.ts +7 -0
- package/dist/components/FileDiff/FileDiff.d.ts +2 -2
- package/dist/components/PantheonLogo/PantheonLogo.d.ts +5 -4
- package/dist/components/Popover/Popover.d.ts +6 -2
- package/dist/components/ResultCount/ResultCount.d.ts +53 -0
- package/dist/components/RowActionsMenu/RowActionsMenu.d.ts +46 -0
- package/dist/components/SiteFooter/SiteFooter.d.ts +45 -0
- package/dist/components/{navigation/DashboardSearch/DashboardSearch.d.ts → SiteSearch/SiteSearch.d.ts} +6 -11
- package/dist/components/SortableList/SortableList.d.ts +8 -0
- package/dist/components/SortableList/SortableListHeader.d.ts +7 -0
- package/dist/components/SortableList/SortableRow.d.ts +16 -0
- package/dist/components/SortableList/sortable-utils.d.ts +19 -0
- package/dist/components/SortableList/types.d.ts +142 -0
- package/dist/components/SortableList/useSortableTree.d.ts +18 -0
- package/dist/components/StatPanel/StatPanel.d.ts +70 -0
- package/dist/components/{RefreshChecker/RefreshChecker.d.ts → StatusChecker/StatusChecker.d.ts} +6 -19
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +7 -4
- package/dist/components/StatusScrim/StatusScrim.d.ts +22 -0
- package/dist/components/Table/Table.d.ts +386 -17
- package/dist/components/TableOfContents/TableOfContents.d.ts +1 -5
- package/dist/components/Tag/Tag.d.ts +21 -3
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +29 -8
- package/dist/components/Tooltip/Tooltip.d.ts +15 -4
- package/dist/components/UtilityBar/UtilityBar.d.ts +26 -0
- package/dist/components/badges/Badge/Badge.d.ts +10 -3
- package/dist/components/badges/StatusBadge/StatusBadge.d.ts +2 -1
- package/dist/components/buttons/Button/Button.d.ts +15 -0
- package/dist/components/buttons/ButtonLink/ButtonLink.d.ts +1 -3
- package/dist/components/buttons/ClipboardButton/ClipboardButton.d.ts +5 -1
- package/dist/components/buttons/CloseButton/CloseButton.d.ts +2 -2
- package/dist/components/buttons/FilterButton/FilterButton.d.ts +92 -0
- package/dist/components/buttons/IconButton/IconButton.d.ts +13 -1
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +70 -20
- package/dist/components/buttons/SSOButton/SSOButton.d.ts +9 -1
- package/dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +44 -8
- package/dist/components/buttons/SelectButton/SelectButton.d.ts +81 -0
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +26 -1
- package/dist/components/cards/ActionCard/ActionCard.d.ts +64 -0
- package/dist/components/cards/Card/Card.d.ts +10 -4
- package/dist/components/cards/CardSelect/CardSelect.d.ts +100 -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/PieChart/PieChart.d.ts +59 -0
- package/dist/components/charts/ProportionBar/ProportionBar.d.ts +57 -0
- package/dist/components/charts/shared/ChartAccessibleTable.d.ts +17 -0
- package/dist/components/charts/shared/ChartLegend.d.ts +31 -0
- package/dist/components/charts/shared/ChartSkeleton.d.ts +11 -0
- package/dist/components/charts/shared/chart-colors.d.ts +30 -0
- package/dist/components/charts/shared/chart-styles.d.ts +24 -0
- package/dist/components/charts/shared/formatters.d.ts +12 -0
- package/dist/components/charts/shared/types.d.ts +128 -0
- package/dist/components/empty-states/HorizontalEmptyState/HorizontalEmptyState.d.ts +13 -8
- package/dist/components/empty-states/VerticalEmptyState/VerticalEmptyState.d.ts +3 -2
- package/dist/components/icons/Icon/Icon.d.ts +2 -2
- package/dist/components/icons/Icon/custom-icons.d.ts +1 -1
- package/dist/components/icons/Icon/generated-icon-data.d.ts +253 -15
- package/dist/components/icons/PaymentIcon/PaymentIcon.d.ts +7 -3
- package/dist/components/icons/PlatformIcon/PlatformIcon.d.ts +6 -6
- package/dist/components/{Avatar → identity/Avatar}/Avatar.d.ts +8 -3
- package/dist/components/identity/AvatarLabel/AvatarLabel.d.ts +42 -0
- package/dist/components/identity/IdentityBlock/IdentityBlock.d.ts +37 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +11 -1
- package/dist/components/inputs/CheckboxFieldset/CheckboxFieldset.d.ts +20 -2
- package/dist/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +20 -2
- package/dist/components/inputs/Combobox/Combobox.d.ts +33 -7
- package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +26 -5
- package/dist/components/inputs/Datepicker/Datepicker.d.ts +280 -16
- package/dist/components/inputs/FileUpload/FileUpload.d.ts +16 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +20 -2
- package/dist/components/inputs/Select/Select.d.ts +35 -3
- package/dist/components/inputs/Switch/Switch.d.ts +15 -5
- package/dist/components/inputs/TagsInput/TagsInput.d.ts +16 -1
- package/dist/components/inputs/TextInput/TextInput.d.ts +14 -4
- package/dist/components/inputs/Textarea/Textarea.d.ts +12 -2
- package/dist/components/inputs/Timepicker/Timepicker.d.ts +104 -0
- package/dist/components/inputs/input-utilities.d.ts +16 -1
- package/dist/components/{CTALink → links/CTALink}/CTALink.d.ts +2 -2
- package/dist/components/{LinkNewWindow → links/LinkNewWindow}/LinkNewWindow.d.ts +1 -1
- package/dist/components/loading-indicators/Spinner/Spinner.d.ts +5 -4
- package/dist/components/navigation/BookmarksMenu/BookmarksMenu.d.ts +151 -0
- package/dist/components/navigation/ButtonNav/ButtonNav.d.ts +11 -5
- package/dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/components/navigation/Navbar/Navbar.d.ts +16 -15
- package/dist/components/navigation/SideNav/SideNav.d.ts +7 -1
- package/dist/components/navigation/SideNavGlobal/SideNavGlobal.d.ts +5 -15
- package/dist/components/navigation/SideNavGlobal/SideNavGlobalItem.d.ts +15 -1
- package/dist/components/navigation/SiteMenu/SiteMenu.d.ts +26 -0
- package/dist/components/navigation/SiteMenu/SiteMenuDropdown.d.ts +23 -0
- package/dist/components/navigation/TreeNav/TreeNav.d.ts +48 -0
- package/dist/components/navigation/UserMenu/UserMenu.d.ts +31 -5
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +13 -16
- package/dist/components/navigation/navigation-utilities.d.ts +15 -2
- package/dist/components/notifications/SectionMessage/SectionMessage.d.ts +12 -4
- package/dist/components/notifications/Toaster/Toast.d.ts +12 -1
- package/dist/components/notifications/Toaster/Toaster.d.ts +16 -7
- package/dist/components/notifications/Toaster/useToast.d.ts +2 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +66 -0
- package/dist/components/overlays/BulkActionBar/BulkActionBar.d.ts +48 -0
- package/dist/components/{Drawer → overlays/Drawer}/Drawer.d.ts +4 -4
- package/dist/components/overlays/FullScreenOverlay/FullScreenOverlay.d.ts +45 -0
- package/dist/components/{Modal → overlays/Modal}/Modal.d.ts +3 -1
- package/dist/components/{Pagination → pagination/Pagination}/Pagination.d.ts +7 -2
- package/dist/components/pagination/PaginationChapter/PaginationChapter.d.ts +55 -0
- package/dist/components/pagination/PaginationCompact/PaginationCompact.d.ts +67 -0
- package/dist/components/panels/BookmarksPanel/BookmarksPanel.d.ts +67 -0
- package/dist/components/panels/ExpansionPanel/ExpansionPanel.d.ts +1 -2
- package/dist/components/panels/ExpansionPanelGroup/ExpansionPanelGroup.d.ts +1 -2
- package/dist/components/panels/FeaturePanel/FeaturePanel.d.ts +72 -0
- package/dist/components/panels/Panel/Panel.d.ts +3 -3
- package/dist/components/panels/PanelList/PanelList.d.ts +2 -2
- package/dist/components/panels/PanelList/PanelRow.d.ts +9 -1
- package/dist/components/panels/PanelStack/PanelStack.d.ts +19 -0
- package/dist/components/panels/WidgetPanel/WidgetPanel.d.ts +39 -0
- package/dist/components/panels/WorkspaceSelectorPanel/WorkspaceSelectorPanel.d.ts +57 -0
- package/dist/components/progress-indicators/ProgressBar/ProgressBar.d.ts +4 -5
- package/dist/components/progress-indicators/ProgressRing/ProgressRing.d.ts +12 -4
- package/dist/components/{FlowSteps/FlowSteps.d.ts → steppers/StepList/StepList.d.ts} +7 -7
- package/dist/css/component-css/pds-Table.stories.css +1 -0
- package/dist/css/component-css/pds-action-card.css +1 -0
- package/dist/css/component-css/pds-avatar-label.css +1 -0
- package/dist/css/component-css/pds-avatar.css +1 -1
- 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-bar-chart.css +1 -0
- package/dist/css/component-css/pds-bookmarks-menu.css +1 -0
- package/dist/css/component-css/pds-bookmarks-panel.css +1 -0
- package/dist/css/component-css/pds-bottom-sheet.css +1 -0
- package/dist/css/component-css/pds-branch-diff.css +1 -1
- package/dist/css/component-css/pds-breadcrumb.css +1 -1
- package/dist/css/component-css/pds-bulk-action-bar.css +1 -0
- package/dist/css/component-css/pds-button-link.css +1 -1
- package/dist/css/component-css/pds-button-nav.css +1 -1
- package/dist/css/component-css/pds-button.css +46 -14
- package/dist/css/component-css/pds-callout.css +1 -1
- package/dist/css/component-css/pds-card-select.css +2 -0
- package/dist/css/component-css/pds-card.css +1 -1
- package/dist/css/component-css/pds-chart-legend.css +1 -0
- package/dist/css/component-css/pds-chart-wrapper.css +1 -0
- package/dist/css/component-css/pds-checkbox-group.css +1 -1
- package/dist/css/component-css/pds-checkbox.css +1 -1
- package/dist/css/component-css/pds-close-button.css +1 -1
- package/dist/css/component-css/pds-code-block-legacy.css +1 -1
- package/dist/css/component-css/pds-code-block.css +1 -1
- package/dist/css/component-css/pds-combobox-multiselect.css +3 -2
- package/dist/css/component-css/pds-combobox.css +1 -1
- package/dist/css/component-css/pds-compact-empty-state.css +1 -1
- package/dist/css/component-css/pds-comparison-list.css +1 -1
- package/dist/css/component-css/pds-cta-link.css +1 -1
- package/dist/css/component-css/pds-datepicker.css +1 -3
- package/dist/css/component-css/pds-drawer.css +1 -1
- package/dist/css/component-css/pds-dropdown-menu.css +2 -2
- package/dist/css/component-css/pds-dropdown.css +3 -0
- package/dist/css/component-css/pds-expansion-panel-group.css +1 -1
- package/dist/css/component-css/pds-expansion-panel.css +2 -1
- package/dist/css/component-css/pds-feature-panel.css +15 -0
- package/dist/css/component-css/pds-file-diff.css +1 -1
- package/dist/css/component-css/pds-file-upload.css +1 -7
- package/dist/css/component-css/pds-filter-button.css +1 -0
- package/dist/css/component-css/pds-full-screen-overlay.css +1 -0
- package/dist/css/component-css/pds-horizontal-empty-state.css +1 -1
- package/dist/css/component-css/pds-icon-button.css +22 -14
- package/dist/css/component-css/pds-icon-story-only.css +1 -1
- package/dist/css/component-css/pds-icon.css +1 -1
- package/dist/css/component-css/pds-identity-block.css +1 -0
- package/dist/css/component-css/pds-index.css +189 -63
- package/dist/css/component-css/pds-inline-message.css +1 -1
- package/dist/css/component-css/pds-input-group.css +1 -1
- 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-link-new-window.css +1 -1
- package/dist/css/component-css/pds-menu-button.css +11 -1
- package/dist/css/component-css/pds-modal.css +1 -1
- package/dist/css/component-css/pds-nav-menu.css +1 -5
- package/dist/css/component-css/pds-navbar.css +4 -1
- package/dist/css/component-css/pds-pagination-chapter.css +3 -0
- package/dist/css/component-css/pds-pagination-compact.css +1 -0
- package/dist/css/component-css/pds-pagination.css +1 -1
- package/dist/css/component-css/pds-panel-list.css +1 -1
- package/dist/css/component-css/pds-panel-stack.css +1 -0
- package/dist/css/component-css/pds-panel.css +2 -1
- package/dist/css/component-css/pds-pantheon-logo.css +1 -1
- package/dist/css/component-css/pds-payment-icon.css +1 -1
- package/dist/css/component-css/pds-picture.css +1 -1
- package/dist/css/component-css/pds-pie-chart.css +1 -0
- package/dist/css/component-css/pds-platform-icon.css +1 -1
- package/dist/css/component-css/pds-popover.css +1 -1
- package/dist/css/component-css/pds-progress-bar.css +1 -1
- package/dist/css/component-css/pds-progress-ring.css +1 -1
- package/dist/css/component-css/pds-proportion-bar.css +1 -0
- package/dist/css/component-css/pds-radio-group.css +1 -1
- package/dist/css/component-css/pds-result-count.css +1 -0
- package/dist/css/component-css/pds-row-actions-menu.css +2 -0
- package/dist/css/component-css/pds-section-message.css +1 -1
- package/dist/css/component-css/pds-segmented-button.css +2 -1
- package/dist/css/component-css/pds-select-button.css +1 -0
- package/dist/css/component-css/pds-select.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +3 -7
- package/dist/css/component-css/pds-side-nav.css +3 -1
- package/dist/css/component-css/pds-site-footer.css +1 -1
- package/dist/css/component-css/pds-site-search.css +1 -0
- package/dist/css/component-css/pds-skeleton.css +1 -1
- package/dist/css/component-css/pds-skiplink.css +1 -1
- package/dist/css/component-css/pds-sortable-list.css +8 -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 +2 -2
- package/dist/css/component-css/pds-stat-panel.css +1 -0
- package/dist/css/component-css/pds-status-badge.css +1 -1
- package/dist/css/component-css/pds-status-checker.css +1 -0
- package/dist/css/component-css/pds-status-indicator.css +1 -1
- package/dist/css/component-css/pds-status-scrim.css +1 -0
- package/dist/css/component-css/pds-step-list.css +1 -0
- package/dist/css/component-css/pds-stepper.css +5 -1
- package/dist/css/component-css/pds-switch.css +6 -11
- package/dist/css/component-css/pds-tab-menu.css +2 -2
- package/dist/css/component-css/pds-table-of-contents.css +1 -1
- package/dist/css/component-css/pds-table.css +7 -1
- 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 +1 -1
- package/dist/css/component-css/pds-tally.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-theme-switcher.css +1 -1
- package/dist/css/component-css/pds-timepicker.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-tree-nav.css +1 -0
- package/dist/css/component-css/pds-user-menu-story-only.css +1 -1
- package/dist/css/component-css/pds-user-menu.css +32 -1
- package/dist/css/component-css/pds-utility-bar.css +1 -0
- package/dist/css/component-css/pds-utility-button.css +3 -1
- 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-video-embed.css +1 -1
- package/dist/css/component-css/pds-widget-panel.css +1 -0
- package/dist/css/component-css/pds-workspace-selector-panel.css +1 -0
- package/dist/css/component-css/pds-workspace-selector.css +23 -1
- package/dist/css/design-tokens/variables.dark.css +371 -340
- package/dist/css/design-tokens/variables.global.css +10 -19
- package/dist/css/design-tokens/variables.light.css +367 -316
- package/dist/css/design-tokens/variables.typography.css +1 -2
- package/dist/css/layout-css/pds-app-layout.css +3 -2
- package/dist/css/layout-css/pds-docs-layout.css +1 -1
- package/dist/css/layout-css/pds-index.css +3 -9
- package/dist/css/layout-css/pds-sidebar-layout.css +13 -0
- package/dist/css/layout-css/pds-stat-panel-group.css +1 -0
- package/dist/css/layout-css/pds-stepper-layout.css +1 -1
- package/dist/css/layout-css/pds-three-item-layout.css +1 -1
- package/dist/css/layout-css/pds-two-item-layout.css +1 -1
- package/dist/css/pds-components.css +189 -63
- package/dist/css/pds-core.css +3 -2
- package/dist/css/pds-layouts.css +3 -9
- package/dist/index.css +5 -1
- package/dist/index.d.ts +101 -9
- package/dist/index.js +13601 -6078
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +59 -42
- package/dist/layouts/AppLayout/AppLayout.d.ts +85 -10
- package/dist/layouts/DocsLayout/DocsLayout.d.ts +9 -7
- package/dist/layouts/SidebarLayout/SidebarLayout.d.ts +41 -7
- package/dist/layouts/StatPanelGroup/StatPanelGroup.d.ts +32 -0
- package/dist/layouts/StepperLayout/StepperLayout.d.ts +13 -1
- package/dist/layouts/ThreeItemLayout/ThreeItemLayout.d.ts +3 -3
- package/dist/layouts/TwoItemLayout/TwoItemLayout.d.ts +3 -3
- package/dist/libs/components/NavAccordion/NavAccordion.d.ts +27 -0
- package/dist/libs/components/NestedOverlayContext.d.ts +14 -0
- package/dist/libs/components/StatusDot/StatusDot.d.ts +15 -0
- package/dist/libs/components/WorkspaceListItem/WorkspaceListItem.d.ts +40 -0
- package/dist/libs/components/useOverlayZIndex.d.ts +16 -0
- package/dist/libs/components/utils.d.ts +1 -1
- package/dist/libs/types/custom-types.d.ts +11 -5
- package/dist/libs/types/layout-types.d.ts +6 -1
- package/dist/libs/types/navigation-types.d.ts +17 -1
- package/dist/svg/anglesDown.svg +3 -0
- package/dist/svg/anglesUp.svg +3 -0
- package/dist/svg/arrowDownWideShort.svg +3 -0
- package/dist/svg/arrowUpShortWide.svg +3 -0
- package/dist/svg/barsStaggered.svg +3 -0
- package/dist/svg/bookmark.svg +3 -0
- package/dist/svg/bookmarkSolid.svg +3 -0
- package/dist/svg/box.svg +3 -0
- package/dist/svg/circleExclamationSolid.svg +3 -0
- package/dist/svg/circleHalfStroke.svg +3 -0
- package/dist/svg/circleInfoSolid.svg +3 -0
- package/dist/svg/circleQuestionSolid.svg +3 -0
- package/dist/svg/claude.svg +3 -0
- package/dist/svg/clock.svg +3 -0
- package/dist/svg/collapseToCenter.svg +3 -0
- package/dist/svg/compress.svg +3 -0
- package/dist/svg/diagramVenn.svg +3 -0
- package/dist/svg/files.svg +3 -0
- package/dist/svg/floppyDisk.svg +3 -0
- package/dist/svg/folders.svg +3 -0
- package/dist/svg/grid.svg +2 -2
- package/dist/svg/grid2.svg +3 -0
- package/dist/svg/landmark.svg +3 -0
- package/dist/svg/list.svg +3 -0
- package/dist/svg/move.svg +3 -0
- package/dist/svg/octagonExclamation.svg +3 -0
- package/dist/svg/openai.svg +3 -0
- package/dist/svg/pause.svg +3 -0
- package/dist/svg/penPaintbrush.svg +3 -0
- package/dist/svg/rectanglesMixed.svg +3 -0
- package/dist/svg/sidebar.svg +3 -0
- package/dist/svg/slider.svg +3 -0
- package/dist/svg/squareDashed.svg +3 -0
- package/dist/svg/tableColumns.svg +3 -0
- package/dist/svg/userSolid.svg +3 -0
- package/dist/{layouts → utilities}/FlexContainer/FlexContainer.d.ts +7 -7
- package/dist/utilities/GlobalWrapper/GlobalWrapper.d.ts +35 -0
- package/dist/utilities/ai-visuals/AiVisualsDemo.d.ts +8 -0
- package/dist/utilities/auto-grid/AutoGrid.d.ts +48 -0
- package/dist/utilities/context-providers/ThemeContext/ThemeContext.d.ts +113 -0
- package/dist/utilities/grid/Grid.d.ts +56 -0
- package/dist/utilities/grid/GridItem.d.ts +57 -0
- package/dist/utilities/hooks/useDropdown/index.d.ts +1 -0
- package/dist/utilities/hooks/useDropdown/useDropdown.d.ts +154 -0
- package/dist/utilities/hooks/useIsMobile/useIsMobile.d.ts +16 -0
- package/dist/utilities/hooks/useKeyPress/useKeyPress.d.ts +6 -0
- package/dist/utilities/hooks/useKeyboardShortcut/useKeyboardShortcut.d.ts +29 -0
- package/package.json +82 -46
- package/dist/components/CTASlice/CTASlice.d.ts +0 -43
- package/dist/components/CodeBlock/themes/pdsLight.d.ts +0 -2
- package/dist/components/DashboardStat/DashboardStat.d.ts +0 -28
- package/dist/components/PullQuote/PullQuote.d.ts +0 -34
- package/dist/components/SiteDashboardHeading/SiteDashboardHeading.d.ts +0 -62
- package/dist/components/SocialLinks/SocialLinks.d.ts +0 -23
- package/dist/components/cards/CardHeading/CardHeading.d.ts +0 -31
- package/dist/components/cards/CardSelectGroup/CardSelectGroup.d.ts +0 -60
- package/dist/components/cards/EmptyStateCard/EmptyStateCard.d.ts +0 -36
- package/dist/components/cards/LinksCard/LinksCard.d.ts +0 -29
- package/dist/components/cards/LinksCard/links-card-sample-data.d.ts +0 -2
- package/dist/components/cards/NewSiteCard/NewSiteCard.d.ts +0 -61
- package/dist/components/cards/PaymentCard/PaymentCard.d.ts +0 -47
- package/dist/components/cards/PricingCard/PricingCard.d.ts +0 -95
- package/dist/components/cards/SiteCard/SiteCard.d.ts +0 -50
- package/dist/components/footer/FooterHeading/FooterHeading.d.ts +0 -22
- package/dist/components/footer/FooterLinks/FooterLinks.d.ts +0 -26
- package/dist/components/footer/SiteFooter/SiteFooter.d.ts +0 -34
- package/dist/components/footer/SiteFooter/footer-content.d.ts +0 -1
- package/dist/components/navigation/DashboardNav/DashboardNav.d.ts +0 -35
- package/dist/components/navigation/DashboardNav/DashboardNavItem.d.ts +0 -24
- package/dist/components/navigation/NavMenu/NavMenu.d.ts +0 -33
- package/dist/components/navigation/NavMenu/NavMenuDropdown.d.ts +0 -24
- package/dist/components/navigation/SideNavCompact/SideNavCompact.d.ts +0 -53
- package/dist/components/notifications/NotificationHubIcon/NotificationHubIcon.d.ts +0 -38
- package/dist/components/notifications/NotificationsPopover/NotificationsPopover.d.ts +0 -118
- package/dist/components/tiles/AvatarTileList/AvatarTileList.d.ts +0 -28
- package/dist/components/tiles/Tile/Tile.d.ts +0 -42
- package/dist/components/tiles/TileGrid/TileGrid.d.ts +0 -29
- package/dist/css/component-css/pds-avatar-tile-list.css +0 -1
- package/dist/css/component-css/pds-card-heading.css +0 -1
- package/dist/css/component-css/pds-card-select-group.css +0 -1
- package/dist/css/component-css/pds-cta-slice.css +0 -1
- package/dist/css/component-css/pds-dashboard-nav.css +0 -5
- package/dist/css/component-css/pds-dashboard-search.css +0 -1
- package/dist/css/component-css/pds-dashboard-stat.css +0 -1
- package/dist/css/component-css/pds-empty-state-card.css +0 -1
- package/dist/css/component-css/pds-flow-steps.css +0 -1
- package/dist/css/component-css/pds-footer-heading.css +0 -1
- package/dist/css/component-css/pds-footer-links.css +0 -1
- package/dist/css/component-css/pds-links-card.css +0 -1
- package/dist/css/component-css/pds-new-site-card.css +0 -1
- package/dist/css/component-css/pds-notification-hub-icon.css +0 -1
- package/dist/css/component-css/pds-notifications-popover.css +0 -1
- package/dist/css/component-css/pds-payment-card.css +0 -1
- package/dist/css/component-css/pds-pricing-card-local.css +0 -1
- package/dist/css/component-css/pds-pricing-card.css +0 -1
- package/dist/css/component-css/pds-pull-quote.css +0 -1
- package/dist/css/component-css/pds-refresh-checker.css +0 -1
- package/dist/css/component-css/pds-side-nav-compact.css +0 -1
- package/dist/css/component-css/pds-site-card.css +0 -1
- package/dist/css/component-css/pds-site-dashboard-heading.css +0 -1
- package/dist/css/component-css/pds-social-links.css +0 -1
- package/dist/css/component-css/pds-tile.css +0 -1
- package/dist/css/component-css/pds-tiles-common.css +0 -1
- package/dist/css/layout-css/pds-dashboard-global.css +0 -8
- package/dist/css/layout-css/pds-dashboard-inner.css +0 -1
- package/dist/css/layout-css/pds-flex-container.css +0 -1
- package/dist/layouts/DashboardGlobal/DashboardGlobal.d.ts +0 -57
- package/dist/layouts/DashboardInner/DashboardInner.d.ts +0 -30
- package/dist/layouts/GlobalWrapper/GlobalWrapper.d.ts +0 -19
- package/dist/utilities/context-providers/ResponsiveContext/ResponsiveContext.d.ts +0 -6
- /package/dist/components/{Skiplink → links/Skiplink}/Skiplink.d.ts +0 -0
- /package/dist/components/{Picture → media/Picture}/Picture.d.ts +0 -0
- /package/dist/components/{VideoEmbed → media/VideoEmbed}/VideoEmbed.d.ts +0 -0
- /package/dist/components/{Pagination → pagination/Pagination}/usePagination.d.ts +0 -0
- /package/dist/components/{FlowSteps → steppers/StepList}/example-steps.d.ts +0 -0
- /package/dist/svg/{linkSimple.svg → link.svg} +0 -0
- /package/dist/svg/{linkSimpleSlash.svg → unlink.svg} +0 -0
- /package/dist/{layouts → utilities}/Container/Container.d.ts +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React, { ReactNode, RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The user's color-mode choice. Matches the ThemeSwitcher component's options.
|
|
4
|
+
* `'system'` follows the OS via `prefers-color-scheme`.
|
|
5
|
+
*/
|
|
6
|
+
export type Theme = 'light' | 'dark' | 'system';
|
|
7
|
+
/**
|
|
8
|
+
* The concrete theme applied to the `data-theme` attribute. `'system'` is
|
|
9
|
+
* resolved to one of these before being applied.
|
|
10
|
+
*/
|
|
11
|
+
export type ResolvedTheme = 'light' | 'dark';
|
|
12
|
+
interface ThemeContextValue {
|
|
13
|
+
/** Resolved theme applied to `data-theme` (`'system'` → `'light' | 'dark'`). */
|
|
14
|
+
resolvedTheme: ResolvedTheme;
|
|
15
|
+
/** Update the theme. In controlled mode this only notifies `onThemeChange`. */
|
|
16
|
+
setTheme: (theme: Theme) => void;
|
|
17
|
+
/** The user's current choice (`'system'` preserved as-is). */
|
|
18
|
+
theme: Theme;
|
|
19
|
+
}
|
|
20
|
+
export declare const ThemeContext: React.Context<ThemeContextValue>;
|
|
21
|
+
/**
|
|
22
|
+
* Prop types for ThemeContextProvider
|
|
23
|
+
*/
|
|
24
|
+
export interface ThemeContextProviderProps {
|
|
25
|
+
/**
|
|
26
|
+
* Child components.
|
|
27
|
+
*/
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Fallback theme when nothing is stored (and in uncontrolled mode).
|
|
31
|
+
* Defaults to `'light'`.
|
|
32
|
+
*/
|
|
33
|
+
defaultTheme?: Theme;
|
|
34
|
+
/**
|
|
35
|
+
* Opt out of the inline anti-flash script the provider renders before its
|
|
36
|
+
* children. That script sets `data-theme` from `localStorage` during SSR
|
|
37
|
+
* before first paint, preventing a flash of the wrong theme. It is only
|
|
38
|
+
* rendered for the uncontrolled, persisted, whole-page case (no `nodeRef`);
|
|
39
|
+
* set this to `true` to suppress it — for example, if you inject the script
|
|
40
|
+
* yourself via {@link getThemeInitScript}. Defaults to `false`.
|
|
41
|
+
*/
|
|
42
|
+
disableInitScript?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Element to receive the `data-theme` attribute. Defaults to
|
|
45
|
+
* `document.documentElement` (the whole page). Provide a ref to scope theming
|
|
46
|
+
* to a subtree — for example, an embedded preview or a themed region.
|
|
47
|
+
*/
|
|
48
|
+
nodeRef?: RefObject<HTMLElement | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Callback fired whenever the user changes the theme. This is the hook point
|
|
51
|
+
* for persisting to a server/preference service later. Fires in both
|
|
52
|
+
* controlled and uncontrolled modes.
|
|
53
|
+
*/
|
|
54
|
+
onThemeChange?: (theme: Theme) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to persist the theme to `localStorage`. Ignored in controlled
|
|
57
|
+
* mode (when `theme` is provided). Defaults to `true`.
|
|
58
|
+
*/
|
|
59
|
+
persist?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* `localStorage` key used to persist the theme. Defaults to `'pds-theme'`.
|
|
62
|
+
*/
|
|
63
|
+
storageKey?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Controlled theme value. When provided, the consuming app owns the value
|
|
66
|
+
* (for example, sourced from a preference service) and the provider stops
|
|
67
|
+
* writing to `localStorage` — it only resolves and applies the value. Pair
|
|
68
|
+
* with `onThemeChange` to receive user-initiated changes.
|
|
69
|
+
*/
|
|
70
|
+
theme?: Theme;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Options for {@link getThemeInitScript}. Match these to the values passed to
|
|
74
|
+
* the `ThemeContextProvider` (or `GlobalWrapper`'s `themeProps`).
|
|
75
|
+
*/
|
|
76
|
+
export interface ThemeInitScriptOptions {
|
|
77
|
+
/** Fallback theme when nothing is stored. Defaults to `'light'`. */
|
|
78
|
+
defaultTheme?: Theme;
|
|
79
|
+
/** `localStorage` key the provider persists to. Defaults to `'pds-theme'`. */
|
|
80
|
+
storageKey?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns a tiny synchronous script (as a string) that sets the `data-theme`
|
|
84
|
+
* attribute on the document root from the persisted preference **before first
|
|
85
|
+
* paint** — preventing a flash of the wrong theme on server-rendered pages (a
|
|
86
|
+
* flash the provider alone cannot prevent, since it only applies the theme
|
|
87
|
+
* after hydration).
|
|
88
|
+
*
|
|
89
|
+
* The `ThemeContextProvider` renders this script automatically for the
|
|
90
|
+
* uncontrolled, persisted, whole-page case, so most apps never call this
|
|
91
|
+
* directly. It is exported for advanced setups that want to place the script
|
|
92
|
+
* themselves (for example, in the document `<head>`). Note: importing it drags
|
|
93
|
+
* in this client module, so it cannot be called from a React Server Component —
|
|
94
|
+
* let the provider inject it, or inline the string. Either way, add
|
|
95
|
+
* `suppressHydrationWarning` to the `<html>` element, since the script mutates
|
|
96
|
+
* it before React hydrates.
|
|
97
|
+
*/
|
|
98
|
+
export declare const getThemeInitScript: ({ defaultTheme, storageKey, }?: ThemeInitScriptOptions) => string;
|
|
99
|
+
/**
|
|
100
|
+
* ThemeContextProvider — owns color-mode state and drives the `data-theme`
|
|
101
|
+
* attribute on the document root.
|
|
102
|
+
*
|
|
103
|
+
* Works standalone or via `GlobalWrapper`'s opt-in. Persists to `localStorage`
|
|
104
|
+
* by default, and exposes a controlled mode (`theme` + `onThemeChange`) so an
|
|
105
|
+
* application can take over persistence.
|
|
106
|
+
*/
|
|
107
|
+
export declare const ThemeContextProvider: ({ children, defaultTheme, disableInitScript, nodeRef, onThemeChange, persist, storageKey, theme: controlledTheme, }: ThemeContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
/**
|
|
109
|
+
* Access the current theme, the resolved theme, and a setter. Returns a no-op
|
|
110
|
+
* default when no `ThemeContextProvider` is present.
|
|
111
|
+
*/
|
|
112
|
+
export declare const useTheme: () => ThemeContextValue;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { ContainerStackBreakpoint, GapScale } from '../../libs/types/layout-types';
|
|
3
|
+
import './grid.css';
|
|
4
|
+
/**
|
|
5
|
+
* Prop types for Grid
|
|
6
|
+
*/
|
|
7
|
+
export interface GridProps extends ComponentPropsWithoutRef<'div'> {
|
|
8
|
+
/**
|
|
9
|
+
* Make the grid an inline-size query container (`container-type: inline-size`,
|
|
10
|
+
* named `pds-grid`) so its items can respond to the grid's own width with
|
|
11
|
+
* `@container pds-grid (…)` rules instead of the viewport. Use when the
|
|
12
|
+
* available width is decoupled from the viewport (e.g. beside a collapsible
|
|
13
|
+
* sidebar). The restack rule is authored per-layout — see the docs.
|
|
14
|
+
*/
|
|
15
|
+
asContainer?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Grid items — typically `GridItem` elements.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Additional class names
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Opt in to dense packing (`grid-auto-flow: row dense`), which backfills gaps
|
|
26
|
+
* left by items with row or column spans instead of leaving holes — useful
|
|
27
|
+
* for bento layouts. Off by default because it can change the visual order.
|
|
28
|
+
*/
|
|
29
|
+
dense?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Gap between grid tracks, from the numbered spacing scale. Fixed at all
|
|
32
|
+
* breakpoints; set `mobileGap` to change it on small screens. Defaults to
|
|
33
|
+
* `xl` (24px).
|
|
34
|
+
*/
|
|
35
|
+
gap?: GapScale;
|
|
36
|
+
/**
|
|
37
|
+
* Gap on small (mobile) screens. If not set, uses the same value as `gap`.
|
|
38
|
+
*/
|
|
39
|
+
mobileGap?: GapScale;
|
|
40
|
+
/**
|
|
41
|
+
* Collapse the grid to a single column once its own width drops below this
|
|
42
|
+
* threshold, regardless of viewport — a curated scale (`s` 30rem, `m` 48rem,
|
|
43
|
+
* `l` 60rem, `xl` 75rem). Implies `asContainer`. For an off-scale threshold,
|
|
44
|
+
* use `asContainer` with your own `@container` rule instead.
|
|
45
|
+
*/
|
|
46
|
+
stackBelow?: ContainerStackBreakpoint;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Grid layout component — a typed wrapper over the `pds-grid` utility classes.
|
|
50
|
+
* A fluid grid that is 4 columns at small viewports and 12 at medium and up;
|
|
51
|
+
* place `GridItem` children and set their column spans per breakpoint.
|
|
52
|
+
*
|
|
53
|
+
* The underlying classes (`pds-grid`, `pds-grid--gap-*`, `pds-grid-item*`) can
|
|
54
|
+
* also be used directly without this component.
|
|
55
|
+
*/
|
|
56
|
+
export declare const Grid: ({ asContainer, children, className, dense, gap, mobileGap, stackBelow, ...props }: GridProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import './grid.css';
|
|
3
|
+
type GridSpanSm = 1 | 2 | 3 | 4;
|
|
4
|
+
type GridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
|
+
type GridRowSpan = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
/**
|
|
7
|
+
* Prop types for GridItem
|
|
8
|
+
*/
|
|
9
|
+
export interface GridItemProps extends ComponentPropsWithoutRef<'div'> {
|
|
10
|
+
/**
|
|
11
|
+
* Item content.
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Additional class names
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Rows to span at large viewports (1–6). Falls back to the medium value.
|
|
20
|
+
*/
|
|
21
|
+
rowSpanLg?: GridRowSpan;
|
|
22
|
+
/**
|
|
23
|
+
* Rows to span at medium viewports (1–6). Falls back to a single row.
|
|
24
|
+
*/
|
|
25
|
+
rowSpanMd?: GridRowSpan;
|
|
26
|
+
/**
|
|
27
|
+
* Rows to span at small viewports (1–6). Falls back to a single row.
|
|
28
|
+
*/
|
|
29
|
+
rowSpanSm?: GridRowSpan;
|
|
30
|
+
/**
|
|
31
|
+
* Rows to span at extra-large viewports (1–6). Falls back to the large value.
|
|
32
|
+
*/
|
|
33
|
+
rowSpanXl?: GridRowSpan;
|
|
34
|
+
/**
|
|
35
|
+
* Columns to span at large viewports (1–12). Falls back to the medium value.
|
|
36
|
+
*/
|
|
37
|
+
spanLg?: GridSpan;
|
|
38
|
+
/**
|
|
39
|
+
* Columns to span at medium viewports (1–12). Falls back to full width.
|
|
40
|
+
*/
|
|
41
|
+
spanMd?: GridSpan;
|
|
42
|
+
/**
|
|
43
|
+
* Columns to span at small viewports (1–4). Falls back to full width.
|
|
44
|
+
*/
|
|
45
|
+
spanSm?: GridSpanSm;
|
|
46
|
+
/**
|
|
47
|
+
* Columns to span at extra-large viewports (1–12). Falls back to the large value.
|
|
48
|
+
*/
|
|
49
|
+
spanXl?: GridSpan;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* GridItem — a child of `Grid`. Sets the column span per breakpoint via the
|
|
53
|
+
* `pds-grid-item--{breakpoint}-{span}` utility classes. Missing breakpoints
|
|
54
|
+
* fall back to the full column width for that viewport.
|
|
55
|
+
*/
|
|
56
|
+
export declare const GridItem: ({ children, className, rowSpanLg, rowSpanMd, rowSpanSm, rowSpanXl, spanLg, spanMd, spanSm, spanXl, ...props }: GridItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDropdown';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/react';
|
|
2
|
+
import { useFloating, useFloatingNodeId, useInteractions } from '@floating-ui/react';
|
|
3
|
+
export type DropdownRole = 'menu' | 'listbox' | 'dialog';
|
|
4
|
+
export type DropdownVariant = 'default' | 'input';
|
|
5
|
+
export interface UseDropdownOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Allow keyboard navigation to escape the list (move past first/last item).
|
|
8
|
+
* Useful for combobox inputs where focus should return to the input.
|
|
9
|
+
*/
|
|
10
|
+
allowEscape?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable click-to-toggle interaction via useClick.
|
|
13
|
+
* Set to false for combobox-type inputs where open/close is managed
|
|
14
|
+
* by input events (typing, focus) rather than a click toggle.
|
|
15
|
+
*/
|
|
16
|
+
enableClick?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enable keyboard list navigation via useListNavigation.
|
|
19
|
+
* Set to false if keyboard nav is managed externally.
|
|
20
|
+
*/
|
|
21
|
+
enableListNavigation?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Enable shift middleware to keep the dropdown within viewport bounds.
|
|
24
|
+
* Set to false for inputs where the dropdown should align flush with the trigger.
|
|
25
|
+
*/
|
|
26
|
+
enableShift?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Enable transition animations on the dropdown panel.
|
|
29
|
+
*/
|
|
30
|
+
enableTransition?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Enable typeahead character search via useTypeahead.
|
|
33
|
+
*/
|
|
34
|
+
enableTypeahead?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Set the floating panel's width to exactly match the reference
|
|
37
|
+
* (trigger) element's width, applied via inline style. Needed any time
|
|
38
|
+
* the panel is rendered through a `FloatingPortal` — once portaled, a
|
|
39
|
+
* CSS `width: 100%` on the panel resolves against the viewport instead
|
|
40
|
+
* of the trigger, since the panel is no longer nested inside it. Implied
|
|
41
|
+
* (and overridden to `minWidth` instead of `width`) by `variant: 'input'`.
|
|
42
|
+
*/
|
|
43
|
+
matchReferenceWidth?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Caps the panel's height in pixels, on top of the available-viewport-
|
|
46
|
+
* space cap floating-ui's `size` middleware always applies. Omit to use
|
|
47
|
+
* only the viewport cap.
|
|
48
|
+
*/
|
|
49
|
+
maxHeightValue?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Offset distance in pixels between the trigger and the dropdown panel.
|
|
52
|
+
* Ignored when variant is 'input' (uses dynamic offset based on placement).
|
|
53
|
+
*/
|
|
54
|
+
offsetValue?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Open the dropdown on hover (desktop navigation menus).
|
|
57
|
+
* Enables useHover with safePolygon.
|
|
58
|
+
*/
|
|
59
|
+
openOnHover?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Preferred placement of the dropdown panel relative to the trigger.
|
|
62
|
+
*/
|
|
63
|
+
placement?: Placement;
|
|
64
|
+
/**
|
|
65
|
+
* ARIA role for the dropdown container.
|
|
66
|
+
*/
|
|
67
|
+
role?: DropdownRole;
|
|
68
|
+
/**
|
|
69
|
+
* Index of the currently selected item. Used by typeahead to maintain
|
|
70
|
+
* selection context. Only needed for selection-style dropdowns (Select).
|
|
71
|
+
*/
|
|
72
|
+
selectedIndex?: number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Minimum clearance (px) shift maintains from the viewport edge — the
|
|
75
|
+
* "safe zone" a trigger closer than this is still nudged away from, even
|
|
76
|
+
* if the panel itself wouldn't actually overflow. Defaults to 24. Lower
|
|
77
|
+
* to 0 so shift only intervenes on genuine overflow, when a trigger
|
|
78
|
+
* sitting close to the edge (but not overflowing) needs to stay flush.
|
|
79
|
+
*/
|
|
80
|
+
shiftPadding?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Dropdown variant. 'input' applies input-specific positioning: dynamic
|
|
83
|
+
* offset based on placement direction and size constraints with min/max height.
|
|
84
|
+
* Use for Select, Combobox, and other input-attached dropdowns.
|
|
85
|
+
*/
|
|
86
|
+
variant?: DropdownVariant;
|
|
87
|
+
/**
|
|
88
|
+
* Use virtual focus (aria-activedescendant) instead of roving tabindex.
|
|
89
|
+
* Appropriate for combobox-type inputs where focus must stay on the input.
|
|
90
|
+
*/
|
|
91
|
+
virtual?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface UseDropdownReturn {
|
|
94
|
+
/**
|
|
95
|
+
* Index of the currently active/focused item in the list.
|
|
96
|
+
*/
|
|
97
|
+
activeIndex: number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Styles to apply to the floating panel element.
|
|
100
|
+
*/
|
|
101
|
+
floatingStyles: ReturnType<typeof useFloating>['floatingStyles'];
|
|
102
|
+
/**
|
|
103
|
+
* Props to spread on the floating panel element.
|
|
104
|
+
*/
|
|
105
|
+
getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];
|
|
106
|
+
/**
|
|
107
|
+
* Props to spread on each item element.
|
|
108
|
+
*/
|
|
109
|
+
getItemProps: ReturnType<typeof useInteractions>['getItemProps'];
|
|
110
|
+
/**
|
|
111
|
+
* Props to spread on the trigger/reference element.
|
|
112
|
+
*/
|
|
113
|
+
getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];
|
|
114
|
+
/**
|
|
115
|
+
* Whether the floating panel should be mounted in the DOM
|
|
116
|
+
* (accounts for transition animations).
|
|
117
|
+
*/
|
|
118
|
+
isMounted: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Whether the dropdown is currently open.
|
|
121
|
+
*/
|
|
122
|
+
isOpen: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Ref array for list item DOM nodes (used by useListNavigation).
|
|
125
|
+
*/
|
|
126
|
+
listRef: React.MutableRefObject<any[]>;
|
|
127
|
+
/**
|
|
128
|
+
* This instance's Floating UI tree node ID (`null` when not part of a
|
|
129
|
+
* `<FloatingTree>`). Consumers that can be nested inside another floating
|
|
130
|
+
* panel (e.g. MenuButton, Dropdown) wrap their rendered floating panel in
|
|
131
|
+
* a `<FloatingNode id={nodeId}>` so outside-click/Escape resolve to the
|
|
132
|
+
* correct (innermost) panel when nested. See each consumer's own
|
|
133
|
+
* `useFloatingParentNodeId()` check for whether it also needs to provide
|
|
134
|
+
* its own `<FloatingTree>` (root case) or can join an ancestor's.
|
|
135
|
+
*/
|
|
136
|
+
nodeId: ReturnType<typeof useFloatingNodeId>;
|
|
137
|
+
/**
|
|
138
|
+
* Floating UI refs for the reference and floating elements.
|
|
139
|
+
*/
|
|
140
|
+
refs: ReturnType<typeof useFloating>['refs'];
|
|
141
|
+
/**
|
|
142
|
+
* Set the active/focused item index.
|
|
143
|
+
*/
|
|
144
|
+
setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;
|
|
145
|
+
/**
|
|
146
|
+
* Set the open state of the dropdown.
|
|
147
|
+
*/
|
|
148
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
149
|
+
/**
|
|
150
|
+
* Transition styles to apply to the floating panel element.
|
|
151
|
+
*/
|
|
152
|
+
transitionStyles: React.CSSProperties;
|
|
153
|
+
}
|
|
154
|
+
export declare const useDropdown: ({ allowEscape, enableClick, enableListNavigation, enableShift, enableTransition, enableTypeahead, matchReferenceWidth, maxHeightValue, offsetValue, openOnHover, placement, role, selectedIndex, shiftPadding, variant, virtual, }?: UseDropdownOptions) => UseDropdownReturn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether the layout is currently in its mobile presentation, tracking
|
|
3
|
+
* the `data-pds-mobile` attribute that `GlobalWrapper` sets on the document
|
|
4
|
+
* root. Reactive: updates when the breakpoint is crossed.
|
|
5
|
+
*
|
|
6
|
+
* Use this to render only the active responsive variant of a component, rather
|
|
7
|
+
* than mounting both a mobile and a desktop tree and toggling them with CSS —
|
|
8
|
+
* mounting both duplicates any ids in the slotted content (invalid HTML) and
|
|
9
|
+
* makes `getElementById`/`htmlFor`/`aria-controls` resolve to the hidden copy.
|
|
10
|
+
*
|
|
11
|
+
* SSR-safe: resolves to `false` (desktop) on the server and on the first client
|
|
12
|
+
* render, then updates after `GlobalWrapper` applies the attribute.
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean} `true` when the mobile presentation is active.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -20,4 +20,10 @@ export interface UseKeyPressOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
shiftKey?: boolean;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use `useKeyboardShortcut` instead. `useKeyPress` fires even while
|
|
25
|
+
* the user is typing in a form field and requires callers to manually disable
|
|
26
|
+
* shortcuts when an overlay is open; `useKeyboardShortcut` handles both by
|
|
27
|
+
* default. This hook will be removed before the v2 stable release.
|
|
28
|
+
*/
|
|
23
29
|
export declare const useKeyPress: (targetKey: string, callback?: (event: KeyboardEvent) => void, options?: UseKeyPressOptions) => boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HotkeyCallback, Keys, Options } from 'react-hotkeys-hook';
|
|
2
|
+
export type UseKeyboardShortcutOptions = Options;
|
|
3
|
+
/**
|
|
4
|
+
* Registers a keyboard shortcut, applying the PDS defaults on top of
|
|
5
|
+
* `react-hotkeys-hook`:
|
|
6
|
+
*
|
|
7
|
+
* - **Ignores form fields by default.** Shortcuts do not fire while focus is in
|
|
8
|
+
* an `input`, `textarea`, `select`, or `contentEditable` element, so typing a
|
|
9
|
+
* shortcut character (e.g. `/`) into a field never hijacks it. Opt in per
|
|
10
|
+
* shortcut with `enableOnFormTags` / `enableOnContentEditable` when a shortcut
|
|
11
|
+
* genuinely needs to fire inside a field.
|
|
12
|
+
* - **Overlay-aware.** Shortcuts auto-suppress while any PDS overlay (modal,
|
|
13
|
+
* drawer, mobile menu, etc.) is open, so callers never have to thread
|
|
14
|
+
* `hasOpenOverlay` through their own `enabled` flag.
|
|
15
|
+
*
|
|
16
|
+
* The full `react-hotkeys-hook` option surface (scopes, key sequences,
|
|
17
|
+
* `description`, cross-platform `mod`, etc.) is available via `options`.
|
|
18
|
+
*
|
|
19
|
+
* @param keys - The key or combination to listen for, e.g. `'/'`, `'mod+k'`,
|
|
20
|
+
* `'shift+['`. Uses `react-hotkeys-hook` key syntax.
|
|
21
|
+
* @param callback - Invoked when the shortcut fires. Receives the
|
|
22
|
+
* `KeyboardEvent` and the parsed hotkey event.
|
|
23
|
+
* @param options - `react-hotkeys-hook` options. `enabled` is combined with the
|
|
24
|
+
* overlay state so a shortcut is active only when enabled *and* no overlay is
|
|
25
|
+
* open.
|
|
26
|
+
* @param dependencies - Optional dependency array for the callback, forwarded to
|
|
27
|
+
* `react-hotkeys-hook`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useKeyboardShortcut: (keys: Keys, callback: HotkeyCallback, options?: UseKeyboardShortcutOptions, dependencies?: unknown[]) => (instance: HTMLElement) => void;
|