@reblu/site-blocks 0.27.0 → 0.28.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,16 @@
1
1
  # @reblu/site-blocks
2
2
 
3
+ ## 0.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 275adaf: REB-1201: `ArbitrationBadge` drop-in renders the tenant's consumer-arbitration distinctive in the footer — logo at `h-16`, `alt` with the adhesion number («… N.º de adhesión CA00000»), the number as visible text, optional link in a new window. `TrustBadges` knows the new type (heading «Arbitraje de consumo») but leaves it out of its default groups, so a footer with both never shows it twice; opt in with `types`. Any badge with an adhesion number gets it in its `alt`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [275adaf]
12
+ - @reblu/site-contracts@1.28.0
13
+
3
14
  ## 0.27.0
4
15
 
5
16
  ### Minor Changes
package/README.md CHANGED
@@ -35,6 +35,7 @@ colour on the red background. See `docs/theming/theming.md`.
35
35
  | `PageBlocks`, `FaqAccordion` | `.` | Registry-block renderer (`PageDetail.blocks`) and native `<details>` FAQ. Server Components. See "Page blocks" below. |
36
36
  | `ProductTrustItems`, `DEFAULT_TRUST_ICONS` | `.` | Store-wide trust messages from `ShopConfig.productTrustItems`. Server Component. See "Product trust items" below. |
37
37
  | `TrustBadges`, `DEFAULT_TRUST_BADGE_HEADINGS` | `.` | The tenant's trust badges from `client.trustBadges.list()`, grouped by type. Server Component. See "Trust badges" below. |
38
+ | `ArbitrationBadge` | `.` | The consumer-arbitration distinctive with its adhesion number, for the footer. Server Component. See "Consumer arbitration badge" below. |
38
39
  | `buildFaqPageJsonLd`, `collectFaqItems` | `./seo` | schema.org `FAQPage` structured data. Directive-free (also on `.`). See "Page blocks" below. |
39
40
  | `useCollection` | `./client` | Headless filterable/sortable/paginated collection hook (facets, category, tag, search). Serves both page and blog indexes. |
40
41
  | `Collection` | `./client` | Token-driven presentational grid over `useCollection`. |
@@ -755,7 +756,11 @@ export async function Footer() {
755
756
  - `types` picks which groups render and in what order, e.g. only the funding
756
757
  logos: `<TrustBadges badges={badges} types={['SUBVENTION']} />`. To fetch
757
758
  only one type, `client.trustBadges.list({ type: 'SUBVENTION' })`.
758
- - A logo is an `<img>` with `alt` = badge name, rendered only when its URL is
759
+ - `CONSUMER_ARBITRATION` is not in the default groups — render it with
760
+ `ArbitrationBadge` (below). Opt in with `types` to group it here; its heading
761
+ is «Arbitraje de consumo».
762
+ - A logo is an `<img>` with `alt` = badge name (plus «N.º de adhesión …» when
763
+ the badge has an adhesion number), rendered only when its URL is
759
764
  http(s) or root-relative (`/logos/x.svg`); any other scheme (`javascript:`,
760
765
  `data:`, `//host`) is dropped and the badge shows its name as text, like a
761
766
  badge without a logo. A badge `url` (http/https only) opens in a new window
@@ -781,6 +786,46 @@ export async function Footer() {
781
786
  `listClassName` and `logoClassName` are layout/sizing slots and still merge
782
787
  with `cn`.
783
788
 
789
+ ## Consumer arbitration badge — `ArbitrationBadge` (REB-1201)
790
+
791
+ A tenant adhered to the consumer arbitration system shows the official
792
+ distinctive in the footer, visible and accessible, with its adhesion number. In
793
+ nexus › Trust badges create a badge of type «Arbitraje de consumo» with the
794
+ official logo, the «Número de adhesión» (required for that type) and an
795
+ optional link. The API serves it like any other badge, with `adhesionNumber`.
796
+
797
+ ```tsx
798
+ import { ArbitrationBadge, TrustBadges } from '@reblu/site-blocks'
799
+
800
+ export async function Footer() {
801
+ const { data: badges } = await client.trustBadges.list().catch(() => ({ data: [] }))
802
+ return (
803
+ <footer>
804
+ {/* … */}
805
+ <TrustBadges badges={badges} headingLevel={2} />
806
+ <ArbitrationBadge badges={badges} />
807
+ </footer>
808
+ )
809
+ }
810
+ ```
811
+
812
+ - Feed it the whole list: only `CONSUMER_ARBITRATION` badges render, and
813
+ `TrustBadges` leaves that type out by default, so it never shows twice. To
814
+ fetch only it, `client.trustBadges.list({ type: 'CONSUMER_ARBITRATION' })`.
815
+ - The logo is an `<img>` at `h-16` (not a tiny icon) with `alt` = «{name}.
816
+ N.º de adhesión {number}». The number is also shown as visible text under the
817
+ logo, `aria-hidden` there because the `alt` already says it. Without a usable
818
+ logo (same http(s)/root-relative rule as `TrustBadges`) the name and number
819
+ are plain text.
820
+ - `numberLabel` changes «N.º de adhesión» (alt and caption); `showNumber={false}`
821
+ drops the visible caption, the `alt` keeps the number.
822
+ - A http(s) `url` opens in a new window with `rel="noopener noreferrer"` and a
823
+ visually hidden `newWindowLabel`.
824
+ - Nothing renders without a named consumer-arbitration badge.
825
+ - Styling hooks: `className` (the `<ul>`), `logoClassName` (merged with
826
+ `h-16 w-auto object-contain`, e.g. `brightness-0 invert` on a dark footer),
827
+ `numberClassName`.
828
+
784
829
  ## `ParentPage` (formerly `Specialty`)
785
830
 
786
831
  `ParentPage` renders a page that groups other pages: the hero and content