@reblu/site-blocks 0.26.0 → 0.27.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
@@ -322,8 +322,12 @@ declare function CourseDescription({ description, heading, headingLevel, heading
322
322
  type Guarantee = NonNullable<AcademyCourseDetail['refundGuarantee']>;
323
323
  /** Texts of {@link CoursePurchaseTerms}; replace any of them in the SITE's language. */
324
324
  interface CoursePurchaseTermsLabels {
325
- /** Shown when checkout asks for the withdrawal waiver. */
325
+ /** Shown when checkout asks for the digital-content withdrawal waiver. */
326
326
  withdrawalWaiver: ReactNode;
327
+ /** REB-1240: shown when checkout asks for the express request to start a training service. */
328
+ serviceStartRequest: ReactNode;
329
+ /** REB-1240: the tenant's exact box text, after the line of its kind. */
330
+ consentText: (text: string) => ReactNode;
327
331
  /** Months of access after enrolment. */
328
332
  accessDuration: (months: number) => ReactNode;
329
333
  /** The refund guarantee terms. */
@@ -332,8 +336,10 @@ interface CoursePurchaseTermsLabels {
332
336
  declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
333
337
  /**
334
338
  * `CoursePurchaseTerms` — the drop-in for what a buyer must see before paying
335
- * for a course (`client.academy.bySlug()`), REB-1199:
336
- * `withdrawalWaiverRequired`, `accessDurationMonths` and `refundGuarantee`.
339
+ * for a course (`client.academy.bySlug()`), REB-1199/REB-1240:
340
+ * `withdrawalConsent` (the box the course's modality calls for, with the
341
+ * tenant's text; `withdrawalWaiverRequired` against an API that predates it),
342
+ * `accessDurationMonths` and `refundGuarantee`.
337
343
  *
338
344
  * Server Component, RSC-safe: no hooks, no state, no `'use client'`.
339
345
  *
@@ -343,7 +349,7 @@ declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
343
349
  */
344
350
  interface CoursePurchaseTermsProps {
345
351
  /** The fields of `AcademyCourseDetail` this block reads (all optional). */
346
- course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'accessDurationMonths' | 'refundGuarantee'>>;
352
+ course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'withdrawalConsent' | 'accessDurationMonths' | 'refundGuarantee'>>;
347
353
  /** Optional section heading, e.g. «Antes de comprar». */
348
354
  heading?: ReactNode;
349
355
  /** Level of `heading`. Defaults to `2`. */
package/dist/index.d.ts CHANGED
@@ -322,8 +322,12 @@ declare function CourseDescription({ description, heading, headingLevel, heading
322
322
  type Guarantee = NonNullable<AcademyCourseDetail['refundGuarantee']>;
323
323
  /** Texts of {@link CoursePurchaseTerms}; replace any of them in the SITE's language. */
324
324
  interface CoursePurchaseTermsLabels {
325
- /** Shown when checkout asks for the withdrawal waiver. */
325
+ /** Shown when checkout asks for the digital-content withdrawal waiver. */
326
326
  withdrawalWaiver: ReactNode;
327
+ /** REB-1240: shown when checkout asks for the express request to start a training service. */
328
+ serviceStartRequest: ReactNode;
329
+ /** REB-1240: the tenant's exact box text, after the line of its kind. */
330
+ consentText: (text: string) => ReactNode;
327
331
  /** Months of access after enrolment. */
328
332
  accessDuration: (months: number) => ReactNode;
329
333
  /** The refund guarantee terms. */
@@ -332,8 +336,10 @@ interface CoursePurchaseTermsLabels {
332
336
  declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
333
337
  /**
334
338
  * `CoursePurchaseTerms` — the drop-in for what a buyer must see before paying
335
- * for a course (`client.academy.bySlug()`), REB-1199:
336
- * `withdrawalWaiverRequired`, `accessDurationMonths` and `refundGuarantee`.
339
+ * for a course (`client.academy.bySlug()`), REB-1199/REB-1240:
340
+ * `withdrawalConsent` (the box the course's modality calls for, with the
341
+ * tenant's text; `withdrawalWaiverRequired` against an API that predates it),
342
+ * `accessDurationMonths` and `refundGuarantee`.
337
343
  *
338
344
  * Server Component, RSC-safe: no hooks, no state, no `'use client'`.
339
345
  *
@@ -343,7 +349,7 @@ declare const DEFAULT_COURSE_PURCHASE_TERMS_LABELS: CoursePurchaseTermsLabels;
343
349
  */
344
350
  interface CoursePurchaseTermsProps {
345
351
  /** The fields of `AcademyCourseDetail` this block reads (all optional). */
346
- course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'accessDurationMonths' | 'refundGuarantee'>>;
352
+ course: Partial<Pick<AcademyCourseDetail, 'withdrawalWaiverRequired' | 'withdrawalConsent' | 'accessDurationMonths' | 'refundGuarantee'>>;
347
353
  /** Optional section heading, e.g. «Antes de comprar». */
348
354
  heading?: ReactNode;
349
355
  /** Level of `heading`. Defaults to `2`. */
package/dist/index.js CHANGED
@@ -13473,9 +13473,11 @@ function CourseDescription({
13473
13473
  }
13474
13474
 
13475
13475
  // src/components/course-purchase-terms.tsx
13476
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
13476
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
13477
13477
  var DEFAULT_COURSE_PURCHASE_TERMS_LABELS = {
13478
13478
  withdrawalWaiver: "El acceso empieza al comprar: al pagar pides el acceso inmediato y renuncias al derecho de desistimiento de 14 d\xEDas.",
13479
+ serviceStartRequest: "Al pagar pides expresamente que la formaci\xF3n empiece dentro del plazo de desistimiento de 14 d\xEDas.",
13480
+ consentText: (text3) => ` Texto de la casilla: \xAB${text3}\xBB`,
13479
13481
  accessDuration: (months) => `Acceso durante ${months} ${months === 1 ? "mes" : "meses"} desde la inscripci\xF3n.`,
13480
13482
  refundGuarantee: ({ basis, thresholdPercent, windowDays }) => {
13481
13483
  const period = windowDays != null ? ` durante ${windowDays} d\xEDas desde el pago` : "";
@@ -13496,7 +13498,21 @@ function CoursePurchaseTerms({
13496
13498
  }) {
13497
13499
  const text3 = { ...DEFAULT_COURSE_PURCHASE_TERMS_LABELS, ...labels };
13498
13500
  const items = [];
13499
- if (course.withdrawalWaiverRequired === true) {
13501
+ if (course.withdrawalConsent !== void 0) {
13502
+ const consent = course.withdrawalConsent;
13503
+ if (consent) {
13504
+ const line = consent.kind === "SERVICE_START_REQUEST" ? text3.serviceStartRequest : text3.withdrawalWaiver;
13505
+ items.push({
13506
+ // The waiver keeps its REB-1199 slot (existing SITE styles target it).
13507
+ key: consent.kind === "SERVICE_START_REQUEST" ? "service-start-request" : "withdrawal-waiver",
13508
+ kind: consent.kind,
13509
+ node: /* @__PURE__ */ jsxs3(Fragment2, { children: [
13510
+ line,
13511
+ text3.consentText(consent.text)
13512
+ ] })
13513
+ });
13514
+ }
13515
+ } else if (course.withdrawalWaiverRequired === true) {
13500
13516
  items.push({ key: "withdrawal-waiver", node: text3.withdrawalWaiver });
13501
13517
  }
13502
13518
  if (typeof course.accessDurationMonths === "number") {
@@ -13507,7 +13523,7 @@ function CoursePurchaseTerms({
13507
13523
  }
13508
13524
  if (items.length === 0) return null;
13509
13525
  const hasHeading = heading !== void 0 && heading !== null && heading !== "";
13510
- const list = /* @__PURE__ */ jsx3("ul", { className: slotClassName("list-disc space-y-1 pl-5", "text-sm text-muted-foreground", listClassName), children: items.map((item) => /* @__PURE__ */ jsx3("li", { "data-slot": `course-purchase-terms-${item.key}`, children: item.node }, item.key)) });
13526
+ const list = /* @__PURE__ */ jsx3("ul", { className: slotClassName("list-disc space-y-1 pl-5", "text-sm text-muted-foreground", listClassName), children: items.map((item) => /* @__PURE__ */ jsx3("li", { "data-slot": `course-purchase-terms-${item.key}`, "data-kind": item.kind, children: item.node }, item.key)) });
13511
13527
  const Tag = `h${headingLevel}`;
13512
13528
  return /* @__PURE__ */ jsxs3(
13513
13529
  "section",
@@ -13690,7 +13706,7 @@ import { cn as cn3 } from "@reblu/site-ui/utils";
13690
13706
  // src/components/_page-parts.tsx
13691
13707
  import { cn as cn2 } from "@reblu/site-ui/utils";
13692
13708
  import { buttonVariants } from "@reblu/site-ui/button-variants";
13693
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
13709
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
13694
13710
  var KNOWN_BUTTON_VARIANTS = /* @__PURE__ */ new Set([
13695
13711
  "default",
13696
13712
  "destructive",
@@ -13751,10 +13767,10 @@ function PageSectionBlock({ section }) {
13751
13767
  /* @__PURE__ */ jsx6(SectionCta, { section })
13752
13768
  ] });
13753
13769
  if (sideBySide && hasImages) {
13754
- return /* @__PURE__ */ jsx6("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
13770
+ return /* @__PURE__ */ jsx6("section", { className: "grid items-center gap-8 md:grid-cols-2", children: imageFirst ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
13755
13771
  /* @__PURE__ */ jsx6(SectionImages, { section }),
13756
13772
  body3
13757
- ] }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
13773
+ ] }) : /* @__PURE__ */ jsxs6(Fragment3, { children: [
13758
13774
  body3,
13759
13775
  /* @__PURE__ */ jsx6(SectionImages, { section })
13760
13776
  ] }) });
@@ -15285,7 +15301,7 @@ function AddedToCartToast({
15285
15301
 
15286
15302
  // src/components/checkout-login-prompt.tsx
15287
15303
  import { cn as cn18 } from "@reblu/site-ui/utils";
15288
- import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
15304
+ import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
15289
15305
  var DEFAULT_LABELS6 = {
15290
15306
  title: "Identificaci\xF3n",
15291
15307
  description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
@@ -15312,7 +15328,7 @@ function CheckoutLoginPrompt({
15312
15328
  if (!open) return null;
15313
15329
  const t = { ...DEFAULT_LABELS6, ...labels };
15314
15330
  const isValidEmail = EMAIL_PATTERN.test(email.trim());
15315
- return /* @__PURE__ */ jsxs22(Fragment3, { children: [
15331
+ return /* @__PURE__ */ jsxs22(Fragment4, { children: [
15316
15332
  /* @__PURE__ */ jsx24("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
15317
15333
  /* @__PURE__ */ jsxs22(
15318
15334
  "div",
@@ -15394,7 +15410,7 @@ function CheckoutLoginPrompt({
15394
15410
  // src/components/checkout-form.tsx
15395
15411
  import { cn as cn19 } from "@reblu/site-ui/utils";
15396
15412
  import { PhoneInput } from "@reblu/site-ui/phone-input";
15397
- import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
15413
+ import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
15398
15414
  var DEFAULT_LABELS7 = {
15399
15415
  contactTitle: "Datos de contacto",
15400
15416
  nameLabel: "Nombre completo",
@@ -15450,7 +15466,7 @@ function CheckoutForm({
15450
15466
  event.preventDefault();
15451
15467
  if (discountCode.trim() && !discountApplying) onApplyDiscount();
15452
15468
  }
15453
- return /* @__PURE__ */ jsxs23(Fragment4, { children: [
15469
+ return /* @__PURE__ */ jsxs23(Fragment5, { children: [
15454
15470
  loginPrompt,
15455
15471
  /* @__PURE__ */ jsxs23(
15456
15472
  "form",