feat(cibg): WP-12 — CIBG Datablock for application data
Adopt the vendored CIBG Datablock (.data-block / .block-wrapper) as the way to show application data: - New app-data-block molecule (grey surface + white panel + projected rows, optional heading, stacked variant, aria-label) + stories. - data-row switches to a `div[app-data-row]` attribute selector so the <dl>'s direct child is a native <div> (HTML5.1 dl > div > dt+dd). This makes the definition list axe-clean — a bare custom element between <dl> and its dt/dd trips axe's definition-list rule regardless of display:contents, a defect the dashboard shipped live. Re-enables a11y on the data-row / review-section / registration-summary stories (previously disabled pending this rework). - review-section folds onto app-data-block (drops its hand-carried classes). - registration-summary + dashboard "Persoonsgegevens (BRP)" drop app-card and render as datablocks; both wizards' review rows + the beroep row convert to the div selector. GREEN: lint, check:tokens, 178 tests, build, build-storybook, 136 axe stories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
33
src/app/shared/ui/data-block/data-block.component.ts
Normal file
33
src/app/shared/ui/data-block/data-block.component.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import { HeadingComponent } from '@shared/ui/heading/heading.component';
|
||||
|
||||
/** Molecule: CIBG Huisstijl **Datablock** (designsystem.cibg.nl/componenten/datablock)
|
||||
— THE way to show user/application data. A grey `.data-block` surface holds a white
|
||||
`.block-wrapper` panel with a `<dl>` of projected `<app-data-row>`s. Use `stacked`
|
||||
(`.data-block--stacked`) when labels/values are long and should stack. Replaces the
|
||||
`app-card + dl` idiom for data views (the datablock carries its own surface, so it is
|
||||
NOT wrapped in an `app-card` — see WP-12). When there is no visible `heading`, pass an
|
||||
`ariaLabel` so the definition list is announced. */
|
||||
@Component({
|
||||
selector: 'app-data-block',
|
||||
imports: [HeadingComponent],
|
||||
template: `
|
||||
@if (heading()) { <app-heading [level]="level()">{{ heading() }}</app-heading> }
|
||||
<div class="data-block" [class.data-block--stacked]="stacked()">
|
||||
<div class="block-wrapper">
|
||||
<dl class="mb-0" [attr.aria-label]="ariaLabel() || null">
|
||||
<ng-content />
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
})
|
||||
export class DataBlockComponent {
|
||||
heading = input('');
|
||||
/** Heading level when `heading` is set (default h3, matching `app-card`). */
|
||||
level = input<1 | 2 | 3 | 4 | 5>(3);
|
||||
/** Stacks label above value (`.data-block--stacked`) for long content. */
|
||||
stacked = input(false);
|
||||
/** Accessible name for the `<dl>` when there is no visible heading. */
|
||||
ariaLabel = input('');
|
||||
}
|
||||
Reference in New Issue
Block a user