@porsche-design-system/components-react 3.0.0-alpha.5 → 3.0.0-alpha.6
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 +149 -20
- package/esm/lib/components/accordion.wrapper.js +2 -2
- package/esm/lib/components/banner.wrapper.js +3 -3
- package/esm/lib/components/carousel.wrapper.js +2 -2
- package/esm/lib/components/inline-notification.wrapper.js +3 -3
- package/esm/lib/components/pagination.wrapper.js +2 -2
- package/esm/lib/components/segmented-control.wrapper.js +2 -2
- package/esm/lib/components/stepper-horizontal.wrapper.js +2 -2
- package/esm/lib/components/switch.wrapper.js +2 -2
- package/esm/lib/components/table.wrapper.js +2 -2
- package/esm/lib/components/tabs-bar.wrapper.js +2 -2
- package/esm/lib/components/tabs.wrapper.js +2 -2
- package/lib/components/accordion.wrapper.d.ts +7 -7
- package/lib/components/accordion.wrapper.js +2 -2
- package/lib/components/banner.wrapper.d.ts +18 -2
- package/lib/components/banner.wrapper.js +3 -3
- package/lib/components/carousel.wrapper.d.ts +7 -7
- package/lib/components/carousel.wrapper.js +2 -2
- package/lib/components/inline-notification.wrapper.d.ts +10 -2
- package/lib/components/inline-notification.wrapper.js +3 -3
- package/lib/components/pagination.wrapper.d.ts +9 -9
- package/lib/components/pagination.wrapper.js +2 -2
- package/lib/components/segmented-control.wrapper.d.ts +9 -9
- package/lib/components/segmented-control.wrapper.js +2 -2
- package/lib/components/stepper-horizontal.wrapper.d.ts +9 -9
- package/lib/components/stepper-horizontal.wrapper.js +2 -2
- package/lib/components/switch.wrapper.d.ts +9 -9
- package/lib/components/switch.wrapper.js +2 -2
- package/lib/components/table.wrapper.d.ts +9 -9
- package/lib/components/table.wrapper.js +2 -2
- package/lib/components/tabs-bar.wrapper.d.ts +9 -9
- package/lib/components/tabs-bar.wrapper.js +2 -2
- package/lib/components/tabs.wrapper.d.ts +9 -9
- package/lib/components/tabs.wrapper.js +2 -2
- package/lib/types.d.ts +20 -19
- package/package.json +2 -2
- package/ssr/components/dist/styles/esm/styles-entry.js +76 -84
- package/ssr/components/dist/utils/esm/utils-entry.js +4 -9
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/inline-notification.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/stepper-horizontal.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs.wrapper.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +5 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +1 -1
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +5 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.js +76 -84
- package/ssr/esm/components/dist/utils/esm/utils-entry.js +5 -9
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/inline-notification.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/stepper-horizontal.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/tabs.wrapper.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +5 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +5 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +1 -1
- package/ssr/lib/components/accordion.wrapper.d.ts +7 -7
- package/ssr/lib/components/banner.wrapper.d.ts +18 -2
- package/ssr/lib/components/carousel.wrapper.d.ts +7 -7
- package/ssr/lib/components/inline-notification.wrapper.d.ts +10 -2
- package/ssr/lib/components/pagination.wrapper.d.ts +9 -9
- package/ssr/lib/components/segmented-control.wrapper.d.ts +9 -9
- package/ssr/lib/components/stepper-horizontal.wrapper.d.ts +9 -9
- package/ssr/lib/components/switch.wrapper.d.ts +9 -9
- package/ssr/lib/components/table.wrapper.d.ts +9 -9
- package/ssr/lib/components/tabs-bar.wrapper.d.ts +9 -9
- package/ssr/lib/components/tabs.wrapper.d.ts +9 -9
- package/ssr/lib/dsr-components/banner.d.ts +2 -0
- package/ssr/lib/dsr-components/inline-notification.d.ts +1 -0
- package/ssr/lib/dsr-components/switch.d.ts +0 -3
- package/ssr/lib/types.d.ts +20 -19
|
@@ -17,8 +17,6 @@ hasWindow &&
|
|
|
17
17
|
.forEach((mutation) => { var _a; return (_a = attributeMutationMap.get(mutation.target)) === null || _a === void 0 ? void 0 : _a(); });
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
// TODO: resolve overlap with Breakpoint type from utilities package
|
|
21
|
-
const BREAKPOINTS = ['base', 'xs', 's', 'm', 'l', 'xl'];
|
|
22
20
|
const parseJSON = (prop) => {
|
|
23
21
|
if (typeof prop === 'string') {
|
|
24
22
|
try {
|
|
@@ -235,14 +233,12 @@ const gridNarrowOffset = {
|
|
|
235
233
|
xxl: gridNarrowOffsetXXL,
|
|
236
234
|
};
|
|
237
235
|
|
|
236
|
+
const breakpoints = ['base', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
237
|
+
|
|
238
238
|
function getMediaQueryMax(max) {
|
|
239
239
|
return `@media(max-width:${breakpoint[max] - 1}px)`;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
function getMediaQueryMinMax(min, max) {
|
|
243
|
-
return `@media(min-width:${breakpoint[min]}px) and (max-width:${breakpoint[max] - 1}px)`;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
242
|
const spacingStaticXSmall = '4px';
|
|
247
243
|
|
|
248
244
|
const spacingStaticSmall = '8px';
|
|
@@ -311,10 +307,7 @@ const textLargeStyle = {
|
|
|
311
307
|
...fontHyphenationStyle,
|
|
312
308
|
};
|
|
313
309
|
|
|
314
|
-
|
|
315
|
-
const mediaQueries = Object.entries(breakpoint)
|
|
316
|
-
.filter(([key]) => key !== 'xxl')
|
|
317
|
-
.map(([, val]) => `(min-width:${val}px)`);
|
|
310
|
+
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
318
311
|
hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
|
|
319
312
|
|
|
320
313
|
Object.entries(breakpoint).reduce((result, [key, val]) => (Object.assign(Object.assign({}, result), { [`${val}px`]: key })), {});
|
|
@@ -3956,7 +3949,7 @@ const formatObjectOutput = (value) => {
|
|
|
3956
3949
|
.replace(/^"(.+)"$/, '$1'); // remove wrapping double quotes
|
|
3957
3950
|
};
|
|
3958
3951
|
'value, ' +
|
|
3959
|
-
formatObjectOutput(
|
|
3952
|
+
formatObjectOutput(breakpoints.reduce((prev, key) => (Object.assign(Object.assign({}, prev), { [key + (key !== 'base' ? '?' : '')]: 'value' })), {})).replace(/"/g, '');
|
|
3960
3953
|
|
|
3961
3954
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3962
3955
|
|
|
@@ -4029,35 +4022,6 @@ const getComponentCss$Y = (size, compact, open, theme) => {
|
|
|
4029
4022
|
} }));
|
|
4030
4023
|
};
|
|
4031
4024
|
|
|
4032
|
-
const easeInQuad = 'cubic-bezier(0.45,0,0.55,1)';
|
|
4033
|
-
const easeOutQuad = 'cubic-bezier(0.5,1,0.89,1)';
|
|
4034
|
-
const ANIMATION_DURATION = 600;
|
|
4035
|
-
const getAnimationIn = (keyframesName, durationVar) => {
|
|
4036
|
-
const duration = durationVar ? `var(${durationVar},${ANIMATION_DURATION}ms)` : `${ANIMATION_DURATION}ms`;
|
|
4037
|
-
return {
|
|
4038
|
-
animation: `${duration} $${keyframesName} ${easeInQuad} forwards`,
|
|
4039
|
-
};
|
|
4040
|
-
};
|
|
4041
|
-
const getAnimationOut = (keyframesName) => ({
|
|
4042
|
-
animation: addImportantToRule(`${ANIMATION_DURATION}ms $${keyframesName} ${easeOutQuad} forwards`),
|
|
4043
|
-
});
|
|
4044
|
-
const getKeyframes = (direction, outsideStyle) => {
|
|
4045
|
-
const insideStyle = { opacity: 1, transform: 'translate3d(0,0,0)' };
|
|
4046
|
-
return direction === 'in'
|
|
4047
|
-
? {
|
|
4048
|
-
from: outsideStyle,
|
|
4049
|
-
to: insideStyle,
|
|
4050
|
-
}
|
|
4051
|
-
: {
|
|
4052
|
-
from: insideStyle,
|
|
4053
|
-
to: outsideStyle,
|
|
4054
|
-
};
|
|
4055
|
-
};
|
|
4056
|
-
const getKeyframesMobile = (direction, bottomVar) => getKeyframes(direction, {
|
|
4057
|
-
opacity: 0,
|
|
4058
|
-
transform: `translate3d(0,calc(var(${bottomVar}) + 100%),0)`, // space before and after "+" is crucial
|
|
4059
|
-
});
|
|
4060
|
-
|
|
4061
4025
|
const TOAST_Z_INDEX = 999999;
|
|
4062
4026
|
const MODAL_Z_INDEX = 99999;
|
|
4063
4027
|
const POPOVER_Z_INDEX = 9999;
|
|
@@ -4067,35 +4031,31 @@ const cssVariableTop = '--p-banner-position-top';
|
|
|
4067
4031
|
const cssVariableBottom = '--p-banner-position-bottom';
|
|
4068
4032
|
const cssVariableAnimationDuration = '--p-animation-duration';
|
|
4069
4033
|
const cssVariableZIndex = '--p-internal-banner-z-index';
|
|
4070
|
-
const
|
|
4071
|
-
const
|
|
4072
|
-
const
|
|
4073
|
-
const
|
|
4074
|
-
|
|
4075
|
-
transform: `translate3d(0,calc(-100% - var(${topVar})),0)`, // space before and after "-" is crucial
|
|
4076
|
-
});
|
|
4077
|
-
const getComponentCss$X = () => {
|
|
4034
|
+
const ANIMATION_DURATION$1 = 600;
|
|
4035
|
+
const duration$1 = `var(${cssVariableAnimationDuration},${ANIMATION_DURATION$1}ms)`;
|
|
4036
|
+
const easeInQuad$1 = 'cubic-bezier(0.45,0,0.55,1)';
|
|
4037
|
+
const easeOutQuad$1 = 'cubic-bezier(0.5,1,0.89,1)';
|
|
4038
|
+
const getComponentCss$X = (isOpen) => {
|
|
4078
4039
|
return getCss({
|
|
4079
4040
|
'@global': {
|
|
4080
|
-
':host':
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4041
|
+
':host': addImportantToEachRule(Object.assign(Object.assign(Object.assign(Object.assign({ [cssVariableTop]: '56px', [cssVariableBottom]: '56px', position: 'fixed', top: 'auto', bottom: `var(${cssVariableBottom})`, left: gridExtendedOffsetBase, right: gridExtendedOffsetBase, margin: 0, padding: 0, width: 'auto', maxWidth: '100%', zIndex: `var(${cssVariableZIndex},${BANNER_Z_INDEX})` }, dropShadowHighStyle), (isOpen
|
|
4042
|
+
? {
|
|
4043
|
+
opacity: 1,
|
|
4044
|
+
visibility: 'inherit',
|
|
4045
|
+
transform: 'translate3d(0,0,0)',
|
|
4046
|
+
transition: `opacity ${duration$1} ${easeInQuad$1}, transform ${duration$1} ${easeInQuad$1}`,
|
|
4047
|
+
}
|
|
4048
|
+
: {
|
|
4049
|
+
opacity: 0,
|
|
4050
|
+
visibility: 'hidden',
|
|
4051
|
+
transform: `translate3d(0,calc(var(${cssVariableBottom}) + 100%),0)`,
|
|
4052
|
+
'&(.hydrated),&(.ssr)': {
|
|
4053
|
+
transition: `visibility 0s linear ${duration$1}, opacity ${duration$1} ${easeOutQuad$1}, transform ${duration$1} ${easeOutQuad$1}`,
|
|
4054
|
+
},
|
|
4055
|
+
})), { [getMediaQueryMin('s')]: Object.assign({ top: `var(${cssVariableTop})`, bottom: 'auto', left: gridExtendedOffsetS, right: gridExtendedOffsetS }, (!isOpen && { transform: `translate3d(0,calc(-100% - var(${cssVariableTop})),0)` })), [getMediaQueryMin('xxl')]: {
|
|
4086
4056
|
left: gridExtendedOffsetXXL,
|
|
4087
4057
|
right: gridExtendedOffsetXXL,
|
|
4088
|
-
} }), hostHiddenStyles))
|
|
4089
|
-
[mediaQueryBaseToS]: getAnimationIn('mobileIn', cssVariableAnimationDuration),
|
|
4090
|
-
[mediaQueryS$1]: getAnimationIn('desktopIn', cssVariableAnimationDuration),
|
|
4091
|
-
}, '&(.banner--close)': {
|
|
4092
|
-
[mediaQueryBaseToS]: getAnimationOut('mobileOut'),
|
|
4093
|
-
[mediaQueryS$1]: getAnimationOut('desktopOut'),
|
|
4094
|
-
} }),
|
|
4095
|
-
'@keyframes mobileIn': getKeyframesMobile('in', cssVariableBottom),
|
|
4096
|
-
'@keyframes mobileOut': getKeyframesMobile('out', cssVariableBottom),
|
|
4097
|
-
'@keyframes desktopIn': getKeyframesDesktop('in', cssVariableTop),
|
|
4098
|
-
'@keyframes desktopOut': getKeyframesDesktop('out', cssVariableTop),
|
|
4058
|
+
} }), hostHiddenStyles)),
|
|
4099
4059
|
},
|
|
4100
4060
|
});
|
|
4101
4061
|
};
|
|
@@ -4392,7 +4352,7 @@ const getComponentCss$T = (icon, iconSource, variant, hideLabel, disabled, loadi
|
|
|
4392
4352
|
backgroundColor,
|
|
4393
4353
|
borderColor,
|
|
4394
4354
|
color: textColor,
|
|
4395
|
-
})), (
|
|
4355
|
+
})), (loading && !isPrimary && frostedGlassStyle)) }, (loading && {
|
|
4396
4356
|
spinner: {
|
|
4397
4357
|
width: fontLineHeight,
|
|
4398
4358
|
height: fontLineHeight,
|
|
@@ -4890,6 +4850,9 @@ const filterDarkContrastLow = toFilter([20, 7, 421, 202, 97, 82]);
|
|
|
4890
4850
|
const filterDarkContrastMedium = toFilter([66, 3, 333, 187, 82, 86]);
|
|
4891
4851
|
const filterDarkContrastHigh = toFilter([68, 6, 108, 187, 104, 88]);
|
|
4892
4852
|
|
|
4853
|
+
const filterLightDisabled = toFilter([63, 8, 108, 188, 94, 86]);
|
|
4854
|
+
const filterDarkDisabled = toFilter([52, 6, 135, 187, 94, 89]);
|
|
4855
|
+
|
|
4893
4856
|
const filterLightNotificationSuccess = toFilter([28, 89, 572, 71, 111, 98]);
|
|
4894
4857
|
const filterLightNotificationWarning = toFilter([58, 53, 820, 12, 112, 103]);
|
|
4895
4858
|
const filterLightNotificationError = toFilter([14, 75, 4140, 347, 100, 97]);
|
|
@@ -4913,7 +4876,7 @@ const sizeMap$2 = {
|
|
|
4913
4876
|
const filter = {
|
|
4914
4877
|
light: {
|
|
4915
4878
|
primary: filterLightPrimary,
|
|
4916
|
-
'state-disabled':
|
|
4879
|
+
'state-disabled': filterLightDisabled,
|
|
4917
4880
|
'contrast-low': filterLightContrastLow,
|
|
4918
4881
|
'contrast-medium': filterLightContrastMedium,
|
|
4919
4882
|
'contrast-high': filterLightContrastHigh,
|
|
@@ -4924,7 +4887,7 @@ const filter = {
|
|
|
4924
4887
|
},
|
|
4925
4888
|
dark: {
|
|
4926
4889
|
primary: filterDarkPrimary,
|
|
4927
|
-
'state-disabled':
|
|
4890
|
+
'state-disabled': filterDarkDisabled,
|
|
4928
4891
|
'contrast-low': filterDarkContrastLow,
|
|
4929
4892
|
'contrast-medium': filterDarkContrastMedium,
|
|
4930
4893
|
'contrast-high': filterDarkContrastHigh,
|
|
@@ -5161,38 +5124,42 @@ const isFullscreenForXl = (fullscreen) => {
|
|
|
5161
5124
|
const entries = Object.entries(fullscreenParsed);
|
|
5162
5125
|
const [lastTrueBreakpoint] = entries.filter(([, val]) => val).pop() || [];
|
|
5163
5126
|
const [lastFalseBreakpoint] = entries.filter(([, val]) => !val).pop() || [];
|
|
5164
|
-
return
|
|
5127
|
+
return breakpoints.indexOf(lastTrueBreakpoint) > breakpoints.indexOf(lastFalseBreakpoint);
|
|
5165
5128
|
}
|
|
5166
5129
|
};
|
|
5167
5130
|
const getSlottedJssStyle = (marginValue, hasHeader, hasDismissButton) => {
|
|
5168
5131
|
const marginPx = `${-marginValue}px`;
|
|
5169
|
-
const marginRem = pxToRemWithUnit(-marginValue);
|
|
5170
5132
|
return Object.assign(Object.assign({ [`&(.${stretchToFullModalWidthClassName})`]: {
|
|
5171
5133
|
width: `calc(100% + ${marginValue * 2}px)`,
|
|
5172
5134
|
margin: `0 ${marginPx}`,
|
|
5173
5135
|
} }, (!hasHeader && {
|
|
5174
5136
|
[`&(.${stretchToFullModalWidthClassName}:first-child)`]: {
|
|
5175
|
-
marginTop: hasDismissButton ?
|
|
5137
|
+
marginTop: hasDismissButton ? pxToRemWithUnit(-marginValue) : marginPx,
|
|
5176
5138
|
},
|
|
5177
5139
|
})), { [`&(.${stretchToFullModalWidthClassName}:last-child)`]: {
|
|
5178
5140
|
marginBottom: marginPx,
|
|
5179
5141
|
} });
|
|
5180
5142
|
};
|
|
5181
|
-
const getComponentCss$x = (
|
|
5182
|
-
const isFullscreenForXlAndXxl = isFullscreenForXl(
|
|
5143
|
+
const getComponentCss$x = (isOpen, isFullscreen, hasDismissButton, hasHeader) => {
|
|
5144
|
+
const isFullscreenForXlAndXxl = isFullscreenForXl(isFullscreen);
|
|
5145
|
+
const duration = isOpen ? '.6s' : '.2s';
|
|
5183
5146
|
return getCss(Object.assign(Object.assign({ '@global': {
|
|
5184
|
-
':host': Object.assign(Object.assign({}, addImportantToEachRule(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ position: 'fixed' }, getInsetJssStyle()), { zIndex: MODAL_Z_INDEX, display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap' }), (
|
|
5147
|
+
':host': Object.assign(Object.assign({}, addImportantToEachRule(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ position: 'fixed' }, getInsetJssStyle()), { zIndex: MODAL_Z_INDEX, display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap' }), (isOpen
|
|
5185
5148
|
? {
|
|
5186
|
-
opacity: 1,
|
|
5187
5149
|
visibility: 'inherit',
|
|
5188
5150
|
}
|
|
5189
5151
|
: {
|
|
5190
|
-
opacity: 0,
|
|
5191
5152
|
visibility: 'hidden',
|
|
5153
|
+
transition: 'visibility 0s linear .2s',
|
|
5192
5154
|
})), hostHiddenStyles), {
|
|
5193
5155
|
// workaround via pseudo element to fix stacking (black) background in safari
|
|
5194
|
-
'&::before': Object.assign(Object.assign(Object.assign(Object.assign({ content: '""', position: 'fixed' }, getInsetJssStyle()), { background: themeDarkBackgroundShading
|
|
5195
|
-
|
|
5156
|
+
'&::before': Object.assign(Object.assign(Object.assign(Object.assign({ content: '""', position: 'fixed' }, getInsetJssStyle()), { background: themeDarkBackgroundShading, pointerEvents: 'none' }), (isOpen
|
|
5157
|
+
? Object.assign({ opacity: 1 }, frostedGlassStyle) : {
|
|
5158
|
+
opacity: 0,
|
|
5159
|
+
backdropFilter: 'blur(0px)',
|
|
5160
|
+
WebkitBackdropFilter: 'blur(0px)',
|
|
5161
|
+
})), { transition: `opacity ${duration} ${transitionTimingFunction}, backdrop-filter ${duration} ${transitionTimingFunction},--webkit-backdrop-filter ${duration} ${transitionTimingFunction}` }) }))), { overflowY: 'auto' }),
|
|
5162
|
+
'::slotted': addImportantToEachRule(Object.assign({}, mergeDeep(getSlottedJssStyle(32, hasHeader, hasDismissButton), buildResponsiveStyles(isFullscreen, (fullscreenValue) => ({
|
|
5196
5163
|
[`&(.${stretchToFullModalWidthClassName}`]: {
|
|
5197
5164
|
'&:first-child)': {
|
|
5198
5165
|
borderRadius: fullscreenValue ? 0 : '8px 8px 0 0',
|
|
@@ -5206,19 +5173,20 @@ const getComponentCss$x = (open, fullscreen, hasDismissButton, hasHeader) => {
|
|
|
5206
5173
|
}, root: mergeDeep({
|
|
5207
5174
|
position: 'relative',
|
|
5208
5175
|
boxSizing: 'border-box',
|
|
5209
|
-
|
|
5210
|
-
|
|
5176
|
+
transform: isOpen ? 'scale3d(1,1,1)' : 'scale3d(.9,.9,1)',
|
|
5177
|
+
opacity: isOpen ? 1 : 0,
|
|
5178
|
+
transition: `opacity ${duration} ${transitionTimingFunction},transform ${duration} ${transitionTimingFunction}`,
|
|
5211
5179
|
padding: hasDismissButton ? `${pxToRemWithUnit(32)} 32px 32px 32px` : '32px',
|
|
5212
5180
|
background: backgroundColor,
|
|
5213
5181
|
outline: 0,
|
|
5214
|
-
'&:focus::before': Object.assign({ content: '""', position: 'fixed', border: `${borderWidthBase} solid`, pointerEvents: 'none' }, buildResponsiveStyles(
|
|
5182
|
+
'&:focus::before': Object.assign({ content: '""', position: 'fixed', border: `${borderWidthBase} solid`, pointerEvents: 'none' }, buildResponsiveStyles(isFullscreen, (fullscreenValue) => (Object.assign({ borderRadius: fullscreenValue ? 0 : '12px', borderColor: fullscreenValue ? lightThemePrimaryColor : darkThemePrimaryColor }, getInsetJssStyle(fullscreenValue ? 0 : -4))))),
|
|
5215
5183
|
'&:not(:focus-visible)::before': {
|
|
5216
5184
|
border: 0,
|
|
5217
5185
|
},
|
|
5218
5186
|
[mediaQueryXl]: {
|
|
5219
5187
|
margin: isFullscreenForXlAndXxl ? 0 : `min(192px, 10vh) ${gridExtendedOffsetBase}`,
|
|
5220
5188
|
},
|
|
5221
|
-
}, buildResponsiveStyles(
|
|
5189
|
+
}, buildResponsiveStyles(isFullscreen, getFullscreenJssStyles)) }, (hasHeader && {
|
|
5222
5190
|
header: {
|
|
5223
5191
|
padding: '0 0 8px',
|
|
5224
5192
|
},
|
|
@@ -6338,6 +6306,26 @@ const getComponentCss$3 = (isDisabled, hideLabel, state, hasCounter, theme) => {
|
|
|
6338
6306
|
|
|
6339
6307
|
const cssVariablePositionBottom = '--p-toast-position-bottom'; // CSS custom property exposed as public interface
|
|
6340
6308
|
const cssVariablePositionBottomInternal = '--p-internal-toast-position-bottom';
|
|
6309
|
+
const easeInQuad = 'cubic-bezier(0.45,0,0.55,1)';
|
|
6310
|
+
const easeOutQuad = 'cubic-bezier(0.5,1,0.89,1)';
|
|
6311
|
+
const ANIMATION_DURATION = 600;
|
|
6312
|
+
const duration = `${ANIMATION_DURATION}ms`;
|
|
6313
|
+
const getKeyframes = (direction, outsideStyle) => {
|
|
6314
|
+
const insideStyle = { opacity: 1, transform: 'translate3d(0,0,0)' };
|
|
6315
|
+
return direction === 'in'
|
|
6316
|
+
? {
|
|
6317
|
+
from: outsideStyle,
|
|
6318
|
+
to: insideStyle,
|
|
6319
|
+
}
|
|
6320
|
+
: {
|
|
6321
|
+
from: insideStyle,
|
|
6322
|
+
to: outsideStyle,
|
|
6323
|
+
};
|
|
6324
|
+
};
|
|
6325
|
+
const getKeyframesMobile = (direction, bottomVar) => getKeyframes(direction, {
|
|
6326
|
+
opacity: 0,
|
|
6327
|
+
transform: `translate3d(0,calc(var(${bottomVar}) + 100%),0)`, // space before and after "+" is crucial
|
|
6328
|
+
});
|
|
6341
6329
|
const toastCloseClassName = 'close';
|
|
6342
6330
|
const getComponentCss$1 = () => {
|
|
6343
6331
|
return getCss({
|
|
@@ -6354,8 +6342,12 @@ const getComponentCss$1 = () => {
|
|
|
6354
6342
|
'@keyframes in': getKeyframesMobile('in', cssVariablePositionBottomInternal),
|
|
6355
6343
|
'@keyframes out': getKeyframesMobile('out', cssVariablePositionBottomInternal),
|
|
6356
6344
|
},
|
|
6357
|
-
hydrated:
|
|
6358
|
-
|
|
6345
|
+
hydrated: {
|
|
6346
|
+
animation: `${duration} $in ${easeInQuad} forwards`,
|
|
6347
|
+
},
|
|
6348
|
+
[toastCloseClassName]: {
|
|
6349
|
+
animation: addImportantToRule(`${ANIMATION_DURATION}ms $out ${easeOutQuad} forwards`),
|
|
6350
|
+
},
|
|
6359
6351
|
});
|
|
6360
6352
|
};
|
|
6361
6353
|
|
|
@@ -81,9 +81,6 @@ hasWindow &&
|
|
|
81
81
|
.forEach((mutation) => { var _a; return (_a = attributeMutationMap.get(mutation.target)) === null || _a === void 0 ? void 0 : _a(); });
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
// TODO: resolve overlap with Breakpoint type from utilities package
|
|
85
|
-
const BREAKPOINTS = ['base', 'xs', 's', 'm', 'l', 'xl'];
|
|
86
|
-
|
|
87
84
|
const borderWidthBase = '2px';
|
|
88
85
|
|
|
89
86
|
const themeLightStateFocus = '#1A44EA';
|
|
@@ -135,6 +132,8 @@ function getMediaQueryMin(min) {
|
|
|
135
132
|
return `@media(min-width:${breakpoint[min]}px)`;
|
|
136
133
|
}
|
|
137
134
|
|
|
135
|
+
const breakpoints = ['base', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
136
|
+
|
|
138
137
|
const _textFontPartA = `${fontStyleNormal} ${fontVariant} ${fontWeightRegular} `;
|
|
139
138
|
const _textFontPartB = `/${fontLineHeight} ${fontFamily}`;
|
|
140
139
|
|
|
@@ -148,10 +147,7 @@ const textSmallStyle = {
|
|
|
148
147
|
...fontHyphenationStyle,
|
|
149
148
|
};
|
|
150
149
|
|
|
151
|
-
|
|
152
|
-
const mediaQueries = Object.entries(breakpoint)
|
|
153
|
-
.filter(([key]) => key !== 'xxl')
|
|
154
|
-
.map(([, val]) => `(min-width:${val}px)`);
|
|
150
|
+
const mediaQueries = Object.values(breakpoint).map((v) => `(min-width:${v}px)`);
|
|
155
151
|
hasWindow && window.matchMedia ? mediaQueries.map(window.matchMedia) : [];
|
|
156
152
|
|
|
157
153
|
Object.entries(breakpoint).reduce((result, [key, val]) => (Object.assign(Object.assign({}, result), { [`${val}px`]: key })), {});
|
|
@@ -3692,7 +3688,7 @@ const formatObjectOutput = (value) => {
|
|
|
3692
3688
|
.replace(/^"(.+)"$/, '$1'); // remove wrapping double quotes
|
|
3693
3689
|
};
|
|
3694
3690
|
'value, ' +
|
|
3695
|
-
formatObjectOutput(
|
|
3691
|
+
formatObjectOutput(breakpoints.reduce((prev, key) => (Object.assign(Object.assign({}, prev), { [key + (key !== 'base' ? '?' : '')]: 'value' })), {})).replace(/"/g, '');
|
|
3696
3692
|
|
|
3697
3693
|
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3698
3694
|
const resizeMap = new Map();
|
|
@@ -4094,7 +4090,6 @@ const getTextTagType = (host, tag) => {
|
|
|
4094
4090
|
}
|
|
4095
4091
|
};
|
|
4096
4092
|
|
|
4097
|
-
exports.BREAKPOINTS = BREAKPOINTS;
|
|
4098
4093
|
exports.DISPLAY_TAGS = DISPLAY_TAGS;
|
|
4099
4094
|
exports.HEADING_TAGS = HEADING_TAGS;
|
|
4100
4095
|
exports.HEADLINE_TAGS = HEADLINE_TAGS;
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.js
CHANGED
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var accordion = require('../dsr-components/accordion.js');
|
|
8
8
|
|
|
9
|
-
const PAccordion = react.forwardRef(({ compact, heading, onAccordionChange,
|
|
9
|
+
const PAccordion = react.forwardRef(({ compact, heading, onAccordionChange, onUpdate, open, size = 'small', tag = 'h2', theme = 'light', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'accordionChange', onAccordionChange);
|
|
12
|
-
hooks.useEventCallback(elementRef, '
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-accordion');
|
|
14
14
|
const propsToSync = [compact, heading, open, size, tag, theme];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.js
CHANGED
|
@@ -6,14 +6,14 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var banner = require('../dsr-components/banner.js');
|
|
8
8
|
|
|
9
|
-
const PBanner = react.forwardRef(({ description = '', heading = '', onDismiss,
|
|
9
|
+
const PBanner = react.forwardRef(({ description = '', dismissButton = true, heading = '', onDismiss, open = false, persistent, state = 'info', theme = 'light', width, className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-banner');
|
|
13
|
-
const propsToSync = [description, heading, persistent, state, theme, width];
|
|
13
|
+
const propsToSync = [description, dismissButton, heading, open, persistent, state, theme, width];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['description', 'heading', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['description', 'dismissButton', 'heading', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PBanner = react.forwardRef(({ description = '', heading = '', onDismiss, p
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(banner.DSRBanner, { ...{ description, heading, persistent, state, theme, width, children } })),
|
|
27
|
+
children: (jsxRuntime.jsx(banner.DSRBanner, { ...{ description, dismissButton, heading, open, persistent, state, theme, width, children } })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js
CHANGED
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var carousel = require('../dsr-components/carousel.js');
|
|
8
8
|
|
|
9
|
-
const PCarousel = react.forwardRef(({ activeSlideIndex = 0, alignHeader = 'left', description, disablePagination, heading, intl, onCarouselChange,
|
|
9
|
+
const PCarousel = react.forwardRef(({ activeSlideIndex = 0, alignHeader = 'left', description, disablePagination, heading, intl, onCarouselChange, onUpdate, pagination = true, rewind = true, slidesPerPage = 1, theme = 'light', width = 'basic', wrapContent, className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'carouselChange', onCarouselChange);
|
|
12
|
-
hooks.useEventCallback(elementRef, '
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-carousel');
|
|
14
14
|
const propsToSync = [activeSlideIndex, alignHeader, description, disablePagination, heading, intl, pagination, rewind, slidesPerPage, theme, width, wrapContent];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -6,15 +6,15 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var inlineNotification = require('../dsr-components/inline-notification.js');
|
|
8
8
|
|
|
9
|
-
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', heading = '', onAction, onDismiss, persistent
|
|
9
|
+
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', onAction, onDismiss, persistent, state = 'info', theme = 'light', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'action', onAction);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-inline-notification');
|
|
14
|
-
const propsToSync = [actionIcon, actionLabel, actionLoading, description, heading, persistent, state, theme];
|
|
14
|
+
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
if (!process.browser) {
|
|
@@ -25,7 +25,7 @@ const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', acti
|
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
...(!process.browser
|
|
27
27
|
? {
|
|
28
|
-
children: (jsxRuntime.jsx(inlineNotification.DSRInlineNotification, { ...{ actionIcon, actionLabel, actionLoading, description, heading, persistent, state, theme, children } })),
|
|
28
|
+
children: (jsxRuntime.jsx(inlineNotification.DSRInlineNotification, { ...{ actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme, children } })),
|
|
29
29
|
}
|
|
30
30
|
: {
|
|
31
31
|
children,
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js
CHANGED
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var pagination = require('../dsr-components/pagination.js');
|
|
8
8
|
|
|
9
|
-
const PPagination = react.forwardRef(({ activePage = 1, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl = { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }, itemsPerPage = 1, maxNumberOfPageLinks = { base: 5, xs: 7, },
|
|
9
|
+
const PPagination = react.forwardRef(({ activePage = 1, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl = { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }, itemsPerPage = 1, maxNumberOfPageLinks = { base: 5, xs: 7, }, onPageChange, onUpdate, theme = 'light', totalItemsCount = 1, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'pageChange', onPageChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-pagination');
|
|
14
14
|
const propsToSync = [activePage, allyLabel, allyLabelNext, allyLabelPage, allyLabelPrev, intl, itemsPerPage, maxNumberOfPageLinks, theme, totalItemsCount];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var segmentedControl = require('../dsr-components/segmented-control.js');
|
|
8
8
|
|
|
9
|
-
const PSegmentedControl = react.forwardRef(({ backgroundColor,
|
|
9
|
+
const PSegmentedControl = react.forwardRef(({ backgroundColor, onSegmentedControlChange, onUpdate, theme = 'light', value, className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-segmented-control');
|
|
14
14
|
const propsToSync = [backgroundColor, theme, value];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var stepperHorizontal = require('../dsr-components/stepper-horizontal.js');
|
|
8
8
|
|
|
9
|
-
const PStepperHorizontal = react.forwardRef(({
|
|
9
|
+
const PStepperHorizontal = react.forwardRef(({ onStepChange, onUpdate, size = 'small', theme = 'light', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'stepChange', onStepChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-stepper-horizontal');
|
|
14
14
|
const propsToSync = [size, theme];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.js
CHANGED
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var _switch = require('../dsr-components/switch.js');
|
|
8
8
|
|
|
9
|
-
const PSwitch = react.forwardRef(({ alignLabel = 'right', checked = false, disabled = false, hideLabel = false, loading = false,
|
|
9
|
+
const PSwitch = react.forwardRef(({ alignLabel = 'right', checked = false, disabled = false, hideLabel = false, loading = false, onSwitchChange, onUpdate, stretch = false, theme = 'light', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'switchChange', onSwitchChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-switch');
|
|
14
14
|
const propsToSync = [alignLabel, checked, disabled, hideLabel, loading, stretch, theme];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var table = require('../dsr-components/table.js');
|
|
8
8
|
|
|
9
|
-
const PTable = react.forwardRef(({ caption,
|
|
9
|
+
const PTable = react.forwardRef(({ caption, onSortingChange, onUpdate, theme = 'light', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'sortingChange', onSortingChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-table');
|
|
14
14
|
const propsToSync = [caption, theme];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.js
CHANGED
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var tabsBar = require('../dsr-components/tabs-bar.js');
|
|
8
8
|
|
|
9
|
-
const PTabsBar = react.forwardRef(({ activeTabIndex, gradientColor = 'background-base', gradientColorScheme,
|
|
9
|
+
const PTabsBar = react.forwardRef(({ activeTabIndex, gradientColor = 'background-base', gradientColorScheme, onTabChange, onUpdate, size = 'small', theme = 'light', weight = 'regular', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'tabChange', onTabChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-tabs-bar');
|
|
14
14
|
const propsToSync = [activeTabIndex, gradientColor, gradientColorScheme, size, theme, weight];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -6,10 +6,10 @@ var hooks = require('../../hooks.js');
|
|
|
6
6
|
var utils = require('../../utils.js');
|
|
7
7
|
var tabs = require('../dsr-components/tabs.js');
|
|
8
8
|
|
|
9
|
-
const PTabs = react.forwardRef(({ activeTabIndex = 0, gradientColor = 'background-base', gradientColorScheme,
|
|
9
|
+
const PTabs = react.forwardRef(({ activeTabIndex = 0, gradientColor = 'background-base', gradientColorScheme, onTabChange, onUpdate, size = 'small', theme = 'light', weight = 'regular', className, children, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
|
-
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
12
11
|
hooks.useEventCallback(elementRef, 'tabChange', onTabChange);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-tabs');
|
|
14
14
|
const propsToSync = [activeTabIndex, gradientColor, gradientColorScheme, size, theme, weight];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
@@ -68,11 +68,14 @@ var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
|
|
|
68
68
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
|
|
69
69
|
|
|
70
70
|
class DSRBanner extends react.Component {
|
|
71
|
+
get hasDismissButton() {
|
|
72
|
+
return this.props.persistent ? false : this.props.dismissButton;
|
|
73
|
+
}
|
|
71
74
|
render() {
|
|
72
75
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
73
76
|
const hasTitleSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
74
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getBannerCss()));
|
|
75
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(inlineNotification_wrapper.PInlineNotification, { heading: this.props.heading, description: this.props.description, state: this.props.state,
|
|
77
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getBannerCss(this.props.open)));
|
|
78
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(inlineNotification_wrapper.PInlineNotification, { heading: this.props.heading, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": !this.props.open ? 'true' : 'false', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsxRuntime.jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsxRuntime.jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsxRuntime.jsx("slot", { name: "description" })] })] }), this.props.children] }));
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -72,7 +72,7 @@ class DSRButton extends react.Component {
|
|
|
72
72
|
render() {
|
|
73
73
|
splitChildren.splitChildren(this.props.children);
|
|
74
74
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getButtonCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.theme)));
|
|
75
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("button", { ...utilsEntry.getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, children: [this.props.loading && (jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: utilsEntry.getLinkButtonThemeForIcon(this.props.variant, this.props.theme), aria: { 'aria-label': 'Loading state:' } })), utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color:
|
|
75
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("button", { ...utilsEntry.getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, children: [this.props.loading && (jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: utilsEntry.getLinkButtonThemeForIcon(this.props.variant, this.props.theme), aria: { 'aria-label': 'Loading state:' } })), utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: this.props.disabled ? (this.props.variant === 'primary' ? 'contrast-high' : 'state-disabled') : 'primary', theme: !this.props.disabled ? utilsEntry.getLinkButtonThemeForIcon(this.props.variant, this.props.theme) : this.props.theme, "aria-hidden": "true" })), jsxRuntime.jsx("span", { className: "label", children: jsxRuntime.jsx("slot", {}) })] })] }), this.props.children] }));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -69,13 +69,16 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
|
|
|
69
69
|
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.js');
|
|
70
70
|
|
|
71
71
|
class DSRInlineNotification extends react.Component {
|
|
72
|
+
get hasDismissButton() {
|
|
73
|
+
return this.props.persistent ? false : this.props.dismissButton;
|
|
74
|
+
}
|
|
72
75
|
render() {
|
|
73
76
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
74
77
|
const bannerId = 'banner';
|
|
75
78
|
const labelId = 'label';
|
|
76
79
|
const descriptionId = 'description';
|
|
77
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel,
|
|
78
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: `notification-${this.props.state}`, theme: this.props.theme, "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsxRuntime.jsx("h5", { id: labelId, children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }), jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", theme: this.props.theme, icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })),
|
|
80
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel, this.hasDismissButton, this.props.theme)));
|
|
81
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: `notification-${this.props.state}`, theme: this.props.theme, "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsxRuntime.jsx("h5", { id: labelId, children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }), jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", theme: this.props.theme, icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.hasDismissButton && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", icon: "close", theme: this.props.theme, hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -78,7 +78,7 @@ class DSRTabs extends react.Component {
|
|
|
78
78
|
? { ...child, props: { ...child.props, theme: this.props.theme, hidden: this.props.activeTabIndex !== i ? true : null } }
|
|
79
79
|
: child);
|
|
80
80
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTabsCss()));
|
|
81
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(tabsBar_wrapper.PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, gradientColor: this.props.gradientColor, activeTabIndex: this.props.activeTabIndex, children: otherChildren.map((tab, index) => (jsxRuntime.jsx("button", { type: "button", children: typeof tab === 'object' && 'props' in tab && tab.props.label }, index))) }), jsxRuntime.jsx("slot", {})] })] }), manipulatedChildren] }));
|
|
81
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(tabsBar_wrapper.PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, gradientColor: this.props.gradientColor, activeTabIndex: this.props.activeTabIndex, onUpdate: this.props.onTabsBarUpdate, children: otherChildren.map((tab, index) => (jsxRuntime.jsx("button", { type: "button", children: typeof tab === 'object' && 'props' in tab && tab.props.label }, index))) }), jsxRuntime.jsx("slot", {})] })] }), manipulatedChildren] }));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|