@dsn-starter-kit/components-react 1.0.2 → 2.0.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/README.md +1 -1
- package/dist/ActionGroup/ActionGroup.css +58 -26
- package/dist/ActionGroup/ActionGroup.d.ts +10 -2
- package/dist/ActionGroup/ActionGroup.d.ts.map +1 -1
- package/dist/ActionGroup/ActionGroup.js +20 -2
- package/dist/ActionGroup/ActionGroup.js.map +1 -1
- package/dist/Alert/Alert.css +25 -11
- package/dist/Alert/Alert.d.ts +14 -0
- package/dist/Alert/Alert.d.ts.map +1 -1
- package/dist/Alert/Alert.js +14 -2
- package/dist/Alert/Alert.js.map +1 -1
- package/dist/Grid/Grid.css +2 -2
- package/dist/Hero/Hero.css +638 -0
- package/dist/Note/Note.css +22 -14
- package/dist/Note/Note.d.ts +18 -3
- package/dist/Note/Note.d.ts.map +1 -1
- package/dist/Note/Note.js +18 -5
- package/dist/Note/Note.js.map +1 -1
- package/dist/PageBody/PageBody.css +30 -0
- package/dist/PageFooter/PageFooter.css +0 -1
- package/dist/SkipLink/SkipLink.d.ts +1 -1
- package/dist/SkipLink/SkipLink.js +1 -1
- package/dist/TableOfContents/TableOfContents.css +75 -0
- package/dist/TableOfContents/TableOfContents.d.ts +61 -0
- package/dist/TableOfContents/TableOfContents.d.ts.map +1 -0
- package/dist/TableOfContents/TableOfContents.js +32 -0
- package/dist/TableOfContents/TableOfContents.js.map +1 -0
- package/dist/TableOfContents/index.d.ts +3 -0
- package/dist/TableOfContents/index.d.ts.map +1 -0
- package/dist/TableOfContents/index.js +2 -0
- package/dist/TableOfContents/index.js.map +1 -0
- package/dist/index.css +851 -54
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/Note/Note.css
CHANGED
|
@@ -8,34 +8,42 @@
|
|
|
8
8
|
* Visually highlighted message for supplementary or important information.
|
|
9
9
|
* Passive counterpart to Alert — no live region, read on navigation only.
|
|
10
10
|
*
|
|
11
|
+
* The icon is decorative (aria-hidden); the non-neutral variants (info,
|
|
12
|
+
* positive, negative, warning) carry a visually hidden variant label that
|
|
13
|
+
* announces the variant to screen reader users: "Informatie: " / "Succes: " /
|
|
14
|
+
* "Foutmelding: " / "Let op: ". With a heading the label is the first child of
|
|
15
|
+
* the heading; without a heading it is a standalone span before the content.
|
|
16
|
+
* Neutral has no label: that variant deliberately carries no semantic signal.
|
|
17
|
+
*
|
|
11
18
|
* Usage:
|
|
12
|
-
* <!-- Neutral (default), with icon and heading -->
|
|
19
|
+
* <!-- Neutral (default), with icon and heading — no variant label -->
|
|
13
20
|
* <div class="dsn-note">
|
|
14
21
|
* <span class="dsn-note__icon" aria-hidden="true">
|
|
15
|
-
* <svg class="dsn-icon" aria-hidden="true"><!-- info-circle --></svg>
|
|
22
|
+
* <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- info-circle --></svg>
|
|
16
23
|
* </span>
|
|
17
|
-
* <
|
|
24
|
+
* <h3 class="dsn-heading dsn-heading--heading-3 dsn-note__heading">Let op</h3>
|
|
18
25
|
* <div class="dsn-note__content">
|
|
19
26
|
* <p>Aanvullende informatie over dit onderwerp.</p>
|
|
20
27
|
* </div>
|
|
21
28
|
* </div>
|
|
22
29
|
*
|
|
23
|
-
* <!-- Info variant -->
|
|
30
|
+
* <!-- Info variant, with visually hidden variant label -->
|
|
24
31
|
* <div class="dsn-note dsn-note--info">
|
|
25
32
|
* <span class="dsn-note__icon" aria-hidden="true">
|
|
26
|
-
* <svg class="dsn-icon" aria-hidden="true"><!-- info-circle --></svg>
|
|
33
|
+
* <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- info-circle --></svg>
|
|
27
34
|
* </span>
|
|
28
|
-
* <
|
|
35
|
+
* <h3 class="dsn-heading dsn-heading--heading-3 dsn-note__heading"><span class="dsn-visually-hidden">Informatie: </span>Heading</h3>
|
|
29
36
|
* <div class="dsn-note__content">
|
|
30
37
|
* <p>Body content.</p>
|
|
31
38
|
* </div>
|
|
32
39
|
* </div>
|
|
33
40
|
*
|
|
34
|
-
* <!-- Without heading — icon spans both rows -->
|
|
35
|
-
* <div class="dsn-note dsn-note--no-heading">
|
|
41
|
+
* <!-- Without heading — icon spans both rows, variant label as standalone span -->
|
|
42
|
+
* <div class="dsn-note dsn-note--warning dsn-note--no-heading">
|
|
36
43
|
* <span class="dsn-note__icon" aria-hidden="true">
|
|
37
|
-
* <svg class="dsn-icon" aria-hidden="true"><!--
|
|
44
|
+
* <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- alert-triangle --></svg>
|
|
38
45
|
* </span>
|
|
46
|
+
* <span class="dsn-visually-hidden">Let op: </span>
|
|
39
47
|
* <div class="dsn-note__content">
|
|
40
48
|
* <p>Aanvullende informatie.</p>
|
|
41
49
|
* </div>
|
|
@@ -46,15 +54,15 @@
|
|
|
46
54
|
* ...
|
|
47
55
|
* </aside>
|
|
48
56
|
*
|
|
49
|
-
* <!-- as="nav" — table of contents -->
|
|
57
|
+
* <!-- as="nav" — standalone navigation section (not a page table of contents: use TableOfContents) -->
|
|
50
58
|
* <nav class="dsn-note" aria-labelledby="note-heading-id">
|
|
51
59
|
* <span class="dsn-note__icon" aria-hidden="true">
|
|
52
|
-
* <svg class="dsn-icon" aria-hidden="true"><!-- info-circle --></svg>
|
|
60
|
+
* <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- info-circle --></svg>
|
|
53
61
|
* </span>
|
|
54
|
-
* <
|
|
55
|
-
* <
|
|
62
|
+
* <h3 class="dsn-heading dsn-heading--heading-3 dsn-note__heading" id="note-heading-id">Related pages</h3>
|
|
63
|
+
* <div class="dsn-note__content">
|
|
56
64
|
* <ul>...</ul>
|
|
57
|
-
* </
|
|
65
|
+
* </div>
|
|
58
66
|
* </nav>
|
|
59
67
|
*/
|
|
60
68
|
|
package/dist/Note/Note.d.ts
CHANGED
|
@@ -29,6 +29,16 @@ export interface NoteProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
29
29
|
* - `ReactNode` — aangepast icoon
|
|
30
30
|
*/
|
|
31
31
|
iconStart?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Visueel verborgen tekst die de variant benoemt voor screenreadergebruikers
|
|
34
|
+
* (inclusief scheidingsteken en spatie). Komt vóór de heading, of vóór de
|
|
35
|
+
* content als er geen heading is.
|
|
36
|
+
* - `undefined` (default) — standaardtekst per variant:
|
|
37
|
+
* `''` (neutral) / `'Informatie: '` / `'Succes: '` / `'Foutmelding: '` / `'Let op: '`
|
|
38
|
+
* - `''` — geen variant-label (bijv. als de heading de variant al benoemt)
|
|
39
|
+
* - `string` — eigen tekst, bijv. voor een andere taal
|
|
40
|
+
*/
|
|
41
|
+
variantLabel?: string;
|
|
32
42
|
/**
|
|
33
43
|
* Body-content: tekst, lijst, links, etc.
|
|
34
44
|
*/
|
|
@@ -61,10 +71,10 @@ export interface NoteProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
61
71
|
* <Paragraph>Meer context.</Paragraph>
|
|
62
72
|
* </Note>
|
|
63
73
|
*
|
|
64
|
-
* // as="nav" — inhoudsopgave
|
|
65
|
-
* <Note as="nav" variant="neutral" heading="
|
|
74
|
+
* // as="nav" — eigenstandige navigatiesectie (niet voor een pagina-inhoudsopgave: gebruik TableOfContents)
|
|
75
|
+
* <Note as="nav" variant="neutral" heading="Gerelateerde pagina's" headingLevel={2}>
|
|
66
76
|
* <UnorderedList>
|
|
67
|
-
* <li><Link href="
|
|
77
|
+
* <li><Link href="/gerelateerd-1">Gerelateerde pagina 1</Link></li>
|
|
68
78
|
* </UnorderedList>
|
|
69
79
|
* </Note>
|
|
70
80
|
*
|
|
@@ -72,6 +82,11 @@ export interface NoteProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
72
82
|
* <Note variant="info" heading="Opmerking" iconStart={null}>
|
|
73
83
|
* <Paragraph>Zonder icoon.</Paragraph>
|
|
74
84
|
* </Note>
|
|
85
|
+
*
|
|
86
|
+
* // Variant-label onderdrukken (heading benoemt de variant al)
|
|
87
|
+
* <Note variant="warning" heading="Waarschuwing" variantLabel="">
|
|
88
|
+
* <Paragraph>Dit heeft gevolgen voor uw aanvraag.</Paragraph>
|
|
89
|
+
* </Note>
|
|
75
90
|
* ```
|
|
76
91
|
*/
|
|
77
92
|
export declare const Note: React.ForwardRefExoticComponent<NoteProps & React.RefAttributes<HTMLElement>>;
|
package/dist/Note/Note.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Note.d.ts","sourceRoot":"","sources":["../../src/Note/Note.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAIrC,OAAO,YAAY,CAAC;AAEpB,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,CAAC;AACd,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Note.d.ts","sourceRoot":"","sources":["../../src/Note/Note.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAIrC,OAAO,YAAY,CAAC;AAEpB,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,CAAC;AACd,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAkBzD,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAClE;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,IAAI,+EA+EhB,CAAC"}
|
package/dist/Note/Note.js
CHANGED
|
@@ -11,6 +11,13 @@ const PREFERRED_ICONS = {
|
|
|
11
11
|
negative: 'exclamation-circle',
|
|
12
12
|
warning: 'alert-triangle',
|
|
13
13
|
};
|
|
14
|
+
const VARIANT_LABELS = {
|
|
15
|
+
neutral: '',
|
|
16
|
+
info: 'Informatie: ',
|
|
17
|
+
positive: 'Succes: ',
|
|
18
|
+
negative: 'Foutmelding: ',
|
|
19
|
+
warning: 'Let op: ',
|
|
20
|
+
};
|
|
14
21
|
/**
|
|
15
22
|
* Note component
|
|
16
23
|
* Visueel uitgelicht bericht voor aanvullende of belangrijke informatie.
|
|
@@ -38,10 +45,10 @@ const PREFERRED_ICONS = {
|
|
|
38
45
|
* <Paragraph>Meer context.</Paragraph>
|
|
39
46
|
* </Note>
|
|
40
47
|
*
|
|
41
|
-
* // as="nav" — inhoudsopgave
|
|
42
|
-
* <Note as="nav" variant="neutral" heading="
|
|
48
|
+
* // as="nav" — eigenstandige navigatiesectie (niet voor een pagina-inhoudsopgave: gebruik TableOfContents)
|
|
49
|
+
* <Note as="nav" variant="neutral" heading="Gerelateerde pagina's" headingLevel={2}>
|
|
43
50
|
* <UnorderedList>
|
|
44
|
-
* <li><Link href="
|
|
51
|
+
* <li><Link href="/gerelateerd-1">Gerelateerde pagina 1</Link></li>
|
|
45
52
|
* </UnorderedList>
|
|
46
53
|
* </Note>
|
|
47
54
|
*
|
|
@@ -49,12 +56,18 @@ const PREFERRED_ICONS = {
|
|
|
49
56
|
* <Note variant="info" heading="Opmerking" iconStart={null}>
|
|
50
57
|
* <Paragraph>Zonder icoon.</Paragraph>
|
|
51
58
|
* </Note>
|
|
59
|
+
*
|
|
60
|
+
* // Variant-label onderdrukken (heading benoemt de variant al)
|
|
61
|
+
* <Note variant="warning" heading="Waarschuwing" variantLabel="">
|
|
62
|
+
* <Paragraph>Dit heeft gevolgen voor uw aanvraag.</Paragraph>
|
|
63
|
+
* </Note>
|
|
52
64
|
* ```
|
|
53
65
|
*/
|
|
54
|
-
export const Note = React.forwardRef(({ as: As = 'div', className, variant = 'neutral', heading, headingLevel = 3, iconStart, children, ...props }, ref) => {
|
|
66
|
+
export const Note = React.forwardRef(({ as: As = 'div', className, variant = 'neutral', heading, headingLevel = 3, iconStart, variantLabel, children, ...props }, ref) => {
|
|
55
67
|
const headingId = useId();
|
|
56
68
|
const noIcon = iconStart === null;
|
|
57
69
|
const noHeading = !heading;
|
|
70
|
+
const resolvedVariantLabel = variantLabel ?? VARIANT_LABELS[variant];
|
|
58
71
|
const resolvedIcon = iconStart === undefined ? (_jsx(Icon, { name: PREFERRED_ICONS[variant], size: "xl", "aria-hidden": true })) : (iconStart);
|
|
59
72
|
const classes = classNames('dsn-note', variant !== 'neutral' && `dsn-note--${variant}`, noHeading && 'dsn-note--no-heading', className);
|
|
60
73
|
// For landmark elements with a heading, add aria-labelledby automatically
|
|
@@ -62,7 +75,7 @@ export const Note = React.forwardRef(({ as: As = 'div', className, variant = 'ne
|
|
|
62
75
|
const labelledBy = isLandmark && heading && !props['aria-label'] && !props['aria-labelledby']
|
|
63
76
|
? headingId
|
|
64
77
|
: undefined;
|
|
65
|
-
return (_jsxs(As, { ref: ref, className: classes, "aria-labelledby": labelledBy, ...props, children: [!noIcon && (_jsx("span", { className: "dsn-note__icon", "aria-hidden": true, children: resolvedIcon })), heading && (
|
|
78
|
+
return (_jsxs(As, { ref: ref, className: classes, "aria-labelledby": labelledBy, ...props, children: [!noIcon && (_jsx("span", { className: "dsn-note__icon", "aria-hidden": true, children: resolvedIcon })), heading && (_jsxs(Heading, { level: headingLevel, appearance: "heading-3", className: "dsn-note__heading", id: isLandmark ? headingId : undefined, children: [resolvedVariantLabel && (_jsx("span", { className: "dsn-visually-hidden", children: resolvedVariantLabel })), heading] })), noHeading && resolvedVariantLabel && (_jsx("span", { className: "dsn-visually-hidden", children: resolvedVariantLabel })), children && _jsx("div", { className: "dsn-note__content", children: children })] }));
|
|
66
79
|
});
|
|
67
80
|
Note.displayName = 'Note';
|
|
68
81
|
//# sourceMappingURL=Note.js.map
|
package/dist/Note/Note.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Note.js","sourceRoot":"","sources":["../../src/Note/Note.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,YAAY,CAAC;AAUpB,MAAM,eAAe,GAAgC;IACnD,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,oBAAoB;IAC9B,OAAO,EAAE,gBAAgB;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"Note.js","sourceRoot":"","sources":["../../src/Note/Note.tsx"],"names":[],"mappings":"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"}
|
|
@@ -67,3 +67,33 @@
|
|
|
67
67
|
background-color: transparent;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* =============================================================================
|
|
71
|
+
Sidebar layout — Table of Contents kolom (rechts)
|
|
72
|
+
De ToC-inhoud wordt twee keer gerenderd: één keer inline (onder H1/lead,
|
|
73
|
+
zichtbaar tot 80em) en één keer als rechterkolom (zichtbaar vanaf 80em).
|
|
74
|
+
`display: none` sluit de verborgen kopie uit van de accessibility tree,
|
|
75
|
+
dus er is nooit dubbele content voor schermlezers.
|
|
76
|
+
============================================================================= */
|
|
77
|
+
|
|
78
|
+
.dsn-sidebar-layout__toc-inline {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dsn-sidebar-layout__toc {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (min-width: 80em) {
|
|
87
|
+
.dsn-sidebar-layout__toc-inline {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dsn-sidebar-layout__toc {
|
|
92
|
+
display: block;
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
inline-size: var(--dsn-sidebar-layout-toc-inline-size, 16rem);
|
|
95
|
+
padding-inline-start: var(--dsn-space-inline-2xl);
|
|
96
|
+
padding-block: var(--dsn-space-block-3xl);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
============================================================================= */
|
|
26
26
|
|
|
27
27
|
.dsn-page-footer {
|
|
28
|
-
--dsn-grid-margin: 0;
|
|
29
28
|
background-color: var(--dsn-page-footer-background-color);
|
|
30
29
|
border-block-start: var(--dsn-page-footer-border-block-start-width) solid
|
|
31
30
|
var(--dsn-page-footer-border-block-start-color);
|
|
@@ -21,7 +21,7 @@ export interface SkipLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElem
|
|
|
21
21
|
* SkipLink — toegankelijkheidskoppeling om herhalende navigatie te omzeilen.
|
|
22
22
|
*
|
|
23
23
|
* Plaatst de link als **eerste focusbaar element** in de DOM, vóór `<header>` en `<nav>`.
|
|
24
|
-
* Voldoet aan WCAG 2.
|
|
24
|
+
* Voldoet aan WCAG 2.2 succescriterium 2.4.1 (Bypass Blocks, Level A).
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```tsx
|
|
@@ -6,7 +6,7 @@ import './SkipLink.css';
|
|
|
6
6
|
* SkipLink — toegankelijkheidskoppeling om herhalende navigatie te omzeilen.
|
|
7
7
|
*
|
|
8
8
|
* Plaatst de link als **eerste focusbaar element** in de DOM, vóór `<header>` en `<nav>`.
|
|
9
|
-
* Voldoet aan WCAG 2.
|
|
9
|
+
* Voldoet aan WCAG 2.2 succescriterium 2.4.1 (Bypass Blocks, Level A).
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableOfContents component styles for React
|
|
3
|
+
* Re-exports the base TableOfContents styles from components-html
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Table Of Contents Component
|
|
8
|
+
* Inhoudsopgave met ankerlinks naar de secties op de huidige pagina.
|
|
9
|
+
* Alleen H2-secties horen hierin opgenomen te worden.
|
|
10
|
+
*
|
|
11
|
+
* Twee appearances:
|
|
12
|
+
* - Default ("framed"): accent-1 achtergrond + linkerborder, heading als heading-3.
|
|
13
|
+
* Bedoeld voor gebruik inline in de content-flow (bijv. onder de lead paragraph).
|
|
14
|
+
* - `dsn-table-of-contents--plain`: geen kader, heading als heading-5.
|
|
15
|
+
* Bedoeld voor gebruik in een losstaande kolom naast de hoofdinhoud.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* <!-- Framed (default) -->
|
|
19
|
+
* <nav class="dsn-table-of-contents" aria-labelledby="toc-heading">
|
|
20
|
+
* <h2 class="dsn-heading dsn-heading--heading-3 dsn-table-of-contents__heading" id="toc-heading">Op deze pagina</h2>
|
|
21
|
+
* <ul class="dsn-unordered-list">
|
|
22
|
+
* <li><a class="dsn-link" href="#sectie-1">Sectie 1</a></li>
|
|
23
|
+
* </ul>
|
|
24
|
+
* </nav>
|
|
25
|
+
*
|
|
26
|
+
* <!-- Plain -->
|
|
27
|
+
* <nav class="dsn-table-of-contents dsn-table-of-contents--plain" aria-labelledby="toc-heading-plain">
|
|
28
|
+
* <h2 class="dsn-heading dsn-heading--heading-5 dsn-table-of-contents__heading" id="toc-heading-plain">Op deze pagina</h2>
|
|
29
|
+
* <ul class="dsn-unordered-list">
|
|
30
|
+
* <li><a class="dsn-link" href="#sectie-1">Sectie 1</a></li>
|
|
31
|
+
* </ul>
|
|
32
|
+
* </nav>
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
.dsn-table-of-contents {
|
|
36
|
+
border-inline-start: var(--dsn-table-of-contents-border-inline-start-width)
|
|
37
|
+
solid var(--dsn-table-of-contents-border-inline-start-color);
|
|
38
|
+
background-color: var(--dsn-table-of-contents-background-color);
|
|
39
|
+
padding-block: var(--dsn-table-of-contents-padding-block);
|
|
40
|
+
padding-inline-start: var(--dsn-table-of-contents-padding-inline-start);
|
|
41
|
+
padding-inline-end: var(--dsn-table-of-contents-padding-inline-end);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dsn-table-of-contents__heading {
|
|
45
|
+
margin-block-end: var(--dsn-table-of-contents-heading-gap);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* =============================================================================
|
|
49
|
+
Plain appearance — geen kader, voor gebruik in een losstaande kolom
|
|
50
|
+
============================================================================= */
|
|
51
|
+
|
|
52
|
+
.dsn-table-of-contents--plain {
|
|
53
|
+
border-inline-start: none;
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
padding-block: var(--dsn-table-of-contents-plain-padding-block);
|
|
56
|
+
padding-inline-start: 0;
|
|
57
|
+
padding-inline-end: 0;
|
|
58
|
+
/* Ankerlinks: omgekeerd onderstrepingsgedrag t.o.v. de standaard Link —
|
|
59
|
+
rust zonder onderstreping, hover mét, zodat de kolom rustiger oogt. */
|
|
60
|
+
--dsn-link-text-decoration-line: var(
|
|
61
|
+
--dsn-table-of-contents-plain-link-text-decoration-line
|
|
62
|
+
);
|
|
63
|
+
--dsn-link-hover-text-decoration-line: var(
|
|
64
|
+
--dsn-table-of-contents-plain-link-hover-text-decoration-line
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.dsn-table-of-contents--plain .dsn-unordered-list > li {
|
|
69
|
+
margin-block-end: var(--dsn-table-of-contents-plain-list-gap);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dsn-table-of-contents--plain .dsn-unordered-list > li:last-child {
|
|
73
|
+
margin-block-end: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type HeadingLevel } from '../Heading';
|
|
3
|
+
import './TableOfContents.css';
|
|
4
|
+
export type TableOfContentsAppearance = 'framed' | 'plain';
|
|
5
|
+
export interface TableOfContentsItem {
|
|
6
|
+
/**
|
|
7
|
+
* Anchor target — moet overeenkomen met het `id` van de bijbehorende H2 op de pagina
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Zichtbare linktekst
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TableOfContentsProps extends React.HTMLAttributes<HTMLElement> {
|
|
16
|
+
/**
|
|
17
|
+
* Zichtbare heading-tekst
|
|
18
|
+
* @default 'Op deze pagina'
|
|
19
|
+
*/
|
|
20
|
+
heading?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Semantisch heading-niveau
|
|
23
|
+
* @default 2
|
|
24
|
+
*/
|
|
25
|
+
headingLevel?: HeadingLevel;
|
|
26
|
+
/**
|
|
27
|
+
* Visuele weergave:
|
|
28
|
+
* - `'framed'` — accent-1 achtergrond + linkerborder, heading als heading-3 (voor gebruik inline in de content-flow)
|
|
29
|
+
* - `'plain'` — geen kader, heading als heading-5 (voor gebruik in een losstaande kolom)
|
|
30
|
+
* @default 'framed'
|
|
31
|
+
*/
|
|
32
|
+
appearance?: TableOfContentsAppearance;
|
|
33
|
+
/**
|
|
34
|
+
* Secties waarnaar gelinkt wordt — alleen H2's horen hierin opgenomen te worden
|
|
35
|
+
*/
|
|
36
|
+
items: TableOfContentsItem[];
|
|
37
|
+
/**
|
|
38
|
+
* Additional CSS class names
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* TableOfContents component
|
|
44
|
+
* Inhoudsopgave met ankerlinks naar de H2-secties op de huidige pagina.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* // Framed (default) — inline in de content-flow
|
|
49
|
+
* <TableOfContents
|
|
50
|
+
* items={[
|
|
51
|
+
* { id: 'sectie-1', label: 'Sectie 1' },
|
|
52
|
+
* { id: 'sectie-2', label: 'Sectie 2' },
|
|
53
|
+
* ]}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Plain — in een losstaande kolom naast de hoofdinhoud
|
|
57
|
+
* <TableOfContents appearance="plain" items={items} />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const TableOfContents: React.ForwardRefExoticComponent<TableOfContentsProps & React.RefAttributes<HTMLElement>>;
|
|
61
|
+
//# sourceMappingURL=TableOfContents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../src/TableOfContents/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxD,OAAO,uBAAuB,CAAC;AAE/B,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC7E;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAEvC;;OAEG;IACH,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,0FAgD3B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useId } from 'react';
|
|
3
|
+
import { classNames } from '@dsn-starter-kit/core';
|
|
4
|
+
import { Heading } from '../Heading';
|
|
5
|
+
import { Link } from '../Link';
|
|
6
|
+
import { UnorderedList } from '../UnorderedList';
|
|
7
|
+
import './TableOfContents.css';
|
|
8
|
+
/**
|
|
9
|
+
* TableOfContents component
|
|
10
|
+
* Inhoudsopgave met ankerlinks naar de H2-secties op de huidige pagina.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Framed (default) — inline in de content-flow
|
|
15
|
+
* <TableOfContents
|
|
16
|
+
* items={[
|
|
17
|
+
* { id: 'sectie-1', label: 'Sectie 1' },
|
|
18
|
+
* { id: 'sectie-2', label: 'Sectie 2' },
|
|
19
|
+
* ]}
|
|
20
|
+
* />
|
|
21
|
+
*
|
|
22
|
+
* // Plain — in een losstaande kolom naast de hoofdinhoud
|
|
23
|
+
* <TableOfContents appearance="plain" items={items} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const TableOfContents = React.forwardRef(({ heading = 'Op deze pagina', headingLevel = 2, appearance = 'framed', items, className, ...props }, ref) => {
|
|
27
|
+
const headingId = useId();
|
|
28
|
+
const classes = classNames('dsn-table-of-contents', appearance === 'plain' && 'dsn-table-of-contents--plain', className);
|
|
29
|
+
return (_jsxs("nav", { ref: ref, className: classes, "aria-labelledby": headingId, ...props, children: [_jsx(Heading, { level: headingLevel, appearance: appearance === 'plain' ? 'heading-5' : 'heading-3', className: "dsn-table-of-contents__heading", id: headingId, children: heading }), _jsx(UnorderedList, { children: items.map((item) => (_jsx("li", { children: _jsx(Link, { href: `#${item.id}`, children: item.label }) }, item.id))) })] }));
|
|
30
|
+
});
|
|
31
|
+
TableOfContents.displayName = 'TableOfContents';
|
|
32
|
+
//# sourceMappingURL=TableOfContents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../../src/TableOfContents/TableOfContents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,uBAAuB,CAAC;AAgD/B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAI7C,CACE,EACE,OAAO,GAAG,gBAAgB,EAC1B,YAAY,GAAG,CAAC,EAChB,UAAU,GAAG,QAAQ,EACrB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC;IAE1B,MAAM,OAAO,GAAG,UAAU,CACxB,uBAAuB,EACvB,UAAU,KAAK,OAAO,IAAI,8BAA8B,EACxD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,eACE,GAAG,EAAE,GAA6B,EAClC,SAAS,EAAE,OAAO,qBACD,SAAS,KACtB,KAAK,aAET,KAAC,OAAO,IACN,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAC9D,SAAS,EAAC,gCAAgC,EAC1C,EAAE,EAAE,SAAS,YAEZ,OAAO,GACA,EACV,KAAC,aAAa,cACX,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,uBACE,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,IAAI,CAAC,EAAE,EAAE,YAAG,IAAI,CAAC,KAAK,GAAQ,IADvC,IAAI,CAAC,EAAE,CAEX,CACN,CAAC,GACY,IACZ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TableOfContents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TableOfContents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|