@opensite/ui 3.0.6 → 3.0.8

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.
@@ -0,0 +1,180 @@
1
+ import { Img } from '@page-speed/img';
2
+ import { clsx } from 'clsx';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ // components/ui/media-aspect-ratio.tsx
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ function AspectRatio({
12
+ ...props
13
+ }) {
14
+ return /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
15
+ }
16
+ var DEFAULT_DEVICE_ASPECT_RATIOS = {
17
+ desktop: "square",
18
+ mobile: "square"
19
+ };
20
+ var DEFAULT_MEDIA_CLASS_NAME = "size-full object-cover";
21
+ var DEFAULT_FRAME_CLASS_NAME = "overflow-hidden";
22
+ var DEFAULT_BREAKPOINT = "lg";
23
+ var BREAKPOINT_VISIBILITY_CLASSES = {
24
+ sm: {
25
+ desktop: "hidden sm:block",
26
+ mobile: "sm:hidden"
27
+ },
28
+ md: {
29
+ desktop: "hidden md:block",
30
+ mobile: "md:hidden"
31
+ },
32
+ lg: {
33
+ desktop: "hidden lg:block",
34
+ mobile: "lg:hidden"
35
+ },
36
+ xl: {
37
+ desktop: "hidden xl:block",
38
+ mobile: "xl:hidden"
39
+ },
40
+ "2xl": {
41
+ desktop: "hidden 2xl:block",
42
+ mobile: "2xl:hidden"
43
+ }
44
+ };
45
+ var MEDIA_ASPECT_RATIOS = {
46
+ square: 1,
47
+ horizontal: 16 / 9,
48
+ vertical: 355 / 520
49
+ };
50
+ function resolveAspectRatio(ratio, fallback) {
51
+ const resolvedRatio = ratio ?? fallback;
52
+ if (typeof resolvedRatio === "number" && Number.isFinite(resolvedRatio) && resolvedRatio > 0) {
53
+ return resolvedRatio;
54
+ }
55
+ return MEDIA_ASPECT_RATIOS[resolvedRatio];
56
+ }
57
+ function hasRenderableMedia(mediaItem) {
58
+ return Boolean(mediaItem?.image?.src || mediaItem?.video?.src);
59
+ }
60
+ function renderMediaElement({
61
+ mediaItem,
62
+ optixFlowConfig,
63
+ mediaClassName,
64
+ imageClassName,
65
+ videoClassName
66
+ }) {
67
+ if (!hasRenderableMedia(mediaItem)) {
68
+ return null;
69
+ }
70
+ if (mediaItem.video?.src) {
71
+ const { className: inlineVideoClassName, poster, ...videoProps } = mediaItem.video;
72
+ const posterFallback = poster ?? (typeof mediaItem.image?.src === "string" ? mediaItem.image.src : void 0);
73
+ return /* @__PURE__ */ jsx(
74
+ "video",
75
+ {
76
+ ...videoProps,
77
+ poster: posterFallback,
78
+ className: cn(
79
+ DEFAULT_MEDIA_CLASS_NAME,
80
+ mediaClassName,
81
+ videoClassName,
82
+ inlineVideoClassName
83
+ )
84
+ }
85
+ );
86
+ }
87
+ if (mediaItem.image?.src) {
88
+ const { className: inlineImageClassName, alt, src, ...imageProps } = mediaItem.image;
89
+ return /* @__PURE__ */ jsx(
90
+ Img,
91
+ {
92
+ ...imageProps,
93
+ src,
94
+ alt: alt ?? "",
95
+ className: cn(
96
+ DEFAULT_MEDIA_CLASS_NAME,
97
+ mediaClassName,
98
+ imageClassName,
99
+ inlineImageClassName
100
+ ),
101
+ optixFlowConfig
102
+ }
103
+ );
104
+ }
105
+ return null;
106
+ }
107
+ function MediaAspectRatio({
108
+ containerClassName,
109
+ mobileClassName,
110
+ desktopClassName,
111
+ frameClassName,
112
+ mobileFrameClassName,
113
+ desktopFrameClassName,
114
+ mediaClassName,
115
+ imageClassName,
116
+ videoClassName,
117
+ mediaItem,
118
+ optixFlowConfig,
119
+ deviceAspectRatios = DEFAULT_DEVICE_ASPECT_RATIOS,
120
+ breakpoint = DEFAULT_BREAKPOINT
121
+ }) {
122
+ if (!hasRenderableMedia(mediaItem)) {
123
+ return null;
124
+ }
125
+ const ratios = {
126
+ desktop: resolveAspectRatio(
127
+ deviceAspectRatios.desktop,
128
+ DEFAULT_DEVICE_ASPECT_RATIOS.desktop
129
+ ),
130
+ mobile: resolveAspectRatio(
131
+ deviceAspectRatios.mobile,
132
+ DEFAULT_DEVICE_ASPECT_RATIOS.mobile
133
+ )
134
+ };
135
+ const sharedFrameClassName = cn(
136
+ DEFAULT_FRAME_CLASS_NAME,
137
+ frameClassName,
138
+ mediaItem.containerClassName
139
+ );
140
+ const visibilityClasses = BREAKPOINT_VISIBILITY_CLASSES[breakpoint];
141
+ return /* @__PURE__ */ jsxs("div", { className: containerClassName, "data-slot": "media-aspect-ratio", children: [
142
+ /* @__PURE__ */ jsx("div", { className: cn("relative", visibilityClasses.mobile, mobileClassName), children: /* @__PURE__ */ jsx(
143
+ AspectRatio,
144
+ {
145
+ ratio: ratios.mobile,
146
+ className: cn(sharedFrameClassName, mobileFrameClassName),
147
+ children: renderMediaElement({
148
+ mediaItem,
149
+ optixFlowConfig,
150
+ mediaClassName,
151
+ imageClassName,
152
+ videoClassName
153
+ })
154
+ }
155
+ ) }),
156
+ /* @__PURE__ */ jsx(
157
+ "div",
158
+ {
159
+ className: cn(visibilityClasses.desktop, desktopClassName),
160
+ style: { aspectRatio: String(ratios.desktop) },
161
+ children: /* @__PURE__ */ jsx(
162
+ "div",
163
+ {
164
+ className: cn("size-full", sharedFrameClassName, desktopFrameClassName),
165
+ "data-slot": "media-aspect-ratio-frame",
166
+ children: renderMediaElement({
167
+ mediaItem,
168
+ optixFlowConfig,
169
+ mediaClassName,
170
+ imageClassName,
171
+ videoClassName
172
+ })
173
+ }
174
+ )
175
+ }
176
+ )
177
+ ] });
178
+ }
179
+
180
+ export { MEDIA_ASPECT_RATIOS, MediaAspectRatio };
package/dist/registry.cjs CHANGED
@@ -6,6 +6,7 @@ var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var img = require('@page-speed/img');
8
8
  var react = require('motion/react');
