@pantheon-systems/pds-toolkit-react 2.0.0-alpha.7 → 2.0.0-alpha.71
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 +1787 -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/Avatar/Avatar.d.ts +5 -1
- 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 +192 -0
- package/dist/components/Dropdown/DropdownSelectedIcon.d.ts +7 -0
- package/dist/components/FileDiff/FileDiff.d.ts +2 -2
- package/dist/components/IdentityBlock/IdentityBlock.d.ts +37 -0
- package/dist/components/PantheonLogo/PantheonLogo.d.ts +5 -4
- package/dist/components/Popover/Popover.d.ts +5 -1
- package/dist/components/ResultCount/ResultCount.d.ts +53 -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/{RefreshChecker/RefreshChecker.d.ts → StatusChecker/StatusChecker.d.ts} +6 -19
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +7 -4
- package/dist/components/Table/Table.d.ts +290 -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 +6 -2
- package/dist/components/UtilityBar/UtilityBar.d.ts +26 -0
- package/dist/components/badges/Badge/Badge.d.ts +1 -1
- 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 +4 -4
- package/dist/components/buttons/FilterButton/FilterButton.d.ts +92 -0
- package/dist/components/buttons/IconButton/IconButton.d.ts +12 -0
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +24 -17
- package/dist/components/buttons/SSOButton/SSOButton.d.ts +9 -1
- package/dist/components/buttons/SegmentedButton/SegmentedButton.d.ts +44 -8
- 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/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 +212 -16
- package/dist/components/icons/PaymentIcon/PaymentIcon.d.ts +7 -3
- package/dist/components/icons/PlatformIcon/PlatformIcon.d.ts +6 -6
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/inputs/CheckboxFieldset/CheckboxFieldset.d.ts +9 -1
- package/dist/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +9 -1
- package/dist/components/inputs/Combobox/Combobox.d.ts +17 -7
- package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +10 -5
- package/dist/components/inputs/Datepicker/Datepicker.d.ts +217 -14
- package/dist/components/inputs/FileUpload/FileUpload.d.ts +6 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +10 -2
- package/dist/components/inputs/Select/Select.d.ts +11 -2
- package/dist/components/inputs/Switch/Switch.d.ts +5 -5
- package/dist/components/inputs/TagsInput/TagsInput.d.ts +6 -1
- package/dist/components/inputs/TextInput/TextInput.d.ts +4 -4
- package/dist/components/inputs/Textarea/Textarea.d.ts +2 -2
- package/dist/components/inputs/Timepicker/Timepicker.d.ts +94 -0
- package/dist/components/inputs/input-utilities.d.ts +12 -2
- package/dist/components/{CTALink → links/CTALink}/CTALink.d.ts +1 -1
- 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/ButtonNav/ButtonNav.d.ts +11 -5
- package/dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/components/navigation/Navbar/Navbar.d.ts +9 -21
- 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 +20 -5
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +2 -16
- package/dist/components/navigation/navigation-utilities.d.ts +12 -0
- 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/Drawer/Drawer.d.ts +58 -0
- package/dist/components/overlays/FullScreenOverlay/FullScreenOverlay.d.ts +45 -0
- package/dist/components/{Modal → overlays/Modal}/Modal.d.ts +2 -2
- 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 +62 -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/Panel/Panel.d.ts +4 -21
- package/dist/components/panels/PanelList/PanelList.d.ts +1 -1
- package/dist/components/panels/PanelStack/PanelStack.d.ts +19 -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-action-card.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-branch-diff.css +1 -1
- package/dist/css/component-css/pds-breadcrumb.css +1 -1
- 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 +45 -13
- 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 -0
- package/dist/css/component-css/pds-dropdown-menu.css +2 -2
- package/dist/css/component-css/pds-dropdown.css +2 -0
- package/dist/css/component-css/pds-expansion-panel-group.css +1 -1
- package/dist/css/component-css/pds-expansion-panel.css +2 -1
- package/dist/css/component-css/pds-file-diff.css +1 -1
- package/dist/css/component-css/pds-file-upload.css +3 -3
- 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 +5 -3
- 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 +152 -45
- 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 +7 -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-section-message.css +1 -1
- package/dist/css/component-css/pds-segmented-button.css +2 -1
- package/dist/css/component-css/pds-select.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +3 -5
- 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-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-step-list.css +1 -0
- package/dist/css/component-css/pds-stepper.css +3 -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 +5 -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-workspace-selector.css +26 -1
- package/dist/css/design-tokens/variables.dark.css +385 -338
- package/dist/css/design-tokens/variables.global.css +10 -18
- package/dist/css/design-tokens/variables.light.css +376 -309
- 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 +5 -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 +152 -45
- 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 +95 -7
- package/dist/index.js +12738 -4787
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +44 -41
- 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 +16 -6
- 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/StatusDot/StatusDot.d.ts +15 -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 +4 -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/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/floppyDisk.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/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/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 +6 -6
- package/dist/utilities/GlobalWrapper/GlobalWrapper.d.ts +35 -0
- package/dist/utilities/context-providers/ThemeContext/ThemeContext.d.ts +113 -0
- package/dist/utilities/grid/Grid.d.ts +58 -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 +138 -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 +83 -47
- package/tailwind/README.md +220 -0
- package/tailwind/TESTING.md +457 -0
- package/tailwind/v3/preset.cjs +258 -0
- package/tailwind/v4/theme.css +230 -0
- 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
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantheon-systems/pds-toolkit-react",
|
|
3
3
|
"technology": "React",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.71",
|
|
5
5
|
"description": "PDS toolkit built using the React framework",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"url": "https://github.com/pantheon-systems/pds-toolkit-react/issues"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/pantheon-systems/pds-toolkit-react#readme",
|
|
23
|
+
"bin": {
|
|
24
|
+
"pds-codemod": "./bin/pds-codemod.cjs"
|
|
25
|
+
},
|
|
23
26
|
"module": "dist/index.js",
|
|
24
27
|
"types": "dist/index.d.ts",
|
|
25
28
|
"exports": {
|
|
@@ -27,10 +30,17 @@
|
|
|
27
30
|
"types": "./dist/index.d.ts",
|
|
28
31
|
"import": "./dist/index.js"
|
|
29
32
|
},
|
|
33
|
+
"./tailwind/v3/preset": "./tailwind/v3/preset.cjs",
|
|
34
|
+
"./tailwind/v4/theme.css": "./tailwind/v4/theme.css",
|
|
30
35
|
"./*": "./dist/*"
|
|
31
36
|
},
|
|
32
37
|
"files": [
|
|
33
|
-
"
|
|
38
|
+
"bin",
|
|
39
|
+
"codemods/v1-to-v2/transforms",
|
|
40
|
+
"codemods/v1-to-v2/mappings.json",
|
|
41
|
+
"codemods/v1-to-v2/css-token-renames.js",
|
|
42
|
+
"dist",
|
|
43
|
+
"tailwind"
|
|
34
44
|
],
|
|
35
45
|
"sideEffects": [
|
|
36
46
|
"*.css"
|
|
@@ -41,17 +51,17 @@
|
|
|
41
51
|
"build:lib": "vite build && npm run build:types",
|
|
42
52
|
"build:types": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
43
53
|
"postbuild:lib": "npm run build:css && npm run build:css:components && npm run build:css:layouts && npm run build:css:packageExtraCss && npm run generate:svg-icons",
|
|
44
|
-
"build:css": "postcss src/core.css -o dist/css/pds-core.css",
|
|
45
|
-
"build:css:components": "postcss src/components/index.css -o dist/css/pds-components.css",
|
|
46
|
-
"build:css:layouts": "postcss src/layouts/index.css -o dist/css/pds-layouts.css",
|
|
47
|
-
"build:css:packageExtraCss": "node scripts/package-extra-css.js",
|
|
54
|
+
"build:css": "PDS_CSS_LAYER=pds-v2 postcss src/core.css -o dist/css/pds-core.css",
|
|
55
|
+
"build:css:components": "PDS_CSS_LAYER=pds-v2 postcss src/components/index.css -o dist/css/pds-components.css",
|
|
56
|
+
"build:css:layouts": "PDS_CSS_LAYER=pds-v2 postcss src/layouts/index.css -o dist/css/pds-layouts.css",
|
|
57
|
+
"build:css:packageExtraCss": "PDS_CSS_LAYER=pds-v2 node scripts/package-extra-css.js",
|
|
48
58
|
"build:css:watch": "npm run build:css -- -w",
|
|
49
59
|
"prestorybook": "node scripts/filter-exports-by-tags.js && npm run build:css && npm run build:css:components && npm run build:css:layouts && npm run generate:ux-writing-search-index && npm run generate:ux-writing-guide",
|
|
50
|
-
"storybook": "storybook dev -p 6006",
|
|
60
|
+
"storybook": "PDS_CSS_LAYER=pds-v2 storybook dev -p 6006",
|
|
51
61
|
"prebuild": "npm run build:css && npm run build:css:components && npm run build:css:layouts && npm run build:css:packageExtraCss && npm run generate:ux-writing-search-index && npm run generate:ux-writing-guide",
|
|
52
|
-
"build": "NODE_ENV=production storybook build",
|
|
62
|
+
"build": "NODE_OPTIONS=--max-old-space-size=4096 NODE_ENV=production storybook build",
|
|
53
63
|
"build-storybook": "NODE_ENV=production storybook build",
|
|
54
|
-
"postbuild": "node scripts/
|
|
64
|
+
"postbuild": "node scripts/generate-html-docs.js && node scripts/build-starter-template.js && node scripts/copy-mcp-assets.js && node scripts/verify-mcp-build.js",
|
|
55
65
|
"verify:mcp": "node scripts/verify-mcp-build.js",
|
|
56
66
|
"start": "node index.js",
|
|
57
67
|
"develop": "npm run storybook",
|
|
@@ -85,83 +95,99 @@
|
|
|
85
95
|
"generate:ux-writing-search-index": "node scripts/generate-search-index.js",
|
|
86
96
|
"generate:ux-writing-guide": "node scripts/generate-ux-writing-guide.js",
|
|
87
97
|
"generate:html-docs": "node scripts/generate-html-docs.js",
|
|
98
|
+
"test:codemods": "jest --testPathPatterns=codemods/",
|
|
88
99
|
"test:version-switcher": "bash scripts/test-version-switcher.sh",
|
|
89
100
|
"pack:local": "bash scripts/pack-local.sh",
|
|
90
101
|
"prepare": "husky install",
|
|
91
102
|
"chromatic": "npx chromatic --project-token=chpt_8f57e9785118676"
|
|
92
103
|
},
|
|
104
|
+
"jest": {
|
|
105
|
+
"testMatch": [
|
|
106
|
+
"**/codemods/**/__tests__/**/*.test.js"
|
|
107
|
+
],
|
|
108
|
+
"testEnvironment": "node"
|
|
109
|
+
},
|
|
93
110
|
"devDependencies": {
|
|
94
111
|
"@arethetypeswrong/cli": "^0.15.3",
|
|
95
|
-
"@axe-core/playwright": "^4.11.
|
|
96
|
-
"@babel/preset-env": "^7.
|
|
112
|
+
"@axe-core/playwright": "^4.11.3",
|
|
113
|
+
"@babel/preset-env": "^7.29.5",
|
|
97
114
|
"@babel/preset-react": "^7.18.6",
|
|
98
115
|
"@babel/preset-typescript": "^7.28.5",
|
|
99
116
|
"@csstools/postcss-design-tokens": "^2.0.4",
|
|
100
117
|
"@csstools/postcss-global-data": "^1.0.3",
|
|
101
|
-
"@
|
|
102
|
-
"@
|
|
103
|
-
"@
|
|
104
|
-
"@
|
|
105
|
-
"@storybook/addon-
|
|
106
|
-
"@storybook/addon-
|
|
107
|
-
"@storybook/
|
|
108
|
-
"@storybook/
|
|
109
|
-
"@
|
|
110
|
-
"@
|
|
111
|
-
"@
|
|
112
|
-
"@
|
|
113
|
-
"@
|
|
118
|
+
"@fortawesome/free-brands-svg-icons": "7.2.0",
|
|
119
|
+
"@fortawesome/pro-regular-svg-icons": "7.2.0",
|
|
120
|
+
"@fortawesome/pro-solid-svg-icons": "7.2.0",
|
|
121
|
+
"@playwright/test": "^1.60.0",
|
|
122
|
+
"@storybook/addon-a11y": "^10.4.0",
|
|
123
|
+
"@storybook/addon-docs": "^10.4.0",
|
|
124
|
+
"@storybook/addon-links": "^10.4.0",
|
|
125
|
+
"@storybook/addon-mcp": "^0.6.0",
|
|
126
|
+
"@storybook/addon-webpack5-compiler-swc": "^4.0.3",
|
|
127
|
+
"@storybook/react-vite": "^10.4.0",
|
|
128
|
+
"@storybook/react-webpack5": "^10.4.0",
|
|
129
|
+
"@types/prismjs": "^1.26.6",
|
|
130
|
+
"@types/react": "^19.2.14",
|
|
131
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
132
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
133
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
114
134
|
"@vueless/storybook-dark-mode": "^9.0.9",
|
|
115
135
|
"axe-html-reporter": "^2.2.3",
|
|
116
136
|
"chromatic": "^13.3.4",
|
|
117
137
|
"concurrently": "^8.0.1",
|
|
118
138
|
"cssnano": "^6.0.1",
|
|
119
|
-
"eslint": "^9.
|
|
139
|
+
"eslint": "^9.39.4",
|
|
120
140
|
"eslint-config-prettier": "^9.1.0",
|
|
121
141
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
122
142
|
"eslint-plugin-import": "^2.32.0",
|
|
123
|
-
"eslint-plugin-prettier": "^5.
|
|
143
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
124
144
|
"eslint-plugin-react": "^7.32.2",
|
|
125
145
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
126
146
|
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
127
|
-
"eslint-plugin-storybook": "^10.
|
|
147
|
+
"eslint-plugin-storybook": "^10.4.0",
|
|
128
148
|
"eslint-plugin-typescript-sort-keys": "^3.3.0",
|
|
129
149
|
"fast-glob": "^3.3.2",
|
|
130
150
|
"husky": "^8.0.3",
|
|
151
|
+
"jest": "^30.4.2",
|
|
152
|
+
"jscodeshift": "^17.3.0",
|
|
131
153
|
"lint-staged": "^13.2.3",
|
|
132
154
|
"pino-pretty": "^13.1.3",
|
|
133
155
|
"plop": "^3.1.2",
|
|
134
|
-
"postcss": "^8.
|
|
156
|
+
"postcss": "^8.5.14",
|
|
135
157
|
"postcss-cli": "^10.1.0",
|
|
136
158
|
"postcss-custom-media": "^9.1.3",
|
|
137
159
|
"postcss-import": "^15.1.0",
|
|
138
160
|
"postcss-insert": "^1.0.0",
|
|
139
|
-
"postcss-loader": "^8.
|
|
161
|
+
"postcss-loader": "^8.2.1",
|
|
140
162
|
"postcss-nested": "^6.0.1",
|
|
141
|
-
"prettier": "3.
|
|
142
|
-
"prettier-plugin-css-order": "^2.
|
|
163
|
+
"prettier": "^3.8.3",
|
|
164
|
+
"prettier-plugin-css-order": "^2.2.0",
|
|
143
165
|
"react": "^18.2.0",
|
|
144
166
|
"react-dom": "^18.2.0",
|
|
145
|
-
"storybook": "^10.
|
|
146
|
-
"tsc-alias": "^1.8.
|
|
167
|
+
"storybook": "^10.4.0",
|
|
168
|
+
"tsc-alias": "^1.8.17",
|
|
147
169
|
"typescript": "^5.4.5",
|
|
148
|
-
"vite": "^
|
|
170
|
+
"vite": "^8.0.16",
|
|
149
171
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
150
172
|
"vite-tsconfig-paths": "^4.3.2"
|
|
151
173
|
},
|
|
152
174
|
"peerDependencies": {
|
|
153
|
-
"react": "^
|
|
154
|
-
"react-dom": "^
|
|
175
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
176
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
155
177
|
},
|
|
156
178
|
"dependencies": {
|
|
179
|
+
"@dnd-kit/core": "^6.3.1",
|
|
180
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
181
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
157
182
|
"@floating-ui/react": "^0.24.3",
|
|
158
183
|
"@floating-ui/react-dom": "~1.3.0",
|
|
159
|
-
"@
|
|
184
|
+
"@internationalized/date": "^3.12.2",
|
|
185
|
+
"@pantheon-systems/pds-design-tokens": "^2.0.0-alpha.67",
|
|
160
186
|
"@reactuses/core": "^5.0.15",
|
|
161
187
|
"date-fns": "^4.1.0",
|
|
162
|
-
"downshift": "^9.
|
|
163
|
-
"express": "^
|
|
164
|
-
"express-rate-limit": "^8.2
|
|
188
|
+
"downshift": "^9.3.2",
|
|
189
|
+
"express": "^5.0.0",
|
|
190
|
+
"express-rate-limit": "^8.5.2",
|
|
165
191
|
"focus-trap-react": "^10.2.1",
|
|
166
192
|
"hash-sum": "^2.0.0",
|
|
167
193
|
"modern-normalize": "^3.0.1",
|
|
@@ -169,16 +195,26 @@
|
|
|
169
195
|
"pino-http": "^11.0.0",
|
|
170
196
|
"prism-react-renderer": "^2.4.1",
|
|
171
197
|
"prismjs": "^1.29.0",
|
|
198
|
+
"react-aria": "^3.50.0",
|
|
172
199
|
"react-code-block": "^1.1.1",
|
|
173
|
-
"react-day-picker": "^9.11.1",
|
|
174
200
|
"react-device-detect": "^2.2.3",
|
|
175
|
-
"react-
|
|
176
|
-
"react-
|
|
201
|
+
"react-hotkeys-hook": "^4.5.1",
|
|
202
|
+
"react-stately": "^3.48.0",
|
|
203
|
+
"react-toastify": "^11.1.0",
|
|
204
|
+
"recharts": "^3.8.1"
|
|
177
205
|
},
|
|
178
|
-
"
|
|
179
|
-
"@
|
|
180
|
-
"
|
|
181
|
-
"
|
|
206
|
+
"overrides": {
|
|
207
|
+
"@babel/plugin-transform-modules-systemjs": "^7.29.4",
|
|
208
|
+
"fast-uri": "^3.1.5",
|
|
209
|
+
"hono": "^4.12.18",
|
|
210
|
+
"ip-address": "^10.1.1",
|
|
211
|
+
"micromatch": "^4.0.8",
|
|
212
|
+
"minimatch": "^10.0.0",
|
|
213
|
+
"postcss-insert": {
|
|
214
|
+
"postcss": "^8.4.31"
|
|
215
|
+
},
|
|
216
|
+
"valibot": "^1.4.2",
|
|
217
|
+
"yaml": "^2.8.3"
|
|
182
218
|
},
|
|
183
219
|
"lint-staged": {
|
|
184
220
|
"*": "prettier --write --ignore-unknown",
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# PDS Tailwind Configuration
|
|
2
|
+
|
|
3
|
+
Tailwind CSS configs that map Pantheon Design System tokens to Tailwind utilities. Available for both Tailwind v3 and v4.
|
|
4
|
+
|
|
5
|
+
> **Note:** Using Tailwind CSS alongside PDS is not the recommended approach. PDS components handle their own styling. This configuration is provided so that UI built outside the scope of PDS components uses correct design system values rather than arbitrary ones.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Both configs require `pds-core.css` to be loaded globally in your app. This provides the `--pds-*` CSS custom properties that the Tailwind utilities reference at runtime.
|
|
12
|
+
|
|
13
|
+
Import it as a JavaScript import in your app's root layout — this ensures reliable module resolution via the package `exports` map:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> **Note:** Use `css/pds-core.css`, not `dist/css/pds-core.css`. The package exports map handles the `dist/` prefix automatically. Using a CSS `@import` instead of a JS import can cause resolution failures in some bundlers (including Next.js with Turbopack).
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Tailwind v4
|
|
24
|
+
|
|
25
|
+
**Recommended for new projects.**
|
|
26
|
+
|
|
27
|
+
### Setup
|
|
28
|
+
|
|
29
|
+
In `app/layout.tsx` (or your root layout):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
33
|
+
import './globals.css';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
In `app/globals.css`:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
/* Tailwind layers — imported separately to exclude preflight */
|
|
40
|
+
@import 'tailwindcss/theme' layer(theme);
|
|
41
|
+
@import 'tailwindcss/utilities' layer(utilities);
|
|
42
|
+
|
|
43
|
+
/* PDS theme overrides */
|
|
44
|
+
@import '@pantheon-systems/pds-toolkit-react/tailwind/v4/theme.css';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Why not `@import "tailwindcss"`?**
|
|
48
|
+
> The single `@import "tailwindcss"` shorthand includes Tailwind's preflight CSS reset, which conflicts with PDS base styles. Importing the layers individually lets you skip preflight.
|
|
49
|
+
|
|
50
|
+
No `tailwind.config.js` is needed.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Tailwind v3
|
|
55
|
+
|
|
56
|
+
### Setup
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install tailwindcss@3
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`tailwind.config.js`:
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
/** @type {import('tailwindcss').Config} */
|
|
66
|
+
module.exports = {
|
|
67
|
+
presets: [require('@pantheon-systems/pds-toolkit-react/tailwind/v3/preset')],
|
|
68
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In `app/layout.tsx` (or your root layout):
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
76
|
+
import './globals.css';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`app/globals.css`:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
/* Tailwind directives */
|
|
83
|
+
@tailwind base;
|
|
84
|
+
@tailwind components;
|
|
85
|
+
@tailwind utilities;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Preflight is disabled automatically by the preset.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## What's included
|
|
93
|
+
|
|
94
|
+
### Colors
|
|
95
|
+
|
|
96
|
+
All values reference PDS CSS custom properties — dark mode works automatically.
|
|
97
|
+
|
|
98
|
+
| Group | Example utility | PDS token |
|
|
99
|
+
| ------------------- | ------------------------------ | --------------------------------------- |
|
|
100
|
+
| `bg-*` | `bg-bg-default` | `--pds-color-bg-default` |
|
|
101
|
+
| `fg-*` | `text-fg-default` | `--pds-color-fg-default` |
|
|
102
|
+
| `text-*` | `text-text-secondary` | `--pds-color-text-default-secondary` |
|
|
103
|
+
| `border-*` | `border-border-input` | `--pds-color-border-input` |
|
|
104
|
+
| `interactive-*` | `text-interactive-link` | `--pds-color-interactive-link-default` |
|
|
105
|
+
| `status-{type}-*` | `bg-status-success-background` | `--pds-color-status-success-background` |
|
|
106
|
+
| `brand-primary-*` | `bg-brand-primary-400` | `--pds-color-brand-primary-400` |
|
|
107
|
+
| `brand-secondary-*` | `bg-brand-secondary` | `--pds-color-brand-secondary-default` |
|
|
108
|
+
| `brand-accent-*` | `text-brand-accent` | `--pds-color-brand-accent-default` |
|
|
109
|
+
|
|
110
|
+
### Spacing
|
|
111
|
+
|
|
112
|
+
The PDS named scale replaces Tailwind's default numeric scale. Use semantic keys like `p-m`, `gap-xl`, `mt-2xl`.
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<div class="p-m gap-xl mt-2xl">...</div>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Common Tailwind numeric values are also aliased to their nearest PDS equivalent, so `p-4` still works and stays in sync with the token:
|
|
119
|
+
|
|
120
|
+
| Tailwind | PDS key | Value |
|
|
121
|
+
| -------- | ------- | ------- |
|
|
122
|
+
| `p-1` | `p-4xs` | 0.25rem |
|
|
123
|
+
| `p-2` | `p-2xs` | 0.5rem |
|
|
124
|
+
| `p-3` | `p-s` | 0.75rem |
|
|
125
|
+
| `p-4` | `p-m` | 1rem |
|
|
126
|
+
| `p-5` | `p-l` | 1.25rem |
|
|
127
|
+
| `p-6` | `p-xl` | 1.5rem |
|
|
128
|
+
| `p-8` | `p-2xl` | 2rem |
|
|
129
|
+
| `p-10` | `p-3xl` | 2.5rem |
|
|
130
|
+
| `p-12` | `p-4xl` | 3rem |
|
|
131
|
+
| `p-16` | `p-5xl` | 4rem |
|
|
132
|
+
|
|
133
|
+
Values like `p-7`, `p-9`, `p-11` (which don't have a clean PDS equivalent) are not aliased and will not generate any CSS.
|
|
134
|
+
|
|
135
|
+
> **Numeric aliases use CSS variable references**, not hardcoded values. If a PDS spacing token ever changes, `p-4` will automatically reflect the new value — no config update needed.
|
|
136
|
+
|
|
137
|
+
### Typography
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<p class="font-sans text-m font-normal leading-m">Body text</p>
|
|
141
|
+
<h2 class="font-sans text-2xl font-semibold leading-s">Heading</h2>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
| Scale | Font size | Font family | Font weight | Line height | Letter spacing |
|
|
145
|
+
| ----- | ------------ | ----------------------- | ----------------------------------------------- | ------------------- | ------------------- |
|
|
146
|
+
| Keys | `xs` – `9xl` | `sans`, `serif`, `mono` | `light`, `normal`, `medium`, `semibold`, `bold` | `s`, `m`, `l`, `xl` | `s`, `m`, `l`, `xl` |
|
|
147
|
+
|
|
148
|
+
### Border radius
|
|
149
|
+
|
|
150
|
+
```html
|
|
151
|
+
<div class="rounded-container">Card</div>
|
|
152
|
+
<button class="rounded-button">Button</button>
|
|
153
|
+
<input class="rounded-input" />
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Keys: `none`, `DEFAULT` (`rounded`), `button`, `input`, `container`, `bar`, `full`
|
|
157
|
+
|
|
158
|
+
### Z-index
|
|
159
|
+
|
|
160
|
+
```html
|
|
161
|
+
<div class="z-modal">Modal</div>
|
|
162
|
+
<nav class="z-navigation">Nav</nav>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Keys: `navigation`, `dropdown`, `notifications`, `overlay`, `modal`, `max`
|
|
166
|
+
|
|
167
|
+
### Max width
|
|
168
|
+
|
|
169
|
+
Matches PDS `Container` component breakpoints. Use when building layout sections outside PDS container components.
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<div class="max-w-standard mx-auto px-m">...</div>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Keys: `narrow` (1024px), `standard` (1200px), `wide` (1440px), `x-wide` (1600px)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Important caveats
|
|
180
|
+
|
|
181
|
+
### Borders require an explicit border-style
|
|
182
|
+
|
|
183
|
+
The PDS preset resets `border-style` to `none` on all elements so that borders are fully opt-in. This prevents phantom borders on elements that pick up a non-zero `border-width` from PDS components, inheritance, or browser defaults. When adding borders with Tailwind, always include a border-style class (`border-solid`, `border-dashed`, or `border-dotted`):
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<div class="border border-solid border-border-default">...</div>
|
|
187
|
+
<div class="border-b border-solid border-border-separator">Divider</div>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Opacity modifiers are not supported
|
|
191
|
+
|
|
192
|
+
Tailwind's opacity modifier syntax (`bg-bg-default/50`) does not work with CSS variable color references. This is a known Tailwind limitation — the compiler cannot decompose a CSS variable into RGB channels. Avoid using opacity modifiers with PDS colors.
|
|
193
|
+
|
|
194
|
+
### Apply Tailwind utilities to your own elements, not PDS components
|
|
195
|
+
|
|
196
|
+
PDS components are styled with scoped BEM classes. Do not use Tailwind utilities to override PDS component styles — use component props and the `className` prop for layout adjustments only. Applying Tailwind utility classes to PDS component internals will lead to unpredictable results.
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
// ✅ Tailwind for your layout, PDS for the component
|
|
200
|
+
<div class="flex gap-m items-center">
|
|
201
|
+
<Button label="Save" variant="primary" />
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
// ❌ Don't override PDS component internals with Tailwind
|
|
205
|
+
<Button label="Save" className="text-red-500 bg-blue-200" />
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Import order matters
|
|
209
|
+
|
|
210
|
+
`pds-core.css` must be imported before Tailwind. If Tailwind's utilities load before PDS variables are defined, the CSS custom property references will resolve to empty values.
|
|
211
|
+
|
|
212
|
+
### Scanning for class names (`@source` in v4)
|
|
213
|
+
|
|
214
|
+
Tailwind v4 automatically scans your project files for class names. If your source files are outside the default scan path (common in monorepos), add a `@source` directive to your CSS entry point:
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
@source './src/**/*.{js,ts,jsx,tsx}';
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
This is your project's responsibility — the PDS package does not need to be scanned (PDS components do not use Tailwind class names internally).
|