@reblu/site-blocks 0.14.0 → 0.15.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, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
1
+ import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
2
2
  import { FaqItem } from './seo.cjs';
3
3
  export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.cjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -275,11 +275,17 @@ interface CourseDescriptionProps {
275
275
  * with a `heading` (so its `##` sits one level below it) and `0` without one.
276
276
  */
277
277
  headingOffset?: number;
278
- /** Classes for the outer element. */
278
+ /** Classes for the outer element (added to its `space-y-3` layout). */
279
279
  className?: string;
280
- /** Classes for the heading. */
280
+ /**
281
+ * Classes for the heading. When given, they REPLACE the default
282
+ * `text-xl font-semibold` (REB-997) — pass the full typography you want.
283
+ */
281
284
  headingClassName?: string;
282
- /** Classes for the rendered Markdown body. */
285
+ /**
286
+ * Classes for the rendered Markdown body. When given, they REPLACE the
287
+ * default `text-muted-foreground` (REB-997).
288
+ */
283
289
  contentClassName?: string;
284
290
  }
285
291
  declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
@@ -428,9 +434,13 @@ interface ProductTrustItemsProps {
428
434
  icons?: Partial<Record<ShopProductTrustIcon, TrustIconComponent>>;
429
435
  /** List element. Defaults to `ul`. */
430
436
  as?: 'ul' | 'ol';
431
- /** Classes for the list element. */
437
+ /** Classes for the list element (added to its `space-y-2.5` layout). */
432
438
  className?: string;
433
- /** Classes for each `<li>` row. */
439
+ /**
440
+ * Classes for each `<li>` row. When given, they REPLACE the default
441
+ * `text-sm text-muted-foreground` (REB-997); the row's `flex items-center
442
+ * gap-3` layout is kept.
443
+ */
434
444
  itemClassName?: string;
435
445
  }
436
446
  declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
@@ -463,6 +473,55 @@ interface FaqAccordionProps {
463
473
  }
464
474
  declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLevel, defaultOpen, className, }: FaqAccordionProps): react_jsx_runtime.JSX.Element | null;
465
475
 
476
+ /**
477
+ * `TrustBadges` — the tenant's trust badges (partners, insurers, funding,
478
+ * certifications, awards) configured in nexus and served by
479
+ * `client.trustBadges.list()` (REB-996). Drop it in a footer or an "about"
480
+ * section; switching a badge off or letting its validity date pass in nexus
481
+ * removes it from the SITE on the next revalidation, with no deploy.
482
+ *
483
+ * Server Component, RSC-safe: no hooks, no state, no `'use client'`.
484
+ *
485
+ * Semantics — the API is the only source of claims:
486
+ * - `null`, `undefined`, a non-array or `[]` render NOTHING.
487
+ * - An entry with an unknown `type` or an empty name is skipped; if nothing
488
+ * survives, nothing is rendered.
489
+ * - Badges are grouped by type (in {@link DEFAULT_TRUST_BADGE_TYPE_ORDER}, or
490
+ * the `types` prop), each group under an overridable heading, and ordered by
491
+ * `sortOrder` inside it.
492
+ * - A logo is an `<img>` whose `alt` is the badge name; a badge without a logo
493
+ * shows its name as text.
494
+ * - `url` links only when it is http(s), in a new window with
495
+ * `rel="noopener noreferrer"` and a visually hidden new-window hint.
496
+ */
497
+ /** Default group heading per badge type. Override any of them with `headings`. */
498
+ declare const DEFAULT_TRUST_BADGE_HEADINGS: Readonly<Record<TrustBadgeType, string>>;
499
+ /** Default order of the groups. */
500
+ declare const DEFAULT_TRUST_BADGE_TYPE_ORDER: readonly TrustBadgeType[];
501
+ interface TrustBadgesProps {
502
+ /** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
503
+ badges: readonly TrustBadge[] | null | undefined;
504
+ /** Per-type heading overrides; `null` renders that group without a heading. */
505
+ headings?: Partial<Record<TrustBadgeType, string | null>>;
506
+ /** Which groups to render, in this order. Defaults to every type. */
507
+ types?: readonly TrustBadgeType[];
508
+ /** Heading level of each group title. Defaults to `2`. */
509
+ headingLevel?: HeadingLevel;
510
+ /** Visually hidden text appended to linked badges. */
511
+ newWindowLabel?: string;
512
+ /** Classes for the root element. */
513
+ className?: string;
514
+ /** Classes for each group. */
515
+ groupClassName?: string;
516
+ /** Classes for each group heading. */
517
+ headingClassName?: string;
518
+ /** Classes for each group's `<ul>`. */
519
+ listClassName?: string;
520
+ /** Classes for each logo `<img>`. */
521
+ logoClassName?: string;
522
+ }
523
+ declare function TrustBadges({ badges, headings, types, headingLevel, newWindowLabel, className, groupClassName, headingClassName, listClassName, logoClassName, }: TrustBadgesProps): react_jsx_runtime.JSX.Element | null;
524
+
466
525
  /**
467
526
  * REB-850 — `PageBlocks`: the shared renderer for a page's registry blocks
468
527
  * (`PageDetail.blocks`, REB-75), so a SITE stops hand-writing its own.
@@ -1144,4 +1203,4 @@ interface OrderInvoiceLinkProps {
1144
1203
  }
1145
1204
  declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
1146
1205
 
1147
- export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, 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, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, 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, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
1206
+ export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, 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, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
1
+ import { ShopErrorCode, PageDetail, PageListItem, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopOrderInvoice } from '@reblu/site-contracts';
2
2
  import { FaqItem } from './seo.js';
3
3
  export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -275,11 +275,17 @@ interface CourseDescriptionProps {
275
275
  * with a `heading` (so its `##` sits one level below it) and `0` without one.
276
276
  */
