@porsche-design-system/components-react 4.10.1 → 4.11.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 +102 -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
|
@@ -44,11 +44,11 @@ function _typeof(o) {
|
|
|
44
44
|
}, _typeof(o);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
function toPrimitive(t,
|
|
47
|
+
function toPrimitive(t, e) {
|
|
48
48
|
if ("object" != _typeof(t) || !t) return t;
|
|
49
|
-
var
|
|
50
|
-
if (void 0 !==
|
|
51
|
-
var i =
|
|
49
|
+
var r;
|
|
50
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
51
|
+
var i = r.call(t, e);
|
|
52
52
|
if ("object" != _typeof(i)) return i;
|
|
53
53
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
54
54
|
}
|
|
@@ -3240,8 +3240,9 @@ const parseAndGetAriaAttributes = (rawAttributes) => {
|
|
|
3240
3240
|
if (rawAttributes) {
|
|
3241
3241
|
return Object.fromEntries(Object.entries(parseJSONAttribute(rawAttributes)).map(([key, val]) => [
|
|
3242
3242
|
key,
|
|
3243
|
-
// convert booleans to strings so that values are properly set and not just result in attributes without a value when true in jsx
|
|
3244
|
-
|
|
3243
|
+
// convert booleans to strings so that values are properly set and not just result in attributes without a value when true in jsx;
|
|
3244
|
+
// convert Element / Element[] (or null) to null so Stencil does not stringify "[object HTMLElement]" as an attribute
|
|
3245
|
+
typeof val === 'boolean' ? `${val}` : typeof val === 'object' ? null : val,
|
|
3245
3246
|
]));
|
|
3246
3247
|
}
|
|
3247
3248
|
return undefined;
|
|
@@ -3377,6 +3378,27 @@ const textSmallStyle = {
|
|
|
3377
3378
|
font: `${_textFontPartA}${fontSizeTextSmall}${_textFontPartB}`,
|
|
3378
3379
|
};
|
|
3379
3380
|
|
|
3381
|
+
// AUTO-GENERATED by scripts/buildCssVariableConstants.ts — do not edit by hand.
|
|
3382
|
+
const colorBackdrop = '--p-color-backdrop';
|
|
3383
|
+
|
|
3384
|
+
// Wraps a bare CSS custom property name
|
|
3385
|
+
// (e.g. `--p-color-canvas`, exported as a plain literal const) into a CSS
|
|
3386
|
+
// `var(...)` reference, optionally with a fallback. Kept as a standalone module
|
|
3387
|
+
// with no side effects so bundlers (Stencil/Rollup) can tree-shake it together
|
|
3388
|
+
// with the individual variable consts.
|
|
3389
|
+
/**
|
|
3390
|
+
* Wraps a CSS custom property name into a `var(...)` reference.
|
|
3391
|
+
*
|
|
3392
|
+
* @example
|
|
3393
|
+
* import { colorCanvas, ref } from '@porsche-design-system/stylesheets';
|
|
3394
|
+
* const styles = { background: ref(colorCanvas) }; // -> 'var(--p-color-canvas)'
|
|
3395
|
+
* const styles = { color: ref(colorPrimary, '#000') }; // -> 'var(--p-color-primary,#000)'
|
|
3396
|
+
*
|
|
3397
|
+
* @param name The bare CSS custom property name, e.g. `--p-color-canvas`.
|
|
3398
|
+
* @param fallback Optional fallback value used when the variable is not defined.
|
|
3399
|
+
*/
|
|
3400
|
+
const ref = (name, fallback) => `var(${name}${'' })`;
|
|
3401
|
+
|
|
3380
3402
|
const parse = (prop) => {
|
|
3381
3403
|
if (typeof prop === 'string') {
|
|
3382
3404
|
try {
|
|
@@ -4318,6 +4340,388 @@ if (tempIcon) {
|
|
|
4318
4340
|
tempIcon.style.width = ICON_SIZE;
|
|
4319
4341
|
tempIcon.style.marginRight = ICON_MARGIN;
|
|
4320
4342
|
}
|
|
4343
|
+
const SWIPE_START_THRESHOLD_PX = 8;
|
|
4344
|
+
const SWIPE_DISMISS_DISTANCE_RATIO = 0.25;
|
|
4345
|
+
const SWIPE_DISMISS_MAX_DISTANCE_PX = 180;
|
|
4346
|
+
const SWIPE_DISMISS_VELOCITY_PX_PER_MS = 0.5;
|
|
4347
|
+
const SWIPE_DISMISS_MIN_FLICK_PX = 20;
|
|
4348
|
+
const SWIPE_VELOCITY_DECAY_MS = 64;
|
|
4349
|
+
const SWIPE_SCROLL_LOCK_MS = 100;
|
|
4350
|
+
const SWIPE_MAX_BACKDROP_SCRUB = 0.99;
|
|
4351
|
+
const isElement = (node) => node instanceof HTMLElement;
|
|
4352
|
+
const EXCLUDED_SWIPE_TARGET_SELECTOR = [
|
|
4353
|
+
'input',
|
|
4354
|
+
'textarea',
|
|
4355
|
+
'select',
|
|
4356
|
+
'button',
|
|
4357
|
+
'label',
|
|
4358
|
+
'summary',
|
|
4359
|
+
'canvas',
|
|
4360
|
+
'dialog',
|
|
4361
|
+
'a[href]',
|
|
4362
|
+
'video[controls]',
|
|
4363
|
+
'audio[controls]',
|
|
4364
|
+
'[contenteditable]:not([contenteditable="false" i])',
|
|
4365
|
+
'[draggable="true"]',
|
|
4366
|
+
':popover-open',
|
|
4367
|
+
...[
|
|
4368
|
+
'button',
|
|
4369
|
+
'link',
|
|
4370
|
+
'slider',
|
|
4371
|
+
'spinbutton',
|
|
4372
|
+
'textbox',
|
|
4373
|
+
'combobox',
|
|
4374
|
+
'listbox',
|
|
4375
|
+
'menuitem',
|
|
4376
|
+
'option',
|
|
4377
|
+
'switch',
|
|
4378
|
+
'tab',
|
|
4379
|
+
].map((role) => `[role="${role}"]`),
|
|
4380
|
+
].join();
|
|
4381
|
+
const isVerticallyScrollable = (element) => {
|
|
4382
|
+
if (element.scrollHeight <= element.clientHeight) {
|
|
4383
|
+
return false;
|
|
4384
|
+
}
|
|
4385
|
+
const { overflowY } = getComputedStyle(element);
|
|
4386
|
+
return overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay';
|
|
4387
|
+
};
|
|
4388
|
+
/** True when the sheet scroller and every scrollable ancestor between the touch and it are at the top. */
|
|
4389
|
+
const isScrolledToTop = (composedPath, scroller) => {
|
|
4390
|
+
for (const node of composedPath) {
|
|
4391
|
+
if (node === scroller) {
|
|
4392
|
+
break;
|
|
4393
|
+
}
|
|
4394
|
+
if (isElement(node) && isVerticallyScrollable(node) && node.scrollTop > 0) {
|
|
4395
|
+
return false;
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
return scroller.scrollTop <= 0;
|
|
4399
|
+
};
|
|
4400
|
+
/**
|
|
4401
|
+
* True when the touch starts on an interactive control, editable region, canvas, open popover or nested dialog.
|
|
4402
|
+
* This includes the swipe handle button, which is dragged through Pointer Events instead.
|
|
4403
|
+
*/
|
|
4404
|
+
const hasExcludedSwipeTarget = (composedPath, ownDialog) => {
|
|
4405
|
+
for (const node of composedPath) {
|
|
4406
|
+
if (node === ownDialog) {
|
|
4407
|
+
return false;
|
|
4408
|
+
}
|
|
4409
|
+
if (node instanceof Element && node.matches(EXCLUDED_SWIPE_TARGET_SELECTOR)) {
|
|
4410
|
+
return true;
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
return false;
|
|
4414
|
+
};
|
|
4415
|
+
/** Locks a gesture to an axis once it has moved past the start threshold. */
|
|
4416
|
+
const getSwipeAxis = (dx, dy, thresholdPx = SWIPE_START_THRESHOLD_PX) => {
|
|
4417
|
+
if (Math.hypot(dx, dy) < thresholdPx) {
|
|
4418
|
+
return null;
|
|
4419
|
+
}
|
|
4420
|
+
return Math.abs(dx) >= Math.abs(dy) ? 'x' : 'y';
|
|
4421
|
+
};
|
|
4422
|
+
/** Distance or downward flick closes the sheet. An intentional upward flick cancels a long drag. */
|
|
4423
|
+
const shouldDismissBySwipe = (dy, velocityY, sheetHeight) => {
|
|
4424
|
+
if (dy <= 0 || velocityY <= -SWIPE_DISMISS_VELOCITY_PX_PER_MS) {
|
|
4425
|
+
return false;
|
|
4426
|
+
}
|
|
4427
|
+
const distanceThreshold = Math.min(SWIPE_DISMISS_DISTANCE_RATIO * sheetHeight, SWIPE_DISMISS_MAX_DISTANCE_PX);
|
|
4428
|
+
return dy >= distanceThreshold || (velocityY >= SWIPE_DISMISS_VELOCITY_PX_PER_MS && dy > SWIPE_DISMISS_MIN_FLICK_PX);
|
|
4429
|
+
};
|
|
4430
|
+
/** Backdrop mix while dragging. Clamped so the close transition still has a background-color delta. */
|
|
4431
|
+
const getSwipeBackdropBackgroundColor = (dy, sheetHeight) => {
|
|
4432
|
+
const progress = sheetHeight > 0 ? Math.min(Math.max(dy, 0) / sheetHeight, SWIPE_MAX_BACKDROP_SCRUB) : 0;
|
|
4433
|
+
const percent = Math.round((1 - progress) * 10000) / 100;
|
|
4434
|
+
return `color-mix(in srgb, ${ref(colorBackdrop)} ${percent}%, transparent)`;
|
|
4435
|
+
};
|
|
4436
|
+
/**
|
|
4437
|
+
* Manages downward swipe dismissal for `p-sheet`: Touch Events on the non-interactive sheet surface (so native scrolling
|
|
4438
|
+
* and horizontal gestures keep working) and Pointer Events with pointer capture on `.swipe-handle` (mouse, pen and
|
|
4439
|
+
* touch). Also scrubs the backdrop, snaps back and recovers from a consumer veto.
|
|
4440
|
+
*/
|
|
4441
|
+
const createSheetSwipeController = (options) => {
|
|
4442
|
+
const { getDialog, getScroller, getSheet, getSwipeHandle, isOpen, hasSwipeHandle, onSwipeDismiss } = options;
|
|
4443
|
+
let wasOpen = false;
|
|
4444
|
+
let listeners;
|
|
4445
|
+
let touchId = null;
|
|
4446
|
+
let pointerId = null;
|
|
4447
|
+
let startX = 0;
|
|
4448
|
+
let startY = 0;
|
|
4449
|
+
let lastY = 0;
|
|
4450
|
+
let lastTime = 0;
|
|
4451
|
+
let velocityY = 0;
|
|
4452
|
+
let axis = null;
|
|
4453
|
+
let isDragging = false;
|
|
4454
|
+
let dragDy = 0;
|
|
4455
|
+
let sheetHeight = 0;
|
|
4456
|
+
let lastScrollTime = 0;
|
|
4457
|
+
let pendingSwipeDismiss = false;
|
|
4458
|
+
let vetoFrame = 0;
|
|
4459
|
+
let suppressHandleClick = false;
|
|
4460
|
+
let isRecovering = false;
|
|
4461
|
+
let glideOut;
|
|
4462
|
+
const clearSwipeStyles = () => {
|
|
4463
|
+
const sheet = getSheet();
|
|
4464
|
+
if (sheet) {
|
|
4465
|
+
sheet.style.transition = '';
|
|
4466
|
+
sheet.style.transform = '';
|
|
4467
|
+
}
|
|
4468
|
+
const dialog = getDialog();
|
|
4469
|
+
if (dialog) {
|
|
4470
|
+
dialog.style.transition = '';
|
|
4471
|
+
dialog.style.backgroundColor = '';
|
|
4472
|
+
}
|
|
4473
|
+
};
|
|
4474
|
+
/** Restores the still-open sheet from its drag position, which transitions the backdrop back. */
|
|
4475
|
+
const recoverSwipeStyles = () => {
|
|
4476
|
+
isRecovering ||= !!getDialog()?.style.backgroundColor;
|
|
4477
|
+
clearSwipeStyles();
|
|
4478
|
+
};
|
|
4479
|
+
const endGlideOut = () => {
|
|
4480
|
+
glideOut?.abort();
|
|
4481
|
+
glideOut = undefined;
|
|
4482
|
+
};
|
|
4483
|
+
/** Glides the closing sheet out from its drag position instead of jumping back to the closed offset of the stylesheet. */
|
|
4484
|
+
const glideOutSheet = (sheet) => {
|
|
4485
|
+
sheet.style.transform = 'translate3d(0, 100%, 0)';
|
|
4486
|
+
glideOut = new AbortController();
|
|
4487
|
+
sheet.addEventListener('transitionend', (event) => {
|
|
4488
|
+
if (event.target === sheet && event.propertyName === 'transform') {
|
|
4489
|
+
endGlideOut();
|
|
4490
|
+
// The inline style outranks the stylesheet, so it would be where the next open transition starts from.
|
|
4491
|
+
sheet.style.transform = '';
|
|
4492
|
+
}
|
|
4493
|
+
}, { signal: glideOut.signal });
|
|
4494
|
+
};
|
|
4495
|
+
const resetGesture = () => {
|
|
4496
|
+
touchId = null;
|
|
4497
|
+
pointerId = null;
|
|
4498
|
+
axis = null;
|
|
4499
|
+
isDragging = false;
|
|
4500
|
+
velocityY = 0;
|
|
4501
|
+
};
|
|
4502
|
+
const canBeginGesture = () => touchId === null && pointerId === null && performance.now() - lastScrollTime >= SWIPE_SCROLL_LOCK_MS;
|
|
4503
|
+
const beginGesture = (clientX, clientY) => {
|
|
4504
|
+
startX = clientX;
|
|
4505
|
+
startY = clientY;
|
|
4506
|
+
lastY = clientY;
|
|
4507
|
+
lastTime = performance.now();
|
|
4508
|
+
dragDy = 0;
|
|
4509
|
+
sheetHeight = getSheet()?.getBoundingClientRect().height ?? 0;
|
|
4510
|
+
suppressHandleClick = false;
|
|
4511
|
+
};
|
|
4512
|
+
const applyDragFrame = (clientY, dy) => {
|
|
4513
|
+
const sheet = getSheet();
|
|
4514
|
+
const dialog = getDialog();
|
|
4515
|
+
if (!sheet || !dialog) {
|
|
4516
|
+
return;
|
|
4517
|
+
}
|
|
4518
|
+
const now = performance.now();
|
|
4519
|
+
if (now > lastTime) {
|
|
4520
|
+
velocityY = (clientY - lastY) / (now - lastTime);
|
|
4521
|
+
}
|
|
4522
|
+
lastY = clientY;
|
|
4523
|
+
lastTime = now;
|
|
4524
|
+
dragDy = Math.max(0, dy);
|
|
4525
|
+
sheet.style.transition = 'none';
|
|
4526
|
+
sheet.style.transform = `translate3d(0, ${dragDy}px, 0)`;
|
|
4527
|
+
dialog.style.transition = 'none';
|
|
4528
|
+
dialog.style.backgroundColor = getSwipeBackdropBackgroundColor(dragDy, sheetHeight);
|
|
4529
|
+
};
|
|
4530
|
+
/** Locks the axis once, then follows the pointer while the gesture is downward and the content is scrolled to the top. */
|
|
4531
|
+
const moveGesture = (event, clientX, clientY) => {
|
|
4532
|
+
const dy = clientY - startY;
|
|
4533
|
+
if (!axis) {
|
|
4534
|
+
axis = getSwipeAxis(clientX - startX, dy);
|
|
4535
|
+
const scroller = getScroller();
|
|
4536
|
+
isDragging =
|
|
4537
|
+
axis === 'y' && dy > 0 && event.cancelable && !!scroller && isScrolledToTop(event.composedPath(), scroller);
|
|
4538
|
+
}
|
|
4539
|
+
if (isDragging) {
|
|
4540
|
+
event.preventDefault();
|
|
4541
|
+
applyDragFrame(clientY, dy);
|
|
4542
|
+
}
|
|
4543
|
+
};
|
|
4544
|
+
const scheduleVetoCheck = () => {
|
|
4545
|
+
cancelAnimationFrame(vetoFrame);
|
|
4546
|
+
// Two frames give a controlled consumer time to set `open = false` before a veto is assumed.
|
|
4547
|
+
vetoFrame = requestAnimationFrame(() => {
|
|
4548
|
+
vetoFrame = requestAnimationFrame(() => {
|
|
4549
|
+
if (isOpen() && pendingSwipeDismiss) {
|
|
4550
|
+
pendingSwipeDismiss = false;
|
|
4551
|
+
recoverSwipeStyles();
|
|
4552
|
+
}
|
|
4553
|
+
});
|
|
4554
|
+
});
|
|
4555
|
+
};
|
|
4556
|
+
const finishGesture = (cancelled) => {
|
|
4557
|
+
const wasDragging = isDragging;
|
|
4558
|
+
const releaseVelocityY = performance.now() - lastTime > SWIPE_VELOCITY_DECAY_MS ? 0 : velocityY;
|
|
4559
|
+
const shouldDismiss = wasDragging && !cancelled && isOpen() && shouldDismissBySwipe(dragDy, releaseVelocityY, sheetHeight);
|
|
4560
|
+
// A pointer drag on the handle ends with a click on it, in any direction. Touch drags call `preventDefault()` and
|
|
4561
|
+
// never produce one.
|
|
4562
|
+
suppressHandleClick = axis !== null && pointerId !== null;
|
|
4563
|
+
resetGesture();
|
|
4564
|
+
if (shouldDismiss) {
|
|
4565
|
+
pendingSwipeDismiss = true;
|
|
4566
|
+
onSwipeDismiss();
|
|
4567
|
+
scheduleVetoCheck();
|
|
4568
|
+
}
|
|
4569
|
+
else if (wasDragging) {
|
|
4570
|
+
recoverSwipeStyles();
|
|
4571
|
+
}
|
|
4572
|
+
};
|
|
4573
|
+
const trackedTouch = (event) => Array.from(event.changedTouches).find((touch) => touch.identifier === touchId);
|
|
4574
|
+
/** A second finger makes it a multi-touch gesture such as pinch zoom, which stays with the browser. */
|
|
4575
|
+
const yieldsToMultiTouch = (event) => {
|
|
4576
|
+
if (event.touches.length < 2) {
|
|
4577
|
+
return false;
|
|
4578
|
+
}
|
|
4579
|
+
if (touchId !== null) {
|
|
4580
|
+
finishGesture(true);
|
|
4581
|
+
}
|
|
4582
|
+
return true;
|
|
4583
|
+
};
|
|
4584
|
+
const onTouchStart = (event) => {
|
|
4585
|
+
if (yieldsToMultiTouch(event)) {
|
|
4586
|
+
return;
|
|
4587
|
+
}
|
|
4588
|
+
const touch = event.changedTouches[0];
|
|
4589
|
+
const dialog = getDialog();
|
|
4590
|
+
if (touch && dialog && canBeginGesture() && !hasExcludedSwipeTarget(event.composedPath(), dialog)) {
|
|
4591
|
+
touchId = touch.identifier;
|
|
4592
|
+
beginGesture(touch.clientX, touch.clientY);
|
|
4593
|
+
}
|
|
4594
|
+
};
|
|
4595
|
+
const onTouchMove = (event) => {
|
|
4596
|
+
if (yieldsToMultiTouch(event)) {
|
|
4597
|
+
return;
|
|
4598
|
+
}
|
|
4599
|
+
const touch = trackedTouch(event);
|
|
4600
|
+
if (touch) {
|
|
4601
|
+
moveGesture(event, touch.clientX, touch.clientY);
|
|
4602
|
+
}
|
|
4603
|
+
};
|
|
4604
|
+
const onTouchEnd = (event) => {
|
|
4605
|
+
if (trackedTouch(event)) {
|
|
4606
|
+
finishGesture(event.type === 'touchcancel');
|
|
4607
|
+
}
|
|
4608
|
+
};
|
|
4609
|
+
const onHandlePointerDown = (event) => {
|
|
4610
|
+
if (event.button === 0 && event.isPrimary && canBeginGesture()) {
|
|
4611
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
4612
|
+
pointerId = event.pointerId;
|
|
4613
|
+
beginGesture(event.clientX, event.clientY);
|
|
4614
|
+
}
|
|
4615
|
+
};
|
|
4616
|
+
const onHandlePointerMove = (event) => {
|
|
4617
|
+
if (event.pointerId !== pointerId) {
|
|
4618
|
+
return;
|
|
4619
|
+
}
|
|
4620
|
+
// No button pressed means the release was missed, e.g. after the window lost focus mid-drag.
|
|
4621
|
+
if (event.buttons === 0) {
|
|
4622
|
+
finishGesture(true);
|
|
4623
|
+
}
|
|
4624
|
+
else {
|
|
4625
|
+
moveGesture(event, event.clientX, event.clientY);
|
|
4626
|
+
}
|
|
4627
|
+
};
|
|
4628
|
+
const onHandlePointerEnd = (event) => {
|
|
4629
|
+
if (event.pointerId === pointerId) {
|
|
4630
|
+
finishGesture(event.type !== 'pointerup');
|
|
4631
|
+
}
|
|
4632
|
+
};
|
|
4633
|
+
const onClickCapture = (event) => {
|
|
4634
|
+
// `detail === 0` is a keyboard activation, which is never the tail of a drag.
|
|
4635
|
+
if (suppressHandleClick && event.detail > 0 && getSwipeHandle()?.contains(event.target)) {
|
|
4636
|
+
suppressHandleClick = false;
|
|
4637
|
+
event.preventDefault();
|
|
4638
|
+
event.stopPropagation();
|
|
4639
|
+
}
|
|
4640
|
+
};
|
|
4641
|
+
const onScroll = () => {
|
|
4642
|
+
lastScrollTime = performance.now();
|
|
4643
|
+
};
|
|
4644
|
+
const detachListeners = () => {
|
|
4645
|
+
listeners?.abort.abort();
|
|
4646
|
+
listeners = undefined;
|
|
4647
|
+
resetGesture();
|
|
4648
|
+
};
|
|
4649
|
+
const syncListeners = () => {
|
|
4650
|
+
const dialog = getDialog();
|
|
4651
|
+
const sheet = getSheet();
|
|
4652
|
+
const handle = getSwipeHandle();
|
|
4653
|
+
if (!(isOpen() && hasSwipeHandle() && dialog && sheet && handle)) {
|
|
4654
|
+
// Disabling the feature while open must not leave the sheet displaced. The glide-out styles of a closed sheet stay.
|
|
4655
|
+
if (isOpen() && (isDragging || pendingSwipeDismiss)) {
|
|
4656
|
+
cancelAnimationFrame(vetoFrame);
|
|
4657
|
+
pendingSwipeDismiss = false;
|
|
4658
|
+
recoverSwipeStyles();
|
|
4659
|
+
}
|
|
4660
|
+
detachListeners();
|
|
4661
|
+
return;
|
|
4662
|
+
}
|
|
4663
|
+
if (listeners?.dialog === dialog && listeners.sheet === sheet && listeners.handle === handle) {
|
|
4664
|
+
return;
|
|
4665
|
+
}
|
|
4666
|
+
detachListeners();
|
|
4667
|
+
const abort = new AbortController();
|
|
4668
|
+
const { signal } = abort;
|
|
4669
|
+
sheet.addEventListener('touchstart', onTouchStart, { passive: true, signal });
|
|
4670
|
+
sheet.addEventListener('touchmove', onTouchMove, { passive: false, signal });
|
|
4671
|
+
sheet.addEventListener('touchend', onTouchEnd, { passive: true, signal });
|
|
4672
|
+
sheet.addEventListener('touchcancel', onTouchEnd, { passive: true, signal });
|
|
4673
|
+
sheet.addEventListener('click', onClickCapture, { capture: true, signal });
|
|
4674
|
+
handle.addEventListener('pointerdown', onHandlePointerDown, { signal });
|
|
4675
|
+
handle.addEventListener('pointermove', onHandlePointerMove, { signal });
|
|
4676
|
+
handle.addEventListener('pointerup', onHandlePointerEnd, { signal });
|
|
4677
|
+
handle.addEventListener('pointercancel', onHandlePointerEnd, { signal });
|
|
4678
|
+
handle.addEventListener('lostpointercapture', onHandlePointerEnd, { signal });
|
|
4679
|
+
dialog.addEventListener('scroll', onScroll, { capture: true, passive: true, signal });
|
|
4680
|
+
listeners = { dialog, sheet, handle, abort };
|
|
4681
|
+
};
|
|
4682
|
+
const sync = () => {
|
|
4683
|
+
const open = isOpen();
|
|
4684
|
+
if (open !== wasOpen) {
|
|
4685
|
+
isRecovering = false;
|
|
4686
|
+
}
|
|
4687
|
+
if (open && !wasOpen) {
|
|
4688
|
+
pendingSwipeDismiss = false;
|
|
4689
|
+
endGlideOut();
|
|
4690
|
+
clearSwipeStyles();
|
|
4691
|
+
}
|
|
4692
|
+
else if (!open && wasOpen) {
|
|
4693
|
+
cancelAnimationFrame(vetoFrame);
|
|
4694
|
+
clearSwipeStyles();
|
|
4695
|
+
// Swipe dismiss glides out from the drag position. Any other close (e.g. Escape mid-drag) runs the standard
|
|
4696
|
+
// transition so `motionHiddenEnd` fires.
|
|
4697
|
+
const sheet = getSheet();
|
|
4698
|
+
if (pendingSwipeDismiss && sheet) {
|
|
4699
|
+
glideOutSheet(sheet);
|
|
4700
|
+
}
|
|
4701
|
+
pendingSwipeDismiss = false;
|
|
4702
|
+
}
|
|
4703
|
+
wasOpen = open;
|
|
4704
|
+
syncListeners();
|
|
4705
|
+
};
|
|
4706
|
+
const destroy = () => {
|
|
4707
|
+
detachListeners();
|
|
4708
|
+
endGlideOut();
|
|
4709
|
+
clearSwipeStyles();
|
|
4710
|
+
cancelAnimationFrame(vetoFrame);
|
|
4711
|
+
pendingSwipeDismiss = false;
|
|
4712
|
+
suppressHandleClick = false;
|
|
4713
|
+
isRecovering = false;
|
|
4714
|
+
wasOpen = false;
|
|
4715
|
+
};
|
|
4716
|
+
const consumeRecoveryTransition = (event) => {
|
|
4717
|
+
if (isRecovering && event.target === getDialog() && event.propertyName === 'background-color') {
|
|
4718
|
+
isRecovering = false;
|
|
4719
|
+
return true;
|
|
4720
|
+
}
|
|
4721
|
+
return false;
|
|
4722
|
+
};
|
|
4723
|
+
return { sync, destroy, consumeRecoveryTransition };
|
|
4724
|
+
};
|
|
4321
4725
|
const isStateCompleteOrWarning = (state) => {
|
|
4322
4726
|
return state === 'complete' || state === 'warning';
|
|
4323
4727
|
};
|
|
@@ -4369,6 +4773,14 @@ exports.AI_TAG_TRANSLATIONS = AI_TAG_TRANSLATIONS;
|
|
|
4369
4773
|
exports.DISPLAY_TAGS = DISPLAY_TAGS;
|
|
4370
4774
|
exports.HEADING_TAGS = HEADING_TAGS;
|
|
4371
4775
|
exports.MARKET_LOCALES = MARKET_LOCALES;
|
|
4776
|
+
exports.SWIPE_DISMISS_DISTANCE_RATIO = SWIPE_DISMISS_DISTANCE_RATIO;
|
|
4777
|
+
exports.SWIPE_DISMISS_MAX_DISTANCE_PX = SWIPE_DISMISS_MAX_DISTANCE_PX;
|
|
4778
|
+
exports.SWIPE_DISMISS_MIN_FLICK_PX = SWIPE_DISMISS_MIN_FLICK_PX;
|
|
4779
|
+
exports.SWIPE_DISMISS_VELOCITY_PX_PER_MS = SWIPE_DISMISS_VELOCITY_PX_PER_MS;
|
|
4780
|
+
exports.SWIPE_MAX_BACKDROP_SCRUB = SWIPE_MAX_BACKDROP_SCRUB;
|
|
4781
|
+
exports.SWIPE_SCROLL_LOCK_MS = SWIPE_SCROLL_LOCK_MS;
|
|
4782
|
+
exports.SWIPE_START_THRESHOLD_PX = SWIPE_START_THRESHOLD_PX;
|
|
4783
|
+
exports.SWIPE_VELOCITY_DECAY_MS = SWIPE_VELOCITY_DECAY_MS;
|
|
4372
4784
|
exports.TEXT_TAGS = TEXT_TAGS;
|
|
4373
4785
|
exports.anchorSlot = anchorSlot;
|
|
4374
4786
|
exports.attributeMutationMap = attributeMutationMap;
|
|
@@ -4378,6 +4790,7 @@ exports.buildFlagUrl = buildFlagUrl;
|
|
|
4378
4790
|
exports.buildIconUrl = buildIconUrl;
|
|
4379
4791
|
exports.createPaginationItems = createPaginationItems;
|
|
4380
4792
|
exports.createRange = createRange;
|
|
4793
|
+
exports.createSheetSwipeController = createSheetSwipeController;
|
|
4381
4794
|
exports.createTopLayerController = createTopLayerController;
|
|
4382
4795
|
exports.crestSize = crestSize;
|
|
4383
4796
|
exports.descriptionId = descriptionId;
|
|
@@ -4406,10 +4819,13 @@ exports.getSanitizedActiveTabIndex = getSanitizedActiveTabIndex;
|
|
|
4406
4819
|
exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
|
|
4407
4820
|
exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
|
|
4408
4821
|
exports.getSvgUrl = getSvgUrl;
|
|
4822
|
+
exports.getSwipeAxis = getSwipeAxis;
|
|
4823
|
+
exports.getSwipeBackdropBackgroundColor = getSwipeBackdropBackgroundColor;
|
|
4409
4824
|
exports.getSwitchButtonAriaAttributes = getSwitchButtonAriaAttributes;
|
|
4410
4825
|
exports.getTextTagType = getTextTagType;
|
|
4411
4826
|
exports.getTotalPages = getTotalPages;
|
|
4412
4827
|
exports.hasDocument = hasDocument;
|
|
4828
|
+
exports.hasExcludedSwipeTarget = hasExcludedSwipeTarget;
|
|
4413
4829
|
exports.hasShowPickerSupport = hasShowPickerSupport;
|
|
4414
4830
|
exports.hasSpecificDirectChildTag = hasSpecificDirectChildTag;
|
|
4415
4831
|
exports.hasVisibleIcon = hasVisibleIcon;
|
|
@@ -4420,6 +4836,7 @@ exports.isDialogBackdropTarget = isDialogBackdropTarget;
|
|
|
4420
4836
|
exports.isDisabledOrLoading = isDisabledOrLoading;
|
|
4421
4837
|
exports.isInfinitePagination = isInfinitePagination;
|
|
4422
4838
|
exports.isListTypeOrdered = isListTypeOrdered;
|
|
4839
|
+
exports.isScrolledToTop = isScrolledToTop;
|
|
4423
4840
|
exports.isSortable = isSortable;
|
|
4424
4841
|
exports.isStateCompleteOrWarning = isStateCompleteOrWarning;
|
|
4425
4842
|
exports.isUrl = isUrl;
|
|
@@ -4434,6 +4851,7 @@ exports.parseJSONAttribute = parseJSONAttribute;
|
|
|
4434
4851
|
exports.parseJSONBoolean = parseJSONBoolean;
|
|
4435
4852
|
exports.resolveAiTagTranslationLanguage = resolveAiTagTranslationLanguage;
|
|
4436
4853
|
exports.setAriaIDREF = setAriaIDREF;
|
|
4854
|
+
exports.shouldDismissBySwipe = shouldDismissBySwipe;
|
|
4437
4855
|
exports.showDialog = showDialog;
|
|
4438
4856
|
exports.supportsConstructableStylesheets = supportsConstructableStylesheets;
|
|
4439
4857
|
exports.supportsNativePopover = supportsNativePopover;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.cjs
CHANGED
|
@@ -7,20 +7,20 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var link = require('../dsr-components/link.cjs');
|
|
9
9
|
|
|
10
|
-
const PLink = /*#__PURE__*/ react.forwardRef(({ aria, compact = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', variant = 'primary', className, children, ...rest }, ref) => {
|
|
10
|
+
const PLink = /*#__PURE__*/ react.forwardRef(({ aria, compact = false, cover = false, download, hideLabel = false, href, icon = 'none', iconSource, rel, target = '_self', variant = 'primary', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-link');
|
|
13
|
-
const propsToSync = [aria, compact, download, hideLabel, href, icon, iconSource, rel, target, variant];
|
|
13
|
+
const propsToSync = [aria, compact, cover, download, hideLabel, href, icon, iconSource, rel, target, variant];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['aria', 'compact', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['aria', 'compact', 'cover', 'download', 'hideLabel', 'href', 'icon', 'iconSource', 'rel', 'target', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
...(!process.browser
|
|
22
22
|
? {
|
|
23
|
-
children: (jsxRuntime.jsx(link.DSRLink, { aria, compact, download, hideLabel, href, icon, iconSource, rel, target, variant, children })),
|
|
23
|
+
children: (jsxRuntime.jsx(link.DSRLink, { aria, compact, cover, download, hideLabel, href, icon, iconSource, rel, target, variant, children })),
|
|
24
24
|
}
|
|
25
25
|
: {
|
|
26
26
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.cjs
CHANGED
|
@@ -7,21 +7,21 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var popover = require('../dsr-components/popover.cjs');
|
|
9
9
|
|
|
10
|
-
const PPopover = /*#__PURE__*/ react.forwardRef(({ aria, compact, description, direction = 'bottom', onDismiss, open, className, children, ...rest }, ref) => {
|
|
10
|
+
const PPopover = /*#__PURE__*/ react.forwardRef(({ aria, arrow = true, compact, description, direction = 'bottom', onDismiss, open, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-popover');
|
|
14
|
-
const propsToSync = [aria, compact, description, direction, open];
|
|
14
|
+
const propsToSync = [aria, arrow, compact, description, direction, open];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['aria', 'compact', 'description', 'direction', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['aria', 'arrow', 'compact', 'description', 'direction', 'open'].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: (jsxRuntime.jsx(popover.DSRPopover, { aria, compact, description, direction, open, children })),
|
|
24
|
+
children: (jsxRuntime.jsx(popover.DSRPopover, { aria, arrow, compact, description, direction, open, children })),
|
|
25
25
|
}
|
|
26
26
|
: {
|
|
27
27
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/sheet.wrapper.cjs
CHANGED
|
@@ -7,23 +7,23 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var sheet = require('../dsr-components/sheet.cjs');
|
|
9
9
|
|
|
10
|
-
const PSheet = /*#__PURE__*/ react.forwardRef(({ aria, background = 'canvas', disableBackdropClick = false, dismissButton = true, onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, className, children, ...rest }, ref) => {
|
|
10
|
+
const PSheet = /*#__PURE__*/ react.forwardRef(({ aria, background = 'canvas', disableBackdropClick = false, dismissButton = true, onDismiss, onMotionHiddenEnd, onMotionVisibleEnd, open = false, swipeHandle = false, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'motionHiddenEnd', onMotionHiddenEnd);
|
|
14
14
|
hooks.useEventCallback(elementRef, 'motionVisibleEnd', onMotionVisibleEnd);
|
|
15
15
|
const WebComponentTag = hooks.usePrefix('p-sheet');
|
|
16
|
-
const propsToSync = [aria, background, disableBackdropClick, dismissButton, open];
|
|
16
|
+
const propsToSync = [aria, background, disableBackdropClick, dismissButton, open, swipeHandle];
|
|
17
17
|
hooks.useBrowserLayoutEffect(() => {
|
|
18
18
|
const { current } = elementRef;
|
|
19
|
-
['aria', 'background', 'disableBackdropClick', 'dismissButton', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
|
+
['aria', 'background', 'disableBackdropClick', 'dismissButton', 'open', 'swipeHandle'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
20
20
|
}, propsToSync);
|
|
21
21
|
const props = {
|
|
22
22
|
...rest,
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
...(!process.browser
|
|
25
25
|
? {
|
|
26
|
-
children: (jsxRuntime.jsx(sheet.DSRSheet, { aria, background, disableBackdropClick, dismissButton, open, children })),
|
|
26
|
+
children: (jsxRuntime.jsx(sheet.DSRSheet, { aria, background, disableBackdropClick, dismissButton, open, swipeHandle, children })),
|
|
27
27
|
}
|
|
28
28
|
: {
|
|
29
29
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
17
17
|
*/
|
|
18
18
|
class DSRAccordion extends react.Component {
|
|
19
19
|
host;
|
|
20
|
+
summary;
|
|
20
21
|
hasSummary;
|
|
21
22
|
hasSummaryBefore;
|
|
22
23
|
hasSummaryAfter;
|
|
@@ -27,7 +28,7 @@ class DSRAccordion extends react.Component {
|
|
|
27
28
|
const hasSummaryAfter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'summary-after').length > 0;
|
|
28
29
|
const Heading = this.props.headingTag;
|
|
29
30
|
const style = getCachedMinifiedCss.getCachedMinifiedCss(stylesEntry.getAccordionCss, this.props.alignMarker, this.props.background, this.props.compact, this.props.indent, this.props.open, this.props.sticky, hasSummaryBefore, hasSummaryAfter, this.props.size);
|
|
30
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true",
|
|
31
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("details", { ...(this.props.open ? { open: true } : {}), children: [jsxRuntime.jsx("summary", { children: hasSummary ? jsxRuntime.jsx("slot", { name: "summary" }) : jsxRuntime.jsx(Heading, { children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }) }), hasSummaryBefore && jsxRuntime.jsx("slot", { name: "summary-before" }), hasSummaryAfter && jsxRuntime.jsx("slot", { name: "summary-after" }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("slot", {}) })] })] }), this.props.children] }));
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var fcDismissButton = require('./fc-dismiss-button.cjs');
|
|
5
5
|
|
|
6
|
-
const DialogBase = ({ children, inert, containerClass, ariaAttributes, dismissable = false, header, footer, subFooter, }) => {
|
|
7
|
-
return (jsxRuntime.jsx("dialog", { inert: inert, tabIndex: -1, ...(ariaAttributes ?? {}), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: containerClass, children: [dismissable && jsxRuntime.jsx(fcDismissButton.FCDismissButton, { label: `Dismiss ${containerClass}` }), header, children, footer, subFooter] }) }) }));
|
|
6
|
+
const DialogBase = ({ children, inert, containerClass, ariaAttributes, dismissable = false, swipeHandle, header, footer, subFooter, }) => {
|
|
7
|
+
return (jsxRuntime.jsx("dialog", { inert: inert, tabIndex: -1, ...(ariaAttributes ?? {}), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: containerClass, children: [swipeHandle, dismissable && jsxRuntime.jsx(fcDismissButton.FCDismissButton, { label: `Dismiss ${containerClass}` }), header, children, footer, subFooter] }) }) }));
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
exports.DialogBase = DialogBase;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs
CHANGED
|
@@ -17,7 +17,7 @@ id, label: label$1, description, loading, initialLoading, required, disabled, st
|
|
|
17
17
|
// onWheel,
|
|
18
18
|
// onChange,
|
|
19
19
|
// onBlur,
|
|
20
|
-
//
|
|
20
|
+
// onKeyPress,
|
|
21
21
|
// refElement,
|
|
22
22
|
start, end, aria, }) => {
|
|
23
23
|
const { namedSlotChildren } = splitChildren.splitChildren(children);
|
|
@@ -17,14 +17,16 @@ class DSRLink extends react.Component {
|
|
|
17
17
|
render() {
|
|
18
18
|
splitChildren.splitChildren(this.props.children);
|
|
19
19
|
const TagType = this.props.href === undefined ? 'span' : 'a';
|
|
20
|
-
const
|
|
20
|
+
const icon = utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" }));
|
|
21
|
+
const label = (jsxRuntime.jsx("span", { className: "label", children: jsxRuntime.jsx("slot", {}) }));
|
|
22
|
+
const style = getCachedMinifiedCss.getCachedMinifiedCss(stylesEntry.getLinkCss, this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.href === undefined, this.props.compact, this.props.cover);
|
|
21
23
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
|
|
22
24
|
href: this.props.href,
|
|
23
25
|
target: this.props.target,
|
|
24
26
|
download: this.props.download,
|
|
25
27
|
rel: this.props.rel,
|
|
26
28
|
...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
|
|
27
|
-
}), children: [
|
|
29
|
+
}), children: [this.props.cover && jsxRuntime.jsx("span", { className: "backdrop" }), this.props.cover ? (jsxRuntime.jsxs("span", { className: "content", children: [icon, label] })) : (icon), !this.props.cover && label] })] }), this.props.children] }));
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.cjs
CHANGED
|
@@ -80,7 +80,7 @@ class DSRPopover extends react.Component {
|
|
|
80
80
|
const hasSlottedButton = namedSlotChildren.filter(({ props: { slot } }) => slot === 'button').length > 0;
|
|
81
81
|
const id = 'popover';
|
|
82
82
|
const style = getCachedMinifiedCss.getCachedMinifiedCss(getPopoverTriggerCss, this.props.effectiveOpen, this.props.compact, this.props.isInitialRender);
|
|
83
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasSlottedButton ? (jsxRuntime.jsx("slot", { name: "button" })) : (jsxRuntime.jsx("button", { type: "button", "aria-label": "More information", "aria-details": id, ...utilsEntry.parseAndGetAriaAttributes(this.props.aria), "aria-expanded": this.props.effectiveOpen ? 'true' : 'false' })), jsxRuntime.jsxs("div", { id: id, popover: "manual", inert: !this.props.effectiveOpen, children: [jsxRuntime.jsx("div", { className: "arrow" }), this.props.description ? jsxRuntime.jsx("p", { children: this.props.description }) : jsxRuntime.jsx("slot", {})] })] })] }), this.props.children] }));
|
|
83
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootclonable: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasSlottedButton ? (jsxRuntime.jsx("slot", { name: "button" })) : (jsxRuntime.jsx("button", { type: "button", "aria-label": "More information", "aria-details": id, ...utilsEntry.parseAndGetAriaAttributes(this.props.aria), "aria-expanded": this.props.effectiveOpen ? 'true' : 'false' })), jsxRuntime.jsxs("div", { id: id, popover: "manual", inert: !this.props.effectiveOpen, children: [this.props.arrow && jsxRuntime.jsx("div", { className: "arrow" }), this.props.description ? jsxRuntime.jsx("p", { children: this.props.description }) : jsxRuntime.jsx("slot", {})] })] })] }), this.props.children] }));
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
// module-level, because getCachedMinifiedCss() caches per function reference
|