@porsche-design-system/components-react 4.1.0 → 4.2.0-rc.1

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.
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ require('react');
5
+ require('../../provider.cjs');
6
+ var button_wrapper = require('../components/button.wrapper.cjs');
7
+
8
+ const DialogBase = ({ children,
9
+ // host,
10
+ inert, containerClass, ariaAttributes, dismissable = false, header, footer, subFooter, }) => {
11
+ 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(button_wrapper.PButton, { className: "dismiss", variant: "secondary", compact: true, type: "button", hideLabel: true, icon: "close", children: `Dismiss ${containerClass}` })), header, children, footer, subFooter] }) }) }));
12
+ };
13
+
14
+ exports.DialogBase = DialogBase;
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var react = require('react');
5
- require('../../provider.cjs');
6
4
  var splitChildren = require('../../splitChildren.cjs');
5
+ var react = require('react');
7
6
  var minifyCss = require('../../minifyCss.cjs');
8
7
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
8
  var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
- var button_wrapper = require('../components/button.wrapper.cjs');
9
+ var dialogBase = require('./dialog-base.cjs');
11
10
 
12
11
  /**
13
12
  * @slot {"name": "header", "description": "Renders a sticky header section above the content area." }
@@ -32,11 +31,11 @@ class DSRFlyout extends react.Component {
32
31
  const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
33
32
  const hasSubFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sub-footer').length > 0;
34
33
  const style = minifyCss.minifyCss(stylesEntry.getFlyoutCss(this.props.open, this.props.background, this.props.backdrop, this.props.position, hasHeader, hasFooter, hasSubFooter, this.props.footerBehavior));
35
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("dialog", { tabIndex: -1, ...utilsEntry.parseAndGetAriaAttributes({
34
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(dialogBase.DialogBase, { host: null, dismissable: true, containerClass: "flyout", header: hasHeader ? jsxRuntime.jsx("slot", { name: "header" }) : undefined, footer: hasFooter ? jsxRuntime.jsx("slot", { name: "footer" }) : undefined, subFooter: hasSubFooter ? jsxRuntime.jsx("slot", { name: "sub-footer" }) : undefined, ariaAttributes: utilsEntry.parseAndGetAriaAttributes({
36
35
  'aria-modal': true,
37
36
  ...{ 'aria-label': hasHeader ? namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children : 'Flyout' },
38
37
  ...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
39
- }), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: "flyout", children: [jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss", variant: "secondary", compact: true, type: "button", hideLabel: true, icon: "close", children: "Dismiss flyout" }), hasHeader && jsxRuntime.jsx("slot", { name: "header" }), jsxRuntime.jsx("slot", {}), hasFooter && jsxRuntime.jsx("slot", { name: "footer" }), hasSubFooter && jsxRuntime.jsx("slot", { name: "sub-footer" })] }) }) })] }), this.props.children] }));
38
+ }), children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
40
39
  }
41
40
  }
42
41
 
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var react = require('react');
5
- require('../../provider.cjs');
6
4
  var splitChildren = require('../../splitChildren.cjs');
5
+ var react = require('react');
7
6
  var minifyCss = require('../../minifyCss.cjs');
8
7
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
8
  var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
- var button_wrapper = require('../components/button.wrapper.cjs');
9
+ var dialogBase = require('./dialog-base.cjs');
11
10
 
12
11
  /**
13
12
  * @slot {"name": "header", "description": "Renders a header section above the content area." }
@@ -30,11 +29,11 @@ class DSRModal extends react.Component {
30
29
  this.props.disableCloseButton ? false : this.props.dismissButton;
31
30
  // TODO: why do we validate only when opened?
32
31
  const style = minifyCss.minifyCss(stylesEntry.getModalCss(this.props.open, this.props.background, this.props.backdrop, this.props.fullscreen, this.props.dismissButton, hasHeader, hasFooter));
33
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("dialog", { inert: !this.props.open, tabIndex: -1, ...utilsEntry.parseAndGetAriaAttributes({
32
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(dialogBase.DialogBase, { host: null, inert: !this.props.open, dismissable: this.props.dismissButton ?? undefined, containerClass: "modal", header: hasHeader ? jsxRuntime.jsx("slot", { name: "header" }) : undefined, footer: hasFooter ? jsxRuntime.jsx("slot", { name: "footer" }) : undefined, ariaAttributes: utilsEntry.parseAndGetAriaAttributes({
34
33
  'aria-modal': true,
35
34
  ...(hasHeader && { 'aria-label': this.props.ariaLabel }),
36
35
  ...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
37
- }), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: "modal", children: [this.props.dismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss", variant: "secondary", compact: true, type: "button", hideLabel: true, icon: "close", children: "Dismiss modal" })), hasHeader && jsxRuntime.jsx("slot", { name: "header" }), jsxRuntime.jsx("slot", {}), hasFooter && jsxRuntime.jsx("slot", { name: "footer" })] }) }) })] }), this.props.children] }));
36
+ }), children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
38
37
  }
39
38
  }
40
39
 
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var react = require('react');
5
- require('../../provider.cjs');
6
4
  var splitChildren = require('../../splitChildren.cjs');
5
+ var react = require('react');
7
6
  var minifyCss = require('../../minifyCss.cjs');
8
7
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
8
  var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
- var button_wrapper = require('../components/button.wrapper.cjs');
9
+ var dialogBase = require('./dialog-base.cjs');
11
10
 
12
11
  /**
13
12
  * @slot {"name": "header", "description": "Renders a header section above the content area." }
@@ -25,13 +24,13 @@ class DSRSheet extends react.Component {
25
24
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
26
25
  if (this.props.open) ;
27
26
  const style = minifyCss.minifyCss(stylesEntry.getSheetCss(this.props.open, this.props.background, this.props.dismissButton));
28
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("dialog", { inert: !this.props.open, tabIndex: -1, ...utilsEntry.parseAndGetAriaAttributes({
27
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(dialogBase.DialogBase, { host: null, inert: !this.props.open, dismissable: this.props.dismissButton ?? undefined, containerClass: "sheet", header: hasHeader ? jsxRuntime.jsx("slot", { name: "header" }) : undefined, ariaAttributes: utilsEntry.parseAndGetAriaAttributes({
29
28
  'aria-modal': true,
30
29
  ...(hasHeader && {
31
30
  'aria-label': namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0 && namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children,
32
31
  }),
33
32
  ...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
34
- }), children: jsxRuntime.jsx("div", { className: "scroller", children: jsxRuntime.jsxs("div", { className: "sheet", children: [this.props.dismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss", variant: "secondary", compact: true, type: "button", hideLabel: true, icon: "close", children: "Dismiss sheet" })), hasHeader && jsxRuntime.jsx("slot", { name: "header" }), jsxRuntime.jsx("slot", {})] }) }) })] }), this.props.children] }));
33
+ }), children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
35
34
  }
36
35
  }
37
36
 
@@ -3773,7 +3773,7 @@ const OPTION_LIST_SAFE_ZONE = 6;
3773
3773
 
3774
3774
  const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
3775
3775
 
3776
- const prefix = `[Porsche Design System v${"4.1.0"}]` // this part isn't covered by unit tests
3776
+ const prefix = `[Porsche Design System v${"4.2.0-rc.1"}]` // this part isn't covered by unit tests
3777
3777
  ;
3778
3778
  const consoleError = (...messages) => {
3779
3779
  console.error(prefix, ...messages);
@@ -5877,6 +5877,211 @@ const getComponentCss$12 = (hideLabel, state, isDisabled, isLoading, isCompact)
5877
5877
  ...getFunctionalComponentLoadingMessageStyles(),
5878
5878
  });
5879
5879
  };
5880
+ const cssVarBackgroundColor = '--_p-dialog-a';
5881
+ const dialogHostJssStyle = (background) => {
5882
+ return {
5883
+ '--pds-internal-grid-outer-column': `calc(${spacingFluidLg} - ${gridGap})`,
5884
+ '--pds-internal-grid-margin': `calc(${spacingFluidLg} * -1)`,
5885
+ '--pds-internal-grid-width-min': 'auto',
5886
+ '--pds-internal-grid-width-max': 'none',
5887
+ [cssVarBackgroundColor]: background === 'surface' ? colorSurface : colorCanvas,
5888
+ };
5889
+ };
5890
+ const getFunctionalComponentDialogBaseStyles = (isVisible, backdrop = 'blur') => {
5891
+ return {
5892
+ dialog: {
5893
+ ...dialogBackdropResetJssStyle,
5894
+ ...getDialogBackdropTransitionJssStyle(isVisible, backdrop),
5895
+ },
5896
+ };
5897
+ };
5898
+ const dialogBackdropResetJssStyle = {
5899
+ position: 'fixed', // ua-style
5900
+ inset: 0, // ua-style
5901
+ margin: 0, // ua-style
5902
+ padding: 0, // ua-style
5903
+ border: 0, // ua-style
5904
+ width: '100dvw', // ua-style
5905
+ height: '100dvh', // ua-style
5906
+ maxWidth: '100dvw', // ua-style
5907
+ maxHeight: '100dvh', // ua-style
5908
+ overflow: 'hidden', // ua-style
5909
+ display: 'block', // ua-style
5910
+ outline: 0, // ua-style (we always expect a focusable element to be within the dialog)
5911
+ '&::backdrop': {
5912
+ display: 'none', // ua-style (we can't use it atm because it's not animatable in all browsers)
5913
+ },
5914
+ };
5915
+ const getDialogBackdropTransitionJssStyle = (isVisible, backdrop = 'blur') => {
5916
+ const isBackdropBlur = backdrop === 'blur';
5917
+ const duration = isVisible ? 'long' : 'moderate';
5918
+ const easing = isVisible ? 'in' : 'out';
5919
+ // as soon as all browsers are supporting `allow-discrete`, visibility transition shouldn't be necessary anymore
5920
+ const transition = `visibility 0s linear var(${cssVariableTransitionDuration}, ${isVisible ? '0s' : motionDurationMap[duration]}), ${getTransition('background-color', duration, easing)}, ${getTransition('-webkit-backdrop-filter', duration, easing)}, ${getTransition('backdrop-filter', duration, easing)}`;
5921
+ return {
5922
+ zIndex: 9999999, // fallback for fade out stacking until `overlay` + `allow-discrete` is supported in all browsers. It tries to mimic #top-layer positioning hierarchy.
5923
+ ...(isVisible
5924
+ ? {
5925
+ visibility: 'inherit',
5926
+ pointerEvents: 'auto',
5927
+ background: colorBackdrop,
5928
+ ...(isBackdropBlur && {
5929
+ WebkitBackdropFilter: blurFrosted,
5930
+ backdropFilter: blurFrosted,
5931
+ }),
5932
+ }
5933
+ : {
5934
+ visibility: 'hidden', // element shall not be tabbable with keyboard after fade out transition has finished
5935
+ pointerEvents: 'none', // element can't be interacted with mouse
5936
+ background: 'transparent',
5937
+ }),
5938
+ transition,
5939
+ // `allow-discrete` transition for ua-style `overlay` (supported browsers only) ensures dialog is rendered on
5940
+ // #top-layer as long as fade-in or fade-out transition/animation is running
5941
+ '@supports (transition-behavior: allow-discrete)': {
5942
+ transition: `${transition}, ${getTransition('overlay', duration, easing)} allow-discrete`,
5943
+ },
5944
+ };
5945
+ };
5946
+ const getScrollerJssStyle = (position) => {
5947
+ // ensures scrollbar color is set correctly (e.g. when scrollbar is shown on backdrop, on flyout/modal surface or with Auto Dark Mode)
5948
+ const backgroundLight = 'rgba(255,255,255,.01)';
5949
+ const backgroundDark = 'rgba(0,0,0,.01)';
5950
+ const background = {
5951
+ light: backgroundLight,
5952
+ dark: backgroundDark,
5953
+ auto: backgroundLight,
5954
+ };
5955
+ return {
5956
+ position: 'absolute',
5957
+ isolation: 'isolate', // creates new stacking context to show scrollbars on top of header/footer areas (on iOS/iPadOS)
5958
+ display: 'grid',
5959
+ ...(position === 'fullscreen'
5960
+ ? {
5961
+ inset: 0,
5962
+ }
5963
+ : {
5964
+ insetBlock: 0,
5965
+ [position === 'start' ? 'insetInlineStart' : 'insetInlineEnd']: 0,
5966
+ }),
5967
+ overflow: 'hidden auto',
5968
+ overscrollBehaviorY: 'none',
5969
+ // TODO: check if smooth scrolling on iOS is given?
5970
+ background: background.light,
5971
+ };
5972
+ };
5973
+ const dialogBorderRadius = `var(${legacyRadiusLarge}, ${radiusXl})`;
5974
+ const dialogPaddingTop = spacingFluidMd$1;
5975
+ const dialogPaddingBottom = `calc(${spacingFluidSm} + ${spacingFluidMd$1})`;
5976
+ const dialogPaddingInline = spacingFluidLg;
5977
+ const dialogGridJssStyle = () => {
5978
+ return {
5979
+ position: 'relative',
5980
+ display: 'grid',
5981
+ gridTemplate: `auto/${spacingFluidSm} minmax(0,1fr) ${spacingFluidSm}`,
5982
+ gap: `${spacingFluidMd$1} calc(${spacingFluidLg} - ${spacingFluidSm})`,
5983
+ paddingTop: dialogPaddingTop,
5984
+ paddingBottom: dialogPaddingBottom,
5985
+ alignContent: 'flex-start',
5986
+ };
5987
+ };
5988
+ const getDialogColorJssStyle = () => {
5989
+ return {
5990
+ color: colorPrimary, // enables color inheritance for slots
5991
+ background: `var(${cssVarBackgroundColor})`,
5992
+ };
5993
+ };
5994
+ const getDialogTransitionJssStyle = (isVisible, slideIn) => {
5995
+ const duration = isVisible ? 'moderate' : 'short';
5996
+ const easing = isVisible ? 'in' : 'out';
5997
+ return {
5998
+ // transition offset relies vertically on viewport (vh) because the dialog height can be infinite, while horizontally
5999
+ // it relies on the dialog width (%) which has a max-width
6000
+ ...(isVisible
6001
+ ? {
6002
+ opacity: 1,
6003
+ transform: 'initial',
6004
+ }
6005
+ : {
6006
+ opacity: 0,
6007
+ transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '-' : ''}100%)`,
6008
+ '&:dir(rtl)': {
6009
+ transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '' : '-'}100%)`,
6010
+ },
6011
+ }),
6012
+ transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
6013
+ };
6014
+ };
6015
+ const getDialogDismissButtonJssStyle = () => {
6016
+ return {
6017
+ gridArea: '1/3',
6018
+ zIndex: 5, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
6019
+ position: 'sticky',
6020
+ top: spacingFluidSm,
6021
+ marginTop: `calc(-1 * ${dialogPaddingTop} + ${spacingFluidSm})`,
6022
+ marginInlineEnd: spacingFluidSm,
6023
+ placeSelf: 'flex-start flex-end',
6024
+ boxShadow: `0px 0px 30px hsla(from var(${cssVarBackgroundColor}) h s l / 0.35)`,
6025
+ };
6026
+ };
6027
+ const getSlotJssStyle = () => {
6028
+ return {
6029
+ display: 'block',
6030
+ '&:first-of-type': {
6031
+ gridRowStart: 1,
6032
+ },
6033
+ };
6034
+ };
6035
+ const getSlotHeaderJssStyle = () => {
6036
+ const paddingTop = dialogPaddingTop;
6037
+ const paddingBottom = spacingStaticMd;
6038
+ return {
6039
+ gridColumn: '1/-1',
6040
+ zIndex: 1, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
6041
+ position: 'sticky',
6042
+ top: 0, // necessary for `IntersectionObserver` to detect if sticky element is stuck or not. Float value is used, so that sticky area isn't moved out visually by e.g. 1px when container gets scrolled.
6043
+ marginBlock: `calc(-1 * ${paddingTop}) calc(-1 * ${paddingBottom})`,
6044
+ padding: `${paddingTop} ${dialogPaddingInline} ${paddingBottom}`,
6045
+ background: `linear-gradient(180deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 80%,transparent 100%)`,
6046
+ };
6047
+ };
6048
+ const getSlotMainJssStyle = () => {
6049
+ return {
6050
+ gridColumn: '2/3',
6051
+ zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
6052
+ };
6053
+ };
6054
+ const getSlotFooterJssStyle = () => {
6055
+ const paddingBlock = `calc(${dialogPaddingBottom} - ${dialogBorderRadius})`;
6056
+ const offset = `calc(${paddingBlock} / 2)`;
6057
+ return {
6058
+ gridColumn: '1/-1',
6059
+ zIndex: 2, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
6060
+ position: 'sticky',
6061
+ bottom: '-.1px', // necessary for `IntersectionObserver` to detect if sticky element is stuck or not. Float value is used, so that sticky area isn't moved out visually by e.g. 1px when container gets scrolled.
6062
+ marginBlock: `calc(-1 * ${paddingBlock})`,
6063
+ padding: `${paddingBlock} ${dialogPaddingInline}`,
6064
+ background: `linear-gradient(0deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 20%,transparent 80%)`,
6065
+ '&[data-stuck]::after': {
6066
+ content: '""',
6067
+ zIndex: -1,
6068
+ position: 'absolute',
6069
+ inset: `calc(${paddingBlock} - ${offset}) calc(${dialogPaddingInline} - ${offset})`,
6070
+ background: colorFrosted,
6071
+ borderRadius: radius3Xl,
6072
+ WebkitBackdropFilter: blurFrosted,
6073
+ backdropFilter: blurFrosted,
6074
+ },
6075
+ };
6076
+ };
6077
+ const getSlotSubFooterJssStyle = () => {
6078
+ return {
6079
+ gridColumn: '1/-1',
6080
+ zIndex: 3, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
6081
+ paddingInline: dialogPaddingInline,
6082
+ backgroundColor: `var(${cssVarBackgroundColor})`,
6083
+ };
6084
+ };
5880
6085
 
5881
6086
  /**
5882
6087
  * @css-variable {"name": "--ref-p-input-slotted-padding", "description": "When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly."}
@@ -6896,210 +7101,6 @@ const getComponentCss$W = (size) => {
6896
7101
  });
6897
7102
  };
6898
7103
 
6899
- const cssVarBackgroundColor = '--_p-dialog-a';
6900
- const dialogHostJssStyle = (background) => {
6901
- return {
6902
- '--pds-internal-grid-outer-column': `calc(${spacingFluidLg} - ${gridGap})`,
6903
- '--pds-internal-grid-margin': `calc(${spacingFluidLg} * -1)`,
6904
- '--pds-internal-grid-width-min': 'auto',
6905
- '--pds-internal-grid-width-max': 'none',
6906
- [cssVarBackgroundColor]: background === 'surface' ? colorSurface : colorCanvas,
6907
- };
6908
- };
6909
- const getDialogJssStyle = (isVisible, backdrop = 'blur') => {
6910
- return {
6911
- ...dialogBackdropResetJssStyle,
6912
- ...getDialogBackdropTransitionJssStyle(isVisible, backdrop),
6913
- };
6914
- };
6915
- const dialogBackdropResetJssStyle = {
6916
- position: 'fixed', // ua-style
6917
- inset: 0, // ua-style
6918
- margin: 0, // ua-style
6919
- padding: 0, // ua-style
6920
- border: 0, // ua-style
6921
- width: '100dvw', // ua-style
6922
- height: '100dvh', // ua-style
6923
- maxWidth: '100dvw', // ua-style
6924
- maxHeight: '100dvh', // ua-style
6925
- overflow: 'hidden', // ua-style
6926
- display: 'block', // ua-style
6927
- outline: 0, // ua-style (we always expect a focusable element to be within the dialog)
6928
- '&::backdrop': {
6929
- display: 'none', // ua-style (we can't use it atm because it's not animatable in all browsers)
6930
- },
6931
- };
6932
- const getDialogBackdropTransitionJssStyle = (isVisible, backdrop = 'blur') => {
6933
- const isBackdropBlur = backdrop === 'blur';
6934
- const duration = isVisible ? 'long' : 'moderate';
6935
- const easing = isVisible ? 'in' : 'out';
6936
- // as soon as all browsers are supporting `allow-discrete`, visibility transition shouldn't be necessary anymore
6937
- const transition = `visibility 0s linear var(${cssVariableTransitionDuration}, ${isVisible ? '0s' : motionDurationMap[duration]}), ${getTransition('background-color', duration, easing)}, ${getTransition('-webkit-backdrop-filter', duration, easing)}, ${getTransition('backdrop-filter', duration, easing)}`;
6938
- return {
6939
- zIndex: 9999999, // fallback for fade out stacking until `overlay` + `allow-discrete` is supported in all browsers. It tries to mimic #top-layer positioning hierarchy.
6940
- ...(isVisible
6941
- ? {
6942
- visibility: 'inherit',
6943
- pointerEvents: 'auto',
6944
- background: colorBackdrop,
6945
- ...(isBackdropBlur && {
6946
- WebkitBackdropFilter: blurFrosted,
6947
- backdropFilter: blurFrosted,
6948
- }),
6949
- }
6950
- : {
6951
- visibility: 'hidden', // element shall not be tabbable with keyboard after fade out transition has finished
6952
- pointerEvents: 'none', // element can't be interacted with mouse
6953
- background: 'transparent',
6954
- }),
6955
- transition,
6956
- // `allow-discrete` transition for ua-style `overlay` (supported browsers only) ensures dialog is rendered on
6957
- // #top-layer as long as fade-in or fade-out transition/animation is running
6958
- '@supports (transition-behavior: allow-discrete)': {
6959
- transition: `${transition}, ${getTransition('overlay', duration, easing)} allow-discrete`,
6960
- },
6961
- };
6962
- };
6963
- const getScrollerJssStyle = (position) => {
6964
- // ensures scrollbar color is set correctly (e.g. when scrollbar is shown on backdrop, on flyout/modal surface or with Auto Dark Mode)
6965
- const backgroundLight = 'rgba(255,255,255,.01)';
6966
- const backgroundDark = 'rgba(0,0,0,.01)';
6967
- const background = {
6968
- light: backgroundLight,
6969
- dark: backgroundDark,
6970
- auto: backgroundLight,
6971
- };
6972
- return {
6973
- position: 'absolute',
6974
- isolation: 'isolate', // creates new stacking context to show scrollbars on top of header/footer areas (on iOS/iPadOS)
6975
- display: 'grid',
6976
- ...(position === 'fullscreen'
6977
- ? {
6978
- inset: 0,
6979
- }
6980
- : {
6981
- insetBlock: 0,
6982
- [position === 'start' ? 'insetInlineStart' : 'insetInlineEnd']: 0,
6983
- }),
6984
- overflow: 'hidden auto',
6985
- overscrollBehaviorY: 'none',
6986
- // TODO: check if smooth scrolling on iOS is given?
6987
- background: background.light,
6988
- };
6989
- };
6990
- const dialogBorderRadius = `var(${legacyRadiusLarge}, ${radiusXl})`;
6991
- const dialogPaddingTop = spacingFluidMd$1;
6992
- const dialogPaddingBottom = `calc(${spacingFluidSm} + ${spacingFluidMd$1})`;
6993
- const dialogPaddingInline = spacingFluidLg;
6994
- const dialogGridJssStyle = () => {
6995
- return {
6996
- position: 'relative',
6997
- display: 'grid',
6998
- gridTemplate: `auto/${spacingFluidSm} minmax(0,1fr) ${spacingFluidSm}`,
6999
- gap: `${spacingFluidMd$1} calc(${spacingFluidLg} - ${spacingFluidSm})`,
7000
- paddingTop: dialogPaddingTop,
7001
- paddingBottom: dialogPaddingBottom,
7002
- alignContent: 'flex-start',
7003
- };
7004
- };
7005
- const getDialogColorJssStyle = () => {
7006
- return {
7007
- color: colorPrimary, // enables color inheritance for slots
7008
- background: `var(${cssVarBackgroundColor})`,
7009
- };
7010
- };
7011
- const getDialogTransitionJssStyle = (isVisible, slideIn) => {
7012
- const duration = isVisible ? 'moderate' : 'short';
7013
- const easing = isVisible ? 'in' : 'out';
7014
- return {
7015
- // transition offset relies vertically on viewport (vh) because the dialog height can be infinite, while horizontally
7016
- // it relies on the dialog width (%) which has a max-width
7017
- ...(isVisible
7018
- ? {
7019
- opacity: 1,
7020
- transform: 'initial',
7021
- }
7022
- : {
7023
- opacity: 0,
7024
- transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '-' : ''}100%)`,
7025
- '&:dir(rtl)': {
7026
- transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '' : '-'}100%)`,
7027
- },
7028
- }),
7029
- transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
7030
- };
7031
- };
7032
- const getDialogDismissButtonJssStyle = () => {
7033
- return {
7034
- gridArea: '1/3',
7035
- zIndex: 5, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
7036
- position: 'sticky',
7037
- top: spacingFluidSm,
7038
- marginTop: `calc(-1 * ${dialogPaddingTop} + ${spacingFluidSm})`,
7039
- marginInlineEnd: spacingFluidSm,
7040
- placeSelf: 'flex-start flex-end',
7041
- boxShadow: `0px 0px 30px hsla(from var(${cssVarBackgroundColor}) h s l / 0.35)`
7042
- };
7043
- };
7044
- const getSlotJssStyle = () => {
7045
- return {
7046
- display: 'block',
7047
- '&:first-of-type': {
7048
- gridRowStart: 1,
7049
- },
7050
- };
7051
- };
7052
- const getSlotHeaderJssStyle = () => {
7053
- const paddingTop = dialogPaddingTop;
7054
- const paddingBottom = spacingStaticMd;
7055
- return {
7056
- gridColumn: '1/-1',
7057
- zIndex: 1, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
7058
- position: 'sticky',
7059
- top: 0, // necessary for `IntersectionObserver` to detect if sticky element is stuck or not. Float value is used, so that sticky area isn't moved out visually by e.g. 1px when container gets scrolled.
7060
- marginBlock: `calc(-1 * ${paddingTop}) calc(-1 * ${paddingBottom})`,
7061
- padding: `${paddingTop} ${dialogPaddingInline} ${paddingBottom}`,
7062
- background: `linear-gradient(180deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 80%,transparent 100%)`,
7063
- };
7064
- };
7065
- const getSlotMainJssStyle = () => {
7066
- return {
7067
- gridColumn: '2/3',
7068
- zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
7069
- };
7070
- };
7071
- const getSlotFooterJssStyle = () => {
7072
- const paddingBlock = `calc(${dialogPaddingBottom} - ${dialogBorderRadius})`;
7073
- const offset = `calc(${paddingBlock} / 2)`;
7074
- return {
7075
- gridColumn: '1/-1',
7076
- zIndex: 2, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
7077
- position: 'sticky',
7078
- bottom: '-.1px', // necessary for `IntersectionObserver` to detect if sticky element is stuck or not. Float value is used, so that sticky area isn't moved out visually by e.g. 1px when container gets scrolled.
7079
- marginBlock: `calc(-1 * ${paddingBlock})`,
7080
- padding: `${paddingBlock} ${dialogPaddingInline}`,
7081
- background: `linear-gradient(0deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 20%,transparent 80%)`,
7082
- '&[data-stuck]::after': {
7083
- content: '""',
7084
- zIndex: -1,
7085
- position: 'absolute',
7086
- inset: `calc(${paddingBlock} - ${offset}) calc(${dialogPaddingInline} - ${offset})`,
7087
- background: colorFrosted,
7088
- borderRadius: radius3Xl,
7089
- WebkitBackdropFilter: blurFrosted,
7090
- backdropFilter: blurFrosted,
7091
- },
7092
- };
7093
- };
7094
- const getSlotSubFooterJssStyle = () => {
7095
- return {
7096
- gridColumn: '1/-1',
7097
- zIndex: 3, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
7098
- paddingInline: dialogPaddingInline,
7099
- backgroundColor: `var(${cssVarBackgroundColor})`,
7100
- };
7101
- };
7102
-
7103
7104
  /**
7104
7105
  * @css-variable {"name": "--p-flyout-width", "description": "Width of the flyout.", "defaultValue": "auto"}
7105
7106
  */
