From cc4c3769d543b091b0a884fc68964ad8fe7eadca Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 16:46:02 -0400 Subject: [PATCH 1/8] docs: rename doc files to match pf-v5 element names --- .../docs/{pf-accordion.md => pf-v5-accordion.md} | 0 .../pf-v5-alert/docs/{pf-alert.md => pf-v5-alert.md} | 0 elements/pf-v5-alert/pf-v5-alert.ts | 1 + .../docs/{pf-avatar.md => pf-v5-avatar.md} | 0 .../docs/{pf-back-to-top.md => pf-v5-back-to-top.md} | 0 ...-background-image.md => pf-v5-background-image.md} | 0 .../pf-v5-badge/docs/{pf-badge.md => pf-v5-badge.md} | 0 .../docs/{pf-banner.md => pf-v5-banner.md} | 0 .../docs/{pf-button.md => pf-v5-button.md} | 0 .../pf-v5-card/docs/{pf-card.md => pf-v5-card.md} | 0 .../pf-v5-chip/docs/{pf-chip.md => pf-v5-chip.md} | 0 .../{pf-clipboard-copy.md => pf-v5-clipboard-copy.md} | 0 .../docs/{pf-code-block.md => pf-v5-code-block.md} | 0 elements/pf-v5-code-block/pf-v5-code-block.ts | 11 ++++------- .../docs/{pf-dropdown.md => pf-v5-dropdown.md} | 0 .../docs/{pf-helper-text.md => pf-v5-helper-text.md} | 0 elements/pf-v5-helper-text/pf-v5-helper-text.ts | 1 + .../pf-v5-hint/docs/{pf-hint.md => pf-v5-hint.md} | 0 .../pf-v5-icon/docs/{pf-icon.md => pf-v5-icon.md} | 0 .../docs/{pf-jump-links.md => pf-v5-jump-links.md} | 0 .../docs/{pf-label-group.md => pf-v5-label-group.md} | 0 elements/pf-v5-label-group/pf-v5-label-group.ts | 1 + .../pf-v5-label/docs/{pf-label.md => pf-v5-label.md} | 0 .../pf-v5-modal/docs/{pf-modal.md => pf-v5-modal.md} | 0 .../pf-v5-panel/docs/{pf-panel.md => pf-v5-panel.md} | 0 .../docs/{pf-popover.md => pf-v5-popover.md} | 0 ...-progress-stepper.md => pf-v5-progress-stepper.md} | 0 .../docs/{pf-progress.md => pf-v5-progress.md} | 0 .../{pf-search-input.md => pf-v5-search-input.md} | 2 +- .../docs/{pf-select.md => pf-v5-select.md} | 0 .../docs/{pf-spinner.md => pf-v5-spinner.md} | 0 .../docs/{pf-switch.md => pf-v5-switch.md} | 0 .../pf-v5-table/docs/{pf-table.md => pf-v5-table.md} | 0 .../pf-v5-tabs/docs/{pf-tabs.md => pf-v5-tabs.md} | 0 .../docs/{pf-text-area.md => pf-v5-text-area.md} | 0 .../docs/{pf-text-input.md => pf-v5-text-input.md} | 0 .../pf-v5-tile/docs/{pf-tile.md => pf-v5-tile.md} | 0 .../docs/{pf-timestamp.md => pf-v5-timestamp.md} | 0 .../docs/{pf-tooltip.md => pf-v5-tooltip.md} | 0 39 files changed, 8 insertions(+), 8 deletions(-) rename elements/pf-v5-accordion/docs/{pf-accordion.md => pf-v5-accordion.md} (100%) rename elements/pf-v5-alert/docs/{pf-alert.md => pf-v5-alert.md} (100%) rename elements/pf-v5-avatar/docs/{pf-avatar.md => pf-v5-avatar.md} (100%) rename elements/pf-v5-back-to-top/docs/{pf-back-to-top.md => pf-v5-back-to-top.md} (100%) rename elements/pf-v5-background-image/docs/{pf-background-image.md => pf-v5-background-image.md} (100%) rename elements/pf-v5-badge/docs/{pf-badge.md => pf-v5-badge.md} (100%) rename elements/pf-v5-banner/docs/{pf-banner.md => pf-v5-banner.md} (100%) rename elements/pf-v5-button/docs/{pf-button.md => pf-v5-button.md} (100%) rename elements/pf-v5-card/docs/{pf-card.md => pf-v5-card.md} (100%) rename elements/pf-v5-chip/docs/{pf-chip.md => pf-v5-chip.md} (100%) rename elements/pf-v5-clipboard-copy/docs/{pf-clipboard-copy.md => pf-v5-clipboard-copy.md} (100%) rename elements/pf-v5-code-block/docs/{pf-code-block.md => pf-v5-code-block.md} (100%) rename elements/pf-v5-dropdown/docs/{pf-dropdown.md => pf-v5-dropdown.md} (100%) rename elements/pf-v5-helper-text/docs/{pf-helper-text.md => pf-v5-helper-text.md} (100%) rename elements/pf-v5-hint/docs/{pf-hint.md => pf-v5-hint.md} (100%) rename elements/pf-v5-icon/docs/{pf-icon.md => pf-v5-icon.md} (100%) rename elements/pf-v5-jump-links/docs/{pf-jump-links.md => pf-v5-jump-links.md} (100%) rename elements/pf-v5-label-group/docs/{pf-label-group.md => pf-v5-label-group.md} (100%) rename elements/pf-v5-label/docs/{pf-label.md => pf-v5-label.md} (100%) rename elements/pf-v5-modal/docs/{pf-modal.md => pf-v5-modal.md} (100%) rename elements/pf-v5-panel/docs/{pf-panel.md => pf-v5-panel.md} (100%) rename elements/pf-v5-popover/docs/{pf-popover.md => pf-v5-popover.md} (100%) rename elements/pf-v5-progress-stepper/docs/{pf-progress-stepper.md => pf-v5-progress-stepper.md} (100%) rename elements/pf-v5-progress/docs/{pf-progress.md => pf-v5-progress.md} (100%) rename elements/pf-v5-search-input/docs/{pf-search-input.md => pf-v5-search-input.md} (98%) rename elements/pf-v5-select/docs/{pf-select.md => pf-v5-select.md} (100%) rename elements/pf-v5-spinner/docs/{pf-spinner.md => pf-v5-spinner.md} (100%) rename elements/pf-v5-switch/docs/{pf-switch.md => pf-v5-switch.md} (100%) rename elements/pf-v5-table/docs/{pf-table.md => pf-v5-table.md} (100%) rename elements/pf-v5-tabs/docs/{pf-tabs.md => pf-v5-tabs.md} (100%) rename elements/pf-v5-text-area/docs/{pf-text-area.md => pf-v5-text-area.md} (100%) rename elements/pf-v5-text-input/docs/{pf-text-input.md => pf-v5-text-input.md} (100%) rename elements/pf-v5-tile/docs/{pf-tile.md => pf-v5-tile.md} (100%) rename elements/pf-v5-timestamp/docs/{pf-timestamp.md => pf-v5-timestamp.md} (100%) rename elements/pf-v5-tooltip/docs/{pf-tooltip.md => pf-v5-tooltip.md} (100%) diff --git a/elements/pf-v5-accordion/docs/pf-accordion.md b/elements/pf-v5-accordion/docs/pf-v5-accordion.md similarity index 100% rename from elements/pf-v5-accordion/docs/pf-accordion.md rename to elements/pf-v5-accordion/docs/pf-v5-accordion.md diff --git a/elements/pf-v5-alert/docs/pf-alert.md b/elements/pf-v5-alert/docs/pf-v5-alert.md similarity index 100% rename from elements/pf-v5-alert/docs/pf-alert.md rename to elements/pf-v5-alert/docs/pf-v5-alert.md diff --git a/elements/pf-v5-alert/pf-v5-alert.ts b/elements/pf-v5-alert/pf-v5-alert.ts index 3e58d31828..76f94acc65 100644 --- a/elements/pf-v5-alert/pf-v5-alert.ts +++ b/elements/pf-v5-alert/pf-v5-alert.ts @@ -29,6 +29,7 @@ export class PfV5AlertCloseEvent extends Event { * An **alert** is a notification that provides brief information to the user * without blocking their workflow. * + * @alias Alert * @fires close - When an alert is closed e.g. when close button is clicked or when the alert times * out. Cancel the event to prevent the alert from being removed. */ diff --git a/elements/pf-v5-avatar/docs/pf-avatar.md b/elements/pf-v5-avatar/docs/pf-v5-avatar.md similarity index 100% rename from elements/pf-v5-avatar/docs/pf-avatar.md rename to elements/pf-v5-avatar/docs/pf-v5-avatar.md diff --git a/elements/pf-v5-back-to-top/docs/pf-back-to-top.md b/elements/pf-v5-back-to-top/docs/pf-v5-back-to-top.md similarity index 100% rename from elements/pf-v5-back-to-top/docs/pf-back-to-top.md rename to elements/pf-v5-back-to-top/docs/pf-v5-back-to-top.md diff --git a/elements/pf-v5-background-image/docs/pf-background-image.md b/elements/pf-v5-background-image/docs/pf-v5-background-image.md similarity index 100% rename from elements/pf-v5-background-image/docs/pf-background-image.md rename to elements/pf-v5-background-image/docs/pf-v5-background-image.md diff --git a/elements/pf-v5-badge/docs/pf-badge.md b/elements/pf-v5-badge/docs/pf-v5-badge.md similarity index 100% rename from elements/pf-v5-badge/docs/pf-badge.md rename to elements/pf-v5-badge/docs/pf-v5-badge.md diff --git a/elements/pf-v5-banner/docs/pf-banner.md b/elements/pf-v5-banner/docs/pf-v5-banner.md similarity index 100% rename from elements/pf-v5-banner/docs/pf-banner.md rename to elements/pf-v5-banner/docs/pf-v5-banner.md diff --git a/elements/pf-v5-button/docs/pf-button.md b/elements/pf-v5-button/docs/pf-v5-button.md similarity index 100% rename from elements/pf-v5-button/docs/pf-button.md rename to elements/pf-v5-button/docs/pf-v5-button.md diff --git a/elements/pf-v5-card/docs/pf-card.md b/elements/pf-v5-card/docs/pf-v5-card.md similarity index 100% rename from elements/pf-v5-card/docs/pf-card.md rename to elements/pf-v5-card/docs/pf-v5-card.md diff --git a/elements/pf-v5-chip/docs/pf-chip.md b/elements/pf-v5-chip/docs/pf-v5-chip.md similarity index 100% rename from elements/pf-v5-chip/docs/pf-chip.md rename to elements/pf-v5-chip/docs/pf-v5-chip.md diff --git a/elements/pf-v5-clipboard-copy/docs/pf-clipboard-copy.md b/elements/pf-v5-clipboard-copy/docs/pf-v5-clipboard-copy.md similarity index 100% rename from elements/pf-v5-clipboard-copy/docs/pf-clipboard-copy.md rename to elements/pf-v5-clipboard-copy/docs/pf-v5-clipboard-copy.md diff --git a/elements/pf-v5-code-block/docs/pf-code-block.md b/elements/pf-v5-code-block/docs/pf-v5-code-block.md similarity index 100% rename from elements/pf-v5-code-block/docs/pf-code-block.md rename to elements/pf-v5-code-block/docs/pf-v5-code-block.md diff --git a/elements/pf-v5-code-block/pf-v5-code-block.ts b/elements/pf-v5-code-block/pf-v5-code-block.ts index bcf788e40e..8bbc86c1b7 100644 --- a/elements/pf-v5-code-block/pf-v5-code-block.ts +++ b/elements/pf-v5-code-block/pf-v5-code-block.ts @@ -4,19 +4,16 @@ import { property } from 'lit/decorators/property.js'; import { classMap } from 'lit/directives/class-map.js'; import styles from './pf-v5-code-block.css'; -/** - * A **code block** is a component that contains 2 or more lines of read-only code. The code in a code block can be copied to the clipboard. - * @alias Code Block - * @attr {boolean} [expanded=false] - * Indicates if the code-block has been expanded - */ - function dedent(str: string): string { const stripped = str.replace(/^\n/, ''); const match = stripped.match(/^\s+/); return match ? stripped.replace(new RegExp(`^${match[0]}`, 'gm'), '') : str; } +/** + * A **code block** is a component that contains 2 or more lines of read-only code. The code in a code block can be copied to the clipboard. + * @alias Code Block + */ @customElement('pf-v5-code-block') export class PfV5CodeBlock extends LitElement { static readonly styles: CSSStyleSheet[] = [styles]; diff --git a/elements/pf-v5-dropdown/docs/pf-dropdown.md b/elements/pf-v5-dropdown/docs/pf-v5-dropdown.md similarity index 100% rename from elements/pf-v5-dropdown/docs/pf-dropdown.md rename to elements/pf-v5-dropdown/docs/pf-v5-dropdown.md diff --git a/elements/pf-v5-helper-text/docs/pf-helper-text.md b/elements/pf-v5-helper-text/docs/pf-v5-helper-text.md similarity index 100% rename from elements/pf-v5-helper-text/docs/pf-helper-text.md rename to elements/pf-v5-helper-text/docs/pf-v5-helper-text.md diff --git a/elements/pf-v5-helper-text/pf-v5-helper-text.ts b/elements/pf-v5-helper-text/pf-v5-helper-text.ts index d0e5ccf302..ca46eb51b7 100644 --- a/elements/pf-v5-helper-text/pf-v5-helper-text.ts +++ b/elements/pf-v5-helper-text/pf-v5-helper-text.ts @@ -20,6 +20,7 @@ const StatusIconMap = { /** * Displays contextual feedback for form fields with optional icon and status color. * + * @alias Helper Text * @slot icon - Optional custom icon to override the default icon. * @slot - Default slot for the helper text content. * diff --git a/elements/pf-v5-hint/docs/pf-hint.md b/elements/pf-v5-hint/docs/pf-v5-hint.md similarity index 100% rename from elements/pf-v5-hint/docs/pf-hint.md rename to elements/pf-v5-hint/docs/pf-v5-hint.md diff --git a/elements/pf-v5-icon/docs/pf-icon.md b/elements/pf-v5-icon/docs/pf-v5-icon.md similarity index 100% rename from elements/pf-v5-icon/docs/pf-icon.md rename to elements/pf-v5-icon/docs/pf-v5-icon.md diff --git a/elements/pf-v5-jump-links/docs/pf-jump-links.md b/elements/pf-v5-jump-links/docs/pf-v5-jump-links.md similarity index 100% rename from elements/pf-v5-jump-links/docs/pf-jump-links.md rename to elements/pf-v5-jump-links/docs/pf-v5-jump-links.md diff --git a/elements/pf-v5-label-group/docs/pf-label-group.md b/elements/pf-v5-label-group/docs/pf-v5-label-group.md similarity index 100% rename from elements/pf-v5-label-group/docs/pf-label-group.md rename to elements/pf-v5-label-group/docs/pf-v5-label-group.md diff --git a/elements/pf-v5-label-group/pf-v5-label-group.ts b/elements/pf-v5-label-group/pf-v5-label-group.ts index 7a0c7f9694..64320a9452 100644 --- a/elements/pf-v5-label-group/pf-v5-label-group.ts +++ b/elements/pf-v5-label-group/pf-v5-label-group.ts @@ -37,6 +37,7 @@ const REMAINING_RE = /\$\{\s*remaining\s*\}/g; * When the number of labels exceeds `numLabels`, additional labels will be * hidden using an overflow label. * + * @alias Label Group * @summary Groups multiple labels with overflow, category, and close support. * * @fires {PfV5LabelGroupExpandEvent} expand - Fires when label group is expanded to show all labels diff --git a/elements/pf-v5-label/docs/pf-label.md b/elements/pf-v5-label/docs/pf-v5-label.md similarity index 100% rename from elements/pf-v5-label/docs/pf-label.md rename to elements/pf-v5-label/docs/pf-v5-label.md diff --git a/elements/pf-v5-modal/docs/pf-modal.md b/elements/pf-v5-modal/docs/pf-v5-modal.md similarity index 100% rename from elements/pf-v5-modal/docs/pf-modal.md rename to elements/pf-v5-modal/docs/pf-v5-modal.md diff --git a/elements/pf-v5-panel/docs/pf-panel.md b/elements/pf-v5-panel/docs/pf-v5-panel.md similarity index 100% rename from elements/pf-v5-panel/docs/pf-panel.md rename to elements/pf-v5-panel/docs/pf-v5-panel.md diff --git a/elements/pf-v5-popover/docs/pf-popover.md b/elements/pf-v5-popover/docs/pf-v5-popover.md similarity index 100% rename from elements/pf-v5-popover/docs/pf-popover.md rename to elements/pf-v5-popover/docs/pf-v5-popover.md diff --git a/elements/pf-v5-progress-stepper/docs/pf-progress-stepper.md b/elements/pf-v5-progress-stepper/docs/pf-v5-progress-stepper.md similarity index 100% rename from elements/pf-v5-progress-stepper/docs/pf-progress-stepper.md rename to elements/pf-v5-progress-stepper/docs/pf-v5-progress-stepper.md diff --git a/elements/pf-v5-progress/docs/pf-progress.md b/elements/pf-v5-progress/docs/pf-v5-progress.md similarity index 100% rename from elements/pf-v5-progress/docs/pf-progress.md rename to elements/pf-v5-progress/docs/pf-v5-progress.md diff --git a/elements/pf-v5-search-input/docs/pf-search-input.md b/elements/pf-v5-search-input/docs/pf-v5-search-input.md similarity index 98% rename from elements/pf-v5-search-input/docs/pf-search-input.md rename to elements/pf-v5-search-input/docs/pf-v5-search-input.md index 6b84d6d1f3..9658591695 100644 --- a/elements/pf-v5-search-input/docs/pf-search-input.md +++ b/elements/pf-v5-search-input/docs/pf-v5-search-input.md @@ -31,7 +31,7 @@ import '@patternfly/elements/pf-v5-search-input/pf-v5-search-input.js'; #### Search Input Form {% htmlexample %} - {% renderFile "./elements/pf-v5-search-input/demo/pf-v5-search-input-with-submit.html" %} + {% renderFile "./elements/pf-v5-search-input/demo/pf-search-input-with-submit.html" %} {% endhtmlexample %} #### Disabled diff --git a/elements/pf-v5-select/docs/pf-select.md b/elements/pf-v5-select/docs/pf-v5-select.md similarity index 100% rename from elements/pf-v5-select/docs/pf-select.md rename to elements/pf-v5-select/docs/pf-v5-select.md diff --git a/elements/pf-v5-spinner/docs/pf-spinner.md b/elements/pf-v5-spinner/docs/pf-v5-spinner.md similarity index 100% rename from elements/pf-v5-spinner/docs/pf-spinner.md rename to elements/pf-v5-spinner/docs/pf-v5-spinner.md diff --git a/elements/pf-v5-switch/docs/pf-switch.md b/elements/pf-v5-switch/docs/pf-v5-switch.md similarity index 100% rename from elements/pf-v5-switch/docs/pf-switch.md rename to elements/pf-v5-switch/docs/pf-v5-switch.md diff --git a/elements/pf-v5-table/docs/pf-table.md b/elements/pf-v5-table/docs/pf-v5-table.md similarity index 100% rename from elements/pf-v5-table/docs/pf-table.md rename to elements/pf-v5-table/docs/pf-v5-table.md diff --git a/elements/pf-v5-tabs/docs/pf-tabs.md b/elements/pf-v5-tabs/docs/pf-v5-tabs.md similarity index 100% rename from elements/pf-v5-tabs/docs/pf-tabs.md rename to elements/pf-v5-tabs/docs/pf-v5-tabs.md diff --git a/elements/pf-v5-text-area/docs/pf-text-area.md b/elements/pf-v5-text-area/docs/pf-v5-text-area.md similarity index 100% rename from elements/pf-v5-text-area/docs/pf-text-area.md rename to elements/pf-v5-text-area/docs/pf-v5-text-area.md diff --git a/elements/pf-v5-text-input/docs/pf-text-input.md b/elements/pf-v5-text-input/docs/pf-v5-text-input.md similarity index 100% rename from elements/pf-v5-text-input/docs/pf-text-input.md rename to elements/pf-v5-text-input/docs/pf-v5-text-input.md diff --git a/elements/pf-v5-tile/docs/pf-tile.md b/elements/pf-v5-tile/docs/pf-v5-tile.md similarity index 100% rename from elements/pf-v5-tile/docs/pf-tile.md rename to elements/pf-v5-tile/docs/pf-v5-tile.md diff --git a/elements/pf-v5-timestamp/docs/pf-timestamp.md b/elements/pf-v5-timestamp/docs/pf-v5-timestamp.md similarity index 100% rename from elements/pf-v5-timestamp/docs/pf-timestamp.md rename to elements/pf-v5-timestamp/docs/pf-v5-timestamp.md diff --git a/elements/pf-v5-tooltip/docs/pf-tooltip.md b/elements/pf-v5-tooltip/docs/pf-v5-tooltip.md similarity index 100% rename from elements/pf-v5-tooltip/docs/pf-tooltip.md rename to elements/pf-v5-tooltip/docs/pf-v5-tooltip.md From f6f0dd80309d67c907b656293f40763cd623cd20 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 16:46:34 -0400 Subject: [PATCH 2/8] chore: update tagPrefix in config --- .pfe.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pfe.config.json b/.pfe.config.json index 8d99ac9ae4..02fa929c23 100644 --- a/.pfe.config.json +++ b/.pfe.config.json @@ -1,3 +1,4 @@ { - "renderTitleInOverview": false + "renderTitleInOverview": false, + "tagPrefix": "pf-v5" } From 39d1bd3484abaf4c0c4c9551cf50725264fd1a35 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 16:47:28 -0400 Subject: [PATCH 3/8] fix: use unbundled element modules for docs site --- docs/_data/importMap.cjs | 35 +++++------------------------------ docs/_plugins/pfe-assets.cjs | 33 ++++++++++++++------------------- docs/main.mjs | 34 ++++++++++++++++++++++++++++++++++ package.json | 3 ++- 4 files changed, 55 insertions(+), 50 deletions(-) diff --git a/docs/_data/importMap.cjs b/docs/_data/importMap.cjs index 12279d1b23..dd79d08705 100644 --- a/docs/_data/importMap.cjs +++ b/docs/_data/importMap.cjs @@ -1,6 +1,5 @@ const fs = require('node:fs'); const path = require('node:path'); -const { glob } = require('glob'); const packageLock = JSON.parse(fs.readFileSync(path.join( __dirname, @@ -82,38 +81,14 @@ module.exports = async function() { const map = generator.getMap(); map.imports['/docs/zero-md.js'] = '/zero-md.js'; - map.imports['@patternfly/elements'] = '/pfe.min.js'; - map.imports['@patternfly/pfe-core'] = '/pfe.min.js'; + map.imports['@patternfly/elements/'] = '/assets/@patternfly/elements/'; + map.imports['@patternfly/pfe-core/'] = '/assets/@patternfly/pfe-core/'; + map.imports['@patternfly/pfe-core'] = '/assets/@patternfly/pfe-core/core.js'; + map.imports['@patternfly/pfe-tools/'] = '/assets/@patternfly/pfe-tools/'; map.imports['@patternfly/icons/'] = '/assets/@patternfly/icons/'; - map.imports['@patternfly/pfe-core/decorators.js'] = '/pfe.min.js'; - map.imports['@patternfly/pfe-tools/environment.js'] = '/tools/environment.js'; + map.imports['@lit/context'] = map.scopes['https://cdn.jsdelivr.net/']['@lit/context']; map.imports['lit/'] = map.imports.lit.replace('index.js', ''); map.scopes['https://cdn.jsdelivr.net/'].lit = map.imports.lit; map.scopes['https://cdn.jsdelivr.net/']['lit/'] = map.imports.lit.replace('index.js', ''); - - // add imports for imports under pfe-core - const pfeCoreImports = (await glob('./{functions,controllers,decorators}/*.ts', { - cwd: path.join(__dirname, '../../core/pfe-core'), - })) - .filter(x => !x.endsWith('.d.ts')) - .map(x => x.replace('.ts', '.js')); - for (const file of pfeCoreImports) { - map.imports[path.join('@patternfly/pfe-core', file)] = '/pfe.min.js'; - } - - map.imports['@patternfly/pfe-core/decorators.js'] = '/pfe.min.js'; - map.imports['@patternfly/pfe-core'] = '/pfe.min.js'; - - const elementsPath = path.join(__dirname, '..', '..', 'elements'); - for (const tagName of fs.readdirSync(elementsPath)) { - const elementPath = path.join(elementsPath, tagName); - if (fs.statSync(elementPath).isDirectory()) { - for (const fileName of fs.readdirSync(elementPath)) { - if (fileName.endsWith('.ts') && !fileName.endsWith('.d.ts')) { - map.imports[`@patternfly/elements/${tagName}/${fileName.replace('.ts', '')}.js`] = `/pfe.min.js`; - } - } - } - } return map; }; diff --git a/docs/_plugins/pfe-assets.cjs b/docs/_plugins/pfe-assets.cjs index fb22d474b2..79104731cb 100644 --- a/docs/_plugins/pfe-assets.cjs +++ b/docs/_plugins/pfe-assets.cjs @@ -10,10 +10,9 @@ function getFilesToCopy(options) { const cwd = process.cwd(); const prefix = `${(options?.prefix ?? 'pf').replace(/-$/, '')}-`; - const hasElements = fs.existsSync(path.join(cwd, 'elements')); const hasCore = fs.existsSync(path.join(cwd, 'core')); - if (!hasElements && !hasCore) { + if (!hasCore) { return null; } @@ -21,25 +20,12 @@ function getFilesToCopy(options) { [path.join(cwd, 'node_modules/element-internals-polyfill')]: 'element-internals-polyfill', }; - const tagNames = fs.readdirSync(path.join(cwd, 'elements')); const corePkgs = fs.readdirSync(path.join(cwd, 'core')); - // Copy all component and core files to _site - if (hasElements) { - Object.assign(files, Object.fromEntries(tagNames - .filter(x => !x.match(/node_modules|tsconfig|README\.md|(?:\.ts$)|(?:config\.js$)/)) - .map(dir => [ - `elements/${dir}`, - `components/${dir.replace(prefix, '')}`, - ]))); - } - - if (hasCore) { - Object.assign(files, Object.fromEntries(corePkgs.map(dir => [ - `core/${dir}`, - `core/${dir.replace(prefix, '')}`, - ]))); - } + Object.assign(files, Object.fromEntries(corePkgs.map(dir => [ + `core/${dir}`, + `core/${dir.replace(prefix, '')}`, + ]))); return files; } @@ -75,6 +61,15 @@ module.exports = { eleventyConfig.addPassthroughCopy({ 'node_modules/@patternfly/icons/': '/assets/@patternfly/icons/', }); + eleventyConfig.addPassthroughCopy({ + 'elements': '/assets/@patternfly/elements', + }); + eleventyConfig.addPassthroughCopy({ + './core/pfe-core': '/assets/@patternfly/pfe-core', + }); + eleventyConfig.addPassthroughCopy({ + 'tools/pfe-tools': '/assets/@patternfly/pfe-tools', + }); eleventyConfig.addPassthroughCopy('brand/**/*'); const filesToCopy = getFilesToCopy(options); diff --git a/docs/main.mjs b/docs/main.mjs index 5bb77a69ef..892f000ed8 100644 --- a/docs/main.mjs +++ b/docs/main.mjs @@ -1,6 +1,40 @@ import '@rhds/elements/rh-footer/rh-footer-universal.js'; import 'element-internals-polyfill'; import { PfV5Icon } from '@patternfly/elements/pf-v5-icon/pf-v5-icon.js'; +import '@patternfly/elements/pf-v5-accordion/pf-v5-accordion.js'; +import '@patternfly/elements/pf-v5-alert/pf-v5-alert.js'; +import '@patternfly/elements/pf-v5-avatar/pf-v5-avatar.js'; +import '@patternfly/elements/pf-v5-back-to-top/pf-v5-back-to-top.js'; +import '@patternfly/elements/pf-v5-background-image/pf-v5-background-image.js'; +import '@patternfly/elements/pf-v5-badge/pf-v5-badge.js'; +import '@patternfly/elements/pf-v5-banner/pf-v5-banner.js'; +import '@patternfly/elements/pf-v5-button/pf-v5-button.js'; +import '@patternfly/elements/pf-v5-card/pf-v5-card.js'; +import '@patternfly/elements/pf-v5-chip/pf-v5-chip.js'; +import '@patternfly/elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.js'; +import '@patternfly/elements/pf-v5-code-block/pf-v5-code-block.js'; +import '@patternfly/elements/pf-v5-dropdown/pf-v5-dropdown.js'; +import '@patternfly/elements/pf-v5-helper-text/pf-v5-helper-text.js'; +import '@patternfly/elements/pf-v5-hint/pf-v5-hint.js'; +import '@patternfly/elements/pf-v5-jump-links/pf-v5-jump-links.js'; +import '@patternfly/elements/pf-v5-label/pf-v5-label.js'; +import '@patternfly/elements/pf-v5-label-group/pf-v5-label-group.js'; +import '@patternfly/elements/pf-v5-modal/pf-v5-modal.js'; +import '@patternfly/elements/pf-v5-panel/pf-v5-panel.js'; +import '@patternfly/elements/pf-v5-popover/pf-v5-popover.js'; +import '@patternfly/elements/pf-v5-progress/pf-v5-progress.js'; +import '@patternfly/elements/pf-v5-progress-stepper/pf-v5-progress-stepper.js'; +import '@patternfly/elements/pf-v5-search-input/pf-v5-search-input.js'; +import '@patternfly/elements/pf-v5-select/pf-v5-select.js'; +import '@patternfly/elements/pf-v5-spinner/pf-v5-spinner.js'; +import '@patternfly/elements/pf-v5-switch/pf-v5-switch.js'; +import '@patternfly/elements/pf-v5-table/pf-v5-table.js'; +import '@patternfly/elements/pf-v5-tabs/pf-v5-tabs.js'; +import '@patternfly/elements/pf-v5-text-area/pf-v5-text-area.js'; +import '@patternfly/elements/pf-v5-text-input/pf-v5-text-input.js'; +import '@patternfly/elements/pf-v5-tile/pf-v5-tile.js'; +import '@patternfly/elements/pf-v5-timestamp/pf-v5-timestamp.js'; +import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js'; // if `/v2/` path load icons from static directory if (document.location.href.includes('/v2/')) { diff --git a/package.json b/package.json index 50f07f541a..413586b5bb 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,8 @@ "service": true, "command": "eleventy --serve", "dependencies": [ - "build:core" + "build:core", + "build:elements" ] }, "start": { From b4cdc2673860c12f1c60d37ccee371aa341e33e9 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 16:48:18 -0400 Subject: [PATCH 4/8] refactor(tools): use pfe config for tag aliasing in DocsPage --- tools/pfe-tools/11ty/DocsPage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/pfe-tools/11ty/DocsPage.ts b/tools/pfe-tools/11ty/DocsPage.ts index 8fc1fba249..6ddeb15c3d 100644 --- a/tools/pfe-tools/11ty/DocsPage.ts +++ b/tools/pfe-tools/11ty/DocsPage.ts @@ -1,4 +1,5 @@ import type { PfeConfig } from '../config.js'; +import { getPfeConfig } from '../config.js'; import { Manifest } from '../custom-elements-manifest/lib/Manifest.js'; import slugify from 'slugify'; @@ -20,12 +21,14 @@ export class DocsPage { summary?: string | null; docsTemplatePath?: string; constructor(public manifest: Manifest, options?: DocsPageOptions) { + const config = getPfeConfig(options?.rootDir); this.tagName = options?.tagName ?? ''; this.title = options?.title ?? Manifest.prettyTag(this.tagName); this.docsTemplatePath = options?.docsTemplatePath; this.summary = this.manifest.getSummary(this.tagName); this.description = this.manifest.getDescription(this.tagName); - const aliased = options?.aliases?.[this.tagName] ?? this.tagName.replace(/^\w+-/, ''); + const prefix = `${config.tagPrefix.replace(/-$/, '')}-`; + const aliased = config.aliases[this.tagName] ?? this.tagName.replace(prefix, ''); this.slug = slugify(aliased, { strict: true, lower: true }); } } From 20b30476cd57510a34011e25a5ee43889b0ec2a1 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 16:51:51 -0400 Subject: [PATCH 5/8] chore(tools): add changeset --- .changeset/wacky-jobs-lead.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/wacky-jobs-lead.md diff --git a/.changeset/wacky-jobs-lead.md b/.changeset/wacky-jobs-lead.md new file mode 100644 index 0000000000..1090297a93 --- /dev/null +++ b/.changeset/wacky-jobs-lead.md @@ -0,0 +1,6 @@ +--- +"@patternfly/pfe-tools": patch +--- + +Corrected usage of config for tagPrefix in `DocsPage` for alias + \ No newline at end of file From e8b17e79a9786673e352010e5c250af04ab3df93 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 17:00:57 -0400 Subject: [PATCH 6/8] chore: correct npm run docs to include the elements build --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 413586b5bb..628d689617 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,7 @@ ], "dependencies": [ "build:core", + "build:elements", "analyze" ] }, From 3044da16ff784044803d93cbb6082c2b31b0fe65 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 17:14:16 -0400 Subject: [PATCH 7/8] fix: copy element screenshots to docs site --- docs/_plugins/pfe-assets.cjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/_plugins/pfe-assets.cjs b/docs/_plugins/pfe-assets.cjs index 79104731cb..b340fedd13 100644 --- a/docs/_plugins/pfe-assets.cjs +++ b/docs/_plugins/pfe-assets.cjs @@ -71,6 +71,20 @@ module.exports = { 'tools/pfe-tools': '/assets/@patternfly/pfe-tools', }); eleventyConfig.addPassthroughCopy('brand/**/*'); + + // Copy only screenshot.png from each element's docs/ folder to the site. + // Markdown docs are handled by 11ty templates; screenshots are the only static asset. + const prefix = `${(options?.prefix ?? 'pf').replace(/-$/, '')}-`; + for (const dir of fs.readdirSync(path.join(process.cwd(), 'elements'))) { + const screenshot = path.join('elements', dir, 'docs', 'screenshot.png'); + if (fs.existsSync(screenshot)) { + const slug = dir.replace(prefix, ''); + eleventyConfig.addPassthroughCopy({ + [screenshot]: `/components/${slug}/docs/screenshot.png`, + }); + } + } + const filesToCopy = getFilesToCopy(options); if (filesToCopy) { From 17f0cf71ed729e62b9c2cc21ce66b45b6bf13152 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Tue, 28 Apr 2026 17:37:09 -0400 Subject: [PATCH 8/8] fix: copy demo assets to docs site --- docs/_plugins/pfe-assets.cjs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/_plugins/pfe-assets.cjs b/docs/_plugins/pfe-assets.cjs index b340fedd13..07965ef88a 100644 --- a/docs/_plugins/pfe-assets.cjs +++ b/docs/_plugins/pfe-assets.cjs @@ -72,17 +72,30 @@ module.exports = { }); eleventyConfig.addPassthroughCopy('brand/**/*'); - // Copy only screenshot.png from each element's docs/ folder to the site. - // Markdown docs are handled by 11ty templates; screenshots are the only static asset. + // Copy static assets (screenshots, demo images/css/js) from element folders + // to the site with the tag prefix stripped from the directory name. + // Markdown and HTML are handled by 11ty templates; this covers everything else. const prefix = `${(options?.prefix ?? 'pf').replace(/-$/, '')}-`; for (const dir of fs.readdirSync(path.join(process.cwd(), 'elements'))) { + const slug = dir.replace(prefix, ''); const screenshot = path.join('elements', dir, 'docs', 'screenshot.png'); if (fs.existsSync(screenshot)) { - const slug = dir.replace(prefix, ''); eleventyConfig.addPassthroughCopy({ [screenshot]: `/components/${slug}/docs/screenshot.png`, }); } + const demoDir = path.join(process.cwd(), 'elements', dir, 'demo'); + if (fs.existsSync(demoDir)) { + const assets = + fs.readdirSync(demoDir, { recursive: true }) + .filter(f => !String(f).endsWith('.html')); + for (const asset of assets) { + const src = path.join('elements', dir, 'demo', String(asset)); + eleventyConfig.addPassthroughCopy({ + [src]: `/components/${slug}/demo/${asset}`, + }); + } + } } const filesToCopy = getFilesToCopy(options);