277
277
  headingOffset?: number;
278
- /** Classes for the outer element. */
278
+ /** Classes for the outer element (added to its `space-y-3` layout). */
279
279
  className?: string;
280
- /** Classes for the heading. */
280
+ /**
281
+ * Classes for the heading. When given, they REPLACE the default
282
+ * `text-xl font-semibold` (REB-997) — pass the full typography you want.
283
+ */
281
284
  headingClassName?: string;
282
- /** Classes for the rendered Markdown body. */
285
+ /**
286
+ * Classes for the rendered Markdown body. When given, they REPLACE the
287
+ * default `text-muted-foreground` (REB-997).
288
+ */
283
289
  contentClassName?: string;
284
290
  }
285
291
  declare function CourseDescription({ description, heading, headingLevel, headingId, headingOffset, className, headingClassName, contentClassName, }: CourseDescriptionProps): react_jsx_runtime.JSX.Element | null;
@@ -428,9 +434,13 @@ interface ProductTrustItemsProps {
428
434
  icons?: Partial<Record<ShopProductTrustIcon, TrustIconComponent>>;
429
435
  /** List element. Defaults to `ul`. */
430
436
  as?: 'ul' | 'ol';
431
- /** Classes for the list element. */
437
+ /** Classes for the list element (added to its `space-y-2.5` layout). */
432
438
  className?: string;
433
- /** Classes for each `<li>` row. */
439
+ /**
440
+ * Classes for each `<li>` row. When given, they REPLACE the default
441
+ * `text-sm text-muted-foreground` (REB-997); the row's `flex items-center
442
+ * gap-3` layout is kept.
443
+ */
434
444
  itemClassName?: string;
435
445
  }
436
446
  declare function ProductTrustItems({ items, icons, as: List, className, itemClassName, }: ProductTrustItemsProps): react_jsx_runtime.JSX.Element | null;
@@ -463,6 +473,55 @@ interface FaqAccordionProps {
463
473
  }
464
474
  declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLevel, defaultOpen, className, }: FaqAccordionProps): react_jsx_runtime.JSX.Element | null;
465
475
 
