@planetaexo/design-system 0.54.0 → 0.55.0

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.d.cts CHANGED
@@ -2428,18 +2428,52 @@ interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {
2428
2428
  * AVIF, art-direction, etc. Render order = priority.
2429
2429
  */
2430
2430
  extraSources?: React.ReactNode;
2431
+ /**
2432
+ * Disable lazy loading. Use for LCP (hero, first card above the fold)
2433
+ * so the browser starts the request immediately instead of waiting for
2434
+ * the IntersectionObserver to fire.
2435
+ * @default false
2436
+ */
2437
+ eager?: boolean;
2438
+ /**
2439
+ * How far before the image enters the viewport to start loading.
2440
+ * Matches WP-Rocket's "Load images on visible viewport" — anything
2441
+ * within `rootMargin` triggers the swap. @default "200px"
2442
+ */
2443
+ rootMargin?: string;
2431
2444
  }
2432
2445
  /**
2433
- * `<img>` with a transparent WebP `<source>` wrapper.
2446
+ * `<img>` with a transparent WebP `<source>` wrapper AND
2447
+ * IntersectionObserver-based lazy load (WP-Rocket style).
2448
+ *
2449
+ * Behavior:
2450
+ * - SSR / first paint: the `<img>` renders a 1×1 transparent placeholder
2451
+ * in `src`; the real URL lives in `data-src`. The `<source srcset>` is
2452
+ * only emitted once the image enters the viewport — so no network
2453
+ * request fires for off-screen images, period.
2454
+ * - On mount: an `IntersectionObserver` watches with
2455
+ * `rootMargin: 200px` (configurable). When the placeholder gets within
2456
+ * 200px of the viewport, state flips and the component re-renders
2457
+ * with the real `src` (+ WebP `<source>` if eligible). The browser
2458
+ * decodes asynchronously thanks to `decoding="async"`.
2459
+ * - Pass `eager` to skip the observer entirely — required for LCP
2460
+ * images (hero, above-the-fold cards). Eager renders the real URL
2461
+ * synchronously.
2434
2462
  *
2435
- * Drop-in replacement for `<img>`. For sources that aren't WebP-eligible
2436
- * (SVG, GIF, base64), the `<picture>` wrapper is skipped and we render
2437
- * the plain `<img>` saves a useless `<picture>` element in the markup.
2463
+ * Why not just `loading="lazy"`?
2464
+ * Native `loading="lazy"` is honored by modern browsers but the
2465
+ * threshold isn't tunable (Chromium loads at ~3 viewports out, Firefox
2466
+ * at the next page). WP-Rocket's appeal is the predictable, small
2467
+ * `rootMargin` — 200px feels much more "just in time", saves more
2468
+ * bandwidth on long pages, and tests cleanly via DevTools network throttling.
2438
2469
  *
2439
- * Intentionally lightweight: no probing, no fetch, no preload. The
2440
- * browser's native `<picture>` resolver does the right thing for free.
2470
+ * SSR safety:
2471
+ * Marked `"use client"` because of the observer. The first render
2472
+ * (server + client hydration) emits the placeholder; the swap happens
2473
+ * one effect tick later. Hydration mismatch is impossible because both
2474
+ * sides start from `visible = eager`.
2441
2475
  */
2442
- declare function Picture({ src, extraSources, ...imgProps }: PictureProps): react_jsx_runtime.JSX.Element;
2476
+ declare function Picture({ src, extraSources, eager, rootMargin, decoding, loading, ...imgProps }: PictureProps): react_jsx_runtime.JSX.Element;
2443
2477
 
2444
2478
  /**
2445
2479
  * WebP-fallback helpers for components that render content-image URLs.
@@ -3040,6 +3074,15 @@ declare function TripPage({ title, tagline, destination, duration, images, video
3040
3074
  interface Category2Trip extends TripCardProps {
3041
3075
  /** Marca a trip como featured — sobe para o topo do grid principal. */
3042
3076
  featured?: boolean;
3077
+ /**
3078
+ * Per-group filter membership — `{ groupId: [optionId, …] }`, where the ids
3079
+ * match the `filterGroups` option ids. A trip is kept when, for every active
3080
+ * filter group, its ids intersect the selected option(s). Groups that no trip
3081
+ * carries data for stay display-only (selecting them doesn't filter).
3082
+ */
3083
+ filterTags?: Record<string, string[]>;
3084
+ /** Numeric price driving the price sort (the display string stays in `price`). */
3085
+ priceValue?: number;
3043
3086
  }
