@porsche-design-system/components-angular 4.5.0-rc.1 → 4.6.0-rc.0
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/CHANGELOG.md +10 -0
- package/bin/pds-skill.js +259 -0
- package/fesm2022/porsche-design-system-components-angular.mjs.map +1 -1
- package/package.json +5 -2
- package/skill/SKILL.md +124 -0
- package/skill/references/components/p-accordion/examples/Default.ts +26 -0
- package/skill/references/components/p-accordion/examples/InteractiveElementsInSummary.ts +30 -0
- package/skill/references/components/p-accordion/examples/StickySummary.ts +26 -0
- package/skill/references/components/p-accordion/p-accordion.md +95 -0
- package/skill/references/components/p-ai-tag/examples/Default.ts +13 -0
- package/skill/references/components/p-ai-tag/examples/WithinCheckbox.ts +33 -0
- package/skill/references/components/p-ai-tag/examples/WithinFormLabel.ts +40 -0
- package/skill/references/components/p-ai-tag/examples/WithinImage.ts +16 -0
- package/skill/references/components/p-ai-tag/examples/WithinInputSearch.ts +15 -0
- package/skill/references/components/p-ai-tag/examples/WithinRadioGroup.ts +32 -0
- package/skill/references/components/p-ai-tag/examples/WithinTable.ts +94 -0
- package/skill/references/components/p-ai-tag/examples/WithinText.ts +17 -0
- package/skill/references/components/p-ai-tag/p-ai-tag.md +47 -0
- package/skill/references/components/p-banner/examples/Customization.ts +37 -0
- package/skill/references/components/p-banner/examples/Default.ts +26 -0
- package/skill/references/components/p-banner/p-banner.md +92 -0
- package/skill/references/components/p-button/examples/Default.ts +15 -0
- package/skill/references/components/p-button/examples/Form.ts +26 -0
- package/skill/references/components/p-button/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button/p-button.md +118 -0
- package/skill/references/components/p-button-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Form.ts +26 -0
- package/skill/references/components/p-button-pure/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button-pure/p-button-pure.md +118 -0
- package/skill/references/components/p-button-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-button-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-button-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-button-tile/examples/Hyphens.ts +38 -0
- package/skill/references/components/p-button-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-button-tile/p-button-tile.md +115 -0
- package/skill/references/components/p-canvas/examples/Default.ts +13 -0
- package/skill/references/components/p-canvas/p-canvas.md +91 -0
- package/skill/references/components/p-carousel/examples/Default.ts +26 -0
- package/skill/references/components/p-carousel/examples/DynamicSlides.ts +37 -0
- package/skill/references/components/p-carousel/examples/FlexibleWidths.ts +32 -0
- package/skill/references/components/p-carousel/examples/FocusOnCenterSlide.ts +65 -0
- package/skill/references/components/p-carousel/examples/Intl.ts +23 -0
- package/skill/references/components/p-carousel/examples/JumpToSlide.ts +50 -0
- package/skill/references/components/p-carousel/p-carousel.md +142 -0
- package/skill/references/components/p-checkbox/examples/Default.ts +13 -0
- package/skill/references/components/p-checkbox/examples/Form.ts +31 -0
- package/skill/references/components/p-checkbox/examples/Indeterminate.ts +16 -0
- package/skill/references/components/p-checkbox/examples/Slots.ts +57 -0
- package/skill/references/components/p-checkbox/examples/WrappedLabel.ts +27 -0
- package/skill/references/components/p-checkbox/p-checkbox.md +122 -0
- package/skill/references/components/p-crest/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-crest/examples/Default.ts +13 -0
- package/skill/references/components/p-crest/examples/Link.ts +13 -0
- package/skill/references/components/p-crest/p-crest.md +65 -0
- package/skill/references/components/p-display/examples/Color.ts +15 -0
- package/skill/references/components/p-display/examples/Default.ts +15 -0
- package/skill/references/components/p-display/examples/Semantics.ts +21 -0
- package/skill/references/components/p-display/examples/Size.ts +15 -0
- package/skill/references/components/p-display/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-display/p-display.md +78 -0
- package/skill/references/components/p-divider/examples/Default.ts +13 -0
- package/skill/references/components/p-divider/examples/Responsive.ts +15 -0
- package/skill/references/components/p-divider/examples/Vertical.ts +15 -0
- package/skill/references/components/p-divider/p-divider.md +49 -0
- package/skill/references/components/p-drilldown/examples/CustomContent.ts +166 -0
- package/skill/references/components/p-drilldown/examples/Default.ts +119 -0
- package/skill/references/components/p-drilldown/p-drilldown.md +168 -0
- package/skill/references/components/p-fieldset/examples/Default.ts +15 -0
- package/skill/references/components/p-fieldset/examples/Required.ts +16 -0
- package/skill/references/components/p-fieldset/examples/SlottedLabel.ts +18 -0
- package/skill/references/components/p-fieldset/examples/SlottedMessage.ts +18 -0
- package/skill/references/components/p-fieldset/p-fieldset.md +88 -0
- package/skill/references/components/p-flag/examples/Default.ts +13 -0
- package/skill/references/components/p-flag/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-flag/examples/Size.ts +16 -0
- package/skill/references/components/p-flag/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-flag/p-flag.md +68 -0
- package/skill/references/components/p-flyout/examples/CustomStyling.ts +47 -0
- package/skill/references/components/p-flyout/examples/Default.ts +44 -0
- package/skill/references/components/p-flyout/examples/Form.ts +47 -0
- package/skill/references/components/p-flyout/examples/StickyTop.ts +44 -0
- package/skill/references/components/p-flyout/p-flyout.md +128 -0
- package/skill/references/components/p-heading/examples/Color.ts +15 -0
- package/skill/references/components/p-heading/examples/Default.ts +15 -0
- package/skill/references/components/p-heading/examples/Semantics.ts +21 -0
- package/skill/references/components/p-heading/p-heading.md +78 -0
- package/skill/references/components/p-icon/examples/Color.ts +16 -0
- package/skill/references/components/p-icon/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-icon/examples/Custom.ts +13 -0
- package/skill/references/components/p-icon/examples/Default.ts +13 -0
- package/skill/references/components/p-icon/examples/Overview.ts +591 -0
- package/skill/references/components/p-icon/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-icon/examples/Size.ts +16 -0
- package/skill/references/components/p-icon/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-icon/p-icon.md +88 -0
- package/skill/references/components/p-inline-notification/examples/ActionButton.ts +29 -0
- package/skill/references/components/p-inline-notification/examples/Default.ts +13 -0
- package/skill/references/components/p-inline-notification/examples/EventHandling.ts +31 -0
- package/skill/references/components/p-inline-notification/p-inline-notification.md +74 -0
- package/skill/references/components/p-input-date/examples/Default.ts +13 -0
- package/skill/references/components/p-input-date/examples/Form.ts +31 -0
- package/skill/references/components/p-input-date/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-date/p-input-date.md +138 -0
- package/skill/references/components/p-input-email/examples/Default.ts +13 -0
- package/skill/references/components/p-input-email/examples/Form.ts +31 -0
- package/skill/references/components/p-input-email/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-email/p-input-email.md +142 -0
- package/skill/references/components/p-input-month/examples/Default.ts +13 -0
- package/skill/references/components/p-input-month/examples/Form.ts +31 -0
- package/skill/references/components/p-input-month/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-month/p-input-month.md +138 -0
- package/skill/references/components/p-input-number/examples/Default.ts +13 -0
- package/skill/references/components/p-input-number/examples/Form.ts +31 -0
- package/skill/references/components/p-input-number/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-number/p-input-number.md +146 -0
- package/skill/references/components/p-input-password/examples/Default.ts +13 -0
- package/skill/references/components/p-input-password/examples/Form.ts +31 -0
- package/skill/references/components/p-input-password/examples/Slots.ts +42 -0
- package/skill/references/components/p-input-password/examples/Toggle.ts +13 -0
- package/skill/references/components/p-input-password/p-input-password.md +141 -0
- package/skill/references/components/p-input-search/examples/AriaCombobox.ts +38 -0
- package/skill/references/components/p-input-search/examples/Default.ts +13 -0
- package/skill/references/components/p-input-search/examples/Form.ts +31 -0
- package/skill/references/components/p-input-search/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-search/p-input-search.md +178 -0
- package/skill/references/components/p-input-tel/examples/Default.ts +13 -0
- package/skill/references/components/p-input-tel/examples/Form.ts +31 -0
- package/skill/references/components/p-input-tel/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-tel/p-input-tel.md +141 -0
- package/skill/references/components/p-input-text/examples/Controlled.ts +36 -0
- package/skill/references/components/p-input-text/examples/Default.ts +13 -0
- package/skill/references/components/p-input-text/examples/Form.ts +31 -0
- package/skill/references/components/p-input-text/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-text/p-input-text.md +146 -0
- package/skill/references/components/p-input-time/examples/Default.ts +13 -0
- package/skill/references/components/p-input-time/examples/Form.ts +31 -0
- package/skill/references/components/p-input-time/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-time/p-input-time.md +140 -0
- package/skill/references/components/p-input-url/examples/Default.ts +13 -0
- package/skill/references/components/p-input-url/examples/Form.ts +31 -0
- package/skill/references/components/p-input-url/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-url/p-input-url.md +141 -0
- package/skill/references/components/p-input-week/examples/Default.ts +13 -0
- package/skill/references/components/p-input-week/examples/Form.ts +31 -0
- package/skill/references/components/p-input-week/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-week/p-input-week.md +138 -0
- package/skill/references/components/p-link/examples/Default.ts +15 -0
- package/skill/references/components/p-link/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link/examples/Icon.ts +20 -0
- package/skill/references/components/p-link/p-link.md +101 -0
- package/skill/references/components/p-link-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-link-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-link-pure/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link-pure/examples/Icon.ts +20 -0
- package/skill/references/components/p-link-pure/p-link-pure.md +110 -0
- package/skill/references/components/p-link-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-link-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-link-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-link-tile/examples/Hyphens.ts +39 -0
- package/skill/references/components/p-link-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-link-tile/examples/WithVideo.ts +18 -0
- package/skill/references/components/p-link-tile/p-link-tile.md +105 -0
- package/skill/references/components/p-link-tile-product/examples/Default.ts +24 -0
- package/skill/references/components/p-link-tile-product/examples/FrameworkRouting.ts +27 -0
- package/skill/references/components/p-link-tile-product/p-link-tile-product.md +93 -0
- package/skill/references/components/p-modal/examples/AlertDialog.ts +41 -0
- package/skill/references/components/p-modal/examples/CustomStyling.ts +28 -0
- package/skill/references/components/p-modal/examples/Default.ts +41 -0
- package/skill/references/components/p-modal/examples/Scrollable.ts +45 -0
- package/skill/references/components/p-modal/p-modal.md +135 -0
- package/skill/references/components/p-model-signature/examples/CustomStyling.ts +17 -0
- package/skill/references/components/p-model-signature/examples/Default.ts +13 -0
- package/skill/references/components/p-model-signature/examples/MaskBlendMode.ts +35 -0
- package/skill/references/components/p-model-signature/examples/MaskImage.ts +15 -0
- package/skill/references/components/p-model-signature/examples/MaskVideo.ts +15 -0
- package/skill/references/components/p-model-signature/examples/SafeZone.ts +63 -0
- package/skill/references/components/p-model-signature/p-model-signature.md +62 -0
- package/skill/references/components/p-multi-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-multi-select/examples/Default.ts +32 -0
- package/skill/references/components/p-multi-select/examples/Form.ts +38 -0
- package/skill/references/components/p-multi-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-multi-select/examples/SelectedSlot.ts +103 -0
- package/skill/references/components/p-multi-select/examples/SetValue.ts +76 -0
- package/skill/references/components/p-multi-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-multi-select/p-multi-select.md +197 -0
- package/skill/references/components/p-pagination/examples/Default.ts +13 -0
- package/skill/references/components/p-pagination/p-pagination.md +83 -0
- package/skill/references/components/p-pin-code/examples/CopyPaste.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Default.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Form.ts +31 -0
- package/skill/references/components/p-pin-code/examples/Slots.ts +42 -0
- package/skill/references/components/p-pin-code/p-pin-code.md +109 -0
- package/skill/references/components/p-popover/examples/Default.ts +17 -0
- package/skill/references/components/p-popover/examples/SlottedButton.ts +18 -0
- package/skill/references/components/p-popover/p-popover.md +116 -0
- package/skill/references/components/p-radio-group/examples/Default.ts +20 -0
- package/skill/references/components/p-radio-group/examples/Form.ts +38 -0
- package/skill/references/components/p-radio-group/examples/Slots.ts +72 -0
- package/skill/references/components/p-radio-group/p-radio-group.md +157 -0
- package/skill/references/components/p-scroller/examples/Default.ts +54 -0
- package/skill/references/components/p-scroller/examples/Height.ts +29 -0
- package/skill/references/components/p-scroller/examples/ScrollToPosition.ts +43 -0
- package/skill/references/components/p-scroller/p-scroller.md +93 -0
- package/skill/references/components/p-segmented-control/examples/Default.ts +29 -0
- package/skill/references/components/p-segmented-control/examples/Form.ts +37 -0
- package/skill/references/components/p-segmented-control/examples/Slots.ts +57 -0
- package/skill/references/components/p-segmented-control/examples/WithLabels.ts +29 -0
- package/skill/references/components/p-segmented-control/p-segmented-control.md +162 -0
- package/skill/references/components/p-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-select/examples/Default.ts +32 -0
- package/skill/references/components/p-select/examples/Form.ts +38 -0
- package/skill/references/components/p-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-select/examples/Required.ts +48 -0
- package/skill/references/components/p-select/examples/SelectedSlot.ts +130 -0
- package/skill/references/components/p-select/examples/SetValue.ts +71 -0
- package/skill/references/components/p-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-select/examples/SlottedImages.ts +38 -0
- package/skill/references/components/p-select/p-select.md +194 -0
- package/skill/references/components/p-sheet/examples/Default.ts +33 -0
- package/skill/references/components/p-sheet/p-sheet.md +121 -0
- package/skill/references/components/p-spinner/examples/Color.ts +16 -0
- package/skill/references/components/p-spinner/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-spinner/examples/Default.ts +13 -0
- package/skill/references/components/p-spinner/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-spinner/examples/Size.ts +16 -0
- package/skill/references/components/p-spinner/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-spinner/p-spinner.md +96 -0
- package/skill/references/components/p-stepper-horizontal/examples/Default.ts +26 -0
- package/skill/references/components/p-stepper-horizontal/examples/FrameworkImplementation.ts +107 -0
- package/skill/references/components/p-stepper-horizontal/p-stepper-horizontal.md +109 -0
- package/skill/references/components/p-switch/examples/Default.ts +21 -0
- package/skill/references/components/p-switch/p-switch.md +103 -0
- package/skill/references/components/p-table/examples/Advanced.ts +162 -0
- package/skill/references/components/p-table/examples/CaptionProperty.ts +40 -0
- package/skill/references/components/p-table/examples/CaptionSlot.ts +43 -0
- package/skill/references/components/p-table/examples/Default.ts +120 -0
- package/skill/references/components/p-table/examples/HideLabel.ts +40 -0
- package/skill/references/components/p-table/examples/LayoutFixed.ts +53 -0
- package/skill/references/components/p-table/examples/Sorting.ts +79 -0
- package/skill/references/components/p-table/p-table.md +189 -0
- package/skill/references/components/p-tabs/examples/ActiveTab.ts +29 -0
- package/skill/references/components/p-tabs/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs/examples/Gradient.ts +114 -0
- package/skill/references/components/p-tabs/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs/p-tabs.md +136 -0
- package/skill/references/components/p-tabs-bar/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Gradient.ts +80 -0
- package/skill/references/components/p-tabs-bar/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Links.ts +23 -0
- package/skill/references/components/p-tabs-bar/p-tabs-bar.md +181 -0
- package/skill/references/components/p-tag/examples/Default.ts +15 -0
- package/skill/references/components/p-tag/examples/Multiline.ts +17 -0
- package/skill/references/components/p-tag/examples/SlottedButton.ts +44 -0
- package/skill/references/components/p-tag/examples/SlottedLink.ts +44 -0
- package/skill/references/components/p-tag/p-tag.md +66 -0
- package/skill/references/components/p-tag-dismissible/examples/Default.ts +15 -0
- package/skill/references/components/p-tag-dismissible/p-tag-dismissible.md +75 -0
- package/skill/references/components/p-text/examples/Default.ts +15 -0
- package/skill/references/components/p-text/examples/Semantics.ts +21 -0
- package/skill/references/components/p-text/examples/Size.ts +15 -0
- package/skill/references/components/p-text/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-text/p-text.md +68 -0
- package/skill/references/components/p-text-list/examples/Default.ts +31 -0
- package/skill/references/components/p-text-list/p-text-list.md +68 -0
- package/skill/references/components/p-textarea/examples/Default.ts +13 -0
- package/skill/references/components/p-textarea/examples/Form.ts +31 -0
- package/skill/references/components/p-textarea/examples/Slots.ts +42 -0
- package/skill/references/components/p-textarea/p-textarea.md +122 -0
- package/skill/references/components/p-toast/examples/Default.ts +23 -0
- package/skill/references/components/p-toast/p-toast.md +61 -0
- package/skill/references/components/p-wordmark/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Default.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Size.ts +13 -0
- package/skill/references/components/p-wordmark/p-wordmark.md +66 -0
- package/skill/references/icons.md +5 -0
- package/skill/references/styles/emotion.md +439 -0
- package/skill/references/styles/scss.md +402 -0
- package/skill/references/styles/tailwindcss.md +356 -0
- package/skill/references/styles/vanilla-extract.md +444 -0
- package/skill/references/stylesheets.md +331 -0
- package/skill/references/tokens.md +323 -0
- package/types/porsche-design-system-components-angular.d.ts +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# p-ai-tag
|
|
2
|
+
|
|
3
|
+
`p-ai-tag` is used to indicate AI-generated or AI-modified content. It displays a localized and legally compliant AI label text (abbreviated or as long-form) combined with an icon.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Use the AI tag to indicate that content has been generated or assisted by artificial intelligence.
|
|
8
|
+
|
|
9
|
+
The following segment provides instructions for designers and developers regarding the appropriate utilization of this component in various situations.
|
|
10
|
+
|
|
11
|
+
### Do:
|
|
12
|
+
|
|
13
|
+
- Use to indicate AI-generated or AI-assisted content.
|
|
14
|
+
- Use the appropriate `locale` to match the user's language.
|
|
15
|
+
- Use the `abbreviation` variant for compact contexts where space is limited.
|
|
16
|
+
- Use the `generated` or `modified` variant when a full label improves clarity.
|
|
17
|
+
|
|
18
|
+
### Don't:
|
|
19
|
+
|
|
20
|
+
- Don't use as a general-purpose tag — use `p-tag` instead.
|
|
21
|
+
- Don't use for non-AI-related labeling or categorization.
|
|
22
|
+
|
|
23
|
+
## Accessibility support
|
|
24
|
+
|
|
25
|
+
For the `abbreviation` variant, the component uses an `<abbr>` element so the full “artificial intelligence” term is available as the expansion.
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### Properties
|
|
30
|
+
|
|
31
|
+
| Property | Type | Default | Description |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| `locale` | `'bg_BG'` `'bs_BA'` `'cs_CZ'` `'da_DK'` `'de_DE'` `'el_GR'` `'en_CY'` `'en_GB'` `'en_US'` `'es_ES'` `'et_EE'` `'fi_FI'` `'fr_FR'` `'he_IL'` `'hr_HR'` `'hu_HU'` `'is_IS'` `'it_IT'` `'lt_LT'` `'lv_LV'` `'me_ME'` `'mk_MK'` `'mt_MT'` `'nb_NO'` `'nl_NL'` `'pl_PL'` `'pt_PT'` `'ro_RO'` `'ru_RU'` `'sk_SK'` `'sl_SI'` `'sr_RS'` `'sv_SE'` `'tr_TR'` `'uk_UA'` | `'en_US'` | Locale for the AI text (ISO format, e.g. "de_DE"). |
|
|
34
|
+
| `variant` | `'abbreviation'` `'generated'` `'modified'` | `'generated'` | Variant to display: 'abbreviation' (e.g. "AI"), 'generated' (e.g. "AI-generated"), or 'modified' (e.g. "AI-modified"). |
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
| Example | When to use | File |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
41
|
+
| Within Checkbox | The `p-ai-tag` can be used inline with other form components. | [./examples/WithinCheckbox.ts](./examples/WithinCheckbox.ts) |
|
|
42
|
+
| Within Radio Group | The `p-ai-tag` can also be placed within the slotted label of a `p-radio-button-wrapper` to indicate AI-related content for individual radio options. | [./examples/WithinRadioGroup.ts](./examples/WithinRadioGroup.ts) |
|
|
43
|
+
| Within Form Label | The `p-ai-tag` can be placed within a `label` of a `p-select` (or any other form component) to indicate AI-related content for selected options. | [./examples/WithinFormLabel.ts](./examples/WithinFormLabel.ts) |
|
|
44
|
+
| Within Input Search | The `p-ai-tag` can be placed in the `end` slot of a `p-input-search` to indicate that the search results are AI-powered. | [./examples/WithinInputSearch.ts](./examples/WithinInputSearch.ts) |
|
|
45
|
+
| Within Text | The `p-ai-tag` can be placed inline within a `p-text` to indicate that the surrounding text content is AI-related. | [./examples/WithinText.ts](./examples/WithinText.ts) |
|
|
46
|
+
| Within Image | The `p-ai-tag` can be positioned as an overlay on images to indicate that the image content has been generated or modified by AI. | [./examples/WithinImage.ts](./examples/WithinImage.ts) |
|
|
47
|
+
| Within Table | The `p-ai-tag` can sit inline in a `p-table-head-cell` next to the column title — for example on a **Status** column when that data is AI-assisted. | [./examples/WithinTable.ts](./examples/WithinTable.ts) |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button type="button" (click)="onClick()">
|
|
8
|
+
Open Banner
|
|
9
|
+
</p-button>
|
|
10
|
+
|
|
11
|
+
<p-banner [open]="open" class="[--p-banner-top:8px] [--p-banner-bottom:8px] [--p-banner-inset-x:8px] [--p-banner-max-w:70ch]" (dismiss)="onDismiss()">
|
|
12
|
+
<p-heading slot="heading" size="sm" weight="semibold">
|
|
13
|
+
Some heading
|
|
14
|
+
</p-heading>
|
|
15
|
+
<p-text slot="description">
|
|
16
|
+
Some description. You can also add inline
|
|
17
|
+
<p-link-pure href="https://porsche.com" icon="none" [underline]="true">
|
|
18
|
+
links
|
|
19
|
+
</p-link-pure>
|
|
20
|
+
to route to another page.
|
|
21
|
+
</p-text>
|
|
22
|
+
</p-banner>
|
|
23
|
+
`,
|
|
24
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
+
standalone: true,
|
|
26
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
27
|
+
})
|
|
28
|
+
export class ExampleComponent {
|
|
29
|
+
open = false;
|
|
30
|
+
|
|
31
|
+
onClick() {
|
|
32
|
+
this.open = true;
|
|
33
|
+
}
|
|
34
|
+
onDismiss() {
|
|
35
|
+
this.open = false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button type="button" (click)="onClick()">
|
|
8
|
+
Open Banner
|
|
9
|
+
</p-button>
|
|
10
|
+
|
|
11
|
+
<p-banner [open]="open" heading="Some Heading" headingTag="h3" description="Some Description" (dismiss)="onDismiss()"></p-banner>
|
|
12
|
+
`,
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
16
|
+
})
|
|
17
|
+
export class ExampleComponent {
|
|
18
|
+
open = false;
|
|
19
|
+
|
|
20
|
+
onClick() {
|
|
21
|
+
this.open = true;
|
|
22
|
+
}
|
|
23
|
+
onDismiss() {
|
|
24
|
+
this.open = false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# p-banner
|
|
2
|
+
|
|
3
|
+
The `p-banner` component provides action-based feedback messages (e.g. after performing a task) or to convey informational and/or critical notification like some site related topics.
|
|
4
|
+
|
|
5
|
+
Review the [notification decision tree](https://designsystem.porsche.com/patterns/notifications/decision-tree) to determine which notification component is best for a particular scenario.
|
|
6
|
+
|
|
7
|
+
For more information about the Usage of the `p-banner` checkout the [Notification](https://designsystem.porsche.com/patterns/notifications/introduction) page.
|
|
8
|
+
|
|
9
|
+
## Accessibility support
|
|
10
|
+
|
|
11
|
+
### Keyboard
|
|
12
|
+
|
|
13
|
+
| Key / state | Function |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `ESC` | Closes the Banner. |
|
|
16
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next focusable element. |
|
|
17
|
+
| `focus` | Moves focus automatically to the close button. |
|
|
18
|
+
|
|
19
|
+
### ARIA enhancements
|
|
20
|
+
|
|
21
|
+
#### Internal **ARIA** that is managed by the component:
|
|
22
|
+
|
|
23
|
+
| ARIA | Usage |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `role="status"` | When content is populated or changed in `state="info"`, the component announces it unobtrusively. |
|
|
26
|
+
| `role="alert"` | When content is populated or changed in `state="warning/error"`, the component announces it immediately. |
|
|
27
|
+
| `aria-label="STRING"` | References the accessible name. |
|
|
28
|
+
|
|
29
|
+
## Development considerations
|
|
30
|
+
|
|
31
|
+
### Focus handling
|
|
32
|
+
|
|
33
|
+
To support **keyboard navigation**, please take care of correct **focus handling** after closing the `Banner` with `ESC` or `Enter` key: The trigger element (e.g. a button) which has opened the `Banner` must receive focus state again after the `Banner` is closed. This is important to keep focus order consistent.
|
|
34
|
+
|
|
35
|
+
### ARIA live announcements
|
|
36
|
+
|
|
37
|
+
The `Banner` component uses `role="status"` and `role="alert"` to announce **content changes** for assistive technologies, but only if the component is **pre-rendered** and the content is added dynamically.
|
|
38
|
+
|
|
39
|
+
### Common do's and don'ts
|
|
40
|
+
|
|
41
|
+
- **Do** pre-render the banner in the DOM and update its content when showing feedback.
|
|
42
|
+
- **Do** provide meaningful `heading` and `description` text for warnings and errors.
|
|
43
|
+
- **Do** return focus to the trigger or at a logical place after the banner is dismissed.
|
|
44
|
+
- **Don't** mount the entire banner only at the moment it should be announced.
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
### Properties
|
|
49
|
+
|
|
50
|
+
| Property | Type | Default | Description |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| `description` | `string` | `''` | Sets the supporting description text shown below the heading. |
|
|
53
|
+
| `dismissButton` | `boolean` | `true` | Shows a dismiss button so the user can manually close the banner. |
|
|
54
|
+
| `heading` | `string` | `''` | Sets the heading text displayed at the top of the banner. |
|
|
55
|
+
| `headingTag` | `'h1'` `'h2'` `'h3'` `'h4'` `'h5'` `'h6'` | `'h5'` | Sets the HTML heading tag (e.g. h2, h3) to maintain correct document structure for the heading. |
|
|
56
|
+
| `open` _(required)_ | `boolean` | `false` | Controls whether the banner is visible. Set to `true` to show it and `false` to hide it. |
|
|
57
|
+
| `position` | `'top'` `'bottom'`<br>`BreakpointCustomizable<BannerPosition>` | `{"base":"bottom","s":"top"}` | Sets the position of the banner on screen — `top` or `bottom`. Supports responsive breakpoint values. |
|
|
58
|
+
| `state` | `'info'` `'success'` `'warning'` `'error'` | `'info'` | Sets the visual state of the banner — controls the icon and color scheme (`info`, `warning`, `error`, `success`). |
|
|
59
|
+
|
|
60
|
+
### Events
|
|
61
|
+
|
|
62
|
+
| Event | Type | Description |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `dismiss` | `CustomEvent<void>` | Emitted when the user closes the banner via the dismiss button or Escape key. |
|
|
65
|
+
|
|
66
|
+
### Controlled properties
|
|
67
|
+
|
|
68
|
+
- `open` — a controlled prop: the component does **not** update it itself. Handle the `dismiss` event and assign the new value to `open` yourself, or the change will not take effect.
|
|
69
|
+
|
|
70
|
+
### Slots
|
|
71
|
+
|
|
72
|
+
| Slot | Required | Allowed tag names | Description |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| `heading` | no | — | Defines the heading of the banner. Can be used as an alternative to the `heading` prop for rich content. |
|
|
75
|
+
| _(default)_ | no | — | Default slot for the banner description content. |
|
|
76
|
+
| `description` _(deprecated)_ | no | — | Deprecated: Use the default slot instead. |
|
|
77
|
+
|
|
78
|
+
### CSS Variables
|
|
79
|
+
|
|
80
|
+
| CSS Variable | Default | Description |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `--p-banner-max-w` | `100ch` | Defines the maximum width of the Banner. |
|
|
83
|
+
| `--p-banner-top` | `56px` | Defines the distance from the top of the viewport. Only takes effect when the `position` property is set to `top` (at the respective breakpoint). |
|
|
84
|
+
| `--p-banner-bottom` | `56px` | Defines the distance from the bottom of the viewport. Only takes effect when the `position` property is set to `bottom` (at the respective breakpoint). |
|
|
85
|
+
| `--p-banner-inset-x` | `max(22px, 10.625vw - 12px)` | Defines the horizontal offset of the Banner from the edges of the viewport. |
|
|
86
|
+
|
|
87
|
+
## Examples
|
|
88
|
+
|
|
89
|
+
| Example | When to use | File |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
92
|
+
| Customization | Rich content for `heading` and `description` can be provided via named slots. | [./examples/Customization.ts](./examples/Customization.ts) |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button>
|
|
8
|
+
Some label
|
|
9
|
+
</p-button>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<form (submit)="handleSubmit($event)" class="flex gap-fluid-sm">
|
|
8
|
+
<p-button name="option" value="A" type="submit">Button A</p-button>
|
|
9
|
+
<p-button name="option" value="B" type="submit">Button B</p-button>
|
|
10
|
+
</form>
|
|
11
|
+
|
|
12
|
+
<p-text>Last submitted data: {{ lastSubmittedData }}</p-text>
|
|
13
|
+
`,
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
standalone: true,
|
|
16
|
+
imports: [PorscheDesignSystemModule],
|
|
17
|
+
})
|
|
18
|
+
export class ExampleComponent {
|
|
19
|
+
lastSubmittedData: string = 'none';
|
|
20
|
+
|
|
21
|
+
handleSubmit(e: Event): void {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
const submitter = (e as SubmitEvent).submitter as HTMLButtonElement;
|
|
24
|
+
this.lastSubmittedData = submitter.name + '=' + submitter.value || 'none';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<form (submit)="handleSubmit($event)" id="some-form">
|
|
8
|
+
<p-textarea name="some-name" label="Some Label"></p-textarea>
|
|
9
|
+
</form>
|
|
10
|
+
|
|
11
|
+
<div class="flex gap-fluid-sm mt-fluid-sm">
|
|
12
|
+
<p-button type="submit" form="some-form">Submit</p-button>
|
|
13
|
+
<p-button type="reset" form="some-form">Reset</p-button>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<p-text>Last submitted data: {{ lastSubmittedData }}</p-text>
|
|
17
|
+
`,
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [PorscheDesignSystemModule],
|
|
21
|
+
})
|
|
22
|
+
export class ExampleComponent {
|
|
23
|
+
lastSubmittedData: string = 'none';
|
|
24
|
+
|
|
25
|
+
handleSubmit(e: Event): void {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
const formData = new FormData(e.target as HTMLFormElement);
|
|
28
|
+
this.lastSubmittedData = (formData.get('some-name') as string) || 'none';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# p-button
|
|
2
|
+
|
|
3
|
+
The `p-button` component is essential for performing form or **interaction** events. For an optimal user guidance and dedicated pursuit of business or sales goals, different types of Buttons (**Primary** and **Secondary**) are available for usage. A Button can be used with or without a label but it's recommended to keep the **label visible** for better **usability** whenever possible. When used without a label, it is mandatory for **accessibility** to provide a descriptive label text for screen readers. Whenever you want to provide navigational elements, stick to the [Link](../p-link/p-link.md) component instead.
|
|
4
|
+
|
|
5
|
+
You can use native `click`, `focus`, `focusin`, `blur` and `focusout` events on the `p-button`.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Do:
|
|
10
|
+
|
|
11
|
+
- Use buttons for actions that have clear consequences, such as submitting a form or initiating a purchase.
|
|
12
|
+
- Use buttons to indicate the next step in a process, such as "Continue" or "Next".
|
|
13
|
+
- Use buttons with clear and concise labels that accurately describe the action they perform.
|
|
14
|
+
- Use the primary button for the most important or desired action, and use the secondary button for less important or secondary actions.
|
|
15
|
+
- Use icons in buttons to enhance their meaning, but ensure the icon is relevant and easily recognizable.
|
|
16
|
+
- Use disabled buttons to indicate actions that are currently unavailable or incomplete, and provide context for why the button is disabled.
|
|
17
|
+
|
|
18
|
+
### Don't:
|
|
19
|
+
|
|
20
|
+
- Don't use buttons for non-actionable elements, such as decorative graphics or text.
|
|
21
|
+
- Don't use ambiguous or unclear labels for buttons, as it can lead to confusion for users.
|
|
22
|
+
- Don't use too many buttons on a page or in a single section, as it can overwhelm users and reduce usability.
|
|
23
|
+
- Don't use primary and secondary buttons interchangeably, as it can confuse users and reduce the clarity of your interface.
|
|
24
|
+
- Don't use disabled buttons without providing context for why the button is disabled. This can lead to confusion and frustration for users.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Related components
|
|
29
|
+
|
|
30
|
+
- [Links](../p-link/p-link.md)
|
|
31
|
+
|
|
32
|
+
## Accessibility support
|
|
33
|
+
|
|
34
|
+
### Keyboard
|
|
35
|
+
|
|
36
|
+
| Key / state | Function |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
39
|
+
| `Enter`, `Space` | Activates the button. |
|
|
40
|
+
| `disabled` | Button still focusable. |
|
|
41
|
+
|
|
42
|
+
### ARIA enhancements
|
|
43
|
+
|
|
44
|
+
#### External **ARIA** provided by the `aria` property:
|
|
45
|
+
|
|
46
|
+
| ARIA | Usage |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `aria-label` | Defines a string value that labels the interactive element. |
|
|
49
|
+
| `aria-description` | Defines a string value that adds a more detailed description of the interactive element. |
|
|
50
|
+
| `aria-expanded` | Exposes a visual state (e.g. expanded/collapsed) of another element. |
|
|
51
|
+
| `aria-pressed` | Exposes the `pressed` state of a toggle button. |
|
|
52
|
+
| `aria-haspopup` | Defines that the button opens a popup (e.g. `dialog`). It can be used in combination with `aria-expanded` to indicate the state of the popup. |
|
|
53
|
+
|
|
54
|
+
#### Internal **ARIA** that is managed by the component:
|
|
55
|
+
|
|
56
|
+
| ARIA | Usage |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `aria-disabled="true"` | When `disabled` prop is set, this ARIA attribute is set on the button element. |
|
|
59
|
+
| `role="status"` | When `loading` prop is set, the component announces the loading state (start and finish). |
|
|
60
|
+
| `aria-hidden="true"` | When the `icon` prop is set, the icon is hidden from the screen reader. |
|
|
61
|
+
|
|
62
|
+
## Limitations
|
|
63
|
+
|
|
64
|
+
Due to the nature of **Web Components** and **shadow DOM**, there are limitations when using some **ARIA** attributes to define relationships between elements across different shadow DOMs or shadow DOM/light DOM combinations.
|
|
65
|
+
|
|
66
|
+
| ARIA | Support |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `aria-labelledby` | 🚫 |
|
|
69
|
+
| `aria-describedby` | 🚫 |
|
|
70
|
+
| `aria-owns` | 🚫 |
|
|
71
|
+
| `aria-controls` | 🚫 |
|
|
72
|
+
| `aria-activedescendant` | 🚫 |
|
|
73
|
+
|
|
74
|
+
## Development considerations
|
|
75
|
+
|
|
76
|
+
### Labelling
|
|
77
|
+
|
|
78
|
+
If the text of a button does not clearly indicate what the button's behavior is, add a brief, descriptive label using the `aria` property with the `aria-label` value to provide more context for screen reader users. Phrases like "Add", "Detail" or "Show" can be unclear when read out of context by a screen reader. In such instances, provide an alternative text that offers more detailed information, such as "Add item XYZ to shopping cart" or "Details of product XYZ."
|
|
79
|
+
|
|
80
|
+
### Common do's and don'ts
|
|
81
|
+
|
|
82
|
+
- **Do** pass ARIA attributes via the `aria` prop, for example `aria="{ 'aria-haspopup': 'dialog' }"` when opening a dialog.
|
|
83
|
+
- **Do** provide a clear accessible name for icon-only actions via slotted label or `aria` property.
|
|
84
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
85
|
+
- **Don't** rely on short generic button labels like "Show" or "Add" without context.
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
### Properties
|
|
90
|
+
|
|
91
|
+
| Property | Type | Default | Description |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| `aria` | `ButtonAriaAttribute` | `undefined` | Sets ARIA attributes on the button to improve accessibility for screen readers. |
|
|
94
|
+
| `compact` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Reduces the button's height and padding for denser layouts. Supports responsive breakpoint values. |
|
|
95
|
+
| `disabled` | `boolean` | `false` | Disables the button, preventing all interaction and blocking events. |
|
|
96
|
+
| `form` | `string` | `undefined` | Associates the button with a form element by its ID, so it can submit or reset that form even when placed outside of it. |
|
|
97
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
98
|
+
| `icon` | `'none'`<br>one of 290 icon names — see [icon names](references/icons.md) | `'none'` | Sets the icon displayed inside the button. Use `none` to show no icon. |
|
|
99
|
+
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon, used instead of the built-in icon set. |
|
|
100
|
+
| `loading` | `boolean` | `false` | Disables the button and replaces its content with a loading spinner to indicate an ongoing operation. |
|
|
101
|
+
| `name` | `string` | `undefined` | Sets the name submitted with the form data when this button triggers form submission. |
|
|
102
|
+
| `type` | `'button'` `'submit'` `'reset'` | `'submit'` | Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. |
|
|
103
|
+
| `value` | `string` | `undefined` | Sets the value submitted with the form data when this button triggers form submission, paired with `name`. |
|
|
104
|
+
| `variant` | `'primary'` `'secondary'` | `'primary'` | Sets the visual style variant of the button (`primary` or `secondary`). |
|
|
105
|
+
|
|
106
|
+
### Slots
|
|
107
|
+
|
|
108
|
+
| Slot | Required | Allowed tag names | Description |
|
|
109
|
+
| --- | --- | --- | --- |
|
|
110
|
+
| _(default)_ | no | — | Default slot for the button label. |
|
|
111
|
+
|
|
112
|
+
## Examples
|
|
113
|
+
|
|
114
|
+
| Example | When to use | File |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
117
|
+
| Form | When used as a submit button, the `name` and `value` props are submitted as a pair as part of the form data. | [./examples/Form.ts](./examples/Form.ts) |
|
|
118
|
+
| Form Attribute | When a button is used as a submit or reset button outside a form, the `form` attribute can be utilized to explicitly associate the button with a specific form element. | [./examples/FormAttribute.ts](./examples/FormAttribute.ts) |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button-pure class="p-static-md">
|
|
8
|
+
Some label
|
|
9
|
+
</p-button-pure>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button-pure>
|
|
8
|
+
Some label
|
|
9
|
+
</p-button-pure>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<form (submit)="handleSubmit($event)" class="flex gap-fluid-sm">
|
|
8
|
+
<p-button-pure name="option" value="A" type="submit">Button A</p-button-pure>
|
|
9
|
+
<p-button-pure name="option" value="B" type="submit">Button B</p-button-pure>
|
|
10
|
+
</form>
|
|
11
|
+
|
|
12
|
+
<p-text>Last submitted data: {{ lastSubmittedData }}</p-text>
|
|
13
|
+
`,
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
standalone: true,
|
|
16
|
+
imports: [PorscheDesignSystemModule],
|
|
17
|
+
})
|
|
18
|
+
export class ExampleComponent {
|
|
19
|
+
lastSubmittedData: string = 'none';
|
|
20
|
+
|
|
21
|
+
handleSubmit(e: Event): void {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
const submitter = (e as SubmitEvent).submitter as HTMLButtonElement;
|
|
24
|
+
this.lastSubmittedData = submitter.name + '=' + submitter.value || 'none';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<form (submit)="handleSubmit($event)" id="some-form">
|
|
8
|
+
<p-textarea name="some-name" label="Some Label"></p-textarea>
|
|
9
|
+
</form>
|
|
10
|
+
|
|
11
|
+
<div class="flex gap-fluid-sm mt-fluid-sm">
|
|
12
|
+
<p-button-pure type="submit" form="some-form">Submit</p-button-pure>
|
|
13
|
+
<p-button-pure type="reset" form="some-form">Reset</p-button-pure>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<p-text>Last submitted data: {{ lastSubmittedData }}</p-text>
|
|
17
|
+
`,
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [PorscheDesignSystemModule],
|
|
21
|
+
})
|
|
22
|
+
export class ExampleComponent {
|
|
23
|
+
lastSubmittedData: string = 'none';
|
|
24
|
+
|
|
25
|
+
handleSubmit(e: Event): void {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
const formData = new FormData(e.target as HTMLFormElement);
|
|
28
|
+
this.lastSubmittedData = (formData.get('some-name') as string) || 'none';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# p-button-pure
|
|
2
|
+
|
|
3
|
+
The `p-button-pure` component is essential to perform events for **interactions**. A Button can be used with or without a label, but it's recommended to keep the **label visible** for better **usability** whenever possible. When used without a label, it is mandatory for **accessibility** to provide a descriptive label text for screen readers.
|
|
4
|
+
|
|
5
|
+
Whenever you want to provide navigational elements, stick to the [Link](../p-link/p-link.md) or [Link Pure](../p-link-pure/p-link-pure.md) component instead.
|
|
6
|
+
|
|
7
|
+
Similarly to the `p-button`, the `p-button-pure` can be used as a submit button within a form for which a `name` and `value` prop can be passed. See the [Button Form Example](../p-button/p-button.md) for more information.
|
|
8
|
+
|
|
9
|
+
You can use native `click`, `focus`, `focusin`, `blur` and `focusout` events on the `p-button-pure`.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use Button Pure as a more subtle call to action or to execute an action.
|
|
16
|
+
- Choose the appropriate variant for your use case, such as Icon and Text or Text only.
|
|
17
|
+
- Use Icon left as the default state and stretch only on small viewports or areas.
|
|
18
|
+
- Keep the label short and include active verbs to indicate the action.
|
|
19
|
+
- Stack Button Pure groups left-aligned to guarantee scannability and legibility.
|
|
20
|
+
|
|
21
|
+
### Don't:
|
|
22
|
+
|
|
23
|
+
- Don't use Button Pure as the primary or only call to action.
|
|
24
|
+
- Don't use long labels that do not give a clear indication of the action.
|
|
25
|
+
- Don't use buttons to link/navigate to other pages. Use regular [Link](../p-link/p-link.md) instead.
|
|
26
|
+
|
|
27
|
+
## Accessibility support
|
|
28
|
+
|
|
29
|
+
### Keyboard
|
|
30
|
+
|
|
31
|
+
| Key / state | Function |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
34
|
+
| `Enter`, `Space` | Activates the button. |
|
|
35
|
+
| `disabled` | Button still focusable. |
|
|
36
|
+
|
|
37
|
+
### ARIA enhancements
|
|
38
|
+
|
|
39
|
+
#### External **ARIA** provided by the `aria` property:
|
|
40
|
+
|
|
41
|
+
| ARIA | Usage |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `aria-label` | Defines a string value that labels the interactive element. |
|
|
44
|
+
| `aria-description` | Defines a string value that adds a more detailed description of the interactive element. |
|
|
45
|
+
| `aria-expanded` | Exposes a visual state (e.g. expanded/collapsed) of another element. |
|
|
46
|
+
| `aria-pressed` | Exposes the `pressed` state of a toggle button. |
|
|
47
|
+
| `aria-haspopup` | Defines that the button opens a popup (e.g. `dialog`). It can be used in combination with `aria-expanded` to indicate the state of the popup. |
|
|
48
|
+
|
|
49
|
+
#### Internal **ARIA** that is managed by the component:
|
|
50
|
+
|
|
51
|
+
| ARIA | Usage |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `aria-disabled="true"` | When `disabled` prop is set, this ARIA attribute is set on the button element. |
|
|
54
|
+
| `role="status"` | When `loading` prop is set, the component announces the loading state (start and finish). |
|
|
55
|
+
| `aria-hidden="true"` | When the `icon` prop is set, the icon is hidden from the screen reader. |
|
|
56
|
+
|
|
57
|
+
## Limitations
|
|
58
|
+
|
|
59
|
+
Due to the nature of **Web Components** and **shadow DOM**, there are limitations when using some **ARIA** attributes to define relationships between elements across different shadow DOMs or shadow DOM/light DOM combinations.
|
|
60
|
+
|
|
61
|
+
| ARIA | Support |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `aria-labelledby` | 🚫 |
|
|
64
|
+
| `aria-describedby` | 🚫 |
|
|
65
|
+
| `aria-owns` | 🚫 |
|
|
66
|
+
| `aria-controls` | 🚫 |
|
|
67
|
+
| `aria-activedescendant` | 🚫 |
|
|
68
|
+
|
|
69
|
+
## Development considerations
|
|
70
|
+
|
|
71
|
+
### Labelling
|
|
72
|
+
|
|
73
|
+
If the text of a button does not clearly indicate what the button's behavior is, add a brief, descriptive label using the `aria` property with the `aria-label` value to provide more context for screen reader users. Phrases like "Add," "Detail," or "Show" can be unclear when read out of context by a screen reader. In such instances, provide an alternative text that offers more detailed information, such as "Add item XYZ to shopping cart" or "Details of product XYZ."
|
|
74
|
+
|
|
75
|
+
### Common do's and don'ts
|
|
76
|
+
|
|
77
|
+
- **Do** pass ARIA attributes via the `aria` prop, for example `aria="{ 'aria-haspopup': 'dialog' }"` when opening a dialog.
|
|
78
|
+
- **Do** provide a clear accessible name for icon-only actions via slotted label or `aria` property.
|
|
79
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
80
|
+
- **Don't** rely on short generic button labels like "Show" or "Add" without context.
|
|
81
|
+
|
|
82
|
+
## API
|
|
83
|
+
|
|
84
|
+
### Properties
|
|
85
|
+
|
|
86
|
+
| Property | Type | Default | Description |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| `active` | `boolean` | `false` | Visually marks the button as the currently active or selected item, useful for navigation and toggle patterns. |
|
|
89
|
+
| `alignLabel` | `'start'` `'end'`<br>`BreakpointCustomizable<ButtonPureAlignLabel>` | `'end'` | Sets the label position relative to the icon — `start` places it before, `end` places it after. Supports responsive breakpoint values. |
|
|
90
|
+
| `aria` | `ButtonPureAriaAttribute` | `undefined` | Sets ARIA attributes on the button to improve accessibility for screen readers. |
|
|
91
|
+
| `color` | `'primary'` `'contrast-higher'` `'contrast-high'` `'contrast-medium'` `'inherit'` | `'primary'` | Sets the foreground color of the button's icon and label text. |
|
|
92
|
+
| `disabled` | `boolean` | `false` | Disables the button, preventing all interaction and blocking events. |
|
|
93
|
+
| `form` | `string` | `undefined` | Associates the button with a form element by its ID, so it can submit or reset that form even when placed outside of it. |
|
|
94
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
95
|
+
| `icon` | `''`<br>one of 290 icon names — see [icon names](references/icons.md) | `'arrow-right'` | Sets the icon displayed next to the label. |
|
|
96
|
+
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon, used instead of the built-in icon set. |
|
|
97
|
+
| `loading` | `boolean` | `false` | Disables the button and replaces its icon with a loading spinner to indicate an ongoing operation. |
|
|
98
|
+
| `name` | `string` | `undefined` | Sets the name submitted with the form data when this button triggers form submission. |
|
|
99
|
+
| `size` | `'2xs'` `'xs'` `'sm'` `'md'` `'lg'` `'xl'` `'2xl'` `'3xl'` `'4xl'` `'5xl'` `'inherit'`<br>_deprecated:_ `'xx-small'` `'x-small'` `'small'` `'medium'` `'large'` `'x-large'`<br>`BreakpointCustomizable<ButtonPureSize>` | `'sm'` | Sets the font size of the button label. Supports responsive breakpoint values. |
|
|
100
|
+
| `stretch` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Expands the space between icon and label to fill the full container width. Supports responsive breakpoint values. |
|
|
101
|
+
| `type` | `'button'` `'submit'` `'reset'` | `'submit'` | Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. |
|
|
102
|
+
| `underline` | `boolean` | `false` | Adds a text underline to the label to reinforce the button's link-like appearance. |
|
|
103
|
+
| `value` | `string` | `undefined` | Sets the value submitted with the form data when this button triggers form submission, paired with `name`. |
|
|
104
|
+
|
|
105
|
+
### Slots
|
|
106
|
+
|
|
107
|
+
| Slot | Required | Allowed tag names | Description |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| _(default)_ | no | — | Default slot for the button label. |
|
|
110
|
+
|
|
111
|
+
## Examples
|
|
112
|
+
|
|
113
|
+
| Example | When to use | File |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
116
|
+
| Button Pure with custom clickable/focusable area | Sometimes it might be useful to enlarge the clickable/focusable area of a button to fulfill accessibility guidelines. | [./examples/CustomClickableArea.ts](./examples/CustomClickableArea.ts) |
|
|
117
|
+
| Form | When used as a submit button, the `name` and `value` props are submitted as a pair as part of the form data. | [./examples/Form.ts](./examples/Form.ts) |
|
|
118
|
+
| Form Attribute | When a button is used as a submit or reset button outside a form, the `form` attribute can be utilized to explicitly associate the button with a specific form element. | [./examples/FormAttribute.ts](./examples/FormAttribute.ts) |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button-tile label="Some label" description="Some Description" [gradient]="true">
|
|
8
|
+
<p-tag slot="header" color="background-frosted" [compact]="true" [style]="{'colorScheme': 'only light'}">
|
|
9
|
+
Some tag
|
|
10
|
+
</p-tag>
|
|
11
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
12
|
+
</p-button-tile>
|
|
13
|
+
`,
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
standalone: true,
|
|
16
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
17
|
+
})
|
|
18
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-button-tile label="Some label" description="Some Description" [gradient]="true">
|
|
8
|
+
<p-tag slot="header" color="background-frosted" [compact]="true">
|
|
9
|
+
Some tag
|
|
10
|
+
</p-tag>
|
|
11
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
12
|
+
<p-text slot="footer">
|
|
13
|
+
Some footer text
|
|
14
|
+
</p-text>
|
|
15
|
+
</p-button-tile>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
export class ExampleComponent {}
|