@porsche-design-system/components-react 4.1.0-rc.0 → 4.2.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 +10 -0
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +225 -208
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.cjs +14 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs +4 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs +4 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.cjs +4 -5
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +210 -209
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.mjs +12 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +4 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs +4 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.mjs +4 -5
- package/ssr/esm/lib/dsr-components/dialog-base.d.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
14
14
|
|
|
15
15
|
## [Unreleased]
|
|
16
16
|
|
|
17
|
+
## [4.2.0-rc.0] - 2026-05-12
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `AG Grid`:
|
|
22
|
+
- custom compact theme ([#4301](https://github.com/porsche-design-system/porsche-design-system/pull/4301))
|
|
23
|
+
- minor style adjustments ([#4301](https://github.com/porsche-design-system/porsche-design-system/pull/4301))
|
|
24
|
+
|
|
25
|
+
## [4.1.0] - 2026-05-06
|
|
26
|
+
|
|
17
27
|
## [4.1.0-rc.0] - 2026-05-05
|
|
18
28
|
|
|
19
29
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-rc.0",
|
|
4
4
|
"description": "Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"porsche",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://github.com/porsche-design-system/porsche-design-system"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@porsche-design-system/components-js": "4.
|
|
24
|
+
"@porsche-design-system/components-js": "4.2.0-rc.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"ag-grid-community": ">= 35.0.0 <36.0.0",
|
|
@@ -3775,7 +3775,7 @@ const OPTION_LIST_SAFE_ZONE = 6;
|
|
|
3775
3775
|
|
|
3776
3776
|
const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
|
|
3777
3777
|
|
|
3778
|
-
const prefix = `[Porsche Design System v${"4.
|
|
3778
|
+
const prefix = `[Porsche Design System v${"4.2.0-rc.0"}]` // this part isn't covered by unit tests
|
|
3779
3779
|
;
|
|
3780
3780
|
const consoleError = (...messages) => {
|
|
3781
3781
|
console.error(prefix, ...messages);
|
|
@@ -5879,6 +5879,211 @@ const getComponentCss$12 = (hideLabel, state, isDisabled, isLoading, isCompact)
|
|
|
5879
5879
|
...getFunctionalComponentLoadingMessageStyles(),
|
|
5880
5880
|
});
|
|
5881
5881
|
};
|
|
5882
|
+
const cssVarBackgroundColor = '--_p-dialog-a';
|
|
5883
|
+
const dialogHostJssStyle = (background) => {
|
|
5884
|
+
return {
|
|
5885
|
+
'--pds-internal-grid-outer-column': `calc(${spacingFluidLg} - ${gridGap})`,
|
|
5886
|
+
'--pds-internal-grid-margin': `calc(${spacingFluidLg} * -1)`,
|
|
5887
|
+
'--pds-internal-grid-width-min': 'auto',
|
|
5888
|
+
'--pds-internal-grid-width-max': 'none',
|
|
5889
|
+
[cssVarBackgroundColor]: background === 'surface' ? colorSurface : colorCanvas,
|
|
5890
|
+
};
|
|
5891
|
+
};
|
|
5892
|
+
const getFunctionalComponentDialogBaseStyles = (isVisible, backdrop = 'blur') => {
|
|
5893
|
+
return {
|
|
5894
|
+
dialog: {
|
|
5895
|
+
...dialogBackdropResetJssStyle,
|
|
5896
|
+
...getDialogBackdropTransitionJssStyle(isVisible, backdrop),
|
|
5897
|
+
},
|
|
5898
|
+
};
|
|
5899
|
+
};
|
|
5900
|
+
const dialogBackdropResetJssStyle = {
|
|
5901
|
+
position: 'fixed', // ua-style
|
|
5902
|
+
inset: 0, // ua-style
|
|
5903
|
+
margin: 0, // ua-style
|
|
5904
|
+
padding: 0, // ua-style
|
|
5905
|
+
border: 0, // ua-style
|
|
5906
|
+
width: '100dvw', // ua-style
|
|
5907
|
+
height: '100dvh', // ua-style
|
|
5908
|
+
maxWidth: '100dvw', // ua-style
|
|
5909
|
+
maxHeight: '100dvh', // ua-style
|
|
5910
|
+
overflow: 'hidden', // ua-style
|
|
5911
|
+
display: 'block', // ua-style
|
|
5912
|
+
outline: 0, // ua-style (we always expect a focusable element to be within the dialog)
|
|
5913
|
+
'&::backdrop': {
|
|
5914
|
+
display: 'none', // ua-style (we can't use it atm because it's not animatable in all browsers)
|
|
5915
|
+
},
|
|
5916
|
+
};
|
|
5917
|
+
const getDialogBackdropTransitionJssStyle = (isVisible, backdrop = 'blur') => {
|
|
5918
|
+
const isBackdropBlur = backdrop === 'blur';
|
|
5919
|
+
const duration = isVisible ? 'long' : 'moderate';
|
|
5920
|
+
const easing = isVisible ? 'in' : 'out';
|
|
5921
|
+
// as soon as all browsers are supporting `allow-discrete`, visibility transition shouldn't be necessary anymore
|
|
5922
|
+
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)}`;
|
|
5923
|
+
return {
|
|
5924
|
+
zIndex: 9999999, // fallback for fade out stacking until `overlay` + `allow-discrete` is supported in all browsers. It tries to mimic #top-layer positioning hierarchy.
|
|
5925
|
+
...(isVisible
|
|
5926
|
+
? {
|
|
5927
|
+
visibility: 'inherit',
|
|
5928
|
+
pointerEvents: 'auto',
|
|
5929
|
+
background: colorBackdrop,
|
|
5930
|
+
...(isBackdropBlur && {
|
|
5931
|
+
WebkitBackdropFilter: blurFrosted,
|
|
5932
|
+
backdropFilter: blurFrosted,
|
|
5933
|
+
}),
|
|
5934
|
+
}
|
|
5935
|
+
: {
|
|
5936
|
+
visibility: 'hidden', // element shall not be tabbable with keyboard after fade out transition has finished
|
|
5937
|
+
pointerEvents: 'none', // element can't be interacted with mouse
|
|
5938
|
+
background: 'transparent',
|
|
5939
|
+
}),
|
|
5940
|
+
transition,
|
|
5941
|
+
// `allow-discrete` transition for ua-style `overlay` (supported browsers only) ensures dialog is rendered on
|
|
5942
|
+
// #top-layer as long as fade-in or fade-out transition/animation is running
|
|
5943
|
+
'@supports (transition-behavior: allow-discrete)': {
|
|
5944
|
+
transition: `${transition}, ${getTransition('overlay', duration, easing)} allow-discrete`,
|
|
5945
|
+
},
|
|
5946
|
+
};
|
|
5947
|
+
};
|
|
5948
|
+
const getScrollerJssStyle = (position) => {
|
|
5949
|
+
// ensures scrollbar color is set correctly (e.g. when scrollbar is shown on backdrop, on flyout/modal surface or with Auto Dark Mode)
|
|
5950
|
+
const backgroundLight = 'rgba(255,255,255,.01)';
|
|
5951
|
+
const backgroundDark = 'rgba(0,0,0,.01)';
|
|
5952
|
+
const background = {
|
|
5953
|
+
light: backgroundLight,
|
|
5954
|
+
dark: backgroundDark,
|
|
5955
|
+
auto: backgroundLight,
|
|
5956
|
+
};
|
|
5957
|
+
return {
|
|
5958
|
+
position: 'absolute',
|
|
5959
|
+
isolation: 'isolate', // creates new stacking context to show scrollbars on top of header/footer areas (on iOS/iPadOS)
|
|
5960
|
+
display: 'grid',
|
|
5961
|
+
...(position === 'fullscreen'
|
|
5962
|
+
? {
|
|
5963
|
+
inset: 0,
|
|
5964
|
+
}
|
|
5965
|
+
: {
|
|
5966
|
+
insetBlock: 0,
|
|
5967
|
+
[position === 'start' ? 'insetInlineStart' : 'insetInlineEnd']: 0,
|
|
5968
|
+
}),
|
|
5969
|
+
overflow: 'hidden auto',
|
|
5970
|
+
overscrollBehaviorY: 'none',
|
|
5971
|
+
// TODO: check if smooth scrolling on iOS is given?
|
|
5972
|
+
background: background.light,
|
|
5973
|
+
};
|
|
5974
|
+
};
|
|
5975
|
+
const dialogBorderRadius = `var(${legacyRadiusLarge}, ${radiusXl})`;
|
|
5976
|
+
const dialogPaddingTop = spacingFluidMd$1;
|
|
5977
|
+
const dialogPaddingBottom = `calc(${spacingFluidSm} + ${spacingFluidMd$1})`;
|
|
5978
|
+
const dialogPaddingInline = spacingFluidLg;
|
|
5979
|
+
const dialogGridJssStyle = () => {
|
|
5980
|
+
return {
|
|
5981
|
+
position: 'relative',
|
|
5982
|
+
display: 'grid',
|
|
5983
|
+
gridTemplate: `auto/${spacingFluidSm} minmax(0,1fr) ${spacingFluidSm}`,
|
|
5984
|
+
gap: `${spacingFluidMd$1} calc(${spacingFluidLg} - ${spacingFluidSm})`,
|
|
5985
|
+
paddingTop: dialogPaddingTop,
|
|
5986
|
+
paddingBottom: dialogPaddingBottom,
|
|
5987
|
+
alignContent: 'flex-start',
|
|
5988
|
+
};
|
|
5989
|
+
};
|
|
5990
|
+
const getDialogColorJssStyle = () => {
|
|
5991
|
+
return {
|
|
5992
|
+
color: colorPrimary, // enables color inheritance for slots
|
|
5993
|
+
background: `var(${cssVarBackgroundColor})`,
|
|
5994
|
+
};
|
|
5995
|
+
};
|
|
5996
|
+
const getDialogTransitionJssStyle = (isVisible, slideIn) => {
|
|
5997
|
+
const duration = isVisible ? 'moderate' : 'short';
|
|
5998
|
+
const easing = isVisible ? 'in' : 'out';
|
|
5999
|
+
return {
|
|
6000
|
+
// transition offset relies vertically on viewport (vh) because the dialog height can be infinite, while horizontally
|
|
6001
|
+
// it relies on the dialog width (%) which has a max-width
|
|
6002
|
+
...(isVisible
|
|
6003
|
+
? {
|
|
6004
|
+
opacity: 1,
|
|
6005
|
+
transform: 'initial',
|
|
6006
|
+
}
|
|
6007
|
+
: {
|
|
6008
|
+
opacity: 0,
|
|
6009
|
+
transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '-' : ''}100%)`,
|
|
6010
|
+
'&:dir(rtl)': {
|
|
6011
|
+
transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '' : '-'}100%)`,
|
|
6012
|
+
},
|
|
6013
|
+
}),
|
|
6014
|
+
transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
|
|
6015
|
+
};
|
|
6016
|
+
};
|
|
6017
|
+
const getDialogDismissButtonJssStyle = () => {
|
|
6018
|
+
return {
|
|
6019
|
+
gridArea: '1/3',
|
|
6020
|
+
zIndex: 5, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
6021
|
+
position: 'sticky',
|
|
6022
|
+
top: spacingFluidSm,
|
|
6023
|
+
marginTop: `calc(-1 * ${dialogPaddingTop} + ${spacingFluidSm})`,
|
|
6024
|
+
marginInlineEnd: spacingFluidSm,
|
|
6025
|
+
placeSelf: 'flex-start flex-end',
|
|
6026
|
+
boxShadow: `0px 0px 30px hsla(from var(${cssVarBackgroundColor}) h s l / 0.35)`,
|
|
6027
|
+
};
|
|
6028
|
+
};
|
|
6029
|
+
const getSlotJssStyle = () => {
|
|
6030
|
+
return {
|
|
6031
|
+
display: 'block',
|
|
6032
|
+
'&:first-of-type': {
|
|
6033
|
+
gridRowStart: 1,
|
|
6034
|
+
},
|
|
6035
|
+
};
|
|
6036
|
+
};
|
|
6037
|
+
const getSlotHeaderJssStyle = () => {
|
|
6038
|
+
const paddingTop = dialogPaddingTop;
|
|
6039
|
+
const paddingBottom = spacingStaticMd;
|
|
6040
|
+
return {
|
|
6041
|
+
gridColumn: '1/-1',
|
|
6042
|
+
zIndex: 1, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
6043
|
+
position: 'sticky',
|
|
6044
|
+
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.
|
|
6045
|
+
marginBlock: `calc(-1 * ${paddingTop}) calc(-1 * ${paddingBottom})`,
|
|
6046
|
+
padding: `${paddingTop} ${dialogPaddingInline} ${paddingBottom}`,
|
|
6047
|
+
background: `linear-gradient(180deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 80%,transparent 100%)`,
|
|
6048
|
+
};
|
|
6049
|
+
};
|
|
6050
|
+
const getSlotMainJssStyle = () => {
|
|
6051
|
+
return {
|
|
6052
|
+
gridColumn: '2/3',
|
|
6053
|
+
zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
6054
|
+
};
|
|
6055
|
+
};
|
|
6056
|
+
const getSlotFooterJssStyle = () => {
|
|
6057
|
+
const paddingBlock = `calc(${dialogPaddingBottom} - ${dialogBorderRadius})`;
|
|
6058
|
+
const offset = `calc(${paddingBlock} / 2)`;
|
|
6059
|
+
return {
|
|
6060
|
+
gridColumn: '1/-1',
|
|
6061
|
+
zIndex: 2, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
6062
|
+
position: 'sticky',
|
|
6063
|
+
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.
|
|
6064
|
+
marginBlock: `calc(-1 * ${paddingBlock})`,
|
|
6065
|
+
padding: `${paddingBlock} ${dialogPaddingInline}`,
|
|
6066
|
+
background: `linear-gradient(0deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 20%,transparent 80%)`,
|
|
6067
|
+
'&[data-stuck]::after': {
|
|
6068
|
+
content: '""',
|
|
6069
|
+
zIndex: -1,
|
|
6070
|
+
position: 'absolute',
|
|
6071
|
+
inset: `calc(${paddingBlock} - ${offset}) calc(${dialogPaddingInline} - ${offset})`,
|
|
6072
|
+
background: colorFrosted,
|
|
6073
|
+
borderRadius: radius3Xl,
|
|
6074
|
+
WebkitBackdropFilter: blurFrosted,
|
|
6075
|
+
backdropFilter: blurFrosted,
|
|
6076
|
+
},
|
|
6077
|
+
};
|
|
6078
|
+
};
|
|
6079
|
+
const getSlotSubFooterJssStyle = () => {
|
|
6080
|
+
return {
|
|
6081
|
+
gridColumn: '1/-1',
|
|
6082
|
+
zIndex: 3, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
6083
|
+
paddingInline: dialogPaddingInline,
|
|
6084
|
+
backgroundColor: `var(${cssVarBackgroundColor})`,
|
|
6085
|
+
};
|
|
6086
|
+
};
|
|
5882
6087
|
|
|
5883
6088
|
/**
|
|
5884
6089
|
* @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."}
|
|
@@ -6898,210 +7103,6 @@ const getComponentCss$W = (size) => {
|
|
|
6898
7103
|
});
|
|
6899
7104
|
};
|
|
6900
7105
|
|
|
6901
|
-
const cssVarBackgroundColor = '--_p-dialog-a';
|
|
6902
|
-
const dialogHostJssStyle = (background) => {
|
|
6903
|
-
return {
|
|
6904
|
-
'--pds-internal-grid-outer-column': `calc(${spacingFluidLg} - ${gridGap})`,
|
|
6905
|
-
'--pds-internal-grid-margin': `calc(${spacingFluidLg} * -1)`,
|
|
6906
|
-
'--pds-internal-grid-width-min': 'auto',
|
|
6907
|
-
'--pds-internal-grid-width-max': 'none',
|
|
6908
|
-
[cssVarBackgroundColor]: background === 'surface' ? colorSurface : colorCanvas,
|
|
6909
|
-
};
|
|
6910
|
-
};
|
|
6911
|
-
const getDialogJssStyle = (isVisible, backdrop = 'blur') => {
|
|
6912
|
-
return {
|
|
6913
|
-
...dialogBackdropResetJssStyle,
|
|
6914
|
-
...getDialogBackdropTransitionJssStyle(isVisible, backdrop),
|
|
6915
|
-
};
|
|
6916
|
-
};
|
|
6917
|
-
const dialogBackdropResetJssStyle = {
|
|
6918
|
-
position: 'fixed', // ua-style
|
|
6919
|
-
inset: 0, // ua-style
|
|
6920
|
-
margin: 0, // ua-style
|
|
6921
|
-
padding: 0, // ua-style
|
|
6922
|
-
border: 0, // ua-style
|
|
6923
|
-
width: '100dvw', // ua-style
|
|
6924
|
-
height: '100dvh', // ua-style
|
|
6925
|
-
maxWidth: '100dvw', // ua-style
|
|
6926
|
-
maxHeight: '100dvh', // ua-style
|
|
6927
|
-
overflow: 'hidden', // ua-style
|
|
6928
|
-
display: 'block', // ua-style
|
|
6929
|
-
outline: 0, // ua-style (we always expect a focusable element to be within the dialog)
|
|
6930
|
-
'&::backdrop': {
|
|
6931
|
-
display: 'none', // ua-style (we can't use it atm because it's not animatable in all browsers)
|
|
6932
|
-
},
|
|
6933
|
-
};
|
|
6934
|
-
const getDialogBackdropTransitionJssStyle = (isVisible, backdrop = 'blur') => {
|
|
6935
|
-
const isBackdropBlur = backdrop === 'blur';
|
|
6936
|
-
const duration = isVisible ? 'long' : 'moderate';
|
|
6937
|
-
const easing = isVisible ? 'in' : 'out';
|
|
6938
|
-
// as soon as all browsers are supporting `allow-discrete`, visibility transition shouldn't be necessary anymore
|
|
6939
|
-
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)}`;
|
|
6940
|
-
return {
|
|
6941
|
-
zIndex: 9999999, // fallback for fade out stacking until `overlay` + `allow-discrete` is supported in all browsers. It tries to mimic #top-layer positioning hierarchy.
|
|
6942
|
-
...(isVisible
|
|
6943
|
-
? {
|
|
6944
|
-
visibility: 'inherit',
|
|
6945
|
-
pointerEvents: 'auto',
|
|
6946
|
-
background: colorBackdrop,
|
|
6947
|
-
...(isBackdropBlur && {
|
|
6948
|
-
WebkitBackdropFilter: blurFrosted,
|
|
6949
|
-
backdropFilter: blurFrosted,
|
|
6950
|
-
}),
|
|
6951
|
-
}
|
|
6952
|
-
: {
|
|
6953
|
-
visibility: 'hidden', // element shall not be tabbable with keyboard after fade out transition has finished
|
|
6954
|
-
pointerEvents: 'none', // element can't be interacted with mouse
|
|
6955
|
-
background: 'transparent',
|
|
6956
|
-
}),
|
|
6957
|
-
transition,
|
|
6958
|
-
// `allow-discrete` transition for ua-style `overlay` (supported browsers only) ensures dialog is rendered on
|
|
6959
|
-
// #top-layer as long as fade-in or fade-out transition/animation is running
|
|
6960
|
-
'@supports (transition-behavior: allow-discrete)': {
|
|
6961
|
-
transition: `${transition}, ${getTransition('overlay', duration, easing)} allow-discrete`,
|
|
6962
|
-
},
|
|
6963
|
-
};
|
|
6964
|
-
};
|
|
6965
|
-
const getScrollerJssStyle = (position) => {
|
|
6966
|
-
// ensures scrollbar color is set correctly (e.g. when scrollbar is shown on backdrop, on flyout/modal surface or with Auto Dark Mode)
|
|
6967
|
-
const backgroundLight = 'rgba(255,255,255,.01)';
|
|
6968
|
-
const backgroundDark = 'rgba(0,0,0,.01)';
|
|
6969
|
-
const background = {
|
|
6970
|
-
light: backgroundLight,
|
|
6971
|
-
dark: backgroundDark,
|
|
6972
|
-
auto: backgroundLight,
|
|
6973
|
-
};
|
|
6974
|
-
return {
|
|
6975
|
-
position: 'absolute',
|
|
6976
|
-
isolation: 'isolate', // creates new stacking context to show scrollbars on top of header/footer areas (on iOS/iPadOS)
|
|
6977
|
-
display: 'grid',
|
|
6978
|
-
...(position === 'fullscreen'
|
|
6979
|
-
? {
|
|
6980
|
-
inset: 0,
|
|
6981
|
-
}
|
|
6982
|
-
: {
|
|
6983
|
-
insetBlock: 0,
|
|
6984
|
-
[position === 'start' ? 'insetInlineStart' : 'insetInlineEnd']: 0,
|
|
6985
|
-
}),
|
|
6986
|
-
overflow: 'hidden auto',
|
|
6987
|
-
overscrollBehaviorY: 'none',
|
|
6988
|
-
// TODO: check if smooth scrolling on iOS is given?
|
|
6989
|
-
background: background.light,
|
|
6990
|
-
};
|
|
6991
|
-
};
|
|
6992
|
-
const dialogBorderRadius = `var(${legacyRadiusLarge}, ${radiusXl})`;
|
|
6993
|
-
const dialogPaddingTop = spacingFluidMd$1;
|
|
6994
|
-
const dialogPaddingBottom = `calc(${spacingFluidSm} + ${spacingFluidMd$1})`;
|
|
6995
|
-
const dialogPaddingInline = spacingFluidLg;
|
|
6996
|
-
const dialogGridJssStyle = () => {
|
|
6997
|
-
return {
|
|
6998
|
-
position: 'relative',
|
|
6999
|
-
display: 'grid',
|
|
7000
|
-
gridTemplate: `auto/${spacingFluidSm} minmax(0,1fr) ${spacingFluidSm}`,
|
|
7001
|
-
gap: `${spacingFluidMd$1} calc(${spacingFluidLg} - ${spacingFluidSm})`,
|
|
7002
|
-
paddingTop: dialogPaddingTop,
|
|
7003
|
-
paddingBottom: dialogPaddingBottom,
|
|
7004
|
-
alignContent: 'flex-start',
|
|
7005
|
-
};
|
|
7006
|
-
};
|
|
7007
|
-
const getDialogColorJssStyle = () => {
|
|
7008
|
-
return {
|
|
7009
|
-
color: colorPrimary, // enables color inheritance for slots
|
|
7010
|
-
background: `var(${cssVarBackgroundColor})`,
|
|
7011
|
-
};
|
|
7012
|
-
};
|
|
7013
|
-
const getDialogTransitionJssStyle = (isVisible, slideIn) => {
|
|
7014
|
-
const duration = isVisible ? 'moderate' : 'short';
|
|
7015
|
-
const easing = isVisible ? 'in' : 'out';
|
|
7016
|
-
return {
|
|
7017
|
-
// transition offset relies vertically on viewport (vh) because the dialog height can be infinite, while horizontally
|
|
7018
|
-
// it relies on the dialog width (%) which has a max-width
|
|
7019
|
-
...(isVisible
|
|
7020
|
-
? {
|
|
7021
|
-
opacity: 1,
|
|
7022
|
-
transform: 'initial',
|
|
7023
|
-
}
|
|
7024
|
-
: {
|
|
7025
|
-
opacity: 0,
|
|
7026
|
-
transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '-' : ''}100%)`,
|
|
7027
|
-
'&:dir(rtl)': {
|
|
7028
|
-
transform: slideIn === '^' ? 'translateY(25vh)' : `translateX(${slideIn === '>' ? '' : '-'}100%)`,
|
|
7029
|
-
},
|
|
7030
|
-
}),
|
|
7031
|
-
transition: `${getTransition('opacity', duration, easing)}, ${getTransition('transform', duration, easing)}`,
|
|
7032
|
-
};
|
|
7033
|
-
};
|
|
7034
|
-
const getDialogDismissButtonJssStyle = () => {
|
|
7035
|
-
return {
|
|
7036
|
-
gridArea: '1/3',
|
|
7037
|
-
zIndex: 5, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
7038
|
-
position: 'sticky',
|
|
7039
|
-
top: spacingFluidSm,
|
|
7040
|
-
marginTop: `calc(-1 * ${dialogPaddingTop} + ${spacingFluidSm})`,
|
|
7041
|
-
marginInlineEnd: spacingFluidSm,
|
|
7042
|
-
placeSelf: 'flex-start flex-end',
|
|
7043
|
-
boxShadow: `0px 0px 30px hsla(from var(${cssVarBackgroundColor}) h s l / 0.35)`
|
|
7044
|
-
};
|
|
7045
|
-
};
|
|
7046
|
-
const getSlotJssStyle = () => {
|
|
7047
|
-
return {
|
|
7048
|
-
display: 'block',
|
|
7049
|
-
'&:first-of-type': {
|
|
7050
|
-
gridRowStart: 1,
|
|
7051
|
-
},
|
|
7052
|
-
};
|
|
7053
|
-
};
|
|
7054
|
-
const getSlotHeaderJssStyle = () => {
|
|
7055
|
-
const paddingTop = dialogPaddingTop;
|
|
7056
|
-
const paddingBottom = spacingStaticMd;
|
|
7057
|
-
return {
|
|
7058
|
-
gridColumn: '1/-1',
|
|
7059
|
-
zIndex: 1, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
7060
|
-
position: 'sticky',
|
|
7061
|
-
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.
|
|
7062
|
-
marginBlock: `calc(-1 * ${paddingTop}) calc(-1 * ${paddingBottom})`,
|
|
7063
|
-
padding: `${paddingTop} ${dialogPaddingInline} ${paddingBottom}`,
|
|
7064
|
-
background: `linear-gradient(180deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 80%,transparent 100%)`,
|
|
7065
|
-
};
|
|
7066
|
-
};
|
|
7067
|
-
const getSlotMainJssStyle = () => {
|
|
7068
|
-
return {
|
|
7069
|
-
gridColumn: '2/3',
|
|
7070
|
-
zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
7071
|
-
};
|
|
7072
|
-
};
|
|
7073
|
-
const getSlotFooterJssStyle = () => {
|
|
7074
|
-
const paddingBlock = `calc(${dialogPaddingBottom} - ${dialogBorderRadius})`;
|
|
7075
|
-
const offset = `calc(${paddingBlock} / 2)`;
|
|
7076
|
-
return {
|
|
7077
|
-
gridColumn: '1/-1',
|
|
7078
|
-
zIndex: 2, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
7079
|
-
position: 'sticky',
|
|
7080
|
-
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.
|
|
7081
|
-
marginBlock: `calc(-1 * ${paddingBlock})`,
|
|
7082
|
-
padding: `${paddingBlock} ${dialogPaddingInline}`,
|
|
7083
|
-
background: `linear-gradient(0deg,var(${cssVarBackgroundColor}) 0%,var(${cssVarBackgroundColor}) 20%,transparent 80%)`,
|
|
7084
|
-
'&[data-stuck]::after': {
|
|
7085
|
-
content: '""',
|
|
7086
|
-
zIndex: -1,
|
|
7087
|
-
position: 'absolute',
|
|
7088
|
-
inset: `calc(${paddingBlock} - ${offset}) calc(${dialogPaddingInline} - ${offset})`,
|
|
7089
|
-
background: colorFrosted,
|
|
7090
|
-
borderRadius: radius3Xl,
|
|
7091
|
-
WebkitBackdropFilter: blurFrosted,
|
|
7092
|
-
backdropFilter: blurFrosted,
|
|
7093
|
-
},
|
|
7094
|
-
};
|
|
7095
|
-
};
|
|
7096
|
-
const getSlotSubFooterJssStyle = () => {
|
|
7097
|
-
return {
|
|
7098
|
-
gridColumn: '1/-1',
|
|
7099
|
-
zIndex: 3, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
7100
|
-
paddingInline: dialogPaddingInline,
|
|
7101
|
-
backgroundColor: `var(${cssVarBackgroundColor})`,
|
|
7102
|
-
};
|
|
7103
|
-
};
|
|
7104
|
-
|
|
7105
7106
|
/**
|
|
7106
7107
|
* @css-variable {"name": "--p-flyout-width", "description": "Width of the flyout.", "defaultValue": "auto"}
|
|
7107
7108
|
*/
|
|
@@ -7156,7 +7157,7 @@ const getComponentCss$V = (isOpen, background, backdrop, position, hasHeader, ha
|
|
|
7156
7157
|
'&[name=sub-footer]': getSlotSubFooterJssStyle(),
|
|
7157
7158
|
}),
|
|
7158
7159
|
},
|
|
7159
|
-
|
|
7160
|
+
...getFunctionalComponentDialogBaseStyles(isOpen, backdrop),
|
|
7160
7161
|
},
|
|
7161
7162
|
scroller: {
|
|
7162
7163
|
...getScrollerJssStyle(isPositionStart ? 'start' : 'end'),
|
|
@@ -7978,7 +7979,7 @@ const getComponentCss$C = (isOpen, background, backdrop, fullscreen, hasDismissB
|
|
|
7978
7979
|
'&[name=footer]': getSlotFooterJssStyle(),
|
|
7979
7980
|
}),
|
|
7980
7981
|
},
|
|
7981
|
-
|
|
7982
|
+
...getFunctionalComponentDialogBaseStyles(isOpen, backdrop),
|
|
7982
7983
|
},
|
|
7983
7984
|
scroller: getScrollerJssStyle('fullscreen'),
|
|
7984
7985
|
modal: {
|
|
@@ -9047,7 +9048,7 @@ const getComponentCss$n = (isOpen, background, hasDismissButton) => {
|
|
|
9047
9048
|
zIndex: 0, // controls layering + creates new stacking context (prevents content within to be above other dialog areas)
|
|
9048
9049
|
},
|
|
9049
9050
|
},
|
|
9050
|
-
|
|
9051
|
+
...getFunctionalComponentDialogBaseStyles(isOpen, 'shading'),
|
|
9051
9052
|
},
|
|
9052
9053
|
scroller: getScrollerJssStyle('fullscreen'),
|
|
9053
9054
|
sheet: {
|
|
@@ -10258,6 +10259,12 @@ const getComponentCss = (size) => {
|
|
|
10258
10259
|
exports.cssVarButtonPureMargin = cssVarButtonPureMargin;
|
|
10259
10260
|
exports.cssVarButtonPurePadding = cssVarButtonPurePadding;
|
|
10260
10261
|
exports.cssVarInternalInputBaseScaling = cssVarInternalInputBaseScaling;
|
|
10262
|
+
exports.dialogBorderRadius = dialogBorderRadius;
|
|
10263
|
+
exports.dialogGridJssStyle = dialogGridJssStyle;
|
|
10264
|
+
exports.dialogHostJssStyle = dialogHostJssStyle;
|
|
10265
|
+
exports.dialogPaddingBottom = dialogPaddingBottom;
|
|
10266
|
+
exports.dialogPaddingInline = dialogPaddingInline;
|
|
10267
|
+
exports.dialogPaddingTop = dialogPaddingTop;
|
|
10261
10268
|
exports.getAccordionCss = getComponentCss$19;
|
|
10262
10269
|
exports.getBannerCss = getComponentCss$18;
|
|
10263
10270
|
exports.getButtonCss = getComponentCss$15;
|
|
@@ -10267,6 +10274,9 @@ exports.getCanvasCss = getComponentCss$14;
|
|
|
10267
10274
|
exports.getCarouselCss = getComponentCss$13;
|
|
10268
10275
|
exports.getCheckboxCss = getComponentCss$12;
|
|
10269
10276
|
exports.getCrestCss = getComponentCss$11;
|
|
10277
|
+
exports.getDialogColorJssStyle = getDialogColorJssStyle;
|
|
10278
|
+
exports.getDialogDismissButtonJssStyle = getDialogDismissButtonJssStyle;
|
|
10279
|
+
exports.getDialogTransitionJssStyle = getDialogTransitionJssStyle;
|
|
10270
10280
|
exports.getDisplayCss = getComponentCss$10;
|
|
10271
10281
|
exports.getDividerCss = getComponentCss$$;
|
|
10272
10282
|
exports.getDrilldownCss = getComponentCss$_;
|
|
@@ -10275,6 +10285,7 @@ exports.getDrilldownLinkCss = getComponentCss$Y;
|
|
|
10275
10285
|
exports.getFieldsetCss = getComponentCss$X;
|
|
10276
10286
|
exports.getFlagCss = getComponentCss$W;
|
|
10277
10287
|
exports.getFlyoutCss = getComponentCss$V;
|
|
10288
|
+
exports.getFunctionalComponentDialogBaseStyles = getFunctionalComponentDialogBaseStyles;
|
|
10278
10289
|
exports.getFunctionalComponentInputBaseStyles = getFunctionalComponentInputBaseStyles;
|
|
10279
10290
|
exports.getFunctionalComponentLabelAfterStyles = getFunctionalComponentLabelAfterStyles;
|
|
10280
10291
|
exports.getFunctionalComponentLabelStyles = getFunctionalComponentLabelStyles;
|
|
@@ -10312,11 +10323,17 @@ exports.getPopoverCss = getComponentCss$v;
|
|
|
10312
10323
|
exports.getRadioGroupCss = getComponentCss$t;
|
|
10313
10324
|
exports.getRadioGroupOptionCss = getComponentCss$u;
|
|
10314
10325
|
exports.getScrollerCss = getComponentCss$s;
|
|
10326
|
+
exports.getScrollerJssStyle = getScrollerJssStyle;
|
|
10315
10327
|
exports.getSegmentedControlCss = getComponentCss$q;
|
|
10316
10328
|
exports.getSegmentedControlItemCss = getComponentCss$r;
|
|
10317
10329
|
exports.getSelectCss = getComponentCss$o;
|
|
10318
10330
|
exports.getSelectOptionCss = getComponentCss$p;
|
|
10319
10331
|
exports.getSheetCss = getComponentCss$n;
|
|
10332
|
+
exports.getSlotFooterJssStyle = getSlotFooterJssStyle;
|
|
10333
|
+
exports.getSlotHeaderJssStyle = getSlotHeaderJssStyle;
|
|
10334
|
+
exports.getSlotJssStyle = getSlotJssStyle;
|
|
10335
|
+
exports.getSlotMainJssStyle = getSlotMainJssStyle;
|
|
10336
|
+
exports.getSlotSubFooterJssStyle = getSlotSubFooterJssStyle;
|
|
10320
10337
|
exports.getSpinnerCss = getComponentCss$m;
|
|
10321
10338
|
exports.getStepperHorizontalCss = getComponentCss$k;
|
|
10322
10339
|
exports.getStepperHorizontalItemCss = getComponentCss$l;
|
|
@@ -3454,7 +3454,7 @@ const hasShowPickerSupport = () => (hasDocument &&
|
|
|
3454
3454
|
'showPicker' in HTMLInputElement.prototype &&
|
|
3455
3455
|
CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
|
|
3456
3456
|
|
|
3457
|
-
const prefix = `[Porsche Design System v${"4.
|
|
3457
|
+
const prefix = `[Porsche Design System v${"4.2.0-rc.0"}]` // this part isn't covered by unit tests
|
|
3458
3458
|
;
|
|
3459
3459
|
const consoleError$1 = (...messages) => {
|
|
3460
3460
|
console.error(prefix, ...messages);
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.cjs
ADDED
|
@@ -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;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs
CHANGED
|
@@ -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
|
|
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("
|
|
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("
|
|
38
|
+
}), children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs
CHANGED
|
@@ -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
|
|
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(
|
|
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("
|
|
36
|
+
}), children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.cjs
CHANGED
|
@@ -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
|
|
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(
|
|
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("
|
|
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.
|
|
3776
|
+
const prefix = `[Porsche Design System v${"4.2.0-rc.0"}]` // 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
|
@@ -3452,7 +3452,7 @@ const hasShowPickerSupport = () => (hasDocument &&
|
|
|
3452
3452
|
'showPicker' in HTMLInputElement.prototype &&
|
|
3453
3453
|
CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
|
|
3454
3454
|
|
|
3455
|
-
const prefix = `[Porsche Design System v${"4.
|
|
3455
|
+
const prefix = `[Porsche Design System v${"4.2.0-rc.0"}]` // this part isn't covered by unit tests
|
|
3456
3456
|
;
|
|
3457
3457
|
const consoleError$1 = (...messages) => {
|
|
3458
3458
|
console.error(prefix, ...messages);
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/dialog-base.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../../provider.mjs';
|
|
4
|
+
import { PButton } from '../components/button.wrapper.mjs';
|
|
5
|
+
|
|
6
|
+
const DialogBase = ({ children,
|
|
7
|
+
// host,
|
|
8
|
+
inert, containerClass, ariaAttributes, dismissable = false, header, footer, subFooter, }) => {
|
|
9
|
+
return (jsx("dialog", { inert: inert, tabIndex: -1, ...(ariaAttributes ?? {}), children: jsx("div", { className: "scroller", children: jsxs("div", { className: containerClass, children: [dismissable && (jsx(PButton, { className: "dismiss", variant: "secondary", compact: true, type: "button", hideLabel: true, icon: "close", children: `Dismiss ${containerClass}` })), header, children, footer, subFooter] }) }) }));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { DialogBase };
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import '../../provider.mjs';
|
|
4
2
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
3
|
+
import { Component } from 'react';
|
|
5
4
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
5
|
import { getFlyoutCss as getComponentCss$V } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
6
|
import { parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
-
import {
|
|
7
|
+
import { DialogBase } from './dialog-base.mjs';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @slot {"name": "header", "description": "Renders a sticky header section above the content area." }
|
|
@@ -30,11 +29,11 @@ class DSRFlyout extends Component {
|
|
|
30
29
|
const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
|
|
31
30
|
const hasSubFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sub-footer').length > 0;
|
|
32
31
|
const style = minifyCss(getComponentCss$V(this.props.open, this.props.background, this.props.backdrop, this.props.position, hasHeader, hasFooter, hasSubFooter, this.props.footerBehavior));
|
|
33
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("
|
|
32
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(DialogBase, { host: null, dismissable: true, containerClass: "flyout", header: hasHeader ? jsx("slot", { name: "header" }) : undefined, footer: hasFooter ? jsx("slot", { name: "footer" }) : undefined, subFooter: hasSubFooter ? jsx("slot", { name: "sub-footer" }) : undefined, ariaAttributes: parseAndGetAriaAttributes({
|
|
34
33
|
'aria-modal': true,
|
|
35
34
|
...{ 'aria-label': hasHeader ? namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children : 'Flyout' },
|
|
36
35
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
37
|
-
}), children: jsx("
|
|
36
|
+
}), children: jsx("slot", {}) })] }), this.props.children] }));
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import '../../provider.mjs';
|
|
4
2
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
3
|
+
import { Component } from 'react';
|
|
5
4
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
5
|
import { getModalCss as getComponentCss$C } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
6
|
import { parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
-
import {
|
|
7
|
+
import { DialogBase } from './dialog-base.mjs';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @slot {"name": "header", "description": "Renders a header section above the content area." }
|
|
@@ -28,11 +27,11 @@ class DSRModal extends Component {
|
|
|
28
27
|
this.props.disableCloseButton ? false : this.props.dismissButton;
|
|
29
28
|
// TODO: why do we validate only when opened?
|
|
30
29
|
const style = minifyCss(getComponentCss$C(this.props.open, this.props.background, this.props.backdrop, this.props.fullscreen, this.props.dismissButton, hasHeader, hasFooter));
|
|
31
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(
|
|
30
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(DialogBase, { host: null, inert: !this.props.open, dismissable: this.props.dismissButton ?? undefined, containerClass: "modal", header: hasHeader ? jsx("slot", { name: "header" }) : undefined, footer: hasFooter ? jsx("slot", { name: "footer" }) : undefined, ariaAttributes: parseAndGetAriaAttributes({
|
|
32
31
|
'aria-modal': true,
|
|
33
32
|
...(hasHeader && { 'aria-label': this.props.ariaLabel }),
|
|
34
33
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
35
|
-
}), children: jsx("
|
|
34
|
+
}), children: jsx("slot", {}) })] }), this.props.children] }));
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
import '../../provider.mjs';
|
|
4
2
|
import { splitChildren } from '../../splitChildren.mjs';
|
|
3
|
+
import { Component } from 'react';
|
|
5
4
|
import { minifyCss } from '../../minifyCss.mjs';
|
|
6
5
|
import { getSheetCss as getComponentCss$n } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
|
|
7
6
|
import { parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
|
|
8
|
-
import {
|
|
7
|
+
import { DialogBase } from './dialog-base.mjs';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @slot {"name": "header", "description": "Renders a header section above the content area." }
|
|
@@ -23,13 +22,13 @@ class DSRSheet extends Component {
|
|
|
23
22
|
const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
|
|
24
23
|
if (this.props.open) ;
|
|
25
24
|
const style = minifyCss(getComponentCss$n(this.props.open, this.props.background, this.props.dismissButton));
|
|
26
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(
|
|
25
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(DialogBase, { host: null, inert: !this.props.open, dismissable: this.props.dismissButton ?? undefined, containerClass: "sheet", header: hasHeader ? jsx("slot", { name: "header" }) : undefined, ariaAttributes: parseAndGetAriaAttributes({
|
|
27
26
|
'aria-modal': true,
|
|
28
27
|
...(hasHeader && {
|
|
29
28
|
'aria-label': namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0 && namedSlotChildren.find(({ props: { slot } }) => slot === 'header')?.props.children,
|
|
30
29
|
}),
|
|
31
30
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
32
|
-
}), children: jsx("
|
|
31
|
+
}), children: jsx("slot", {}) })] }), this.props.children] }));
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AriaAttributes } from '../types';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { JSX } from 'react';
|
|
4
|
+
type DialogBaseProps = {
|
|
5
|
+
children?: JSX.Element;
|
|
6
|
+
host: HTMLElement;
|
|
7
|
+
inert?: boolean;
|
|
8
|
+
dialogRef?: (el: HTMLDialogElement) => void;
|
|
9
|
+
scrollerRef?: (el: HTMLDivElement) => void;
|
|
10
|
+
containerClass: 'flyout' | 'modal' | 'sheet';
|
|
11
|
+
onCancel?: (e: Event) => void;
|
|
12
|
+
onClick?: (e: MouseEvent) => void;
|
|
13
|
+
onTransitionEnd?: (e: TransitionEvent) => void;
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
ariaAttributes?: AriaAttributes;
|
|
16
|
+
dismissable?: boolean;
|
|
17
|
+
header?: JSX.Element;
|
|
18
|
+
footer?: JSX.Element;
|
|
19
|
+
subFooter?: JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
export declare const DialogBase: FC<DialogBaseProps>;
|
|
22
|
+
export {};
|