@porsche-design-system/components-react 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/esm/lib/components/button.wrapper.d.ts +2 -2
- package/esm/lib/components/link.wrapper.d.ts +2 -2
- package/package.json +4 -3
- package/skill/SKILL.md +136 -0
- package/skill/references/components/p-accordion/examples/Default.tsx +24 -0
- package/skill/references/components/p-accordion/examples/InteractiveElementsInSummary.tsx +28 -0
- package/skill/references/components/p-accordion/examples/StickySummary.tsx +24 -0
- package/skill/references/components/p-accordion/p-accordion.md +95 -0
- package/skill/references/components/p-ai-tag/examples/Default.tsx +10 -0
- package/skill/references/components/p-ai-tag/examples/WithinCheckbox.tsx +30 -0
- package/skill/references/components/p-ai-tag/examples/WithinFormLabel.tsx +37 -0
- package/skill/references/components/p-ai-tag/examples/WithinImage.tsx +13 -0
- package/skill/references/components/p-ai-tag/examples/WithinInputSearch.tsx +12 -0
- package/skill/references/components/p-ai-tag/examples/WithinRadioGroup.tsx +29 -0
- package/skill/references/components/p-ai-tag/examples/WithinTable.tsx +91 -0
- package/skill/references/components/p-ai-tag/examples/WithinText.tsx +14 -0
- package/skill/references/components/p-ai-tag/p-ai-tag.md +47 -0
- package/skill/references/components/p-banner/examples/Customization.tsx +35 -0
- package/skill/references/components/p-banner/examples/Default.tsx +24 -0
- package/skill/references/components/p-banner/p-banner.md +92 -0
- package/skill/references/components/p-button/examples/Default.tsx +12 -0
- package/skill/references/components/p-button/examples/Form.tsx +28 -0
- package/skill/references/components/p-button/examples/FormAttribute.tsx +31 -0
- package/skill/references/components/p-button/p-button.md +118 -0
- package/skill/references/components/p-button-pure/examples/CustomClickableArea.tsx +12 -0
- package/skill/references/components/p-button-pure/examples/Default.tsx +12 -0
- package/skill/references/components/p-button-pure/examples/Form.tsx +28 -0
- package/skill/references/components/p-button-pure/examples/FormAttribute.tsx +32 -0
- package/skill/references/components/p-button-pure/p-button-pure.md +118 -0
- package/skill/references/components/p-button-tile/examples/ColorScheme.tsx +15 -0
- package/skill/references/components/p-button-tile/examples/Default.tsx +18 -0
- package/skill/references/components/p-button-tile/examples/FooterSlot.tsx +29 -0
- package/skill/references/components/p-button-tile/examples/Hyphens.tsx +33 -0
- package/skill/references/components/p-button-tile/examples/UiBehaviour.tsx +41 -0
- package/skill/references/components/p-button-tile/p-button-tile.md +115 -0
- package/skill/references/components/p-canvas/examples/Default.tsx +10 -0
- package/skill/references/components/p-canvas/p-canvas.md +91 -0
- package/skill/references/components/p-carousel/examples/Default.tsx +23 -0
- package/skill/references/components/p-carousel/examples/DynamicSlides.tsx +32 -0
- package/skill/references/components/p-carousel/examples/FlexibleWidths.tsx +29 -0
- package/skill/references/components/p-carousel/examples/FocusOnCenterSlide.tsx +56 -0
- package/skill/references/components/p-carousel/examples/Intl.tsx +20 -0
- package/skill/references/components/p-carousel/examples/JumpToSlide.tsx +42 -0
- package/skill/references/components/p-carousel/p-carousel.md +142 -0
- package/skill/references/components/p-checkbox/examples/Default.tsx +10 -0
- package/skill/references/components/p-checkbox/examples/Form.tsx +45 -0
- package/skill/references/components/p-checkbox/examples/Indeterminate.tsx +13 -0
- package/skill/references/components/p-checkbox/examples/Slots.tsx +54 -0
- package/skill/references/components/p-checkbox/examples/WrappedLabel.tsx +24 -0
- package/skill/references/components/p-checkbox/p-checkbox.md +122 -0
- package/skill/references/components/p-crest/examples/CustomClickableArea.tsx +10 -0
- package/skill/references/components/p-crest/examples/Default.tsx +10 -0
- package/skill/references/components/p-crest/examples/Link.tsx +10 -0
- package/skill/references/components/p-crest/p-crest.md +65 -0
- package/skill/references/components/p-display/examples/Color.tsx +12 -0
- package/skill/references/components/p-display/examples/Default.tsx +12 -0
- package/skill/references/components/p-display/examples/Semantics.tsx +18 -0
- package/skill/references/components/p-display/examples/Size.tsx +12 -0
- package/skill/references/components/p-display/examples/SizeResponsive.tsx +12 -0
- package/skill/references/components/p-display/p-display.md +78 -0
- package/skill/references/components/p-divider/examples/Default.tsx +10 -0
- package/skill/references/components/p-divider/examples/Responsive.tsx +12 -0
- package/skill/references/components/p-divider/examples/Vertical.tsx +12 -0
- package/skill/references/components/p-divider/p-divider.md +49 -0
- package/skill/references/components/p-drilldown/examples/CustomContent.tsx +164 -0
- package/skill/references/components/p-drilldown/examples/Default.tsx +117 -0
- package/skill/references/components/p-drilldown/p-drilldown.md +168 -0
- package/skill/references/components/p-fieldset/examples/Default.tsx +12 -0
- package/skill/references/components/p-fieldset/examples/Required.tsx +13 -0
- package/skill/references/components/p-fieldset/examples/SlottedLabel.tsx +15 -0
- package/skill/references/components/p-fieldset/examples/SlottedMessage.tsx +15 -0
- package/skill/references/components/p-fieldset/p-fieldset.md +88 -0
- package/skill/references/components/p-flag/examples/Default.tsx +10 -0
- package/skill/references/components/p-flag/examples/ResponsiveSize.tsx +10 -0
- package/skill/references/components/p-flag/examples/Size.tsx +13 -0
- package/skill/references/components/p-flag/examples/SizeCssVar.tsx +10 -0
- package/skill/references/components/p-flag/p-flag.md +68 -0
- package/skill/references/components/p-flyout/examples/CustomStyling.tsx +45 -0
- package/skill/references/components/p-flyout/examples/Default.tsx +42 -0
- package/skill/references/components/p-flyout/examples/Form.tsx +54 -0
- package/skill/references/components/p-flyout/examples/StickyTop.tsx +42 -0
- package/skill/references/components/p-flyout/p-flyout.md +128 -0
- package/skill/references/components/p-heading/examples/Color.tsx +12 -0
- package/skill/references/components/p-heading/examples/Default.tsx +12 -0
- package/skill/references/components/p-heading/examples/Semantics.tsx +18 -0
- package/skill/references/components/p-heading/p-heading.md +78 -0
- package/skill/references/components/p-icon/examples/Color.tsx +13 -0
- package/skill/references/components/p-icon/examples/ColorCssVar.tsx +10 -0
- package/skill/references/components/p-icon/examples/Custom.tsx +10 -0
- package/skill/references/components/p-icon/examples/Default.tsx +10 -0
- package/skill/references/components/p-icon/examples/Overview.tsx +588 -0
- package/skill/references/components/p-icon/examples/ResponsiveSize.tsx +10 -0
- package/skill/references/components/p-icon/examples/Size.tsx +13 -0
- package/skill/references/components/p-icon/examples/SizeCssVar.tsx +10 -0
- package/skill/references/components/p-icon/p-icon.md +88 -0
- package/skill/references/components/p-inline-notification/examples/ActionButton.tsx +25 -0
- package/skill/references/components/p-inline-notification/examples/Default.tsx +10 -0
- package/skill/references/components/p-inline-notification/examples/EventHandling.tsx +25 -0
- package/skill/references/components/p-inline-notification/p-inline-notification.md +74 -0
- package/skill/references/components/p-input-date/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-date/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-date/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-date/p-input-date.md +142 -0
- package/skill/references/components/p-input-email/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-email/examples/Form.tsx +51 -0
- package/skill/references/components/p-input-email/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-email/p-input-email.md +146 -0
- package/skill/references/components/p-input-month/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-month/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-month/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-month/p-input-month.md +142 -0
- package/skill/references/components/p-input-number/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-number/examples/Form.tsx +51 -0
- package/skill/references/components/p-input-number/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-number/p-input-number.md +150 -0
- package/skill/references/components/p-input-password/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-password/examples/Form.tsx +51 -0
- package/skill/references/components/p-input-password/examples/Slots.tsx +39 -0
- package/skill/references/components/p-input-password/examples/Toggle.tsx +10 -0
- package/skill/references/components/p-input-password/p-input-password.md +145 -0
- package/skill/references/components/p-input-search/examples/AriaCombobox.tsx +35 -0
- package/skill/references/components/p-input-search/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-search/examples/Form.tsx +52 -0
- package/skill/references/components/p-input-search/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-search/p-input-search.md +182 -0
- package/skill/references/components/p-input-tel/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-tel/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-tel/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-tel/p-input-tel.md +145 -0
- package/skill/references/components/p-input-text/examples/Controlled.tsx +36 -0
- package/skill/references/components/p-input-text/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-text/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-text/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-text/p-input-text.md +150 -0
- package/skill/references/components/p-input-time/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-time/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-time/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-time/p-input-time.md +144 -0
- package/skill/references/components/p-input-url/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-url/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-url/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-url/p-input-url.md +145 -0
- package/skill/references/components/p-input-week/examples/Default.tsx +10 -0
- package/skill/references/components/p-input-week/examples/Form.tsx +45 -0
- package/skill/references/components/p-input-week/examples/Slots.tsx +41 -0
- package/skill/references/components/p-input-week/p-input-week.md +142 -0
- package/skill/references/components/p-link/examples/Default.tsx +12 -0
- package/skill/references/components/p-link/examples/FrameworkRouting.tsx +14 -0
- package/skill/references/components/p-link/examples/Icon.tsx +17 -0
- package/skill/references/components/p-link/p-link.md +101 -0
- package/skill/references/components/p-link-pure/examples/CustomClickableArea.tsx +12 -0
- package/skill/references/components/p-link-pure/examples/Default.tsx +12 -0
- package/skill/references/components/p-link-pure/examples/FrameworkRouting.tsx +14 -0
- package/skill/references/components/p-link-pure/examples/Icon.tsx +17 -0
- package/skill/references/components/p-link-pure/p-link-pure.md +110 -0
- package/skill/references/components/p-link-tile/examples/ColorScheme.tsx +15 -0
- package/skill/references/components/p-link-tile/examples/Default.tsx +18 -0
- package/skill/references/components/p-link-tile/examples/FooterSlot.tsx +29 -0
- package/skill/references/components/p-link-tile/examples/Hyphens.tsx +34 -0
- package/skill/references/components/p-link-tile/examples/UiBehaviour.tsx +41 -0
- package/skill/references/components/p-link-tile/examples/WithVideo.tsx +15 -0
- package/skill/references/components/p-link-tile/p-link-tile.md +105 -0
- package/skill/references/components/p-link-tile-product/examples/Default.tsx +22 -0
- package/skill/references/components/p-link-tile-product/examples/FrameworkRouting.tsx +25 -0
- package/skill/references/components/p-link-tile-product/p-link-tile-product.md +93 -0
- package/skill/references/components/p-modal/examples/AlertDialog.tsx +39 -0
- package/skill/references/components/p-modal/examples/CustomStyling.tsx +26 -0
- package/skill/references/components/p-modal/examples/Default.tsx +39 -0
- package/skill/references/components/p-modal/examples/Scrollable.tsx +43 -0
- package/skill/references/components/p-modal/p-modal.md +135 -0
- package/skill/references/components/p-model-signature/examples/CustomStyling.tsx +14 -0
- package/skill/references/components/p-model-signature/examples/Default.tsx +10 -0
- package/skill/references/components/p-model-signature/examples/MaskBlendMode.tsx +32 -0
- package/skill/references/components/p-model-signature/examples/MaskImage.tsx +12 -0
- package/skill/references/components/p-model-signature/examples/MaskVideo.tsx +12 -0
- package/skill/references/components/p-model-signature/examples/SafeZone.tsx +60 -0
- package/skill/references/components/p-model-signature/p-model-signature.md +62 -0
- package/skill/references/components/p-multi-select/examples/AsyncFilter.tsx +136 -0
- package/skill/references/components/p-multi-select/examples/Default.tsx +29 -0
- package/skill/references/components/p-multi-select/examples/Form.tsx +53 -0
- package/skill/references/components/p-multi-select/examples/Optgroups.tsx +42 -0
- package/skill/references/components/p-multi-select/examples/SelectedSlot.tsx +94 -0
- package/skill/references/components/p-multi-select/examples/SetValue.tsx +80 -0
- package/skill/references/components/p-multi-select/examples/Slots.tsx +48 -0
- package/skill/references/components/p-multi-select/p-multi-select.md +197 -0
- package/skill/references/components/p-pagination/examples/Default.tsx +10 -0
- package/skill/references/components/p-pagination/p-pagination.md +83 -0
- package/skill/references/components/p-pin-code/examples/CopyPaste.tsx +10 -0
- package/skill/references/components/p-pin-code/examples/Default.tsx +10 -0
- package/skill/references/components/p-pin-code/examples/Form.tsx +45 -0
- package/skill/references/components/p-pin-code/examples/Slots.tsx +39 -0
- package/skill/references/components/p-pin-code/p-pin-code.md +109 -0
- package/skill/references/components/p-popover/examples/Default.tsx +14 -0
- package/skill/references/components/p-popover/examples/SlottedButton.tsx +15 -0
- package/skill/references/components/p-popover/p-popover.md +116 -0
- package/skill/references/components/p-radio-group/examples/Default.tsx +17 -0
- package/skill/references/components/p-radio-group/examples/Form.tsx +53 -0
- package/skill/references/components/p-radio-group/examples/Slots.tsx +69 -0
- package/skill/references/components/p-radio-group/p-radio-group.md +157 -0
- package/skill/references/components/p-scroller/examples/Default.tsx +51 -0
- package/skill/references/components/p-scroller/examples/Height.tsx +26 -0
- package/skill/references/components/p-scroller/examples/ScrollToPosition.tsx +58 -0
- package/skill/references/components/p-scroller/p-scroller.md +93 -0
- package/skill/references/components/p-segmented-control/examples/Default.tsx +26 -0
- package/skill/references/components/p-segmented-control/examples/Form.tsx +52 -0
- package/skill/references/components/p-segmented-control/examples/Slots.tsx +54 -0
- package/skill/references/components/p-segmented-control/examples/WithLabels.tsx +26 -0
- package/skill/references/components/p-segmented-control/p-segmented-control.md +162 -0
- package/skill/references/components/p-select/examples/AsyncFilter.tsx +136 -0
- package/skill/references/components/p-select/examples/Default.tsx +29 -0
- package/skill/references/components/p-select/examples/Form.tsx +53 -0
- package/skill/references/components/p-select/examples/Optgroups.tsx +42 -0
- package/skill/references/components/p-select/examples/Required.tsx +48 -0
- package/skill/references/components/p-select/examples/SelectedSlot.tsx +124 -0
- package/skill/references/components/p-select/examples/SetValue.tsx +80 -0
- package/skill/references/components/p-select/examples/Slots.tsx +48 -0
- package/skill/references/components/p-select/examples/SlottedImages.tsx +35 -0
- package/skill/references/components/p-select/p-select.md +194 -0
- package/skill/references/components/p-sheet/examples/Default.tsx +31 -0
- package/skill/references/components/p-sheet/p-sheet.md +121 -0
- package/skill/references/components/p-spinner/examples/Color.tsx +13 -0
- package/skill/references/components/p-spinner/examples/ColorCssVar.tsx +10 -0
- package/skill/references/components/p-spinner/examples/Default.tsx +10 -0
- package/skill/references/components/p-spinner/examples/ResponsiveSize.tsx +10 -0
- package/skill/references/components/p-spinner/examples/Size.tsx +13 -0
- package/skill/references/components/p-spinner/examples/SizeCssVar.tsx +10 -0
- package/skill/references/components/p-spinner/p-spinner.md +96 -0
- package/skill/references/components/p-stepper-horizontal/examples/Default.tsx +23 -0
- package/skill/references/components/p-stepper-horizontal/examples/FrameworkImplementation.tsx +100 -0
- package/skill/references/components/p-stepper-horizontal/p-stepper-horizontal.md +109 -0
- package/skill/references/components/p-switch/examples/Default.tsx +19 -0
- package/skill/references/components/p-switch/p-switch.md +103 -0
- package/skill/references/components/p-table/examples/Advanced.tsx +186 -0
- package/skill/references/components/p-table/examples/CaptionProperty.tsx +37 -0
- package/skill/references/components/p-table/examples/CaptionSlot.tsx +40 -0
- package/skill/references/components/p-table/examples/Default.tsx +117 -0
- package/skill/references/components/p-table/examples/HideLabel.tsx +37 -0
- package/skill/references/components/p-table/examples/LayoutFixed.tsx +50 -0
- package/skill/references/components/p-table/examples/Sorting.tsx +86 -0
- package/skill/references/components/p-table/p-table.md +189 -0
- package/skill/references/components/p-tabs/examples/ActiveTab.tsx +26 -0
- package/skill/references/components/p-tabs/examples/Default.tsx +26 -0
- package/skill/references/components/p-tabs/examples/Gradient.tsx +111 -0
- package/skill/references/components/p-tabs/examples/Labelling.tsx +26 -0
- package/skill/references/components/p-tabs/p-tabs.md +136 -0
- package/skill/references/components/p-tabs-bar/examples/Default.tsx +27 -0
- package/skill/references/components/p-tabs-bar/examples/Gradient.tsx +78 -0
- package/skill/references/components/p-tabs-bar/examples/Labelling.tsx +27 -0
- package/skill/references/components/p-tabs-bar/examples/Links.tsx +20 -0
- package/skill/references/components/p-tabs-bar/p-tabs-bar.md +181 -0
- package/skill/references/components/p-tag/examples/Default.tsx +12 -0
- package/skill/references/components/p-tag/examples/Multiline.tsx +14 -0
- package/skill/references/components/p-tag/examples/SlottedButton.tsx +41 -0
- package/skill/references/components/p-tag/examples/SlottedLink.tsx +41 -0
- package/skill/references/components/p-tag/p-tag.md +66 -0
- package/skill/references/components/p-tag-dismissible/examples/Default.tsx +12 -0
- package/skill/references/components/p-tag-dismissible/p-tag-dismissible.md +75 -0
- package/skill/references/components/p-text/examples/Default.tsx +12 -0
- package/skill/references/components/p-text/examples/Semantics.tsx +18 -0
- package/skill/references/components/p-text/examples/Size.tsx +12 -0
- package/skill/references/components/p-text/examples/SizeResponsive.tsx +12 -0
- package/skill/references/components/p-text/p-text.md +68 -0
- package/skill/references/components/p-text-list/examples/Default.tsx +28 -0
- package/skill/references/components/p-text-list/p-text-list.md +68 -0
- package/skill/references/components/p-textarea/examples/Default.tsx +10 -0
- package/skill/references/components/p-textarea/examples/Form.tsx +45 -0
- package/skill/references/components/p-textarea/examples/Slots.tsx +39 -0
- package/skill/references/components/p-textarea/p-textarea.md +122 -0
- package/skill/references/components/p-toast/examples/Default.tsx +22 -0
- package/skill/references/components/p-toast/p-toast.md +61 -0
- package/skill/references/components/p-wordmark/examples/CustomClickableArea.tsx +10 -0
- package/skill/references/components/p-wordmark/examples/Default.tsx +10 -0
- package/skill/references/components/p-wordmark/examples/Size.tsx +10 -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/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +1 -1
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +1 -1
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -1
- package/ssr/esm/lib/components/button.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/link.wrapper.d.ts +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PButton, PCheckbox, PFlyout, PHeading, PText, PTextarea } from '@porsche-design-system/components-react';
|
|
3
|
+
import { type FormEvent, useCallback, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export const Example = () => {
|
|
6
|
+
const [isFlyoutOpen, setIsFlyoutOpen] = useState<boolean>(false);
|
|
7
|
+
const [checkboxValue, setCheckboxValue] = useState('none');
|
|
8
|
+
const [textareaValue, setTextareaValue] = useState('none');
|
|
9
|
+
|
|
10
|
+
const onOpen = useCallback(() => {
|
|
11
|
+
setIsFlyoutOpen(true);
|
|
12
|
+
}, []);
|
|
13
|
+
const onDismiss = useCallback(() => {
|
|
14
|
+
setIsFlyoutOpen(false);
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
const onSubmit = (e: FormEvent<HTMLFormElement>) => {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
const formData = new FormData(e.currentTarget);
|
|
20
|
+
setCheckboxValue(formData.get('some-checkbox')?.toString() || 'none');
|
|
21
|
+
setTextareaValue(formData.get('some-textarea')?.toString() || 'none');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<PButton type="button" aria={{ 'aria-haspopup': 'dialog' }} onClick={onOpen}>
|
|
27
|
+
Open Flyout
|
|
28
|
+
</PButton>
|
|
29
|
+
<PFlyout open={isFlyoutOpen} onDismiss={onDismiss} aria={{ 'aria-label': 'Some Heading' }}>
|
|
30
|
+
<PHeading slot="header" size="large" tag="h2">
|
|
31
|
+
Some Heading
|
|
32
|
+
</PHeading>
|
|
33
|
+
<form id="some-form" onSubmit={onSubmit}>
|
|
34
|
+
<PCheckbox name="some-checkbox" label="Some Label"></PCheckbox>
|
|
35
|
+
<PTextarea name="some-textarea" label="Some Label"></PTextarea>
|
|
36
|
+
</form>
|
|
37
|
+
<PButton slot="footer" type="submit" form="some-form">
|
|
38
|
+
Submit
|
|
39
|
+
</PButton>
|
|
40
|
+
<PButton slot="footer" type="reset" variant="secondary" form="some-form">
|
|
41
|
+
Reset
|
|
42
|
+
</PButton>
|
|
43
|
+
<PText slot="sub-footer">
|
|
44
|
+
Last submitted data:
|
|
45
|
+
<br />
|
|
46
|
+
<br />
|
|
47
|
+
checkbox: {checkboxValue}
|
|
48
|
+
<br />
|
|
49
|
+
textarea: {textareaValue}
|
|
50
|
+
</PText>
|
|
51
|
+
</PFlyout>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { PButton, PFlyout, PHeading, PText } from '@porsche-design-system/components-react';
|
|
4
|
+
|
|
5
|
+
export const Example = () => {
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
|
|
8
|
+
const onClick = () => {
|
|
9
|
+
setOpen(true);
|
|
10
|
+
}
|
|
11
|
+
const onDismiss = () => {
|
|
12
|
+
setOpen(false);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<PButton type="button" aria={{'aria-haspopup': 'dialog'}} onClick={onClick}>
|
|
18
|
+
Open Flyout
|
|
19
|
+
</PButton>
|
|
20
|
+
|
|
21
|
+
<PFlyout open={open} aria={{'aria-label': 'Some Heading'}} onDismiss={onDismiss}>
|
|
22
|
+
<PHeading slot="header" size="large" tag="h2">
|
|
23
|
+
Some Heading
|
|
24
|
+
</PHeading>
|
|
25
|
+
<div className="grid grid-cols-[2fr_1fr] gap-static-md items-start">
|
|
26
|
+
<div className="sticky top-[calc(var(--p-flyout-sticky-top,0)+16px)] p-static-md bg-surface">
|
|
27
|
+
Some sticky element within content relying on --p-flyout-sticky-top
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<PText>
|
|
31
|
+
Some Content Begin
|
|
32
|
+
</PText>
|
|
33
|
+
<div className="w-[10px] h-[120vh] bg-[deeppink]"></div>
|
|
34
|
+
<PText>
|
|
35
|
+
Some Content End
|
|
36
|
+
</PText>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</PFlyout>
|
|
40
|
+
</>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# p-flyout
|
|
2
|
+
|
|
3
|
+
The `p-flyout` is a overlay from the left or right side of the screen. It is commonly used as a temporary workspace that allows users to complete tasks without navigating to a new page or as a mobile navigation.
|
|
4
|
+
|
|
5
|
+
It is a controlled component. This grants flexible control over the flyout's behavior especially whether it should stay open after user interaction like submission of a form.
|
|
6
|
+
|
|
7
|
+
> **Scroll-lock**
|
|
8
|
+
>
|
|
9
|
+
> This component sets `overflow: hidden` on the body when opened in order to prevent background scrolling.
|
|
10
|
+
>
|
|
11
|
+
> This doesn't work completely reliable under iOS but is the most stable solution.
|
|
12
|
+
>
|
|
13
|
+
> Feel free to address this issue in an Open Source PR, if you can provide a better solution.
|
|
14
|
+
>
|
|
15
|
+
> **[Current implementation](https://github.com/porsche-design-system/porsche-design-system/blob/main/packages/components/src/utils/setScrollLock.ts)**
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Do:
|
|
20
|
+
|
|
21
|
+
- Use a Flyout as a temporary workspace that allows users to complete tasks without navigating to a new page.
|
|
22
|
+
- Use a Flyout for mobile navigation.
|
|
23
|
+
- Adjust Flyout size and alignment with the grid.
|
|
24
|
+
- Use the sticky header for a descriptive heading & optional sub-heading.
|
|
25
|
+
- Use the sticky footer for a call to action.
|
|
26
|
+
- Use the sub-footer slot for additional or less important information such as legals or faqs.
|
|
27
|
+
- Follow button order and positioning guidelines.
|
|
28
|
+
- Use feedback banner for any feedback related to the request.
|
|
29
|
+
|
|
30
|
+
### Don't:
|
|
31
|
+
|
|
32
|
+
- Don't use to many actions in the sticky footer or header.
|
|
33
|
+
- Don't put important information in the sub-footer slot.
|
|
34
|
+
- Don't use fullscreen Flyout's on desktop.
|
|
35
|
+
- Don't launch a Flyout within a Flyout.
|
|
36
|
+
|
|
37
|
+
## Accessibility support
|
|
38
|
+
|
|
39
|
+
The `Flyout` component uses the native `dialog` element to provide a modal dialog which comes with browser-specific behavior. As a result, accessibility features may vary across different browsers.
|
|
40
|
+
|
|
41
|
+
### Keyboard
|
|
42
|
+
|
|
43
|
+
| Key / state | Function |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element inside the dialog. Focus is trapped (browser behavior). |
|
|
46
|
+
| `ESC` | Closes the dialog. |
|
|
47
|
+
| `focus` on trigger element | The focus is returned to the trigger element after closing the dialog (browser behavior). |
|
|
48
|
+
|
|
49
|
+
### ARIA enhancements
|
|
50
|
+
|
|
51
|
+
#### External **ARIA** provided by the `aria` property:
|
|
52
|
+
|
|
53
|
+
| ARIA | Usage |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `aria-label` | Defines a string value that labels the dialog element. |
|
|
56
|
+
|
|
57
|
+
#### Internal **ARIA** that is managed by the component:
|
|
58
|
+
|
|
59
|
+
| ARIA | Usage |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| `aria-label="STRING"` | Defines the accessible name if no `aria` property is provided, uses the contents of the header slot and falls back to a fixed name. |
|
|
62
|
+
|
|
63
|
+
## Development considerations
|
|
64
|
+
|
|
65
|
+
To inform users that the trigger button opens a `dialog`, set `aria-haspopup` on the trigger using the `aria` property. Provide the dialog title through the `header` slot or the flyout `aria` property.
|
|
66
|
+
|
|
67
|
+
### Common do's and don'ts
|
|
68
|
+
|
|
69
|
+
- **Do** use a semantic trigger (usually a button) with a meaningful accessible name.
|
|
70
|
+
- **Do** set `aria-haspopup` through the trigger component `aria` prop when opening the flyout.
|
|
71
|
+
- **Do** ensure a meaningful title is available via the `header` slot or `aria` property.
|
|
72
|
+
- **Don't** add raw host-level ARIA attributes as a workaround.
|
|
73
|
+
- **Don't** use unclear trigger copy like "Menu" when the flyout purpose is not obvious.
|
|
74
|
+
|
|
75
|
+
## API
|
|
76
|
+
|
|
77
|
+
### Properties
|
|
78
|
+
|
|
79
|
+
| Property | Type | Default | Description |
|
|
80
|
+
| --- | --- | --- | --- |
|
|
81
|
+
| `aria` | `FlyoutAriaAttribute` | `undefined` | Sets ARIA attributes on the flyout dialog element for improved screen reader accessibility. |
|
|
82
|
+
| `backdrop` | `'blur'` `'shading'` | `'blur'` | Sets the backdrop style. Use `blur` when background content is irrelevant; use `shading` when users still need visual context. |
|
|
83
|
+
| `background` | `'canvas'` `'surface'` | `'canvas'` | Sets the background color of the flyout panel (`canvas` or `surface`). |
|
|
84
|
+
| `disableBackdropClick` | `boolean` | `false` | When enabled, clicking the backdrop will not close the flyout. |
|
|
85
|
+
| `footerBehavior` | `'sticky'` `'fixed'` | `'sticky'` | Controls footer behavior. `fixed` keeps it anchored at the bottom; `sticky` pins it only when content overflows. |
|
|
86
|
+
| `fullscreen` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | If true the flyout stretches to the full viewport width with squared corners. Useful for smaller viewports where the flyout would otherwise fill the screen but still show rounded corners. |
|
|
87
|
+
| `open` _(required)_ | `boolean` | `false` | Controls whether the flyout panel is visible. |
|
|
88
|
+
| `position` | `'start'` `'end'` | `'end'` | Sets the side the flyout slides in from — `start` for left or `end` for right in LTR layouts. |
|
|
89
|
+
|
|
90
|
+
### Events
|
|
91
|
+
|
|
92
|
+
| Event | Type | Description |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| `dismiss` | `CustomEvent<void>` | Emitted when the user closes the flyout via the close button, backdrop click, or Escape key. |
|
|
95
|
+
| `motionHiddenEnd` | `CustomEvent<FlyoutMotionHiddenEndEventDetail>`<br>`TransitionEvent` | Emitted after the flyout's close transition completes and the panel is fully hidden. |
|
|
96
|
+
| `motionVisibleEnd` | `CustomEvent<FlyoutMotionVisibleEndEventDetail>`<br>`TransitionEvent` | Emitted after the flyout's open transition completes and the panel is fully visible. |
|
|
97
|
+
|
|
98
|
+
### Controlled properties
|
|
99
|
+
|
|
100
|
+
- `open` — a controlled prop: the component does **not** update it itself. Handle the `dismiss` event and assign the new value to `open` yourself, or the change will not take effect.
|
|
101
|
+
|
|
102
|
+
### Slots
|
|
103
|
+
|
|
104
|
+
| Slot | Required | Allowed tag names | Description |
|
|
105
|
+
| --- | --- | --- | --- |
|
|
106
|
+
| `header` | no | — | Renders a sticky header section above the content area. |
|
|
107
|
+
| _(default)_ | no | — | Default slot for the main content. |
|
|
108
|
+
| `footer` | no | — | Shows a sticky footer section, flowing under the content area when scrollable. |
|
|
109
|
+
| `sub-footer` | no | — | Renders additional content below the footer, such as legal information or FAQs. It appears when the flyout has enough space or when the user scrolls to the end. |
|
|
110
|
+
|
|
111
|
+
### CSS Variables
|
|
112
|
+
|
|
113
|
+
| CSS Variable | Default | Description |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `--p-flyout-width` | `auto` | Width of the flyout. |
|
|
116
|
+
| `--p-flyout-sticky-top` | — | @experimental Exposes the header's height as a read-only CSS variable, set automatically by the component. Slotted sticky content can use this value to offset their top position correctly. |
|
|
117
|
+
| `--ref-p-flyout-pt` | — | Exposes the internally used padding-top of the Flyout as read only CSS variable. When slotting e.g. a media container, this variable can be used to stretch the element to the top of the Flyout. |
|
|
118
|
+
| `--ref-p-flyout-pb` | — | Exposes the internally used padding-bottom of the Flyout as read only CSS variable. When slotting e.g. a media container, this variable can be used to stretch the element to the bottom of the Flyout. |
|
|
119
|
+
| `--ref-p-flyout-px` | — | Exposes the internally used padding-inline of the Flyout as read only CSS variable. When slotting e.g. a media container, this variable can be used to stretch the element to the full horizontal size of the Flyout. |
|
|
120
|
+
|
|
121
|
+
## Examples
|
|
122
|
+
|
|
123
|
+
| Example | When to use | File |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| Default | Minimal default configuration. | [./examples/Default.tsx](./examples/Default.tsx) |
|
|
126
|
+
| Sticky content with Custom CSS Property (Experimental) | In order to display some sticky element within the flyout content you can use the experimental `--p-flyout-sticky-top` CSS custom property to account for the height of the header. | [./examples/StickyTop.tsx](./examples/StickyTop.tsx) |
|
|
127
|
+
| Flyout Form | The following example demonstrates how a form can be used within a flyout component: | [./examples/Form.tsx](./examples/Form.tsx) |
|
|
128
|
+
| Custom Styling | The Flyout exposes read-only CSS Variables (prefixed with `--ref-`). | [./examples/CustomStyling.tsx](./examples/CustomStyling.tsx) |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PHeading } from '@porsche-design-system/components-react';
|
|
3
|
+
|
|
4
|
+
export const Example = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<PHeading tag="h3" color="inherit" className="text-[deeppink]">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</PHeading>
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PHeading } from '@porsche-design-system/components-react';
|
|
3
|
+
|
|
4
|
+
export const Example = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<PHeading tag="h3">
|
|
8
|
+
The quick brown fox jumps over the lazy dog
|
|
9
|
+
</PHeading>
|
|
10
|
+
|
|
11
|
+
<PHeading>
|
|
12
|
+
<h3>
|
|
13
|
+
The quick brown fox jumps over the lazy dog
|
|
14
|
+
</h3>
|
|
15
|
+
</PHeading>
|
|
16
|
+
</>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# p-heading
|
|
2
|
+
|
|
3
|
+
`p-heading` is used to highlight and specify heading styling and hierarchy in documents.
|
|
4
|
+
|
|
5
|
+
> **Recommendation**
|
|
6
|
+
>
|
|
7
|
+
> Although the component is very sophisticated, it's recommended (if possible) to use the corresponding utility classes of the "@porsche-design-system/components-{js | angular | react | vue}/tailwindcss" sub-package or any of the other styling solutions for best performance since way less DOM nodes are required to render. Further information can be found [here](../../styles/tailwindcss.md).
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
p-heading is used to highlight and specify heading styling and hierarchy
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use p-heading styles to clearly mark section titles and subsections.
|
|
16
|
+
- Align headings with the grid to maintain visual rhythm.
|
|
17
|
+
- Use heading-xx-large for primary sections; scale down for subsections.
|
|
18
|
+
- Pair each heading with a text style one or two steps smaller (e.g. heading-large with text-medium).
|
|
19
|
+
|
|
20
|
+
### Don't:
|
|
21
|
+
|
|
22
|
+
- Don’t use p-heading styles for hero or marketing intros—use p-display instead.
|
|
23
|
+
- Don’t mix heading sizes inconsistently within the same view.
|
|
24
|
+
- Don’t center-align headings in content-heavy layouts unless intended for a special moment.
|
|
25
|
+
|
|
26
|
+
## Accessibility support
|
|
27
|
+
|
|
28
|
+
This component does not include any special accessibility features.
|
|
29
|
+
|
|
30
|
+
## Development considerations
|
|
31
|
+
|
|
32
|
+
### Heading hierarchy
|
|
33
|
+
|
|
34
|
+
While using the `Heading` component, take care of the correct heading hierarchy which can be adjusted through the `tag` property. Keep in mind that the visual appearance must not always be identical with the semantic hierarchy.
|
|
35
|
+
|
|
36
|
+
#### Best practices
|
|
37
|
+
|
|
38
|
+
- Use one unique `h1` per page that describes what that page is about.
|
|
39
|
+
- Use headings to describe the content below. Do not use an HTML heading just to make the text appear bigger or stand out.
|
|
40
|
+
- Use heading levels like the index of a book: hierarchical.
|
|
41
|
+
- Do not choose a heading by its size, but by its level in the context of the content.
|
|
42
|
+
- Heading hierarchy should not increase by more than one level at a time.
|
|
43
|
+
- Do not skip a heading level from the top down.
|
|
44
|
+
|
|
45
|
+
### Common do's and don'ts
|
|
46
|
+
|
|
47
|
+
- **Do** use the `tag` prop to reflect the semantic hierarchy, not just visual size.
|
|
48
|
+
- **Do** keep one unique `h1` per page.
|
|
49
|
+
- **Don't** choose a heading level based on appearance alone.
|
|
50
|
+
- **Don't** skip heading levels when nesting sections.
|
|
51
|
+
|
|
52
|
+
## API
|
|
53
|
+
|
|
54
|
+
### Properties
|
|
55
|
+
|
|
56
|
+
| Property | Type | Default | Description |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| `align` | `'start'` `'center'` `'end'` `'inherit'` | `'start'` | Sets the horizontal text alignment (`start`, `center`, `end`, or `inherit`). |
|
|
59
|
+
| `color` | `'primary'` `'contrast-higher'` `'contrast-high'` `'contrast-medium'` `'inherit'` | `'primary'` | Sets the text color using PDS color tokens. |
|
|
60
|
+
| `ellipsis` | `boolean` | `false` | Truncates the text with an ellipsis when it overflows the container on a single line. Cannot be combined with multi-line content. |
|
|
61
|
+
| `hyphens` | `'none'` `'manual'` `'auto'` `'inherit'` | `'none'` | Controls hyphenation behavior — `auto` lets the browser decide, `manual` only breaks at `­`, `none` disables it entirely. |
|
|
62
|
+
| `size` | `'2xs'` `'xs'` `'sm'` `'md'` `'lg'` `'xl'` `'2xl'` `'3xl'` `'4xl'` `'5xl'` `'inherit'`<br>_deprecated:_ `'small'` `'medium'` `'large'` `'x-large'` `'xx-large'`<br>`BreakpointCustomizable<HeadingSize>` | `'2xl'` | Sets the visual size of the heading. Use `inherit` to derive size from the parent. Supports responsive breakpoint values. |
|
|
63
|
+
| `tag` | `undefined` `'h1'` `'h2'` `'h3'` `'h4'` `'h5'` `'h6'` | `undefined` | Sets the HTML heading tag (h1–h6) for correct document outline placement. When omitted, the tag is inferred from `size`. |
|
|
64
|
+
| `weight` | `'normal'` `'semibold'` `'bold'`<br>_deprecated:_ `'regular'` `'semi-bold'` | `'normal'` | Sets the font weight — `normal`, `semibold`, or `bold`. |
|
|
65
|
+
|
|
66
|
+
### Slots
|
|
67
|
+
|
|
68
|
+
| Slot | Required | Allowed tag names | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| _(default)_ | no | — | Default slot to render the heading. |
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
| Example | When to use | File |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Default | Minimal default configuration. | [./examples/Default.tsx](./examples/Default.tsx) |
|
|
77
|
+
| Semantics | To provide more contextual HTML semantics you can either pass them with the `tag` property or directly inside a slot. | [./examples/Semantics.tsx](./examples/Semantics.tsx) |
|
|
78
|
+
| Color | Predefined theme-based colors are available, but `inherit` can also be used to define a custom color. | [./examples/Color.tsx](./examples/Color.tsx) |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PIcon, PText } from '@porsche-design-system/components-react';
|
|
3
|
+
|
|
4
|
+
export const Example = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<PText style={{'color': 'light-dark(mediumvioletred, deeppink)'}} color="inherit">
|
|
8
|
+
<PIcon className="me-static-sm" color="inherit" name="highway" aria={{'aria-label': 'Highway icon'}}></PIcon>
|
|
9
|
+
Some text
|
|
10
|
+
</PText>
|
|
11
|
+
</>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PIcon } from '@porsche-design-system/components-react';
|
|
3
|
+
|
|
4
|
+
export const Example = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<PIcon className="[--p-icon-color:deeppink]" name="highway" aria={{'aria-label': 'Highway icon'}}></PIcon>
|
|
8
|
+
</>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PIcon } from '@porsche-design-system/components-react';
|
|
3
|
+
|
|
4
|
+
export const Example = () => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<PIcon source="assets/icon-custom-kaixin.svg" aria={{'aria-label': 'Icon for social media platform Kaixin'}}></PIcon>
|
|
8
|
+
</>
|
|
9
|
+
)
|
|
10
|
+
}
|