@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.
Files changed (114) hide show
  1. package/dist/accordion-item-G5CNMERW.mjs +1 -0
  2. package/dist/{banner-EYII7V7X.mjs → banner-2B4K5R4N.mjs} +1 -1
  3. package/dist/carousel-BBEW5P4Y.mjs +1 -0
  4. package/dist/carousel-ERCHOWUS.mjs +1 -0
  5. package/dist/chunk-2SEOCBRK.mjs +1 -0
  6. package/dist/{chunk-TFA6HYP4.mjs → chunk-3PDY7RJC.mjs} +2 -2
  7. package/dist/chunk-4LWAGTFW.mjs +1 -0
  8. package/dist/chunk-5VM2Y55L.mjs +1 -0
  9. package/dist/chunk-AKRWCDDG.mjs +1 -0
  10. package/dist/{chunk-VW2XC3SE.mjs → chunk-FPOIJMYT.mjs} +1 -1
  11. package/dist/{chunk-B2O55EVA.mjs → chunk-LA36HQWS.mjs} +1 -1
  12. package/dist/chunk-M3BGP5VE.mjs +1 -0
  13. package/dist/chunk-QHIWJPL6.mjs +1 -0
  14. package/dist/chunk-TIRCISSU.mjs +1 -0
  15. package/dist/chunk-TM7Q5NMH.mjs +1 -0
  16. package/dist/chunk-YUCUJWBO.mjs +1 -0
  17. package/dist/chunk-Z7JSWSPD.mjs +1 -0
  18. package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
  19. package/dist/components/canvas/index.d.mts +21 -5
  20. package/dist/components/canvas/index.mjs +2 -1
  21. package/dist/components/ui/index.d.mts +25 -61
  22. package/dist/components/ui/index.mjs +1 -1
  23. package/dist/content/components/canvas/Accordion/accordion.tsx +12 -6
  24. package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +36 -23
  25. package/dist/content/components/canvas/Button/index.tsx +2 -1
  26. package/dist/content/components/canvas/Card/card.tsx +3 -1
  27. package/dist/content/components/canvas/Carousel/carousel.tsx +3 -1
  28. package/dist/content/components/canvas/Container/container.tsx +4 -0
  29. package/dist/content/components/canvas/Container/parameters.ts +4 -0
  30. package/dist/content/components/canvas/DemoHero/atoms.tsx +4 -31
  31. package/dist/content/components/canvas/DemoHero/columns-variant.tsx +7 -1
  32. package/dist/content/components/canvas/DemoHero/default-variant.tsx +8 -1
  33. package/dist/content/components/canvas/DemoHero/demo-hero.tsx +4 -2
  34. package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +65 -56
  35. package/dist/content/components/canvas/DemoHero/index.tsx +14 -3
  36. package/dist/content/components/canvas/DemoHero/utils.ts +0 -14
  37. package/dist/content/components/canvas/Flex/flex.tsx +4 -2
  38. package/dist/content/components/canvas/Grid/grid.tsx +3 -1
  39. package/dist/content/components/canvas/Image/image.tsx +2 -13
  40. package/dist/content/components/canvas/Image/placeholder.tsx +20 -0
  41. package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +3 -1
  42. package/dist/content/components/canvas/Modal/modal.tsx +69 -12
  43. package/dist/content/components/{ui → canvas}/Modal/style-utils.ts +4 -4
  44. package/dist/content/components/canvas/Review/default-variant.tsx +3 -1
  45. package/dist/content/components/canvas/Review/multi-column-variant.tsx +3 -1
  46. package/dist/content/components/canvas/Section/columns-variant.tsx +7 -1
  47. package/dist/content/components/canvas/Section/default-variant.tsx +10 -1
  48. package/dist/content/components/canvas/Section/section.tsx +4 -0
  49. package/dist/content/components/canvas/Table/table.tsx +6 -1
  50. package/dist/content/components/canvas/Tabs/tabs.tsx +6 -1
  51. package/dist/content/components/canvas/Testimonial/default-variant.tsx +4 -2
  52. package/dist/content/components/canvas/Testimonial/testimonial.tsx +4 -0
  53. package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +4 -2
  54. package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +4 -2
  55. package/dist/content/components/canvas/Video/index.tsx +2 -0
  56. package/dist/content/components/canvas/Video/video.tsx +2 -1
  57. package/dist/content/components/ui/Button/index.ts +5 -2
  58. package/dist/content/components/ui/Carousel/carousel.tsx +2 -2
  59. package/dist/content/components/ui/Carousel/index.ts +1 -1
  60. package/dist/content/components/ui/Container/container.tsx +7 -2
  61. package/dist/content/components/ui/Container/index.ts +6 -0
  62. package/dist/content/components/ui/Container/utils.ts +18 -0
  63. package/dist/content/components/ui/Flex/flex.tsx +27 -19
  64. package/dist/content/components/ui/Flex/index.ts +5 -1
  65. package/dist/content/components/ui/Footer/index.ts +1 -1
  66. package/dist/content/components/ui/Grid/grid.tsx +25 -19
  67. package/dist/content/components/ui/Grid/index.ts +16 -4
  68. package/dist/content/components/ui/GridItem/index.ts +10 -4
  69. package/dist/content/components/ui/Header/index.ts +1 -1
  70. package/dist/content/components/ui/Text/index.ts +6 -3
  71. package/dist/image-gallery-F6JLG7XW.mjs +1 -0
  72. package/dist/{index-D5cLtaIv.d.mts → index-B9eeSbLG.d.mts} +14 -7
  73. package/dist/index.mjs +1 -1
  74. package/dist/{mobile-JGZBHQC2.mjs → mobile-UAUHHXPH.mjs} +1 -1
  75. package/dist/modal-HKMQGV4B.mjs +1 -0
  76. package/dist/navigation-flyout-MXIJA6PC.mjs +1 -0
  77. package/dist/navigation-group-DEN3D2BO.mjs +1 -0
  78. package/dist/tabs-AQFKYC6M.mjs +1 -0
  79. package/package.json +10 -14
  80. package/dist/accordion-item-QAVKQEB2.mjs +0 -1
  81. package/dist/accordion-item-Y4PSNOH4.mjs +0 -1
  82. package/dist/carousel-RZ2DV6QX.mjs +0 -1
  83. package/dist/carousel-YELQRJVB.mjs +0 -1
  84. package/dist/chunk-2BMAPB63.mjs +0 -1
  85. package/dist/chunk-7GVG4HLE.mjs +0 -1
  86. package/dist/chunk-ABORGLS6.mjs +0 -2
  87. package/dist/chunk-EOV2LPGC.mjs +0 -1
  88. package/dist/chunk-EUVKAE6M.mjs +0 -1
  89. package/dist/chunk-FIN5US3Q.mjs +0 -1
  90. package/dist/chunk-LZOK42EM.mjs +0 -1
  91. package/dist/chunk-PMMAALCQ.mjs +0 -1
  92. package/dist/chunk-RYEXR67P.mjs +0 -1
  93. package/dist/chunk-TCQTXNKT.mjs +0 -1
  94. package/dist/chunk-WAW7PQYM.mjs +0 -1
  95. package/dist/content/components/ui/Accordion/accordion.tsx +0 -23
  96. package/dist/content/components/ui/Accordion/index.tsx +0 -9
  97. package/dist/content/components/ui/AccordionItem/accordion-item.tsx +0 -41
  98. package/dist/content/components/ui/AccordionItem/index.tsx +0 -16
  99. package/dist/content/components/ui/InlineSVG/index.ts +0 -13
  100. package/dist/content/components/ui/InlineSVG/inline-svg.tsx +0 -59
  101. package/dist/content/components/ui/InlineSVG/utils.ts +0 -77
  102. package/dist/content/components/ui/Modal/index.tsx +0 -22
  103. package/dist/content/components/ui/Modal/modal.tsx +0 -89
  104. package/dist/image-gallery-AMU6FS7N.mjs +0 -1
  105. package/dist/modal-43IHAVWB.mjs +0 -1
  106. package/dist/modal-5FNTFSTN.mjs +0 -1
  107. package/dist/navigation-flyout-EPIOXRWJ.mjs +0 -1
  108. package/dist/navigation-group-OCZ35QI2.mjs +0 -1
  109. package/dist/tabs-J23TEEQ7.mjs +0 -1
  110. package/dist/utils/sitemap.d.mts +0 -21
  111. package/dist/utils/sitemap.mjs +0 -1
  112. /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-down.tsx +0 -0
  113. /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-up.tsx +0 -0
  114. /package/dist/content/components/{ui → canvas}/Modal/close-icon.tsx +0 -0
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
3
- import BaseAccordion from '@/components/ui/Accordion';
3
+ import Container from '@/components/ui/Container';
4
4
  import { AccordionProps } from '.';
