@opensite/ui 2.3.9 → 2.4.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/registry.js CHANGED
@@ -7887,7 +7887,7 @@ function AboutStreamlineTeam({
7887
7887
  }
7888
7888
  )
7889
7889
  ] }),
7890
- /* @__PURE__ */ jsxs("div", { className: "pl-0 md:pl-8", children: [
7890
+ /* @__PURE__ */ jsxs("div", { className: "pl-0 md:pl-8 lg:pl-16", children: [
7891
7891
  title && (typeof title === "string" ? /* @__PURE__ */ jsx(
7892
7892
  "h1",
7893
7893
  {
@@ -7938,7 +7938,8 @@ function AboutStreamlineTeam({
7938
7938
  {
7939
7939
  actions,
7940
7940
  actionsSlot,
7941
- actionsClassName
7941
+ actionsClassName,
7942
+ verticalSpacing: "mt-4 md:mt-0"
7942
7943
  }
7943
7944
  )
7944
7945
  ]
@@ -8780,7 +8781,7 @@ function AboutMissionDualImage({
8780
8781
  if (!primaryHeading || !secondaryContent) {
8781
8782
  return null;
8782
8783
  }
8783
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-4 md:gap-6", children: [
8784
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-2 md:gap-4", children: [
8784
8785
  primaryHeading && (typeof primaryHeading === "string" ? /* @__PURE__ */ jsx(
8785
8786
  "h2",
8786
8787
  {
@@ -8791,7 +8792,7 @@ function AboutMissionDualImage({
8791
8792
  children: primaryHeading
8792
8793
  }
8793
8794
  ) : primaryHeading),
8794
- secondaryContent && (typeof secondaryContent === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-4 text-lg", secondaryClassname), children: secondaryContent }) : secondaryContent)
8795
+ secondaryContent && (typeof secondaryContent === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-base md:text-lg", secondaryClassname), children: secondaryContent }) : secondaryContent)
8795
8796
  ] });
8796
8797
  },
8797
8798
  []
@@ -26151,6 +26152,11 @@ function FeatureBentoImageGrid({
26151
26152
  }
26152
26153
  );
26153
26154
  }
26155
+ var ASPECT_RATIO_CLASSES = {
26156
+ square: "aspect-square",
26157
+ horizontal: "aspect-video",
26158
+ vertical: "aspect-[3/4]"
26159
+ };
26154
26160
  function FeatureImageCardsThreeColumn({
26155
26161
  title,
26156
26162
  description,
@@ -26168,7 +26174,8 @@ function FeatureImageCardsThreeColumn({
26168
26174
  background,
26169
26175
  pattern,
26170
26176
  patternOpacity,
26171
- patternClassName
26177
+ patternClassName,
26178
+ cardAspectRatios = { desktop: "vertical", mobile: "square" }
26172
26179
  }) {
26173
26180
  const renderImage = useCallback(
26174
26181
  (card, imageAlt) => {
@@ -26179,7 +26186,7 @@ function FeatureImageCardsThreeColumn({
26179
26186
  {
26180
26187
  src: card.imageSrc,
26181
26188
  alt: imageAlt,
26182
- className: "h-full max-h-[450px] min-h-80 w-full rounded-xl object-cover object-center",
26189
+ className: "absolute inset-0 h-full w-full rounded-xl object-cover object-center",
26183
26190
  loading: "lazy",
26184
26191
  optixFlowConfig
26185
26192
  }
@@ -26198,77 +26205,149 @@ function FeatureImageCardsThreeColumn({
26198
26205
  },
26199
26206
  []
26200
26207
  );
26208
+ const renderCardBadge = useCallback(
26209
+ (card) => {
26210
+ return card.badgeText || card.avatarSrc || card.icon || card.iconName ? /* @__PURE__ */ jsxs(
26211
+ Badge,
26212
+ {
26213
+ variant: "default",
26214
+ className: cn("py-1 px-3 gap-2", card.badgeClassName),
26215
+ children: [
26216
+ renderBadgeIcon(card),
26217
+ card.badgeText
26218
+ ]
26219
+ }
26220
+ ) : null;
26221
+ },
26222
+ [renderBadgeIcon]
26223
+ );
26224
+ const cardHasTextContent = useCallback(
26225
+ (card) => {
26226
+ const hasBadge = !!(card.badgeText || card.avatarSrc || card.icon || card.iconName);
26227
+ return hasBadge || !!card.title || !!card.subtitle || !!card.linkText;
26228
+ },
26229
+ []
26230
+ );
26231
+ const renderCardText = useCallback(
26232
+ (card) => {
26233
+ if (!cardHasTextContent(card)) {
26234
+ return null;
26235
+ }
26236
+ const cardBadge = renderCardBadge(card);
26237
+ return /* @__PURE__ */ jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-4 md:p-6", children: [
26238
+ cardBadge || /* @__PURE__ */ jsx("div", {}),
26239
+ card.title || card.subtitle || card.linkText ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-4 md:gap-6 text-white", children: [
26240
+ card.title || card.subtitle ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-2 md:gap-4", children: [
26241
+ card.title && (typeof card.title === "string" ? /* @__PURE__ */ jsx(
26242
+ "h3",
26243
+ {
26244
+ className: cn(
26245
+ "text-lg md:text-xl font-semibold",
26246
+ card.titleClassName
26247
+ ),
26248
+ children: card.title
26249
+ }
26250
+ ) : card.title),
26251
+ card.subtitle && (typeof card.subtitle === "string" ? /* @__PURE__ */ jsx(
26252
+ "p",
26253
+ {
26254
+ className: cn(
26255
+ "text-base font-normal",
26256
+ card.subtitleClassName
26257
+ ),
26258
+ children: card.subtitle
26259
+ }
26260
+ ) : card.subtitle)
26261
+ ] }) : null,
26262
+ card.linkText && /* @__PURE__ */ jsxs(
26263
+ "div",
26264
+ {
26265
+ className: cn(
26266
+ "font-bold text-xs uppercase flex items-center gap-2",
26267
+ card.linkClassName
26268
+ ),
26269
+ children: [
26270
+ card.linkText,
26271
+ /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-up-right", size: 18 })
26272
+ ]
26273
+ }
26274
+ )
26275
+ ] }) : null
26276
+ ] });
26277
+ },
26278
+ [cardHasTextContent, renderCardBadge]
26279
+ );
26201
26280
  const cardsContent = useMemo(() => {
26202
26281
  if (cardsSlot) return cardsSlot;
26203
26282
  if (!cards || cards.length === 0) return null;
26204
26283
  return cards.map((card, index) => {
26205
26284
  const imageAlt = card.imageAlt || (typeof card.title === "string" ? card.title : "Card image");
26285
+ const mobileAspectClass = ASPECT_RATIO_CLASSES[cardAspectRatios.mobile];
26286
+ const desktopAspectClass = `md:${ASPECT_RATIO_CLASSES[cardAspectRatios.desktop]}`;
26206
26287
  return /* @__PURE__ */ jsxs(
26207
26288
  Pressable,
26208
26289
  {
26209
26290
  href: card.link,
26210
26291
  onClick: card.onClick,
26211
26292
  className: cn(
26212
- "group relative overflow-hidden rounded-xl",
26293
+ "group relative overflow-hidden rounded-2xl shadow-xl",
26294
+ mobileAspectClass,
26295
+ desktopAspectClass,
26213
26296
  cardClassName,
26214
26297
  card.className
26215
26298
  ),
26216
26299
  children: [
26217
26300
  renderImage(card, imageAlt),
26218
- /* @__PURE__ */ jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-10 md:translate-y-20 rounded-xl bg-linear-to-t from-black to-transparent transition-transform duration-300 group-hover:translate-y-0" }),
26219
- /* @__PURE__ */ jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-4 md:p-6", children: [
26220
- (card.badgeText || card.avatarSrc || card.icon || card.iconName) && /* @__PURE__ */ jsxs(
26221
- Badge,
26222
- {
26223
- variant: "default",
26224
- className: cn("py-1 px-4", card.badgeClassName),
26225
- children: [
26226
- renderBadgeIcon(card),
26227
- card.badgeText
26228
- ]
26229
- }
26230
- ),
26231
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 md:gap-4", children: [
26232
- card.title && (typeof card.title === "string" ? /* @__PURE__ */ jsx(
26233
- "h3",
26234
- {
26235
- className: cn(
26236
- "text-lg md:text-xl font-semibold",
26237
- card.titleClassName
26238
- ),
26239
- children: card.title
26240
- }
26241
- ) : /* @__PURE__ */ jsx(
26242
- "div",
26243
- {
26244
- className: cn(
26245
- "text-lg md:text-xl font-semibold",
26246
- card.titleClassName
26247
- ),
26248
- children: card.title
26249
- }
26250
- )),
26251
- card.linkText && card.link && /* @__PURE__ */ jsxs(
26252
- "div",
26253
- {
26254
- className: cn(
26255
- "font-bold text-xs uppercase flex items-center gap-2",
26256
- card.linkClassName
26257
- ),
26258
- children: [
26259
- card.linkText,
26260
- /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-up-right", size: 18 })
26261
- ]
26262
- }
26263
- )
26264
- ] })
26265
- ] })
26301
+ cardHasTextContent(card) && /* @__PURE__ */ jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-10 md:translate-y-20 rounded-xl bg-linear-to-t from-black to-transparent transition-transform duration-300 group-hover:translate-y-0" }),
26302
+ renderCardText(card)
26266
26303
  ]
26267
26304
  },
26268
26305
  index
26269
26306
  );
26270
26307
  });
26271
- }, [cardsSlot, cards, cardClassName, renderImage, renderBadgeIcon]);
26308
+ }, [
26309
+ cardsSlot,
26310
+ cards,
26311
+ cardClassName,
26312
+ cardAspectRatios,
26313
+ renderImage,
26314
+ cardHasTextContent,
26315
+ renderCardText
26316
+ ]);
26317
+ const contentItems = useMemo(() => {
26318
+ const items = [];
26319
+ if (title) {
26320
+ if (typeof title === "string") {
26321
+ items.push({
26322
+ _type: "text",
26323
+ as: "h2",
26324
+ className: cn(
26325
+ "text-3xl font-semibold text-balance md:text-4xl lg:text-5xl max-w-full md:max-w-md",
26326
+ title
26327
+ ),
26328
+ children: title
26329
+ });
26330
+ } else {
26331
+ items.push(title);
26332
+ }
26333
+ }
26334
+ if (description) {
26335
+ if (typeof description === "string") {
26336
+ items.push({
26337
+ _type: "text",
26338
+ as: "p",
26339
+ className: cn(
26340
+ "text-xl max-w-full md:max-w-md text-balance",
26341
+ descriptionClassName
26342
+ ),
26343
+ children: description
26344
+ });
26345
+ } else {
26346
+ items.push(description);
26347
+ }
26348
+ }
26349
+ return items;
26350
+ }, [title, titleClassName, description, descriptionClassName]);
26272
26351
  return /* @__PURE__ */ jsx(
26273
26352
  Section,
26274
26353
  {
@@ -26280,34 +26359,16 @@ function FeatureImageCardsThreeColumn({
26280
26359
  className,
26281
26360
  containerClassName,
26282
26361
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-6 md:space-y-16", children: [
26283
- title || description ? /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-6 text-left", headerClassName), children: [
26284
- title && (typeof title === "string" ? /* @__PURE__ */ jsx(
26285
- "h2",
26286
- {
26287
- className: cn(
26288
- "text-2xl font-semibold text-balance md:text-3xl lg:text-4xl max-w-lg md:max-w-md",
26289
- titleClassName
26290
- ),
26291
- children: title
26292
- }
26293
- ) : /* @__PURE__ */ jsx(
26294
- "div",
26295
- {
26296
- className: cn(
26297
- "text-2xl font-semibold text-balance md:text-3xl lg:text-4xl max-w-lg md:max-w-md",
26298
- titleClassName
26299
- ),
26300
- children: title
26301
- }
26302
- )),
26303
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("max-w-lg md:max-w-md", descriptionClassName), children: description }) : /* @__PURE__ */ jsx(
26304
- "div",
26305
- {
26306
- className: cn("max-w-lg md:max-w-md", descriptionClassName),
26307
- children: description
26308
- }
26309
- ))
26310
- ] }) : null,
26362
+ /* @__PURE__ */ jsx(
26363
+ ContentGroup,
26364
+ {
26365
+ items: contentItems,
26366
+ className: cn(
26367
+ "flex flex-col gap-2 text-left items-start",
26368
+ headerClassName
26369
+ )
26370
+ }
26371
+ ),
26311
26372
  /* @__PURE__ */ jsx(
26312
26373
  "div",
26313
26374
  {
@@ -41457,6 +41518,40 @@ function FeatureAnimatedCarousel({
41457
41518
  );
41458
41519
  }
41459
41520
  const currentFeature = features[activeIndex];
41521
+ const contentItems = useMemo(() => {
41522
+ const items = [];
41523
+ if (title) {
41524
+ if (typeof title === "string") {
41525
+ items.push({
41526
+ _type: "text",
41527
+ as: "h2",
41528
+ className: cn(
41529
+ "text-3xl font-semibold text-balance md:text-4xl lg:text-5xl max-w-full md:max-w-md",
41530
+ title
41531
+ ),
41532
+ children: title
41533
+ });
41534
+ } else {
41535
+ items.push(title);
41536
+ }
41537
+ }
41538
+ if (description) {
41539
+ if (typeof description === "string") {
41540
+ items.push({
41541
+ _type: "text",
41542
+ as: "p",
41543
+ className: cn(
41544
+ "text-xl max-w-full md:max-w-md text-balance",
41545
+ descriptionClassName
41546
+ ),
41547
+ children: description
41548
+ });
41549
+ } else {
41550
+ items.push(description);
41551
+ }
41552
+ }
41553
+ return items;
41554
+ }, [title, titleClassName, description, descriptionClassName]);
41460
41555
  return /* @__PURE__ */ jsx(
41461
41556
  Section,
41462
41557
  {
@@ -41468,43 +41563,16 @@ function FeatureAnimatedCarousel({
41468
41563
  className,
41469
41564
  containerClassName,
41470
41565
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-6 md:space-y-16", children: [
41471
- title || description ? /* @__PURE__ */ jsxs(
41472
- "div",
41566
+ /* @__PURE__ */ jsx(
41567
+ ContentGroup,
41473
41568
  {
41569
+ items: contentItems,
41474
41570
  className: cn(
41475
- "flex flex-col gap-4 md:gap-6 text-left",
41571
+ "flex flex-col gap-2 text-left items-start",
41476
41572
  headerClassName
41477
- ),
41478
- children: [
41479
- title && (typeof title === "string" ? /* @__PURE__ */ jsx(
41480
- "h2",
41481
- {
41482
- className: cn(
41483
- "text-xl font-semibold text-balance md:text-2xl lg:text-3xl max-w-lg md:max-w-md",
41484
- titleClassName
41485
- ),
41486
- children: title
41487
- }
41488
- ) : /* @__PURE__ */ jsx(
41489
- "div",
41490
- {
41491
- className: cn(
41492
- "text-xl font-semibold text-balance md:text-2xl lg:text-3xl max-w-lg md:max-w-md",
41493
- titleClassName
41494
- ),
41495
- children: title
41496
- }
41497
- )),
41498
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("max-w-lg md:max-w-md", descriptionClassName), children: description }) : /* @__PURE__ */ jsx(
41499
- "div",
41500
- {
41501
- className: cn("max-w-lg md:max-w-md", descriptionClassName),
41502
- children: description
41503
- }
41504
- ))
41505
- ]
41573
+ )
41506
41574
  }
41507
- ) : null,
41575
+ ),
41508
41576
  /* @__PURE__ */ jsxs(
41509
41577
  "div",
41510
41578
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensite/ui",
3
- "version": "2.3.9",
3
+ "version": "2.4.1",
4
4
  "description": "Foundational UI component library for OpenSite Semantic Site Builder with tree-shakable exports and abstract styling",
5
5
  "keywords": [
6
6
  "react",