@@ -7154,7 +7155,7 @@ const getComponentCss$V = (isOpen, background, backdrop, position, hasHeader, ha
7154
7155
  '&[name=sub-footer]': getSlotSubFooterJssStyle(),
7155
7156
  }),
7156
7157
  },
7157
- dialog: getDialogJssStyle(isOpen, backdrop),
7158
+ ...getFunctionalComponentDialogBaseStyles(isOpen, backdrop),
7158
7159
  },
7159
7160
  scroller: {
7160
7161
  ...getScrollerJssStyle(isPositionStart ? 'start' : 'end'),
@@ -7976,7 +7977,7 @@ const getComponentCss$C = (isOpen, background, backdrop, fullscreen, hasDismissB
7976
7977
  '&[name=footer]': getSlotFooterJssStyle(),
7977
7978
  }),
7978
7979
  },
7979
- dialog: getDialogJssStyle(isOpen, backdrop),
7980
+ ...getFunctionalComponentDialogBaseStyles(isOpen, backdrop),
7980
7981
  },
7981
7982
  scroller: getScrollerJssStyle('fullscreen'),
7982
7983
  modal: {
@@ -9045,7 +9046,7 @@ const getComponentCss$n = (isOpen, background, hasDismissButton) => {
9045
9046
  zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
9046
9047
  },
9047
9048
  },
