@uniformdev/csk-components 6.0.123-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 -1
- 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 -14
- 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-ABORGLS6.mjs +0 -2
- package/dist/chunk-EOV2LPGC.mjs +0 -1
- package/dist/chunk-EUVKAE6M.mjs +0 -1
- package/dist/chunk-FIN5US3Q.mjs +0 -1
- package/dist/chunk-LZOK42EM.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/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-EPIOXRWJ.mjs +0 -1
- package/dist/navigation-group-OCZ35QI2.mjs +0 -1
- package/dist/tabs-J23TEEQ7.mjs +0 -1
- package/dist/utils/sitemap.d.mts +0 -21
- package/dist/utils/sitemap.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,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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { cn, formatSpaceParameterValue, resolveViewPort } from '@/utils/styling';
|
|
3
3
|
import { ContainerProps } from '.';
|
|
4
|
+
import { getHeightValue } from './utils';
|
|
4
5
|
|
|
5
6
|
export const Container: FC<ContainerProps> = ({
|
|
6
7
|
className,
|
|
@@ -11,6 +12,8 @@ export const Container: FC<ContainerProps> = ({
|
|
|
11
12
|
spacing,
|
|
12
13
|
border = '',
|
|
13
14
|
fluidContent = false,
|
|
15
|
+
fullHeight = false,
|
|
16
|
+
fitHeight = false,
|
|
14
17
|
height,
|
|
15
18
|
maxWidth,
|
|
16
19
|
...rest
|
|
@@ -20,6 +23,8 @@ export const Container: FC<ContainerProps> = ({
|
|
|
20
23
|
{ marginTop, marginBottom, marginRight, marginLeft, paddingTop, paddingBottom, paddingRight, paddingLeft },
|
|
21
24
|
] = formatSpaceParameterValue(spacing);
|
|
22
25
|
|
|
26
|
+
const heightValue = getHeightValue({ height, fullHeight, fitHeight });
|
|
27
|
+
|
|
23
28
|
return (
|
|
24
29
|
<div
|
|
25
30
|
className={cn(
|
|
@@ -29,7 +34,7 @@ export const Container: FC<ContainerProps> = ({
|
|
|
29
34
|
'mx-auto w-full': !fluidContent,
|
|
30
35
|
'max-w-7xl max-w-container-width': !maxWidth && !fluidContent,
|
|
31
36
|
[`max-w-${maxWidth}`]: !!maxWidth && !fluidContent,
|
|
32
|
-
[resolveViewPort(
|
|
37
|
+
[resolveViewPort(heightValue, 'h-{value}')]: heightValue,
|
|
33
38
|
},
|
|
34
39
|
wrapperClassName
|
|
35
40
|
)}
|
|
@@ -47,7 +52,7 @@ export const Container: FC<ContainerProps> = ({
|
|
|
47
52
|
[resolveViewPort(paddingRight, 'pr-{value}')]: paddingRight,
|
|
48
53
|
[resolveViewPort(paddingLeft, 'pl-{value}')]: paddingLeft,
|
|
49
54
|
[resolveViewPort(border, '{value}')]: border,
|
|
50
|
-
[resolveViewPort(
|
|
55
|
+
[resolveViewPort(heightValue, 'h-{value}')]: heightValue,
|
|
51
56
|
},
|
|
52
57
|
className
|
|
53
58
|
)}
|
|
@@ -6,9 +6,15 @@ export type ContainerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
6
6
|
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
7
7
|
border?: string | ViewPort<string>;
|
|
8
8
|
fluidContent?: boolean;
|
|
9
|
+
/** @deprecated Use height prop instead */
|
|
10
|
+
fullHeight?: boolean;
|
|
11
|
+
/** @deprecated Use height prop instead */
|
|
12
|
+
fitHeight?: boolean;
|
|
9
13
|
height?: string | ViewPort<string>;
|
|
10
14
|
wrapperClassName?: string;
|
|
11
15
|
maxWidth?: string;
|
|
12
16
|
};
|
|
13
17
|
|
|
18
|
+
export { getHeightValue } from './utils';
|
|
19
|
+
|
|
14
20
|
export { Container as default } from './container';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewPort } from '@/types/cskTypes';
|
|
2
|
+
|
|
3
|
+
export const getHeightValue = ({
|
|
4
|
+
height,
|
|
5
|
+
fullHeight,
|
|
6
|
+
fitHeight,
|
|
7
|
+
}: {
|
|
8
|
+
height?: string | ViewPort<string> | undefined;
|
|
9
|
+
fullHeight?: boolean | undefined;
|
|
10
|
+
fitHeight?: boolean | undefined;
|
|
11
|
+
}) => {
|
|
12
|
+
if (height) return height;
|
|
13
|
+
// Cover deprecated cases
|
|
14
|
+
if (fullHeight) return 'h-screen';
|
|
15
|
+
if (fitHeight) return 'h-full';
|
|
16
|
+
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import BaseContainer from '@/components/ui/Container';
|
|
2
|
+
import BaseContainer, { getHeightValue } from '@/components/ui/Container';
|
|
3
3
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
4
4
|
import { FlexProps } from '.';
|
|
5
5
|
|
|
@@ -14,24 +14,32 @@ export const Flex: FC<FlexProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
+
fullHeight,
|
|
18
|
+
fitHeight,
|
|
17
19
|
height,
|
|
18
20
|
children,
|
|
19
|
-
}) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[resolveViewPort(direction, 'flex-{value}')]: direction,
|
|
26
|
-
[resolveViewPort(justifyContent, 'justify-{value}')]: justifyContent,
|
|
27
|
-
[resolveViewPort(gap, 'gap-{value}')]: gap,
|
|
28
|
-
[resolveViewPort(alignItems, 'items-{value}')]: alignItems,
|
|
29
|
-
[resolveViewPort(height, 'h-{value}')]: height,
|
|
30
|
-
},
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
21
|
+
}) => {
|
|
22
|
+
const heightValue = getHeightValue({ height, fullHeight, fitHeight });
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<BaseContainer
|
|
26
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height, wrapperClassName }}
|
|
33
27
|
>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
<div
|
|
29
|
+
className={cn(
|
|
30
|
+
'flex',
|
|
31
|
+
{
|
|
32
|
+
[resolveViewPort(direction, 'flex-{value}')]: direction,
|
|
33
|
+
[resolveViewPort(justifyContent, 'justify-{value}')]: justifyContent,
|
|
34
|
+
[resolveViewPort(gap, 'gap-{value}')]: gap,
|
|
35
|
+
[resolveViewPort(alignItems, 'items-{value}')]: alignItems,
|
|
36
|
+
[resolveViewPort(heightValue, 'h-{value}')]: heightValue,
|
|
37
|
+
},
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
</BaseContainer>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
1
2
|
import { ContainerProps as BaseContainerProps } from '@/components/ui/Container';
|
|
2
3
|
import { ViewPort } from '@/types/cskTypes';
|
|
3
4
|
|
|
4
5
|
type Direction = 'row' | 'row-reverse' | 'col' | 'col-reverse';
|
|
5
6
|
type Justify = 'normal' | 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';
|
|
7
|
+
type FlexGap = keyof DefaultTheme['spacing'];
|
|
6
8
|
type Align = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
7
9
|
|
|
8
10
|
export type FlexProps = Pick<
|
|
@@ -14,12 +16,14 @@ export type FlexProps = Pick<
|
|
|
14
16
|
| 'spacing'
|
|
15
17
|
| 'border'
|
|
16
18
|
| 'fluidContent'
|
|
19
|
+
| 'fullHeight'
|
|
20
|
+
| 'fitHeight'
|
|
17
21
|
| 'height'
|
|
18
22
|
| 'children'
|
|
19
23
|
> & {
|
|
20
24
|
direction?: Direction | ViewPort<Direction>;
|
|
21
25
|
justifyContent?: Justify | ViewPort<Justify>;
|
|
22
|
-
gap?:
|
|
26
|
+
gap?: FlexGap | ViewPort<FlexGap>;
|
|
23
27
|
alignItems?: Align | ViewPort<Align>;
|
|
24
28
|
};
|
|
25
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContainerProps as BaseContainerProps } from '@/components/ui/Container';
|
|
2
2
|
|
|
3
|
-
export type FooterProps = Omit<BaseContainerProps, '
|
|
3
|
+
export type FooterProps = Omit<BaseContainerProps, 'fullHeight' | 'content'> & {
|
|
4
4
|
logo?: React.ReactNode;
|
|
5
5
|
copyright?: React.ReactNode;
|
|
6
6
|
content?: React.ReactNode;
|