@planetaexo/design-system 0.52.1 → 0.52.3

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/index.cjs CHANGED
@@ -9968,6 +9968,30 @@ function TrustpilotFallback({ config }) {
9968
9968
  }
9969
9969
  );
9970
9970
  }
9971
+
9972
+ // src/lib/image-webp.ts
9973
+ var WEBP_ELIGIBLE_EXTENSION = /\.(jpe?g|png)(\?[^"'\s>]*)?$/i;
9974
+ function webpVariantUrl(src) {
9975
+ var _a;
9976
+ if (!src) return null;
9977
+ const m = src.match(WEBP_ELIGIBLE_EXTENSION);
9978
+ if (!m) return null;
9979
+ const query = (_a = m[2]) != null ? _a : "";
9980
+ const withoutQuery = query ? src.slice(0, -query.length) : src;
9981
+ return `${withoutQuery}.webp${query}`;
9982
+ }
9983
+ function Picture(_a) {
9984
+ var _b = _a, { src, extraSources } = _b, imgProps = __objRest(_b, ["src", "extraSources"]);
9985
+ const webp = webpVariantUrl(src);
9986
+ if (!webp) {
9987
+ return /* @__PURE__ */ jsxRuntime.jsx("img", __spreadValues({ src }, imgProps));
9988
+ }
9989
+ return /* @__PURE__ */ jsxRuntime.jsxs("picture", { style: { display: "contents" }, children: [
9990
+ /* @__PURE__ */ jsxRuntime.jsx("source", { srcSet: webp, type: "image/webp" }),
9991
+ extraSources,
9992
+ /* @__PURE__ */ jsxRuntime.jsx("img", __spreadValues({ src }, imgProps))
9993
+ ] });
9994
+ }
9971
9995
  function ItineraryDayCard({
9972
9996
  stop,
9973
9997
  onOpen
@@ -10321,7 +10345,7 @@ function Lightbox({
10321
10345
  }
10322
10346
  ),
10323
10347
  /* @__PURE__ */ jsxRuntime.jsx(
10324
- "img",
10348
+ Picture,
10325
10349
  {
10326
10350
  src: photo.src,
10327
10351
  alt: (_a = photo.alt) != null ? _a : `Photo ${index + 1}`,
@@ -10389,7 +10413,7 @@ function PhotoTile({
10389
10413
  "aria-label": (_a = photo.alt) != null ? _a : `Photo ${index + 1}`,
10390
10414
  children: [
10391
10415
  /* @__PURE__ */ jsxRuntime.jsx(
10392
- "img",
10416
+ Picture,
10393
10417
  {
10394
10418
  src: photo.src,
10395
10419
  alt: (_b = photo.alt) != null ? _b : `Photo ${index + 1}`,
@@ -10509,7 +10533,7 @@ function MasonryGallery({
10509
10533
  "aria-label": (_a = p.alt) != null ? _a : `Photo ${i + 1}`,
10510
10534
  children: [
10511
10535
  /* @__PURE__ */ jsxRuntime.jsx(
10512
- "img",
10536
+ Picture,
10513
10537
  {
10514
10538
  src: p.src,
10515
10539
  alt: (_b = p.alt) != null ? _b : `Photo ${i + 1}`,
@@ -10548,7 +10572,7 @@ function FilmstripGallery({
10548
10572
  "aria-label": (_a = p.alt) != null ? _a : `Photo ${i + 1}`,
10549
10573
  children: [
10550
10574
  /* @__PURE__ */ jsxRuntime.jsx(
10551
- "img",
10575
+ Picture,
10552
10576
  {
10553
10577
  src: p.src,
10554
10578
  alt: (_b = p.alt) != null ? _b : `Photo ${i + 1}`,
@@ -10613,7 +10637,7 @@ function FeaturedGallery({
10613
10637
  "aria-label": (_a = p.alt) != null ? _a : `Photo ${i + 4}`,
10614
10638
  children: [
10615
10639
  /* @__PURE__ */ jsxRuntime.jsx(
10616
- "img",
10640
+ Picture,
10617
10641
  {
10618
10642
  src: p.src,
10619
10643
  alt: (_b = p.alt) != null ? _b : `Photo ${i + 4}`,
@@ -10665,7 +10689,7 @@ function CarouselGallery({
10665
10689
  "aria-label": `Open photo ${index + 1} fullscreen`,
10666
10690
  className: "absolute inset-0 w-full h-full cursor-zoom-in focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
10667
10691
  children: /* @__PURE__ */ jsxRuntime.jsx(
10668
- "img",
10692
+ Picture,
10669
10693
  {
10670
10694
  src: photo.src,
10671
10695
  alt: (_a = photo.alt) != null ? _a : `Photo ${index + 1}`,
@@ -12037,7 +12061,7 @@ function TripCardEditorial(props) {
12037
12061
  const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12038
12062
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative aspect-[4/3] overflow-hidden bg-muted", children: [
12039
12063
  /* @__PURE__ */ jsxRuntime.jsx(
12040
- "img",
12064
+ Picture,
12041
12065
  {
12042
12066
  src: image,
12043
12067
  alt: imageAlt,
@@ -12128,7 +12152,7 @@ function TripCard(props) {
12128
12152
  ),
12129
12153
  children: [
12130
12154
  /* @__PURE__ */ jsxRuntime.jsx(
12131
- "img",
12155
+ Picture,
12132
12156
  {
12133
12157
  src: image,
12134
12158
  alt: imageAlt,
@@ -12275,7 +12299,7 @@ function TripHeader({
12275
12299
  ),
12276
12300
  videoUrl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12277
12301
  hasHeroImage ? /* @__PURE__ */ jsxRuntime.jsx(
12278
- "img",
12302
+ Picture,
12279
12303
  {
12280
12304
  src: validImages[0],
12281
12305
  alt: "",
@@ -12312,7 +12336,7 @@ function TripHeader({
12312
12336
  }
12313
12337
  )
12314
12338
  ] }) : hasHeroImage ? /* @__PURE__ */ jsxRuntime.jsx(
12315
- "img",
12339
+ Picture,
12316
12340
  {
12317
12341
  src: currentSrc,
12318
12342
  alt: title,
@@ -12889,6 +12913,7 @@ function TripPage({
12889
12913
  optionalExtras,
12890
12914
  accommodation,
12891
12915
  accommodationGallery,
12916
+ accommodationGalleryVariant = "gridCompact",
12892
12917
  whenItOperates,
12893
12918
  food,
12894
12919
  foodGallery,
@@ -13210,7 +13235,7 @@ function TripPage({
13210
13235
  PhotoGallery,
13211
13236
  {
13212
13237
  photos: accommodationGallery,
13213
- variant: "gridCompact",
13238
+ variant: accommodationGalleryVariant,
13214
13239
  initialVisible: 6
13215
13240
  }
13216
13241
  ) })
@@ -13291,7 +13316,7 @@ function TripPage({
13291
13316
  (sectionIcons == null ? void 0 : sectionIcons.weather) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary [&>svg]:h-5 [&>svg]:w-5", children: sectionIcons.weather }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SunIcon, { className: "h-5 w-5 text-primary" }),
13292
13317
  (_k = labels == null ? void 0 : labels.weather) != null ? _k : "Weather"
13293
13318
  ] }) }),
13294
- /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { className: "pb-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start gap-3 rounded-xl bg-muted/60 border border-border p-5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base text-foreground leading-relaxed space-y-2 [&_strong]:font-semibold", children: weather }) }) })
13319
+ /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { className: "pb-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base text-foreground leading-relaxed space-y-3 [&_strong]:font-semibold [&_a]:text-primary [&_a]:underline", children: weather }) })
13295
13320
  ]
13296
13321
  }
13297
13322
  ),
@@ -14789,6 +14814,7 @@ exports.PaymentReceiptEmail = PaymentReceiptEmail;
14789
14814
  exports.PaymentReminderEmail = PaymentReminderEmail;
14790
14815
  exports.PhoneCountrySelect = PhoneCountrySelect;
14791
14816
  exports.PhotoGallery = PhotoGallery;
14817
+ exports.Picture = Picture;
14792
14818
  exports.PricingTrip = PricingTrip;
14793
14819
  exports.RegistrationForm = RegistrationForm;
14794
14820
  exports.RegistrationProgressBar = RegistrationProgressBar;
@@ -14814,6 +14840,7 @@ exports.getStripeAppearance = getStripeAppearance;
14814
14840
  exports.itineraryDaySpecIcons = itineraryDaySpecIcons;
14815
14841
  exports.stripeAppearance = stripeAppearance;
14816
14842
  exports.validateCpf = validateCpf;
14843
+ exports.webpVariantUrl = webpVariantUrl;
14817
14844
  exports.wrapEmailHtml = wrapEmailHtml;
14818
14845
  //# sourceMappingURL=index.cjs.map
14819
14846
  //# sourceMappingURL=index.cjs.map