@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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/ActionGroup/ActionGroup.css +58 -26
  3. package/dist/ActionGroup/ActionGroup.d.ts +10 -2
  4. package/dist/ActionGroup/ActionGroup.d.ts.map +1 -1
  5. package/dist/ActionGroup/ActionGroup.js +20 -2
  6. package/dist/ActionGroup/ActionGroup.js.map +1 -1
  7. package/dist/Alert/Alert.css +25 -11
  8. package/dist/Alert/Alert.d.ts +14 -0
  9. package/dist/Alert/Alert.d.ts.map +1 -1
  10. package/dist/Alert/Alert.js +14 -2
  11. package/dist/Alert/Alert.js.map +1 -1
  12. package/dist/Grid/Grid.css +2 -2
  13. package/dist/Hero/Hero.css +638 -0
  14. package/dist/Note/Note.css +22 -14
  15. package/dist/Note/Note.d.ts +18 -3
  16. package/dist/Note/Note.d.ts.map +1 -1
  17. package/dist/Note/Note.js +18 -5
  18. package/dist/Note/Note.js.map +1 -1
  19. package/dist/PageBody/PageBody.css +30 -0
  20. package/dist/PageFooter/PageFooter.css +0 -1
  21. package/dist/SkipLink/SkipLink.d.ts +1 -1
  22. package/dist/SkipLink/SkipLink.js +1 -1
  23. package/dist/TableOfContents/TableOfContents.css +75 -0
  24. package/dist/TableOfContents/TableOfContents.d.ts +61 -0
  25. package/dist/TableOfContents/TableOfContents.d.ts.map +1 -0
  26. package/dist/TableOfContents/TableOfContents.js +32 -0
  27. package/dist/TableOfContents/TableOfContents.js.map +1 -0
  28. package/dist/TableOfContents/index.d.ts +3 -0
  29. package/dist/TableOfContents/index.d.ts.map +1 -0
  30. package/dist/TableOfContents/index.js +2 -0
  31. package/dist/TableOfContents/index.js.map +1 -0
  32. package/dist/index.css +851 -54
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +1 -0
  36. package/dist/index.js.map +1 -1
  37. package/package.json +3 -3
