@porsche-design-system/components-angular 4.5.0 → 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 +8 -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,142 @@
|
|
|
1
|
+
# p-carousel
|
|
2
|
+
|
|
3
|
+
The `p-carousel` component allows related or similar content to be consumed on a step by step basis with a better overview than just showing them in a grid or as a list. The reason for this is, that only a certain amount of slides is visible at the same time.
|
|
4
|
+
|
|
5
|
+
Therefore, the `p-carousel`'s content has to be divided into multiple parts or slides. The amount of slides visible can be specified on a per-breakpoint basis.
|
|
6
|
+
|
|
7
|
+
> **Layout hint**
|
|
8
|
+
>
|
|
9
|
+
> When using the `width` prop to align with the **[Porsche Grid](../../styles/tailwindcss.md)**, the component must span the full viewport width.
|
|
10
|
+
>
|
|
11
|
+
> When using the `--p-carousel-px` CSS variable, the component can be placed within any container, allowing you to customize the horizontal padding that reveals parts of the next/previous slide.
|
|
12
|
+
>
|
|
13
|
+
> When using the `--p-carousel-ps` and `--p-carousel-pe` CSS variables, the component can be placed within any container, allowing you to customize the horizontal padding asymmetric that reveals parts of the next/previous slide.
|
|
14
|
+
|
|
15
|
+
> **Dynamic changes**
|
|
16
|
+
>
|
|
17
|
+
> This component has limited support for dynamic property changes due to the way it is implemented.
|
|
18
|
+
>
|
|
19
|
+
> If you need to use a specific property dynamically, please open a [feature request](https://designsystem.porsche.com/help/feature-request/).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Do:
|
|
24
|
+
|
|
25
|
+
- Use to showcase a group of related featured content in a row, such as images or cards.
|
|
26
|
+
- Use when you have five or fewer items of the same style to display.
|
|
27
|
+
- Use when there is insufficient content space to display all items without overlapping or cluttering.
|
|
28
|
+
- Keep the number of slides within the carousel to a minimum, preferably five or fewer.
|
|
29
|
+
- Use specify the number of slides visible at the same time, either static or for each breakpoint individually.
|
|
30
|
+
|
|
31
|
+
### Don't:
|
|
32
|
+
|
|
33
|
+
- Don't vary the size of the items in its height.
|
|
34
|
+
- Don't maintain the same layout or at least the same content structure with every item.
|
|
35
|
+
|
|
36
|
+
## Accessibility support
|
|
37
|
+
|
|
38
|
+
### Keyboard
|
|
39
|
+
|
|
40
|
+
| Key / state | Function |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `Tab`, `Shift-Tab` | - Moves focus to the next (or previous) focusable element. - Supports cycling through all items. - Activates "Skip" link (if set through `skipLinkTarget`). |
|
|
43
|
+
|
|
44
|
+
### ARIA enhancements
|
|
45
|
+
|
|
46
|
+
#### External **ARIA** provided by the `aria` property:
|
|
47
|
+
|
|
48
|
+
| ARIA | Usage |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `aria-label` | Defines a string value that labels the carousel. |
|
|
51
|
+
|
|
52
|
+
#### Internal **ARIA** that is managed by the component:
|
|
53
|
+
|
|
54
|
+
| ARIA | Usage |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `aria-label="STRING"` | Defines a string value that labels prev/next and carousel items. |
|
|
57
|
+
| `role="region"` | Defines the carousel as a semantic region. |
|
|
58
|
+
| `role="group"` | Defines the carousel item as a semantic group. |
|
|
59
|
+
| `aria-labelledby="IDREF"` | References the accessible name. |
|
|
60
|
+
| `aria-roledescription="carousel"` | Specifies the role as "carousel". |
|
|
61
|
+
| `aria-roledescription="slide"` | Specifies the role of the carousel item as "slide". |
|
|
62
|
+
| `aria-live="polite"` | Announces current active slide item. |
|
|
63
|
+
|
|
64
|
+
## Development considerations
|
|
65
|
+
|
|
66
|
+
### Skip Carousel Entries
|
|
67
|
+
|
|
68
|
+
Through the `skipLinkTarget` property, a skip link for keyboard users can be provided to give the possibility to skip over all carousel entries. The skip link is only visible when it receives focus from the keyboard.
|
|
69
|
+
|
|
70
|
+
- Use the `skipLinkTarget` property if you have >5 carousel items
|
|
71
|
+
- The target of the skip link should point to the next heading or element right after the carousel
|
|
72
|
+
|
|
73
|
+
### Common do's and don'ts
|
|
74
|
+
|
|
75
|
+
- **Do** configure `skip-link-target` for larger carousels or repeated content sections.
|
|
76
|
+
- **Do** ensure the skip target points to the next meaningful section.
|
|
77
|
+
- **Do** provide a descriptive carousel label via the `aria` property.
|
|
78
|
+
- **Don't** force keyboard users to tab through every slide control when a skip path is needed.
|
|
79
|
+
- **Don't** use vague labels that do not communicate carousel context.
|
|
80
|
+
|
|
81
|
+
## API
|
|
82
|
+
|
|
83
|
+
### Properties
|
|
84
|
+
|
|
85
|
+
| Property | Type | Default | Description |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
| `activeSlideIndex` | `number` | `0` | Sets the zero-based index of the currently visible slide. Update this to navigate programmatically. |
|
|
88
|
+
| `alignControls` | `'start'` `'center'` `'auto'` | `'auto'` | Controls the alignment of custom slotted controls within the header area. |
|
|
89
|
+
| `alignHeader` | `'start'` `'center'` | `'start'` | Controls the horizontal alignment of the heading and description. |
|
|
90
|
+
| `aria` | `CarouselAriaAttribute` | `undefined` | Sets ARIA attributes on the carousel region element for improved accessibility. |
|
|
91
|
+
| `description` | `string` | `undefined` | Sets the description text displayed below the heading for additional context. |
|
|
92
|
+
| `focusOnCenterSlide` | `boolean` | `false` | When enabled, each slide is individually focusable and the carousel navigates one slide at a time instead of one page. |
|
|
93
|
+
| `gradient` | `boolean` | `false` | Shows a gradient fade at the start and end edges to visually indicate more slides beyond the viewport. |
|
|
94
|
+
| `heading` | `string` | `undefined` | Sets the heading text displayed above the carousel. Also used as the accessible label when no `aria` prop is set. |
|
|
95
|
+
| `headingSize` | `'x-large'` `'xx-large'` | `'x-large'` | Sets the font size of the carousel heading. |
|
|
96
|
+
| `intl` | `CarouselInternationalization` | `undefined` | Overrides the default label strings used for the previous, next, and page indicators — useful for localization. |
|
|
97
|
+
| `pagination` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Shows pagination dot indicators below the carousel. Supports responsive breakpoint values. |
|
|
98
|
+
| `rewind` | `boolean` | `false` | Enables infinite looping — navigating past the last slide wraps back to the first, and vice versa. |
|
|
99
|
+
| `skipLinkTarget` | `string` | `undefined` | Sets the `href` of an in-page skip link that lets keyboard users jump past the carousel slides. |
|
|
100
|
+
| `slidesPerPage` | `'auto'` `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`<br>`BreakpointCustomizable<CarouselSlidesPerPage>` | `1` | Sets how many slides are visible at once. Use `auto` to control each slide's width via CSS. Supports responsive breakpoint values. |
|
|
101
|
+
| `trimSpace` | `boolean` | `false` | Removes whitespace before the first and after the last slide when `focusOnCenterSlide` is enabled. |
|
|
102
|
+
| `width` | `'basic'` `'extended'` `'wide'` `'full'` | `'basic'` | Sets the maximum width and outer spacing of the carousel, aligned to PDS grid widths. |
|
|
103
|
+
|
|
104
|
+
### Events
|
|
105
|
+
|
|
106
|
+
| Event | Type | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `update` | `CustomEvent<CarouselUpdateEventDetail>`<br>`{ activeIndex: number; previousIndex: number }` | Emitted when the carousel navigates to a new slide, with the active and previous slide indexes in the event detail. |
|
|
109
|
+
|
|
110
|
+
### Controlled properties
|
|
111
|
+
|
|
112
|
+
- `activeSlideIndex` — a controlled prop, but the component also updates it internally. Listen for the `update` event to observe changes; you do not have to write the value back.
|
|
113
|
+
|
|
114
|
+
### Slots
|
|
115
|
+
|
|
116
|
+
| Slot | Required | Allowed tag names | Description |
|
|
117
|
+
| --- | --- | --- | --- |
|
|
118
|
+
| `heading` | no | — | Renders a heading above the carousel. |
|
|
119
|
+
| `description` | no | — | Renders descriptive content below the heading. |
|
|
120
|
+
| `controls` | no | — | Renders custom controls such as navigation buttons or indicators. |
|
|
121
|
+
| _(default)_ | no | — | Default slot for the carousel slides. |
|
|
122
|
+
|
|
123
|
+
### CSS Variables
|
|
124
|
+
|
|
125
|
+
| CSS Variable | Default | Description |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| `--p-carousel-px` | — | Defines the logical inline start and end padding of the carousel, the extra space is used to show parts of the next/previous slide. When used then the prop `width` has no effect anymore. |
|
|
128
|
+
| `--p-carousel-ps` | — | Defines the logical inline start padding of the carousel, the extra space is used to show parts of the next/previous slide. Needs to be used in combination with `--p-carousel-px` or `--p-carousel-pe`. When used then the prop `width` has no effect anymore. |
|
|
129
|
+
| `--p-carousel-pe` | — | Defines the logical inline end padding of the carousel, the extra space is used to show parts of the next/previous slide. Needs to be used in combination with `--p-carousel-px` or `--p-carousel-ps`. When used then the prop `width` has no effect anymore. |
|
|
130
|
+
| `--p-carousel-prev-next-color-scheme` | — | Color Scheme applied to the navigation (prev/next buttons) |
|
|
131
|
+
| `--p-carousel-border-radius` | `var(--p-radius-large, var(--p-radius-4xl))` | Sets the border radius of each carousel slide. |
|
|
132
|
+
|
|
133
|
+
## Examples
|
|
134
|
+
|
|
135
|
+
| Example | When to use | File |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
138
|
+
| Slides with flexible widths | In case you want to have slides with different widths you can use `slidesPerPage` with a value of `auto`. | [./examples/FlexibleWidths.ts](./examples/FlexibleWidths.ts) |
|
|
139
|
+
| Jump to slide (activeSlideIndex) | To control the `p-carousel` from the outside you can specify its `activeSlideIndex` initially but also later. | [./examples/JumpToSlide.ts](./examples/JumpToSlide.ts) |
|
|
140
|
+
| Add/remove slides | Slides can be added and removed dynamically. | [./examples/DynamicSlides.ts](./examples/DynamicSlides.ts) |
|
|
141
|
+
| Centered Slide and Gradient Customization | The carousel centers the active slide and loops through slides individually rather than by page when multiple slides are visible. | [./examples/FocusOnCenterSlide.ts](./examples/FocusOnCenterSlide.ts) |
|
|
142
|
+
| Internationalization (i18n) | Default wordings for screen readers can be overridden or translated by passing an object to the `intl` property. | [./examples/Intl.ts](./examples/Intl.ts) |
|
|
@@ -0,0 +1,13 @@
|
|
|
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-checkbox label="Some label" name="some-name"></p-checkbox>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="flex flex-col gap-fluid-sm">
|
|
9
|
+
<p-checkbox formControlName="myCheckbox" [label]="'Some Label'" />
|
|
10
|
+
<div class="flex gap-fluid-sm">
|
|
11
|
+
<p-button type="submit">Submit</p-button>
|
|
12
|
+
<p-button type="reset">Reset</p-button>
|
|
13
|
+
</div>
|
|
14
|
+
<p-text>Last submitted data: {{ submittedValue }}</p-text>
|
|
15
|
+
</form>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule, FormsModule, ReactiveFormsModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
export class ExampleComponent {
|
|
22
|
+
form = new FormGroup({
|
|
23
|
+
myCheckbox: new FormControl<boolean>(false),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
submittedValue: any = undefined;
|
|
27
|
+
|
|
28
|
+
onSubmit(): void {
|
|
29
|
+
this.submittedValue = JSON.stringify(this.form.value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
<div class="flex flex-col gap-static-sm">
|
|
8
|
+
<p-checkbox label="Some label" [indeterminate]="true"></p-checkbox>
|
|
9
|
+
<p-checkbox label="Some label" [indeterminate]="true" [checked]="true"></p-checkbox>
|
|
10
|
+
</div>
|
|
11
|
+
`,
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
15
|
+
})
|
|
16
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
<div class="flex flex-col gap-static-sm">
|
|
8
|
+
<p-checkbox name="some-name">
|
|
9
|
+
<span slot="label">
|
|
10
|
+
<img src="assets/911.png" alt="" class="object-contain inline-block align-middle -mt-2 me-static-sm w-[70px]" />
|
|
11
|
+
Some slotted label with custom content and a "label-after" slot
|
|
12
|
+
</span>
|
|
13
|
+
<p-popover slot="label-after">
|
|
14
|
+
Some label with a
|
|
15
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
16
|
+
link
|
|
17
|
+
</a>
|
|
18
|
+
</p-popover>
|
|
19
|
+
</p-checkbox>
|
|
20
|
+
<p-checkbox name="some-name">
|
|
21
|
+
<span slot="label">
|
|
22
|
+
Some slotted label
|
|
23
|
+
</span>
|
|
24
|
+
</p-checkbox>
|
|
25
|
+
<p-checkbox name="some-name" disabled="true">
|
|
26
|
+
<span slot="label">
|
|
27
|
+
Disabled slotted label, a nested
|
|
28
|
+
<a href="https://www.porsche.com" class="underline" tabindex="-1">
|
|
29
|
+
link
|
|
30
|
+
</a>
|
|
31
|
+
and a label-after slot.
|
|
32
|
+
</span>
|
|
33
|
+
<p-popover slot="label-after">
|
|
34
|
+
Some information about the disabled state.
|
|
35
|
+
</p-popover>
|
|
36
|
+
</p-checkbox>
|
|
37
|
+
<p-checkbox name="some-name" state="error">
|
|
38
|
+
<span slot="label">
|
|
39
|
+
Some slotted label with a nested
|
|
40
|
+
<a href="https://www.porsche.com" class="underline">
|
|
41
|
+
link
|
|
42
|
+
</a>
|
|
43
|
+
</span>
|
|
44
|
+
<span slot="message">
|
|
45
|
+
Some slotted error message with a
|
|
46
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
47
|
+
link
|
|
48
|
+
</a>
|
|
49
|
+
</span>
|
|
50
|
+
</p-checkbox>
|
|
51
|
+
</div>
|
|
52
|
+
`,
|
|
53
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
+
standalone: true,
|
|
55
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
56
|
+
})
|
|
57
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
<div class="flex items-start w-64 border-2 border-contrast-lower rounded-md hover:border-primary transition-colors">
|
|
8
|
+
<label class="inline-flex flex-col p-fluid-xs gap-static-xs prose-text-sm cursor-pointer hover:[--p-checkbox-border-color:var(--color-primary)]" (click)="onClick()">
|
|
9
|
+
<span>
|
|
10
|
+
Some wrapped custom label besides a popover
|
|
11
|
+
</span>
|
|
12
|
+
<p-checkbox [checked]="false"></p-checkbox>
|
|
13
|
+
</label>
|
|
14
|
+
<p-popover class="mr-static-xs mt-static-xs">
|
|
15
|
+
Some additional content.
|
|
16
|
+
</p-popover>
|
|
17
|
+
</div>
|
|
18
|
+
`,
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
22
|
+
})
|
|
23
|
+
export class ExampleComponent {
|
|
24
|
+
onClick() {
|
|
25
|
+
this.checked = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# p-checkbox
|
|
2
|
+
|
|
3
|
+
The `p-checkbox` component wraps the native HTML input type `checkbox` form element. Checking one box doesn't uncheck other Checkboxes. By default, Checkboxes are not selected.
|
|
4
|
+
|
|
5
|
+
> **Firefox Form Restore Bug**
|
|
6
|
+
>
|
|
7
|
+
> Firefox has a known bug where it incorrectly restores form state for form-associated custom elements with shadow DOM on page reload. Checkbox values may appear inside unrelated `input-text` fields in the same form under certain conditions. To work around this, add the native HTML attribute `autocomplete="off"` to all checkbox form elements. See [Firefox Bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1986953) for details.
|
|
8
|
+
|
|
9
|
+
A `label` is a caption which informs the user what information a particular form field is asking for. The `p-checkbox` component can be used with or without a label, but it's recommended to keep the label visible for better accessibility whenever possible. When used without a label, it's best practice to provide a descriptive label text for screen readers.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use for a list of options when you want the user to select one, none, or multiple options.
|
|
16
|
+
- Use when an explicit action is required to apply to settings.
|
|
17
|
+
- Use the default view for checkboxes when no option is selected.
|
|
18
|
+
- Use the indeterminate state only as a visual state and not as a direct user interaction.
|
|
19
|
+
- Nest when a parent and child relationship is needed.
|
|
20
|
+
- Use short and descriptive label text for each checkbox option.
|
|
21
|
+
- Provide validation messages for each checkbox option if needed.
|
|
22
|
+
- Set vertically left-aligned for better scannability.
|
|
23
|
+
|
|
24
|
+
### Don't:
|
|
25
|
+
|
|
26
|
+
- Avoid using when you have more than 8 options to choose from or consider using a [Select](../p-select/p-select.md).
|
|
27
|
+
- Don't mix [Radio Group](../p-radio-group/p-radio-group.md) options with checkboxes.
|
|
28
|
+
- Don't change the selection of another checkbox when a nested one is clicked. The only exception is when a checkbox is used to make a bulk selection of multiple items.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Related Components
|
|
33
|
+
|
|
34
|
+
- [Radio Group](../p-radio-group/p-radio-group.md)
|
|
35
|
+
- [Select](../p-select/p-select.md)
|
|
36
|
+
|
|
37
|
+
## Accessibility support
|
|
38
|
+
|
|
39
|
+
### Keyboard
|
|
40
|
+
|
|
41
|
+
| Key / state | Function |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
44
|
+
| `Space` | Activates/Deactivates checkbox. |
|
|
45
|
+
|
|
46
|
+
### ARIA enhancements
|
|
47
|
+
|
|
48
|
+
#### Internal **ARIA** that is managed by the component:
|
|
49
|
+
|
|
50
|
+
| ARIA | Usage |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `aria-describedby="IDREF"` | References the accessible description of status messages. |
|
|
53
|
+
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
|
|
54
|
+
| `aria-hidden="true"` | If `required` attribute is set, the visible asterisk indicator is hidden from assistive technologies. |
|
|
55
|
+
| `aria-invalid="true"` | If `error` state is set. |
|
|
56
|
+
|
|
57
|
+
## Development considerations
|
|
58
|
+
|
|
59
|
+
### Disabled state
|
|
60
|
+
|
|
61
|
+
In general, avoid using the `disabled` state. Disabled elements are no longer focusable and may be missed by screen reader users. They can also confuse sighted users if the reason they are disabled is not made clear.
|
|
62
|
+
|
|
63
|
+
### Common do's and don'ts
|
|
64
|
+
|
|
65
|
+
- **Do** provide a clear `label` that describes what the checkbox controls.
|
|
66
|
+
- **Do** use the component state/message API so validation and status changes are announced.
|
|
67
|
+
- **Do** use clear error wording that helps users recover.
|
|
68
|
+
- **Don't** use `hide-label` without an accessible name.
|
|
69
|
+
- **Don't** use `hide-label` when it is not clear what the checkbox controls.
|
|
70
|
+
|
|
71
|
+
## API
|
|
72
|
+
|
|
73
|
+
### Properties
|
|
74
|
+
|
|
75
|
+
| Property | Type | Default | Description |
|
|
76
|
+
| --- | --- | --- | --- |
|
|
77
|
+
| `checked` | `boolean` | `false` | Reflects the checkbox's current checked state and allows setting the initial checked value on load. |
|
|
78
|
+
| `compact` | `boolean` | `false` | Reduces the checkbox size and spacing for a more compact layout. |
|
|
79
|
+
| `disabled` | `boolean` | `false` | Disables the checkbox, preventing all interaction. The value is not submitted with the form. |
|
|
80
|
+
| `form` | `string` | `undefined` | Associates the checkbox with a form element by its ID when not directly nested inside it. |
|
|
81
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
82
|
+
| `indeterminate` | `boolean` | `false` | Puts the checkbox into an indeterminate state, indicating that a group of child items is only partially selected. |
|
|
83
|
+
| `label` | `string` | `''` | Sets the visible label text displayed next to the checkbox. |
|
|
84
|
+
| `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables the checkbox and displays a loading spinner to indicate an ongoing operation. |
|
|
85
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the checkbox when `state` is `success` or `error`. |
|
|
86
|
+
| `name` | `string` | `''` | Sets the name submitted with the form data to identify this checkbox's value on the server. |
|
|
87
|
+
| `required` | `boolean` | `false` | Marks the checkbox as required — form submission is blocked unless the checkbox is checked. |
|
|
88
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state, controlling the visual appearance and style of the feedback message (`none`, `success`, `error`). |
|
|
89
|
+
| `value` | `string` | `'on'` | Sets the value submitted with the form data when the checkbox is checked. Unchecked checkboxes are excluded from form submissions. |
|
|
90
|
+
|
|
91
|
+
### Events
|
|
92
|
+
|
|
93
|
+
| Event | Type | Description |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `blur` | `CustomEvent<CheckboxBlurEventDetail>`<br>`Event` | Emitted when the checkbox loses focus. |
|
|
96
|
+
| `change` | `CustomEvent<CheckboxChangeEventDetail>`<br>`Event` | Emitted when the user changes the checked state of the checkbox. |
|
|
97
|
+
|
|
98
|
+
### Slots
|
|
99
|
+
|
|
100
|
+
| Slot | Required | Allowed tag names | Description |
|
|
101
|
+
| --- | --- | --- | --- |
|
|
102
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
103
|
+
| `label-after` | no | — | Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`). |
|
|
104
|
+
| `message` | no | — | Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
105
|
+
|
|
106
|
+
### CSS Variables
|
|
107
|
+
|
|
108
|
+
| CSS Variable | Default | Description |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `--p-checkbox-border-color` | — | 🧪Experimental: Border colors of Checkbox. Should be used to override the default border color in different states (e.g., hover, focus, error), e.g. when the Checkbox is wrapped inside a custom label. |
|
|
111
|
+
| `--p-checkbox-background-color` | — | 🧪Experimental: Background color of Checkbox. |
|
|
112
|
+
| `--p-checkbox-icon-color` | — | 🧪Experimental: Checkmark icon color of Checkbox. |
|
|
113
|
+
|
|
114
|
+
## Examples
|
|
115
|
+
|
|
116
|
+
| Example | When to use | File |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
119
|
+
| Form | The `p-checkbox` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.ts) |
|
|
120
|
+
| Indeterminate | Mask the visual appearance of a checkbox which has a state in-between checked and unchecked. | [./examples/Indeterminate.ts](./examples/Indeterminate.ts) |
|
|
121
|
+
| Slots | Use named slots when `label` or `message` need markup such as a link. | [./examples/Slots.ts](./examples/Slots.ts) |
|
|
122
|
+
| Custom wrapped label (🧪Experimental) | The `p-checkbox` component also supports a custom wrapped `label` by wrapping the component in a `label` tag. | [./examples/WrappedLabel.ts](./examples/WrappedLabel.ts) |
|
|
@@ -0,0 +1,13 @@
|
|
|
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-crest href="https://porsche.com" class="p-static-md" [aria]="{'aria-label': 'Porsche Homepage'}"></p-crest>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,13 @@
|
|
|
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-crest></p-crest>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,13 @@
|
|
|
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-crest href="https://porsche.com" [aria]="{'aria-label': 'Porsche Homepage'}"></p-crest>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# p-crest
|
|
2
|
+
|
|
3
|
+
The `p-crest` gives the Porsche brand a distinctive look, sets it apart from others within the overall external image and represents the quality of the product.
|
|
4
|
+
|
|
5
|
+
> **Usage hint**
|
|
6
|
+
>
|
|
7
|
+
> This component shall only be used on viewports below 480px (breakpoint "S"). Otherwise, [p-wordmark](../p-wordmark/p-wordmark.md) has to be used.
|
|
8
|
+
|
|
9
|
+
You can use native `click`, `focus`, `focusin`, `blur` and `focusout` events on the `p-crest`.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use the [Wordmark](../p-wordmark/p-wordmark.md) as the main brand identifier.
|
|
16
|
+
- Use the crest only as an additional small brand identifier (e.g., within contact cards).
|
|
17
|
+
- Switch from the wordmark to the crest on small viewports below 480px (automatically implemented in global navigation and footer).
|
|
18
|
+
|
|
19
|
+
### Don't:
|
|
20
|
+
|
|
21
|
+
- Use the crest as the primary brand identifier by default.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Related Components
|
|
26
|
+
|
|
27
|
+
- [Wordmark](../p-wordmark/p-wordmark.md)
|
|
28
|
+
|
|
29
|
+
## Accessibility support
|
|
30
|
+
|
|
31
|
+
### ARIA enhancements
|
|
32
|
+
|
|
33
|
+
#### External **ARIA** provided by the `aria` property:
|
|
34
|
+
|
|
35
|
+
| ARIA | Usage |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `aria-label` | Defines a string value that labels the interactive element. |
|
|
38
|
+
| `aria-current` | Exposes the current state of the link. |
|
|
39
|
+
| `aria-haspopup` | Defines that the link opens a popup (e.g. `dialog`). |
|
|
40
|
+
|
|
41
|
+
## Development considerations
|
|
42
|
+
|
|
43
|
+
### Common do's and don'ts
|
|
44
|
+
|
|
45
|
+
- **Do** pass ARIA attributes through the `aria` prop when the crest is linked.
|
|
46
|
+
- **Do** provide a descriptive `aria-label` for linked crests, for example "Porsche home".
|
|
47
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
### Properties
|
|
52
|
+
|
|
53
|
+
| Property | Type | Default | Description |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| `aria` | `CrestAriaAttribute` | `undefined` | Sets ARIA attributes on the anchor element to improve accessibility when the crest is used as a link. |
|
|
56
|
+
| `href` | `string` | `undefined` | When set, renders the crest as an anchor element navigating to this URL when clicked. |
|
|
57
|
+
| `target` | `'_self'` `'_blank'` `'_parent'` `'_top'` `'string'` | `'_self'` | Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. |
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
| Example | When to use | File |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
64
|
+
| Link | The Porsche Crest will be rendered as `<a>`-tag as soon as an `href` is provided. | [./examples/Link.ts](./examples/Link.ts) |
|
|
65
|
+
| Custom clickable/focusable area | Sometimes it may be useful to enlarge the clickable/focusable area of the Porsche Crest. | [./examples/CustomClickableArea.ts](./examples/CustomClickableArea.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-display tag="h3" color="inherit" class="text-[deeppink]">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</p-display>
|
|
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-display>
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</p-display>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
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-display tag="h3">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</p-display>
|
|
10
|
+
|
|
11
|
+
<p-display>
|
|
12
|
+
<h3>
|
|
13
|
+
The quick brown fox jumps over the lazy dog
|
|
14
|
+
</h3>
|
|
15
|
+
</p-display>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
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-display tag="h3" size="inherit" class="text-[5rem]">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</p-display>
|
|
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-display tag="h3" [size]="{'base': 'medium', 'l': 'large'}">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</p-display>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|