9048
- dialog: getDialogJssStyle(isOpen, 'shading'),
9049
+ ...getFunctionalComponentDialogBaseStyles(isOpen, 'shading'),
9049
9050
  },
9050
9051
  scroller: getScrollerJssStyle('fullscreen'),
9051
9052
  sheet: {
@@ -10253,4 +10254,4 @@ const getComponentCss = (size) => {
10253
10254
  });
10254
10255
  };
10255
10256
 
10256
- export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, getComponentCss$19 as getAccordionCss, getComponentCss$18 as getBannerCss, getComponentCss$15 as getButtonCss, getComponentCss$17 as getButtonPureCss, getComponentCss$16 as getButtonTileCss, getComponentCss$14 as getCanvasCss, getComponentCss$13 as getCarouselCss, getComponentCss$12 as getCheckboxCss, getComponentCss$11 as getCrestCss, getComponentCss$10 as getDisplayCss, getComponentCss$$ as getDividerCss, getComponentCss$_ as getDrilldownCss, getComponentCss$Z as getDrilldownItemCss, getComponentCss$Y as getDrilldownLinkCss, getComponentCss$X as getFieldsetCss, getComponentCss$W as getFlagCss, getComponentCss$V as getFlyoutCss, getFunctionalComponentInputBaseStyles, getFunctionalComponentLabelAfterStyles, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentNoResultsOptionStyles, getFunctionalComponentNotificationBaseStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$U as getHeadingCss, getComponentCss$T as getIconCss, getComponentCss$S as getInlineNotificationCss, getComponentCss$R as getInputDateCss, getComponentCss$Q as getInputEmailCss, getComponentCss$P as getInputMonthCss, getComponentCss$O as getInputNumberCss, getComponentCss$N as getInputPasswordCss, getComponentCss$M as getInputSearchCss, getComponentCss$L as getInputTelCss, getComponentCss$K as getInputTextCss, getComponentCss$J as getInputTimeCss, getComponentCss$I as getInputUrlCss, getComponentCss$H as getInputWeekCss, getComponentCss$D as getLinkCss, getComponentCss$G as getLinkPureCss, getComponentCss$E as getLinkTileCss, getComponentCss$F as getLinkTileProductCss, getComponentCss$C as getModalCss, getComponentCss$B as getModelSignatureCss, getComponentCss$y as getMultiSelectCss, getComponentCss$A as getMultiSelectOptionCss, getComponentCss$z as getOptgroupCss, getComponentCss$x as getPaginationCss, getComponentCss$w as getPinCodeCss, getComponentCss$v as getPopoverCss, getComponentCss$t as getRadioGroupCss, getComponentCss$u as getRadioGroupOptionCss, getComponentCss$s as getScrollerCss, getComponentCss$q as getSegmentedControlCss, getComponentCss$r as getSegmentedControlItemCss, getComponentCss$o as getSelectCss, getComponentCss$p as getSelectOptionCss, getComponentCss$n as getSheetCss, getComponentCss$m as getSpinnerCss, getComponentCss$k as getStepperHorizontalCss, getComponentCss$l as getStepperHorizontalItemCss, getComponentCss$j as getSwitchCss, getComponentCss$i as getTableBodyCss, getComponentCss$g as getTableCellCss, getComponentCss$h as getTableCss, getComponentCss$f as getTableHeadCellCss, getComponentCss$d as getTableHeadCss, getComponentCss$e as getTableHeadRowCss, getComponentCss$c as getTableRowCss, getComponentCss$b as getTabsBarCss, getComponentCss$9 as getTabsCss, getComponentCss$a as getTabsItemCss, getComponentCss$7 as getTagCss, getComponentCss$8 as getTagDismissibleCss, getComponentCss$4 as getTextCss, getComponentCss$6 as getTextListCss, getComponentCss$5 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };
10257
+ export { cssVarButtonPureMargin, cssVarButtonPurePadding, cssVarInternalInputBaseScaling, dialogBorderRadius, dialogGridJssStyle, dialogHostJssStyle, dialogPaddingBottom, dialogPaddingInline, dialogPaddingTop, getComponentCss$19 as getAccordionCss, getComponentCss$18 as getBannerCss, getComponentCss$15 as getButtonCss, getComponentCss$17 as getButtonPureCss, getComponentCss$16 as getButtonTileCss, getComponentCss$14 as getCanvasCss, getComponentCss$13 as getCarouselCss, getComponentCss$12 as getCheckboxCss, getComponentCss$11 as getCrestCss, getDialogColorJssStyle, getDialogDismissButtonJssStyle, getDialogTransitionJssStyle, getComponentCss$10 as getDisplayCss, getComponentCss$$ as getDividerCss, getComponentCss$_ as getDrilldownCss, getComponentCss$Z as getDrilldownItemCss, getComponentCss$Y as getDrilldownLinkCss, getComponentCss$X as getFieldsetCss, getComponentCss$W as getFlagCss, getComponentCss$V as getFlyoutCss, getFunctionalComponentDialogBaseStyles, getFunctionalComponentInputBaseStyles, getFunctionalComponentLabelAfterStyles, getFunctionalComponentLabelStyles, getFunctionalComponentLoadingMessageStyles, getFunctionalComponentNoResultsOptionStyles, getFunctionalComponentNotificationBaseStyles, getFunctionalComponentRequiredStyles, getFunctionalComponentStateMessageStyles, getComponentCss$U as getHeadingCss, getComponentCss$T as getIconCss, getComponentCss$S as getInlineNotificationCss, getComponentCss$R as getInputDateCss, getComponentCss$Q as getInputEmailCss, getComponentCss$P as getInputMonthCss, getComponentCss$O as getInputNumberCss, getComponentCss$N as getInputPasswordCss, getComponentCss$M as getInputSearchCss, getComponentCss$L as getInputTelCss, getComponentCss$K as getInputTextCss, getComponentCss$J as getInputTimeCss, getComponentCss$I as getInputUrlCss, getComponentCss$H as getInputWeekCss, getComponentCss$D as getLinkCss, getComponentCss$G as getLinkPureCss, getComponentCss$E as getLinkTileCss, getComponentCss$F as getLinkTileProductCss, getComponentCss$C as getModalCss, getComponentCss$B as getModelSignatureCss, getComponentCss$y as getMultiSelectCss, getComponentCss$A as getMultiSelectOptionCss, getComponentCss$z as getOptgroupCss, getComponentCss$x as getPaginationCss, getComponentCss$w as getPinCodeCss, getComponentCss$v as getPopoverCss, getComponentCss$t as getRadioGroupCss, getComponentCss$u as getRadioGroupOptionCss, getComponentCss$s as getScrollerCss, getScrollerJssStyle, getComponentCss$q as getSegmentedControlCss, getComponentCss$r as getSegmentedControlItemCss, getComponentCss$o as getSelectCss, getComponentCss$p as getSelectOptionCss, getComponentCss$n as getSheetCss, getSlotFooterJssStyle, getSlotHeaderJssStyle, getSlotJssStyle, getSlotMainJssStyle, getSlotSubFooterJssStyle, getComponentCss$m as getSpinnerCss, getComponentCss$k as getStepperHorizontalCss, getComponentCss$l as getStepperHorizontalItemCss, getComponentCss$j as getSwitchCss, getComponentCss$i as getTableBodyCss, getComponentCss$g as getTableCellCss, getComponentCss$h as getTableCss, getComponentCss$f as getTableHeadCellCss, getComponentCss$d as getTableHeadCss, getComponentCss$e as getTableHeadRowCss, getComponentCss$c as getTableRowCss, getComponentCss$b as getTabsBarCss, getComponentCss$9 as getTabsCss, getComponentCss$a as getTabsItemCss, getComponentCss$7 as getTagCss, getComponentCss$8 as getTagDismissibleCss, getComponentCss$4 as getTextCss, getComponentCss$6 as getTextListCss, getComponentCss$5 as getTextListItemCss, getComponentCss$3 as getTextareaCss, getComponentCss$1 as getToastCss, getComponentCss as getWordmarkCss };