3044
3087
  interface Category2BlogPost {
3045
3088
  title: string;
@@ -3071,8 +3114,12 @@ interface CategoryPage2Props {
3071
3114
  label: string;
3072
3115
  href?: string;
3073
3116
  }>;
3074
- /** Pass true (or a links array) to render the transparent SiteHeader over the hero. */
3075
- siteHeader?: boolean | SiteHeaderLink[];
3117
+ /**
3118
+ * Render the overlay SiteHeader inside the hero. Pass `true` for the default
3119
+ * header, a `SiteHeaderLink[]` for custom links, or a full
3120
+ * {@link TripSiteHeaderConfig} to wire languages + onLanguageChange.
3121
+ */
3122
+ siteHeader?: boolean | SiteHeaderLink[] | TripSiteHeaderConfig;
3076
3123
  popularTours?: Category2Trip[];
3077
3124
  popularToursTitle?: string;
3078
3125
  popularToursEyebrow?: string;
package/dist/index.d.ts CHANGED
@@ -2428,18 +2428,52 @@ interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {
2428
2428
  * AVIF, art-direction, etc. Render order = priority.
2429
2429
  */
2430
2430
  extraSources?: React.ReactNode;
2431
+ /**
2432
+ * Disable lazy loading. Use for LCP (hero, first card above the fold)
2433
+ * so the browser starts the request immediately instead of waiting for
2434
+ * the IntersectionObserver to fire.
2435
+ * @default false
2436
+ */
2437
+ eager?: boolean;
2438
+ /**
2439
+ * How far before the image enters the viewport to start loading.
2440
+ * Matches WP-Rocket's "Load images on visible viewport" — anything
2441
+ * within `rootMargin` triggers the swap. @default "200px"
2442
+ */
2443
+ rootMargin?: string;
2431
2444
  }
2432
2445
  /**
2433
- * `<img>` with a transparent WebP `<source>` wrapper.
2446
+ * `<img>` with a transparent WebP `<source>` wrapper AND
2447
+ * IntersectionObserver-based lazy load (WP-Rocket style).
2448
+ *
2449
+ * Behavior:
2450
+ * - SSR / first paint: the `<img>` renders a 1×1 transparent placeholder
2451
+ * in `src`; the real URL lives in `data-src`. The `<source srcset>` is
2452
+ * only emitted once the image enters the viewport — so no network
2453
+ * request fires for off-screen images, period.
2454
+ * - On mount: an `IntersectionObserver` watches with
2455
+ * `rootMargin: 200px` (configurable). When the placeholder gets within
2456
+ * 200px of the viewport, state flips and the component re-renders
2457
+ * with the real `src` (+ WebP `<source>` if eligible). The browser
2458
+ * decodes asynchronously thanks to `decoding="async"`.
2459
+ * - Pass `eager` to skip the observer entirely — required for LCP
2460
+ * images (hero, above-the-fold cards). Eager renders the real URL
2461
+ * synchronously.
2434
2462
  *
2435
- * Drop-in replacement for `<img>`. For sources that aren't WebP-eligible
2436
- * (SVG, GIF, base64), the `<picture>` wrapper is skipped and we render
2437
- * the plain `<img>` saves a useless `<picture>` element in the markup.
2463
+ * Why not just `loading="lazy"`?
2464
+ * Native `loading="lazy"` is honored by modern browsers but the
2465
+ * threshold isn't tunable (Chromium loads at ~3 viewports out, Firefox
2466
+ * at the next page). WP-Rocket's appeal is the predictable, small
2467
+ * `rootMargin` — 200px feels much more "just in time", saves more
2468
+ * bandwidth on long pages, and tests cleanly via DevTools network throttling.
2438
2469
  *
2439
- * Intentionally lightweight: no probing, no fetch, no preload. The
2440
- * browser's native `<picture>` resolver does the right thing for free.
2470
+ * SSR safety:
2471
+ * Marked `"use client"` because of the observer. The first render
2472
+ * (server + client hydration) emits the placeholder; the swap happens
2473
+ * one effect tick later. Hydration mismatch is impossible because both
2474
+ * sides start from `visible = eager`.
2441
2475
  */
2442
- declare function Picture({ src, extraSources, ...imgProps }: PictureProps): react_jsx_runtime.JSX.Element;
2476
+ declare function Picture({ src, extraSources, eager, rootMargin, decoding, loading, ...imgProps }: PictureProps): react_jsx_runtime.JSX.Element;
2443
2477
 
2444
2478
  /**
2445
2479
  * WebP-fallback helpers for components that render content-image URLs.
@@ -3040,6 +3074,15 @@ declare function TripPage({ title, tagline, destination, duration, images, video
3040
3074
  interface Category2Trip extends TripCardProps {
3041
3075
  /** Marca a trip como featured — sobe para o topo do grid principal. */
3042
3076
  featured?: boolean;
3077
+ /**
3078
+ * Per-group filter membership — `{ groupId: [optionId, …] }`, where the ids
3079
+ * match the `filterGroups` option ids. A trip is kept when, for every active
3080
+ * filter group, its ids intersect the selected option(s). Groups that no trip
3081
+ * carries data for stay display-only (selecting them doesn't filter).
3082
+ */
3083
+ filterTags?: Record<string, string[]>;
3084
+ /** Numeric price driving the price sort (the display string stays in `price`). */
3085
+ priceValue?: number;
3043
3086
  }
3044
3087
  interface Category2BlogPost {
3045
3088
  title: string;
@@ -3071,8 +3114,12 @@ interface CategoryPage2Props {
3071
3114
  label: string;
3072
3115
  href?: string;
3073
3116
  }>;
3074
- /** Pass true (or a links array) to render the transparent SiteHeader over the hero. */
3075
- siteHeader?: boolean | SiteHeaderLink[];
3117
+ /**
3118
+ * Render the overlay SiteHeader inside the hero. Pass `true` for the default
3119
+ * header, a `SiteHeaderLink[]` for custom links, or a full
3120
+ * {@link TripSiteHeaderConfig} to wire languages + onLanguageChange.
3121
+ */
3122
+ siteHeader?: boolean | SiteHeaderLink[] | TripSiteHeaderConfig;
3076
3123
  popularTours?: Category2Trip[];
3077
3124
  popularToursTitle?: string;
3078
3125
  popularToursEyebrow?: string;