@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,32 @@
|
|
|
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="grid grid-cols-2 gap-static-md">
|
|
8
|
+
<p-button-tile label="Some label" description="Some Description">
|
|
9
|
+
<p-tag slot="header" color="background-frosted" [compact]="true">
|
|
10
|
+
Some tag
|
|
11
|
+
</p-tag>
|
|
12
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
13
|
+
<p-text slot="footer">
|
|
14
|
+
Some footer text
|
|
15
|
+
</p-text>
|
|
16
|
+
</p-button-tile>
|
|
17
|
+
<p-button-tile label="Some label" description="Some Description" [compact]="true">
|
|
18
|
+
<p-tag slot="header" color="background-frosted" [compact]="true">
|
|
19
|
+
Some tag
|
|
20
|
+
</p-tag>
|
|
21
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
22
|
+
<p-text slot="footer">
|
|
23
|
+
Some footer text
|
|
24
|
+
</p-text>
|
|
25
|
+
</p-button-tile>
|
|
26
|
+
</div>
|
|
27
|
+
`,
|
|
28
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
31
|
+
})
|
|
32
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
PorscheDesignSystemModule,
|
|
4
|
+
PSelect,
|
|
5
|
+
type SelectChangeEventDetail,
|
|
6
|
+
} from '@porsche-design-system/components-angular';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'porsche-design-system-app',
|
|
10
|
+
template: `
|
|
11
|
+
<p-select name="hyphens" label="Select hyphens" [value]="selectedValue" (change)="onChange($event)">
|
|
12
|
+
<p-select-option value="auto">style="hyphens: auto;"</p-select-option>
|
|
13
|
+
<p-select-option value="manual">style="hyphens: manual;"</p-select-option>
|
|
14
|
+
<p-select-option value="none">style="hyphens: none;"</p-select-option>
|
|
15
|
+
</p-select>
|
|
16
|
+
|
|
17
|
+
<p-button-tile
|
|
18
|
+
label="Some label"
|
|
19
|
+
description="An extra­ordinarily Porsche"
|
|
20
|
+
[compact]="true"
|
|
21
|
+
size="inherit"
|
|
22
|
+
[style]="{ maxWidth: '400px', fontSize: '45px', hyphens: selectedValue }"
|
|
23
|
+
class="mt-fluid-sm"
|
|
24
|
+
>
|
|
25
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
26
|
+
</p-button-tile>
|
|
27
|
+
`,
|
|
28
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [PorscheDesignSystemModule],
|
|
31
|
+
})
|
|
32
|
+
export class ExampleComponent {
|
|
33
|
+
selectedValue: PSelect['value'] = 'auto';
|
|
34
|
+
|
|
35
|
+
onChange(e: CustomEvent<SelectChangeEventDetail>) {
|
|
36
|
+
this.selectedValue = e.detail.value;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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="grid grid-cols-2 gap-static-md">
|
|
8
|
+
<p-button-tile aspectRatio="4/3" label="Some Label" description="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum." size="large">
|
|
9
|
+
<p-tag slot="header" color="background-frosted" compact="true">
|
|
10
|
+
4/3
|
|
11
|
+
</p-tag>
|
|
12
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
13
|
+
</p-button-tile>
|
|
14
|
+
<p-button-tile aspectRatio="4/3" label="Some Label" description="Some description">
|
|
15
|
+
<p-tag slot="header" color="background-frosted" compact="true">
|
|
16
|
+
4/3
|
|
17
|
+
</p-tag>
|
|
18
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
19
|
+
</p-button-tile>
|
|
20
|
+
<p-button-tile aspectRatio="1/1" label="Some Label" description="Some description">
|
|
21
|
+
<p-tag slot="header" color="background-frosted" compact="true">
|
|
22
|
+
1/1
|
|
23
|
+
</p-tag>
|
|
24
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
25
|
+
</p-button-tile>
|
|
26
|
+
<p-button-tile aspectRatio="9/16" label="Some Label" description="Some description">
|
|
27
|
+
<p-tag slot="header" color="background-frosted" compact="true">
|
|
28
|
+
9/16
|
|
29
|
+
</p-tag>
|
|
30
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
31
|
+
</p-button-tile>
|
|
32
|
+
<p-button-tile aspectRatio="1/1" label="Some Label" description="Some description">
|
|
33
|
+
<p-tag slot="header" color="background-frosted" compact="true">
|
|
34
|
+
1/1
|
|
35
|
+
</p-tag>
|
|
36
|
+
<img src="assets/lights.jpg" alt="Some image description" />
|
|
37
|
+
</p-button-tile>
|
|
38
|
+
</div>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# p-button-tile
|
|
2
|
+
|
|
3
|
+
The `p-button-tile` is an interactive component that displays a provided image to tease content and performs form or **interaction** events within one container. Whenever you want to provide navigational elements, stick to the [Link Tile](../p-link-tile/p-link-tile.md) component instead.
|
|
4
|
+
|
|
5
|
+
**Note:** The component does not take care of processing and aligning the image.
|
|
6
|
+
|
|
7
|
+
An `<img/>`, `<picture/>` or `<video/>` tag has to be provided as default slot.
|
|
8
|
+
|
|
9
|
+
Additionally, the properties `description` and `label` are required. The `description` property is used as a teaser with a more detailed description of the button and its action.
|
|
10
|
+
|
|
11
|
+
The `label` property is used to describe the button.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Do:
|
|
16
|
+
|
|
17
|
+
- Use Button Tile for **on-page interactivity**.
|
|
18
|
+
- Use [Link Tile](../p-link-tile/p-link-tile.md) instead if you want to **navigate** to another page.
|
|
19
|
+
- Use Button Tile with appropriate aspect ratios and short descriptions (80 characters or fewer).
|
|
20
|
+
- Use basic Button Tile for better perception tests and compact Button Tile for improved spacing (especially on mobile).
|
|
21
|
+
- Use gradient Button Tile when image contrast is insufficient and select images with natural contrast.
|
|
22
|
+
- Use font size for visual hierarchy and customize image type and font size for responsiveness.
|
|
23
|
+
- Use engaging verbs and product names in compact Button Tile.
|
|
24
|
+
- Create assets upfront for image processing.
|
|
25
|
+
|
|
26
|
+
### Don't:
|
|
27
|
+
|
|
28
|
+
- Don't manipulate images, keep them natural and contrasted.
|
|
29
|
+
- Don't write long descriptions that overflow content (especially on mobile).
|
|
30
|
+
|
|
31
|
+
## Accessibility support
|
|
32
|
+
|
|
33
|
+
### Keyboard
|
|
34
|
+
|
|
35
|
+
| Key / state | Function |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
38
|
+
| `Enter`, `Space` | Activates the button. |
|
|
39
|
+
| `disabled` | Button still focusable. |
|
|
40
|
+
|
|
41
|
+
### ARIA enhancements
|
|
42
|
+
|
|
43
|
+
#### External **ARIA** provided by the `aria` property:
|
|
44
|
+
|
|
45
|
+
| ARIA | Usage |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `aria-label` | Defines a string value that labels an interactive element. It's required for buttons with `hideLabel="true"`. |
|
|
48
|
+
| `aria-description` | Defines a string value that adds a more detailed description of the interactive element. |
|
|
49
|
+
| `aria-expanded` | Exposes a visual state (e.g. expanded/collapsed) of another element. |
|
|
50
|
+
| `aria-pressed` | Exposes the `pressed` state of a toggle button. |
|
|
51
|
+
| `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. |
|
|
52
|
+
|
|
53
|
+
## Limitations
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
| ARIA | Support |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `aria-labelledby` | 🚫 |
|
|
60
|
+
| `aria-describedby` | 🚫 |
|
|
61
|
+
| `aria-owns` | 🚫 |
|
|
62
|
+
| `aria-controls` | 🚫 |
|
|
63
|
+
| `aria-activedescendant` | 🚫 |
|
|
64
|
+
|
|
65
|
+
## Development considerations
|
|
66
|
+
|
|
67
|
+
### Labelling
|
|
68
|
+
|
|
69
|
+
If the text of the button does not clearly indicate what the button's function 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 "Detail" or "Open" 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 "Open details of product XYZ."
|
|
70
|
+
|
|
71
|
+
### Common do's and don'ts
|
|
72
|
+
|
|
73
|
+
- **Do** pass ARIA attributes via the `aria` prop when the visible label needs more context.
|
|
74
|
+
- **Do** provide a descriptive `label` that explains the tile action.
|
|
75
|
+
- **Do** add `aria-label` on slotted `<video>` elements used as backgrounds.
|
|
76
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
77
|
+
|
|
78
|
+
## API
|
|
79
|
+
|
|
80
|
+
### Properties
|
|
81
|
+
|
|
82
|
+
| Property | Type | Default | Description |
|
|
83
|
+
| --- | --- | --- | --- |
|
|
84
|
+
| `align` | `'top'` `'bottom'` | `'bottom'` | Controls the vertical placement of the description and button — `top` or `bottom`. |
|
|
85
|
+
| `aria` | `ButtonTileAriaAttribute` | `undefined` | Sets ARIA attributes on the tile's action button to improve accessibility for screen readers. |
|
|
86
|
+
| `aspectRatio` | `'1/1'` `'4/3'` `'3/4'` `'16/9'` `'9/16'` `'auto'`<br>`BreakpointCustomizable<ButtonTileAspectRatio>` | `'4/3'` | Sets the width-to-height ratio of the tile media area. Supports responsive breakpoint values. |
|
|
87
|
+
| `compact` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Renders only the icon button without the full label. Supports responsive breakpoint values. |
|
|
88
|
+
| `description` _(required)_ | `string` | `undefined` | Sets the description text displayed in the tile's content area. |
|
|
89
|
+
| `disabled` | `boolean` | `false` | Disables the tile, preventing button interaction. |
|
|
90
|
+
| `gradient` | `boolean` | `false` | Shows a gradient overlay over the media slot to improve text legibility on bright images or videos. |
|
|
91
|
+
| `icon` | `'none'`<br>one of 290 icon names — see [icon names](references/icons.md) | `'none'` | Sets the icon displayed in the tile's action button. Use `none` to show no icon. |
|
|
92
|
+
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon for the action button, used instead of the built-in icon set. |
|
|
93
|
+
| `label` _(required)_ | `string` | `undefined` | Sets the accessible label text of the action button rendered inside the tile. |
|
|
94
|
+
| `loading` | `boolean` | `false` | Disables the tile and shows a loading spinner to indicate an ongoing operation. |
|
|
95
|
+
| `size` | `'medium'` `'large'` `'inherit'`<br>`BreakpointCustomizable<ButtonTileSize>` | `'medium'` | Sets the font size of the description text in the tile content area. Supports responsive breakpoint values. |
|
|
96
|
+
| `type` | `'button'` `'submit'` `'reset'` | `'submit'` | Sets the button's HTML type — `submit` sends the form, `reset` clears it, `button` performs no default action. |
|
|
97
|
+
| `weight` | `'regular'` `'semi-bold'`<br>`BreakpointCustomizable<ButtonTileWeight>` | `'semi-bold'` | Sets the font weight of the description text in the tile content area. Supports responsive breakpoint values. |
|
|
98
|
+
|
|
99
|
+
### Slots
|
|
100
|
+
|
|
101
|
+
| Slot | Required | Allowed tag names | Description |
|
|
102
|
+
| --- | --- | --- | --- |
|
|
103
|
+
| `header` | no | — | Renders a header section above the content area. |
|
|
104
|
+
| _(default)_ | no | — | Default slot for the img or picture tag. |
|
|
105
|
+
| `footer` | no | — | Renders a footer section below the description. |
|
|
106
|
+
|
|
107
|
+
## Examples
|
|
108
|
+
|
|
109
|
+
| Example | When to use | File |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
112
|
+
| UI behaviour | The component is able to break out of its aspect ratio in case content overflows to be accessibility compliant (see first row in example). | [./examples/UiBehaviour.ts](./examples/UiBehaviour.ts) |
|
|
113
|
+
| Hyphens | It is possible to overwrite the hyphens style on the host element and use 'soft' hyphens. | [./examples/Hyphens.ts](./examples/Hyphens.ts) |
|
|
114
|
+
| Footer slot | You can also use a `footer` slot to display additional text below the description, providing more flexibility for custom content. | [./examples/FooterSlot.ts](./examples/FooterSlot.ts) |
|
|
115
|
+
| Color scheme | The component defines `color-scheme: dark` internally, independently of the scheme defined globally or on an ancestor outside the Button Tile. | [./examples/ColorScheme.ts](./examples/ColorScheme.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-canvas></p-canvas>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# p-canvas
|
|
2
|
+
|
|
3
|
+
> **Experimental:** This component is experimental — its API may change in any release. Avoid relying on it in production.
|
|
4
|
+
|
|
5
|
+
The `p-canvas` is an experimental layout component for productive web applications.
|
|
6
|
+
|
|
7
|
+
The canvas component provides a CSS utility class which comes with a basic 12 columns [CSS grid](https://css-tricks.com/snippets/css/complete-guide-grid) and [CSS container-type](https://css-tricks.com/css-container-queries). The utility class can be used in default or footer slot to align its content.
|
|
8
|
+
|
|
9
|
+
```scss
|
|
10
|
+
.-p-canvas-grid // experimental, might be removed in a future release
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The canvas component has some values which can be overwritten by **CSS Variables**.
|
|
14
|
+
|
|
15
|
+
```scss
|
|
16
|
+
--p-canvas-sidebar-start-width: 220px;
|
|
17
|
+
--p-canvas-sidebar-end-width: 180px;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
The following section provides guidance for designers and developers on how to use the p-canvas layout component in different application contexts.
|
|
23
|
+
|
|
24
|
+
### Do:
|
|
25
|
+
|
|
26
|
+
- Use p-canvas to structure complex application layouts with sidebars, headers, and footers in a consistent, responsive manner.
|
|
27
|
+
- Use named slots (sidebar-start, sidebar-end, header-start, footer, etc.) to separate concerns and improve maintainability.
|
|
28
|
+
- Use the -p-canvas-grid utility class to create a 12-column layout inside the canvas content or footer areas.
|
|
29
|
+
- Combine p-canvas with CSS Grid column helpers (e.g. grid-column: span 4) to align content efficiently.
|
|
30
|
+
- Use the sidebarStartOpen and sidebarEndOpen bindings to dynamically control sidebar behavior based on viewport size or user actions.
|
|
31
|
+
- Customize layout widths via CSS variables like --p-canvas-sidebar-start-width and --p-canvas-sidebar-end-width to match your design needs.
|
|
32
|
+
- Use slot="background" for decorative media like images or videos that sit below the main content, enhancing visual appeal.
|
|
33
|
+
- Consider keyboard and focus management when using dynamic flyouts or sidebars, especially on mobile.
|
|
34
|
+
|
|
35
|
+
### Don’t:
|
|
36
|
+
|
|
37
|
+
- Don’t use p-canvas for simple or static content pages where a standard layout is sufficient.
|
|
38
|
+
- Don’t place critical content only inside sidebars or sticky areas without providing access via the main layout.
|
|
39
|
+
- Don’t rely solely on custom styling; instead, use provided slots and layout classes to maintain consistency.
|
|
40
|
+
- Don’t nest p-canvas within another p-canvas; this may lead to unpredictable layout behavior.
|
|
41
|
+
- Don’t overload the p-canvas with too many sticky elements that compete for screen space, especially on smaller viewports.
|
|
42
|
+
- Don’t use -p-canvas-grid outside of canvas slots—it is experimental and might be removed in future releases.
|
|
43
|
+
- Don’t override CSS variables globally without scoping, as this can break other usages in your application.
|
|
44
|
+
|
|
45
|
+
## Accessibility support
|
|
46
|
+
|
|
47
|
+
Not yet considered due to experimental state.
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
### Properties
|
|
52
|
+
|
|
53
|
+
| Property | Type | Default | Description |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| `background` | `'canvas'` `'surface'` | `'canvas'` | Sets the background color of the main content area and automatically applies a matching color to the sidebar. |
|
|
56
|
+
| `sidebarEndOpen` | `boolean` | `false` | Controls whether the utility sidebar on the end side (right in LTR) is open or collapsed. |
|
|
57
|
+
| `sidebarStartOpen` | `boolean` | `false` | Controls whether the navigation sidebar on the start side (left in LTR) is open or collapsed. |
|
|
58
|
+
|
|
59
|
+
### Events
|
|
60
|
+
|
|
61
|
+
| Event | Type | Description |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `sidebarEndDismiss` | `CustomEvent<void>` | Emitted when the user dismisses the end sidebar via the close button. |
|
|
64
|
+
| `sidebarStartUpdate` | `CustomEvent<CanvasSidebarStartUpdateEventDetail>`<br>`{ open: boolean }` | Emitted when the user toggles the start sidebar, with the new open state in the event detail. |
|
|
65
|
+
|
|
66
|
+
### Slots
|
|
67
|
+
|
|
68
|
+
| Slot | Required | Allowed tag names | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `title` | no | — | Renders the application name in the header section of the sidebar start area. |
|
|
71
|
+
| `header-start` | no | — | Renders a **sticky** header section above the content area on the **start** side (**left** in **LTR** mode / **right** in **RTL** mode). |
|
|
72
|
+
| `header-end` | no | — | Renders a **sticky** header section above the content area on the **end** side (**right** in **LTR** mode / **left** in **RTL** mode). |
|
|
73
|
+
| _(default)_ | no | — | Default slot for the main content. |
|
|
74
|
+
| `footer` | no | — | Renders a **sticky** footer section underneath the main content. |
|
|
75
|
+
| `sidebar-start` | no | — | Renders a sidebar area on the **start** side (**left** in **LTR** mode / **right** in **RTL** mode). On mobile view it transforms into a flyout. |
|
|
76
|
+
| `sidebar-end` | no | — | Renders a sidebar area on the **end** side (**right** in **LTR** mode / **left** in **RTL** mode). On mobile view it transforms into a flyout. |
|
|
77
|
+
| `sidebar-end-header` | no | — | Renders in the header section of the sidebar end area. |
|
|
78
|
+
| `background` | no | — | Can be used to pass a sticky media element <img/> or <video/> placed underneath the main content. |
|
|
79
|
+
|
|
80
|
+
### CSS Variables
|
|
81
|
+
|
|
82
|
+
| CSS Variable | Default | Description |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| `--p-canvas-sidebar-start-width` | `320px` | Width of the sidebar start. |
|
|
85
|
+
| `--p-canvas-sidebar-end-width` | `320px` | Width of the sidebar end. |
|
|
86
|
+
|
|
87
|
+
## Examples
|
|
88
|
+
|
|
89
|
+
| Example | When to use | File |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
@@ -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-carousel heading="Some heading" [trimSpace]="true" [pagination]="true" [rewind]="true">
|
|
8
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
9
|
+
Slide 1
|
|
10
|
+
</div>
|
|
11
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
12
|
+
Slide 2
|
|
13
|
+
</div>
|
|
14
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
15
|
+
Slide 3
|
|
16
|
+
</div>
|
|
17
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
18
|
+
Slide 4
|
|
19
|
+
</div>
|
|
20
|
+
</p-carousel>
|
|
21
|
+
`,
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
standalone: true,
|
|
24
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
25
|
+
})
|
|
26
|
+
export class ExampleComponent {}
|
|
@@ -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-carousel [slidesPerPage]="2" [heading]="'Some Heading'">
|
|
8
|
+
@for (_ of [].constructor(amountOfSlides); track _; let i = $index) {
|
|
9
|
+
<div>Slide {{ i + 1 }}</div>
|
|
10
|
+
}
|
|
11
|
+
</p-carousel>
|
|
12
|
+
<div class="flex gap-fluid-sm mt-fluid-sm">
|
|
13
|
+
<p-button type="button" (click)="amountOfSlides = amountOfSlides + 1">Add slide</p-button>
|
|
14
|
+
<p-button type="button" (click)="amountOfSlides = amountOfSlides === 0 ? 0 : amountOfSlides - 1">
|
|
15
|
+
Remove last slide
|
|
16
|
+
</p-button>
|
|
17
|
+
</div>
|
|
18
|
+
`,
|
|
19
|
+
styles: `
|
|
20
|
+
@use '@porsche-design-system/components-angular/scss' as *;
|
|
21
|
+
|
|
22
|
+
p-carousel div {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
background: #00b0f4;
|
|
27
|
+
height: 150px;
|
|
28
|
+
color: $color-primary;
|
|
29
|
+
}
|
|
30
|
+
`,
|
|
31
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [PorscheDesignSystemModule],
|
|
34
|
+
})
|
|
35
|
+
export class ExampleComponent {
|
|
36
|
+
amountOfSlides = 3;
|
|
37
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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-carousel heading="Some heading" slidesPerPage="auto" [trimSpace]="true" [pagination]="true" [rewind]="true">
|
|
8
|
+
<div class="grid place-content-center w-[10vw] h-[150px] bg-surface prose-text-sm">
|
|
9
|
+
10vw
|
|
10
|
+
</div>
|
|
11
|
+
<div class="grid place-content-center w-[200px] h-[150px] bg-surface prose-text-sm">
|
|
12
|
+
200px
|
|
13
|
+
</div>
|
|
14
|
+
<div class="grid place-content-center w-[100px] h-[150px] bg-surface prose-text-sm">
|
|
15
|
+
100px
|
|
16
|
+
</div>
|
|
17
|
+
<div class="grid place-content-center w-[40vw] h-[150px] bg-surface prose-text-sm">
|
|
18
|
+
40vw
|
|
19
|
+
</div>
|
|
20
|
+
<div class="grid place-content-center w-[150px] h-[150px] bg-surface prose-text-sm">
|
|
21
|
+
150px
|
|
22
|
+
</div>
|
|
23
|
+
<div class="grid place-content-center w-[50vw] h-[150px] bg-surface prose-text-sm">
|
|
24
|
+
50vw
|
|
25
|
+
</div>
|
|
26
|
+
</p-carousel>
|
|
27
|
+
`,
|
|
28
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
31
|
+
})
|
|
32
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<p-carousel
|
|
9
|
+
[ngStyle]="{ '--p-gradient-color-width': '25%' }"
|
|
10
|
+
[slidesPerPage]="3"
|
|
11
|
+
[focusOnCenterSlide]="true"
|
|
12
|
+
[trimSpace]="false"
|
|
13
|
+
[heading]="'Some Heading'"
|
|
14
|
+
[gradient]="true"
|
|
15
|
+
(update)="onCarouselUpdate($event)"
|
|
16
|
+
>
|
|
17
|
+
@for (slide of slides; track slide; let i = $index) {
|
|
18
|
+
<div [ngClass]="getSlideClass(i)">
|
|
19
|
+
{{ slide }}
|
|
20
|
+
</div>
|
|
21
|
+
}
|
|
22
|
+
</p-carousel>
|
|
23
|
+
`,
|
|
24
|
+
styles: `
|
|
25
|
+
@use '@porsche-design-system/components-angular/scss' as *;
|
|
26
|
+
|
|
27
|
+
p-carousel div {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
background: #00b0f4;
|
|
32
|
+
height: 150px;
|
|
33
|
+
transition: background 0.3s ease;
|
|
34
|
+
color: $color-primary;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.is-active {
|
|
38
|
+
background: #fc4040 !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.is-prev,
|
|
42
|
+
.is-next {
|
|
43
|
+
background: #f7cb47 !important;
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
47
|
+
standalone: true,
|
|
48
|
+
imports: [CommonModule, PorscheDesignSystemModule],
|
|
49
|
+
})
|
|
50
|
+
export class ExampleComponent {
|
|
51
|
+
slides: string[] = Array.from({ length: 6 }, (_, i) => `Slide ${i}`);
|
|
52
|
+
private activeSlideIndex = 0;
|
|
53
|
+
|
|
54
|
+
onCarouselUpdate(event: any): void {
|
|
55
|
+
this.activeSlideIndex = event.detail.activeIndex;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
getSlideClass(index: number): { [key: string]: boolean } {
|
|
59
|
+
return {
|
|
60
|
+
'is-active': index === this.activeSlideIndex,
|
|
61
|
+
'is-prev': index === this.activeSlideIndex - 1,
|
|
62
|
+
'is-next': index === this.activeSlideIndex + 1,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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-carousel heading="Some heading" [intl]="{'slideLabel': 'Slide %s von %s', 'prev': 'Vorheriger Slide', 'next': 'Nchster Slide', 'first': 'Zum ersten Slide', 'last': 'Zum letzten Slide'}">
|
|
8
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
9
|
+
Slide 1
|
|
10
|
+
</div>
|
|
11
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
12
|
+
Slide 2
|
|
13
|
+
</div>
|
|
14
|
+
<div class="grid place-content-center h-[150px] bg-surface prose-text-sm">
|
|
15
|
+
Slide 3
|
|
16
|
+
</div>
|
|
17
|
+
</p-carousel>
|
|
18
|
+
`,
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
22
|
+
})
|
|
23
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { CarouselUpdateEventDetail, PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-carousel [heading]="'Some Heading'" [activeSlideIndex]="activeSlideIndex" (update)="onUpdate($event)">
|
|
8
|
+
<div>Slide 1</div>
|
|
9
|
+
<div>Slide 2</div>
|
|
10
|
+
<div>Slide 3</div>
|
|
11
|
+
</p-carousel>
|
|
12
|
+
|
|
13
|
+
<div class="flex gap-fluid-sm mt-fluid-sm">
|
|
14
|
+
@for (_ of [].constructor(3); track _; let i = $index) {
|
|
15
|
+
<p-button
|
|
16
|
+
type="button"
|
|
17
|
+
(click)="onButtonClick($event)"
|
|
18
|
+
[disabled]="activeSlideIndex === i"
|
|
19
|
+
>
|
|
20
|
+
{{ i + 1 }}
|
|
21
|
+
</p-button>
|
|
22
|
+
}
|
|
23
|
+
</div>
|
|
24
|
+
`,
|
|
25
|
+
styles: `
|
|
26
|
+
@use '@porsche-design-system/components-angular/scss' as *;
|
|
27
|
+
|
|
28
|
+
p-carousel div {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
background: #00b0f4;
|
|
33
|
+
height: 150px;
|
|
34
|
+
color: $color-primary;
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
38
|
+
standalone: true,
|
|
39
|
+
imports: [PorscheDesignSystemModule],
|
|
40
|
+
})
|
|
41
|
+
export class ExampleComponent {
|
|
42
|
+
activeSlideIndex = 1;
|
|
43
|
+
|
|
44
|
+
onUpdate(e: CustomEvent<CarouselUpdateEventDetail>) {
|
|
45
|
+
this.activeSlideIndex = e.detail.activeIndex;
|
|
46
|
+
}
|
|
47
|
+
onButtonClick(e: MouseEvent) {
|
|
48
|
+
this.activeSlideIndex = parseInt((e.target as HTMLButtonElement).innerText) - 1;
|
|
49
|
+
}
|
|
50
|
+
}
|