476
+ /**
477
+ * `TrustBadges` — the tenant's trust badges (partners, insurers, funding,
478
+ * certifications, awards) configured in nexus and served by
479
+ * `client.trustBadges.list()` (REB-996). Drop it in a footer or an "about"
480
+ * section; switching a badge off or letting its validity date pass in nexus
481
+ * removes it from the SITE on the next revalidation, with no deploy.
482
+ *
483
+ * Server Component, RSC-safe: no hooks, no state, no `'use client'`.
484
+ *
485
+ * Semantics — the API is the only source of claims:
486
+ * - `null`, `undefined`, a non-array or `[]` render NOTHING.
487
+ * - An entry with an unknown `type` or an empty name is skipped; if nothing
488
+ * survives, nothing is rendered.
489
+ * - Badges are grouped by type (in {@link DEFAULT_TRUST_BADGE_TYPE_ORDER}, or
490
+ * the `types` prop), each group under an overridable heading, and ordered by
491
+ * `sortOrder` inside it.
492
+ * - A logo is an `<img>` whose `alt` is the badge name; a badge without a logo
493
+ * shows its name as text.
494
+ * - `url` links only when it is http(s), in a new window with
495
+ * `rel="noopener noreferrer"` and a visually hidden new-window hint.
496
+ */
497
+ /** Default group heading per badge type. Override any of them with `headings`. */
498
+ declare const DEFAULT_TRUST_BADGE_HEADINGS: Readonly<Record<TrustBadgeType, string>>;
499
+ /** Default order of the groups. */
500
+ declare const DEFAULT_TRUST_BADGE_TYPE_ORDER: readonly TrustBadgeType[];
501
+ interface TrustBadgesProps {
502
+ /** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
503
+ badges: readonly TrustBadge[] | null | undefined;
504
+ /** Per-type heading overrides; `null` renders that group without a heading. */
505
+ headings?: Partial<Record<TrustBadgeType, string | null>>;
506
+ /** Which groups to render, in this order. Defaults to every type. */
507
+ types?: readonly TrustBadgeType[];
508
+ /** Heading level of each group title. Defaults to `2`. */
509
+ headingLevel?: HeadingLevel;
510
+ /** Visually hidden text appended to linked badges. */
511
+ newWindowLabel?: string;
512
+ /** Classes for the root element. */
513
+ className?: string;
514
+ /** Classes for each group. */
515
+ groupClassName?: string;
516
+ /** Classes for each group heading. */
517
+ headingClassName?: string;
518
+ /** Classes for each group's `<ul>`. */
519
+ listClassName?: string;
520
+ /** Classes for each logo `<img>`. */
521
+ logoClassName?: string;
522
+ }
523
+ declare function TrustBadges({ badges, headings, types, headingLevel, newWindowLabel, className, groupClassName, headingClassName, listClassName, logoClassName, }: TrustBadgesProps): react_jsx_runtime.JSX.Element | null;
524
+
466
525
  /**
467
526
  * REB-850 — `PageBlocks`: the shared renderer for a page's registry blocks
468
527
  * (`PageDetail.blocks`, REB-75), so a SITE stops hand-writing its own.
@@ -1144,4 +1203,4 @@ interface OrderInvoiceLinkProps {
1144
1203
  }
1145
1204
  declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
1146
1205
 
1147
- export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, 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, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, 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, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };
1206
+ export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, 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, CourseDescription, type CourseDescriptionProps, DEFAULT_INVOICE_COUNTRIES, DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE, DEFAULT_SHOP_ERROR_MESSAGES, DEFAULT_SHOP_PRICE_BANDS, DEFAULT_TRUST_BADGE_HEADINGS, DEFAULT_TRUST_BADGE_TYPE_ORDER, DEFAULT_TRUST_ICONS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, type HeadingLevel, MarkdownRenderer, type MarkdownRendererProps, OrderConfirmation, type OrderConfirmationLabels, type OrderConfirmationOrder, type OrderConfirmationProps, type OrderConfirmationStatus, OrderInvoiceLink, type OrderInvoiceLinkLabels, type OrderInvoiceLinkProps, PageBlocks, type PageBlocksComponents, type PageBlocksProps, PageCardGrid, type PageCardGridProps, 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, TrustBadges, type TrustBadgesProps, type TrustIconComponent, type TrustIconProps, buildShareUrls, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutInvoiceFields };