@uniformdev/csk-components 6.0.88 → 6.0.99-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.
Files changed (76) hide show
  1. package/dist/accordion-item-G5CNMERW.mjs +1 -0
  2. package/dist/{banner-4QNCOJXP.mjs → banner-2B4K5R4N.mjs} +1 -1
  3. package/dist/carousel-BBEW5P4Y.mjs +1 -0
  4. package/dist/{carousel-PCTBGT7M.mjs → carousel-ERCHOWUS.mjs} +1 -1
  5. package/dist/chunk-2YTACEBA.mjs +1 -0
  6. package/dist/{chunk-C42FGNCU.mjs → chunk-4LWAGTFW.mjs} +1 -1
  7. package/dist/chunk-5VM2Y55L.mjs +1 -0
  8. package/dist/chunk-BK7UG4U4.mjs +1 -0
  9. package/dist/{chunk-DBXG5BKX.mjs → chunk-FPOIJMYT.mjs} +1 -1
  10. package/dist/{chunk-H4YYFWGR.mjs → chunk-LA36HQWS.mjs} +1 -1
  11. package/dist/chunk-LX5AG5F7.mjs +1 -0
  12. package/dist/chunk-M3BGP5VE.mjs +1 -0
  13. package/dist/chunk-YUCUJWBO.mjs +1 -0
  14. package/dist/chunk-Z7JSWSPD.mjs +1 -0
  15. package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
  16. package/dist/components/canvas/index.d.mts +10 -1
  17. package/dist/components/canvas/index.mjs +2 -2
  18. package/dist/components/ui/index.d.mts +4 -4
  19. package/dist/components/ui/index.mjs +1 -1
  20. package/dist/content/components/canvas/Accordion/accordion.tsx +2 -1
  21. package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +1 -1
  22. package/dist/content/components/canvas/Breadcrumbs/breadcrumbs.tsx +18 -0
  23. package/dist/content/components/canvas/Card/card.tsx +2 -1
  24. package/dist/content/components/canvas/Carousel/carousel.tsx +2 -1
  25. package/dist/content/components/canvas/Container/container.tsx +13 -1
  26. package/dist/content/components/canvas/Container/parameters.ts +5 -0
  27. package/dist/content/components/canvas/DemoHero/columns-variant.tsx +12 -8
  28. package/dist/content/components/canvas/DemoHero/default-variant.tsx +10 -8
  29. package/dist/content/components/canvas/DemoHero/demo-hero.tsx +2 -0
  30. package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +65 -55
  31. package/dist/content/components/canvas/DemoHero/index.tsx +4 -0
  32. package/dist/content/components/canvas/DemoHero/style-utils.ts +2 -2
  33. package/dist/content/components/canvas/Grid/grid.tsx +2 -1
  34. package/dist/content/components/canvas/Image/image.tsx +32 -5
  35. package/dist/content/components/canvas/Image/index.tsx +1 -0
  36. package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +2 -1
  37. package/dist/content/components/canvas/Review/default-variant.tsx +2 -1
  38. package/dist/content/components/canvas/Review/multi-column-variant.tsx +2 -1
  39. package/dist/content/components/canvas/Section/columns-variant.tsx +5 -1
  40. package/dist/content/components/canvas/Section/default-variant.tsx +5 -1
  41. package/dist/content/components/canvas/Section/section.tsx +2 -0
  42. package/dist/content/components/canvas/Table/table.tsx +2 -1
  43. package/dist/content/components/canvas/Tabs/tabs.tsx +2 -1
  44. package/dist/content/components/canvas/Testimonial/default-variant.tsx +3 -2
  45. package/dist/content/components/canvas/Testimonial/testimonial.tsx +2 -0
  46. package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +3 -2
  47. package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +3 -2
  48. package/dist/content/components/ui/Container/container.tsx +6 -3
  49. package/dist/content/components/ui/Container/index.ts +5 -0
  50. package/dist/content/components/ui/Container/utils.ts +18 -0
  51. package/dist/content/components/ui/Flex/flex.tsx +26 -19
  52. package/dist/content/components/ui/Flex/index.ts +1 -0
  53. package/dist/content/components/ui/Grid/grid.tsx +24 -19
  54. package/dist/content/components/ui/Grid/index.ts +9 -1
  55. package/dist/content/components/ui/Image/image.tsx +1 -1
  56. package/dist/content/utils/assets.ts +4 -0
  57. package/dist/image-gallery-F6JLG7XW.mjs +1 -0
  58. package/dist/{index-Bo0jbwJv.d.mts → index-B9eeSbLG.d.mts} +3 -0
  59. package/dist/{mobile-MRAEZAWR.mjs → mobile-UAUHHXPH.mjs} +1 -1
  60. package/dist/{navigation-flyout-3SK6VRHA.mjs → navigation-flyout-MXIJA6PC.mjs} +1 -1
  61. package/dist/{navigation-group-7WBDV5IY.mjs → navigation-group-DEN3D2BO.mjs} +1 -1
  62. package/dist/tabs-AQFKYC6M.mjs +1 -0
  63. package/dist/utils/assets.d.mts +4 -0
  64. package/dist/utils/assets.mjs +1 -1
  65. package/package.json +1 -1
  66. package/dist/accordion-item-ULLV2BRJ.mjs +0 -1
  67. package/dist/carousel-W3SCTR5K.mjs +0 -1
  68. package/dist/chunk-2R23IIXO.mjs +0 -1
  69. package/dist/chunk-CEMXG4S3.mjs +0 -1
  70. package/dist/chunk-F435GHK2.mjs +0 -1
  71. package/dist/chunk-JNIJ5N3Y.mjs +0 -1
  72. package/dist/chunk-PIBMG73F.mjs +0 -1
  73. package/dist/chunk-SDTLQ3CZ.mjs +0 -1
  74. package/dist/chunk-XWVE2EED.mjs +0 -1
  75. package/dist/image-gallery-IYJI5V7T.mjs +0 -1
  76. package/dist/tabs-75KAGSVH.mjs +0 -1