9
+ var AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
9
10
  var reactSlot = require('@radix-ui/react-slot');
10
11
  var classVarianceAuthority = require('class-variance-authority');
11
12
  var PopoverPrimitive = require('@radix-ui/react-popover');
@@ -24,7 +25,6 @@ var Autoplay = require('embla-carousel-autoplay');
24
25
  var ProgressPrimitive = require('@radix-ui/react-progress');
25
26
  var AvatarPrimitive = require('@radix-ui/react-avatar');
26
27
  var AutoScroll3 = require('embla-carousel-auto-scroll');
27
- var AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
28
28
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
29
29
  var LabelPrimitive = require('@radix-ui/react-label');
30
30
  var socialShare = require('@page-speed/social-share');
@@ -61,6 +61,7 @@ function _interopNamespace(e) {
61
61
  }
62
62
 
63
63
  var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
64
+ var AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespace(AspectRatioPrimitive);
64
65
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
65
66
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
66
67
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
@@ -70,7 +71,6 @@ var Autoplay__default = /*#__PURE__*/_interopDefault(Autoplay);
70
71
  var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
71
72
  var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
72
73
  var AutoScroll3__default = /*#__PURE__*/_interopDefault(AutoScroll3);
73
- var AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespace(AspectRatioPrimitive);
74
74
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
75
75
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
76
76
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
@@ -872,6 +872,174 @@ var ImageSlider = ({
872
872
  }
873
873
  );
