|
1 | 1 | # Components |
2 | 2 |
|
3 | | -**Last Updated:** April 3, 2026 |
| 3 | +**Last Updated:** April 4, 2026 |
4 | 4 |
|
5 | 5 | Complete component specifications and guidelines for the Design System Starter Kit. |
6 | 6 |
|
@@ -1586,7 +1586,7 @@ const [isOpen, setIsOpen] = React.useState(false); |
1586 | 1586 |
|
1587 | 1587 | ## Navigation Components |
1588 | 1588 |
|
1589 | | -**Status:** Complete (HTML/CSS, React) — 1 component total |
| 1589 | +**Status:** Complete (HTML/CSS, React) — 3 components total |
1590 | 1590 |
|
1591 | 1591 | ### BreadcrumbNavigation |
1592 | 1592 |
|
@@ -1682,6 +1682,148 @@ const [isOpen, setIsOpen] = React.useState(false); |
1682 | 1682 |
|
1683 | 1683 | --- |
1684 | 1684 |
|
| 1685 | +### MenuLink |
| 1686 | + |
| 1687 | +**Status:** Complete (HTML/CSS, React) |
| 1688 | + |
| 1689 | +**Location:** `packages/components-{html|react}/src/MenuLink/` |
| 1690 | + |
| 1691 | +**Tokens:** `tokens/components/menu-item.json` (gedeeld) + `tokens/components/menu-link.json` (MenuLink-specifiek) |
| 1692 | + |
| 1693 | +**Props:** `href`, `level` (1–4), `current`, `iconStart`, `iconEnd`, `numberBadge`, `subItems`, `expanded`, `onExpandToggle`, `children`, `className` |
| 1694 | + |
| 1695 | +**Features:** |
| 1696 | + |
| 1697 | +- Semantisch een `<a>`, visueel consistent met MenuButton — gebruik voor URL-navigatie |
| 1698 | +- Rendeert als `<li class="dsn-menu-link">` — altijd in een `<ul>` plaatsen |
| 1699 | +- `level` prop (1–4) stelt hiërarchische inspringing in via `margin-inline-start` op de link |
| 1700 | +- `current` prop voegt `aria-current="page"` toe en toont een `border-inline-start` indicator (3px) |
| 1701 | +- `subItems` prop toont een uitklapknop naast de link; `expanded` beheert de open/dichte staat |
| 1702 | +- `numberBadge` slot voor een `<NumberBadge>` rechts van het label |
| 1703 | +- Gedeelde visuele stijl via `--dsn-menu-item-*` tokens; current-staat via `--dsn-menu-link-current-*` |
| 1704 | + |
| 1705 | +**CSS-klassen:** |
| 1706 | + |
| 1707 | +| Klasse | Element | Beschrijving | |
| 1708 | +| ------------------------------ | ---------- | --------------------------------------------------------- | |
| 1709 | +| `dsn-menu-link` | `<li>` | Basiscomponent — altijd aanwezig | |
| 1710 | +| `dsn-menu-link--level-2` | `<li>` | Inspringing: 1× `level-indent` | |
| 1711 | +| `dsn-menu-link--level-3` | `<li>` | Inspringing: 2× `level-indent` | |
| 1712 | +| `dsn-menu-link--level-4` | `<li>` | Inspringing: 3× `level-indent` | |
| 1713 | +| `dsn-menu-link__link` | `<a>` | De navigatielink — bevat icoon, label, badge | |
| 1714 | +| `dsn-menu-link__label` | `<span>` | Zichtbare linktekst | |
| 1715 | +| `dsn-menu-link__divider` | `<span>` | Decoratieve scheidingslijn tussen link en uitklapknop | |
| 1716 | +| `dsn-menu-link__expand-button` | `<button>` | Uitklapknop; `aria-expanded` toggle; chevron roteert 180° | |
| 1717 | + |
| 1718 | +**Usage:** |
| 1719 | + |
| 1720 | +```html |
| 1721 | +<!-- HTML/CSS — level 1, standaard --> |
| 1722 | +<ul style="list-style: none; margin: 0; padding: 0;"> |
| 1723 | + <li class="dsn-menu-link"> |
| 1724 | + <a class="dsn-menu-link__link" href="/dashboard"> |
| 1725 | + <svg class="dsn-icon" aria-hidden="true"><!-- home --></svg> |
| 1726 | + <span class="dsn-menu-link__label">Dashboard</span> |
| 1727 | + </a> |
| 1728 | + </li> |
| 1729 | + <!-- level 2, actieve pagina --> |
| 1730 | + <li class="dsn-menu-link dsn-menu-link--level-2"> |
| 1731 | + <a class="dsn-menu-link__link" href="/rapporten" aria-current="page"> |
| 1732 | + <span class="dsn-menu-link__label">Rapporten</span> |
| 1733 | + </a> |
| 1734 | + </li> |
| 1735 | +</ul> |
| 1736 | +``` |
| 1737 | + |
| 1738 | +```tsx |
| 1739 | +// React |
| 1740 | +<MenuLink href="/dashboard" iconStart={<Icon name="home" aria-hidden />}> |
| 1741 | + Dashboard |
| 1742 | +</MenuLink> |
| 1743 | +<MenuLink href="/rapporten" level={2} current> |
| 1744 | + Rapporten |
| 1745 | +</MenuLink> |
| 1746 | +<MenuLink href="/inbox" numberBadge={<NumberBadge variant="negative">5</NumberBadge>}> |
| 1747 | + Inbox |
| 1748 | +</MenuLink> |
| 1749 | +``` |
| 1750 | + |
| 1751 | +**Tests:** React (27 tests) |
| 1752 | + |
| 1753 | +--- |
| 1754 | + |
| 1755 | +### MenuButton |
| 1756 | + |
| 1757 | +**Status:** Complete (HTML/CSS, React) |
| 1758 | + |
| 1759 | +**Location:** `packages/components-{html|react}/src/MenuButton/` |
| 1760 | + |
| 1761 | +**Tokens:** `tokens/components/menu-item.json` (gedeeld met MenuLink) |
| 1762 | + |
| 1763 | +**Props:** `iconStart`, `iconEnd`, `dotBadge`, `children`, `className` + alle native `<button>` attributen |
| 1764 | + |
| 1765 | +**Features:** |
| 1766 | + |
| 1767 | +- Semantisch een `<button>`, visueel consistent met MenuLink — gebruik voor JS-acties (uitloggen, modal openen, etc.) |
| 1768 | +- Rendeert als `<li class="dsn-menu-button">` — altijd in een `<ul>` plaatsen |
| 1769 | +- `dotBadge` slot voor een `<DotBadge>` die rechtsboven de tekst zweeft (gerenderd in de label-span, `position: relative`) |
| 1770 | +- Geen disabled state — niet van toepassing in navigatiecontext |
| 1771 | +- Volledig gedeelde visuele stijl via `--dsn-menu-item-*` tokens |
| 1772 | + |
| 1773 | +**CSS-klassen:** |
| 1774 | + |
| 1775 | +| Klasse | Element | Beschrijving | |
| 1776 | +| ------------------------- | ---------- | ------------------------------------------------------------------------ | |
| 1777 | +| `dsn-menu-button` | `<li>` | Basiscomponent — altijd aanwezig | |
| 1778 | +| `dsn-menu-button__button` | `<button>` | De knop — button-reset + volledige breedte, flexbox layout | |
| 1779 | +| `dsn-menu-button__label` | `<span>` | Zichtbare knoptekst; `flex: 1`; `position: relative` voor dotBadge anker | |
| 1780 | + |
| 1781 | +**Usage:** |
| 1782 | + |
| 1783 | +```html |
| 1784 | +<!-- HTML/CSS --> |
| 1785 | +<ul style="list-style: none; margin: 0; padding: 0;"> |
| 1786 | + <li class="dsn-menu-button"> |
| 1787 | + <button type="button" class="dsn-menu-button__button"> |
| 1788 | + <svg class="dsn-icon" aria-hidden="true"><!-- settings --></svg> |
| 1789 | + <span class="dsn-menu-button__label">Instellingen</span> |
| 1790 | + </button> |
| 1791 | + </li> |
| 1792 | + <!-- met DotBadge --> |
| 1793 | + <li class="dsn-menu-button"> |
| 1794 | + <button type="button" class="dsn-menu-button__button"> |
| 1795 | + <svg class="dsn-icon" aria-hidden="true"><!-- bell --></svg> |
| 1796 | + <span class="dsn-menu-button__label"> |
| 1797 | + Meldingen |
| 1798 | + <span class="dsn-visually-hidden">, nieuwe meldingen beschikbaar</span> |
| 1799 | + <span |
| 1800 | + class="dsn-dot-badge dsn-dot-badge--negative" |
| 1801 | + aria-hidden="true" |
| 1802 | + ></span> |
| 1803 | + </span> |
| 1804 | + </button> |
| 1805 | + </li> |
| 1806 | +</ul> |
| 1807 | +``` |
| 1808 | + |
| 1809 | +```tsx |
| 1810 | +// React |
| 1811 | +<MenuButton iconStart={<Icon name="settings" aria-hidden />}> |
| 1812 | + Instellingen |
| 1813 | +</MenuButton> |
| 1814 | +<MenuButton |
| 1815 | + iconStart={<Icon name="bell" aria-hidden />} |
| 1816 | + dotBadge={<DotBadge variant="negative" />} |
| 1817 | +> |
| 1818 | + Meldingen |
| 1819 | + <span className="dsn-visually-hidden">, nieuwe meldingen beschikbaar</span> |
| 1820 | +</MenuButton> |
| 1821 | +``` |
| 1822 | + |
| 1823 | +**Tests:** React (13 tests) |
| 1824 | + |
| 1825 | +--- |
| 1826 | + |
1685 | 1827 | ## Form Components |
1686 | 1828 |
|
1687 | 1829 | **Status:** Complete (HTML/CSS, React) — 25 components total |
|
0 commit comments