@opensite/ui 0.7.4 → 0.7.5

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
@@ -18256,41 +18256,44 @@ function CarouselFullscreenScrollFx({
18256
18256
  patternOpacity = 0.033
18257
18257
  }) {
18258
18258
  const containerRef = React52.useRef(null);
18259
+ const scrollContainerRef = React52.useRef(null);
18259
18260
  const [activeIndex, setActiveIndex] = React52.useState(0);
18260
18261
  React52.useEffect(() => {
18261
- const observers = [];
18262
- slides?.forEach((slide, index) => {
18263
- const element = document.getElementById(`fullscreen-${slide.id}`);
18264
- if (element) {
18265
- const observer = new IntersectionObserver(
18266
- (entries) => {
18267
- entries.forEach((entry) => {
18268
- if (entry.isIntersecting && entry.intersectionRatio > 0.5) {
18269
- setActiveIndex(index);
18270
- }
18271
- });
18272
- },
18273
- { threshold: 0.5 }
18274
- );
18275
- observer.observe(element);
18276
- observers.push(observer);
18277
- }
18278
- });
18279
- return () => {
18280
- observers.forEach((observer) => observer.disconnect());
18262
+ const scrollContainer = scrollContainerRef.current;
18263
+ if (!scrollContainer || !slides?.length) return;
18264
+ const handleScroll = () => {
18265
+ const scrollLeft = scrollContainer.scrollLeft;
18266
+ const slideWidth = scrollContainer.clientWidth;
18267
+ const newIndex = Math.round(scrollLeft / slideWidth);
18268
+ setActiveIndex(newIndex);
18281
18269
  };
18270
+ scrollContainer.addEventListener("scroll", handleScroll);
18271
+ return () => scrollContainer.removeEventListener("scroll", handleScroll);
18282
18272
  }, [slides]);
18273
+ const scrollToSlide = React52.useCallback((index) => {
18274
+ const scrollContainer = scrollContainerRef.current;
18275
+ if (!scrollContainer) return;
18276
+ const slideWidth = scrollContainer.clientWidth;
18277
+ if (typeof scrollContainer.scrollTo === "function") {
18278
+ scrollContainer.scrollTo({
18279
+ left: slideWidth * index,
18280
+ behavior: "smooth"
18281
+ });
18282
+ } else {
18283
+ scrollContainer.scrollLeft = slideWidth * index;
18284
+ }
18285
+ }, []);
18283
18286
  return /* @__PURE__ */ jsxs(
18284
18287
  Section,
18285
18288
  {
18286
18289
  ref: containerRef,
18287
18290
  background,
18288
18291
  spacing,
18289
- className: cn(className),
18292
+ className: cn("relative overflow-hidden", className),
18290
18293
  pattern,
18291
18294
  patternOpacity,
18292
18295
  containerMaxWidth,
18293
- containerClassName,
18296
+ containerClassName: "p-0",
18294
18297
  children: [
18295
18298
  /* @__PURE__ */ jsx(
18296
18299
  "div",
@@ -18302,10 +18305,7 @@ function CarouselFullscreenScrollFx({
18302
18305
  children: slides?.map((slide, index) => /* @__PURE__ */ jsx(
18303
18306
  "button",
18304
18307
  {
18305
- onClick: () => {
18306
- const element = document.getElementById(`fullscreen-${slide.id}`);
18307
- element?.scrollIntoView({ behavior: "smooth" });
18308
- },
18308
+ onClick: () => scrollToSlide(index),
18309
18309
  className: cn(
18310
18310
  "h-3 w-3 rounded-full border-2 transition-all",
18311
18311
  activeIndex === index ? "scale-125 border-white bg-white" : "border-white/50 bg-transparent hover:border-white"
@@ -18316,111 +18316,150 @@ function CarouselFullscreenScrollFx({
18316
18316
  ))
18317
18317
  }
18318
18318
  ),
18319
- slidesSlot ? slidesSlot : slides?.map((slide, index) => /* @__PURE__ */ jsxs(
18319
+ /* @__PURE__ */ jsx(
18320
18320
  "div",
18321
18321
  {
18322
- id: `fullscreen-${slide.id}`,
18323
- className: cn(
18324
- "relative flex h-screen w-full items-center justify-center overflow-hidden",
18325
- slide.className
18326
- ),
18327
- children: [
18328
- /* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
18329
- /* @__PURE__ */ jsx(
18330
- Img,
18331
- {
18332
- src: slide.image,
18333
- alt: typeof slide.title === "string" ? slide.title : `Slide ${index + 1}`,
18334
- className: cn(
18335
- "h-full w-full object-cover",
18336
- slide.imageClassName
18337
- ),
18338
- optixFlowConfig
18339
- }
18340
- ),
18341
- /* @__PURE__ */ jsx(
18342
- "div",
18343
- {
18344
- className: "absolute inset-0",
18345
- style: {
18346
- backgroundColor: slide.overlayColor || "rgba(0, 0, 0, 0.5)"
18347
- }
18348
- }
18349
- )
18350
- ] }),
18351
- /* @__PURE__ */ jsxs(
18322
+ ref: scrollContainerRef,
18323
+ className: "flex h-screen snap-x snap-mandatory overflow-x-auto overflow-y-hidden scroll-smooth",
18324
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
18325
+ children: slidesSlot ? slidesSlot : slides?.map((slide, index) => {
18326
+ const renderActions = React52.useMemo(() => {
18327
+ if (!slide.actions || slide.actions.length === 0) return null;
18328
+ return slide.actions.map((action, actionIndex) => {
18329
+ const {
18330
+ label,
18331
+ icon,
18332
+ iconAfter,
18333
+ children,
18334
+ className: actionClassName,
18335
+ asButton,
18336
+ ...pressableProps
18337
+ } = action;
18338
+ return /* @__PURE__ */ jsx(
18339
+ Pressable,
18340
+ {
18341
+ asButton: asButton ?? true,
18342
+ className: actionClassName,
18343
+ ...pressableProps,
18344
+ children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
18345
+ icon,
18346
+ label,
18347
+ iconAfter
18348
+ ] })
18349
+ },
18350
+ actionIndex
18351
+ );
18352
+ });
18353
+ }, [slide.actions]);
18354
+ return /* @__PURE__ */ jsxs(
18352
18355
  "div",
18353
18356
  {
18357
+ id: `fullscreen-${slide.id}`,
18354
18358
  className: cn(
18355
- "relative z-10 mx-auto max-w-4xl md:max-w-2xl px-6 text-center text-white text-shadow",
18356
- contentClassName
18359
+ "relative flex h-screen min-w-full snap-start items-center justify-center overflow-hidden",
18360
+ slide.className
18357
18361
  ),
18358
18362
  children: [
18359
- slide.subtitle && (typeof slide.subtitle === "string" ? /* @__PURE__ */ jsx(
18360
- "p",
18363
+ /* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
18364
+ /* @__PURE__ */ jsx(
18365
+ Img,
18366
+ {
18367
+ src: slide.image,
18368
+ alt: typeof slide.title === "string" ? slide.title : `Slide ${index + 1}`,
18369
+ className: cn(
18370
+ "h-full w-full object-cover",
18371
+ slide.imageClassName
18372
+ ),
18373
+ optixFlowConfig
18374
+ }
18375
+ ),
18376
+ /* @__PURE__ */ jsx(
18377
+ "div",
18378
+ {
18379
+ className: "absolute inset-0",
18380
+ style: {
18381
+ backgroundColor: slide.overlayColor || "rgba(0, 0, 0, 0.5)"
18382
+ }
18383
+ }
18384
+ )
18385
+ ] }),
18386
+ /* @__PURE__ */ jsxs(
18387
+ "div",
18361
18388
  {
18362
18389
  className: cn(
18363
- "mb-4 text-sm font-medium uppercase tracking-widest text-white/70",
18364
- subtitleClassName
18390
+ "relative z-10 mx-auto max-w-4xl md:max-w-2xl px-6 text-center text-white text-shadow",
18391
+ contentClassName
18365
18392
  ),
18366
- children: slide.subtitle
18393
+ children: [
18394
+ slide.subtitle && (typeof slide.subtitle === "string" ? /* @__PURE__ */ jsx(
18395
+ "p",
18396
+ {
18397
+ className: cn(
18398
+ "mb-4 text-sm font-medium uppercase tracking-widest text-white/70",
18399
+ subtitleClassName
18400
+ ),
18401
+ children: slide.subtitle
18402
+ }
18403
+ ) : /* @__PURE__ */ jsx("div", { className: subtitleClassName, children: slide.subtitle })),
18404
+ slide.title && (typeof slide.title === "string" ? /* @__PURE__ */ jsx(
18405
+ "h2",
18406
+ {
18407
+ className: cn(
18408
+ "mb-6 text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl",
18409
+ titleClassName
18410
+ ),
18411
+ children: slide.title
18412
+ }
18413
+ ) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: slide.title })),
18414
+ slide.description && (typeof slide.description === "string" ? /* @__PURE__ */ jsx(
18415
+ "p",
18416
+ {
18417
+ className: cn(
18418
+ "mx-auto text-lg text-white/80 md:text-xl text-balance",
18419
+ descriptionClassName
18420
+ ),
18421
+ children: slide.description
18422
+ }
18423
+ ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: slide.description })),
18424
+ renderActions && /* @__PURE__ */ jsx("div", { className: "mt-8 flex flex-col items-center justify-center gap-3 sm:flex-row", children: renderActions })
18425
+ ]
18367
18426
  }
18368
- ) : /* @__PURE__ */ jsx("div", { className: subtitleClassName, children: slide.subtitle })),
18369
- slide.title && (typeof slide.title === "string" ? /* @__PURE__ */ jsx(
18370
- "h2",
18427
+ ),
18428
+ index < (slides?.length ?? 0) - 1 && /* @__PURE__ */ jsx(
18429
+ "div",
18371
18430
  {
18372
18431
  className: cn(
18373
- "mb-6 text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl",
18374
- titleClassName
18432
+ "absolute bottom-8 left-1/2 -translate-x-1/2",
18433
+ scrollIndicatorClassName
18375
18434
  ),
18376
- children: slide.title
18435
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
18436
+ /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-widest text-white/50", children: "Scroll" }),
18437
+ /* @__PURE__ */ jsx("div", { className: "h-12 w-px animate-pulse bg-linear-to-b from-white/50 to-transparent" })
18438
+ ] })
18377
18439
  }
18378
- ) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: slide.title })),
18379
- slide.description && (typeof slide.description === "string" ? /* @__PURE__ */ jsx(
18380
- "p",
18440
+ ),
18441
+ /* @__PURE__ */ jsxs(
18442
+ "div",
18381
18443
  {
18382
18444
  className: cn(
18383
- "mx-auto text-lg text-white/80 md:text-xl text-balance",
18384
- descriptionClassName
18445
+ "absolute bottom-8 right-8 text-sm text-white/50",
18446
+ counterClassName
18385
18447
  ),
18386
- children: slide.description
18448
+ children: [
18449
+ String(index + 1).padStart(2, "0"),
18450
+ " /",
18451
+ " ",
18452
+ String(slides?.length ?? 0).padStart(2, "0")
18453
+ ]
18387
18454
  }
18388
- ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: slide.description }))
18389
- ]
18390
- }
18391
- ),
18392
- index < (slides?.length ?? 0) - 1 && /* @__PURE__ */ jsx(
18393
- "div",
18394
- {
18395
- className: cn(
18396
- "absolute bottom-8 left-1/2 -translate-x-1/2",
18397
- scrollIndicatorClassName
18398
- ),
18399
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
18400
- /* @__PURE__ */ jsx("span", { className: "text-xs uppercase tracking-widest text-white/50", children: "Scroll" }),
18401
- /* @__PURE__ */ jsx("div", { className: "h-12 w-px animate-pulse bg-linear-to-b from-white/50 to-transparent" })
18402
- ] })
18403
- }
18404
- ),
18405
- /* @__PURE__ */ jsxs(
18406
- "div",
18407
- {
18408
- className: cn(
18409
- "absolute bottom-8 right-8 text-sm text-white/50",
18410
- counterClassName
18411
- ),
18412
- children: [
18413
- String(index + 1).padStart(2, "0"),
18414
- " /",
18415
- " ",
18416
- String(slides?.length ?? 0).padStart(2, "0")
18455
+ )
18417
18456
  ]
18418
- }
18419
- )
18420
- ]
18421
- },
18422
- slide.id
18423
- ))
18457
+ },
18458
+ slide.id
18459
+ );
18460
+ })
18461
+ }
18462
+ )
18424
18463
  ]