@@ -1,15 +1,18 @@
1
1
  import { FC } from 'react';
2
2
  import Container from '@/components/ui/Container';
3
3
  import { cn } from '@/utils/styling';
4
- import { DemoHeroVariants, DemoHeroParameters } from '.';
4
+ import { DemoHeroVariants, FlexibleHeroParameters } from '.';
5
5
 
6
6
  type ColumnsVariantProps = {
7
- backgroundColor: DemoHeroParameters['backgroundColor'];
8
- spacing: DemoHeroParameters['spacing'];
9
- border: DemoHeroParameters['border'];
10
- fluidContent: DemoHeroParameters['fluidContent'];
11
- fullHeight: DemoHeroParameters['fullHeight'];
12
- fitHeight: DemoHeroParameters['fitHeight'];
7
+ backgroundColor: FlexibleHeroParameters['backgroundColor'];
8
+ spacing: FlexibleHeroParameters['spacing'];
9
+ border: FlexibleHeroParameters['border'];
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
+ height: FlexibleHeroParameters['height'];
13
16
  variant?: DemoHeroVariants;
14
17
  demoHeroMedia: React.ReactNode;
15
18
  demoHeroContent: React.ReactNode;
@@ -25,6 +28,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
25
28
  fluidContent,
26
29
  fullHeight,
27
30
  fitHeight,
31
+ height,
28
32
  variant,
29
33
  demoHeroMedia,
30
34
  demoHeroContent,
@@ -32,7 +36,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
32
36
  textAlignmentClass,
33
37
  buttonAlignmentClass,
34
38
  }) => (
35
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
39
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
36
40
  <div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
37
41
  <div className={cn('aspect-square', { 'order-last': variant === DemoHeroVariants.ColumnsReverse })}>
38
42
  <div className="flex size-full items-center justify-center overflow-hidden">{demoHeroMedia}</div>
@@ -1,15 +1,16 @@
1
1
  import { FC } from 'react';
2
2
  import Container from '@/components/ui/Container';
3
3
  import { cn } from '@/utils/styling';
4
- import { DemoHeroParameters } from '.';
4
+ import { FlexibleHeroParameters } from '.';
5
5
 
6
6
  type DefaultVariantProps = {
7
- backgroundColor: DemoHeroParameters['backgroundColor'];
8
- spacing: DemoHeroParameters['spacing'];
9
- border: DemoHeroParameters['border'];
10
- fluidContent: DemoHeroParameters['fluidContent'];
11
- fullHeight: DemoHeroParameters['fullHeight'];
12
- fitHeight: DemoHeroParameters['fitHeight'];
7
+ backgroundColor: FlexibleHeroParameters['backgroundColor'];
8
+ spacing: FlexibleHeroParameters['spacing'];
9
+ border: FlexibleHeroParameters['border'];
10
+ fluidContent: FlexibleHeroParameters['fluidContent'];
11
+ fullHeight: FlexibleHeroParameters['fullHeight'];
12
+ fitHeight: FlexibleHeroParameters['fitHeight'];
13
+ height: FlexibleHeroParameters['height'];
13
14
  demoHeroMedia: React.ReactNode;
14
15
  demoHeroContent: React.ReactNode;
15
16
  demoHeroCTA: React.ReactNode;
@@ -24,6 +25,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
24
25
  fluidContent,
25
26
  fullHeight,
26
27
  fitHeight,
28
+ height,
27
29
  demoHeroMedia,
28
30
  demoHeroContent,
29
31
  demoHeroCTA,
@@ -32,7 +34,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
32
34
  }) => (
33
35
  <Container
34
36
  className="relative overflow-hidden"
35
- {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}
37
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
36
38
  >
37
39
  <div className="absolute left-0 top-0 size-full overflow-hidden">{demoHeroMedia}</div>
38
40
  <Container className="relative flex flex-col gap-8">
@@ -79,6 +79,7 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
79
79
  fluidContent,
80
80
  fullHeight,
81
81
  fitHeight,
82
+ height,
82
83
  isFlexibleHero = false,
83
84
  component,
84
85
  context,
@@ -196,6 +197,7 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
196
197
  fluidContent,
197
198
  fullHeight,
198
199
  fitHeight,
200
+ height,
199
201
  textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
200
202
  buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
201
203
  demoHeroMedia: (
@@ -2,58 +2,68 @@ import { FC } from 'react';
2
2
  import { FixedHeroProps } from '.';
3
3
  import { DemoHero } from './demo-hero';
4
4
 
5
- export const FixedHero: FC<FixedHeroProps> = ({ textColor, enableOverlayAutoTint = false, ...props }) => (
6
- <DemoHero
7
- {...props}
8
- // Eyebrow Text Parameters
9
- eyebrowTitleTag="span"
10
- eyebrowTitleSize={{
11
- mobile: 'xs',
12
- tablet: 'lg',
13
- desktop: 'xl',
14
- }}
15
- eyebrowTitleWeight="bold"
16
- eyebrowTitleTransform="uppercase"
17
- eyebrowTitleColor={textColor || props.eyebrowTitleColor}
18
- // Title Text Parameters
19
- titleSize={{
20
- mobile: '3xl',
21
- tablet: '5xl',
22
- desktop: '5xl',
23
- }}
24
- titleWeight="bold"
25
- titleColor={textColor || props.titleColor}
26
- // Description Text Parameters
27
- descriptionTag="p"
28
- descriptionSize={{
29
- mobile: 'sm',
30
- tablet: 'lg',
31
- desktop: 'xl',
32
- }}
33
- descriptionWeight="normal"
34
- descriptionColor={textColor || props.descriptionColor}
35
- // Primary Button Parameters
36
- primaryButtonSize="button-medium"
37
- primaryButtonTextSize="sm"
38
- primaryButtonTextColor="text-light"
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 && enableOverlayAutoTint ? textColor : undefined}
48
- imageOverlayOpacity="0.3"
49
- // Presentation Parameters
50
- spacing={{
51
- paddingTop: 'container-xlarge',
52
- paddingLeft: 'container-small',
53
- paddingRight: 'container-small',
54
- paddingBottom: 'container-xlarge',
55
- }}
56
- fluidContent={!props.component.variant}
57
- isFlexibleHero={false}
58
- />
59
- );
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: '5xl',
31
+ desktop: '5xl',
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
+ };
@@ -74,7 +74,11 @@ export type DemoHeroParameters = ContainerParameters & {
74
74
 
75
75
  export type FixedHeroParameters = {
76
76
  textColor?: string;
77
+ /**
78
+ * @deprecated Use overlayAutoTint instead.
79
+ */
77
80
  enableOverlayAutoTint?: boolean;
81
+ overlayAutoTint?: string;
78
82
  } & DemoHeroParameters;
79
83
 
80
84
  export type FlexibleHeroParameters = DemoHeroParameters;
@@ -1,8 +1,8 @@
1
1
  import { cn } from '@/utils/styling';
2
- import { ContentAlignment, DemoHeroParameters } from '.';
2
+ import { ContentAlignment, FlexibleHeroParameters } from '.';
3
3
 
4
4
  type AlignmentClass = {
5
- contentAlignment: DemoHeroParameters['contentAlignment'];
5
+ contentAlignment: FlexibleHeroParameters['contentAlignment'];
6
6
  };
7
7
 
8
8
  export const getButtonAlignmentClass = ({ contentAlignment }: AlignmentClass) =>
@@ -13,6 +13,7 @@ export const Grid: FC<GridProps> = ({
13
13
  fluidContent,
14
14
  fullHeight,
15
15
  fitHeight,
16
+ height,
16
17
  slots,
17
18
  component,
18
19
  context,
@@ -20,7 +21,7 @@ export const Grid: FC<GridProps> = ({
20
21
  }) => (
21
22
  <BaseGrid
22
23
  className={className}
23
- {...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}
24
+ {...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
24
25
  >
25
26
  <UniformSlot data={component} context={context} slot={slots.gridInner} />
26
27
  </BaseGrid>
@@ -1,10 +1,11 @@
1
1
  import { FC } from 'react';
2
+ import { imageFrom } from '@uniformdev/assets';
2
3
  import BaseImage from '@/components/ui/Image';
3
4
  import { resolveAsset } from '@/utils/assets';
4
5
  import { ImageProps } from '.';
5
6
  import { ImagePlaceholder } from './placeholder';
6
7
 
7
- export const Image: FC<ImageProps> = ({
8
+ export const Image: FC<ImageProps> = async ({
8
9
  image,
9
10
  objectFit,
10
11
  width,
@@ -13,6 +14,7 @@ export const Image: FC<ImageProps> = ({
13
14
  overlayOpacity,
14
15
  border,
15
16
  priority,
17
+ fill,
16
18
  unoptimized,
17
19
  context,
18
20
  component,
@@ -23,14 +25,38 @@ export const Image: FC<ImageProps> = ({
23
25
  return <ImagePlaceholder context={context} component={component} width={width} height={height} />;
24
26
  }
25
27
 
26
- const { url, title = '' } = resolvedImage;
28
+ const { focalPoint, title = '' } = resolvedImage;
29
+
30
+ const imageWidth = width || resolvedImage.width;
31
+ const imageHeight = height || resolvedImage.height;
32
+
33
+ if (!fill && (!imageWidth || !imageHeight)) {
34
+ console.warn(
35
+ 'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
36
+ );
37
+ return <img src={resolvedImage.url} alt={title} />;
38
+ }
39
+
40
+ const imageUrl = imageFrom(resolvedImage?.url)
41
+ .transform({
42
+ width: width,
43
+ height: height,
44
+ fit: objectFit,
45
+ focal: focalPoint,
46
+ })
47
+ .url();
48
+
49
+ const variantBasedProps = fill
50
+ ? { fill: true }
51
+ : {
52
+ width: imageWidth,
53
+ height: imageHeight,
54
+ };
27
55
 
28
56
  return (
29
57
  <BaseImage
30
- containerStyle={{ ...(width ? { width: `${width}px` } : {}), ...(height ? { height: `${height}px` } : {}) }}
31
- src={url}
58
+ src={imageUrl}
32
59
  alt={title}
33
- fill
34
60
  unoptimized={unoptimized}
35
61
  priority={priority}
36
62
  sizes="100%"
@@ -38,6 +64,7 @@ export const Image: FC<ImageProps> = ({
38
64
  overlayColor={overlayColor}
39
65
  overlayOpacity={overlayOpacity}
40
66
  border={border}
67
+ {...variantBasedProps}
41
68
  />
42
69
  );
43
70
  };
@@ -12,6 +12,7 @@ export type ImageParameters = {
12
12
  border?: string | ViewPort<string>;
13
13
  priority?: boolean;
14
14
  unoptimized?: boolean;
15
+ fill?: boolean;
15
16
  };
16
17
 
17
18
  export type ImageProps = ComponentProps<ImageParameters>;
@@ -18,6 +18,7 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
18
18
  fluidContent,
19
19
  fullHeight,
20
20
  fitHeight,
21
+ height,
21
22
  config,
22
23
  context,
23
24
  component,
@@ -44,7 +45,7 @@ export const ImageGallery: FC<ImageGalleryProps> = ({
44
45
  ?.length;
45
46
 
46
47
  return (
47
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
48
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
48
49
  <div className="flex flex-col gap-1">
49
50
  {showEmptySlot ? (
50
51
  <UniformSlot context={context} slot={slots.imageGalleryItems} data={component} />
@@ -20,11 +20,12 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
20
20
  fluidContent,
21
21
  fullHeight,
22
22
  fitHeight,
23
+ height,
23
24
  ReviewImage,
24
25
  ReviewPersonInfo,
25
26
  ReviewContent,
26
27
  }) => (
27
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
28
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
28
29
  <div className="mx-auto flex lg:max-w-[60%]">
29
30
  <div className="aspect-square size-12 shrink-0 rounded-full">{ReviewImage}</div>
30
31
  <div className="ml-6">
@@ -20,11 +20,12 @@ export const MultiColumnVariant: FC<MultiColumnVariantProps> = ({
20
20
  fluidContent,
21
21
  fullHeight,
22
22
  fitHeight,
23
+ height,
23
24
  ReviewImage,
24
25
  ReviewPersonInfo,
25
26
  ReviewContent,
26
27
  }) => (
27
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
28
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
28
29
  <div className="grid md:grid-cols-12">
29
30
  <div className="mb-2 md:col-span-4 md:my-0">
30
31
  <div className="mb-2 aspect-square size-12 rounded-full">{ReviewImage}</div>
@@ -8,8 +8,11 @@ type ColumnsVariantProps = {
8
8
  spacing: SectionParameters['spacing'];
9
9
  border: SectionParameters['border'];
10
10
  fluidContent: SectionParameters['fluidContent'];
11
+ /** @deprecated Use height prop instead */
11
12
  fullHeight: SectionParameters['fullHeight'];
13
+ /** @deprecated Use height prop instead */
12
14
  fitHeight: SectionParameters['fitHeight'];
15
+ height: SectionParameters['height'];
13
16
  variant: SectionVariants;
14
17
  sectionMedia: React.ReactNode;
15
18
  sectionContent: React.ReactNode;
@@ -25,6 +28,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
25
28
  fluidContent,
26
29
  fullHeight,
27
30
  fitHeight,
31
+ height,
28
32
  variant,
29
33
  sectionMedia,
30
34
  sectionContent,
@@ -32,7 +36,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
32
36
  textAlignmentClass,
33
37
  buttonAlignmentClass,
34
38
  }) => (
35
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
39
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
36
40
  <div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
37
41
  <div className={cn('aspect-square', { 'order-last': variant === SectionVariants.ColumnsReverse })}>
38
42
  <div className="flex size-full items-center justify-center overflow-hidden">{sectionMedia}</div>
@@ -8,8 +8,11 @@ type DefaultVariantProps = {
8
8
  spacing?: SectionParameters['spacing'];
9
9
  border?: SectionParameters['border'];
10
10
  fluidContent?: SectionParameters['fluidContent'];
11
+ /** @deprecated Use height prop instead */
11
12
  fullHeight?: SectionParameters['fullHeight'];
13
+ /** @deprecated Use height prop instead */
12
14
  fitHeight?: SectionParameters['fitHeight'];
15
+ height?: SectionParameters['height'];
13
16
  sectionMedia: React.ReactNode;
14
17
  sectionContent: React.ReactNode;
15
18
  sectionCTA: React.ReactNode;
@@ -24,6 +27,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
24
27
  fluidContent,
25
28
  fullHeight,
26
29
  fitHeight,
30
+ height,
27
31
  sectionMedia,
28
32
  sectionContent,
29
33
  sectionCTA,
@@ -32,7 +36,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
32
36
  }) => (
33
37
  <Container
34
38
  className="relative overflow-hidden"
35
- {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}
39
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
36
40
  >
37
41
  <div className="absolute left-0 top-0 size-full overflow-hidden">{sectionMedia}</div>
38
42
  <Container className="relative flex flex-col gap-8">
@@ -16,6 +16,7 @@ export const Section: FC<SectionProps> = ({
16
16
  fluidContent,
17
17
  fullHeight,
18
18
  fitHeight,
19
+ height,
19
20
  }) => {
20
21
  const variant = component.variant as SectionVariants;
21
22
 
@@ -27,6 +28,7 @@ export const Section: FC<SectionProps> = ({
27
28
  fluidContent,
28
29
  fullHeight,
29
30
  fitHeight,
31
+ height,
30
32
  textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
31
33
  buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
32
34
  sectionMedia: <UniformSlot data={component} context={context} slot={slots.sectionMedia} />,
@@ -16,10 +16,11 @@ export const Table: FC<TableProps> = ({
16
16
  fluidContent,
17
17
  fullHeight,
18
18
  fitHeight,
19
+ height,
19
20
  }) => (
20
21
  <Container
21
22
  className="flex flex-col gap-5"
22
- {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}
23
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
23
24
  >
24
25
  <div className="overflow-x-auto">
25
26
  <table className={getTableClasses({ size, textColor })}>
@@ -18,6 +18,7 @@ export const Tabs: FC<TabsProps> = ({
18
18
  fluidContent,
19
19
  fullHeight,
20
20
  fitHeight,
21
+ height,
21
22
  }) => {
22
23
  const variant = (component.variant || TabsVariants.Default) as TabsVariants;
23
24
  const [activeTabId, setActiveTabId] = useState(component?.slots?.tabItems?.[0]?._id as string);
@@ -47,7 +48,7 @@ export const Tabs: FC<TabsProps> = ({
47
48
  return (
48
49
  <Container
49
50
  className="flex flex-col gap-5"
50
- {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}
51
+ {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
51
52
  >
52
53
  <div className={getButtonContainerClasses({ color, variant })}>
53
54
  {tabItems.map((tabItem, index) => (
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
4
4
 
5
5
  type WithLargeAvatarVariantProps = Pick<
6
6
  TestimonialProps,
7
- 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight'
7
+ 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
8
8
  > & {
9
9
  testimonialPrimaryImage: React.ReactNode;
10
10
  testimonialContent: React.ReactNode;
@@ -23,8 +23,9 @@ export const DefaultVariant: FC<WithLargeAvatarVariantProps> = ({
23
23
  fluidContent,
24
24
  fullHeight,
25
25
  fitHeight,
26
+ height,
26
27
  }) => (
27
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
28
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
28
29
  <div className="mx-auto flex flex-col items-center md:max-w-[80%]">
29
30
  <div>{testimonialSecondaryImage}</div>
30
31
  <div className="my-8">{testimonialContent}</div>
@@ -15,6 +15,7 @@ export const Testimonial: FC<TestimonialProps> = ({
15
15
  fluidContent,
16
16
  fullHeight,
17
17
  fitHeight,
18
+ height,
18
19
  }) => {
19
20
  const variant = component.variant as TestimonialVariants | undefined;
20
21
 
@@ -25,6 +26,7 @@ export const Testimonial: FC<TestimonialProps> = ({
25
26
  fluidContent,
26
27
  fullHeight,
27
28
  fitHeight,
29
+ height,
28
30
  testimonialPrimaryImage: <UniformSlot context={context} data={component} slot={slots.testimonialPrimaryImage} />,
29
31
  testimonialContent: <UniformSlot context={context} data={component} slot={slots.testimonialContent} />,
30
32
  testimonialAuthor: <UniformSlot context={context} data={component} slot={slots.testimonialAuthor} />,
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
4
4
 
5
5
  type WithLargeAvatarVariantProps = Pick<
6
6
  TestimonialProps,
7
- 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight'
7
+ 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
8
8
  > & {
9
9
  testimonialPrimaryImage: React.ReactNode;
10
10
  testimonialContent: React.ReactNode;
@@ -23,8 +23,9 @@ export const WithLargeAvatarVariant: FC<WithLargeAvatarVariantProps> = ({
23
23
  fluidContent,
24
24
  fullHeight,
25
25
  fitHeight,
26
+ height,
26
27
  }) => (
27
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
28
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
28
29
  <div className="mx-auto flex items-center gap-x-10 md:max-w-[80%]">
29
30
  <div className="hidden aspect-square w-full max-w-xs shrink-0 overflow-hidden rounded-xl lg:block">
30
31
  {testimonialPrimaryImage}
@@ -4,7 +4,7 @@ import { TestimonialProps } from '.';
4
4
 
5
5
  type WithLargeAvatarVariantProps = Pick<
6
6
  TestimonialProps,
7
- 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight'
7
+ 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height'
8
8
  > & {
9
9
  testimonialPrimaryImage: React.ReactNode;
10
10
  testimonialContent: React.ReactNode;
@@ -23,8 +23,9 @@ export const WithOverlappingImageVariant: FC<WithLargeAvatarVariantProps> = ({
23
23
  fluidContent,
24
24
  fullHeight,
25
25
  fitHeight,
26
+ height,
26
27
  }) => (
27
- <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight }}>
28
+ <Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
28
29
  <Container className="pb-10 lg:pb-0">
29
30
  <div className="mx-auto flex max-w-2xl flex-col items-center gap-10 lg:max-w-none lg:flex-row">
30
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,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,
@@ -13,6 +14,7 @@ export const Container: FC<ContainerProps> = ({
13
14
  fluidContent = false,
14
15
  fullHeight = false,
15
16
  fitHeight = false,
17
+ height,
16
18
  maxWidth,
17
19
  ...rest
18
20
  }) => {
@@ -21,6 +23,8 @@ export const Container: FC<ContainerProps> = ({
21
23
  { marginTop, marginBottom, marginRight, marginLeft, paddingTop, paddingBottom, paddingRight, paddingLeft },
22
24
  ] = formatSpaceParameterValue(spacing);
23
25
 
26
+ const heightValue = getHeightValue({ height, fullHeight, fitHeight });
27
+
24
28
  return (
25
29
  <div
26
30
  className={cn(
@@ -30,7 +34,7 @@ export const Container: FC<ContainerProps> = ({
30
34
  'mx-auto w-full': !fluidContent,
31
35
  'max-w-7xl max-w-container-width': !maxWidth && !fluidContent,
32
36
  [`max-w-${maxWidth}`]: !!maxWidth && !fluidContent,
33
- 'h-full': fitHeight,
37
+ [resolveViewPort(heightValue, 'h-{value}')]: heightValue,
34
38
  },
35
39
  wrapperClassName
36
40
  )}
@@ -38,8 +42,6 @@ export const Container: FC<ContainerProps> = ({
38
42
  <div
39
43
  className={cn(
40
44
  {
41
- '!h-screen': fullHeight,
42
- 'h-full': fitHeight,
43
45
  [`bg-${backgroundColor}`]: !!backgroundColor,
44
46
  [resolveViewPort(marginTop, 'mt-{value}')]: marginTop,
45
47
  [resolveViewPort(marginBottom, 'mb-{value}')]: marginBottom,
@@ -50,6 +52,7 @@ export const Container: FC<ContainerProps> = ({
50
52
  [resolveViewPort(paddingRight, 'pr-{value}')]: paddingRight,
51
53
  [resolveViewPort(paddingLeft, 'pl-{value}')]: paddingLeft,
52
54
  [resolveViewPort(border, '{value}')]: border,
55
+ [resolveViewPort(heightValue, 'h-{value}')]: heightValue,
53
56
  },
54
57
  className
55
58
  )}
@@ -6,10 +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 */
9
10
  fullHeight?: boolean;
11
+ /** @deprecated Use height prop instead */
10
12
  fitHeight?: boolean;
13
+ height?: string | ViewPort<string>;
11
14
  wrapperClassName?: string;
12
15
  maxWidth?: string;
13
16
  };
14
17
 
18
+ export { getHeightValue } from './utils';
19
+
15
20
  export { Container as default } from './container';