package/README.md CHANGED
@@ -101,7 +101,7 @@ function App() {
101
101
  - **TypeScript Support** - All components are fully typed
102
102
  - **JSDoc Documentation** - Comprehensive documentation with usage examples
103
103
  - **ForwardRef** - All components support ref forwarding
104
- - **Accessibility** - WCAG 2.1 Level AA compliant
104
+ - **Accessibility** - WCAG 2.2 Level AA compliant
105
105
  - **Composable** - Components are designed to work together
106
106
  - **Themeable** - Uses design tokens for easy customization
107
107
 
@@ -1,35 +1,55 @@
1
1
  /**
2
2
  * ActionGroup Component
3
3
  * Groups related actions (Buttons and Links) and manages their layout.
4
+ * Renders as a <ul> with each action in a <li>, with an aria-label
5
+ * describing the group — screenreaders announce the item count and the
6
+ * group's purpose (see issue #295).
4
7
  *
5
8
  * Usage:
6
9
  * <!-- Horizontal (default) — wraps automatically when viewport is too narrow -->
7
- * <div class="dsn-action-group">
8
- * <button class="dsn-button dsn-button--strong dsn-button--size-default">
9
- * <span class="dsn-button__label">Opslaan</span>
10
- * </button>
11
- * <button class="dsn-button dsn-button--subtle dsn-button--size-default">
12
- * <span class="dsn-button__label">Annuleren</span>
13
- * </button>
14
- * </div>
10
+ * <ul class="dsn-action-group" aria-label="Acties">
11
+ * <li class="dsn-action-group__item">
12
+ * <button class="dsn-button dsn-button--strong dsn-button--size-default">
13
+ * <span class="dsn-button__label">Opslaan</span>
14
+ * </button>
15
+ * </li>
16
+ * <li class="dsn-action-group__item">
17
+ * <button class="dsn-button dsn-button--subtle dsn-button--size-default">
18
+ * <span class="dsn-button__label">Annuleren</span>
19
+ * </button>
20
+ * </li>
21
+ * </ul>
15
22
  *
16
23
  * <!-- Horizontal with Link as soft exit -->
17
- * <div class="dsn-action-group">
18
- * <button class="dsn-button dsn-button--strong dsn-button--size-default">
19
- * <span class="dsn-button__label">Volgende stap</span>
20
- * </button>
21
- * <a class="dsn-link" href="/">Terug naar overzicht</a>
22
- * </div>
24
+ * <ul class="dsn-action-group" aria-label="Acties">
25
+ * <li class="dsn-action-group__item">
26
+ * <button class="dsn-button dsn-button--strong dsn-button--size-default">
27
+ * <span class="dsn-button__label">Volgende stap</span>
28
+ * </button>
29
+ * </li>
30
+ * <li class="dsn-action-group__item">
31
+ * <a class="dsn-link" href="/">Terug naar overzicht</a>
32
+ * </li>
33
+ * </ul>
23
34
  *
24
35
  * <!-- Vertical -->
25
- * <div class="dsn-action-group dsn-action-group--vertical">
26
- * <button class="dsn-button dsn-button--strong dsn-button--size-default">
27
- * <span class="dsn-button__label">Primaire actie</span>
28
- * </button>
29
- * <button class="dsn-button dsn-button--subtle dsn-button--size-default">
30
- * <span class="dsn-button__label">Secundaire actie</span>
31
- * </button>
32
- * </div>
36
+ * <ul class="dsn-action-group dsn-action-group--vertical" aria-label="Acties">
37
+ * <li class="dsn-action-group__item">
38
+ * <button class="dsn-button dsn-button--strong dsn-button--size-default">
39
+ * <span class="dsn-button__label">Primaire actie</span>
40
+ * </button>
41
+ * </li>
42
+ * <li class="dsn-action-group__item">
43
+ * <button class="dsn-button dsn-button--subtle dsn-button--size-default">
44
+ * <span class="dsn-button__label">Secundaire actie</span>
45
+ * </button>
46
+ * </li>
47
+ * </ul>
48
+ *
49
+ * <!-- Aangepast aria-label -->
50
+ * <ul class="dsn-action-group" aria-label="Formulierknoppen">
51
+ * ...
52
+ * </ul>
33
53
  */
34
54
 
35
55
  /* ===========================
@@ -40,15 +60,27 @@
40
60
  flex-direction: row;
41
61
  flex-wrap: wrap;
42
62
  align-items: center;
63
+ list-style: none;
64
+ margin: 0;
65
+ padding: 0;
43
66
  column-gap: var(--dsn-action-group-column-gap);
44
67
  row-gap: var(--dsn-action-group-row-gap);
45
68
  }
46
69
 
70
+ /* ===========================
71
+ Item — wraps each Button/Link
72
+ =========================== */
73
+ .dsn-action-group__item {
74
+ display: flex;
75
+ align-items: center;
76
+ }
77
+
47
78
  /* Link en LinkButton hebben align-self: flex-start om uitrekken te voorkomen
48
- in verticale contexten — in een horizontale ActionGroup resetten we dit
49
- zodat ze verticaal centreren met de Buttons naast hen. */
50
- .dsn-action-group:not(.dsn-action-group--vertical) > .dsn-link,
51
- .dsn-action-group:not(.dsn-action-group--vertical) > .dsn-link-button {
79
+ in verticale contexten — align-self op het element zelf overschrijft de
80
+ align-items van het omringende dsn-action-group__item, dus resetten we dit
81
+ hier zodat ze verticaal centreren met de Button ernaast. */
82
+ .dsn-action-group__item > .dsn-link,
83
+ .dsn-action-group__item > .dsn-link-button {
52
84
  align-self: center;
53
85
  }
54
86
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './ActionGroup.css';
3
- export interface ActionGroupProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ export interface ActionGroupProps extends React.HTMLAttributes<HTMLUListElement> {
4
4
  /**
5
5
  * Richting van de groep — horizontale rij met wrapping of verticale kolom
6
6
  * @default 'horizontal'
@@ -15,6 +15,8 @@ export interface ActionGroupProps extends React.HTMLAttributes<HTMLDivElement> {
15
15
  * ActionGroup component
16
16
  * Groepeert gerelateerde acties en verzorgt de lay-out van Buttons en Links.
17
17
  * Horizontale richting (default) wraps automatisch bij te weinig ruimte.
18
+ * Rendert als `<ul>` met elke actie in een `<li>`, zodat screenreaders het
19
+ * aantal acties en de groepsnaam aankondigen (zie issue #295).
18
20
  *
19
21
  * @example
20
22
  * ```tsx
@@ -35,7 +37,13 @@ export interface ActionGroupProps extends React.HTMLAttributes<HTMLDivElement> {
35
37
  * <Button variant="strong">Primaire actie</Button>
36
38
  * <Button variant="subtle">Secundaire actie</Button>
37
39
  * </ActionGroup>
40
+ *
41
+ * // Aangepast aria-label
42
+ * <ActionGroup aria-label="Formulierknoppen">
43
+ * <Button variant="strong" type="submit">Verstuur</Button>
44
+ * <Button variant="subtle">Annuleren</Button>
45
+ * </ActionGroup>
38
46
  * ```
39
47
  */
40
- export declare const ActionGroup: React.ForwardRefExoticComponent<ActionGroupProps & React.RefAttributes<HTMLDivElement>>;
48
+ export declare const ActionGroup: React.ForwardRefExoticComponent<ActionGroupProps & React.RefAttributes<HTMLUListElement>>;
41
49
  //# sourceMappingURL=ActionGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../src/ActionGroup/ActionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,yFAcvB,CAAC"}
1
+ {"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../src/ActionGroup/ActionGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC9E;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAEtC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,WAAW,2FA2BvB,CAAC"}
@@ -2,10 +2,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { classNames } from '@dsn-starter-kit/core';
4
4
  import './ActionGroup.css';
5
+ /**
6
+ * Flattens top-level React.Fragment children (e.g. `<>...</>`) so each
7
+ * action ends up as its own `<li>`, regardless of whether the caller wraps
8
+ * multiple children in a Fragment or passes them as direct JSX children.
9
+ */
10
+ function flattenActions(children) {
11
+ return React.Children.toArray(children).flatMap((child) => React.isValidElement(child) && child.type === React.Fragment
12
+ ? flattenActions(child.props.children)
13
+ : [child]);
14
+ }
5
15
  /**
6
16
  * ActionGroup component
7
17
  * Groepeert gerelateerde acties en verzorgt de lay-out van Buttons en Links.
8
18
  * Horizontale richting (default) wraps automatisch bij te weinig ruimte.
19
+ * Rendert als `<ul>` met elke actie in een `<li>`, zodat screenreaders het
20
+ * aantal acties en de groepsnaam aankondigen (zie issue #295).
9
21
  *
10
22
  * @example
11
23
  * ```tsx
@@ -26,11 +38,17 @@ import './ActionGroup.css';
26
38
  * <Button variant="strong">Primaire actie</Button>
27
39
  * <Button variant="subtle">Secundaire actie</Button>
28
40
  * </ActionGroup>
41
+ *
42
+ * // Aangepast aria-label
43
+ * <ActionGroup aria-label="Formulierknoppen">
44
+ * <Button variant="strong" type="submit">Verstuur</Button>
45
+ * <Button variant="subtle">Annuleren</Button>
46
+ * </ActionGroup>
29
47
  * ```
30
48
  */
31
- export const ActionGroup = React.forwardRef(({ className, direction = 'horizontal', children, ...props }, ref) => {
49
+ export const ActionGroup = React.forwardRef(({ className, direction = 'horizontal', 'aria-label': ariaLabel = 'Acties', children, ...props }, ref) => {
32
50
  const classes = classNames('dsn-action-group', direction === 'vertical' && 'dsn-action-group--vertical', className);
33
- return (_jsx("div", { ref: ref, className: classes, role: "group", ...props, children: children }));
51
+ return (_jsx("ul", { ref: ref, className: classes, "aria-label": ariaLabel, ...props, children: flattenActions(children).map((child, index) => (_jsx("li", { className: "dsn-action-group__item", children: child }, index))) }));
34
52
  });
35
53
  ActionGroup.displayName = 'ActionGroup';
36
54
  //# sourceMappingURL=ActionGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionGroup.js","sourceRoot":"","sources":["../../src/ActionGroup/ActionGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,mBAAmB,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AAY,EACxB,YAAY,EAAE,SAAS,GAAG,QAAQ,EAClC,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,OAAO,GAAG,UAAU,CACxB,kBAAkB,EAClB,SAAS,KAAK,UAAU,IAAI,4BAA4B,EACxD,SAAS,CACV,CAAC;IAEF,OAAO,CACL,aAAI,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,gBAAc,SAAS,KAAM,KAAK,YAC/D,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9C,aAAI,SAAS,EAAC,wBAAwB,YACnC,KAAK,IADoC,KAAK,CAE5C,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
@@ -7,11 +7,19 @@
7
7
  * Alert Component
8
8
  * Important message that informs the user about the current activity or state.
9
9
  *
10
+ * The icon is decorative (aria-hidden); a visually hidden variant label at the
11
+ * start of the heading announces the variant to screen reader users. Real text
12
+ * (not aria-label on the svg) so it gets translated by translation tools,
13
+ * works in braille and stays available when the icon is omitted.
14
+ * Default labels: "Informatie: " / "Succes: " / "Foutmelding: " / "Let op: ".
15
+ *
10
16
  * Usage:
11
17
  * <!-- Info variant (default), with icon -->
12
18
  * <div class="dsn-alert" role="alert">
13
- * <svg class="dsn-icon dsn-alert__icon" aria-hidden="true"><!-- info-circle --></svg>
14
- * <strong class="dsn-alert__heading">Heading</strong>
19
+ * <span class="dsn-alert__icon" aria-hidden="true">
20
+ * <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- info-circle --></svg>
21
+ * </span>
22
+ * <h2 class="dsn-heading dsn-heading--heading-3 dsn-alert__heading"><span class="dsn-visually-hidden">Informatie: </span>Heading</h2>
15
23
  * <div class="dsn-alert__content">
16
24
  * <p>Body text or any content.</p>
17
25
  * </div>
@@ -19,8 +27,10 @@
19
27
  *
20
28
  * <!-- Positive variant -->
21
29
  * <div class="dsn-alert dsn-alert--positive" role="alert">
22
- * <svg class="dsn-icon dsn-alert__icon" aria-hidden="true"><!-- circle-check --></svg>
23
- * <strong class="dsn-alert__heading">Gelukt</strong>
30
+ * <span class="dsn-alert__icon" aria-hidden="true">
31
+ * <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- circle-check --></svg>
32
+ * </span>
33
+ * <h2 class="dsn-heading dsn-heading--heading-3 dsn-alert__heading"><span class="dsn-visually-hidden">Succes: </span>Gelukt</h2>
24
34
  * <div class="dsn-alert__content">
25
35
  * <p>Uw aanvraag is succesvol ingediend.</p>
26
36
  * </div>
@@ -28,8 +38,10 @@
28
38
  *
29
39
  * <!-- Negative variant -->
30
40
  * <div class="dsn-alert dsn-alert--negative" role="alert">
31
- * <svg class="dsn-icon dsn-alert__icon" aria-hidden="true"><!-- exclamation-circle --></svg>
32
- * <strong class="dsn-alert__heading">Er is een fout opgetreden</strong>
41
+ * <span class="dsn-alert__icon" aria-hidden="true">
42
+ * <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- exclamation-circle --></svg>
43
+ * </span>
44
+ * <h2 class="dsn-heading dsn-heading--heading-3 dsn-alert__heading"><span class="dsn-visually-hidden">Foutmelding: </span>Er is een fout opgetreden</h2>
33
45
  * <div class="dsn-alert__content">
34
46
  * <p>Controleer uw gegevens en probeer het opnieuw.</p>
35
47
  * </div>
@@ -37,16 +49,18 @@
37
49
  *
38
50
  * <!-- Warning variant -->
39
51
  * <div class="dsn-alert dsn-alert--warning" role="alert">
40
- * <svg class="dsn-icon dsn-alert__icon" aria-hidden="true"><!-- alert-triangle --></svg>
41
- * <strong class="dsn-alert__heading">Let op</strong>
52
+ * <span class="dsn-alert__icon" aria-hidden="true">
53
+ * <svg class="dsn-icon dsn-icon--xl" aria-hidden="true"><!-- alert-triangle --></svg>
54
+ * </span>
55
+ * <h2 class="dsn-heading dsn-heading--heading-3 dsn-alert__heading"><span class="dsn-visually-hidden">Let op: </span>Uw sessie verloopt binnenkort</h2>
42
56
  * <div class="dsn-alert__content">
43
- * <p>Uw sessie verloopt binnenkort.</p>
57
+ * <p>Sla uw werk op om gegevensverlies te voorkomen.</p>
44
58
  * </div>
45
59
  * </div>
46
60
  *
47
- * <!-- Without icon -->
61
+ * <!-- Without icon: keep the visually hidden variant label -->
48
62
  * <div class="dsn-alert dsn-alert--no-icon" role="alert">
49
- * <strong class="dsn-alert__heading">Heading</strong>
63
+ * <h2 class="dsn-heading dsn-heading--heading-3 dsn-alert__heading"><span class="dsn-visually-hidden">Informatie: </span>Heading</h2>
50
64
  * <div class="dsn-alert__content">
51
65
  * <p>Body text without an icon.</p>
52
66
  * </div>
@@ -23,6 +23,15 @@ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
23
23
  * - `ReactNode` — aangepast icoon
24
24
  */
25
25
  iconStart?: React.ReactNode;
26
+ /**
27
+ * Visueel verborgen tekst vóór de heading die de variant benoemt voor
28
+ * screenreadergebruikers (inclusief scheidingsteken en spatie).
29
+ * - `undefined` (default) — standaardtekst per variant:
30
+ * `'Informatie: '` / `'Succes: '` / `'Foutmelding: '` / `'Let op: '`
31
+ * - `''` — geen variant-label (bijv. als de heading de variant al benoemt)
32
+ * - `string` — eigen tekst, bijv. voor een andere taal
33
+ */
34
+ variantLabel?: string;
26
35
  /**
27
36
  * Optionele body content (tekst, lijst, links, etc.)
28
37
  */
@@ -63,6 +72,11 @@ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
63
72
  * <Alert variant="info" heading="Tip" iconStart={<Icon name="star" aria-hidden />}>
64
73
  * Gebruik de zoekfunctie om snel te navigeren.
65
74
  * </Alert>
75
+ *
76
+ * // Variant-label onderdrukken (heading benoemt de variant al)
77
+ * <Alert variant="negative" heading="Foutmelding" variantLabel="">
78
+ * Controleer uw gegevens.
79
+ * </Alert>
66
80
  * ```
67
81
  */
68
82
  export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AASxE,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;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;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,KAAK,mFAmDjB,CAAC"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAgBxE,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;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;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,KAAK,mFAwDjB,CAAC"}
@@ -10,6 +10,12 @@ const PREFERRED_ICONS = {
10
10
  negative: 'exclamation-circle',
11
11
  warning: 'alert-triangle',
12
12
  };
13
+ const VARIANT_LABELS = {
14
+ info: 'Informatie: ',
15
+ positive: 'Succes: ',
16
+ negative: 'Foutmelding: ',
17
+ warning: 'Let op: ',
18
+ };
13
19
  /**
14
20
  * Alert component
15
21
  * Belangrijk bericht dat de gebruiker informeert over de huidige activiteit of toestand.
@@ -45,13 +51,19 @@ const PREFERRED_ICONS = {
45
51
  * <Alert variant="info" heading="Tip" iconStart={<Icon name="star" aria-hidden />}>
46
52
  * Gebruik de zoekfunctie om snel te navigeren.
47
53
  * </Alert>
54
+ *
55
+ * // Variant-label onderdrukken (heading benoemt de variant al)
56
+ * <Alert variant="negative" heading="Foutmelding" variantLabel="">
57
+ * Controleer uw gegevens.
58
+ * </Alert>
48
59
  * ```
49
60
  */
50
- export const Alert = React.forwardRef(({ className, variant = 'info', heading, headingLevel = 2, iconStart, children, ...props }, ref) => {
61
+ export const Alert = React.forwardRef(({ className, variant = 'info', heading, headingLevel = 2, iconStart, variantLabel, children, ...props }, ref) => {
51
62
  const noIcon = iconStart === null;
63
+ const resolvedVariantLabel = variantLabel ?? VARIANT_LABELS[variant];
52
64
  const resolvedIcon = iconStart === undefined ? (_jsx(Icon, { name: PREFERRED_ICONS[variant], size: "xl", "aria-hidden": true })) : (iconStart);
53
65
  const classes = classNames('dsn-alert', variant !== 'info' && `dsn-alert--${variant}`, noIcon && 'dsn-alert--no-icon', className);
54
- return (_jsxs("div", { ref: ref, className: classes, role: "alert", ...props, children: [!noIcon && (_jsx("span", { className: "dsn-alert__icon", "aria-hidden": true, children: resolvedIcon })), _jsx(Heading, { level: headingLevel, appearance: "heading-3", className: "dsn-alert__heading", children: heading }), children && _jsx("div", { className: "dsn-alert__content", children: children })] }));
66
+ return (_jsxs("div", { ref: ref, className: classes, role: "alert", ...props, children: [!noIcon && (_jsx("span", { className: "dsn-alert__icon", "aria-hidden": true, children: resolvedIcon })), _jsxs(Heading, { level: headingLevel, appearance: "heading-3", className: "dsn-alert__heading", children: [resolvedVariantLabel && (_jsx("span", { className: "dsn-visually-hidden", children: resolvedVariantLabel })), heading] }), children && _jsx("div", { className: "dsn-alert__content", children: children })] }));
55
67
  });
56
68
  Alert.displayName = 'Alert';
57
69
  //# sourceMappingURL=Alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/Alert/Alert.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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,aAAa,CAAC;AAIrB,MAAM,eAAe,GAAiC;IACpD,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,oBAAoB;IAC9B,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAkCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,CACE,EACE,SAAS,EACT,OAAO,GAAG,MAAM,EAChB,OAAO,EACP,YAAY,GAAG,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MA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AO,IACA,EACT,QAAQ,IAAI,cAAK,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAO,IAC7D,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
@@ -46,7 +46,7 @@
46
46
  grid-template-columns: repeat(12, 1fr);
47
47
  column-gap: var(--dsn-grid-gutter);
48
48
  row-gap: var(--dsn-grid-row-gap);
49
- padding-inline: var(--dsn-grid-margin);
49
+ padding-inline: var(--dsn-grid-padding-inline);
50
50
  }
51
51
 
52
52
  /* Max-width variant — gecentreerd met margin-inline: auto */
@@ -69,7 +69,7 @@
69
69
 
70
70
  .dsn-full-bleed {
71
71
  grid-column: 1 / -1;
72
- margin-inline: calc(-1 * var(--dsn-grid-margin));
72
+ margin-inline: calc(-1 * var(--dsn-grid-padding-inline));
73
73
  }
74
74
 
75
75
  /* ============================================================