874
874
  };
875
+ function AspectRatio({
876
+ ...props
877
+ }) {
878
+ return /* @__PURE__ */ jsxRuntime.jsx(AspectRatioPrimitive__namespace.Root, { "data-slot": "aspect-ratio", ...props });
879
+ }
880
+ var DEFAULT_DEVICE_ASPECT_RATIOS = {
881
+ desktop: "square",
882
+ mobile: "square"
883
+ };
884
+ var DEFAULT_MEDIA_CLASS_NAME = "size-full object-cover";
885
+ var DEFAULT_FRAME_CLASS_NAME = "overflow-hidden";
886
+ var DEFAULT_BREAKPOINT = "lg";
887
+ var BREAKPOINT_VISIBILITY_CLASSES = {
888
+ sm: {
889
+ desktop: "hidden sm:block",
890
+ mobile: "sm:hidden"
891
+ },
892
+ md: {
893
+ desktop: "hidden md:block",
894
+ mobile: "md:hidden"
895
+ },
896
+ lg: {
897
+ desktop: "hidden lg:block",
898
+ mobile: "lg:hidden"
899
+ },
900
+ xl: {
901
+ desktop: "hidden xl:block",
902
+ mobile: "xl:hidden"
903
+ },
904
+ "2xl": {
905
+ desktop: "hidden 2xl:block",
906
+ mobile: "2xl:hidden"
907
+ }
908
+ };
909
+ var MEDIA_ASPECT_RATIOS = {
910
+ square: 1,
911
+ horizontal: 16 / 9,
912
+ vertical: 355 / 520
913
+ };
914
+ function resolveAspectRatio(ratio, fallback) {
915
+ const resolvedRatio = ratio ?? fallback;
916
+ if (typeof resolvedRatio === "number" && Number.isFinite(resolvedRatio) && resolvedRatio > 0) {
917
+ return resolvedRatio;
918
+ }
919
+ return MEDIA_ASPECT_RATIOS[resolvedRatio];
920
+ }
921
+ function hasRenderableMedia(mediaItem) {
922
+ return Boolean(mediaItem?.image?.src || mediaItem?.video?.src);
923
+ }
924
+ function renderMediaElement({
925
+ mediaItem,
926
+ optixFlowConfig,
927
+ mediaClassName,
928
+ imageClassName,
929
+ videoClassName
930
+ }) {
931
+ if (!hasRenderableMedia(mediaItem)) {
932
+ return null;
933
+ }
934
+ if (mediaItem.video?.src) {
935
+ const { className: inlineVideoClassName, poster, ...videoProps } = mediaItem.video;
936
+ const posterFallback = poster ?? (typeof mediaItem.image?.src === "string" ? mediaItem.image.src : void 0);
937
+ return /* @__PURE__ */ jsxRuntime.jsx(
938
+ "video",
939
+ {
940
+ ...videoProps,
941
+ poster: posterFallback,
942
+ className: cn(
943
+ DEFAULT_MEDIA_CLASS_NAME,
944
+ mediaClassName,
945
+ videoClassName,
946
+ inlineVideoClassName
947
+ )
948
+ }
949
+ );
950
+ }
951
+ if (mediaItem.image?.src) {
952
+ const { className: inlineImageClassName, alt, src, ...imageProps } = mediaItem.image;
953
+ return /* @__PURE__ */ jsxRuntime.jsx(
954
+ img.Img,
955
+ {
956
+ ...imageProps,
957
+ src,
958
+ alt: alt ?? "",
959
+ className: cn(
960
+ DEFAULT_MEDIA_CLASS_NAME,
961
+ mediaClassName,
962
+ imageClassName,
963
+ inlineImageClassName
964
+ ),
965
+ optixFlowConfig
966
+ }
967
+ );
968
+ }
969
+ return null;
970
+ }
971
+ function MediaAspectRatio({
972
+ containerClassName,
973
+ mobileClassName,
974
+ desktopClassName,
975
+ frameClassName,
976
+ mobileFrameClassName,
977
+ desktopFrameClassName,
978
+ mediaClassName,
979
+ imageClassName,
980
+ videoClassName,
981
+ mediaItem,
982
+ optixFlowConfig,
983
+ deviceAspectRatios = DEFAULT_DEVICE_ASPECT_RATIOS,
984
+ breakpoint = DEFAULT_BREAKPOINT
985
+ }) {
986
+ if (!hasRenderableMedia(mediaItem)) {
987
+ return null;
988
+ }
989
+ const ratios = {
990
+ desktop: resolveAspectRatio(
991
+ deviceAspectRatios.desktop,
992
+ DEFAULT_DEVICE_ASPECT_RATIOS.desktop
993
+ ),
994
+ mobile: resolveAspectRatio(
995
+ deviceAspectRatios.mobile,
996
+ DEFAULT_DEVICE_ASPECT_RATIOS.mobile
997
+ )
998
+ };
999
+ const sharedFrameClassName = cn(
1000
+ DEFAULT_FRAME_CLASS_NAME,
1001
+ frameClassName,
1002
+ mediaItem.containerClassName
1003
+ );
1004
+ const visibilityClasses = BREAKPOINT_VISIBILITY_CLASSES[breakpoint];
1005
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClassName, "data-slot": "media-aspect-ratio", children: [
1006
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative", visibilityClasses.mobile, mobileClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
1007
+ AspectRatio,
1008
+ {
1009
+ ratio: ratios.mobile,
1010
+ className: cn(sharedFrameClassName, mobileFrameClassName),
1011
+ children: renderMediaElement({
1012
+ mediaItem,
1013
+ optixFlowConfig,
1014
+ mediaClassName,
1015
+ imageClassName,
1016
+ videoClassName
1017
+ })
1018
+ }
1019
+ ) }),
1020
+ /* @__PURE__ */ jsxRuntime.jsx(
1021
+ "div",
1022
+ {
1023
+ className: cn(visibilityClasses.desktop, desktopClassName),
1024
+ style: { aspectRatio: String(ratios.desktop) },
1025
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1026
+ "div",
1027
+ {
1028
+ className: cn("size-full", sharedFrameClassName, desktopFrameClassName),
1029
+ "data-slot": "media-aspect-ratio-frame",
1030
+ children: renderMediaElement({
1031
+ mediaItem,
1032
+ optixFlowConfig,
1033
+ mediaClassName,
1034
+ imageClassName,
1035
+ videoClassName
1036
+ })
1037
+ }
1038
+ )
1039
+ }
1040
+ )
1041
+ ] });
1042
+ }
875
1043
  function Card({ className, ...props }) {
876
1044
  return /* @__PURE__ */ jsxRuntime.jsx(
877
1045
  "div",
@@ -36620,11 +36788,6 @@ function BlogHorizontalCards({
36620
36788
  }
36621
36789
  );
36622
36790
  }
36623
- function AspectRatio({
36624
- ...props
36625
- }) {
36626
- return /* @__PURE__ */ jsxRuntime.jsx(AspectRatioPrimitive__namespace.Root, { "data-slot": "aspect-ratio", ...props });
36627
- }
36628
36791
  function Breadcrumb({ ...props }) {
36629
36792
  return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
36630
36793
  }
@@ -53011,7 +53174,7 @@ function HeroPremiumSplitAvatars({
53011
53174
  image,
53012
53175
  imageSlot,
53013
53176
  className,
53014
- spacing = "pt-28 pb-8 md:pt-32 md:pb-32",
53177
+ spacing = "hero",
53015
53178
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
53016
53179
  background,
53017
53180
  pattern,
@@ -53020,8 +53183,15 @@ function HeroPremiumSplitAvatars({
53020
53183
  headingClassName,
53021
53184
  descriptionClassName,
53022
53185
  imageClassName,
53023
- optixFlowConfig
53186
+ optixFlowConfig,
53187
+ mediaAspectRatios = { desktop: "vertical", mobile: "vertical" },
53188
+ directionConfig = { desktop: "mediaRight", mobile: "mediaBottom" }
53024
53189
  }) {
53190
+ const responsiveClassName = React30.useMemo(() => {
53191
+ const desktopOrder = directionConfig.desktop === "mediaRight" ? "md:flex-row" : "md:flex-row-reverse";
53192
+ const mobileOrder = directionConfig.mobile === "mediaTop" ? "flex-col-reverse" : "flex-col";
53193
+ return `${mobileOrder} ${desktopOrder}`;
53194
+ }, [directionConfig.desktop, directionConfig.mobile]);
53025
53195
  const renderBrand = React30.useMemo(() => {
53026
53196
  if (brandSlot) return brandSlot;
53027
53197
  return /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-4xl ", children: [
@@ -53069,19 +53239,31 @@ function HeroPremiumSplitAvatars({
53069
53239
  if (imageSlot) return imageSlot;
53070
53240
  if (!image) return null;
53071
53241
  return /* @__PURE__ */ jsxRuntime.jsx(
53072
- img.Img,
53073
- {
53074
- src: image.src,
53075
- alt: image.alt,
53076
- className: cn(
53077
- "h-full w-full md:w-1/2 object-cover block rounded-xl shadow-xl",
53078
- imageClassName,
53079
- image.className
53080
- ),
53081
- optixFlowConfig
53242
+ MediaAspectRatio,
53243
+ {
53244
+ breakpoint: "md",
53245
+ containerClassName: "relative flex w-full justify-center md:w-1/2",
53246
+ mobileClassName: "w-full",
53247
+ desktopClassName: "w-full max-h-[70dvh]",
53248
+ frameClassName: "rounded-xl shadow-xl",
53249
+ imageClassName: cn("block", imageClassName),
53250
+ mediaItem: {
53251
+ image: {
53252
+ ...image,
53253
+ loading: "eager"
53254
+ }
53255
+ },
53256
+ optixFlowConfig,
53257
+ deviceAspectRatios: mediaAspectRatios
53082
53258
  }
53083
53259
  );
53084
- }, [imageSlot, image, imageClassName, optixFlowConfig]);
53260
+ }, [
53261
+ imageSlot,
53262
+ image,
53263
+ imageClassName,
53264
+ optixFlowConfig,
53265
+ mediaAspectRatios
53266
+ ]);
53085
53267
  return /* @__PURE__ */ jsxRuntime.jsx(
53086
53268
  Section,
53087
53269
  {
@@ -53092,27 +53274,36 @@ function HeroPremiumSplitAvatars({
53092
53274
  patternOpacity,
53093
53275
  className: cn("relative flex items-center justify-center", className),
53094
53276
  containerClassName,
53095
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex w-full flex-col md:flex-row gap-8 md:gap-20", children: [
53096
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center lg:w-1/2", children: /* @__PURE__ */ jsxRuntime.jsxs(
53097
- "div",
53098
- {
53099
- className: cn(
53100
- "my-10 flex w-full flex-col gap-6 md:gap-24",
53101
- contentClassName
53102
- ),
53103
- children: [
53104
- renderBrand,
53105
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 md:gap-8", children: [
53106
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-4xl lg:text-6xl", headingClassName), children: heading }) : /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-4xl lg:text-6xl", headingClassName), children: heading })),
53107
- description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-2.5 lg:text-xl", descriptionClassName), children: description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description })),
53108
- renderAction
53109
- ] }),
53110
- renderAvatars
53111
- ]
53112
- }
53113
- ) }),
53114
- renderImage
53115
- ] })
53277
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
53278
+ "div",
53279
+ {
53280
+ className: cn(
53281
+ "relative flex w-full gap-8 md:gap-20",
53282
+ responsiveClassName
53283
+ ),
53284
+ children: [
53285
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center lg:w-1/2", children: /* @__PURE__ */ jsxRuntime.jsxs(
53286
+ "div",
53287
+ {
53288
+ className: cn(
53289
+ "my-10 flex w-full flex-col gap-6 md:gap-24",
53290
+ contentClassName
53291
+ ),
53292
+ children: [
53293
+ renderBrand,
53294
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 md:gap-8", children: [
53295
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-4xl lg:text-6xl", headingClassName), children: heading }) : /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("text-4xl lg:text-6xl", headingClassName), children: heading })),
53296
+ description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-2.5 lg:text-xl", descriptionClassName), children: description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description })),
53297
+ renderAction
53298
+ ] }),
53299
+ renderAvatars
53300
+ ]
53301
+ }
53302
+ ) }),
53303
+ renderImage
53304
+ ]
53305
+ }
53306
+ )
53116
53307
  }