18425
18464
  }
18426
18465
  );
@@ -76902,7 +76941,7 @@ function ListSearchableGrid({
76902
76941
  }
76903
76942
  );
76904
76943
  }
76905
- var { useMemo: useMemo440 } = React52;
76944
+ var { useMemo: useMemo441 } = React52;
76906
76945
  function OfferModalNewsletterDiscount({
76907
76946
  title,
76908
76947
  emailPlaceholder,
@@ -76969,7 +77008,7 @@ function OfferModalNewsletterDiscount({
76969
77008
  });
76970
77009
  const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
76971
77010
  const dialogProps = open !== void 0 ? { open, onOpenChange } : { defaultOpen };
76972
- const renderCloseButton = useMemo440(() => {
77011
+ const renderCloseButton = useMemo441(() => {
76973
77012
  if (closeButtonSlot) return closeButtonSlot;
76974
77013
  if (!closeButtonText) return null;
76975
77014
  return /* @__PURE__ */ jsx("div", { className: "absolute end-1.5 top-1.5", children: /* @__PURE__ */ jsx(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx(
@@ -76983,12 +77022,12 @@ function OfferModalNewsletterDiscount({
76983
77022
  }
76984
77023
  ) }) });
76985
77024
  }, [closeButtonSlot, closeButtonText, closeClassName]);
76986
- const renderHeader = useMemo440(() => {
77025
+ const renderHeader = useMemo441(() => {
76987
77026
  if (headerSlot) return headerSlot;
76988
77027
  if (!title) return null;
76989
77028
  return /* @__PURE__ */ jsx(DialogHeader, { className: headerClassName, children: typeof title === "string" ? /* @__PURE__ */ jsx(DialogTitle, { className: cn("text-start font-serif text-2xl font-normal leading-snug", titleClassName), children: title }) : /* @__PURE__ */ jsx(DialogTitle, { className: cn("text-start font-serif text-2xl font-normal leading-snug", titleClassName), children: title }) });
76990
77029
  }, [headerSlot, title, headerClassName, titleClassName]);
76991
- const renderForm = useMemo440(() => {
77030
+ const renderForm = useMemo441(() => {
76992
77031
  if (formSlot) return formSlot;
76993
77032
  return /* @__PURE__ */ jsxs(
76994
77033
  Form,
@@ -77050,7 +77089,7 @@ function OfferModalNewsletterDiscount({
77050
77089
  }
77051
77090
  ) });
77052
77091
  }
77053
- var { useMemo: useMemo441 } = React52;
77092
+ var { useMemo: useMemo442 } = React52;
77054
77093
  function OfferModalMembershipImage({
77055
77094
  overline,
77056
77095
  title,
@@ -77126,7 +77165,7 @@ function OfferModalMembershipImage({
77126
77165
  });
77127
77166
  const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
77128
77167
  const dialogProps = open !== void 0 ? { open, onOpenChange } : { defaultOpen };
77129
- const renderImage = useMemo441(() => {
77168
+ const renderImage = useMemo442(() => {
77130
77169
  if (imageSlot) return imageSlot;
77131
77170
  if (!image) return null;
77132
77171
  return /* @__PURE__ */ jsx("div", { className: cn("max-h-[290px] h-full overflow-hidden max-lg:hidden", imageWrapperClassName), children: /* @__PURE__ */ jsx(
@@ -77139,7 +77178,7 @@ function OfferModalMembershipImage({
77139
77178
  }
77140
77179
  ) });
77141
77180
  }, [imageSlot, image, imageWrapperClassName, imageClassName, optixFlowConfig]);
77142
- const renderCloseButton = useMemo441(() => {
77181
+ const renderCloseButton = useMemo442(() => {
77143
77182
  if (closeButtonSlot) return closeButtonSlot;
77144
77183
  return /* @__PURE__ */ jsx("div", { className: "absolute -end-px -top-px z-10", children: /* @__PURE__ */ jsx(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx(
77145
77184
  Pressable,
@@ -77155,7 +77194,7 @@ function OfferModalMembershipImage({
77155
77194
  }
77156
77195
  ) }) });
77157
77196
  }, [closeButtonSlot, closeClassName]);
77158
- const renderForm = useMemo441(() => {
77197
+ const renderForm = useMemo442(() => {
77159
77198
  if (formSlot) return formSlot;
77160
77199
  return /* @__PURE__ */ jsxs(
77161
77200
  Form,
@@ -77218,7 +77257,7 @@ function OfferModalMembershipImage({
77218
77257
  }
77219
77258
  );
77220
77259
  }, [formSlot, form, formConfig, formMethod, emailPlaceholder, inputClassName, submitClassName, buttonText, formClassName]);
77221
- const renderFooter = useMemo441(() => {
77260
+ const renderFooter = useMemo442(() => {
77222
77261
  if (footerSlot) return footerSlot;
77223
77262
  if (!description) return null;
77224
77263
  return /* @__PURE__ */ jsx(DialogFooter, { className: footerClassName, children: /* @__PURE__ */ jsx(DialogDescription, { className: cn("text-muted-foreground text-center text-xs leading-relaxed", descriptionClassName), children: description }) });
@@ -77246,7 +77285,7 @@ function OfferModalMembershipImage({
77246
77285
  }
77247
77286
  ) });
77248
77287
  }
77249
- var { useMemo: useMemo442 } = React52;
77288
+ var { useMemo: useMemo443 } = React52;
77250
77289
  function OfferModalSheetNewsletter({
77251
77290
  logo,
77252
77291
  logoSlot,
@@ -77328,7 +77367,7 @@ function OfferModalSheetNewsletter({
77328
77367
  });
77329
77368
  const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
77330
77369
  const sheetProps = open !== void 0 ? { open, onOpenChange } : { defaultOpen };
77331
- const renderLogo = useMemo442(() => {
77370
+ const renderLogo = useMemo443(() => {
77332
77371
  if (logoSlot) return logoSlot;
77333
77372
  if (!logo) return null;
77334
77373
  const logoSrc = typeof logo.src === "string" ? logo.src : logo.src.light;
@@ -77342,7 +77381,7 @@ function OfferModalSheetNewsletter({
77342
77381
  }
77343
77382
  );
77344
77383
  }, [logoSlot, logo, logoClassName, optixFlowConfig]);
77345
- const renderHeader = useMemo442(() => {
77384
+ const renderHeader = useMemo443(() => {
77346
77385
  if (headerSlot) return headerSlot;
77347
77386
  return /* @__PURE__ */ jsxs(SheetHeader, { className: cn("gap-8 p-0", headerClassName), children: [
77348
77387
  renderLogo,
@@ -77352,7 +77391,7 @@ function OfferModalSheetNewsletter({
77352
77391
  ] })
77353
77392
  ] });
77354
77393
  }, [headerSlot, renderLogo, headerClassName, title, titleClassName, description, descriptionClassName]);
77355
- const renderForm = useMemo442(() => {
77394
+ const renderForm = useMemo443(() => {
77356
77395
  if (formSlot) return formSlot;
77357
77396
  return /* @__PURE__ */ jsx(
77358
77397
  Form,
@@ -77400,7 +77439,7 @@ function OfferModalSheetNewsletter({
77400
77439
  }
77401
77440
  );
77402
77441
  }, [formSlot, form, formConfig, formMethod, emailPlaceholder, inputClassName, submitClassName, buttonText, formClassName]);
77403
- const renderLegal = useMemo442(() => {
77442
+ const renderLegal = useMemo443(() => {
77404
77443
  if (legalSlot) return legalSlot;
77405
77444
  if (!termsUrl || !termsText || !privacyUrl || !privacyText) return null;
77406
77445
  return /* @__PURE__ */ jsxs("p", { className: cn("text-muted-foreground text-xs", legalClassName), children: [
@@ -77414,7 +77453,7 @@ function OfferModalSheetNewsletter({
77414
77453
  "."
77415
77454
  ] });
77416
77455
  }, [legalSlot, termsUrl, termsText, privacyUrl, privacyText, legalClassName]);
77417
- const renderImage = useMemo442(() => {
77456
+ const renderImage = useMemo443(() => {
77418
77457
  if (imageSlot) return imageSlot;
77419
77458
  if (!image) return null;
77420
77459
  return /* @__PURE__ */ jsx("div", { className: cn("h-1/2 basis-1/2", imageWrapperClassName), children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 1, className: "overflow-hidden", children: /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensite/ui",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
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",