@uniformdev/csk-components 6.0.113-alpha.1 → 6.0.117-alpha.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/dist/{accordion-item-VWHOTJAC.mjs → accordion-item-QAVKQEB2.mjs} +1 -1
- package/dist/{accordion-item-NUEMADB2.mjs → accordion-item-Y4PSNOH4.mjs} +1 -1
- package/dist/{banner-2B4K5R4N.mjs → banner-EYII7V7X.mjs} +1 -1
- package/dist/carousel-RZ2DV6QX.mjs +1 -0
- package/dist/carousel-YELQRJVB.mjs +1 -0
- package/dist/chunk-2BMAPB63.mjs +1 -0
- package/dist/chunk-7GVG4HLE.mjs +1 -0
- package/dist/{chunk-LA36HQWS.mjs → chunk-B2O55EVA.mjs} +1 -1
- package/dist/chunk-EOV2LPGC.mjs +1 -0
- package/dist/chunk-EUVKAE6M.mjs +1 -0
- package/dist/chunk-FIN5US3Q.mjs +1 -0
- package/dist/chunk-M6FDQCD7.mjs +1 -0
- package/dist/{chunk-TDAANMNJ.mjs → chunk-PMMAALCQ.mjs} +1 -1
- package/dist/chunk-TCQTXNKT.mjs +1 -0
- package/dist/{chunk-3PDY7RJC.mjs → chunk-TFA6HYP4.mjs} +2 -2
- package/dist/{chunk-FPOIJMYT.mjs → chunk-VW2XC3SE.mjs} +1 -1
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +2 -18
- package/dist/components/canvas/index.mjs +2 -2
- package/dist/components/ui/index.d.mts +23 -10
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +1 -3
- package/dist/content/components/canvas/Card/card.tsx +1 -3
- package/dist/content/components/canvas/Carousel/carousel.tsx +1 -3
- package/dist/content/components/canvas/Container/container.tsx +0 -4
- package/dist/content/components/canvas/Container/parameters.ts +0 -4
- package/dist/content/components/canvas/DemoHero/atoms.tsx +1 -1
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +1 -7
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +1 -8
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +0 -4
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +56 -66
- package/dist/content/components/canvas/DemoHero/index.tsx +1 -12
- package/dist/content/components/canvas/Flex/flex.tsx +0 -4
- package/dist/content/components/canvas/Grid/grid.tsx +1 -3
- package/dist/content/components/canvas/Image/image.tsx +2 -2
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +1 -3
- package/dist/content/components/canvas/Modal/modal.tsx +12 -69
- package/dist/content/components/canvas/Review/default-variant.tsx +1 -3
- package/dist/content/components/canvas/Review/multi-column-variant.tsx +1 -3
- package/dist/content/components/canvas/Section/columns-variant.tsx +1 -7
- package/dist/content/components/canvas/Section/default-variant.tsx +1 -10
- package/dist/content/components/canvas/Section/section.tsx +0 -4
- package/dist/content/components/canvas/Table/table.tsx +1 -6
- package/dist/content/components/canvas/Tabs/tabs.tsx +1 -6
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +2 -4
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +0 -4
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +2 -4
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +2 -4
- package/dist/content/components/canvas/Video/index.tsx +0 -2
- package/dist/content/components/canvas/Video/video.tsx +1 -2
- package/dist/content/components/ui/Accordion/accordion.tsx +23 -0
- package/dist/content/components/ui/Accordion/index.tsx +9 -0
- package/dist/content/components/ui/AccordionItem/accordion-item.tsx +41 -0
- package/dist/content/components/ui/AccordionItem/icon-arrow-down.tsx +20 -0
- package/dist/content/components/ui/AccordionItem/icon-arrow-up.tsx +20 -0
- package/dist/content/components/ui/AccordionItem/index.tsx +16 -0
- package/dist/content/components/ui/Carousel/carousel.tsx +2 -2
- package/dist/content/components/ui/Carousel/index.ts +1 -1
- package/dist/content/components/ui/Container/container.tsx +2 -7
- package/dist/content/components/ui/Container/index.ts +0 -6
- package/dist/content/components/ui/Flex/flex.tsx +19 -27
- package/dist/content/components/ui/Flex/index.ts +0 -2
- package/dist/content/components/ui/Footer/index.ts +1 -1
- package/dist/content/components/ui/Grid/grid.tsx +19 -25
- package/dist/content/components/ui/Grid/index.ts +1 -9
- package/dist/content/components/ui/Header/index.ts +1 -1
- package/dist/content/components/ui/InlineSVG/index.ts +13 -0
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +59 -0
- package/dist/content/components/ui/InlineSVG/utils.ts +77 -0
- package/dist/content/components/ui/Modal/index.tsx +22 -0
- package/dist/content/components/ui/Modal/modal.tsx +89 -0
- package/dist/content/components/{canvas → ui}/Modal/style-utils.ts +4 -4
- package/dist/image-gallery-AMU6FS7N.mjs +1 -0
- package/dist/{index-Bi9hBway.d.mts → index-D5cLtaIv.d.mts} +2 -6
- package/dist/index.mjs +1 -1
- package/dist/{mobile-GZUA7EI6.mjs → mobile-JGZBHQC2.mjs} +1 -1
- package/dist/modal-43IHAVWB.mjs +1 -0
- package/dist/modal-5FNTFSTN.mjs +1 -0
- package/dist/{navigation-flyout-EIN6DEX4.mjs → navigation-flyout-NAU6O2WG.mjs} +1 -1
- package/dist/tabs-J23TEEQ7.mjs +1 -0
- package/package.json +2 -2
- package/dist/carousel-BBEW5P4Y.mjs +0 -1
- package/dist/carousel-ERCHOWUS.mjs +0 -1
- package/dist/chunk-2SEOCBRK.mjs +0 -1
- package/dist/chunk-5VM2Y55L.mjs +0 -1
- package/dist/chunk-7GZZPOY4.mjs +0 -1
- package/dist/chunk-BJ3OD5EH.mjs +0 -1
- package/dist/chunk-JE7SVZ2M.mjs +0 -1
- package/dist/chunk-WNQCSSLG.mjs +0 -1
- package/dist/chunk-YUCUJWBO.mjs +0 -1
- package/dist/content/components/ui/Container/utils.ts +0 -18
- package/dist/image-gallery-F6JLG7XW.mjs +0 -1
- package/dist/modal-HKMQGV4B.mjs +0 -1
- package/dist/tabs-AQFKYC6M.mjs +0 -1
- /package/dist/content/components/{canvas → ui}/Modal/close-icon.tsx +0 -0
|
@@ -13,8 +13,6 @@ export const Container: FC<ContainerProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
-
fullHeight,
|
|
17
|
-
fitHeight,
|
|
18
16
|
height,
|
|
19
17
|
className,
|
|
20
18
|
}) => (
|
|
@@ -26,8 +24,6 @@ export const Container: FC<ContainerProps> = ({
|
|
|
26
24
|
spacing,
|
|
27
25
|
border,
|
|
28
26
|
fluidContent,
|
|
29
|
-
fullHeight,
|
|
30
|
-
fitHeight,
|
|
31
27
|
height,
|
|
32
28
|
className,
|
|
33
29
|
}}
|
|
@@ -9,9 +9,5 @@ export type ContainerParameters = {
|
|
|
9
9
|
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
10
10
|
border?: string | ViewPort<string>;
|
|
11
11
|
fluidContent?: boolean;
|
|
12
|
-
/** @deprecated Use height prop instead */
|
|
13
|
-
fullHeight?: boolean;
|
|
14
|
-
/** @deprecated Use height prop instead */
|
|
15
|
-
fitHeight?: boolean;
|
|
16
12
|
height?: HeightType | ViewPort<HeightType>;
|
|
17
13
|
};
|
|
@@ -104,7 +104,7 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
104
104
|
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
105
105
|
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
106
106
|
|
|
107
|
-
if (!isEditorPreviewMode || isPlaceholder
|
|
107
|
+
if (!isEditorPreviewMode || isPlaceholder) {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -8,10 +8,6 @@ type ColumnsVariantProps = {
|
|
|
8
8
|
spacing: FlexibleHeroParameters['spacing'];
|
|
9
9
|
border: FlexibleHeroParameters['border'];
|
|
10
10
|
fluidContent: FlexibleHeroParameters['fluidContent'];
|
|
11
|
-
/** @deprecated Use height prop instead */
|
|
12
|
-
fullHeight: FlexibleHeroParameters['fullHeight'];
|
|
13
|
-
/** @deprecated Use height prop instead */
|
|
14
|
-
fitHeight: FlexibleHeroParameters['fitHeight'];
|
|
15
11
|
height: FlexibleHeroParameters['height'];
|
|
16
12
|
variant?: DemoHeroVariants;
|
|
17
13
|
demoHeroMedia: React.ReactNode;
|
|
@@ -26,8 +22,6 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
26
22
|
spacing,
|
|
27
23
|
border,
|
|
28
24
|
fluidContent,
|
|
29
|
-
fullHeight,
|
|
30
|
-
fitHeight,
|
|
31
25
|
height,
|
|
32
26
|
variant,
|
|
33
27
|
demoHeroMedia,
|
|
@@ -36,7 +30,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
36
30
|
textAlignmentClass,
|
|
37
31
|
buttonAlignmentClass,
|
|
38
32
|
}) => (
|
|
39
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
33
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
40
34
|
<div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
|
|
41
35
|
<div className={cn('aspect-square', { 'order-last': variant === DemoHeroVariants.ColumnsReverse })}>
|
|
42
36
|
<div className="flex size-full items-center justify-center overflow-hidden">{demoHeroMedia}</div>
|
|
@@ -8,8 +8,6 @@ type DefaultVariantProps = {
|
|
|
8
8
|
spacing: FlexibleHeroParameters['spacing'];
|
|
9
9
|
border: FlexibleHeroParameters['border'];
|
|
10
10
|
fluidContent: FlexibleHeroParameters['fluidContent'];
|
|
11
|
-
fullHeight: FlexibleHeroParameters['fullHeight'];
|
|
12
|
-
fitHeight: FlexibleHeroParameters['fitHeight'];
|
|
13
11
|
height: FlexibleHeroParameters['height'];
|
|
14
12
|
demoHeroMedia: React.ReactNode;
|
|
15
13
|
demoHeroContent: React.ReactNode;
|
|
@@ -23,8 +21,6 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
23
21
|
spacing,
|
|
24
22
|
border,
|
|
25
23
|
fluidContent,
|
|
26
|
-
fullHeight,
|
|
27
|
-
fitHeight,
|
|
28
24
|
height,
|
|
29
25
|
demoHeroMedia,
|
|
30
26
|
demoHeroContent,
|
|
@@ -32,10 +28,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
32
28
|
textAlignmentClass,
|
|
33
29
|
buttonAlignmentClass,
|
|
34
30
|
}) => (
|
|
35
|
-
<Container
|
|
36
|
-
className="relative overflow-hidden"
|
|
37
|
-
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
38
|
-
>
|
|
31
|
+
<Container className="relative overflow-hidden" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
39
32
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{demoHeroMedia}</div>
|
|
40
33
|
<Container className="relative flex flex-col gap-8">
|
|
41
34
|
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{demoHeroContent}</div>
|
|
@@ -78,8 +78,6 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
78
78
|
spacing,
|
|
79
79
|
border,
|
|
80
80
|
fluidContent,
|
|
81
|
-
fullHeight,
|
|
82
|
-
fitHeight,
|
|
83
81
|
height,
|
|
84
82
|
isFlexibleHero = false,
|
|
85
83
|
component,
|
|
@@ -196,8 +194,6 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
196
194
|
spacing,
|
|
197
195
|
border,
|
|
198
196
|
fluidContent,
|
|
199
|
-
fullHeight,
|
|
200
|
-
fitHeight,
|
|
201
197
|
height,
|
|
202
198
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
203
199
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -3,69 +3,59 @@ import { FixedHeroProps } from '.';
|
|
|
3
3
|
import { DemoHero } from './demo-hero';
|
|
4
4
|
import { getImageParametersFocalPoint } from './utils';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
paddingTop: 'container-xlarge',
|
|
63
|
-
paddingLeft: 'container-small',
|
|
64
|
-
paddingRight: 'container-small',
|
|
65
|
-
paddingBottom: 'container-xlarge',
|
|
66
|
-
}}
|
|
67
|
-
fluidContent={!props.component.variant}
|
|
68
|
-
isFlexibleHero={false}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
6
|
+
export const FixedHero: FC<FixedHeroProps> = ({ textColor, overlayAutoTint, ...props }) => (
|
|
7
|
+
<DemoHero
|
|
8
|
+
{...props}
|
|
9
|
+
// Eyebrow Text Parameters
|
|
10
|
+
eyebrowTitleTag="span"
|
|
11
|
+
eyebrowTitleSize={{
|
|
12
|
+
mobile: 'xs',
|
|
13
|
+
tablet: 'lg',
|
|
14
|
+
desktop: 'xl',
|
|
15
|
+
}}
|
|
16
|
+
eyebrowTitleWeight="bold"
|
|
17
|
+
eyebrowTitleTransform="uppercase"
|
|
18
|
+
eyebrowTitleColor={textColor || props.eyebrowTitleColor}
|
|
19
|
+
// Title Text Parameters
|
|
20
|
+
titleSize={{
|
|
21
|
+
mobile: '3xl',
|
|
22
|
+
tablet: '4xl',
|
|
23
|
+
desktop: '4xl',
|
|
24
|
+
}}
|
|
25
|
+
titleWeight="bold"
|
|
26
|
+
titleColor={textColor || props.titleColor}
|
|
27
|
+
// Description Text Parameters
|
|
28
|
+
descriptionTag="p"
|
|
29
|
+
descriptionSize={{
|
|
30
|
+
mobile: 'sm',
|
|
31
|
+
tablet: 'lg',
|
|
32
|
+
desktop: 'xl',
|
|
33
|
+
}}
|
|
34
|
+
descriptionWeight="normal"
|
|
35
|
+
descriptionColor={textColor || props.descriptionColor}
|
|
36
|
+
// Primary Button Parameters
|
|
37
|
+
primaryButtonSize="button-medium"
|
|
38
|
+
primaryButtonTextSize="sm"
|
|
39
|
+
primaryButtonTextColor="text-secondary"
|
|
40
|
+
primaryButtonTextWeight="normal"
|
|
41
|
+
primaryButtonButtonColor="button-primary"
|
|
42
|
+
primaryButtonTextTransform="uppercase"
|
|
43
|
+
primaryButtonHoverButtonColor="button-primary-hover"
|
|
44
|
+
// Image Parameters
|
|
45
|
+
imagePriority
|
|
46
|
+
imageObjectFit="cover"
|
|
47
|
+
imageUnoptimized
|
|
48
|
+
imageContrastBaseColor={!props.component.variant && overlayAutoTint ? textColor : undefined}
|
|
49
|
+
imageOverlayOpacity={overlayAutoTint}
|
|
50
|
+
{...getImageParametersFocalPoint(!!props.component.variant)}
|
|
51
|
+
// Presentation Parameters
|
|
52
|
+
spacing={{
|
|
53
|
+
paddingTop: 'container-xlarge',
|
|
54
|
+
paddingLeft: 'container-small',
|
|
55
|
+
paddingRight: 'container-small',
|
|
56
|
+
paddingBottom: 'container-xlarge',
|
|
57
|
+
}}
|
|
58
|
+
fluidContent={!props.component.variant}
|
|
59
|
+
isFlexibleHero={false}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
@@ -60,10 +60,7 @@ export type SecondaryButtonParameters = PrefixedKeys<BaseButtonParameters, 'seco
|
|
|
60
60
|
export type ImageParameters = PrefixedKeys<Omit<BaseImageParameters, 'image'>, 'image'> &
|
|
61
61
|
Pick<BaseImageParameters, 'image'>;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
* @deprecated Use FixedHeroParameters or FlexibleHeroParameters directly instead.
|
|
65
|
-
*/
|
|
66
|
-
export type DemoHeroParameters = ContainerParameters & {
|
|
63
|
+
type DemoHeroParameters = ContainerParameters & {
|
|
67
64
|
contentAlignment?: ContentAlignment;
|
|
68
65
|
} & EyebrowTitleTextParameters &
|
|
69
66
|
TitleTextParameters &
|
|
@@ -74,10 +71,6 @@ export type DemoHeroParameters = ContainerParameters & {
|
|
|
74
71
|
|
|
75
72
|
export type FixedHeroParameters = {
|
|
76
73
|
textColor?: string;
|
|
77
|
-
/**
|
|
78
|
-
* @deprecated Use overlayAutoTint instead.
|
|
79
|
-
*/
|
|
80
|
-
enableOverlayAutoTint?: boolean;
|
|
81
74
|
overlayAutoTint?: string;
|
|
82
75
|
} & DemoHeroParameters;
|
|
83
76
|
|
|
@@ -93,10 +86,6 @@ export enum FlexibleHeroSlots {
|
|
|
93
86
|
FlexibleHeroCta = 'flexibleHeroCta',
|
|
94
87
|
}
|
|
95
88
|
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated Use FixedHeroProps or FlexibleHeroProps directly instead.
|
|
98
|
-
*/
|
|
99
|
-
export type DemoHeroProps = FixedHeroProps | FlexibleHeroProps;
|
|
100
89
|
export type FixedHeroProps = ComponentProps<FixedHeroParameters>;
|
|
101
90
|
export type FlexibleHeroProps = ComponentProps<FlexibleHeroParameters, FlexibleHeroSlots>;
|
|
102
91
|
|
|
@@ -12,12 +12,10 @@ export const Flex: FC<FlexProps> = ({
|
|
|
12
12
|
spacing,
|
|
13
13
|
border,
|
|
14
14
|
fluidContent,
|
|
15
|
-
fullHeight,
|
|
16
15
|
slots,
|
|
17
16
|
component,
|
|
18
17
|
context,
|
|
19
18
|
className,
|
|
20
|
-
fitHeight,
|
|
21
19
|
height,
|
|
22
20
|
wrapperClassName,
|
|
23
21
|
}) => (
|
|
@@ -31,8 +29,6 @@ export const Flex: FC<FlexProps> = ({
|
|
|
31
29
|
spacing,
|
|
32
30
|
border,
|
|
33
31
|
fluidContent,
|
|
34
|
-
fullHeight,
|
|
35
|
-
fitHeight,
|
|
36
32
|
height,
|
|
37
33
|
wrapperClassName,
|
|
38
34
|
className,
|
|
@@ -11,8 +11,6 @@ export const Grid: FC<GridProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
-
fullHeight,
|
|
15
|
-
fitHeight,
|
|
16
14
|
height,
|
|
17
15
|
slots,
|
|
18
16
|
component,
|
|
@@ -21,7 +19,7 @@ export const Grid: FC<GridProps> = ({
|
|
|
21
19
|
}) => (
|
|
22
20
|
<BaseGrid
|
|
23
21
|
className={className}
|
|
24
|
-
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent,
|
|
22
|
+
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, height }}
|
|
25
23
|
>
|
|
26
24
|
<UniformSlot data={component} context={context} slot={slots.gridInner} />
|
|
27
25
|
</BaseGrid>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { imageFrom } from '@uniformdev/assets';
|
|
3
|
-
import { MediaPlaceholder } from '@/components/ui';
|
|
4
3
|
import BaseImage from '@/components/ui/Image';
|
|
4
|
+
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
5
5
|
import { resolveAsset } from '@/utils/assets';
|
|
6
6
|
import { ImageProps } from '.';
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ export const Image: FC<ImageProps> = async ({
|
|
|
25
25
|
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
26
26
|
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
27
27
|
|
|
28
|
-
if (!isEditorPreviewMode || isPlaceholder
|
|
28
|
+
if (!isEditorPreviewMode || isPlaceholder) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -16,8 +16,6 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
|
|
|
16
16
|
spacing,
|
|
17
17
|
border,
|
|
18
18
|
fluidContent,
|
|
19
|
-
fullHeight,
|
|
20
|
-
fitHeight,
|
|
21
19
|
height,
|
|
22
20
|
config,
|
|
23
21
|
context,
|
|
@@ -45,7 +43,7 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
|
|
|
45
43
|
?.length;
|
|
46
44
|
|
|
47
45
|
return (
|
|
48
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
46
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
49
47
|
<div className="flex flex-col gap-1">
|
|
50
48
|
{showEmptySlot ? (
|
|
51
49
|
<UniformSlot context={context} slot={slots.imageGalleryItems} data={component} />
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC
|
|
3
|
+
import { FC } from 'react';
|
|
4
4
|
import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
|
|
5
|
-
import
|
|
5
|
+
import BaseModal from '@/components/ui/Modal';
|
|
6
6
|
import { ModalProps } from '.';
|
|
7
|
-
import { CloseIcon } from './close-icon';
|
|
8
|
-
import { getCloseButtonClasses, getDialogClasses, getFormClasses } from './style-utils';
|
|
9
7
|
|
|
10
8
|
export const Modal: FC<ModalProps> = ({
|
|
11
9
|
slots,
|
|
@@ -15,68 +13,13 @@ export const Modal: FC<ModalProps> = ({
|
|
|
15
13
|
backgroundColor,
|
|
16
14
|
closeIconColor,
|
|
17
15
|
disableCloseModalOnClickOutside,
|
|
18
|
-
}) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
const handleClickContent = useCallback((e: MouseEvent<HTMLFormElement>) => {
|
|
31
|
-
e.stopPropagation();
|
|
32
|
-
}, []);
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!modalActionsRef.current) return;
|
|
36
|
-
const currentActions = modalActionsRef.current.querySelectorAll('button, a');
|
|
37
|
-
const handleClickButton = () => setShowModal(false);
|
|
38
|
-
|
|
39
|
-
currentActions.forEach(button => {
|
|
40
|
-
button.addEventListener('click', handleClickButton);
|
|
41
|
-
});
|
|
42
|
-
return () =>
|
|
43
|
-
currentActions.forEach(button => {
|
|
44
|
-
button.removeEventListener('click', handleClickButton);
|
|
45
|
-
});
|
|
46
|
-
}, []);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div>
|
|
50
|
-
<div onClick={toggleModal}>
|
|
51
|
-
<UniformSlot data={component} context={context} slot={slots.trigger} />
|
|
52
|
-
</div>
|
|
53
|
-
<div className={getDialogClasses({ showModal })}>
|
|
54
|
-
<dialog
|
|
55
|
-
open={showModal}
|
|
56
|
-
onClick={handleClickOutside}
|
|
57
|
-
aria-label="Close modal"
|
|
58
|
-
aria-modal="true"
|
|
59
|
-
className="flex size-full items-center justify-center bg-black/50 px-4"
|
|
60
|
-
>
|
|
61
|
-
<form method="dialog" className={getFormClasses({ maxWidth, backgroundColor })} onClick={handleClickContent}>
|
|
62
|
-
<button onClick={toggleModal} className={getCloseButtonClasses({ disableCloseModalOnClickOutside })}>
|
|
63
|
-
<CloseIcon
|
|
64
|
-
className={cn({
|
|
65
|
-
[`fill-${closeIconColor}`]: closeIconColor,
|
|
66
|
-
})}
|
|
67
|
-
/>
|
|
68
|
-
</button>
|
|
69
|
-
<div className="p-6 md:p-8">
|
|
70
|
-
<UniformSlot data={component} context={context} slot={slots.modalContent} />
|
|
71
|
-
</div>
|
|
72
|
-
{slots?.modalActions?.items?.length && (
|
|
73
|
-
<div ref={modalActionsRef} className="border-t p-6 md:p-8">
|
|
74
|
-
<UniformSlot data={component} context={context} slot={slots.modalActions} />
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
</form>
|
|
78
|
-
</dialog>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
16
|
+
}) => (
|
|
17
|
+
<BaseModal
|
|
18
|
+
{...{ maxWidth, backgroundColor, closeIconColor, disableCloseModalOnClickOutside }}
|
|
19
|
+
trigger={<UniformSlot data={component} context={context} slot={slots.trigger} />}
|
|
20
|
+
content={<UniformSlot data={component} context={context} slot={slots.modalContent} />}
|
|
21
|
+
actions={
|
|
22
|
+
slots?.modalActions?.items?.length && <UniformSlot data={component} context={context} slot={slots.modalActions} />
|
|
23
|
+
}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
@@ -18,14 +18,12 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
18
18
|
spacing,
|
|
19
19
|
border,
|
|
20
20
|
fluidContent,
|
|
21
|
-
fullHeight,
|
|
22
|
-
fitHeight,
|
|
23
21
|
height,
|
|
24
22
|
ReviewImage,
|
|
25
23
|
ReviewPersonInfo,
|
|
26
24
|
ReviewContent,
|
|
27
25
|
}) => (
|
|
28
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
26
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
29
27
|
<div className="mx-auto flex lg:max-w-[60%]">
|
|
30
28
|
<div className="aspect-square size-12 shrink-0 rounded-full">{ReviewImage}</div>
|
|
31
29
|
<div className="ml-6">
|
|
@@ -18,14 +18,12 @@ export const MultiColumnVariant: FC<MultiColumnVariantProps> = ({
|
|
|
18
18
|
spacing,
|
|
19
19
|
border,
|
|
20
20
|
fluidContent,
|
|
21
|
-
fullHeight,
|
|
22
|
-
fitHeight,
|
|
23
21
|
height,
|
|
24
22
|
ReviewImage,
|
|
25
23
|
ReviewPersonInfo,
|
|
26
24
|
ReviewContent,
|
|
27
25
|
}) => (
|
|
28
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
26
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
29
27
|
<div className="grid md:grid-cols-12">
|
|
30
28
|
<div className="mb-2 md:col-span-4 md:my-0">
|
|
31
29
|
<div className="mb-2 aspect-square size-12 rounded-full">{ReviewImage}</div>
|
|
@@ -8,10 +8,6 @@ type ColumnsVariantProps = {
|
|
|
8
8
|
spacing: SectionParameters['spacing'];
|
|
9
9
|
border: SectionParameters['border'];
|
|
10
10
|
fluidContent: SectionParameters['fluidContent'];
|
|
11
|
-
/** @deprecated Use height prop instead */
|
|
12
|
-
fullHeight: SectionParameters['fullHeight'];
|
|
13
|
-
/** @deprecated Use height prop instead */
|
|
14
|
-
fitHeight: SectionParameters['fitHeight'];
|
|
15
11
|
height: SectionParameters['height'];
|
|
16
12
|
variant: SectionVariants;
|
|
17
13
|
sectionMedia: React.ReactNode;
|
|
@@ -26,8 +22,6 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
26
22
|
spacing,
|
|
27
23
|
border,
|
|
28
24
|
fluidContent,
|
|
29
|
-
fullHeight,
|
|
30
|
-
fitHeight,
|
|
31
25
|
height,
|
|
32
26
|
variant,
|
|
33
27
|
sectionMedia,
|
|
@@ -36,7 +30,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
36
30
|
textAlignmentClass,
|
|
37
31
|
buttonAlignmentClass,
|
|
38
32
|
}) => (
|
|
39
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
33
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
40
34
|
<div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
|
|
41
35
|
<div className={cn('aspect-square', { 'order-last': variant === SectionVariants.ColumnsReverse })}>
|
|
42
36
|
<div className="flex size-full items-center justify-center overflow-hidden">{sectionMedia}</div>
|
|
@@ -8,10 +8,6 @@ type DefaultVariantProps = {
|
|
|
8
8
|
spacing?: SectionParameters['spacing'];
|
|
9
9
|
border?: SectionParameters['border'];
|
|
10
10
|
fluidContent?: SectionParameters['fluidContent'];
|
|
11
|
-
/** @deprecated Use height prop instead */
|
|
12
|
-
fullHeight?: SectionParameters['fullHeight'];
|
|
13
|
-
/** @deprecated Use height prop instead */
|
|
14
|
-
fitHeight?: SectionParameters['fitHeight'];
|
|
15
11
|
height?: SectionParameters['height'];
|
|
16
12
|
sectionMedia: React.ReactNode;
|
|
17
13
|
sectionContent: React.ReactNode;
|
|
@@ -25,8 +21,6 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
25
21
|
spacing,
|
|
26
22
|
border,
|
|
27
23
|
fluidContent,
|
|
28
|
-
fullHeight,
|
|
29
|
-
fitHeight,
|
|
30
24
|
height,
|
|
31
25
|
sectionMedia,
|
|
32
26
|
sectionContent,
|
|
@@ -34,10 +28,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
34
28
|
textAlignmentClass,
|
|
35
29
|
buttonAlignmentClass,
|
|
36
30
|
}) => (
|
|
37
|
-
<Container
|
|
38
|
-
className="relative overflow-hidden"
|
|
39
|
-
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
40
|
-
>
|
|
31
|
+
<Container className="relative overflow-hidden" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
41
32
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{sectionMedia}</div>
|
|
42
33
|
<Container className="relative flex flex-col gap-8">
|
|
43
34
|
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{sectionContent}</div>
|
|
@@ -14,8 +14,6 @@ export const Section: FC<SectionProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
-
fullHeight,
|
|
18
|
-
fitHeight,
|
|
19
17
|
height,
|
|
20
18
|
}) => {
|
|
21
19
|
const variant = component.variant as SectionVariants;
|
|
@@ -26,8 +24,6 @@ export const Section: FC<SectionProps> = ({
|
|
|
26
24
|
spacing,
|
|
27
25
|
border,
|
|
28
26
|
fluidContent,
|
|
29
|
-
fullHeight,
|
|
30
|
-
fitHeight,
|
|
31
27
|
height,
|
|
32
28
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
33
29
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -14,14 +14,9 @@ export const Table: FC<TableProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
-
fullHeight,
|
|
18
|
-
fitHeight,
|
|
19
17
|
height,
|
|
20
18
|
}) => (
|
|
21
|
-
<Container
|
|
22
|
-
className="flex flex-col gap-5"
|
|
23
|
-
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
24
|
-
>
|
|
19
|
+
<Container className="flex flex-col gap-5" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
25
20
|
<div className="overflow-x-auto">
|
|
26
21
|
<table className={getTableClasses({ size, textColor })}>
|
|
27
22
|
<thead>
|
|
@@ -16,8 +16,6 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
16
16
|
spacing,
|
|
17
17
|
border,
|
|
18
18
|
fluidContent,
|
|
19
|
-
fullHeight,
|
|
20
|
-
fitHeight,
|
|
21
19
|
height,
|
|
22
20
|
}) => {
|
|
23
21
|
const variant = (component.variant || TabsVariants.Default) as TabsVariants;
|
|
@@ -46,10 +44,7 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
46
44
|
);
|
|
47
45
|
|
|
48
46
|
return (
|
|
49
|
-
<Container
|
|
50
|
-
className="flex flex-col gap-5"
|
|
51
|
-
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
52
|
-
>
|
|
47
|
+
<Container className="flex flex-col gap-5" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
53
48
|
<div className={getButtonContainerClasses({ color, variant })}>
|
|
54
49
|
{tabItems.map((tabItem, index) => (
|
|
55
50
|
<button
|
|
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
|
|
|
4
4
|
|
|
5
5
|
type WithLargeAvatarVariantProps = Pick<
|
|
6
6
|
TestimonialProps,
|
|
7
|
-
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | '
|
|
7
|
+
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
8
8
|
> & {
|
|
9
9
|
testimonialPrimaryImage: React.ReactNode;
|
|
10
10
|
testimonialContent: React.ReactNode;
|
|
@@ -21,11 +21,9 @@ export const DefaultVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
|
21
21
|
spacing,
|
|
22
22
|
border,
|
|
23
23
|
fluidContent,
|
|
24
|
-
fullHeight,
|
|
25
|
-
fitHeight,
|
|
26
24
|
height,
|
|
27
25
|
}) => (
|
|
28
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
26
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
29
27
|
<div className="mx-auto flex flex-col items-center md:max-w-[80%]">
|
|
30
28
|
<div>{testimonialSecondaryImage}</div>
|
|
31
29
|
<div className="my-8">{testimonialContent}</div>
|
|
@@ -13,8 +13,6 @@ export const Testimonial: FC<TestimonialProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
-
fullHeight,
|
|
17
|
-
fitHeight,
|
|
18
16
|
height,
|
|
19
17
|
}) => {
|
|
20
18
|
const variant = component.variant as TestimonialVariants | undefined;
|
|
@@ -24,8 +22,6 @@ export const Testimonial: FC<TestimonialProps> = ({
|
|
|
24
22
|
spacing,
|
|
25
23
|
border,
|
|
26
24
|
fluidContent,
|
|
27
|
-
fullHeight,
|
|
28
|
-
fitHeight,
|
|
29
25
|
height,
|
|
30
26
|
testimonialPrimaryImage: <UniformSlot context={context} data={component} slot={slots.testimonialPrimaryImage} />,
|
|
31
27
|
testimonialContent: <UniformSlot context={context} data={component} slot={slots.testimonialContent} />,
|