@porsche-design-system/components-react 4.10.1 → 4.11.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 +104 -9
- package/cjs/lib/components/link.wrapper.cjs +3 -3
- package/cjs/lib/components/popover.wrapper.cjs +3 -3
- package/cjs/lib/components/sheet.wrapper.cjs +3 -3
- package/esm/lib/components/input-search.wrapper.d.ts +2 -2
- package/esm/lib/components/link.wrapper.d.ts +10 -0
- package/esm/lib/components/link.wrapper.mjs +3 -3
- package/esm/lib/components/popover.wrapper.d.ts +10 -0
- package/esm/lib/components/popover.wrapper.mjs +3 -3
- package/esm/lib/components/sheet.wrapper.d.ts +12 -2
- package/esm/lib/components/sheet.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +7 -3
- package/package.json +2 -2
- package/skills/pds-audit-deprecations-react/SKILL.md +2 -2
- package/skills/pds-knowledge-react/SKILL.md +8 -7
- package/skills/pds-knowledge-react/references/components/p-accordion/examples/Default.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-accordion/examples/InteractiveElementsInSummary.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-accordion/examples/StickySummary.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-ai-tag/examples/WithinRadioGroup.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-ai-tag/examples/WithinTable.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-banner/examples/Customization.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-banner/p-banner.md +2 -2
- package/skills/pds-knowledge-react/references/components/p-button-pure/p-button-pure.md +9 -0
- package/skills/pds-knowledge-react/references/components/p-carousel/p-carousel.md +1 -1
- package/skills/pds-knowledge-react/references/components/p-fieldset/p-fieldset.md +7 -9
- package/skills/pds-knowledge-react/references/components/p-flyout/examples/CustomStyling.tsx +3 -3
- package/skills/pds-knowledge-react/references/components/p-flyout/examples/Default.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-flyout/examples/StickyTop.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-inline-notification/p-inline-notification.md +1 -1
- package/skills/pds-knowledge-react/references/components/p-input-search/p-input-search.md +26 -8
- package/skills/pds-knowledge-react/references/components/p-link/examples/Cover.tsx +20 -0
- package/skills/pds-knowledge-react/references/components/p-link/p-link.md +3 -0
- package/skills/pds-knowledge-react/references/components/p-link-pure/p-link-pure.md +39 -1
- package/skills/pds-knowledge-react/references/components/p-modal/examples/AlertDialog.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-modal/examples/Default.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-modal/examples/Scrollable.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-popover/p-popover.md +4 -2
- package/skills/pds-knowledge-react/references/components/p-sheet/examples/Default.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-sheet/p-sheet.md +6 -3
- package/skills/pds-knowledge-react/references/components/p-table/examples/CaptionSlot.tsx +1 -1
- package/skills/pds-knowledge-react/references/components/p-toast/p-toast.md +2 -2
- package/skills/pds-knowledge-react/references/deprecations.md +4 -4
- package/skills/pds-knowledge-react/references/examples/patterns/feedback/dialog.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/feedback/inline.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/{footer.md → footer/extended.md} +9 -8
- package/skills/pds-knowledge-react/references/examples/patterns/footer/simple.md +75 -0
- package/skills/pds-knowledge-react/references/examples/patterns/forms/booking.md +479 -0
- package/skills/pds-knowledge-react/references/examples/patterns/forms/contact.md +211 -0
- package/skills/pds-knowledge-react/references/examples/patterns/forms/personal-details.md +253 -0
- package/skills/pds-knowledge-react/references/examples/patterns/forms/search-combobox-link-list.md +363 -0
- package/skills/pds-knowledge-react/references/examples/patterns/forms/search-combobox-option-list.md +499 -0
- package/skills/pds-knowledge-react/references/examples/patterns/header/overlay.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/header/stacked.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/popover/feature-tour.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/popover/local-market-switch.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/popover/priority-navigation.md +2 -1
- package/skills/pds-knowledge-react/references/examples/patterns/tile/call-to-action.md +71 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/category.md +60 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/disclosure.md +84 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/equipment-stacked.md +54 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/equipment.md +69 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/image.md +64 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/model-navigation.md +52 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/model-selection.md +66 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/model-teaser.md +78 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/product.md +92 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/vehicle-listing.md +107 -0
- package/skills/pds-knowledge-react/references/examples/patterns/tile/video.md +114 -0
- package/skills/pds-knowledge-react/references/examples/templates/admin-panel.md +1 -0
- package/skills/pds-knowledge-react/references/examples/templates/landing-page.md +4 -3
- package/skills/pds-knowledge-react/references/examples/templates/personalized-mailing/no-video.md +1166 -0
- package/skills/pds-knowledge-react/references/examples/templates/personalized-mailing/video.md +1252 -0
- package/skills/pds-knowledge-react/references/examples.md +50 -1
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +239 -70
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +424 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/sheet.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs +2 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.cjs +2 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.cjs +4 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.cjs +14 -3
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +239 -70
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +411 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/sheet.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.mjs +5 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.mjs +15 -4
- package/ssr/esm/public-api.d.ts +8696 -5
- package/skills/pds-knowledge-react/references/components/p-input-search/examples/AriaCombobox.tsx +0 -35
- package/ssr/esm/BaseProps.d.ts +0 -2
- package/ssr/esm/getCachedMinifiedCss.d.ts +0 -23
- package/ssr/esm/hooks.d.ts +0 -15
- package/ssr/esm/lib/components/accordion.wrapper.d.ts +0 -98
- package/ssr/esm/lib/components/ai-tag.wrapper.d.ts +0 -26
- package/ssr/esm/lib/components/banner.wrapper.d.ts +0 -86
- package/ssr/esm/lib/components/button-pure.wrapper.d.ts +0 -158
- package/ssr/esm/lib/components/button-tile.wrapper.d.ts +0 -140
- package/ssr/esm/lib/components/button.wrapper.d.ts +0 -118
- package/ssr/esm/lib/components/canvas.wrapper.d.ts +0 -54
- package/ssr/esm/lib/components/carousel.wrapper.d.ts +0 -166
- package/ssr/esm/lib/components/checkbox.wrapper.d.ts +0 -160
- package/ssr/esm/lib/components/crest.wrapper.d.ts +0 -32
- package/ssr/esm/lib/components/display.wrapper.d.ts +0 -57
- package/ssr/esm/lib/components/divider.wrapper.d.ts +0 -26
- package/ssr/esm/lib/components/drilldown-item.wrapper.d.ts +0 -53
- package/ssr/esm/lib/components/drilldown-link.wrapper.d.ts +0 -60
- package/ssr/esm/lib/components/drilldown.wrapper.d.ts +0 -50
- package/ssr/esm/lib/components/fieldset.wrapper.d.ts +0 -66
- package/ssr/esm/lib/components/flag.wrapper.d.ts +0 -34
- package/ssr/esm/lib/components/flyout.wrapper.d.ts +0 -110
- package/ssr/esm/lib/components/heading.wrapper.d.ts +0 -76
- package/ssr/esm/lib/components/icon.wrapper.d.ts +0 -52
- package/ssr/esm/lib/components/index.d.ts +0 -74
- package/ssr/esm/lib/components/inline-notification.wrapper.d.ts +0 -102
- package/ssr/esm/lib/components/input-date.wrapper.d.ts +0 -200
- package/ssr/esm/lib/components/input-email.wrapper.d.ts +0 -228
- package/ssr/esm/lib/components/input-month.wrapper.d.ts +0 -200
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +0 -220
- package/ssr/esm/lib/components/input-password.wrapper.d.ts +0 -210
- package/ssr/esm/lib/components/input-search.wrapper.d.ts +0 -220
- package/ssr/esm/lib/components/input-tel.wrapper.d.ts +0 -218
- package/ssr/esm/lib/components/input-text.wrapper.d.ts +0 -218
- package/ssr/esm/lib/components/input-time.wrapper.d.ts +0 -200
- package/ssr/esm/lib/components/input-url.wrapper.d.ts +0 -218
- package/ssr/esm/lib/components/input-week.wrapper.d.ts +0 -200
- package/ssr/esm/lib/components/link-pure.wrapper.d.ts +0 -138
- package/ssr/esm/lib/components/link-tile-product.wrapper.d.ts +0 -104
- package/ssr/esm/lib/components/link-tile.wrapper.d.ts +0 -126
- package/ssr/esm/lib/components/link.wrapper.d.ts +0 -98
- package/ssr/esm/lib/components/modal.wrapper.d.ts +0 -100
- package/ssr/esm/lib/components/model-signature.wrapper.d.ts +0 -68
- package/ssr/esm/lib/components/multi-select-option.wrapper.d.ts +0 -25
- package/ssr/esm/lib/components/multi-select.wrapper.d.ts +0 -156
- package/ssr/esm/lib/components/optgroup.wrapper.d.ts +0 -25
- package/ssr/esm/lib/components/pagination.wrapper.d.ts +0 -64
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +0 -160
- package/ssr/esm/lib/components/popover.wrapper.d.ts +0 -58
- package/ssr/esm/lib/components/radio-group-option.wrapper.d.ts +0 -43
- package/ssr/esm/lib/components/radio-group.wrapper.d.ts +0 -148
- package/ssr/esm/lib/components/scroller.wrapper.d.ts +0 -62
- package/ssr/esm/lib/components/segmented-control-item.wrapper.d.ts +0 -58
- package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +0 -148
- package/ssr/esm/lib/components/select-option.wrapper.d.ts +0 -25
- package/ssr/esm/lib/components/select.wrapper.d.ts +0 -164
- package/ssr/esm/lib/components/sheet.wrapper.d.ts +0 -80
- package/ssr/esm/lib/components/spinner.wrapper.d.ts +0 -34
- package/ssr/esm/lib/components/stepper-horizontal-item.wrapper.d.ts +0 -26
- package/ssr/esm/lib/components/stepper-horizontal.wrapper.d.ts +0 -26
- package/ssr/esm/lib/components/switch.wrapper.d.ts +0 -94
- package/ssr/esm/lib/components/table-body.wrapper.d.ts +0 -5
- package/ssr/esm/lib/components/table-cell.wrapper.d.ts +0 -17
- package/ssr/esm/lib/components/table-head-cell.wrapper.d.ts +0 -36
- package/ssr/esm/lib/components/table-head-row.wrapper.d.ts +0 -5
- package/ssr/esm/lib/components/table-head.wrapper.d.ts +0 -5
- package/ssr/esm/lib/components/table-row.wrapper.d.ts +0 -5
- package/ssr/esm/lib/components/table.wrapper.d.ts +0 -54
- package/ssr/esm/lib/components/tabs-bar.wrapper.d.ts +0 -70
- package/ssr/esm/lib/components/tabs-item.wrapper.d.ts +0 -15
- package/ssr/esm/lib/components/tabs.wrapper.d.ts +0 -72
- package/ssr/esm/lib/components/tag-dismissible.wrapper.d.ts +0 -34
- package/ssr/esm/lib/components/tag.wrapper.d.ts +0 -46
- package/ssr/esm/lib/components/text-list-item.wrapper.d.ts +0 -5
- package/ssr/esm/lib/components/text-list.wrapper.d.ts +0 -18
- package/ssr/esm/lib/components/text.wrapper.d.ts +0 -78
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +0 -238
- package/ssr/esm/lib/components/toast.wrapper.d.ts +0 -3
- package/ssr/esm/lib/components/wordmark.wrapper.d.ts +0 -42
- package/ssr/esm/lib/dsr-components/accordion.d.ts +0 -18
- package/ssr/esm/lib/dsr-components/ai-tag.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/banner.d.ts +0 -20
- package/ssr/esm/lib/dsr-components/button-pure.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/button-tile.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/button.d.ts +0 -19
- package/ssr/esm/lib/dsr-components/canvas.d.ts +0 -23
- package/ssr/esm/lib/dsr-components/carousel.d.ts +0 -27
- package/ssr/esm/lib/dsr-components/checkbox.d.ts +0 -19
- package/ssr/esm/lib/dsr-components/crest.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/dialog-base.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/display.d.ts +0 -11
- package/ssr/esm/lib/dsr-components/divider.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/drilldown-item.d.ts +0 -15
- package/ssr/esm/lib/dsr-components/drilldown-link.d.ts +0 -11
- package/ssr/esm/lib/dsr-components/drilldown.d.ts +0 -23
- package/ssr/esm/lib/dsr-components/fc-dismiss-button.d.ts +0 -16
- package/ssr/esm/lib/dsr-components/fieldset.d.ts +0 -11
- package/ssr/esm/lib/dsr-components/filter-status-announcer.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/flag.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/flyout.d.ts +0 -26
- package/ssr/esm/lib/dsr-components/heading.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/icon.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/inline-notification.d.ts +0 -11
- package/ssr/esm/lib/dsr-components/input-base.d.ts +0 -38
- package/ssr/esm/lib/dsr-components/input-date.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-email.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-month.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-number.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-password.d.ts +0 -23
- package/ssr/esm/lib/dsr-components/input-search.d.ts +0 -23
- package/ssr/esm/lib/dsr-components/input-tel.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-text.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-time.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-url.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/input-week.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/label.d.ts +0 -24
- package/ssr/esm/lib/dsr-components/link-pure.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/link-tile-product.d.ts +0 -15
- package/ssr/esm/lib/dsr-components/link-tile.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/link.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/loading-message.d.ts +0 -8
- package/ssr/esm/lib/dsr-components/modal.d.ts +0 -23
- package/ssr/esm/lib/dsr-components/model-signature.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/multi-select-option.d.ts +0 -10
- package/ssr/esm/lib/dsr-components/multi-select.d.ts +0 -40
- package/ssr/esm/lib/dsr-components/no-results-option.d.ts +0 -2
- package/ssr/esm/lib/dsr-components/notification-base.d.ts +0 -14
- package/ssr/esm/lib/dsr-components/optgroup.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/pagination.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/pin-code.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/popover.d.ts +0 -27
- package/ssr/esm/lib/dsr-components/radio-group-option.d.ts +0 -13
- package/ssr/esm/lib/dsr-components/radio-group.d.ts +0 -22
- package/ssr/esm/lib/dsr-components/required.d.ts +0 -2
- package/ssr/esm/lib/dsr-components/scroller.d.ts +0 -15
- package/ssr/esm/lib/dsr-components/segmented-control-item.d.ts +0 -10
- package/ssr/esm/lib/dsr-components/segmented-control.d.ts +0 -21
- package/ssr/esm/lib/dsr-components/select-option.d.ts +0 -10
- package/ssr/esm/lib/dsr-components/select.d.ts +0 -41
- package/ssr/esm/lib/dsr-components/sheet.d.ts +0 -20
- package/ssr/esm/lib/dsr-components/spinner.d.ts +0 -6
- package/ssr/esm/lib/dsr-components/state-message.d.ts +0 -10
- package/ssr/esm/lib/dsr-components/stepper-horizontal-item.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/stepper-horizontal.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/switch.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/table-body.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table-cell.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table-head-cell.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table-head-row.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table-head.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table-row.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/table.d.ts +0 -10
- package/ssr/esm/lib/dsr-components/tabs-bar.d.ts +0 -17
- package/ssr/esm/lib/dsr-components/tabs-item.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/tabs.d.ts +0 -12
- package/ssr/esm/lib/dsr-components/tag-dismissible.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/tag.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/text-list-item.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/text-list.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/text.d.ts +0 -9
- package/ssr/esm/lib/dsr-components/textarea.d.ts +0 -19
- package/ssr/esm/lib/dsr-components/toast.d.ts +0 -7
- package/ssr/esm/lib/dsr-components/wordmark.d.ts +0 -6
- package/ssr/esm/lib/types.d.ts +0 -1862
- package/ssr/esm/minifyCss.d.ts +0 -1
- package/ssr/esm/provider.d.ts +0 -10
- package/ssr/esm/splitChildren.d.ts +0 -17
- package/ssr/esm/utils.d.ts +0 -4
|
@@ -42,11 +42,11 @@ function _typeof(o) {
|
|
|
42
42
|
}, _typeof(o);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function toPrimitive(t,
|
|
45
|
+
function toPrimitive(t, e) {
|
|
46
46
|
if ("object" != _typeof(t) || !t) return t;
|
|
47
|
-
var
|
|
48
|
-
if (void 0 !==
|
|
49
|
-
var i =
|
|
47
|
+
var r;
|
|
48
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
49
|
+
var i = r.call(t, e);
|
|
50
50
|
if ("object" != _typeof(i)) return i;
|
|
51
51
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
52
52
|
}
|
|
@@ -3238,8 +3238,9 @@ const parseAndGetAriaAttributes = (rawAttributes) => {
|
|
|
3238
3238
|
if (rawAttributes) {
|
|
3239
3239
|
return Object.fromEntries(Object.entries(parseJSONAttribute(rawAttributes)).map(([key, val]) => [
|
|
3240
3240
|
key,
|
|
3241
|
-
// convert booleans to strings so that values are properly set and not just result in attributes without a value when true in jsx
|
|
3242
|
-
|
|
3241
|
+
// convert booleans to strings so that values are properly set and not just result in attributes without a value when true in jsx;
|
|
3242
|
+
// convert Element / Element[] (or null) to null so Stencil does not stringify "[object HTMLElement]" as an attribute
|
|
3243
|
+
typeof val === 'boolean' ? `${val}` : typeof val === 'object' ? null : val,
|
|
3243
3244
|
]));
|
|
3244
3245
|
}
|
|
3245
3246
|
return undefined;
|
|
@@ -3375,6 +3376,27 @@ const textSmallStyle = {
|
|
|
3375
3376
|
font: `${_textFontPartA}${fontSizeTextSmall}${_textFontPartB}`,
|
|
3376
3377
|
};
|
|
3377
3378
|
|
|
3379
|
+
// AUTO-GENERATED by scripts/buildCssVariableConstants.ts — do not edit by hand.
|
|
3380
|
+
const colorBackdrop = '--p-color-backdrop';
|
|
3381
|
+
|
|
3382
|
+
// Wraps a bare CSS custom property name
|
|
3383
|
+
// (e.g. `--p-color-canvas`, exported as a plain literal const) into a CSS
|
|
3384
|
+
// `var(...)` reference, optionally with a fallback. Kept as a standalone module
|
|
3385
|
+
// with no side effects so bundlers (Stencil/Rollup) can tree-shake it together
|
|
3386
|
+
// with the individual variable consts.
|
|
3387
|
+
/**
|
|
3388
|
+
* Wraps a CSS custom property name into a `var(...)` reference.
|
|
3389
|
+
*
|
|
3390
|
+
* @example
|
|
3391
|
+
* import { colorCanvas, ref } from '@porsche-design-system/stylesheets';
|
|
3392
|
+
* const styles = { background: ref(colorCanvas) }; // -> 'var(--p-color-canvas)'
|
|
3393
|
+
* const styles = { color: ref(colorPrimary, '#000') }; // -> 'var(--p-color-primary,#000)'
|
|
3394
|
+
*
|
|
3395
|
+
* @param name The bare CSS custom property name, e.g. `--p-color-canvas`.
|
|
3396
|
+
* @param fallback Optional fallback value used when the variable is not defined.
|
|
3397
|
+
*/
|
|
3398
|
+
const ref = (name, fallback) => `var(${name}${'' })`;
|
|
3399
|
+
|
|
3378
3400
|
const parse = (prop) => {
|
|
3379
3401
|
if (typeof prop === 'string') {
|
|
3380
3402
|
try {
|
|
@@ -4316,6 +4338,388 @@ if (tempIcon) {
|
|
|
4316
4338
|
tempIcon.style.width = ICON_SIZE;
|
|
4317
4339
|
tempIcon.style.marginRight = ICON_MARGIN;
|
|
4318
4340
|
}
|
|
4341
|
+
const SWIPE_START_THRESHOLD_PX = 8;
|
|
4342
|
+
const SWIPE_DISMISS_DISTANCE_RATIO = 0.25;
|
|
4343
|
+
const SWIPE_DISMISS_MAX_DISTANCE_PX = 180;
|
|
4344
|
+
const SWIPE_DISMISS_VELOCITY_PX_PER_MS = 0.5;
|
|
4345
|
+
const SWIPE_DISMISS_MIN_FLICK_PX = 20;
|
|
4346
|
+
const SWIPE_VELOCITY_DECAY_MS = 64;
|
|
4347
|
+
const SWIPE_SCROLL_LOCK_MS = 100;
|
|
4348
|
+
const SWIPE_MAX_BACKDROP_SCRUB = 0.99;
|
|
4349
|
+
const isElement = (node) => node instanceof HTMLElement;
|
|
4350
|
+
const EXCLUDED_SWIPE_TARGET_SELECTOR = [
|
|
4351
|
+
'input',
|
|
4352
|
+
'textarea',
|
|
4353
|
+
'select',
|
|
4354
|
+
'button',
|
|
4355
|
+
'label',
|
|
4356
|
+
'summary',
|
|
4357
|
+
'canvas',
|
|
4358
|
+
'dialog',
|
|
4359
|
+
'a[href]',
|
|
4360
|
+
'video[controls]',
|
|
4361
|
+
'audio[controls]',
|
|
4362
|
+
'[contenteditable]:not([contenteditable="false" i])',
|
|
4363
|
+
'[draggable="true"]',
|
|
4364
|
+
':popover-open',
|
|
4365
|
+
...[
|
|
4366
|
+
'button',
|
|
4367
|
+
'link',
|
|
4368
|
+
'slider',
|
|
4369
|
+
'spinbutton',
|
|
4370
|
+
'textbox',
|
|
4371
|
+
'combobox',
|
|
4372
|
+
'listbox',
|
|
4373
|
+
'menuitem',
|
|
4374
|
+
'option',
|
|
4375
|
+
'switch',
|
|
4376
|
+
'tab',
|
|
4377
|
+
].map((role) => `[role="${role}"]`),
|
|
4378
|
+
].join();
|
|
4379
|
+
const isVerticallyScrollable = (element) => {
|
|
4380
|
+
if (element.scrollHeight <= element.clientHeight) {
|
|
4381
|
+
return false;
|
|
4382
|
+
}
|
|
4383
|
+
const { overflowY } = getComputedStyle(element);
|
|
4384
|
+
return overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay';
|
|
4385
|
+
};
|
|
4386
|
+
/** True when the sheet scroller and every scrollable ancestor between the touch and it are at the top. */
|
|
4387
|
+
const isScrolledToTop = (composedPath, scroller) => {
|
|
4388
|
+
for (const node of composedPath) {
|
|
4389
|
+
if (node === scroller) {
|
|
4390
|
+
break;
|
|
4391
|
+
}
|
|
4392
|
+
if (isElement(node) && isVerticallyScrollable(node) && node.scrollTop > 0) {
|
|
4393
|
+
return false;
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
return scroller.scrollTop <= 0;
|
|
4397
|
+
};
|
|
4398
|
+
/**
|
|
4399
|
+
* True when the touch starts on an interactive control, editable region, canvas, open popover or nested dialog.
|
|
4400
|
+
* This includes the swipe handle button, which is dragged through Pointer Events instead.
|
|
4401
|
+
*/
|
|
4402
|
+
const hasExcludedSwipeTarget = (composedPath, ownDialog) => {
|
|
4403
|
+
for (const node of composedPath) {
|
|
4404
|
+
if (node === ownDialog) {
|
|
4405
|
+
return false;
|
|
4406
|
+
}
|
|
4407
|
+
if (node instanceof Element && node.matches(EXCLUDED_SWIPE_TARGET_SELECTOR)) {
|
|
4408
|
+
return true;
|
|
4409
|
+
}
|
|
4410
|
+
}
|
|
4411
|
+
return false;
|
|
4412
|
+
};
|
|
4413
|
+
/** Locks a gesture to an axis once it has moved past the start threshold. */
|
|
4414
|
+
const getSwipeAxis = (dx, dy, thresholdPx = SWIPE_START_THRESHOLD_PX) => {
|
|
4415
|
+
if (Math.hypot(dx, dy) < thresholdPx) {
|
|
4416
|
+
return null;
|
|
4417
|
+
}
|
|
4418
|
+
return Math.abs(dx) >= Math.abs(dy) ? 'x' : 'y';
|
|
4419
|
+
};
|
|
4420
|
+
/** Distance or downward flick closes the sheet. An intentional upward flick cancels a long drag. */
|
|
4421
|
+
const shouldDismissBySwipe = (dy, velocityY, sheetHeight) => {
|
|
4422
|
+
if (dy <= 0 || velocityY <= -SWIPE_DISMISS_VELOCITY_PX_PER_MS) {
|
|
4423
|
+
return false;
|
|
4424
|
+
}
|
|
4425
|
+
const distanceThreshold = Math.min(SWIPE_DISMISS_DISTANCE_RATIO * sheetHeight, SWIPE_DISMISS_MAX_DISTANCE_PX);
|
|
4426
|
+
return dy >= distanceThreshold || (velocityY >= SWIPE_DISMISS_VELOCITY_PX_PER_MS && dy > SWIPE_DISMISS_MIN_FLICK_PX);
|
|
4427
|
+
};
|
|
4428
|
+
/** Backdrop mix while dragging. Clamped so the close transition still has a background-color delta. */
|
|
4429
|
+
const getSwipeBackdropBackgroundColor = (dy, sheetHeight) => {
|
|
4430
|
+
const progress = sheetHeight > 0 ? Math.min(Math.max(dy, 0) / sheetHeight, SWIPE_MAX_BACKDROP_SCRUB) : 0;
|
|
4431
|
+
const percent = Math.round((1 - progress) * 10000) / 100;
|
|
4432
|
+
return `color-mix(in srgb, ${ref(colorBackdrop)} ${percent}%, transparent)`;
|
|
4433
|
+
};
|
|
4434
|
+
/**
|
|
4435
|
+
* Manages downward swipe dismissal for `p-sheet`: Touch Events on the non-interactive sheet surface (so native scrolling
|
|
4436
|
+
* and horizontal gestures keep working) and Pointer Events with pointer capture on `.swipe-handle` (mouse, pen and
|
|
4437
|
+
* touch). Also scrubs the backdrop, snaps back and recovers from a consumer veto.
|
|
4438
|
+
*/
|
|
4439
|
+
const createSheetSwipeController = (options) => {
|
|
4440
|
+
const { getDialog, getScroller, getSheet, getSwipeHandle, isOpen, hasSwipeHandle, onSwipeDismiss } = options;
|
|
4441
|
+
let wasOpen = false;
|
|
4442
|
+
let listeners;
|
|
4443
|
+
let touchId = null;
|
|
4444
|
+
let pointerId = null;
|
|
4445
|
+
let startX = 0;
|
|
4446
|
+
let startY = 0;
|
|
4447
|
+
let lastY = 0;
|
|
4448
|
+
let lastTime = 0;
|
|
4449
|
+
let velocityY = 0;
|
|
4450
|
+
let axis = null;
|
|
4451
|
+
let isDragging = false;
|
|
4452
|
+
let dragDy = 0;
|
|
4453
|
+
let sheetHeight = 0;
|
|
4454
|
+
let lastScrollTime = 0;
|
|
4455
|
+
let pendingSwipeDismiss = false;
|
|
4456
|
+
let vetoFrame = 0;
|
|
4457
|
+
let suppressHandleClick = false;
|
|
4458
|
+
let isRecovering = false;
|
|
4459
|
+
let glideOut;
|
|
4460
|
+
const clearSwipeStyles = () => {
|
|
4461
|
+
const sheet = getSheet();
|
|
4462
|
+
if (sheet) {
|
|
4463
|
+
sheet.style.transition = '';
|
|
4464
|
+
sheet.style.transform = '';
|
|
4465
|
+
}
|
|
4466
|
+
const dialog = getDialog();
|
|
4467
|
+
if (dialog) {
|
|
4468
|
+
dialog.style.transition = '';
|
|
4469
|
+
dialog.style.backgroundColor = '';
|
|
4470
|
+
}
|
|
4471
|
+
};
|
|
4472
|
+
/** Restores the still-open sheet from its drag position, which transitions the backdrop back. */
|
|
4473
|
+
const recoverSwipeStyles = () => {
|
|
4474
|
+
isRecovering ||= !!getDialog()?.style.backgroundColor;
|
|
4475
|
+
clearSwipeStyles();
|
|
4476
|
+
};
|
|
4477
|
+
const endGlideOut = () => {
|
|
4478
|
+
glideOut?.abort();
|
|
4479
|
+
glideOut = undefined;
|
|
4480
|
+
};
|
|
4481
|
+
/** Glides the closing sheet out from its drag position instead of jumping back to the closed offset of the stylesheet. */
|
|
4482
|
+
const glideOutSheet = (sheet) => {
|
|
4483
|
+
sheet.style.transform = 'translate3d(0, 100%, 0)';
|
|
4484
|
+
glideOut = new AbortController();
|
|
4485
|
+
sheet.addEventListener('transitionend', (event) => {
|
|
4486
|
+
if (event.target === sheet && event.propertyName === 'transform') {
|
|
4487
|
+
endGlideOut();
|
|
4488
|
+
// The inline style outranks the stylesheet, so it would be where the next open transition starts from.
|
|
4489
|
+
sheet.style.transform = '';
|
|
4490
|
+
}
|
|
4491
|
+
}, { signal: glideOut.signal });
|
|
4492
|
+
};
|
|
4493
|
+
const resetGesture = () => {
|
|
4494
|
+
touchId = null;
|
|
4495
|
+
pointerId = null;
|
|
4496
|
+
axis = null;
|
|
4497
|
+
isDragging = false;
|
|
4498
|
+
velocityY = 0;
|
|
4499
|
+
};
|
|
4500
|
+
const canBeginGesture = () => touchId === null && pointerId === null && performance.now() - lastScrollTime >= SWIPE_SCROLL_LOCK_MS;
|
|
4501
|
+
const beginGesture = (clientX, clientY) => {
|
|
4502
|
+
startX = clientX;
|
|
4503
|
+
startY = clientY;
|
|
4504
|
+
lastY = clientY;
|
|
4505
|
+
lastTime = performance.now();
|
|
4506
|
+
dragDy = 0;
|
|
4507
|
+
sheetHeight = getSheet()?.getBoundingClientRect().height ?? 0;
|
|
4508
|
+
suppressHandleClick = false;
|
|
4509
|
+
};
|
|
4510
|
+
const applyDragFrame = (clientY, dy) => {
|
|
4511
|
+
const sheet = getSheet();
|
|
4512
|
+
const dialog = getDialog();
|
|
4513
|
+
if (!sheet || !dialog) {
|
|
4514
|
+
return;
|
|
4515
|
+
}
|
|
4516
|
+
const now = performance.now();
|
|
4517
|
+
if (now > lastTime) {
|
|
4518
|
+
velocityY = (clientY - lastY) / (now - lastTime);
|
|
4519
|
+
}
|
|
4520
|
+
lastY = clientY;
|
|
4521
|
+
lastTime = now;
|
|
4522
|
+
dragDy = Math.max(0, dy);
|
|
4523
|
+
sheet.style.transition = 'none';
|
|
4524
|
+
sheet.style.transform = `translate3d(0, ${dragDy}px, 0)`;
|
|
4525
|
+
dialog.style.transition = 'none';
|
|
4526
|
+
dialog.style.backgroundColor = getSwipeBackdropBackgroundColor(dragDy, sheetHeight);
|
|
4527
|
+
};
|
|
4528
|
+
/** Locks the axis once, then follows the pointer while the gesture is downward and the content is scrolled to the top. */
|
|
4529
|
+
const moveGesture = (event, clientX, clientY) => {
|
|
4530
|
+
const dy = clientY - startY;
|
|
4531
|
+
if (!axis) {
|
|
4532
|
+
axis = getSwipeAxis(clientX - startX, dy);
|
|
4533
|
+
const scroller = getScroller();
|
|
4534
|
+
isDragging =
|
|
4535
|
+
axis === 'y' && dy > 0 && event.cancelable && !!scroller && isScrolledToTop(event.composedPath(), scroller);
|
|
4536
|
+
}
|
|
4537
|
+
if (isDragging) {
|
|
4538
|
+
event.preventDefault();
|
|
4539
|
+
applyDragFrame(clientY, dy);
|
|
4540
|
+
}
|
|
4541
|
+
};
|
|
4542
|
+
const scheduleVetoCheck = () => {
|
|
4543
|
+
cancelAnimationFrame(vetoFrame);
|
|
4544
|
+
// Two frames give a controlled consumer time to set `open = false` before a veto is assumed.
|
|
4545
|
+
vetoFrame = requestAnimationFrame(() => {
|
|
4546
|
+
vetoFrame = requestAnimationFrame(() => {
|
|
4547
|
+
if (isOpen() && pendingSwipeDismiss) {
|
|
4548
|
+
pendingSwipeDismiss = false;
|
|
4549
|
+
recoverSwipeStyles();
|
|
4550
|
+
}
|
|
4551
|
+
});
|
|
4552
|
+
});
|
|
4553
|
+
};
|
|
4554
|
+
const finishGesture = (cancelled) => {
|
|
4555
|
+
const wasDragging = isDragging;
|
|
4556
|
+
const releaseVelocityY = performance.now() - lastTime > SWIPE_VELOCITY_DECAY_MS ? 0 : velocityY;
|
|
4557
|
+
const shouldDismiss = wasDragging && !cancelled && isOpen() && shouldDismissBySwipe(dragDy, releaseVelocityY, sheetHeight);
|
|
4558
|
+
// A pointer drag on the handle ends with a click on it, in any direction. Touch drags call `preventDefault()` and
|
|
4559
|
+
// never produce one.
|
|
4560
|
+
suppressHandleClick = axis !== null && pointerId !== null;
|
|
4561
|
+
resetGesture();
|
|
4562
|
+
if (shouldDismiss) {
|
|
4563
|
+
pendingSwipeDismiss = true;
|
|
4564
|
+
onSwipeDismiss();
|
|
4565
|
+
scheduleVetoCheck();
|
|
4566
|
+
}
|
|
4567
|
+
else if (wasDragging) {
|
|
4568
|
+
recoverSwipeStyles();
|
|
4569
|
+
}
|
|
4570
|
+
};
|
|
4571
|
+
const trackedTouch = (event) => Array.from(event.changedTouches).find((touch) => touch.identifier === touchId);
|
|
4572
|
+
/** A second finger makes it a multi-touch gesture such as pinch zoom, which stays with the browser. */
|
|
4573
|
+
const yieldsToMultiTouch = (event) => {
|
|
4574
|
+
if (event.touches.length < 2) {
|
|
4575
|
+
return false;
|
|
4576
|
+
}
|
|
4577
|
+
if (touchId !== null) {
|
|
4578
|
+
finishGesture(true);
|
|
4579
|
+
}
|
|
4580
|
+
return true;
|
|
4581
|
+
};
|
|
4582
|
+
const onTouchStart = (event) => {
|
|
4583
|
+
if (yieldsToMultiTouch(event)) {
|
|
4584
|
+
return;
|
|
4585
|
+
}
|
|
4586
|
+
const touch = event.changedTouches[0];
|
|
4587
|
+
const dialog = getDialog();
|
|
4588
|
+
if (touch && dialog && canBeginGesture() && !hasExcludedSwipeTarget(event.composedPath(), dialog)) {
|
|
4589
|
+
touchId = touch.identifier;
|
|
4590
|
+
beginGesture(touch.clientX, touch.clientY);
|
|
4591
|
+
}
|
|
4592
|
+
};
|
|
4593
|
+
const onTouchMove = (event) => {
|
|
4594
|
+
if (yieldsToMultiTouch(event)) {
|
|
4595
|
+
return;
|
|
4596
|
+
}
|
|
4597
|
+
const touch = trackedTouch(event);
|
|
4598
|
+
if (touch) {
|
|
4599
|
+
moveGesture(event, touch.clientX, touch.clientY);
|
|
4600
|
+
}
|
|
4601
|
+
};
|
|
4602
|
+
const onTouchEnd = (event) => {
|
|
4603
|
+
if (trackedTouch(event)) {
|
|
4604
|
+
finishGesture(event.type === 'touchcancel');
|
|
4605
|
+
}
|
|
4606
|
+
};
|
|
4607
|
+
const onHandlePointerDown = (event) => {
|
|
4608
|
+
if (event.button === 0 && event.isPrimary && canBeginGesture()) {
|
|
4609
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
4610
|
+
pointerId = event.pointerId;
|
|
4611
|
+
beginGesture(event.clientX, event.clientY);
|
|
4612
|
+
}
|
|
4613
|
+
};
|
|
4614
|
+
const onHandlePointerMove = (event) => {
|
|
4615
|
+
if (event.pointerId !== pointerId) {
|
|
4616
|
+
return;
|
|
4617
|
+
}
|
|
4618
|
+
// No button pressed means the release was missed, e.g. after the window lost focus mid-drag.
|
|
4619
|
+
if (event.buttons === 0) {
|
|
4620
|
+
finishGesture(true);
|
|
4621
|
+
}
|
|
4622
|
+
else {
|
|
4623
|
+
moveGesture(event, event.clientX, event.clientY);
|
|
4624
|
+
}
|
|
4625
|
+
};
|
|
4626
|
+
const onHandlePointerEnd = (event) => {
|
|
4627
|
+
if (event.pointerId === pointerId) {
|
|
4628
|
+
finishGesture(event.type !== 'pointerup');
|
|
4629
|
+
}
|
|
4630
|
+
};
|
|
4631
|
+
const onClickCapture = (event) => {
|
|
4632
|
+
// `detail === 0` is a keyboard activation, which is never the tail of a drag.
|
|
4633
|
+
if (suppressHandleClick && event.detail > 0 && getSwipeHandle()?.contains(event.target)) {
|
|
4634
|
+
suppressHandleClick = false;
|
|
4635
|
+
event.preventDefault();
|
|
4636
|
+
event.stopPropagation();
|
|
4637
|
+
}
|
|
4638
|
+
};
|
|
4639
|
+
const onScroll = () => {
|
|
4640
|
+
lastScrollTime = performance.now();
|
|
4641
|
+
};
|
|
4642
|
+
const detachListeners = () => {
|
|
4643
|
+
listeners?.abort.abort();
|
|
4644
|
+
listeners = undefined;
|
|
4645
|
+
resetGesture();
|
|
4646
|
+
};
|
|
4647
|
+
const syncListeners = () => {
|
|
4648
|
+
const dialog = getDialog();
|
|
4649
|
+
const sheet = getSheet();
|
|
4650
|
+
const handle = getSwipeHandle();
|
|
4651
|
+
if (!(isOpen() && hasSwipeHandle() && dialog && sheet && handle)) {
|
|
4652
|
+
// Disabling the feature while open must not leave the sheet displaced. The glide-out styles of a closed sheet stay.
|
|
4653
|
+
if (isOpen() && (isDragging || pendingSwipeDismiss)) {
|
|
4654
|
+
cancelAnimationFrame(vetoFrame);
|
|
4655
|
+
pendingSwipeDismiss = false;
|
|
4656
|
+
recoverSwipeStyles();
|
|
4657
|
+
}
|
|
4658
|
+
detachListeners();
|
|
4659
|
+
return;
|
|
4660
|
+
}
|
|
4661
|
+
if (listeners?.dialog === dialog && listeners.sheet === sheet && listeners.handle === handle) {
|
|
4662
|
+
return;
|
|
4663
|
+
}
|
|
4664
|
+
detachListeners();
|
|
4665
|
+
const abort = new AbortController();
|
|
4666
|
+
const { signal } = abort;
|
|
4667
|
+
sheet.addEventListener('touchstart', onTouchStart, { passive: true, signal });
|
|
4668
|
+
sheet.addEventListener('touchmove', onTouchMove, { passive: false, signal });
|
|
4669
|
+
sheet.addEventListener('touchend', onTouchEnd, { passive: true, signal });
|
|
4670
|
+
sheet.addEventListener('touchcancel', onTouchEnd, { passive: true, signal });
|
|
4671
|
+
sheet.addEventListener('click', onClickCapture, { capture: true, signal });
|
|
4672
|
+
handle.addEventListener('pointerdown', onHandlePointerDown, { signal });
|
|
4673
|
+
handle.addEventListener('pointermove', onHandlePointerMove, { signal });
|
|
4674
|
+
handle.addEventListener('pointerup', onHandlePointerEnd, { signal });
|
|
4675
|
+
handle.addEventListener('pointercancel', onHandlePointerEnd, { signal });
|
|
4676
|
+
handle.addEventListener('lostpointercapture', onHandlePointerEnd, { signal });
|
|
4677
|
+
dialog.addEventListener('scroll', onScroll, { capture: true, passive: true, signal });
|
|
4678
|
+
listeners = { dialog, sheet, handle, abort };
|
|
4679
|
+
};
|
|
4680
|
+
const sync = () => {
|
|
4681
|
+
const open = isOpen();
|
|
4682
|
+
if (open !== wasOpen) {
|
|
4683
|
+
isRecovering = false;
|
|
4684
|
+
}
|
|
4685
|
+
if (open && !wasOpen) {
|
|
4686
|
+
pendingSwipeDismiss = false;
|
|
4687
|
+
endGlideOut();
|
|
4688
|
+
clearSwipeStyles();
|
|
4689
|
+
}
|
|
4690
|
+
else if (!open && wasOpen) {
|
|
4691
|
+
cancelAnimationFrame(vetoFrame);
|
|
4692
|
+
clearSwipeStyles();
|
|
4693
|
+
// Swipe dismiss glides out from the drag position. Any other close (e.g. Escape mid-drag) runs the standard
|
|
4694
|
+
// transition so `motionHiddenEnd` fires.
|
|
4695
|
+
const sheet = getSheet();
|
|
4696
|
+
if (pendingSwipeDismiss && sheet) {
|
|
4697
|
+
glideOutSheet(sheet);
|
|
4698
|
+
}
|
|
4699
|
+
pendingSwipeDismiss = false;
|
|
4700
|
+
}
|
|
4701
|
+
wasOpen = open;
|
|
4702
|
+
syncListeners();
|
|
4703
|
+
};
|
|
4704
|
+
const destroy = () => {
|
|
4705
|
+
detachListeners();
|
|
4706
|
+
endGlideOut();
|
|
4707
|
+
clearSwipeStyles();
|
|
4708
|
+
cancelAnimationFrame(vetoFrame);
|
|
4709
|
+
pendingSwipeDismiss = false;
|
|
4710
|
+
suppressHandleClick = false;
|
|
4711
|
+
isRecovering = false;
|
|
4712
|
+
wasOpen = false;
|
|
4713
|
+
};
|
|
4714
|
+
const consumeRecoveryTransition = (event) => {
|
|
4715
|
+
if (isRecovering && event.target === getDialog() && event.propertyName === 'background-color') {
|
|
4716
|
+
isRecovering = false;
|
|
4717
|
+
return true;
|
|
4718
|
+
}
|
|
4719
|
+
return false;
|
|
4720
|
+
};
|
|
4721
|
+
return { sync, destroy, consumeRecoveryTransition };
|
|
4722
|
+
};
|
|
4319
4723
|
const isStateCompleteOrWarning = (state) => {
|
|
4320
4724
|
return state === 'complete' || state === 'warning';
|
|
4321
4725
|
};
|
|
@@ -4362,4 +4766,4 @@ const getTextTagType = (host, tag) => {
|
|
|
4362
4766
|
return tag;
|
|
4363
4767
|
};
|
|
4364
4768
|
|
|
4365
|
-
export { AI_TAG_LOCALES_DEPRECATED, AI_TAG_TRANSLATIONS, DISPLAY_TAGS, HEADING_TAGS, ItemType, MARKET_LOCALES, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, createPaginationItems, createRange, createTopLayerController, crestSize, descriptionId, displaySizeToTagMap, getAiTagLanguage, getAiTagTranslation, getBannerAriaAttributes, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getComboboxAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getInlineNotificationAriaAttributes, getListboxAriaAttributes, getMaxTransitionDurationMs, getParsedTileCompact, getPinCodeInputAriaLabel, getSanitizedActiveTabIndex, getSegmentedControlItemAriaAttributes, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTextTagType, getTotalPages, hasDocument, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, isCurrentInput, isDialogBackdropTarget, isDisabledOrLoading, isInfinitePagination, isListTypeOrdered, isSortable, isStateCompleteOrWarning, isUrl, labelId, mergeInputNativeAria, normalizeAiTagLocale, observedNodesMap, onCancelDialog, onClickDialog, parseAndGetAriaAttributes, parseJSONAttribute, parseJSONBoolean, resolveAiTagTranslationLanguage, setAriaIDREF, showDialog, supportsConstructableStylesheets, supportsNativePopover, supportsOverlayTransition, tempDiv, tempIcon, tempLabel };
|
|
4769
|
+
export { AI_TAG_LOCALES_DEPRECATED, AI_TAG_TRANSLATIONS, DISPLAY_TAGS, HEADING_TAGS, ItemType, MARKET_LOCALES, SWIPE_DISMISS_DISTANCE_RATIO, SWIPE_DISMISS_MAX_DISTANCE_PX, SWIPE_DISMISS_MIN_FLICK_PX, SWIPE_DISMISS_VELOCITY_PX_PER_MS, SWIPE_MAX_BACKDROP_SCRUB, SWIPE_SCROLL_LOCK_MS, SWIPE_START_THRESHOLD_PX, SWIPE_VELOCITY_DECAY_MS, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, createPaginationItems, createRange, createSheetSwipeController, createTopLayerController, crestSize, descriptionId, displaySizeToTagMap, getAiTagLanguage, getAiTagTranslation, getBannerAriaAttributes, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getComboboxAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getInlineNotificationAriaAttributes, getListboxAriaAttributes, getMaxTransitionDurationMs, getParsedTileCompact, getPinCodeInputAriaLabel, getSanitizedActiveTabIndex, getSegmentedControlItemAriaAttributes, getStepperHorizontalIconName, getSvgUrl, getSwipeAxis, getSwipeBackdropBackgroundColor, getSwitchButtonAriaAttributes, getTextTagType, getTotalPages, hasDocument, hasExcludedSwipeTarget, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, isCurrentInput, isDialogBackdropTarget, isDisabledOrLoading, isInfinitePagination, isListTypeOrdered, isScrolledToTop, isSortable, isStateCompleteOrWarning, isUrl, labelId, mergeInputNativeAria, normalizeAiTagLocale, observedNodesMap, onCancelDialog, onClickDialog, parseAndGetAriaAttributes, parseJSONAttribute, parseJSONBoolean, resolveAiTagTranslationLanguage, setAriaIDREF, shouldDismissBySwipe, showDialog, supportsConstructableStylesheets, supportsNativePopover, supportsOverlayTransition, tempDiv, tempIcon, tempLabel };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.mjs
CHANGED
|
@@ -5,20 +5,20 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.m
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRLink } from '../dsr-components/link.mjs';
|
|
7
7
|
|
|
8
|
-
const PLink = /*#__PURE__*/ forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', variant = 'primary', className, children, ...rest }, ref) => {
|
|
8
|
+
const PLink = /*#__PURE__*/ forwardRef(({ aria, compact = false, cover = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', variant = 'primary', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef(undefined);
|
|
10
10
|
const WebComponentTag = usePrefix('p-link');
|
|
11
|
-
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, variant];
|
|
11
|
+
const propsToSync = [aria, compact, cover, download, hideLabel, href, icon, iconSource, rel, target, variant];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['aria', 'compact', 'cover', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
const props = {
|
|
17
17
|
...rest,
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
...(!process.browser
|
|
20
20
|
? {
|
|
21
|
-
children: (jsx(DSRLink, { aria, compact, download, hideLabel, href, icon, iconSource, rel, target, variant, children })),
|
|
21
|
+
children: (jsx(DSRLink, { aria, compact, cover, download, hideLabel, href, icon, iconSource, rel, target, variant, children })),
|
|
22
22
|
}
|
|
23
23
|
: {
|
|
24
24
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.mjs
CHANGED
|
@@ -5,21 +5,21 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRPopover } from '../dsr-components/popover.mjs';
|
|
7
7
|
|
|
8
|
-
const PPopover = /*#__PURE__*/ forwardRef(({ aria, compact, description, direction = 'bottom', onDismiss, open, className, children, ...rest }, ref) => {
|
|
8
|
+
const PPopover = /*#__PURE__*/ forwardRef(({ aria, arrow = true, compact, description, direction = 'bottom', onDismiss, open, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef(undefined);
|
|
10
10
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
11
11
|
const WebComponentTag = usePrefix('p-popover');
|
|
12
|
-
const propsToSync = [aria, compact, description, direction, open];
|
|
12
|
+
const propsToSync = [aria, arrow, compact, description, direction, open];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['aria', 'compact', 'description', 'direction', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['aria', 'arrow', 'compact', 'description', 'direction', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
...(!process.browser
|
|
21
21
|
? {
|
|
22
|
-
children: (jsx(DSRPopover, { aria, compact, description, direction, open, children })),
|
|
22
|
+
children: (jsx(DSRPopover, { aria, arrow, compact, description, direction, open, children })),
|
|
23
23
|
}
|
|
24
24
|
: {
|
|
25
25
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/sheet.wrapper.mjs
CHANGED
|
@@ -5,23 +5,23 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRSheet } from '../dsr-components/sheet.mjs';
|
|
7
7
|
|
|
8
|
-
const PSheet = /*#__PURE__*/ forwardRef(({ aria, background = 'canvas', disableBackdropClick = false, dismissButton = true, onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, className, children, ...rest }, ref) => {
|
|
8
|
+
const PSheet = /*#__PURE__*/ forwardRef(({ aria, background = 'canvas', disableBackdropClick = false, dismissButton = true, onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, swipeHandle = false, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef(undefined);
|
|
10
10
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
11
11
|
useEventCallback(elementRef, 'motionHiddenEnd', onMotionHiddenEnd);
|
|
12
12
|
useEventCallback(elementRef, 'motionVisibleEnd', onMotionVisibleEnd);
|
|
13
13
|
const WebComponentTag = usePrefix('p-sheet');
|
|
14
|
-
const propsToSync = [aria, background, disableBackdropClick, dismissButton, open];
|
|
14
|
+
const propsToSync = [aria, background, disableBackdropClick, dismissButton, open, swipeHandle];
|
|
15
15
|
useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['aria', 'background', 'disableBackdropClick', 'dismissButton', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['aria', 'background', 'disableBackdropClick', 'dismissButton', 'open', 'swipeHandle'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
const props = {
|
|
20
20
|
...rest,
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
...(!process.browser
|
|
23
23
|
? {
|
|
24
|
-
children: (jsx(DSRSheet, { aria, background, disableBackdropClick, dismissButton, open, children })),
|
|
24
|
+
children: (jsx(DSRSheet, { aria, background, disableBackdropClick, dismissButton, open, swipeHandle, children })),
|
|
25
25
|
}
|
|
26
26
|
: {
|
|
27
27
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import { getAccordionCss as getComponentCss$1a } from '../../../../../../compone
|
|
|
15
15
|
*/
|
|
16
16
|
class DSRAccordion extends Component {
|
|
17
17
|
host;
|
|
18
|
+
summary;
|
|
18
19
|
hasSummary;
|
|
19
20
|
hasSummaryBefore;
|
|
20
21
|
hasSummaryAfter;
|
|
@@ -25,7 +26,7 @@ class DSRAccordion extends Component {
|
|
|
25
26
|
const hasSummaryAfter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'summary-after').length > 0;
|
|
26
27
|
const Heading = this.props.headingTag;
|
|
27
28
|
const style = getCachedMinifiedCss(getComponentCss$1a, this.props.alignMarker, this.props.background, this.props.compact, this.props.indent, this.props.open, this.props.sticky, hasSummaryBefore, hasSummaryAfter, this.props.size);
|
|
28
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true",
|
|
29
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("details", { ...(this.props.open ? { open: true } : {}), children: [jsx("summary", { children: hasSummary ? jsx("slot", { name: "summary" }) : jsx(Heading, { children: this.props.heading || jsx("slot", { name: "heading" }) }) }), hasSummaryBefore && jsx("slot", { name: "summary-before" }), hasSummaryAfter && jsx("slot", { name: "summary-after" }), jsx("div", { children: jsx("slot", {}) })] })] }), this.props.children] }));
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { FCDismissButton } from './fc-dismiss-button.mjs';
|
|
3
3
|
|
|
4
|
-
const DialogBase = ({ children, inert, containerClass, ariaAttributes, dismissable = false, header, footer, subFooter, }) => {
|
|
5
|
-
return (jsx("dialog", { inert: inert, tabIndex: -1, ...(ariaAttributes ?? {}), children: jsx("div", { className: "scroller", children: jsxs("div", { className: containerClass, children: [dismissable && jsx(FCDismissButton, { label: `Dismiss ${containerClass}` }), header, children, footer, subFooter] }) }) }));
|
|
4
|
+
const DialogBase = ({ children, inert, containerClass, ariaAttributes, dismissable = false, swipeHandle, header, footer, subFooter, }) => {
|
|
5
|
+
return (jsx("dialog", { inert: inert, tabIndex: -1, ...(ariaAttributes ?? {}), children: jsx("div", { className: "scroller", children: jsxs("div", { className: containerClass, children: [swipeHandle, dismissable && jsx(FCDismissButton, { label: `Dismiss ${containerClass}` }), header, children, footer, subFooter] }) }) }));
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { DialogBase };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs
CHANGED
|
@@ -15,7 +15,7 @@ id, label, description, loading, initialLoading, required, disabled, state, mess
|
|
|
15
15
|
// onWheel,
|
|
16
16
|
// onChange,
|
|
17
17
|
// onBlur,
|
|
18
|
-
//
|
|
18
|
+
// onKeyPress,
|
|
19
19
|
// refElement,
|
|
20
20
|
start, end, aria, }) => {
|
|
21
21
|
const { namedSlotChildren } = splitChildren(children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import '../../provider.mjs';
|
|
4
4
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
@@ -15,14 +15,16 @@ class DSRLink extends Component {
|
|
|
15
15
|
render() {
|
|
16
16
|
splitChildren(this.props.children);
|
|
17
17
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
18
|
-
const
|
|
18
|
+
const icon = hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" }));
|
|
19
|
+
const label = (jsx("span", { className: "label", children: jsx("slot", {}) }));
|
|
20
|
+
const style = getCachedMinifiedCss(getComponentCss$D, this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.href === undefined, this.props.compact, this.props.cover);
|
|
19
21
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
20
22
|
href: this.props.href,
|
|
21
23
|
target: this.props.target,
|
|
22
24
|
download: this.props.download,
|
|
23
25
|
rel: this.props.rel,
|
|
24
26
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
25
|
-
}), children: [
|
|
27
|
+
}), children: [this.props.cover && jsx("span", { className: "backdrop" }), this.props.cover ? (jsxs("span", { className: "content", children: [icon, label] })) : (icon), !this.props.cover && label] })] }), this.props.children] }));
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.mjs
CHANGED
|
@@ -78,7 +78,7 @@ class DSRPopover extends Component {
|
|
|
78
78
|
const hasSlottedButton = namedSlotChildren.filter(({ props: { slot } }) => slot === 'button').length > 0;
|
|
79
79
|
const id = 'popover';
|
|
80
80
|
const style = getCachedMinifiedCss(getPopoverTriggerCss, this.props.effectiveOpen, this.props.compact, this.props.isInitialRender);
|
|
81
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [hasSlottedButton ? (jsx("slot", { name: "button" })) : (jsx("button", { type: "button", "aria-label": "More information", "aria-details": id, ...parseAndGetAriaAttributes(this.props.aria), "aria-expanded": this.props.effectiveOpen ? 'true' : 'false' })), jsxs("div", { id: id, popover: "manual", inert: !this.props.effectiveOpen, children: [jsx("div", { className: "arrow" }), this.props.description ? jsx("p", { children: this.props.description }) : jsx("slot", {})] })] })] }), this.props.children] }));
|
|
81
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [hasSlottedButton ? (jsx("slot", { name: "button" })) : (jsx("button", { type: "button", "aria-label": "More information", "aria-details": id, ...parseAndGetAriaAttributes(this.props.aria), "aria-expanded": this.props.effectiveOpen ? 'true' : 'false' })), jsxs("div", { id: id, popover: "manual", inert: !this.props.effectiveOpen, children: [this.props.arrow && jsx("div", { className: "arrow" }), this.props.description ? jsx("p", { children: this.props.description }) : jsx("slot", {})] })] })] }), this.props.children] }));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
// module-level, because getCachedMinifiedCss() caches per function reference
|