@porsche-design-system/components-react 3.18.0 → 3.19.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/cjs/lib/components/canvas.wrapper.cjs +3 -5
- package/cjs/lib/components/carousel.wrapper.cjs +3 -3
- package/esm/lib/components/canvas.wrapper.d.ts +13 -21
- package/esm/lib/components/canvas.wrapper.mjs +4 -6
- package/esm/lib/components/carousel.wrapper.d.ts +17 -1
- package/esm/lib/components/carousel.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +8 -7
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +244 -63
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.cjs +4 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs +16 -21
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs +3 -2
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +244 -63
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.mjs +5 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +16 -21
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +3 -2
- package/ssr/esm/lib/components/canvas.wrapper.d.ts +13 -21
- package/ssr/esm/lib/components/carousel.wrapper.d.ts +17 -1
- package/ssr/esm/lib/dsr-components/canvas.d.ts +5 -4
- package/ssr/esm/lib/dsr-components/carousel.d.ts +1 -0
- package/ssr/esm/lib/types.d.ts +8 -7
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs
CHANGED
|
@@ -116,13 +116,13 @@ class DSRCarousel extends react.Component {
|
|
|
116
116
|
// 'aria-controls': 'splide-track', // TODO: cross shadow dom? use native button tag instead of p-button-pure?
|
|
117
117
|
};
|
|
118
118
|
const headingId = 'heading';
|
|
119
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCarouselCss(hasHeadingPropOrSlot, hasDescriptionPropOrSlot, hasControlsSlot, this.props.headingSize, this.props.width,
|
|
119
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCarouselCss(this.props.gradientColor, hasHeadingPropOrSlot, hasDescriptionPropOrSlot, hasControlsSlot, this.props.headingSize, this.props.width,
|
|
120
120
|
// flip boolean values of disablePagination since it is the inverse of pagination
|
|
121
121
|
this.props.disablePagination
|
|
122
122
|
? typeof this.props.disablePagination === 'object'
|
|
123
123
|
? Object.fromEntries(Object.entries(this.props.disablePagination).map(([key, value]) => [key, !value]))
|
|
124
124
|
: !this.props.disablePagination
|
|
125
|
-
: this.props.pagination, utilsEntry.isInfinitePagination(this.props.amountOfPages), (alignHeaderDeprecationMap[this.props.alignHeader] ||
|
|
125
|
+
: this.props.pagination, utilsEntry.isInfinitePagination(this.props.focusOnCenterSlide ? this.slides.length : this.props.amountOfPages), (alignHeaderDeprecationMap[this.props.alignHeader] ||
|
|
126
126
|
this.props.alignHeader), this.props.theme, (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length))));
|
|
127
127
|
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.jsxs("div", { className: "header", children: [hasHeadingPropOrSlot &&
|
|
128
128
|
(this.props.heading ? (jsxRuntime.jsx("h2", { className: "heading", id: headingId, children: this.props.heading })) : (jsxRuntime.jsx("div", { className: "heading", id: headingId, children: jsxRuntime.jsx("slot", { name: "heading" }) }))), hasDescriptionPropOrSlot && (this.props.description ? jsxRuntime.jsx("p", { children: this.props.description }) : jsxRuntime.jsx("slot", { name: "description" })), hasControlsSlot && jsxRuntime.jsx("slot", { name: "controls" }), jsxRuntime.jsxs("div", { className: "nav", children: [this.props.skipLinkTarget && (jsxRuntime.jsx(linkPure_wrapper.PLinkPure, { href: this.props.skipLinkTarget, theme: this.props.theme, icon: "arrow-last", className: "btn skip-link", alignLabel: "start", hideLabel: true, children: "Skip carousel entries" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" })), (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" }))] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", ...utilsEntry.parseAndGetAriaAttributes({
|
|
@@ -130,6 +130,7 @@ class DSRCarousel extends react.Component {
|
|
|
130
130
|
...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
|
|
131
131
|
}), children: jsxRuntime.jsx("div", { className: "splide__track", children: jsxRuntime.jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsxRuntime.jsx("div", { className: "splide__slide", children: jsxRuntime.jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), (this.props.disablePagination ? this.props.disablePagination !== true : this.props.pagination) && (this.props.slidesPerPage === 'auto' || typeof this.props.slidesPerPage === 'object' || this.props.slidesPerPage < otherChildren.length) && (jsxRuntime.jsx("div", { className: "pagination-container", "aria-hidden": "true", children: jsxRuntime.jsx("div", { className: "pagination" }) }))] })] }), this.props.children] }));
|
|
132
132
|
}
|
|
133
|
+
getPageCount = () => (this.props.focusOnCenterSlide ? this.slides.length : this.props.amountOfPages);
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
exports.DSRCarousel = DSRCarousel;
|
|
@@ -4706,16 +4706,14 @@ const getComponentCss$13 = (icon, iconSource, variant, hideLabel, disabled, load
|
|
|
4706
4706
|
}));
|
|
4707
4707
|
};
|
|
4708
4708
|
|
|
4709
|
-
const
|
|
4710
|
-
const
|
|
4711
|
-
// TODO: maybe default grid gap would also work
|
|
4709
|
+
const cssVarSidebarStartWidth = '--p-canvas-sidebar-start-width';
|
|
4710
|
+
const cssVarSidebarEndWidth = '--p-canvas-sidebar-end-width';
|
|
4712
4711
|
const gridProductiveGap = gridGap.replace('36px', '24px');
|
|
4713
4712
|
const mediaQueryDesktopView = getMediaQueryMin('m');
|
|
4714
|
-
const
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
};
|
|
4718
|
-
const getComponentCss$12 = (isSidebarStartOpen, sidebarStartWidth, isSidebarEndOpen, sidebarEndWidth) => {
|
|
4713
|
+
const sidebarWidth = '320px';
|
|
4714
|
+
const headerHeight = 'calc(1.5rem + 28px)';
|
|
4715
|
+
const getComponentCss$12 = (theme, isSidebarStartOpen, isSidebarEndOpen) => {
|
|
4716
|
+
const { primaryColor, backgroundColor, backgroundSurfaceColor } = getThemedColors(theme);
|
|
4719
4717
|
return getCss({
|
|
4720
4718
|
'@global': {
|
|
4721
4719
|
':host': {
|
|
@@ -4726,7 +4724,71 @@ const getComponentCss$12 = (isSidebarStartOpen, sidebarStartWidth, isSidebarEndO
|
|
|
4726
4724
|
}),
|
|
4727
4725
|
},
|
|
4728
4726
|
...preventFoucOfNestedElementsStyles,
|
|
4729
|
-
'
|
|
4727
|
+
'::slotted': {
|
|
4728
|
+
'&([slot*="header"])': {
|
|
4729
|
+
display: 'flex',
|
|
4730
|
+
alignItems: 'center',
|
|
4731
|
+
gap: spacingStaticSmall,
|
|
4732
|
+
},
|
|
4733
|
+
'&([slot*="sidebar"])': {
|
|
4734
|
+
display: 'flex',
|
|
4735
|
+
flexDirection: 'column',
|
|
4736
|
+
gap: spacingStaticSmall,
|
|
4737
|
+
},
|
|
4738
|
+
// pre-defined utility classes
|
|
4739
|
+
'&(.p-module)': {
|
|
4740
|
+
gridColumn: '1/-1',
|
|
4741
|
+
},
|
|
4742
|
+
'&(.p-module--subgrid)': {
|
|
4743
|
+
display: 'grid',
|
|
4744
|
+
gridTemplateColumns: 'subgrid',
|
|
4745
|
+
rowGap: gridProductiveGap,
|
|
4746
|
+
},
|
|
4747
|
+
'&(.p-module--more-space-above-small)': {
|
|
4748
|
+
marginTop: spacingStaticSmall,
|
|
4749
|
+
},
|
|
4750
|
+
'&(.p-module--more-space-above-medium)': {
|
|
4751
|
+
marginTop: spacingStaticMedium,
|
|
4752
|
+
},
|
|
4753
|
+
'&(.p-module--more-space-above-large)': {
|
|
4754
|
+
marginTop: spacingStaticLarge,
|
|
4755
|
+
},
|
|
4756
|
+
'&(.p-module--less-space-above-small)': {
|
|
4757
|
+
marginTop: `max(calc(-1 * ${gridProductiveGap}), calc(-1 * ${spacingStaticSmall}))`,
|
|
4758
|
+
},
|
|
4759
|
+
'&(.p-module--less-space-above-medium)': {
|
|
4760
|
+
marginTop: `max(calc(-1 * ${gridProductiveGap}), calc(-1 * ${spacingStaticMedium}))`,
|
|
4761
|
+
},
|
|
4762
|
+
'&(.p-module--less-space-above-large)': {
|
|
4763
|
+
marginTop: `max(calc(-1 * ${gridProductiveGap}), calc(-1 * ${spacingStaticLarge}))`,
|
|
4764
|
+
},
|
|
4765
|
+
'&(.p-flex)': {
|
|
4766
|
+
display: 'flex',
|
|
4767
|
+
},
|
|
4768
|
+
'&(.p-align-items--center)': {
|
|
4769
|
+
alignItems: 'center',
|
|
4770
|
+
},
|
|
4771
|
+
'&(.p-gap--small)': {
|
|
4772
|
+
gap: spacingStaticSmall,
|
|
4773
|
+
},
|
|
4774
|
+
'&(.p-gap--medium)': {
|
|
4775
|
+
gap: spacingStaticMedium,
|
|
4776
|
+
},
|
|
4777
|
+
'&(.p-gap--large)': {
|
|
4778
|
+
gap: spacingStaticLarge,
|
|
4779
|
+
},
|
|
4780
|
+
},
|
|
4781
|
+
'slot[name="title"]::slotted(a)': {
|
|
4782
|
+
textDecoration: 'none',
|
|
4783
|
+
color: 'inherit',
|
|
4784
|
+
},
|
|
4785
|
+
h2: {
|
|
4786
|
+
...textSmallStyle,
|
|
4787
|
+
color: primaryColor,
|
|
4788
|
+
textTransform: 'uppercase',
|
|
4789
|
+
letterSpacing: '2px',
|
|
4790
|
+
},
|
|
4791
|
+
'header, main, footer, aside': {
|
|
4730
4792
|
padding: gridProductiveGap,
|
|
4731
4793
|
boxSizing: 'border-box',
|
|
4732
4794
|
zIndex: 0,
|
|
@@ -4735,49 +4797,78 @@ const getComponentCss$12 = (isSidebarStartOpen, sidebarStartWidth, isSidebarEndO
|
|
|
4735
4797
|
gridArea: 'header',
|
|
4736
4798
|
position: 'sticky',
|
|
4737
4799
|
top: 0,
|
|
4738
|
-
zIndex:
|
|
4800
|
+
zIndex: 9999999,
|
|
4801
|
+
height: headerHeight,
|
|
4802
|
+
display: 'grid',
|
|
4803
|
+
gridTemplateColumns: 'minmax(0, 1fr) auto minmax(0, 1fr)',
|
|
4804
|
+
gap: gridProductiveGap,
|
|
4805
|
+
backgroundColor: backgroundSurfaceColor,
|
|
4806
|
+
alignItems: 'center',
|
|
4807
|
+
paddingBlock: 0,
|
|
4808
|
+
'&::before, &::after': {
|
|
4809
|
+
content: '""',
|
|
4810
|
+
position: 'absolute',
|
|
4811
|
+
backgroundColor: 'transparent',
|
|
4812
|
+
bottom: `calc(${borderRadiusLarge} * -2)`,
|
|
4813
|
+
height: `calc(${borderRadiusLarge} * 2)`,
|
|
4814
|
+
width: borderRadiusLarge,
|
|
4815
|
+
boxShadow: `0 -${borderRadiusLarge} 0 0 ${backgroundSurfaceColor}`,
|
|
4816
|
+
pointerEvents: 'none',
|
|
4817
|
+
},
|
|
4818
|
+
'&::before': {
|
|
4819
|
+
left: 0,
|
|
4820
|
+
borderTopLeftRadius: borderRadiusLarge,
|
|
4821
|
+
},
|
|
4822
|
+
'&::after': {
|
|
4823
|
+
right: 0,
|
|
4824
|
+
borderTopRightRadius: borderRadiusLarge,
|
|
4825
|
+
},
|
|
4739
4826
|
},
|
|
4740
4827
|
main: {
|
|
4741
4828
|
gridArea: 'main',
|
|
4742
|
-
'--
|
|
4743
|
-
'--
|
|
4744
|
-
'--
|
|
4745
|
-
'--
|
|
4829
|
+
'--p-canvas-grid-span-full': 'span 6',
|
|
4830
|
+
'--p-canvas-grid-span-one-half': 'span 3',
|
|
4831
|
+
'--p-canvas-grid-span-one-third': 'span 2',
|
|
4832
|
+
'--p-canvas-grid-span-two-thirds': 'span 4',
|
|
4746
4833
|
display: 'grid',
|
|
4747
4834
|
gridTemplateColumns: 'repeat(6, minmax(0, 1fr))',
|
|
4748
4835
|
gap: gridProductiveGap,
|
|
4749
4836
|
alignContent: 'flex-start',
|
|
4837
|
+
backgroundColor,
|
|
4750
4838
|
[mediaQueryDesktopView]: {
|
|
4751
|
-
'--
|
|
4752
|
-
'--
|
|
4753
|
-
'--
|
|
4754
|
-
'--
|
|
4839
|
+
'--p-canvas-grid-span-full': 'span 12',
|
|
4840
|
+
'--p-canvas-grid-span-one-half': 'span 6',
|
|
4841
|
+
'--p-canvas-grid-span-one-third': 'span 4',
|
|
4842
|
+
'--p-canvas-grid-span-two-thirds': 'span 8',
|
|
4755
4843
|
gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',
|
|
4756
4844
|
},
|
|
4757
4845
|
},
|
|
4758
4846
|
footer: {
|
|
4759
4847
|
gridArea: 'footer',
|
|
4848
|
+
backgroundColor,
|
|
4760
4849
|
},
|
|
4761
4850
|
aside: {
|
|
4762
|
-
// TODO: box-shadows or colored surface must be defined, design is missing
|
|
4763
|
-
position: 'relative',
|
|
4764
4851
|
transition: getTransition('margin'),
|
|
4765
|
-
'
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
? 0
|
|
4770
|
-
: `calc(var(${cssVariableSidebarStartWidth}, ${sidebarWidths[sidebarStartWidth]}) * -1)`,
|
|
4771
|
-
},
|
|
4772
|
-
'&:last-of-type': {
|
|
4773
|
-
gridArea: 'sidebar-end',
|
|
4774
|
-
width: `var(${cssVariableSidebarEndWidth}, ${sidebarWidths[sidebarEndWidth]})`,
|
|
4775
|
-
marginInlineEnd: isSidebarEndOpen
|
|
4776
|
-
? 0
|
|
4777
|
-
: `calc(var(${cssVariableSidebarEndWidth}, ${sidebarWidths[sidebarEndWidth]}) * -1)`,
|
|
4778
|
-
},
|
|
4852
|
+
position: 'sticky',
|
|
4853
|
+
top: headerHeight,
|
|
4854
|
+
height: `calc(100dvh - ${headerHeight})`,
|
|
4855
|
+
overflow: 'hidden auto',
|
|
4779
4856
|
},
|
|
4780
4857
|
},
|
|
4858
|
+
'sidebar-start': {
|
|
4859
|
+
borderInlineEnd: `1px solid ${backgroundSurfaceColor}`,
|
|
4860
|
+
backgroundColor,
|
|
4861
|
+
gridArea: 'sidebar-start',
|
|
4862
|
+
width: `var(${cssVarSidebarStartWidth}, ${sidebarWidth})`,
|
|
4863
|
+
marginInlineStart: isSidebarStartOpen ? 0 : `calc(var(${cssVarSidebarStartWidth}, ${sidebarWidth}) * -1)`,
|
|
4864
|
+
},
|
|
4865
|
+
'sidebar-end': {
|
|
4866
|
+
borderInlineStart: `1px solid ${backgroundSurfaceColor}`,
|
|
4867
|
+
backgroundColor,
|
|
4868
|
+
gridArea: 'sidebar-end',
|
|
4869
|
+
width: `var(${cssVarSidebarEndWidth}, ${sidebarWidth})`,
|
|
4870
|
+
marginInlineEnd: isSidebarEndOpen ? 0 : `calc(var(${cssVarSidebarEndWidth}, ${sidebarWidth}) * -1)`,
|
|
4871
|
+
},
|
|
4781
4872
|
canvas: {
|
|
4782
4873
|
display: 'grid',
|
|
4783
4874
|
gridTemplateRows: 'auto minmax(0, 1fr) auto',
|
|
@@ -4789,15 +4880,30 @@ const getComponentCss$12 = (isSidebarStartOpen, sidebarStartWidth, isSidebarEndO
|
|
|
4789
4880
|
gridTemplateAreas: '"header header header" "sidebar-start main sidebar-end" "sidebar-start footer sidebar-end"',
|
|
4790
4881
|
},
|
|
4791
4882
|
},
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4883
|
+
crest: {
|
|
4884
|
+
[getMediaQueryMin('s')]: {
|
|
4885
|
+
display: 'none',
|
|
4886
|
+
},
|
|
4887
|
+
},
|
|
4888
|
+
wordmark: {
|
|
4889
|
+
height: '10px',
|
|
4890
|
+
[getMediaQueryMax('s')]: {
|
|
4891
|
+
display: 'none',
|
|
4892
|
+
},
|
|
4893
|
+
},
|
|
4894
|
+
header: {
|
|
4895
|
+
display: 'flex',
|
|
4896
|
+
gap: spacingStaticSmall,
|
|
4897
|
+
alignItems: 'center',
|
|
4898
|
+
'&:last-of-type': {
|
|
4899
|
+
justifyContent: 'end',
|
|
4900
|
+
},
|
|
4796
4901
|
},
|
|
4797
4902
|
});
|
|
4798
4903
|
};
|
|
4799
4904
|
|
|
4800
4905
|
const cssVariablePrevNextFilter = '--p-carousel-prev-next-filter';
|
|
4906
|
+
const cssVariableGradientColorWidth = '--p-gradient-color-width';
|
|
4801
4907
|
const carouselTransitionDuration = motionDurationModerate;
|
|
4802
4908
|
const paginationInfiniteStartCaseClass = 'pagination--infinite';
|
|
4803
4909
|
const bulletClass = 'bullet';
|
|
@@ -4825,11 +4931,42 @@ const backfaceVisibilityJssStyle = {
|
|
|
4825
4931
|
backfaceVisibility: 'hidden',
|
|
4826
4932
|
WebkitBackfaceVisibility: 'hidden',
|
|
4827
4933
|
};
|
|
4828
|
-
const
|
|
4934
|
+
const gradientColorLight$1 = {
|
|
4935
|
+
'background-base': '255,255,255',
|
|
4936
|
+
'background-surface': '238,239,242',
|
|
4937
|
+
none: '',
|
|
4938
|
+
};
|
|
4939
|
+
const gradientColorDark$1 = {
|
|
4940
|
+
'background-base': '14,14,18',
|
|
4941
|
+
'background-surface': '33,34,37',
|
|
4942
|
+
none: '',
|
|
4943
|
+
};
|
|
4944
|
+
const gradientColorMap$1 = {
|
|
4945
|
+
auto: gradientColorLight$1,
|
|
4946
|
+
light: gradientColorLight$1,
|
|
4947
|
+
dark: gradientColorDark$1,
|
|
4948
|
+
};
|
|
4949
|
+
const getGradient$1 = (theme, gradientColorTheme) => {
|
|
4950
|
+
const gradientColor = gradientColorMap$1[theme][gradientColorTheme];
|
|
4951
|
+
return (`rgba(${gradientColor},1) 20%,` +
|
|
4952
|
+
`rgba(${gradientColor},0.6) 48%,` +
|
|
4953
|
+
`rgba(${gradientColor},0.3) 68%,` +
|
|
4954
|
+
`rgba(${gradientColor},0)`);
|
|
4955
|
+
};
|
|
4956
|
+
const getComponentCss$11 = (gradientColor, hasHeading, hasDescription, hasControlsSlot, headingSize, width, hasPagination, isInfinitePagination, alignHeader, theme, hasNavigation) => {
|
|
4829
4957
|
const { primaryColor, contrastMediumColor } = getThemedColors(theme);
|
|
4830
4958
|
const { primaryColor: primaryColorDark, contrastMediumColor: contrastMediumColorDark } = getThemedColors('dark');
|
|
4831
4959
|
const { canvasTextColor } = getHighContrastColors();
|
|
4832
4960
|
const isHeaderAlignCenter = alignHeader === 'center';
|
|
4961
|
+
const getGradientStyles = (direction) => gradientColor
|
|
4962
|
+
? {
|
|
4963
|
+
[direction === 'left' ? 'right' : 'left']: 0,
|
|
4964
|
+
background: `linear-gradient(to ${direction}, ${getGradient$1(theme, gradientColor)} 100%)`,
|
|
4965
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4966
|
+
background: `linear-gradient(to ${direction}, ${getGradient$1('dark', gradientColor)} 100%)`,
|
|
4967
|
+
}),
|
|
4968
|
+
}
|
|
4969
|
+
: {};
|
|
4833
4970
|
return getCss({
|
|
4834
4971
|
'@global': {
|
|
4835
4972
|
':host': {
|
|
@@ -4936,6 +5073,7 @@ const getComponentCss$11 = (hasHeading, hasDescription, hasControlsSlot, heading
|
|
|
4936
5073
|
padding: '4px 0', // for slide focus outline
|
|
4937
5074
|
margin: '-4px 0', // for slide focus outline
|
|
4938
5075
|
'&__track': {
|
|
5076
|
+
position: 'relative',
|
|
4939
5077
|
// !important is necessary to override inline styles set by splide library
|
|
4940
5078
|
...addImportantToEachRule({
|
|
4941
5079
|
padding: `0 ${spacingMap[width].base}`,
|
|
@@ -4955,6 +5093,16 @@ const getComponentCss$11 = (hasHeading, hasDescription, hasControlsSlot, heading
|
|
|
4955
5093
|
WebkitUserSelect: 'none',
|
|
4956
5094
|
WebkitTouchCallout: 'none',
|
|
4957
5095
|
},
|
|
5096
|
+
'&::before, &::after': {
|
|
5097
|
+
content: '""',
|
|
5098
|
+
position: 'absolute',
|
|
5099
|
+
zIndex: 1,
|
|
5100
|
+
top: 0,
|
|
5101
|
+
height: '100%',
|
|
5102
|
+
width: `var(${cssVariableGradientColorWidth}, 33%)`,
|
|
5103
|
+
},
|
|
5104
|
+
'&::before': getGradientStyles('right'),
|
|
5105
|
+
'&::after': getGradientStyles('left'),
|
|
4958
5106
|
},
|
|
4959
5107
|
'&__list': {
|
|
4960
5108
|
...backfaceVisibilityJssStyle,
|
|
@@ -8063,10 +8211,13 @@ const getComponentCss$x = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
8063
8211
|
// TODO: move into getSlottedTextFieldTextareaSelectStyles() via parameter, e.g. textAlign=center|start
|
|
8064
8212
|
textAlign: 'center',
|
|
8065
8213
|
// TODO: move into getSlottedTextFieldTextareaSelectStyles() via parameter, e.g. size=max|min
|
|
8066
|
-
|
|
8214
|
+
maxWidth: inputSize,
|
|
8215
|
+
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least.
|
|
8216
|
+
minWidth: `calc(1rem + ${borderWidthBase}*2 + ${spacingStaticSmall}*2)`,
|
|
8067
8217
|
...(length > 4 && {
|
|
8068
8218
|
[getMediaQueryMax('xs')]: {
|
|
8069
8219
|
// TODO: instead of having dedicated css rules depending on length we should try to implement a fluid one fits all solution
|
|
8220
|
+
maxWidth: 'auto',
|
|
8070
8221
|
width: `calc((276px - (${spacingStaticSmall} * ${length - 1})) / ${length})`, // calculate the max with of the inputs that fit into grid in viewport base (276px)
|
|
8071
8222
|
},
|
|
8072
8223
|
}),
|
|
@@ -8116,7 +8267,7 @@ const getComponentCss$x = (hideLabel, state, isDisabled, isLoading, isWithinForm
|
|
|
8116
8267
|
},
|
|
8117
8268
|
wrapper: {
|
|
8118
8269
|
display: 'grid',
|
|
8119
|
-
gridTemplateColumns: `repeat(${length}, minmax(
|
|
8270
|
+
gridTemplateColumns: `repeat(${length}, minmax(auto, 1fr))`,
|
|
8120
8271
|
justifySelf: 'flex-start',
|
|
8121
8272
|
gap: spacingStaticSmall,
|
|
8122
8273
|
},
|
|
@@ -9035,6 +9186,12 @@ const getComponentCss$q = (isDisabled, hasCustomDropdown, hideLabel, state, them
|
|
|
9035
9186
|
|
|
9036
9187
|
const INTERNAL_SELECT_SLOT = 'internal-select';
|
|
9037
9188
|
|
|
9189
|
+
const cssVarBackgroundColor = '--p-select-background-color';
|
|
9190
|
+
const cssVarTextColor = '--p-select-text-color';
|
|
9191
|
+
const cssVarBorderColor = '--p-select-border-color';
|
|
9192
|
+
const cssVarIconFilter = '--p-select-icon-filter';
|
|
9193
|
+
const cssVarBackgroundColorFocus = '--p-select-focus-background-color';
|
|
9194
|
+
const cssVarBorderColorFocus = '--p-select-focus-border-color';
|
|
9038
9195
|
const getComponentCss$p = (direction, isOpen, isDisabled, hideLabel, state, isWithinForm, isNativePopoverCase, theme) => {
|
|
9039
9196
|
return getCss({
|
|
9040
9197
|
'@global': {
|
|
@@ -9079,6 +9236,9 @@ const getComponentCss$p = (direction, isOpen, isDisabled, hideLabel, state, isWi
|
|
|
9079
9236
|
pointerEvents: 'none',
|
|
9080
9237
|
transform: 'rotate3d(0,0,1,0.0001deg)', // needs to be a little more than 0 for correct direction in safari
|
|
9081
9238
|
transition: getTransition('transform'),
|
|
9239
|
+
...(!isHighContrastMode && {
|
|
9240
|
+
filter: `var(${cssVarIconFilter})`,
|
|
9241
|
+
}),
|
|
9082
9242
|
'&--rotate': {
|
|
9083
9243
|
transform: 'rotate3d(0,0,1,180deg)',
|
|
9084
9244
|
},
|
|
@@ -9127,30 +9287,38 @@ const getButtonStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
|
9127
9287
|
cursor: 'not-allowed',
|
|
9128
9288
|
},
|
|
9129
9289
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
9130
|
-
color: primaryColor
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9290
|
+
color: `var(${cssVarTextColor}, ${primaryColor})`,
|
|
9291
|
+
background: `var(${cssVarBackgroundColor}, ${backgroundColor})`,
|
|
9292
|
+
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateColor || contrastMediumColor})`,
|
|
9293
|
+
borderRadius: borderRadiusSmall,
|
|
9294
|
+
'&:not(:focus-visible)': {
|
|
9295
|
+
...getPlaceholderJssStyle({
|
|
9296
|
+
color: `var(${cssVarTextColor}, ${primaryColor})`,
|
|
9297
|
+
opacity: 1,
|
|
9298
|
+
}),
|
|
9299
|
+
...prefersColorSchemeDarkMediaQuery(theme, getPlaceholderJssStyle({
|
|
9300
|
+
color: `var(${cssVarTextColor}, ${primaryColorDark})`,
|
|
9301
|
+
opacity: 1,
|
|
9302
|
+
})),
|
|
9134
9303
|
}, // Opacity fixes placeholder being shown lighter in firefox
|
|
9135
9304
|
...hoverMediaQuery({
|
|
9136
|
-
'&:hover:not(:disabled):not(:focus),label:hover~.wrapper &:not(:disabled):not(:focus)': {
|
|
9137
|
-
borderColor: isOpen ? primaryColor : formStateHoverColor || primaryColor
|
|
9305
|
+
'&:hover:not(:disabled):not(:focus-visible),label:hover~.wrapper &:not(:disabled):not(:focus-visible)': {
|
|
9306
|
+
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColor : formStateHoverColor || primaryColor})`,
|
|
9138
9307
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9139
|
-
borderColor: isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark
|
|
9308
|
+
borderColor: `var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateHoverColorDark || primaryColorDark})`,
|
|
9140
9309
|
}),
|
|
9141
9310
|
},
|
|
9142
9311
|
}),
|
|
9143
9312
|
...(!isDisabled && {
|
|
9144
|
-
'&:focus': {
|
|
9145
|
-
borderColor: primaryColor
|
|
9313
|
+
'&:focus-visible': {
|
|
9314
|
+
borderColor: `var(${cssVarBorderColorFocus}, ${primaryColor})`,
|
|
9315
|
+
background: `var(${cssVarBackgroundColorFocus}, ${backgroundColor})`,
|
|
9146
9316
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9147
|
-
borderColor: primaryColorDark
|
|
9317
|
+
borderColor: `var(${cssVarBorderColorFocus}, ${primaryColorDark})`,
|
|
9318
|
+
background: `var(${cssVarBackgroundColorFocus}, ${backgroundColorDark})`,
|
|
9148
9319
|
}),
|
|
9149
9320
|
},
|
|
9150
9321
|
}),
|
|
9151
|
-
background: backgroundColor,
|
|
9152
|
-
border: `${borderWidthBase} solid ${isOpen ? primaryColor : formStateColor || contrastMediumColor}`,
|
|
9153
|
-
borderRadius: borderRadiusSmall,
|
|
9154
9322
|
...(isOpen && {
|
|
9155
9323
|
['paddingBottom' ]: `calc(${formElementPaddingVertical} + 1px)`, // Add padding to keep same height when border changes
|
|
9156
9324
|
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColor}`),
|
|
@@ -9158,16 +9326,18 @@ const getButtonStyles = (isDisabled, direction, isOpen, state, theme) => {
|
|
|
9158
9326
|
['borderBottomRightRadius' ]: 0,
|
|
9159
9327
|
}),
|
|
9160
9328
|
...(isDisabled && {
|
|
9161
|
-
...getPlaceholderJssStyle({
|
|
9329
|
+
...getPlaceholderJssStyle({
|
|
9330
|
+
color: disabledColor,
|
|
9331
|
+
}),
|
|
9162
9332
|
cursor: 'not-allowed',
|
|
9163
9333
|
color: disabledColor,
|
|
9164
9334
|
borderColor: disabledColor,
|
|
9165
9335
|
WebkitTextFillColor: disabledColor,
|
|
9166
9336
|
}),
|
|
9167
9337
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9168
|
-
color: primaryColorDark
|
|
9169
|
-
background: backgroundColorDark
|
|
9170
|
-
border: `${borderWidthBase} solid ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark}`,
|
|
9338
|
+
color: `var(${cssVarTextColor}, ${primaryColorDark})`,
|
|
9339
|
+
background: `var(${cssVarBackgroundColor}, ${backgroundColorDark})`,
|
|
9340
|
+
border: `${borderWidthBase} solid var(${cssVarBorderColor}, ${isOpen ? primaryColorDark : formStateColorDark || contrastMediumColorDark})`,
|
|
9171
9341
|
...(isOpen && {
|
|
9172
9342
|
['borderBottom' ]: addImportantToRule(`1px solid ${contrastMediumColorDark}`),
|
|
9173
9343
|
}),
|
|
@@ -9203,7 +9373,7 @@ const getListStyles = (isOpen, direction, theme) => {
|
|
|
9203
9373
|
overflowY: 'auto',
|
|
9204
9374
|
WebkitOverflowScrolling: 'touch',
|
|
9205
9375
|
background: backgroundColor,
|
|
9206
|
-
border: `2px solid ${primaryColor}`,
|
|
9376
|
+
border: `2px solid var(${cssVarBorderColor}, ${primaryColor})`,
|
|
9207
9377
|
['borderTop' ]: 'none',
|
|
9208
9378
|
borderRadius: borderRadiusSmall,
|
|
9209
9379
|
['borderTopLeftRadius' ]: 0,
|
|
@@ -9214,7 +9384,7 @@ const getListStyles = (isOpen, direction, theme) => {
|
|
|
9214
9384
|
transform: 'translate3d(0,0,0)', // fix iOS bug if less than 5 items are displayed
|
|
9215
9385
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
9216
9386
|
background: backgroundColorDark,
|
|
9217
|
-
borderColor: primaryColorDark
|
|
9387
|
+
borderColor: `var(${cssVarBorderColor}, ${primaryColorDark})`,
|
|
9218
9388
|
}),
|
|
9219
9389
|
};
|
|
9220
9390
|
};
|
|
@@ -10166,7 +10336,7 @@ const showCustomCalendarOrTimeIndicator = (isCalendar, isTime) => {
|
|
|
10166
10336
|
|
|
10167
10337
|
const cssVariableInputPaddingStart = '--p-internal-text-field-input-padding-start';
|
|
10168
10338
|
const cssVariableInputPaddingEnd = '--p-internal-text-field-input-padding-end';
|
|
10169
|
-
const getComponentCss$8 = (isDisabled, hideLabel, state, hasUnitOrVisibleCounter, unitPosition, inputType, showPasswordToggle, isWithinForm, hasSubmitButton, theme) => {
|
|
10339
|
+
const getComponentCss$8 = (isDisabled, hideLabel, state, hasUnitOrVisibleCounter, unitPosition, inputType, showPasswordToggle, isWithinForm, hasSubmitButton, theme, unitLength) => {
|
|
10170
10340
|
const isSearch = isType(inputType, 'search');
|
|
10171
10341
|
const isPassword = isType(inputType, 'password');
|
|
10172
10342
|
const isNumber = isType(inputType, 'number');
|
|
@@ -10176,6 +10346,9 @@ const getComponentCss$8 = (isDisabled, hideLabel, state, hasUnitOrVisibleCounter
|
|
|
10176
10346
|
const isSearchWithoutFormOrSubmitButton = isSearch && (!isWithinForm || !hasSubmitButton);
|
|
10177
10347
|
const isSearchWithForm = isSearch && isWithinForm;
|
|
10178
10348
|
const isCalendarOrTimeWithCustomIndicator = showCustomCalendarOrTimeIndicator(isCalendar, isTime);
|
|
10349
|
+
const counterCharacterLengthCssVar = 'var(--p-internal-counter-character-length)';
|
|
10350
|
+
const paddingInlineIfUnitOrCounter = hasUnitOrVisibleCounter &&
|
|
10351
|
+
`calc(${formElementLayeredGap} + ${formElementPaddingHorizontal} + ${borderWidthBase} + ${counterCharacterLengthCssVar} * 1ch * log(2.6))`;
|
|
10179
10352
|
return getCss({
|
|
10180
10353
|
'@global': {
|
|
10181
10354
|
':host': {
|
|
@@ -10191,8 +10364,12 @@ const getComponentCss$8 = (isDisabled, hideLabel, state, hasUnitOrVisibleCounter
|
|
|
10191
10364
|
...getSlottedTextFieldTextareaSelectStyles('input', state, false, theme, {
|
|
10192
10365
|
gridArea: '1/1/1/-1',
|
|
10193
10366
|
padding: `${formElementPaddingVertical} ${formElementPaddingHorizontal}`,
|
|
10194
|
-
paddingInlineStart:
|
|
10195
|
-
|
|
10367
|
+
paddingInlineStart: hasUnitOrVisibleCounter && unitPosition === 'prefix'
|
|
10368
|
+
? paddingInlineIfUnitOrCounter
|
|
10369
|
+
: `var(${cssVariableInputPaddingStart})`, // iOS Safari 14.5 can't handle padding-inline shorthand with css variables
|
|
10370
|
+
paddingInlineEnd: hasUnitOrVisibleCounter && unitPosition === 'suffix'
|
|
10371
|
+
? paddingInlineIfUnitOrCounter
|
|
10372
|
+
: `var(${cssVariableInputPaddingEnd})`, // iOS Safari 14.5 can't handle padding-inline shorthand with css variables
|
|
10196
10373
|
// TODO: move into getSlottedTextFieldTextareaSelectStyles()
|
|
10197
10374
|
...(isNumber && {
|
|
10198
10375
|
MozAppearance: 'textfield', // hides up/down spin button for Firefox
|
|
@@ -10417,6 +10594,8 @@ const getComponentCss$4 = (isDisabled, hideLabel, state, hasCounter, theme) => {
|
|
|
10417
10594
|
root: {
|
|
10418
10595
|
display: 'grid',
|
|
10419
10596
|
gap: spacingStaticXSmall,
|
|
10597
|
+
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character.
|
|
10598
|
+
minWidth: `calc(1rem + ${formElementPaddingHorizontal}*2 + ${borderWidthBase}*2)`,
|
|
10420
10599
|
},
|
|
10421
10600
|
wrapper: {
|
|
10422
10601
|
display: 'grid',
|
|
@@ -10468,6 +10647,8 @@ const getComponentCss$3 = (isDisabled, hideLabel, state, hasCounter, resize, the
|
|
|
10468
10647
|
background: 'transparent',
|
|
10469
10648
|
textIndent: 0,
|
|
10470
10649
|
color: primaryColor,
|
|
10650
|
+
// min width is needed for showing at least 1 character in very narrow containers. The "1rem" value is the minimum safe zone to show at least 1 character.
|
|
10651
|
+
minWidth: `calc(1rem + ${formElementPaddingHorizontal}*2 + ${borderWidthBase}*2)`,
|
|
10471
10652
|
transition: `${getTransition('background-color')}, ${getTransition('border-color')}, ${getTransition('color')}`, // for smooth transitions between e.g. disabled states
|
|
10472
10653
|
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
10473
10654
|
borderColor: formStateColorDark || contrastMediumColorDark,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.mjs
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useRef } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRCanvas } from '../dsr-components/canvas.mjs';
|
|
7
7
|
|
|
8
|
-
const PCanvas = forwardRef(({
|
|
8
|
+
const PCanvas = forwardRef(({ sidebarEndIcon = 'configurate', sidebarEndOpen = false, sidebarStartIcon = 'menu-lines', sidebarStartOpen = false, theme, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
|
-
useEventCallback(elementRef, 'dismissSidebarEnd', onDismissSidebarEnd);
|
|
11
|
-
useEventCallback(elementRef, 'dismissSidebarStart', onDismissSidebarStart);
|
|
12
10
|
const WebComponentTag = usePrefix('p-canvas');
|
|
13
|
-
const propsToSync = [sidebarEndOpen,
|
|
11
|
+
const propsToSync = [sidebarEndIcon, sidebarEndOpen, sidebarStartIcon, sidebarStartOpen, theme || useTheme()];
|
|
14
12
|
useBrowserLayoutEffect(() => {
|
|
15
13
|
const { current } = elementRef;
|
|
16
|
-
['sidebarEndOpen', '
|
|
14
|
+
['sidebarEndIcon', 'sidebarEndOpen', 'sidebarStartIcon', 'sidebarStartOpen', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
15
|
}, propsToSync);
|
|
18
16
|
const props = {
|
|
19
17
|
...rest,
|
|
20
18
|
// @ts-ignore
|
|
21
19
|
...(!process.browser
|
|
22
20
|
? {
|
|
23
|
-
children: (jsx(DSRCanvas, { sidebarEndOpen,
|
|
21
|
+
children: (jsx(DSRCanvas, { sidebarEndIcon, sidebarEndOpen, sidebarStartIcon, sidebarStartOpen, theme: theme || useTheme(), children })),
|
|
24
22
|
}
|
|
25
23
|
: {
|
|
26
24
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.mjs
CHANGED
|
@@ -5,22 +5,22 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRCarousel } from '../dsr-components/carousel.mjs';
|
|
7
7
|
|
|
8
|
-
const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, children, ...rest }, ref) => {
|
|
8
|
+
const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, focusOnCenterSlide = false, gradientColor = 'none', heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'carouselChange', onCarouselChange);
|
|
11
11
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
12
12
|
const WebComponentTag = usePrefix('p-carousel');
|
|
13
|
-
const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || useTheme(), width, wrapContent];
|
|
13
|
+
const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, focusOnCenterSlide, gradientColor, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || useTheme(), width, wrapContent];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'focusOnCenterSlide', 'gradientColor', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
...(!process.browser
|
|
22
22
|
? {
|
|
23
|
-
children: (jsx(DSRCarousel, { activeSlideIndex, alignHeader, aria, description, disablePagination, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme: theme || useTheme(), width, wrapContent, children })),
|
|
23
|
+
children: (jsx(DSRCarousel, { activeSlideIndex, alignHeader, aria, description, disablePagination, focusOnCenterSlide, gradientColor, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme: theme || useTheme(), width, wrapContent, children })),
|
|
24
24
|
}
|
|
25
25
|
: {
|
|
26
26
|
children,
|