53117
53308
  );
53118
53309
  }
@@ -53952,11 +54143,6 @@ function HeroAiPoweredCarousel({
53952
54143
  }
53953
54144
  );
53954
54145
  }
53955
- var ASPECT_RATIOS = {
53956
- square: 1,
53957
- horizontal: 16 / 9,
53958
- vertical: 355 / 520
53959
- };
53960
54146
  function HeroAdCampaignExpert({
53961
54147
  sectionId = "hero-ad-campaign-expert",
53962
54148
  heading,
@@ -54035,36 +54221,6 @@ function HeroAdCampaignExpert({
54035
54221
  descriptionClassName,
54036
54222
  renderActions
54037
54223
  ]);
54038
- const hasMedia = mediaItem?.image || mediaItem?.video;
54039
- const renderMedia = React30.useMemo(() => {
54040
- if (!mediaItem) return null;
54041
- const { image, video } = mediaItem;
54042
- if (video) {
54043
- const { src, className: videoClassName, ...videoRest } = video;
54044
- return /* @__PURE__ */ jsxRuntime.jsx(
54045
- "video",
54046
- {
54047
- src,
54048
- className: cn("size-full object-cover", videoClassName),
54049
- ...videoRest
54050
- }
54051
- );
54052
- }
54053
- if (image) {
54054
- const { src, alt, className: imgClassName, ...imgRest } = image;
54055
- return /* @__PURE__ */ jsxRuntime.jsx(
54056
- img.Img,
54057
- {
54058
- src,
54059
- alt,
54060
- className: cn("size-full object-cover", imgClassName),
54061
- optixFlowConfig,
54062
- ...imgRest
54063
- }
54064
- );
54065
- }
54066
- return null;
54067
- }, [mediaItem, optixFlowConfig]);
54068
54224
  return /* @__PURE__ */ jsxRuntime.jsx(
54069
54225
  Section,
54070
54226
  {
@@ -54093,38 +54249,18 @@ function HeroAdCampaignExpert({
54093
54249
  )
54094
54250
  }
54095
54251
  ),
54096
- hasMedia && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative flex w-full justify-center lg:w-1/2"), children: [
54097
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-auto w-[80%] max-w-[355px] lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
54098
- AspectRatio,
54099
- {
54100
- ratio: ASPECT_RATIOS[mediaAspectRatios.mobile],
54101
- className: cn(
54102
- "rounded-xl shadow-2xl overflow-hidden",
54103
- mediaItem?.containerClassName
54104
- ),
54105
- children: renderMedia
54106
- }
54107
- ) }),
54108
- /* @__PURE__ */ jsxRuntime.jsx(
54109
- "div",
54110
- {
54111
- className: "hidden lg:block max-h-[70dvh] w-auto",
54112
- style: {
54113
- aspectRatio: ASPECT_RATIOS[mediaAspectRatios.desktop]
54114
- },
54115
- children: /* @__PURE__ */ jsxRuntime.jsx(
54116
- "div",
54117
- {
54118
- className: cn(
54119
- "size-full rounded-xl shadow-2xl overflow-hidden",
54120
- mediaItem?.containerClassName
54121
- ),
54122
- children: renderMedia
54123
- }
54124
- )
54125
- }
54126
- )
54127
- ] })
54252
+ /* @__PURE__ */ jsxRuntime.jsx(
54253
+ MediaAspectRatio,
54254
+ {
54255
+ containerClassName: "relative flex w-full justify-center lg:w-1/2",
54256
+ desktopClassName: "max-h-[70dvh] w-auto",
54257
+ mobileClassName: "h-auto w-[80%] max-w-[355px]",
54258
+ frameClassName: "rounded-xl shadow-2xl",
54259
+ mediaItem,
54260
+ optixFlowConfig,
54261
+ deviceAspectRatios: mediaAspectRatios
54262
+ }
54263
+ )
54128
54264
  ]
54129
54265
  }
54130
54266
  ) })