@reblu/site-blocks 0.24.0 → 0.25.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @reblu/site-blocks
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1860554: New `CoursePurchaseTerms`: the drop-in for what a buyer must see before paying for a course (REB-1199). It shows the withdrawal waiver, the access duration and the refund guarantee from `AcademyCourseDetail`. Each term renders only when the course carries it; with none, nothing renders. It is a Server Component. The default copy is Spanish and can be replaced with `labels`. Also exports `DEFAULT_COURSE_PURCHASE_TERMS_LABELS`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [1860554]
12
+ - Updated dependencies [82ab415]
13
+ - @reblu/site-contracts@1.25.0
14
+
3
15
  ## 0.24.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -25,6 +25,7 @@ colour on the red background. See `docs/theming/theming.md`.
25
25
  | `sanitizeHtml` | `.` | Sanitises an HTML string before `dangerouslySetInnerHTML` — the **HTML boundary**. See "Security boundaries" below. |
26
26
  | `MarkdownRenderer` | `.` | Canonical Blog renderer: `marked` → **hast-util-sanitize** (XSS) → component map, with a YouTube-domain allowlist. RSC-safe. |
27
27
  | `CourseDescription` | `.` | Drop-in for the rich-text course `description` (`client.academy.bySlug()`). Server Component. See "Rich-text descriptions". |
28
+ | `CoursePurchaseTerms`, `DEFAULT_COURSE_PURCHASE_TERMS_LABELS` | `.` | What the buyer sees before paying: withdrawal waiver, access duration, refund guarantee. Server Component. See "Course purchase terms". |
28
29
  | `LessonPreview`, `DEFAULT_LESSON_PREVIEW_LABELS` | `.` | A public free-preview lesson: hosted video player + sanitised body (`getLessonPreview()`). Server Component. See "Free-preview lesson". |
29
30
  | `Treatment`, `ParentPage`, `ProfileCard`, `ProductCard` | `.` | Presentational organisms over the SITE API contracts. RSC-safe. `Specialty`: deprecated alias, see below. |
30
31
  | `ProfessionalFields` | `.` | The tenant's own professional fields (`professional.fields`) on a team card or profile. RSC-safe. See below. |
@@ -1127,6 +1128,33 @@ export default async function Page({ params }) {
1127
1128
  `lesson-preview-badge`, `lesson-preview-duration`, `lesson-preview-player`,
1128
1129
  `lesson-preview-content`.
1129
1130
 
1131
+ ## Course purchase terms — `CoursePurchaseTerms` (REB-1199)
1132
+
1133
+ What a buyer must see before paying for a course, from `client.academy.bySlug()`:
1134
+
1135
+ - **Withdrawal waiver** (`withdrawalWaiverRequired`): checkout asks for a separate box in which the buyer requests immediate access and waives the 14-day withdrawal right.
1136
+ - **Access duration** (`accessDurationMonths`): months of access after enrolment. `null` means no end date, and nothing is shown.
1137
+ - **Refund guarantee** (`refundGuarantee`): the course's terms. `null` means none, and nothing is shown.
1138
+
1139
+ Each term renders only when the course carries it. A course with none renders nothing, not even the heading. It is a Server Component, RSC-safe. The copy is Spanish and neutral; replace any text with `labels`.
1140
+
1141
+ ```tsx
1142
+ import { CoursePurchaseTerms } from '@reblu/site-blocks'
1143
+
1144
+ const course = await client.academy.bySlug(slug)
1145
+
1146
+ <CoursePurchaseTerms course={course} heading='Antes de comprar' />
1147
+
1148
+ // In another language:
1149
+ <CoursePurchaseTerms
1150
+ course={course}
1151
+ labels={{
1152
+ withdrawalWaiver: 'Immediate access: you waive the 14-day withdrawal right.',
1153
+ accessDuration: (months) => `Access for ${months} months.`,
1154
+ }}
1155
+ />
1156
+ ```
1157
+
1130
1158
  ## Page blocks
1131
1159
 
1132
1160
  `PageBlocks` renders a page's registry blocks (`PageDetail.blocks` from