@uniformdev/csk-components 6.0.121-alpha.1 → 6.1.57
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-G5CNMERW.mjs +1 -0
- package/dist/{banner-EYII7V7X.mjs → banner-2B4K5R4N.mjs} +1 -1
- package/dist/carousel-BBEW5P4Y.mjs +1 -0
- package/dist/carousel-ERCHOWUS.mjs +1 -0
- package/dist/chunk-2SEOCBRK.mjs +1 -0
- package/dist/{chunk-TFA6HYP4.mjs → chunk-3PDY7RJC.mjs} +2 -2
- package/dist/chunk-4LWAGTFW.mjs +1 -0
- package/dist/chunk-5VM2Y55L.mjs +1 -0
- package/dist/chunk-AKRWCDDG.mjs +1 -0
- package/dist/{chunk-VW2XC3SE.mjs → chunk-FPOIJMYT.mjs} +1 -1
- package/dist/{chunk-B2O55EVA.mjs → chunk-LA36HQWS.mjs} +1 -1
- package/dist/chunk-M3BGP5VE.mjs +1 -0
- package/dist/chunk-QHIWJPL6.mjs +1 -0
- package/dist/chunk-TIRCISSU.mjs +1 -0
- package/dist/chunk-TM7Q5NMH.mjs +1 -0
- package/dist/chunk-YUCUJWBO.mjs +1 -0
- package/dist/chunk-Z7JSWSPD.mjs +1 -0
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +21 -5
- package/dist/components/canvas/index.mjs +2 -2
- package/dist/components/ui/index.d.mts +25 -61
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +12 -6
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +36 -23
- package/dist/content/components/canvas/Button/index.tsx +2 -1
- package/dist/content/components/canvas/Card/card.tsx +3 -1
- package/dist/content/components/canvas/Carousel/carousel.tsx +3 -1
- package/dist/content/components/canvas/Container/container.tsx +4 -0
- package/dist/content/components/canvas/Container/parameters.ts +4 -0
- package/dist/content/components/canvas/DemoHero/atoms.tsx +4 -31
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +7 -1
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +8 -1
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +4 -2
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +65 -56
- package/dist/content/components/canvas/DemoHero/index.tsx +14 -3
- package/dist/content/components/canvas/DemoHero/utils.ts +0 -14
- package/dist/content/components/canvas/Flex/flex.tsx +4 -2
- package/dist/content/components/canvas/Grid/grid.tsx +3 -1
- package/dist/content/components/canvas/Image/image.tsx +2 -13
- package/dist/content/components/canvas/Image/placeholder.tsx +20 -0
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +3 -1
- package/dist/content/components/canvas/Modal/modal.tsx +69 -12
- package/dist/content/components/{ui → canvas}/Modal/style-utils.ts +4 -4
- package/dist/content/components/canvas/Review/default-variant.tsx +3 -1
- package/dist/content/components/canvas/Review/multi-column-variant.tsx +3 -1
- package/dist/content/components/canvas/Section/columns-variant.tsx +7 -1
- package/dist/content/components/canvas/Section/default-variant.tsx +10 -1
- package/dist/content/components/canvas/Section/section.tsx +4 -0
- package/dist/content/components/canvas/Table/table.tsx +6 -1
- package/dist/content/components/canvas/Tabs/tabs.tsx +6 -1
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +4 -2
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +4 -0
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +4 -2
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +4 -2
- package/dist/content/components/canvas/Video/index.tsx +2 -0
- package/dist/content/components/canvas/Video/video.tsx +2 -1
- package/dist/content/components/ui/Button/index.ts +5 -2
- 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 +7 -2
- package/dist/content/components/ui/Container/index.ts +6 -0
- package/dist/content/components/ui/Container/utils.ts +18 -0
- package/dist/content/components/ui/Flex/flex.tsx +27 -19
- package/dist/content/components/ui/Flex/index.ts +5 -1
- package/dist/content/components/ui/Footer/index.ts +1 -1
- package/dist/content/components/ui/Grid/grid.tsx +25 -19
- package/dist/content/components/ui/Grid/index.ts +16 -4
- package/dist/content/components/ui/GridItem/index.ts +10 -4
- package/dist/content/components/ui/Header/index.ts +1 -1
- package/dist/content/components/ui/Text/index.ts +6 -3
- package/dist/image-gallery-F6JLG7XW.mjs +1 -0
- package/dist/{index-D5cLtaIv.d.mts → index-B9eeSbLG.d.mts} +14 -7
- package/dist/index.mjs +1 -1
- package/dist/{mobile-JGZBHQC2.mjs → mobile-UAUHHXPH.mjs} +1 -1
- package/dist/modal-HKMQGV4B.mjs +1 -0
- package/dist/navigation-flyout-MXIJA6PC.mjs +1 -0
- package/dist/navigation-group-DEN3D2BO.mjs +1 -0
- package/dist/tabs-AQFKYC6M.mjs +1 -0
- package/package.json +10 -10
- package/dist/accordion-item-QAVKQEB2.mjs +0 -1
- package/dist/accordion-item-Y4PSNOH4.mjs +0 -1
- package/dist/carousel-RZ2DV6QX.mjs +0 -1
- package/dist/carousel-YELQRJVB.mjs +0 -1
- package/dist/chunk-2BMAPB63.mjs +0 -1
- package/dist/chunk-7GVG4HLE.mjs +0 -1
- package/dist/chunk-EOV2LPGC.mjs +0 -1
- package/dist/chunk-EUVKAE6M.mjs +0 -1
- package/dist/chunk-FIN5US3Q.mjs +0 -1
- package/dist/chunk-PMMAALCQ.mjs +0 -1
- package/dist/chunk-RYEXR67P.mjs +0 -1
- package/dist/chunk-TCQTXNKT.mjs +0 -1
- package/dist/chunk-WAW7PQYM.mjs +0 -1
- package/dist/chunk-YA5BXPZL.mjs +0 -1
- package/dist/content/components/ui/Accordion/accordion.tsx +0 -23
- package/dist/content/components/ui/Accordion/index.tsx +0 -9
- package/dist/content/components/ui/AccordionItem/accordion-item.tsx +0 -41
- package/dist/content/components/ui/AccordionItem/index.tsx +0 -16
- package/dist/content/components/ui/InlineSVG/index.ts +0 -13
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +0 -59
- package/dist/content/components/ui/InlineSVG/utils.ts +0 -77
- package/dist/content/components/ui/Modal/index.tsx +0 -22
- package/dist/content/components/ui/Modal/modal.tsx +0 -89
- package/dist/image-gallery-AMU6FS7N.mjs +0 -1
- package/dist/modal-43IHAVWB.mjs +0 -1
- package/dist/modal-5FNTFSTN.mjs +0 -1
- package/dist/navigation-flyout-NAU6O2WG.mjs +0 -1
- package/dist/navigation-group-QA65N6AI.mjs +0 -1
- package/dist/tabs-J23TEEQ7.mjs +0 -1
- /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-down.tsx +0 -0
- /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-up.tsx +0 -0
- /package/dist/content/components/{ui → canvas}/Modal/close-icon.tsx +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
1
2
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
3
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
3
4
|
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
@@ -19,7 +20,7 @@ export type BaseButtonParameters = {
|
|
|
19
20
|
text?: string;
|
|
20
21
|
link?: LinkParamValue;
|
|
21
22
|
textColor?: string;
|
|
22
|
-
textWeight?:
|
|
23
|
+
textWeight?: keyof DefaultTheme['fontWeight'];
|
|
23
24
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
24
25
|
textTransform?: string;
|
|
25
26
|
buttonColor?: string;
|
|
@@ -44,7 +45,6 @@ export type BaseImageParameters = {
|
|
|
44
45
|
border?: string | ViewPort<string>;
|
|
45
46
|
priority?: boolean;
|
|
46
47
|
unoptimized?: boolean;
|
|
47
|
-
fill?: boolean;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
export type EyebrowTitleTextParameters = PrefixedKeys<TextParameters, 'eyebrowTitle'>;
|
|
@@ -60,7 +60,10 @@ export type SecondaryButtonParameters = PrefixedKeys<BaseButtonParameters, 'seco
|
|
|
60
60
|
export type ImageParameters = PrefixedKeys<Omit<BaseImageParameters, 'image'>, 'image'> &
|
|
61
61
|
Pick<BaseImageParameters, 'image'>;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use FixedHeroParameters or FlexibleHeroParameters directly instead.
|
|
65
|
+
*/
|
|
66
|
+
export type DemoHeroParameters = ContainerParameters & {
|
|
64
67
|
contentAlignment?: ContentAlignment;
|
|
65
68
|
} & EyebrowTitleTextParameters &
|
|
66
69
|
TitleTextParameters &
|
|
@@ -71,6 +74,10 @@ type DemoHeroParameters = ContainerParameters & {
|
|
|
71
74
|
|
|
72
75
|
export type FixedHeroParameters = {
|
|
73
76
|
textColor?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Use overlayAutoTint instead.
|
|
79
|
+
*/
|
|
80
|
+
enableOverlayAutoTint?: boolean;
|
|
74
81
|
overlayAutoTint?: string;
|
|
75
82
|
} & DemoHeroParameters;
|
|
76
83
|
|
|
@@ -86,6 +93,10 @@ export enum FlexibleHeroSlots {
|
|
|
86
93
|
FlexibleHeroCta = 'flexibleHeroCta',
|
|
87
94
|
}
|
|
88
95
|
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Use FixedHeroProps or FlexibleHeroProps directly instead.
|
|
98
|
+
*/
|
|
99
|
+
export type DemoHeroProps = FixedHeroProps | FlexibleHeroProps;
|
|
89
100
|
export type FixedHeroProps = ComponentProps<FixedHeroParameters>;
|
|
90
101
|
export type FlexibleHeroProps = ComponentProps<FlexibleHeroParameters, FlexibleHeroSlots>;
|
|
91
102
|
|
|
@@ -29,17 +29,3 @@ export const cleanUpPrefix = <T extends Record<string, unknown>, Prefix extends
|
|
|
29
29
|
{} as RemovePrefix<T, Prefix>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
const HALF_DISPLAY_WIDTH = 608;
|
|
34
|
-
export const getImageParametersFocalPoint = (isVariant: boolean) => {
|
|
35
|
-
const columnImageDimensions = isVariant ? HALF_DISPLAY_WIDTH : undefined;
|
|
36
|
-
return {
|
|
37
|
-
imageFill: !isVariant,
|
|
38
|
-
...(columnImageDimensions
|
|
39
|
-
? {
|
|
40
|
-
imageWidth: columnImageDimensions,
|
|
41
|
-
imageHeight: columnImageDimensions,
|
|
42
|
-
}
|
|
43
|
-
: {}),
|
|
44
|
-
};
|
|
45
|
-
};
|
|
@@ -12,11 +12,12 @@ export const Flex: FC<FlexProps> = ({
|
|
|
12
12
|
spacing,
|
|
13
13
|
border,
|
|
14
14
|
fluidContent,
|
|
15
|
+
fullHeight,
|
|
15
16
|
slots,
|
|
16
17
|
component,
|
|
17
18
|
context,
|
|
18
19
|
className,
|
|
19
|
-
|
|
20
|
+
fitHeight,
|
|
20
21
|
wrapperClassName,
|
|
21
22
|
}) => (
|
|
22
23
|
<BaseFlex
|
|
@@ -29,7 +30,8 @@ export const Flex: FC<FlexProps> = ({
|
|
|
29
30
|
spacing,
|
|
30
31
|
border,
|
|
31
32
|
fluidContent,
|
|
32
|
-
|
|
33
|
+
fullHeight,
|
|
34
|
+
fitHeight,
|
|
33
35
|
wrapperClassName,
|
|
34
36
|
className,
|
|
35
37
|
}}
|
|
@@ -11,6 +11,8 @@ export const Grid: FC<GridProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
+
fullHeight,
|
|
15
|
+
fitHeight,
|
|
14
16
|
height,
|
|
15
17
|
slots,
|
|
16
18
|
component,
|
|
@@ -19,7 +21,7 @@ export const Grid: FC<GridProps> = ({
|
|
|
19
21
|
}) => (
|
|
20
22
|
<BaseGrid
|
|
21
23
|
className={className}
|
|
22
|
-
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, height }}
|
|
24
|
+
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
23
25
|
>
|
|
24
26
|
<UniformSlot data={component} context={context} slot={slots.gridInner} />
|
|
25
27
|
</BaseGrid>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { imageFrom } from '@uniformdev/assets';
|
|
3
3
|
import BaseImage from '@/components/ui/Image';
|
|
4
|
-
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
5
4
|
import { resolveAsset } from '@/utils/assets';
|
|
6
5
|
import { ImageProps } from '.';
|
|
6
|
+
import { ImagePlaceholder } from './placeholder';
|
|
7
7
|
|
|
8
8
|
export const Image: FC<ImageProps> = async ({
|
|
9
9
|
image,
|
|
@@ -22,18 +22,7 @@ export const Image: FC<ImageProps> = async ({
|
|
|
22
22
|
const [resolvedImage] = resolveAsset(image);
|
|
23
23
|
|
|
24
24
|
if (!resolvedImage) {
|
|
25
|
-
|
|
26
|
-
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
27
|
-
|
|
28
|
-
if (!isEditorPreviewMode || isPlaceholder) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div style={{ width: width ? `${width}px` : 'auto', height: height ? `${height}px` : 'auto' }}>
|
|
34
|
-
<MediaPlaceholder type="image" placeholder="Please add an asset to display an image" />
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
25
|
+
return <ImagePlaceholder context={context} component={component} width={width} height={height} />;
|
|
37
26
|
}
|
|
38
27
|
|
|
39
28
|
const { focalPoint, title = '' } = resolvedImage;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
3
|
+
import { ImageProps } from '.';
|
|
4
|
+
|
|
5
|
+
type ImagePlaceholderProps = Pick<ImageProps, 'component' | 'context' | 'width' | 'height'>;
|
|
6
|
+
|
|
7
|
+
export const ImagePlaceholder: FC<ImagePlaceholderProps> = ({ context, component, width, height }) => {
|
|
8
|
+
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
9
|
+
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
10
|
+
|
|
11
|
+
if (!isEditorPreviewMode || isPlaceholder) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div style={{ width: width ? `${width}px` : 'auto', height: height ? `${height}px` : 'auto' }}>
|
|
17
|
+
<MediaPlaceholder type="image" placeholder="Please add an asset to display an image" />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -16,6 +16,8 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
|
|
|
16
16
|
spacing,
|
|
17
17
|
border,
|
|
18
18
|
fluidContent,
|
|
19
|
+
fullHeight,
|
|
20
|
+
fitHeight,
|
|
19
21
|
height,
|
|
20
22
|
config,
|
|
21
23
|
context,
|
|
@@ -43,7 +45,7 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
|
|
|
43
45
|
?.length;
|
|
44
46
|
|
|
45
47
|
return (
|
|
46
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
48
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
47
49
|
<div className="flex flex-col gap-1">
|
|
48
50
|
{showEmptySlot ? (
|
|
49
51
|
<UniformSlot context={context} slot={slots.imageGalleryItems} data={component} />
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC } from 'react';
|
|
3
|
+
import { FC, useCallback, useState, MouseEvent, useRef, useEffect } from 'react';
|
|
4
4
|
import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
|
|
5
|
-
import
|
|
5
|
+
import { cn } from '@/utils/styling';
|
|
6
6
|
import { ModalProps } from '.';
|
|
7
|
+
import { CloseIcon } from './close-icon';
|
|
8
|
+
import { getCloseButtonClasses, getDialogClasses, getFormClasses } from './style-utils';
|
|
7
9
|
|
|
8
10
|
export const Modal: FC<ModalProps> = ({
|
|
9
11
|
slots,
|
|
@@ -13,13 +15,68 @@ export const Modal: FC<ModalProps> = ({
|
|
|
13
15
|
backgroundColor,
|
|
14
16
|
closeIconColor,
|
|
15
17
|
disableCloseModalOnClickOutside,
|
|
16
|
-
}) =>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
18
|
+
}) => {
|
|
19
|
+
const modalActionsRef = useRef<HTMLDivElement>(null);
|
|
20
|
+
const [showModal, setShowModal] = useState(false);
|
|
21
|
+
|
|
22
|
+
const handleClickOutside = useCallback(() => {
|
|
23
|
+
if (!disableCloseModalOnClickOutside) setShowModal(false);
|
|
24
|
+
}, [disableCloseModalOnClickOutside]);
|
|
25
|
+
|
|
26
|
+
const toggleModal = useCallback(() => {
|
|
27
|
+
setShowModal(prev => !prev);
|
|
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
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/utils/styling';
|
|
2
|
-
import { MaxWidthMap,
|
|
2
|
+
import { MaxWidthMap, ModalParameters } from '.';
|
|
3
3
|
|
|
4
4
|
type DialogClassesProps = {
|
|
5
5
|
showModal?: boolean;
|
|
@@ -11,8 +11,8 @@ export const getDialogClasses = ({ showModal }: DialogClassesProps) =>
|
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
type FormClassesProps = {
|
|
14
|
-
maxWidth?:
|
|
15
|
-
backgroundColor?:
|
|
14
|
+
maxWidth?: ModalParameters['maxWidth'];
|
|
15
|
+
backgroundColor?: ModalParameters['backgroundColor'];
|
|
16
16
|
};
|
|
17
17
|
export const getFormClasses = ({ maxWidth, backgroundColor }: FormClassesProps) =>
|
|
18
18
|
cn('rounded-lg shadow-lg relative', MaxWidthMap[maxWidth || 'small'], {
|
|
@@ -20,7 +20,7 @@ export const getFormClasses = ({ maxWidth, backgroundColor }: FormClassesProps)
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
type CloseButtonClassesProps = {
|
|
23
|
-
disableCloseModalOnClickOutside?:
|
|
23
|
+
disableCloseModalOnClickOutside?: ModalParameters['disableCloseModalOnClickOutside'];
|
|
24
24
|
};
|
|
25
25
|
export const getCloseButtonClasses = ({ disableCloseModalOnClickOutside }: CloseButtonClassesProps) =>
|
|
26
26
|
cn('group absolute right-4 top-4 opacity-40 hover:opacity-100', {
|
|
@@ -18,12 +18,14 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
18
18
|
spacing,
|
|
19
19
|
border,
|
|
20
20
|
fluidContent,
|
|
21
|
+
fullHeight,
|
|
22
|
+
fitHeight,
|
|
21
23
|
height,
|
|
22
24
|
ReviewImage,
|
|
23
25
|
ReviewPersonInfo,
|
|
24
26
|
ReviewContent,
|
|
25
27
|
}) => (
|
|
26
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
28
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
27
29
|
<div className="mx-auto flex lg:max-w-[60%]">
|
|
28
30
|
<div className="aspect-square size-12 shrink-0 rounded-full">{ReviewImage}</div>
|
|
29
31
|
<div className="ml-6">
|
|
@@ -18,12 +18,14 @@ export const MultiColumnVariant: FC<MultiColumnVariantProps> = ({
|
|
|
18
18
|
spacing,
|
|
19
19
|
border,
|
|
20
20
|
fluidContent,
|
|
21
|
+
fullHeight,
|
|
22
|
+
fitHeight,
|
|
21
23
|
height,
|
|
22
24
|
ReviewImage,
|
|
23
25
|
ReviewPersonInfo,
|
|
24
26
|
ReviewContent,
|
|
25
27
|
}) => (
|
|
26
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
28
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
27
29
|
<div className="grid md:grid-cols-12">
|
|
28
30
|
<div className="mb-2 md:col-span-4 md:my-0">
|
|
29
31
|
<div className="mb-2 aspect-square size-12 rounded-full">{ReviewImage}</div>
|
|
@@ -8,6 +8,10 @@ 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'];
|
|
11
15
|
height: SectionParameters['height'];
|
|
12
16
|
variant: SectionVariants;
|
|
13
17
|
sectionMedia: React.ReactNode;
|
|
@@ -22,6 +26,8 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
22
26
|
spacing,
|
|
23
27
|
border,
|
|
24
28
|
fluidContent,
|
|
29
|
+
fullHeight,
|
|
30
|
+
fitHeight,
|
|
25
31
|
height,
|
|
26
32
|
variant,
|
|
27
33
|
sectionMedia,
|
|
@@ -30,7 +36,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
30
36
|
textAlignmentClass,
|
|
31
37
|
buttonAlignmentClass,
|
|
32
38
|
}) => (
|
|
33
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
39
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
34
40
|
<div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
|
|
35
41
|
<div className={cn('aspect-square', { 'order-last': variant === SectionVariants.ColumnsReverse })}>
|
|
36
42
|
<div className="flex size-full items-center justify-center overflow-hidden">{sectionMedia}</div>
|
|
@@ -8,6 +8,10 @@ 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'];
|
|
11
15
|
height?: SectionParameters['height'];
|
|
12
16
|
sectionMedia: React.ReactNode;
|
|
13
17
|
sectionContent: React.ReactNode;
|
|
@@ -21,6 +25,8 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
21
25
|
spacing,
|
|
22
26
|
border,
|
|
23
27
|
fluidContent,
|
|
28
|
+
fullHeight,
|
|
29
|
+
fitHeight,
|
|
24
30
|
height,
|
|
25
31
|
sectionMedia,
|
|
26
32
|
sectionContent,
|
|
@@ -28,7 +34,10 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
28
34
|
textAlignmentClass,
|
|
29
35
|
buttonAlignmentClass,
|
|
30
36
|
}) => (
|
|
31
|
-
<Container
|
|
37
|
+
<Container
|
|
38
|
+
className="relative overflow-hidden"
|
|
39
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
40
|
+
>
|
|
32
41
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{sectionMedia}</div>
|
|
33
42
|
<Container className="relative flex flex-col gap-8">
|
|
34
43
|
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{sectionContent}</div>
|
|
@@ -14,6 +14,8 @@ export const Section: FC<SectionProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
+
fullHeight,
|
|
18
|
+
fitHeight,
|
|
17
19
|
height,
|
|
18
20
|
}) => {
|
|
19
21
|
const variant = component.variant as SectionVariants;
|
|
@@ -24,6 +26,8 @@ export const Section: FC<SectionProps> = ({
|
|
|
24
26
|
spacing,
|
|
25
27
|
border,
|
|
26
28
|
fluidContent,
|
|
29
|
+
fullHeight,
|
|
30
|
+
fitHeight,
|
|
27
31
|
height,
|
|
28
32
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
29
33
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -14,9 +14,14 @@ export const Table: FC<TableProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
+
fullHeight,
|
|
18
|
+
fitHeight,
|
|
17
19
|
height,
|
|
18
20
|
}) => (
|
|
19
|
-
<Container
|
|
21
|
+
<Container
|
|
22
|
+
className="flex flex-col gap-5"
|
|
23
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
24
|
+
>
|
|
20
25
|
<div className="overflow-x-auto">
|
|
21
26
|
<table className={getTableClasses({ size, textColor })}>
|
|
22
27
|
<thead>
|
|
@@ -16,6 +16,8 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
16
16
|
spacing,
|
|
17
17
|
border,
|
|
18
18
|
fluidContent,
|
|
19
|
+
fullHeight,
|
|
20
|
+
fitHeight,
|
|
19
21
|
height,
|
|
20
22
|
}) => {
|
|
21
23
|
const variant = (component.variant || TabsVariants.Default) as TabsVariants;
|
|
@@ -44,7 +46,10 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
44
46
|
);
|
|
45
47
|
|
|
46
48
|
return (
|
|
47
|
-
<Container
|
|
49
|
+
<Container
|
|
50
|
+
className="flex flex-col gap-5"
|
|
51
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
52
|
+
>
|
|
48
53
|
<div className={getButtonContainerClasses({ color, variant })}>
|
|
49
54
|
{tabItems.map((tabItem, index) => (
|
|
50
55
|
<button
|
|
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
|
|
|
4
4
|
|
|
5
5
|
type WithLargeAvatarVariantProps = Pick<
|
|
6
6
|
TestimonialProps,
|
|
7
|
-
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
7
|
+
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
|
|
8
8
|
> & {
|
|
9
9
|
testimonialPrimaryImage: React.ReactNode;
|
|
10
10
|
testimonialContent: React.ReactNode;
|
|
@@ -21,9 +21,11 @@ export const DefaultVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
|
21
21
|
spacing,
|
|
22
22
|
border,
|
|
23
23
|
fluidContent,
|
|
24
|
+
fullHeight,
|
|
25
|
+
fitHeight,
|
|
24
26
|
height,
|
|
25
27
|
}) => (
|
|
26
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
28
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
27
29
|
<div className="mx-auto flex flex-col items-center md:max-w-[80%]">
|
|
28
30
|
<div>{testimonialSecondaryImage}</div>
|
|
29
31
|
<div className="my-8">{testimonialContent}</div>
|
|
@@ -13,6 +13,8 @@ export const Testimonial: FC<TestimonialProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
+
fullHeight,
|
|
17
|
+
fitHeight,
|
|
16
18
|
height,
|
|
17
19
|
}) => {
|
|
18
20
|
const variant = component.variant as TestimonialVariants | undefined;
|
|
@@ -22,6 +24,8 @@ export const Testimonial: FC<TestimonialProps> = ({
|
|
|
22
24
|
spacing,
|
|
23
25
|
border,
|
|
24
26
|
fluidContent,
|
|
27
|
+
fullHeight,
|
|
28
|
+
fitHeight,
|
|
25
29
|
height,
|
|
26
30
|
testimonialPrimaryImage: <UniformSlot context={context} data={component} slot={slots.testimonialPrimaryImage} />,
|
|
27
31
|
testimonialContent: <UniformSlot context={context} data={component} slot={slots.testimonialContent} />,
|
|
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
|
|
|
4
4
|
|
|
5
5
|
type WithLargeAvatarVariantProps = Pick<
|
|
6
6
|
TestimonialProps,
|
|
7
|
-
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
7
|
+
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
|
|
8
8
|
> & {
|
|
9
9
|
testimonialPrimaryImage: React.ReactNode;
|
|
10
10
|
testimonialContent: React.ReactNode;
|
|
@@ -21,9 +21,11 @@ export const WithLargeAvatarVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
|
21
21
|
spacing,
|
|
22
22
|
border,
|
|
23
23
|
fluidContent,
|
|
24
|
+
fullHeight,
|
|
25
|
+
fitHeight,
|
|
24
26
|
height,
|
|
25
27
|
}) => (
|
|
26
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
28
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
27
29
|
<div className="mx-auto flex items-center gap-x-10 md:max-w-[80%]">
|
|
28
30
|
<div className="hidden aspect-square w-full max-w-xs shrink-0 overflow-hidden rounded-xl lg:block">
|
|
29
31
|
{testimonialPrimaryImage}
|
|
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
|
|
|
4
4
|
|
|
5
5
|
type WithLargeAvatarVariantProps = Pick<
|
|
6
6
|
TestimonialProps,
|
|
7
|
-
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
7
|
+
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
|
|
8
8
|
> & {
|
|
9
9
|
testimonialPrimaryImage: React.ReactNode;
|
|
10
10
|
testimonialContent: React.ReactNode;
|
|
@@ -21,9 +21,11 @@ export const WithOverlappingImageVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
|
21
21
|
spacing,
|
|
22
22
|
border,
|
|
23
23
|
fluidContent,
|
|
24
|
+
fullHeight,
|
|
25
|
+
fitHeight,
|
|
24
26
|
height,
|
|
25
27
|
}) => (
|
|
26
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
28
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
27
29
|
<Container className="pb-10 lg:pb-0">
|
|
28
30
|
<div className="mx-auto flex max-w-2xl flex-col items-center gap-10 lg:max-w-none lg:flex-row">
|
|
29
31
|
<div className="-mt-7 aspect-[2/1] w-full shrink-0 overflow-hidden rounded-xl lg:-my-7 lg:aspect-[1/1.4] lg:max-w-xs">
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
|
+
import { LinkParamValue } from '@uniformdev/canvas';
|
|
2
3
|
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
3
4
|
import { ViewPort } from '@/types/cskTypes';
|
|
4
5
|
|
|
5
6
|
export type VideoParameters = {
|
|
6
7
|
video?: AssetParamValue;
|
|
8
|
+
url?: LinkParamValue; // Deprecated. Please use video parameter instead of url
|
|
7
9
|
placeholderImage?: AssetParamValue;
|
|
8
10
|
autoPlay?: boolean;
|
|
9
11
|
lazyLoad?: boolean;
|
|
@@ -8,6 +8,7 @@ import { VideoPlaceholder } from './placeholder';
|
|
|
8
8
|
|
|
9
9
|
export const Video: FC<VideoProps> = ({
|
|
10
10
|
video,
|
|
11
|
+
url, // Deprecated. Please use video parameter instead of url
|
|
11
12
|
placeholderImage,
|
|
12
13
|
autoPlay,
|
|
13
14
|
lazyLoad,
|
|
@@ -23,7 +24,7 @@ export const Video: FC<VideoProps> = ({
|
|
|
23
24
|
const [resolvedVideo] = resolveAsset(video);
|
|
24
25
|
const [resolvedImage] = resolveAsset(placeholderImage);
|
|
25
26
|
|
|
26
|
-
const resolvedVideoUrl = resolvedVideo?.url;
|
|
27
|
+
const resolvedVideoUrl = resolvedVideo?.url || (url?.type === 'url' ? url.path : undefined);
|
|
27
28
|
|
|
28
29
|
if (!resolvedVideoUrl) {
|
|
29
30
|
return <VideoPlaceholder component={component} context={context} />;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
2
3
|
import { ViewPort } from '@/types/cskTypes';
|
|
3
4
|
|
|
4
5
|
export enum ButtonVariant {
|
|
5
6
|
Link = 'link',
|
|
6
7
|
}
|
|
7
8
|
|
|
9
|
+
type TextSize = keyof DefaultTheme['fontSize'];
|
|
10
|
+
|
|
8
11
|
export type ButtonProps = PropsWithChildren<{
|
|
9
12
|
variant?: ButtonVariant;
|
|
10
13
|
href?: string;
|
|
@@ -12,8 +15,8 @@ export type ButtonProps = PropsWithChildren<{
|
|
|
12
15
|
size?: string;
|
|
13
16
|
className?: string;
|
|
14
17
|
textColor?: string;
|
|
15
|
-
textSize?:
|
|
16
|
-
textWeight?:
|
|
18
|
+
textSize?: TextSize | ViewPort<TextSize>;
|
|
19
|
+
textWeight?: keyof DefaultTheme['fontWeight'];
|
|
17
20
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
18
21
|
textTransform?: string;
|
|
19
22
|
buttonColor?: string;
|
|
@@ -11,7 +11,7 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
-
|
|
14
|
+
fullHeight,
|
|
15
15
|
itemsPerPage = '1',
|
|
16
16
|
children,
|
|
17
17
|
gapX,
|
|
@@ -116,7 +116,7 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
|
-
<BaseContainer {...{ backgroundColor, spacing, border, fluidContent,
|
|
119
|
+
<BaseContainer {...{ backgroundColor, spacing, border, fluidContent, fullHeight }}>
|
|
120
120
|
<div
|
|
121
121
|
className={cn('relative', {
|
|
122
122
|
[resolveViewPort(gapX, '-mx-{value}')]: gapX,
|
|
@@ -4,7 +4,7 @@ import { ContainerProps as BaseContainerProps } from '@/components/ui/Container'
|
|
|
4
4
|
|
|
5
5
|
export type CarouselProps = Pick<
|
|
6
6
|
BaseContainerProps,
|
|
7
|
-
'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | '
|
|
7
|
+
'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight'
|
|
8
8
|
> & {
|
|
9
9
|
countOfItems?: number;
|
|
10
10
|
children: (options: { className?: string; style?: React.CSSProperties }) => ReactElement;
|