@reblu/site-blocks 0.10.0 → 0.11.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
@@ -1,4 +1,4 @@
1
- import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
1
+ import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
2
2
  import { FaqItem } from './seo.cjs';
3
3
  export { FaqPageJsonLd, buildFaqPageJsonLd, collectFaqItems } from './seo.cjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -332,6 +332,45 @@ interface ProductCardProps {
332
332
  }
333
333
  declare function ProductCard({ product, href, currencyCode, locale, className }: ProductCardProps): react_jsx_runtime.JSX.Element;
334
334
 
335
+ /**
336
+ * `ProductTrustItems` — the store-wide trust messages (shipping, returns, secure
337
+ * payment…) configured in nexus and served as `ShopConfig.productTrustItems`
338
+ * (REB-858). Drop it under the add-to-cart button of a product page (REB-862).
339
+ *
340
+ * Server Component, RSC-safe: no hooks, no state, no `'use client'`. The default
341
+ * icons are Lucide icons bundled into this package's artifact, so their
342
+ * server-evaluability does not depend on the consumer's `lucide-react` version.
343
+ *
344
+ * Semantics — the API is the only source of claims:
345
+ * - `null`, `undefined` or `[]` render NOTHING. No default items are ever invented.
346
+ * - An item whose `icon` is not one this version knows is SKIPPED (no fallback
347
+ * icon): the contract is forward-compatible and a newer API may add icons.
348
+ * - An item with empty / whitespace-only `text` is skipped.
349
+ * - If no item survives, nothing is rendered — never an empty `<ul>`.
350
+ * - Unknown item keys are ignored.
351
+ */
352
+ /** Props an icon component receives. Lucide icons and plain `<svg>` components both fit. */
353
+ interface TrustIconProps {
354
+ className?: string;
355
+ 'aria-hidden'?: boolean | 'true' | 'false';
356
+ }
357
+ type TrustIconComponent = ComponentType<TrustIconProps>;
358
+ /** The default icon for every `ShopProductTrustIcon` of the current contract. */
359
+ declare const DEFAULT_TRUST_ICONS: Readonly<Record<ShopProductTrustIcon, TrustIconComponent>>;
360
+ interface ProductTrustItemsProps {
361
+ /** `ShopConfig.productTrustItems` as served — may be `null` / `undefined`. */
362
+ items: readonly ShopProductTrustItem[] | null | undefined;
363
+ /** Per-icon overrides merged over {@link DEFAULT_TRUST_ICONS}. Cannot add new icon keys. */
364
+ icons?: Partial<Record<ShopProductTrustIcon, TrustIconComponent>>;
365
+ /** List element. Defaults to `ul`. */
366
+ as?: 'ul' | 'ol';
367
+ /** Classes for the list element. */
368
+ className?: string;
369
+ /** Classes for each `<li>` row. */
370
+ itemClassName?: string;
371
+ }
372
+ declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
373
+
335
374
  /** A heading level a caller can configure — `h1`…`h6`. */
336
375
  type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
337
376
 
@@ -866,4 +905,4 @@ interface OrderConfirmationProps {
866
905
  }
867
906
  declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
868
907
 
869
- export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
908
+ export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
1
+ import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder } from '@reblu/site-contracts';
2
2
  import { FaqItem } from './seo.js';
3
3
  export { FaqPageJsonLd, buildFaqPageJsonLd, collectFaqItems } from './seo.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -332,6 +332,45 @@ interface ProductCardProps {
332
332
  }
333
333
  declare function ProductCard({ product, href, currencyCode, locale, className }: ProductCardProps): react_jsx_runtime.JSX.Element;
334
334
 
335
+ /**
336
+ * `ProductTrustItems` — the store-wide trust messages (shipping, returns, secure
337
+ * payment…) configured in nexus and served as `ShopConfig.productTrustItems`
338
+ * (REB-858). Drop it under the add-to-cart button of a product page (REB-862).
339
+ *
340
+ * Server Component, RSC-safe: no hooks, no state, no `'use client'`. The default
341
+ * icons are Lucide icons bundled into this package's artifact, so their
342
+ * server-evaluability does not depend on the consumer's `lucide-react` version.
343
+ *
344
+ * Semantics — the API is the only source of claims:
345
+ * - `null`, `undefined` or `[]` render NOTHING. No default items are ever invented.
346
+ * - An item whose `icon` is not one this version knows is SKIPPED (no fallback
347
+ * icon): the contract is forward-compatible and a newer API may add icons.
348
+ * - An item with empty / whitespace-only `text` is skipped.
349
+ * - If no item survives, nothing is rendered — never an empty `<ul>`.
350
+ * - Unknown item keys are ignored.
351
+ */
352
+ /** Props an icon component receives. Lucide icons and plain `<svg>` components both fit. */
353
+ interface TrustIconProps {
354
+ className?: string;
355
+ 'aria-hidden'?: boolean | 'true' | 'false';
356
+ }
357
+ type TrustIconComponent = ComponentType<TrustIconProps>;
358
+ /** The default icon for every `ShopProductTrustIcon` of the current contract. */
359
+ declare const DEFAULT_TRUST_ICONS: Readonly<Record<ShopProductTrustIcon, TrustIconComponent>>;
360
+ interface ProductTrustItemsProps {
361
+ /** `ShopConfig.productTrustItems` as served — may be `null` / `undefined`. */
362
+ items: readonly ShopProductTrustItem[] | null | undefined;
363
+ /** Per-icon overrides merged over {@link DEFAULT_TRUST_ICONS}. Cannot add new icon keys. */
364
+ icons?: Partial<Record<ShopProductTrustIcon, TrustIconComponent>>;
365
+ /** List element. Defaults to `ul`. */
366
+ as?: 'ul' | 'ol';
367
+ /** Classes for the list element. */
368
+ className?: string;
369
+ /** Classes for each `<li>` row. */
370
+ itemClassName?: string;
371
+ }
372
+ declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
373
+
335
374
  /** A heading level a caller can configure — `h1`…`h6`. */
336
375
  type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
337
376
 
@@ -866,4 +905,4 @@ interface OrderConfirmationProps {
866
905
  }
867
906
  declare function OrderConfirmation({ status, order, sessionId, cartHref, onRecheck, labels, currencyCode, locale, className, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element;
868
907
 
869
- export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };
908
+ export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, FaqAccordion, type FaqAccordionProps, FaqItem, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, PageBlocks, type PageBlocksComponents, type PageBlocksProps, ParentPage, type ParentPageProps, ProductCard, type ProductCardProps, ProductTrustItems, type ProductTrustItemsProps, ProfileCard, type ProfileCardProps, type RenderableBlock, SafeHtml, type SafeHtmlProps, type ShareUrls, type ShopFilterPriceBand, ShopFilters, type ShopFiltersActive, type ShopFiltersHrefs, type ShopFiltersLabels, type ShopFiltersProps, Specialty, type SpecialtyProps, Treatment, type TreatmentProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, markdownToSafeHtml, readingTime, sanitizeHtml, shouldRenderShopFilters };