5
5
 
6
6
  export const Accordion: FC<AccordionProps> = ({
@@ -11,11 +11,17 @@ export const Accordion: FC<AccordionProps> = ({
11
11
  spacing,
12
12
  border,
13
13
  fluidContent,
14
+ fullHeight,
15
+ fitHeight,
14
16
  height,
15
17
  }) => (
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
- />
18
+ <Container
19
+ className="flex flex-col gap-8"
20
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
21
+ >
22
+ <div className="flex flex-col gap-4 text-start">
23
+ <UniformSlot data={component} context={context} slot={slots.accordionContent} />
24
+ </div>
25
+ <UniformSlot data={component} context={context} slot={slots.accordionItems} />
26
+ </Container>
21
27
  );
@@ -1,10 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { FC } from 'react';
3
+ import { FC, useCallback, useState } from 'react';
4
4
  import { UniformSlot, UniformText } from '@uniformdev/canvas-next-rsc/component';
5
- import BaseAccordionItem from '@/components/ui/AccordionItem';
5
+ import Container from '@/components/ui/Container';
6
6
  import BaseText from '@/components/ui/Text';
7
+ import { cn } from '@/utils/styling';
7
8
  import { AccordionItemProps } from '.';
9
+ import { IconArrowDown } from './icon-arrow-down';
10
+ import { IconArrowUp } from './icon-arrow-up';
8
11
 
9
12
  export const AccordionItem: FC<AccordionItemProps> = ({
10
13
  tag,
@@ -22,24 +25,34 @@ export const AccordionItem: FC<AccordionItemProps> = ({
22
25
  backgroundColor,
23
26
  spacing,
24
27
  className,
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
- );
28
+ }) => {
29
+ const [isOpened, setOpened] = useState(false);
30
+ const toggleOpenAccordion = useCallback(() => setOpened(isOpened => !isOpened), []);
31
+
32
+ return (
33
+ <Container {...{ fluidContent: true }}>
34
+ <Container {...{ backgroundColor, spacing, fluidContent: true, className }}>
35
+ <button onClick={toggleOpenAccordion} className="flex w-full flex-row items-center justify-between text-start">
36
+ <BaseText {...{ alignment, color, size, font, weight, transform, decoration, letterSpacing }}>
37
+ <UniformText
38
+ placeholder="Text goes here"
39
+ parameterId="text"
40
+ as={tag || undefined}
41
+ component={component}
42
+ context={context}
43
+ />
44
+ </BaseText>
45
+ <div
46
+ className={cn({
47
+ [`text-${backgroundColor} invert`]: !!backgroundColor,
48
+ 'text-black dark:text-white': !backgroundColor,
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
+ };
@@ -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';
@@ -9,7 +10,7 @@ export type ButtonParameters = {
9
10
  text?: string;
10
11
  link?: LinkParamValue;
11
12
  textColor?: string;
12
- textWeight?: string;
13
+ textWeight?: keyof DefaultTheme['fontWeight'];
13
14
  textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
14
15
  textTransform?: string;
15
16
  buttonColor?: string;
@@ -12,6 +12,8 @@ export const Card: FC<CardProps> = ({
12
12
  spacing,
13
13
  border,
14
14
  fluidContent,
15
+ fullHeight,
16
+ fitHeight,
15
17
  height,
16
18
  className,
17
19
  contentClassName,
@@ -21,7 +23,7 @@ export const Card: FC<CardProps> = ({
21
23
  return (
22
24
  <Container
23
25
  className={cn('relative overflow-hidden', className)}
24
- {...{ backgroundColor, spacing, border, fluidContent, height }}
26
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
25
27
  >
26
28
  <div
27
29
  className={cn({
@@ -13,12 +13,14 @@ export const Carousel: FC<CarouselProps> = ({
13
13
  spacing,
14
14
  border,
15
15
  fluidContent,
16
+ fullHeight,
17
+ fitHeight,
16
18
  height,
17
19
  itemsPerPage,
18
20
  gapX,
19
21
  }) => (
20
22
  <BaseCarousel
21
- {...{ backgroundColor, spacing, border, fluidContent, height, itemsPerPage, gapX }}
23
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height, itemsPerPage, gapX }}
22
24
  countOfItems={slots.carouselItems?.items.length ?? 0}
23
25
  variant={component.variant}
24
26
  >
@@ -13,6 +13,8 @@ export const Container: FC<ContainerProps> = ({
13
13
  spacing,
14
14
  border,
15
15
  fluidContent,
16
+ fullHeight,
17
+ fitHeight,
16
18
  height,
17
19
  className,
18
20
  }) => (
@@ -24,6 +26,8 @@ export const Container: FC<ContainerProps> = ({
24
26
  spacing,
25
27
  border,
26
28
  fluidContent,
29
+ fullHeight,
30
+ fitHeight,
27
31
  height,
28
32
  className,
29
33
  }}
@@ -9,5 +9,9 @@ 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;
12
16
  height?: HeightType | ViewPort<HeightType>;
13
17
  };
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { imageFrom } from '@uniformdev/assets';
3
2
  import { ComponentInstance } from '@uniformdev/canvas';
4
3
  import { CompositionContext, UniformText } from '@uniformdev/canvas-next-rsc/component';
5
4
  import { TextParameters } from '@/components/canvas/Text/parameters';
@@ -96,7 +95,6 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
96
95
  border,
97
96
  priority,
98
97
  unoptimized,
99
- fill,
100
98
  }) => {
101
99
  const [resolvedImage] = resolveAsset(image);
102
100
 
@@ -115,38 +113,14 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
115
113
  );
116
114
  }
117
115
 
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
- };
116
+ const { url, title = '' } = resolvedImage;
145
117
 
146
118
  return (
147
119
  <BaseImage
148
- src={imageUrl}
120
+ containerStyle={{ ...(width ? { width: `${width}px` } : {}), ...(height ? { height: `${height}px` } : {}) }}
121
+ src={url}
149
122
  alt={title}
123
+ fill
150
124
  unoptimized={unoptimized}
151
125
  priority={priority}
152
126
  sizes="100%"
@@ -155,7 +129,6 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
155
129
  contrastBaseColor={contrastBaseColor}
156
130
  overlayOpacity={overlayOpacity}
157
131
  border={border}
158
- {...variantBasedProps}
159
132
  />
160
133
  );
161
134
  };
@@ -8,6 +8,10 @@ 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'];
11
15
  height: FlexibleHeroParameters['height'];
12
16
  variant?: DemoHeroVariants;
13
17
  demoHeroMedia: 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
  demoHeroMedia,
@@ -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 === DemoHeroVariants.ColumnsReverse })}>
36
42
  <div className="flex size-full items-center justify-center overflow-hidden">{demoHeroMedia}</div>
@@ -8,6 +8,8 @@ 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'];
11
13
  height: FlexibleHeroParameters['height'];
12
14
  demoHeroMedia: React.ReactNode;
13
15
  demoHeroContent: React.ReactNode;
@@ -21,6 +23,8 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
21
23
  spacing,
22
24
  border,
23
25
  fluidContent,
26
+ fullHeight,
27
+ fitHeight,
24
28
  height,
25
29
  demoHeroMedia,
26
30
  demoHeroContent,
@@ -28,7 +32,10 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
28
32
  textAlignmentClass,
29
33
  buttonAlignmentClass,
30
34
  }) => (
31
- <Container className="relative overflow-hidden" {...{ backgroundColor, spacing, border, fluidContent, height }}>
35
+ <Container
36
+ className="relative overflow-hidden"
37
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
38
+ >
32
39
  <div className="absolute left-0 top-0 size-full overflow-hidden">{demoHeroMedia}</div>
33
40
  <Container className="relative flex flex-col gap-8">
34
41
  <div className={cn('flex flex-col gap-4', textAlignmentClass)}>{demoHeroContent}</div>
@@ -71,13 +71,14 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
71
71
  imageBorder,
72
72
  imagePriority,
73
73
  imageUnoptimized,
74
- imageFill,
75
74
  // Presentation Parameters
76
75
  contentAlignment,
77
76
  backgroundColor,
78
77
  spacing,
79
78
  border,
80
79
  fluidContent,
80
+ fullHeight,
81
+ fitHeight,
81
82
  height,
82
83
  isFlexibleHero = false,
83
84
  component,
@@ -194,6 +195,8 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
194
195
  spacing,
195
196
  border,
196
197
  fluidContent,
198
+ fullHeight,
199
+ fitHeight,
197
200
  height,
198
201
  textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
199
202
  buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
@@ -212,7 +215,6 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
212
215
  imageBorder,
213
216
  imagePriority,
214
217
  imageUnoptimized,
215
- imageFill,
216
218
  },
217
219
  'image'
218
220
  )}
@@ -1,60 +1,69 @@
1
1
  import { FC } from 'react';
2
2
  import { FixedHeroProps } from '.';
3
3
  import { DemoHero } from './demo-hero';
4
- import { getImageParametersFocalPoint } from './utils';
5
4
 
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
- primaryButtonTextWeight="normal"
40
- primaryButtonButtonColor="button-primary"
41
- primaryButtonTextTransform="uppercase"
42
- primaryButtonHoverButtonColor="button-primary-hover"
43
- // Image Parameters
44
- imagePriority
45
- imageObjectFit="cover"
46
- imageUnoptimized
47
- imageContrastBaseColor={!props.component.variant && overlayAutoTint ? textColor : undefined}
48
- imageOverlayOpacity={overlayAutoTint}
49
- {...getImageParametersFocalPoint(!!props.component.variant)}
50
- // Presentation Parameters
51
- spacing={{
52
- paddingTop: 'container-xlarge',
53
- paddingLeft: 'container-small',
54
- paddingRight: 'container-small',
55
- paddingBottom: 'container-xlarge',
56
- }}
57
- fluidContent={!props.component.variant}
58
- isFlexibleHero={false}
59
- />
60
- );
5
+ const getImageOverlayOpacity = (overlayAutoTint?: string, enableOverlayAutoTint?: boolean) => {
6
+ if (overlayAutoTint) return overlayAutoTint;
7
+ // Cover deprecated case
8
+ if (enableOverlayAutoTint) return '0.3';
9
+ return undefined;
10
+ };
11
+
12
+ export const FixedHero: FC<FixedHeroProps> = ({ textColor, overlayAutoTint, enableOverlayAutoTint, ...props }) => {
13
+ const imageOverlayOpacity = getImageOverlayOpacity(overlayAutoTint, enableOverlayAutoTint);
14
+ return (
15
+ <DemoHero
16
+ {...props}
17
+ // Eyebrow Text Parameters
18
+ eyebrowTitleTag="span"
19
+ eyebrowTitleSize={{
20
+ mobile: 'xs',
21
+ tablet: 'lg',
22
+ desktop: 'xl',
23
+ }}
24
+ eyebrowTitleWeight="bold"
25
+ eyebrowTitleTransform="uppercase"
26
+ eyebrowTitleColor={textColor || props.eyebrowTitleColor}
27
+ // Title Text Parameters
28
+ titleSize={{
29
+ mobile: '3xl',
30
+ tablet: '4xl',
31
+ desktop: '4xl',
32
+ }}
33
+ titleWeight="bold"
34
+ titleColor={textColor || props.titleColor}
35
+ // Description Text Parameters
36
+ descriptionTag="p"
37
+ descriptionSize={{
38
+ mobile: 'sm',
39
+ tablet: 'lg',
40
+ desktop: 'xl',
41
+ }}
42
+ descriptionWeight="normal"
43
+ descriptionColor={textColor || props.descriptionColor}
44
+ // Primary Button Parameters
45
+ primaryButtonSize="button-medium"
46
+ primaryButtonTextSize="sm"
47
+ primaryButtonTextColor="text-light"
48
+ primaryButtonTextWeight="normal"
49
+ primaryButtonButtonColor="button-primary"
50
+ primaryButtonTextTransform="uppercase"
51
+ primaryButtonHoverButtonColor="button-primary-hover"
52
+ // Image Parameters
53
+ imagePriority
54
+ imageObjectFit="cover"
55
+ imageUnoptimized
56
+ imageContrastBaseColor={!props.component.variant && imageOverlayOpacity ? textColor : undefined}
57
+ imageOverlayOpacity={imageOverlayOpacity}
58
+ // Presentation Parameters
59
+ spacing={{
60
+ paddingTop: 'container-xlarge',
61
+ paddingLeft: 'container-small',
62
+ paddingRight: 'container-small',
63
+ paddingBottom: 'container-xlarge',
64
+ }}
65
+ fluidContent={!props.component.variant}
66
+ isFlexibleHero={false}
67
+ />
68
+ );
69
+ };
@@ -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?: string;
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
- type DemoHeroParameters = ContainerParameters & {
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
- height,
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
- height,
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
- const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
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} />