@uniformdev/csk-components 6.0.104 → 6.0.114-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-QAVKQEB2.mjs +1 -0
- package/dist/accordion-item-Y4PSNOH4.mjs +1 -0
- 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-7GVG4HLE.mjs +1 -0
- package/dist/{chunk-LA36HQWS.mjs → chunk-B2O55EVA.mjs} +1 -1
- package/dist/chunk-EIEZRPWW.mjs +1 -0
- package/dist/chunk-EOV2LPGC.mjs +1 -0
- package/dist/chunk-EUVKAE6M.mjs +1 -0
- package/dist/chunk-LG7MD2DH.mjs +1 -0
- package/dist/chunk-PMMAALCQ.mjs +1 -0
- package/dist/chunk-RYEXR67P.mjs +1 -0
- package/dist/chunk-TCQTXNKT.mjs +1 -0
- package/dist/{chunk-FPOIJMYT.mjs → chunk-VW2XC3SE.mjs} +1 -1
- package/dist/chunk-WAW7PQYM.mjs +1 -0
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +5 -21
- package/dist/components/canvas/index.mjs +2 -2
- package/dist/components/ui/index.d.mts +48 -25
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +6 -12
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +23 -36
- package/dist/content/components/canvas/Button/index.tsx +1 -2
- 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 +31 -4
- 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 +2 -4
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +57 -65
- package/dist/content/components/canvas/DemoHero/index.tsx +3 -14
- package/dist/content/components/canvas/DemoHero/utils.ts +14 -0
- package/dist/content/components/canvas/Flex/flex.tsx +2 -4
- package/dist/content/components/canvas/Grid/grid.tsx +1 -3
- package/dist/content/components/canvas/Image/image.tsx +13 -2
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +1 -3
- 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/Button/index.ts +2 -5
- 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 +1 -5
- 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 +4 -16
- package/dist/content/components/ui/GridItem/index.ts +4 -10
- package/dist/content/components/ui/Header/index.ts +1 -1
- package/dist/content/components/ui/Text/index.ts +3 -6
- package/dist/image-gallery-AMU6FS7N.mjs +1 -0
- package/dist/{index-B9eeSbLG.d.mts → index-D5cLtaIv.d.mts} +7 -14
- package/dist/{mobile-UAUHHXPH.mjs → mobile-JGZBHQC2.mjs} +1 -1
- package/dist/navigation-flyout-NAU6O2WG.mjs +1 -0
- package/dist/navigation-group-QA65N6AI.mjs +1 -0
- package/dist/tabs-J23TEEQ7.mjs +1 -0
- package/package.json +7 -7
- package/dist/accordion-item-G5CNMERW.mjs +0 -1
- package/dist/carousel-BBEW5P4Y.mjs +0 -1
- package/dist/carousel-ERCHOWUS.mjs +0 -1
- package/dist/chunk-4LWAGTFW.mjs +0 -1
- package/dist/chunk-5VM2Y55L.mjs +0 -1
- package/dist/chunk-AKRWCDDG.mjs +0 -1
- package/dist/chunk-M3BGP5VE.mjs +0 -1
- package/dist/chunk-QHIWJPL6.mjs +0 -1
- package/dist/chunk-TIRCISSU.mjs +0 -1
- package/dist/chunk-TM7Q5NMH.mjs +0 -1
- package/dist/chunk-YUCUJWBO.mjs +0 -1
- package/dist/chunk-Z7JSWSPD.mjs +0 -1
- package/dist/content/components/canvas/AccordionItem/icon-arrow-down.tsx +0 -20
- package/dist/content/components/canvas/AccordionItem/icon-arrow-up.tsx +0 -20
- package/dist/content/components/canvas/Image/placeholder.tsx +0 -20
- package/dist/content/components/ui/Container/utils.ts +0 -18
- package/dist/image-gallery-F6JLG7XW.mjs +0 -1
- package/dist/navigation-flyout-MXIJA6PC.mjs +0 -1
- package/dist/navigation-group-DEN3D2BO.mjs +0 -1
- package/dist/tabs-AQFKYC6M.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
|
|
3
|
-
import
|
|
3
|
+
import BaseAccordion from '@/components/ui/Accordion';
|
|
4
4
|
import { AccordionProps } from '.';
|
|
5
5
|
|
|
6
6
|
export const Accordion: FC<AccordionProps> = ({
|
|
@@ -11,17 +11,11 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
-
fullHeight,
|
|
15
|
-
fitHeight,
|
|
16
14
|
height,
|
|
17
15
|
}) => (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<UniformSlot data={component} context={context} slot={slots.accordionContent} />
|
|
24
|
-
</div>
|
|
25
|
-
<UniformSlot data={component} context={context} slot={slots.accordionItems} />
|
|
26
|
-
</Container>
|
|
16
|
+
<BaseAccordion
|
|
17
|
+
accordionContent={<UniformSlot data={component} context={context} slot={slots.accordionContent} />}
|
|
18
|
+
accordionItems={<UniformSlot data={component} context={context} slot={slots.accordionItems} />}
|
|
19
|
+
{...{ backgroundColor, spacing, border, fluidContent, height }}
|
|
20
|
+
/>
|
|
27
21
|
);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC
|
|
3
|
+
import { FC } from 'react';
|
|
4
4
|
import { UniformSlot, UniformText } from '@uniformdev/canvas-next-rsc/component';
|
|
5
|
-
import
|
|
5
|
+
import BaseAccordionItem from '@/components/ui/AccordionItem';
|
|
6
6
|
import BaseText from '@/components/ui/Text';
|
|
7
|
-
import { cn } from '@/utils/styling';
|
|
8
7
|
import { AccordionItemProps } from '.';
|
|
9
|
-
import { IconArrowDown } from './icon-arrow-down';
|
|
10
|
-
import { IconArrowUp } from './icon-arrow-up';
|
|
11
8
|
|
|
12
9
|
export const AccordionItem: FC<AccordionItemProps> = ({
|
|
13
10
|
tag,
|
|
@@ -25,34 +22,24 @@ export const AccordionItem: FC<AccordionItemProps> = ({
|
|
|
25
22
|
backgroundColor,
|
|
26
23
|
spacing,
|
|
27
24
|
className,
|
|
28
|
-
}) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})}
|
|
50
|
-
>
|
|
51
|
-
{isOpened ? <IconArrowDown /> : <IconArrowUp />}
|
|
52
|
-
</div>
|
|
53
|
-
</button>
|
|
54
|
-
</Container>
|
|
55
|
-
{isOpened && <UniformSlot data={component} context={context} slot={slots.accordionItemContent} />}
|
|
56
|
-
</Container>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
25
|
+
}) => (
|
|
26
|
+
<BaseAccordionItem
|
|
27
|
+
{...{
|
|
28
|
+
backgroundColor,
|
|
29
|
+
spacing,
|
|
30
|
+
className,
|
|
31
|
+
}}
|
|
32
|
+
text={
|
|
33
|
+
<BaseText {...{ alignment, color, size, font, weight, transform, decoration, letterSpacing }}>
|
|
34
|
+
<UniformText
|
|
35
|
+
placeholder="Text goes here"
|
|
36
|
+
parameterId="text"
|
|
37
|
+
as={tag || undefined}
|
|
38
|
+
component={component}
|
|
39
|
+
context={context}
|
|
40
|
+
/>
|
|
41
|
+
</BaseText>
|
|
42
|
+
}
|
|
43
|
+
accordionItemContent={<UniformSlot data={component} context={context} slot={slots.accordionItemContent} />}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
2
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
2
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
4
3
|
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
@@ -10,7 +9,7 @@ export type ButtonParameters = {
|
|
|
10
9
|
text?: string;
|
|
11
10
|
link?: LinkParamValue;
|
|
12
11
|
textColor?: string;
|
|
13
|
-
textWeight?:
|
|
12
|
+
textWeight?: string;
|
|
14
13
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
15
14
|
textTransform?: string;
|
|
16
15
|
buttonColor?: string;
|
|
@@ -12,8 +12,6 @@ export const Card: FC<CardProps> = ({
|
|
|
12
12
|
spacing,
|
|
13
13
|
border,
|
|
14
14
|
fluidContent,
|
|
15
|
-
fullHeight,
|
|
16
|
-
fitHeight,
|
|
17
15
|
height,
|
|
18
16
|
className,
|
|
19
17
|
contentClassName,
|
|
@@ -23,7 +21,7 @@ export const Card: FC<CardProps> = ({
|
|
|
23
21
|
return (
|
|
24
22
|
<Container
|
|
25
23
|
className={cn('relative overflow-hidden', className)}
|
|
26
|
-
{...{ backgroundColor, spacing, border, fluidContent,
|
|
24
|
+
{...{ backgroundColor, spacing, border, fluidContent, height }}
|
|
27
25
|
>
|
|
28
26
|
<div
|
|
29
27
|
className={cn({
|
|
@@ -13,14 +13,12 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
-
fullHeight,
|
|
17
|
-
fitHeight,
|
|
18
16
|
height,
|
|
19
17
|
itemsPerPage,
|
|
20
18
|
gapX,
|
|
21
19
|
}) => (
|
|
22
20
|
<BaseCarousel
|
|
23
|
-
{...{ backgroundColor, spacing, border, fluidContent,
|
|
21
|
+
{...{ backgroundColor, spacing, border, fluidContent, height, itemsPerPage, gapX }}
|
|
24
22
|
countOfItems={slots.carouselItems?.items.length ?? 0}
|
|
25
23
|
variant={component.variant}
|
|
26
24
|
>
|
|
@@ -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
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { imageFrom } from '@uniformdev/assets';
|
|
2
3
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
3
4
|
import { CompositionContext, UniformText } from '@uniformdev/canvas-next-rsc/component';
|
|
4
5
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
@@ -95,6 +96,7 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
95
96
|
border,
|
|
96
97
|
priority,
|
|
97
98
|
unoptimized,
|
|
99
|
+
fill,
|
|
98
100
|
}) => {
|
|
99
101
|
const [resolvedImage] = resolveAsset(image);
|
|
100
102
|
|
|
@@ -113,14 +115,38 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
113
115
|
);
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
const {
|
|
118
|
+
const { focalPoint, title = '' } = resolvedImage;
|
|
119
|
+
|
|
120
|
+
const imageWidth = width || resolvedImage.width;
|
|
121
|
+
const imageHeight = height || resolvedImage.height;
|
|
122
|
+
|
|
123
|
+
if (!fill && (!imageWidth || !imageHeight)) {
|
|
124
|
+
console.warn(
|
|
125
|
+
'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
|
|
126
|
+
);
|
|
127
|
+
return <img src={resolvedImage.url} alt={title} />;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const imageUrl = imageFrom(resolvedImage?.url)
|
|
131
|
+
.transform({
|
|
132
|
+
width: width,
|
|
133
|
+
height: height,
|
|
134
|
+
fit: objectFit,
|
|
135
|
+
focal: focalPoint,
|
|
136
|
+
})
|
|
137
|
+
.url();
|
|
138
|
+
|
|
139
|
+
const variantBasedProps = fill
|
|
140
|
+
? { fill: true }
|
|
141
|
+
: {
|
|
142
|
+
width: imageWidth,
|
|
143
|
+
height: imageHeight,
|
|
144
|
+
};
|
|
117
145
|
|
|
118
146
|
return (
|
|
119
147
|
<BaseImage
|
|
120
|
-
|
|
121
|
-
src={url}
|
|
148
|
+
src={imageUrl}
|
|
122
149
|
alt={title}
|
|
123
|
-
fill
|
|
124
150
|
unoptimized={unoptimized}
|
|
125
151
|
priority={priority}
|
|
126
152
|
sizes="100%"
|
|
@@ -129,6 +155,7 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
129
155
|
contrastBaseColor={contrastBaseColor}
|
|
130
156
|
overlayOpacity={overlayOpacity}
|
|
131
157
|
border={border}
|
|
158
|
+
{...variantBasedProps}
|
|
132
159
|
/>
|
|
133
160
|
);
|
|
134
161
|
};
|
|
@@ -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>
|
|
@@ -71,14 +71,13 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
71
71
|
imageBorder,
|
|
72
72
|
imagePriority,
|
|
73
73
|
imageUnoptimized,
|
|
74
|
+
imageFill,
|
|
74
75
|
// Presentation Parameters
|
|
75
76
|
contentAlignment,
|
|
76
77
|
backgroundColor,
|
|
77
78
|
spacing,
|
|
78
79
|
border,
|
|
79
80
|
fluidContent,
|
|
80
|
-
fullHeight,
|
|
81
|
-
fitHeight,
|
|
82
81
|
height,
|
|
83
82
|
isFlexibleHero = false,
|
|
84
83
|
component,
|
|
@@ -195,8 +194,6 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
195
194
|
spacing,
|
|
196
195
|
border,
|
|
197
196
|
fluidContent,
|
|
198
|
-
fullHeight,
|
|
199
|
-
fitHeight,
|
|
200
197
|
height,
|
|
201
198
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
202
199
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -215,6 +212,7 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
215
212
|
imageBorder,
|
|
216
213
|
imagePriority,
|
|
217
214
|
imageUnoptimized,
|
|
215
|
+
imageFill,
|
|
218
216
|
},
|
|
219
217
|
'image'
|
|
220
218
|
)}
|
|
@@ -1,69 +1,61 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FixedHeroProps } from '.';
|
|
3
3
|
import { DemoHero } from './demo-hero';
|
|
4
|
+
import { getImageParametersFocalPoint } from './utils';
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
-
paddingLeft: 'container-small',
|
|
62
|
-
paddingRight: 'container-small',
|
|
63
|
-
paddingBottom: 'container-xlarge',
|
|
64
|
-
}}
|
|
65
|
-
fluidContent={!props.component.variant}
|
|
66
|
-
isFlexibleHero={false}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
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
|
+
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
2
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
2
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
4
3
|
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
@@ -20,7 +19,7 @@ export type BaseButtonParameters = {
|
|
|
20
19
|
text?: string;
|
|
21
20
|
link?: LinkParamValue;
|
|
22
21
|
textColor?: string;
|
|
23
|
-
textWeight?:
|
|
22
|
+
textWeight?: string;
|
|
24
23
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
25
24
|
textTransform?: string;
|
|
26
25
|
buttonColor?: string;
|
|
@@ -45,6 +44,7 @@ export type BaseImageParameters = {
|
|
|
45
44
|
border?: string | ViewPort<string>;
|
|
46
45
|
priority?: boolean;
|
|
47
46
|
unoptimized?: boolean;
|
|
47
|
+
fill?: boolean;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
export type EyebrowTitleTextParameters = PrefixedKeys<TextParameters, 'eyebrowTitle'>;
|
|
@@ -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
|
|
|
@@ -29,3 +29,17 @@ 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,12 +12,11 @@ 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
|
-
|
|
19
|
+
height,
|
|
21
20
|
wrapperClassName,
|
|
22
21
|
}) => (
|
|
23
22
|
<BaseFlex
|
|
@@ -30,8 +29,7 @@ export const Flex: FC<FlexProps> = ({
|
|
|
30
29
|
spacing,
|
|
31
30
|
border,
|
|
32
31
|
fluidContent,
|
|
33
|
-
|
|
34
|
-
fitHeight,
|
|
32
|
+
height,
|
|
35
33
|
wrapperClassName,
|
|
36
34
|
className,
|
|
37
35
|
}}
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { imageFrom } from '@uniformdev/assets';
|
|
3
|
+
import { MediaPlaceholder } from '@/components/ui';
|
|
3
4
|
import BaseImage from '@/components/ui/Image';
|
|
4
5
|
import { resolveAsset } from '@/utils/assets';
|
|
5
6
|
import { ImageProps } from '.';
|
|
6
|
-
import { ImagePlaceholder } from './placeholder';
|
|
7
7
|
|
|
8
8
|
export const Image: FC<ImageProps> = async ({
|
|
9
9
|
image,
|
|
@@ -22,7 +22,18 @@ export const Image: FC<ImageProps> = async ({
|
|
|
22
22
|
const [resolvedImage] = resolveAsset(image);
|
|
23
23
|
|
|
24
24
|
if (!resolvedImage) {
|
|
25
|
-
|
|
25
|
+
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
26
|
+
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
27
|
+
|
|
28
|
+
if (!isEditorPreviewMode || isPlaceholder || !component.variant) {
|
|
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
|
+
);
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
const { focalPoint, title = '' } = resolvedImage;
|
|
@@ -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} />
|
|
@@ -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">
|