@reblu/site-blocks 0.27.0 → 0.29.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/CHANGELOG.md +17 -0
- package/README.md +188 -1
- package/dist/index.cjs +757 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +245 -5
- package/dist/index.d.ts +245 -5
- package/dist/index.js +744 -273
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopCheckoutDeliveryConfig, ShopCheckoutCopy, ShopFulfillmentInput, ShopQuote, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.cjs';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.cjs';
|
|
@@ -669,7 +669,8 @@ declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLev
|
|
|
669
669
|
* - Badges are grouped by type (in {@link DEFAULT_TRUST_BADGE_TYPE_ORDER}, or
|
|
670
670
|
* the `types` prop), each group under an overridable heading, and ordered by
|
|
671
671
|
* `sortOrder` inside it.
|
|
672
|
-
* - A logo is an `<img>` whose `alt` is the badge name
|
|
672
|
+
* - A logo is an `<img>` whose `alt` is the badge name (plus its adhesion
|
|
673
|
+
* number when it has one, REB-1201), rendered only when its
|
|
673
674
|
* URL is http(s) or root-relative (REB-1002); a badge without a usable logo
|
|
674
675
|
* shows its name as text.
|
|
675
676
|
* - `heading` (optional) wraps everything in a `<section>` labelled by it
|
|
@@ -682,14 +683,22 @@ declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLev
|
|
|
682
683
|
*/
|
|
683
684
|
/** Default group heading per badge type. Override any of them with `headings`. */
|
|
684
685
|
declare const DEFAULT_TRUST_BADGE_HEADINGS: Readonly<Record<TrustBadgeType, string>>;
|
|
685
|
-
/**
|
|
686
|
+
/**
|
|
687
|
+
* Default order of the groups. CONSUMER_ARBITRATION is deliberately absent
|
|
688
|
+
* (REB-1201): it has its own footer drop-in, `ArbitrationBadge`, so a footer
|
|
689
|
+
* rendering both never shows it twice. Opt in with `types` to group it here.
|
|
690
|
+
*/
|
|
686
691
|
declare const DEFAULT_TRUST_BADGE_TYPE_ORDER: readonly TrustBadgeType[];
|
|
687
692
|
interface TrustBadgesProps {
|
|
688
693
|
/** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
|
|
689
694
|
badges: readonly TrustBadge[] | null | undefined;
|
|
690
695
|
/** Per-type heading overrides; `null` renders that group without a heading. */
|
|
691
696
|
headings?: Partial<Record<TrustBadgeType, string | null>>;
|
|
692
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* Which groups to render, in this order. Defaults to
|
|
699
|
+
* {@link DEFAULT_TRUST_BADGE_TYPE_ORDER} (every type except
|
|
700
|
+
* `CONSUMER_ARBITRATION`, which `ArbitrationBadge` renders).
|
|
701
|
+
*/
|
|
693
702
|
types?: readonly TrustBadgeType[];
|
|
694
703
|
/**
|
|
695
704
|
* Optional section title, e.g. «Nos avalan». When given, the root is a
|
|
@@ -727,6 +736,45 @@ interface TrustBadgesProps {
|
|
|
727
736
|
}
|
|
728
737
|
declare function TrustBadges({ badges, headings, types, heading, headingId, headingLevel, newWindowLabel, className, groupClassName, headingClassName, sectionHeadingClassName, listClassName, logoClassName, }: TrustBadgesProps): react_jsx_runtime.JSX.Element | null;
|
|
729
738
|
|
|
739
|
+
/**
|
|
740
|
+
* `ArbitrationBadge` — the tenant's consumer-arbitration distinctive (trust
|
|
741
|
+
* badge of type `CONSUMER_ARBITRATION`, set up in nexus › Trust badges with
|
|
742
|
+
* its logo, adhesion number and optional link) for the SITE footer (REB-1201).
|
|
743
|
+
* Pass `client.trustBadges.list()`'s `data` as is — every other type is
|
|
744
|
+
* ignored, so the same list can feed `TrustBadges` next to it.
|
|
745
|
+
*
|
|
746
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
747
|
+
*
|
|
748
|
+
* Visible and accessible:
|
|
749
|
+
* - The logo is an `<img>` at `h-16` by default (not a tiny icon) whose `alt`
|
|
750
|
+
* is the badge name plus the adhesion number («… N.º de adhesión CA00000»).
|
|
751
|
+
* - The number is also shown as visible text under the logo, `aria-hidden`
|
|
752
|
+
* there because the `alt` already says it. Without a usable logo the name
|
|
753
|
+
* and the number are plain readable text. `showNumber={false}` drops the
|
|
754
|
+
* visible caption (the `alt` keeps the number).
|
|
755
|
+
* - `url` links only when it is http(s), in a new window with
|
|
756
|
+
* `rel="noopener noreferrer"` and a visually hidden new-window hint.
|
|
757
|
+
* - `null`, `undefined`, a non-array, or a list without a named
|
|
758
|
+
* consumer-arbitration badge render NOTHING.
|
|
759
|
+
*/
|
|
760
|
+
interface ArbitrationBadgeProps {
|
|
761
|
+
/** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
|
|
762
|
+
badges: readonly TrustBadge[] | null | undefined;
|
|
763
|
+
/** Wording before the number, in the alt text and the caption. @default 'N.º de adhesión' */
|
|
764
|
+
numberLabel?: string;
|
|
765
|
+
/** Show the number as visible text under the logo. @default true */
|
|
766
|
+
showNumber?: boolean;
|
|
767
|
+
/** Visually hidden text appended to a linked badge. */
|
|
768
|
+
newWindowLabel?: string;
|
|
769
|
+
/** Classes for the root `<ul>`. */
|
|
770
|
+
className?: string;
|
|
771
|
+
/** Classes added to the logo `<img>` (default `h-16 w-auto object-contain`). */
|
|
772
|
+
logoClassName?: string;
|
|
773
|
+
/** Classes for the number caption. */
|
|
774
|
+
numberClassName?: string;
|
|
775
|
+
}
|
|
776
|
+
declare function ArbitrationBadge({ badges, numberLabel, showNumber, newWindowLabel, className, logoClassName, numberClassName, }: ArbitrationBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
777
|
+
|
|
730
778
|
/**
|
|
731
779
|
* REB-850 — `PageBlocks`: the shared renderer for a page's registry blocks
|
|
732
780
|
* (`PageDetail.blocks`, REB-75), so a SITE stops hand-writing its own.
|
|
@@ -1499,6 +1547,198 @@ interface FullInvoiceFieldsProps {
|
|
|
1499
1547
|
}
|
|
1500
1548
|
declare function FullInvoiceFields({ value, onChange, overCap, issuesInvoices, errors, countries, labels, className, }: FullInvoiceFieldsProps): react_jsx_runtime.JSX.Element | null;
|
|
1501
1549
|
|
|
1550
|
+
/** The shipping address fields the buyer types (country defaults server-side). */
|
|
1551
|
+
interface CheckoutAddressValue {
|
|
1552
|
+
firstName: string;
|
|
1553
|
+
lastName: string;
|
|
1554
|
+
street: string;
|
|
1555
|
+
postalCode: string;
|
|
1556
|
+
city: string;
|
|
1557
|
+
region: string;
|
|
1558
|
+
}
|
|
1559
|
+
type CheckoutAddressErrors = Partial<Record<keyof CheckoutAddressValue, string>>;
|
|
1560
|
+
declare const EMPTY_CHECKOUT_ADDRESS: CheckoutAddressValue;
|
|
1561
|
+
/** SDK texts of {@link CheckoutDeliveryChoice}; the option names come from the tenant. */
|
|
1562
|
+
interface CheckoutDeliveryChoiceLabels {
|
|
1563
|
+
legend: string;
|
|
1564
|
+
free: string;
|
|
1565
|
+
pickupPointsLegend: string;
|
|
1566
|
+
addressLegend: string;
|
|
1567
|
+
firstName: string;
|
|
1568
|
+
lastName: string;
|
|
1569
|
+
street: string;
|
|
1570
|
+
postalCode: string;
|
|
1571
|
+
city: string;
|
|
1572
|
+
region: string;
|
|
1573
|
+
}
|
|
1574
|
+
declare const DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS: CheckoutDeliveryChoiceLabels;
|
|
1575
|
+
interface CheckoutDeliveryChoiceProps {
|
|
1576
|
+
/** `ShopConfig.delivery`. */
|
|
1577
|
+
delivery: ShopCheckoutDeliveryConfig;
|
|
1578
|
+
/** `ShopConfig.checkout` — the tenant's option names. */
|
|
1579
|
+
copy: Pick<ShopCheckoutCopy, 'shippingOptionLabel' | 'pickupOptionLabel'>;
|
|
1580
|
+
/** The current choice; start from {@link defaultCheckoutFulfillment}. */
|
|
1581
|
+
value: ShopFulfillmentInput | null;
|
|
1582
|
+
onChange: (value: ShopFulfillmentInput) => void;
|
|
1583
|
+
address: CheckoutAddressValue;
|
|
1584
|
+
onAddressChange: (value: CheckoutAddressValue) => void;
|
|
1585
|
+
addressErrors?: CheckoutAddressErrors;
|
|
1586
|
+
/** A delivery error from checkout or the quote (e.g. `PICKUP_LOCATION_INVALID`). */
|
|
1587
|
+
error?: string | null;
|
|
1588
|
+
/** The last quote: its home delivery cost wins over the flat cost (free over the threshold). */
|
|
1589
|
+
quote?: Pick<ShopQuote, 'fulfillment' | 'shipping'> | null;
|
|
1590
|
+
/** `false` for a cart with nothing to ship (see {@link quoteRequiresDelivery}): renders nothing. */
|
|
1591
|
+
requiresDelivery?: boolean;
|
|
1592
|
+
labels?: Partial<CheckoutDeliveryChoiceLabels>;
|
|
1593
|
+
currencyCode?: string;
|
|
1594
|
+
locale?: string;
|
|
1595
|
+
/** Prefix of the element ids and radio names (one choice per page). @default 'checkout-delivery' */
|
|
1596
|
+
id?: string;
|
|
1597
|
+
className?: string;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* `CheckoutDeliveryChoice` (REB-1197) — how the order reaches the buyer,
|
|
1601
|
+
* chosen before paying: home delivery (with the shipping address, stored on
|
|
1602
|
+
* the order) or free pickup at one of the tenant's pickup points. Only the
|
|
1603
|
+
* methods the tenant offers (`ShopConfig.delivery.methods`) are shown, with
|
|
1604
|
+
* the tenant's names; home delivery shows its cost and the estimated delivery
|
|
1605
|
+
* term; each pickup point its address, opening hours and ready-in text, all
|
|
1606
|
+
* edited in nexus. Fully controlled, no hooks (RSC-safe root entry); send {@link toCheckoutFulfillmentFields}
|
|
1607
|
+
* with the quote and the checkout body. Place it inside the checkout `<form>`
|
|
1608
|
+
* (the address fields are `required`).
|
|
1609
|
+
*/
|
|
1610
|
+
declare function CheckoutDeliveryChoice({ delivery, copy, value, onChange, address, onAddressChange, addressErrors, error, quote, requiresDelivery, labels, currencyCode, locale, id: uid, className, }: CheckoutDeliveryChoiceProps): react_jsx_runtime.JSX.Element | null;
|
|
1611
|
+
/**
|
|
1612
|
+
* The starting choice: home delivery when offered, else pickup (with the
|
|
1613
|
+
* point preselected when there is only one). `null` when the tenant offers
|
|
1614
|
+
* neither, or against an API that predates the delivery config.
|
|
1615
|
+
*/
|
|
1616
|
+
declare function defaultCheckoutFulfillment(delivery: ShopCheckoutDeliveryConfig | null | undefined): ShopFulfillmentInput | null;
|
|
1617
|
+
/** Whether the cart has something to deliver; `true` until a quote says otherwise. */
|
|
1618
|
+
declare function quoteRequiresDelivery(quote: Pick<ShopQuote, 'lines'> | null | undefined): boolean;
|
|
1619
|
+
/**
|
|
1620
|
+
* The quote and checkout body fields for the delivery choice. Home delivery
|
|
1621
|
+
* carries the address (blank optional fields left out); pickup the point. With
|
|
1622
|
+
* no choice (a cart with nothing to ship) it still sends home delivery: the
|
|
1623
|
+
* server records no delivery for such a cart, and the request stays on the
|
|
1624
|
+
* current contract (REB-1227).
|
|
1625
|
+
*
|
|
1626
|
+
* Pass `requiresDelivery` (`quoteRequiresDelivery(quote)`): when the cart
|
|
1627
|
+
* ships nothing the choice block is hidden and the address stays blank, so no
|
|
1628
|
+
* address and no pickup point are sent — a blank address is refused by the
|
|
1629
|
+
* server (400 INVALID_INPUT) and pickup of nothing is refused too.
|
|
1630
|
+
*/
|
|
1631
|
+
declare function toCheckoutFulfillmentFields(value: ShopFulfillmentInput | null, address: CheckoutAddressValue, requiresDelivery?: boolean): Pick<ShopCheckoutInput, 'fulfillment' | 'shippingAddress'>;
|
|
1632
|
+
|
|
1633
|
+
/** SDK texts of {@link CheckoutQuoteSummary}; the tenant's own ones come in the quote. */
|
|
1634
|
+
interface CheckoutQuoteSummaryLabels {
|
|
1635
|
+
subtotal: string;
|
|
1636
|
+
/** The discount row: its tenant label when automatic, else the code. */
|
|
1637
|
+
discount: (codeOrLabel: string, isAutomatic: boolean) => string;
|
|
1638
|
+
free: string;
|
|
1639
|
+
/** Fallback delivery row name when the quote carries no label. */
|
|
1640
|
+
delivery: string;
|
|
1641
|
+
remainingForFree: (formattedAmount: string) => string;
|
|
1642
|
+
/** A tax row when prices include it («De los cuales IGIC 7 %»). */
|
|
1643
|
+
taxIncluded: (taxLabel: string) => string;
|
|
1644
|
+
total: string;
|
|
1645
|
+
/** Under the total when prices include tax. */
|
|
1646
|
+
taxesIncludedNote: string;
|
|
1647
|
+
quantityTimesUnit: (quantity: number, formattedUnitPrice: string) => string;
|
|
1648
|
+
}
|
|
1649
|
+
declare const DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS: CheckoutQuoteSummaryLabels;
|
|
1650
|
+
interface CheckoutQuoteSummaryProps {
|
|
1651
|
+
/** `useShopQuote().quote` / `client.shop.quote()` — the total Stripe charges. */
|
|
1652
|
+
quote: ShopQuote;
|
|
1653
|
+
heading?: ReactNode;
|
|
1654
|
+
headingLevel?: HeadingLevel;
|
|
1655
|
+
labels?: Partial<CheckoutQuoteSummaryLabels>;
|
|
1656
|
+
/** @default 'EUR' */
|
|
1657
|
+
currencyCode?: string;
|
|
1658
|
+
/** @default 'es-ES' */
|
|
1659
|
+
locale?: string;
|
|
1660
|
+
className?: string;
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* `CheckoutQuoteSummary` (REB-1197) — the pre-payment summary of the
|
|
1664
|
+
* single-step checkout, rendered from `ShopQuote`: every line with its kind,
|
|
1665
|
+
* quantity and unit price; subtotal; discount; the delivery row (home
|
|
1666
|
+
* delivery cost or «Gratis», or the pickup point); the tax rows the tenant
|
|
1667
|
+
* shows; the total; the estimated delivery term. The amount is exactly what
|
|
1668
|
+
* Stripe charges (the API prices quote and checkout with one function).
|
|
1669
|
+
* Announces why a typed code was not applied (`role=status`) and why the
|
|
1670
|
+
* order cannot be paid (`role=alert`, e.g. over the max weight).
|
|
1671
|
+
*
|
|
1672
|
+
* Presentational and RSC-safe. Tenant texts (delivery labels, tax labels,
|
|
1673
|
+
* line kinds, the estimate) come from the API; `labels` replaces the rest.
|
|
1674
|
+
*/
|
|
1675
|
+
declare function CheckoutQuoteSummary({ quote, heading, headingLevel, labels, currencyCode, locale, className, }: CheckoutQuoteSummaryProps): react_jsx_runtime.JSX.Element;
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* `CheckoutTermsAcceptance` (REB-1198) — the mandatory, unticked box «He leído
|
|
1679
|
+
* y acepto las {terms} de {tenant}» of the single-step checkout. Every text is
|
|
1680
|
+
* the tenant's (`ShopConfig.checkout`, edited in nexus › Configuración ›
|
|
1681
|
+
* Legal): `{terms}` becomes the link to the full document (text
|
|
1682
|
+
* `termsLinkText`, target `termsLinkUrl` or the SITE's own `termsHref`, a new
|
|
1683
|
+
* tab when `isTermsLinkNewTab`), `{tenant}` the site name. A label without
|
|
1684
|
+
* `{terms}` gets the link appended.
|
|
1685
|
+
*
|
|
1686
|
+
* Renders nothing while the tenant has published no terms
|
|
1687
|
+
* (`termsVersion: null`): there is nothing to accept and checkout does not
|
|
1688
|
+
* ask. Send {@link toCheckoutTermsFields} with the checkout body; the server
|
|
1689
|
+
* refuses without it (`TERMS_NOT_ACCEPTED`) or with an old version
|
|
1690
|
+
* (`TERMS_VERSION_CHANGED`: reload the config and ask again).
|
|
1691
|
+
*/
|
|
1692
|
+
type CheckoutTermsCopy = Pick<ShopCheckoutCopy, 'tenantName' | 'termsCheckboxLabel' | 'termsLinkText' | 'termsLinkUrl' | 'isTermsLinkNewTab' | 'termsVersion'>;
|
|
1693
|
+
interface CheckoutTermsAcceptanceProps {
|
|
1694
|
+
copy: CheckoutTermsCopy;
|
|
1695
|
+
/** The SITE's route to its terms page, used when the tenant set no `termsLinkUrl`. */
|
|
1696
|
+
termsHref: string;
|
|
1697
|
+
checked: boolean;
|
|
1698
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1699
|
+
/** E.g. «Debes aceptar las condiciones para continuar.» (the SITE's or the API's text). */
|
|
1700
|
+
error?: string | null;
|
|
1701
|
+
/** Appended inside the link when it opens a new tab (screen readers). @default '(se abre en una pestaña nueva)' */
|
|
1702
|
+
newTabHint?: string;
|
|
1703
|
+
/** The checkbox id (one box per page). @default 'checkout-terms' */
|
|
1704
|
+
id?: string;
|
|
1705
|
+
className?: string;
|
|
1706
|
+
}
|
|
1707
|
+
declare function CheckoutTermsAcceptance({ copy, termsHref, checked, onCheckedChange, error, newTabHint, id, className, }: CheckoutTermsAcceptanceProps): react_jsx_runtime.JSX.Element | null;
|
|
1708
|
+
/**
|
|
1709
|
+
* The checkout body fields for the terms box: `acceptsTerms` and the version
|
|
1710
|
+
* shown (`termsVersionId`), or nothing when the tenant published no terms.
|
|
1711
|
+
*/
|
|
1712
|
+
declare function toCheckoutTermsFields(copy: Pick<ShopCheckoutCopy, 'termsVersion'> | null | undefined, accepted: boolean): Pick<ShopCheckoutInput, 'acceptsTerms' | 'termsVersionId'>;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* `CheckoutPayAction` (REB-1198) — the last control of the single-step
|
|
1716
|
+
* checkout: the submit button (`ShopCheckoutCopy.continueToPaymentLabel`,
|
|
1717
|
+
* «Continuar al pago») and, right under it and readable (lawyer, 3-Nov: no
|
|
1718
|
+
* tiny text), the notice with the amount (`ShopQuote.payNotice`, «En el
|
|
1719
|
+
* siguiente paso pagarás {total} en la pasarela segura de Stripe…», already
|
|
1720
|
+
* filled). The button is described by the notice, so a screen reader hears
|
|
1721
|
+
* both. Place it inside the checkout `<form>`.
|
|
1722
|
+
*/
|
|
1723
|
+
interface CheckoutPayActionProps {
|
|
1724
|
+
/** The tenant's button text: `ShopCheckoutCopy.continueToPaymentLabel`. */
|
|
1725
|
+
label: string;
|
|
1726
|
+
/** The tenant's small print: `ShopQuote.payNotice`. Omit while there is no quote. */
|
|
1727
|
+
notice?: string | null;
|
|
1728
|
+
submitting?: boolean;
|
|
1729
|
+
/** Shown on the button while `submitting`. @default 'Procesando…' */
|
|
1730
|
+
submittingLabel?: string;
|
|
1731
|
+
disabled?: boolean;
|
|
1732
|
+
/** Prefix of the element ids (one action per page). @default 'checkout-pay' */
|
|
1733
|
+
id?: string;
|
|
1734
|
+
className?: string;
|
|
1735
|
+
/** Classes for the button; REPLACE the default look. */
|
|
1736
|
+
buttonClassName?: string;
|
|
1737
|
+
/** Classes for the notice; REPLACE the default `text-sm text-muted-foreground`. */
|
|
1738
|
+
noticeClassName?: string;
|
|
1739
|
+
}
|
|
1740
|
+
declare function CheckoutPayAction({ label, notice, submitting, submittingLabel, disabled, id, className, buttonClassName, noticeClassName, }: CheckoutPayActionProps): react_jsx_runtime.JSX.Element;
|
|
1741
|
+
|
|
1502
1742
|
/**
|
|
1503
1743
|
* `ContactInterestField` — the contact form's tenant-configurable interest
|
|
1504
1744
|
* question, drop-in (REB-759). Fully controlled (`value`/`onChange`), no hooks,
|
|
@@ -1548,4 +1788,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1548
1788
|
}
|
|
1549
1789
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1550
1790
|
|
|
1551
|
-
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, 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, HeadingLevel, LegalDocument, type LegalDocumentProps, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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 };
|
|
1791
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, ArbitrationBadge, type ArbitrationBadgeProps, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAddressErrors, type CheckoutAddressValue, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutDeliveryChoice, type CheckoutDeliveryChoiceLabels, type CheckoutDeliveryChoiceProps, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CheckoutPayAction, type CheckoutPayActionProps, CheckoutQuoteSummary, type CheckoutQuoteSummaryLabels, type CheckoutQuoteSummaryProps, CheckoutTermsAcceptance, type CheckoutTermsAcceptanceProps, type CheckoutTermsCopy, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS, DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, 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_CHECKOUT_ADDRESS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LegalDocument, type LegalDocumentProps, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, defaultCheckoutFulfillment, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, quoteRequiresDelivery, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutFulfillmentFields, toCheckoutInvoiceFields, toCheckoutTermsFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
1
|
+
import { ShopErrorCode, AcademyCourseDetail, AcademyLessonPreview, PageDetail, PageListItem, ProfessionalField, ShopProductListItem, ShopProductTrustIcon, ShopProductTrustItem, TrustBadgeType, TrustBadge, BlockType, PageBlock, ResolvedEmbed, ShopFacets, AcademyInstructorPublic, AcademyCategoryPublic, AcademyCatalogFiltersPublic, ShopStaffAutoDiscount, ShopOrder, ShopBillingInput, ShopCheckoutInput, ShopCheckoutDeliveryConfig, ShopCheckoutCopy, ShopFulfillmentInput, ShopQuote, Config, ShopOrderInvoice } from '@reblu/site-contracts';
|
|
2
2
|
export { DATA_REQUEST_TYPES } from '@reblu/site-contracts';
|
|
3
3
|
import { FaqItem } from './seo.js';
|
|
4
4
|
export { FaqPageJsonLd, MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText } from './seo.js';
|
|
@@ -669,7 +669,8 @@ declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLev
|
|
|
669
669
|
* - Badges are grouped by type (in {@link DEFAULT_TRUST_BADGE_TYPE_ORDER}, or
|
|
670
670
|
* the `types` prop), each group under an overridable heading, and ordered by
|
|
671
671
|
* `sortOrder` inside it.
|
|
672
|
-
* - A logo is an `<img>` whose `alt` is the badge name
|
|
672
|
+
* - A logo is an `<img>` whose `alt` is the badge name (plus its adhesion
|
|
673
|
+
* number when it has one, REB-1201), rendered only when its
|
|
673
674
|
* URL is http(s) or root-relative (REB-1002); a badge without a usable logo
|
|
674
675
|
* shows its name as text.
|
|
675
676
|
* - `heading` (optional) wraps everything in a `<section>` labelled by it
|
|
@@ -682,14 +683,22 @@ declare function FaqAccordion({ items, heading, headingLevel, questionHeadingLev
|
|
|
682
683
|
*/
|
|
683
684
|
/** Default group heading per badge type. Override any of them with `headings`. */
|
|
684
685
|
declare const DEFAULT_TRUST_BADGE_HEADINGS: Readonly<Record<TrustBadgeType, string>>;
|
|
685
|
-
/**
|
|
686
|
+
/**
|
|
687
|
+
* Default order of the groups. CONSUMER_ARBITRATION is deliberately absent
|
|
688
|
+
* (REB-1201): it has its own footer drop-in, `ArbitrationBadge`, so a footer
|
|
689
|
+
* rendering both never shows it twice. Opt in with `types` to group it here.
|
|
690
|
+
*/
|
|
686
691
|
declare const DEFAULT_TRUST_BADGE_TYPE_ORDER: readonly TrustBadgeType[];
|
|
687
692
|
interface TrustBadgesProps {
|
|
688
693
|
/** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
|
|
689
694
|
badges: readonly TrustBadge[] | null | undefined;
|
|
690
695
|
/** Per-type heading overrides; `null` renders that group without a heading. */
|
|
691
696
|
headings?: Partial<Record<TrustBadgeType, string | null>>;
|
|
692
|
-
/**
|
|
697
|
+
/**
|
|
698
|
+
* Which groups to render, in this order. Defaults to
|
|
699
|
+
* {@link DEFAULT_TRUST_BADGE_TYPE_ORDER} (every type except
|
|
700
|
+
* `CONSUMER_ARBITRATION`, which `ArbitrationBadge` renders).
|
|
701
|
+
*/
|
|
693
702
|
types?: readonly TrustBadgeType[];
|
|
694
703
|
/**
|
|
695
704
|
* Optional section title, e.g. «Nos avalan». When given, the root is a
|
|
@@ -727,6 +736,45 @@ interface TrustBadgesProps {
|
|
|
727
736
|
}
|
|
728
737
|
declare function TrustBadges({ badges, headings, types, heading, headingId, headingLevel, newWindowLabel, className, groupClassName, headingClassName, sectionHeadingClassName, listClassName, logoClassName, }: TrustBadgesProps): react_jsx_runtime.JSX.Element | null;
|
|
729
738
|
|
|
739
|
+
/**
|
|
740
|
+
* `ArbitrationBadge` — the tenant's consumer-arbitration distinctive (trust
|
|
741
|
+
* badge of type `CONSUMER_ARBITRATION`, set up in nexus › Trust badges with
|
|
742
|
+
* its logo, adhesion number and optional link) for the SITE footer (REB-1201).
|
|
743
|
+
* Pass `client.trustBadges.list()`'s `data` as is — every other type is
|
|
744
|
+
* ignored, so the same list can feed `TrustBadges` next to it.
|
|
745
|
+
*
|
|
746
|
+
* Server Component, RSC-safe: no hooks, no state, no `'use client'`.
|
|
747
|
+
*
|
|
748
|
+
* Visible and accessible:
|
|
749
|
+
* - The logo is an `<img>` at `h-16` by default (not a tiny icon) whose `alt`
|
|
750
|
+
* is the badge name plus the adhesion number («… N.º de adhesión CA00000»).
|
|
751
|
+
* - The number is also shown as visible text under the logo, `aria-hidden`
|
|
752
|
+
* there because the `alt` already says it. Without a usable logo the name
|
|
753
|
+
* and the number are plain readable text. `showNumber={false}` drops the
|
|
754
|
+
* visible caption (the `alt` keeps the number).
|
|
755
|
+
* - `url` links only when it is http(s), in a new window with
|
|
756
|
+
* `rel="noopener noreferrer"` and a visually hidden new-window hint.
|
|
757
|
+
* - `null`, `undefined`, a non-array, or a list without a named
|
|
758
|
+
* consumer-arbitration badge render NOTHING.
|
|
759
|
+
*/
|
|
760
|
+
interface ArbitrationBadgeProps {
|
|
761
|
+
/** `client.trustBadges.list()`'s `data` as served — may be `null` / `undefined`. */
|
|
762
|
+
badges: readonly TrustBadge[] | null | undefined;
|
|
763
|
+
/** Wording before the number, in the alt text and the caption. @default 'N.º de adhesión' */
|
|
764
|
+
numberLabel?: string;
|
|
765
|
+
/** Show the number as visible text under the logo. @default true */
|
|
766
|
+
showNumber?: boolean;
|
|
767
|
+
/** Visually hidden text appended to a linked badge. */
|
|
768
|
+
newWindowLabel?: string;
|
|
769
|
+
/** Classes for the root `<ul>`. */
|
|
770
|
+
className?: string;
|
|
771
|
+
/** Classes added to the logo `<img>` (default `h-16 w-auto object-contain`). */
|
|
772
|
+
logoClassName?: string;
|
|
773
|
+
/** Classes for the number caption. */
|
|
774
|
+
numberClassName?: string;
|
|
775
|
+
}
|
|
776
|
+
declare function ArbitrationBadge({ badges, numberLabel, showNumber, newWindowLabel, className, logoClassName, numberClassName, }: ArbitrationBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
777
|
+
|
|
730
778
|
/**
|
|
731
779
|
* REB-850 — `PageBlocks`: the shared renderer for a page's registry blocks
|
|
732
780
|
* (`PageDetail.blocks`, REB-75), so a SITE stops hand-writing its own.
|
|
@@ -1499,6 +1547,198 @@ interface FullInvoiceFieldsProps {
|
|
|
1499
1547
|
}
|
|
1500
1548
|
declare function FullInvoiceFields({ value, onChange, overCap, issuesInvoices, errors, countries, labels, className, }: FullInvoiceFieldsProps): react_jsx_runtime.JSX.Element | null;
|
|
1501
1549
|
|
|
1550
|
+
/** The shipping address fields the buyer types (country defaults server-side). */
|
|
1551
|
+
interface CheckoutAddressValue {
|
|
1552
|
+
firstName: string;
|
|
1553
|
+
lastName: string;
|
|
1554
|
+
street: string;
|
|
1555
|
+
postalCode: string;
|
|
1556
|
+
city: string;
|
|
1557
|
+
region: string;
|
|
1558
|
+
}
|
|
1559
|
+
type CheckoutAddressErrors = Partial<Record<keyof CheckoutAddressValue, string>>;
|
|
1560
|
+
declare const EMPTY_CHECKOUT_ADDRESS: CheckoutAddressValue;
|
|
1561
|
+
/** SDK texts of {@link CheckoutDeliveryChoice}; the option names come from the tenant. */
|
|
1562
|
+
interface CheckoutDeliveryChoiceLabels {
|
|
1563
|
+
legend: string;
|
|
1564
|
+
free: string;
|
|
1565
|
+
pickupPointsLegend: string;
|
|
1566
|
+
addressLegend: string;
|
|
1567
|
+
firstName: string;
|
|
1568
|
+
lastName: string;
|
|
1569
|
+
street: string;
|
|
1570
|
+
postalCode: string;
|
|
1571
|
+
city: string;
|
|
1572
|
+
region: string;
|
|
1573
|
+
}
|
|
1574
|
+
declare const DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS: CheckoutDeliveryChoiceLabels;
|
|
1575
|
+
interface CheckoutDeliveryChoiceProps {
|
|
1576
|
+
/** `ShopConfig.delivery`. */
|
|
1577
|
+
delivery: ShopCheckoutDeliveryConfig;
|
|
1578
|
+
/** `ShopConfig.checkout` — the tenant's option names. */
|
|
1579
|
+
copy: Pick<ShopCheckoutCopy, 'shippingOptionLabel' | 'pickupOptionLabel'>;
|
|
1580
|
+
/** The current choice; start from {@link defaultCheckoutFulfillment}. */
|
|
1581
|
+
value: ShopFulfillmentInput | null;
|
|
1582
|
+
onChange: (value: ShopFulfillmentInput) => void;
|
|
1583
|
+
address: CheckoutAddressValue;
|
|
1584
|
+
onAddressChange: (value: CheckoutAddressValue) => void;
|
|
1585
|
+
addressErrors?: CheckoutAddressErrors;
|
|
1586
|
+
/** A delivery error from checkout or the quote (e.g. `PICKUP_LOCATION_INVALID`). */
|
|
1587
|
+
error?: string | null;
|
|
1588
|
+
/** The last quote: its home delivery cost wins over the flat cost (free over the threshold). */
|
|
1589
|
+
quote?: Pick<ShopQuote, 'fulfillment' | 'shipping'> | null;
|
|
1590
|
+
/** `false` for a cart with nothing to ship (see {@link quoteRequiresDelivery}): renders nothing. */
|
|
1591
|
+
requiresDelivery?: boolean;
|
|
1592
|
+
labels?: Partial<CheckoutDeliveryChoiceLabels>;
|
|
1593
|
+
currencyCode?: string;
|
|
1594
|
+
locale?: string;
|
|
1595
|
+
/** Prefix of the element ids and radio names (one choice per page). @default 'checkout-delivery' */
|
|
1596
|
+
id?: string;
|
|
1597
|
+
className?: string;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* `CheckoutDeliveryChoice` (REB-1197) — how the order reaches the buyer,
|
|
1601
|
+
* chosen before paying: home delivery (with the shipping address, stored on
|
|
1602
|
+
* the order) or free pickup at one of the tenant's pickup points. Only the
|
|
1603
|
+
* methods the tenant offers (`ShopConfig.delivery.methods`) are shown, with
|
|
1604
|
+
* the tenant's names; home delivery shows its cost and the estimated delivery
|
|
1605
|
+
* term; each pickup point its address, opening hours and ready-in text, all
|
|
1606
|
+
* edited in nexus. Fully controlled, no hooks (RSC-safe root entry); send {@link toCheckoutFulfillmentFields}
|
|
1607
|
+
* with the quote and the checkout body. Place it inside the checkout `<form>`
|
|
1608
|
+
* (the address fields are `required`).
|
|
1609
|
+
*/
|
|
1610
|
+
declare function CheckoutDeliveryChoice({ delivery, copy, value, onChange, address, onAddressChange, addressErrors, error, quote, requiresDelivery, labels, currencyCode, locale, id: uid, className, }: CheckoutDeliveryChoiceProps): react_jsx_runtime.JSX.Element | null;
|
|
1611
|
+
/**
|
|
1612
|
+
* The starting choice: home delivery when offered, else pickup (with the
|
|
1613
|
+
* point preselected when there is only one). `null` when the tenant offers
|
|
1614
|
+
* neither, or against an API that predates the delivery config.
|
|
1615
|
+
*/
|
|
1616
|
+
declare function defaultCheckoutFulfillment(delivery: ShopCheckoutDeliveryConfig | null | undefined): ShopFulfillmentInput | null;
|
|
1617
|
+
/** Whether the cart has something to deliver; `true` until a quote says otherwise. */
|
|
1618
|
+
declare function quoteRequiresDelivery(quote: Pick<ShopQuote, 'lines'> | null | undefined): boolean;
|
|
1619
|
+
/**
|
|
1620
|
+
* The quote and checkout body fields for the delivery choice. Home delivery
|
|
1621
|
+
* carries the address (blank optional fields left out); pickup the point. With
|
|
1622
|
+
* no choice (a cart with nothing to ship) it still sends home delivery: the
|
|
1623
|
+
* server records no delivery for such a cart, and the request stays on the
|
|
1624
|
+
* current contract (REB-1227).
|
|
1625
|
+
*
|
|
1626
|
+
* Pass `requiresDelivery` (`quoteRequiresDelivery(quote)`): when the cart
|
|
1627
|
+
* ships nothing the choice block is hidden and the address stays blank, so no
|
|
1628
|
+
* address and no pickup point are sent — a blank address is refused by the
|
|
1629
|
+
* server (400 INVALID_INPUT) and pickup of nothing is refused too.
|
|
1630
|
+
*/
|
|
1631
|
+
declare function toCheckoutFulfillmentFields(value: ShopFulfillmentInput | null, address: CheckoutAddressValue, requiresDelivery?: boolean): Pick<ShopCheckoutInput, 'fulfillment' | 'shippingAddress'>;
|
|
1632
|
+
|
|
1633
|
+
/** SDK texts of {@link CheckoutQuoteSummary}; the tenant's own ones come in the quote. */
|
|
1634
|
+
interface CheckoutQuoteSummaryLabels {
|
|
1635
|
+
subtotal: string;
|
|
1636
|
+
/** The discount row: its tenant label when automatic, else the code. */
|
|
1637
|
+
discount: (codeOrLabel: string, isAutomatic: boolean) => string;
|
|
1638
|
+
free: string;
|
|
1639
|
+
/** Fallback delivery row name when the quote carries no label. */
|
|
1640
|
+
delivery: string;
|
|
1641
|
+
remainingForFree: (formattedAmount: string) => string;
|
|
1642
|
+
/** A tax row when prices include it («De los cuales IGIC 7 %»). */
|
|
1643
|
+
taxIncluded: (taxLabel: string) => string;
|
|
1644
|
+
total: string;
|
|
1645
|
+
/** Under the total when prices include tax. */
|
|
1646
|
+
taxesIncludedNote: string;
|
|
1647
|
+
quantityTimesUnit: (quantity: number, formattedUnitPrice: string) => string;
|
|
1648
|
+
}
|
|
1649
|
+
declare const DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS: CheckoutQuoteSummaryLabels;
|
|
1650
|
+
interface CheckoutQuoteSummaryProps {
|
|
1651
|
+
/** `useShopQuote().quote` / `client.shop.quote()` — the total Stripe charges. */
|
|
1652
|
+
quote: ShopQuote;
|
|
1653
|
+
heading?: ReactNode;
|
|
1654
|
+
headingLevel?: HeadingLevel;
|
|
1655
|
+
labels?: Partial<CheckoutQuoteSummaryLabels>;
|
|
1656
|
+
/** @default 'EUR' */
|
|
1657
|
+
currencyCode?: string;
|
|
1658
|
+
/** @default 'es-ES' */
|
|
1659
|
+
locale?: string;
|
|
1660
|
+
className?: string;
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* `CheckoutQuoteSummary` (REB-1197) — the pre-payment summary of the
|
|
1664
|
+
* single-step checkout, rendered from `ShopQuote`: every line with its kind,
|
|
1665
|
+
* quantity and unit price; subtotal; discount; the delivery row (home
|
|
1666
|
+
* delivery cost or «Gratis», or the pickup point); the tax rows the tenant
|
|
1667
|
+
* shows; the total; the estimated delivery term. The amount is exactly what
|
|
1668
|
+
* Stripe charges (the API prices quote and checkout with one function).
|
|
1669
|
+
* Announces why a typed code was not applied (`role=status`) and why the
|
|
1670
|
+
* order cannot be paid (`role=alert`, e.g. over the max weight).
|
|
1671
|
+
*
|
|
1672
|
+
* Presentational and RSC-safe. Tenant texts (delivery labels, tax labels,
|
|
1673
|
+
* line kinds, the estimate) come from the API; `labels` replaces the rest.
|
|
1674
|
+
*/
|
|
1675
|
+
declare function CheckoutQuoteSummary({ quote, heading, headingLevel, labels, currencyCode, locale, className, }: CheckoutQuoteSummaryProps): react_jsx_runtime.JSX.Element;
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* `CheckoutTermsAcceptance` (REB-1198) — the mandatory, unticked box «He leído
|
|
1679
|
+
* y acepto las {terms} de {tenant}» of the single-step checkout. Every text is
|
|
1680
|
+
* the tenant's (`ShopConfig.checkout`, edited in nexus › Configuración ›
|
|
1681
|
+
* Legal): `{terms}` becomes the link to the full document (text
|
|
1682
|
+
* `termsLinkText`, target `termsLinkUrl` or the SITE's own `termsHref`, a new
|
|
1683
|
+
* tab when `isTermsLinkNewTab`), `{tenant}` the site name. A label without
|
|
1684
|
+
* `{terms}` gets the link appended.
|
|
1685
|
+
*
|
|
1686
|
+
* Renders nothing while the tenant has published no terms
|
|
1687
|
+
* (`termsVersion: null`): there is nothing to accept and checkout does not
|
|
1688
|
+
* ask. Send {@link toCheckoutTermsFields} with the checkout body; the server
|
|
1689
|
+
* refuses without it (`TERMS_NOT_ACCEPTED`) or with an old version
|
|
1690
|
+
* (`TERMS_VERSION_CHANGED`: reload the config and ask again).
|
|
1691
|
+
*/
|
|
1692
|
+
type CheckoutTermsCopy = Pick<ShopCheckoutCopy, 'tenantName' | 'termsCheckboxLabel' | 'termsLinkText' | 'termsLinkUrl' | 'isTermsLinkNewTab' | 'termsVersion'>;
|
|
1693
|
+
interface CheckoutTermsAcceptanceProps {
|
|
1694
|
+
copy: CheckoutTermsCopy;
|
|
1695
|
+
/** The SITE's route to its terms page, used when the tenant set no `termsLinkUrl`. */
|
|
1696
|
+
termsHref: string;
|
|
1697
|
+
checked: boolean;
|
|
1698
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1699
|
+
/** E.g. «Debes aceptar las condiciones para continuar.» (the SITE's or the API's text). */
|
|
1700
|
+
error?: string | null;
|
|
1701
|
+
/** Appended inside the link when it opens a new tab (screen readers). @default '(se abre en una pestaña nueva)' */
|
|
1702
|
+
newTabHint?: string;
|
|
1703
|
+
/** The checkbox id (one box per page). @default 'checkout-terms' */
|
|
1704
|
+
id?: string;
|
|
1705
|
+
className?: string;
|
|
1706
|
+
}
|
|
1707
|
+
declare function CheckoutTermsAcceptance({ copy, termsHref, checked, onCheckedChange, error, newTabHint, id, className, }: CheckoutTermsAcceptanceProps): react_jsx_runtime.JSX.Element | null;
|
|
1708
|
+
/**
|
|
1709
|
+
* The checkout body fields for the terms box: `acceptsTerms` and the version
|
|
1710
|
+
* shown (`termsVersionId`), or nothing when the tenant published no terms.
|
|
1711
|
+
*/
|
|
1712
|
+
declare function toCheckoutTermsFields(copy: Pick<ShopCheckoutCopy, 'termsVersion'> | null | undefined, accepted: boolean): Pick<ShopCheckoutInput, 'acceptsTerms' | 'termsVersionId'>;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* `CheckoutPayAction` (REB-1198) — the last control of the single-step
|
|
1716
|
+
* checkout: the submit button (`ShopCheckoutCopy.continueToPaymentLabel`,
|
|
1717
|
+
* «Continuar al pago») and, right under it and readable (lawyer, 3-Nov: no
|
|
1718
|
+
* tiny text), the notice with the amount (`ShopQuote.payNotice`, «En el
|
|
1719
|
+
* siguiente paso pagarás {total} en la pasarela segura de Stripe…», already
|
|
1720
|
+
* filled). The button is described by the notice, so a screen reader hears
|
|
1721
|
+
* both. Place it inside the checkout `<form>`.
|
|
1722
|
+
*/
|
|
1723
|
+
interface CheckoutPayActionProps {
|
|
1724
|
+
/** The tenant's button text: `ShopCheckoutCopy.continueToPaymentLabel`. */
|
|
1725
|
+
label: string;
|
|
1726
|
+
/** The tenant's small print: `ShopQuote.payNotice`. Omit while there is no quote. */
|
|
1727
|
+
notice?: string | null;
|
|
1728
|
+
submitting?: boolean;
|
|
1729
|
+
/** Shown on the button while `submitting`. @default 'Procesando…' */
|
|
1730
|
+
submittingLabel?: string;
|
|
1731
|
+
disabled?: boolean;
|
|
1732
|
+
/** Prefix of the element ids (one action per page). @default 'checkout-pay' */
|
|
1733
|
+
id?: string;
|
|
1734
|
+
className?: string;
|
|
1735
|
+
/** Classes for the button; REPLACE the default look. */
|
|
1736
|
+
buttonClassName?: string;
|
|
1737
|
+
/** Classes for the notice; REPLACE the default `text-sm text-muted-foreground`. */
|
|
1738
|
+
noticeClassName?: string;
|
|
1739
|
+
}
|
|
1740
|
+
declare function CheckoutPayAction({ label, notice, submitting, submittingLabel, disabled, id, className, buttonClassName, noticeClassName, }: CheckoutPayActionProps): react_jsx_runtime.JSX.Element;
|
|
1741
|
+
|
|
1502
1742
|
/**
|
|
1503
1743
|
* `ContactInterestField` — the contact form's tenant-configurable interest
|
|
1504
1744
|
* question, drop-in (REB-759). Fully controlled (`value`/`onChange`), no hooks,
|
|
@@ -1548,4 +1788,4 @@ interface OrderInvoiceLinkProps {
|
|
|
1548
1788
|
}
|
|
1549
1789
|
declare function OrderInvoiceLink({ invoice, labels, className }: OrderInvoiceLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
1550
1790
|
|
|
1551
|
-
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, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, 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, HeadingLevel, LegalDocument, type LegalDocumentProps, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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 };
|
|
1791
|
+
export { ALLOWED_YOUTUBE_HOSTS, AddedToCartToast, type AddedToCartToastLabels, type AddedToCartToastProps, type AddedToCartToastStatus, ArbitrationBadge, type ArbitrationBadgeProps, type BlockRendererProps, type CanonicalBlockType, type CartAdjustmentLine, CartAdjustmentsNotice, type CartAdjustmentsNoticeLabels, type CartAdjustmentsNoticeProps, type CartLineItemView, CartLineList, type CartLineListLabels, type CartLineListProps, CartSummary, type CartSummaryLabels, type CartSummaryProps, type CheckoutAddressErrors, type CheckoutAddressValue, type CheckoutAppliedDiscount, type CheckoutContactErrors, type CheckoutContactValues, CheckoutDeliveryChoice, type CheckoutDeliveryChoiceLabels, type CheckoutDeliveryChoiceProps, CheckoutForm, type CheckoutFormLabels, type CheckoutFormProps, CheckoutLoginPrompt, type CheckoutLoginPromptLabels, type CheckoutLoginPromptProps, CheckoutPayAction, type CheckoutPayActionProps, CheckoutQuoteSummary, type CheckoutQuoteSummaryLabels, type CheckoutQuoteSummaryProps, CheckoutTermsAcceptance, type CheckoutTermsAcceptanceProps, type CheckoutTermsCopy, type ContactInterest, ContactInterestField, type ContactInterestFieldProps, CourseCatalogFilters, type CourseCatalogFiltersActive, type CourseCatalogFiltersHrefs, type CourseCatalogFiltersLabels, type CourseCatalogFiltersProps, type CourseCatalogPriceBand, CourseDescription, type CourseDescriptionProps, CoursePurchaseTerms, type CoursePurchaseTermsLabels, type CoursePurchaseTermsProps, DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS, DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS, DEFAULT_COURSE_CATALOG_FILTERS_LABELS, DEFAULT_COURSE_PRICE_BANDS, DEFAULT_COURSE_PURCHASE_TERMS_LABELS, DEFAULT_INVOICE_COUNTRIES, DEFAULT_LESSON_PREVIEW_LABELS, 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_CHECKOUT_ADDRESS, EMPTY_FULL_INVOICE_VALUE, FaqAccordion, type FaqAccordionProps, FaqItem, type FullInvoiceErrors, FullInvoiceFields, type FullInvoiceFieldsLabels, type FullInvoiceFieldsProps, type FullInvoiceIdType, type FullInvoiceValue, HeadingLevel, LegalDocument, type LegalDocumentProps, LessonPreview, type LessonPreviewLabels, type LessonPreviewProps, type MarkdownImageOptions, 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, ProfessionalFields, type ProfessionalFieldsProps, 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, defaultCheckoutFulfillment, formatPrice, getShopErrorMessage, isAllowedYouTubeHost, isOverSimplifiedInvoiceCap, markdownToSafeHtml, quoteRequiresDelivery, readingTime, sanitizeHtml, shopIssuesInvoices, shouldRenderShopFilters, toCheckoutFulfillmentFields, toCheckoutInvoiceFields, toCheckoutTermsFields };
|