@amsterdam/design-system-react 2.0.2 → 2.2.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 (302) hide show
  1. package/dist/Accordion/Accordion.d.ts +3 -3
  2. package/dist/Accordion/AccordionSection.d.ts +5 -5
  3. package/dist/Avatar/Avatar.d.ts +2 -2
  4. package/dist/Badge/Badge.d.ts +4 -4
  5. package/dist/Blockquote/Blockquote.d.ts +5 -5
  6. package/dist/Breakout/BreakoutCell.d.ts +2 -2
  7. package/dist/Button/Button.d.ts +7 -5
  8. package/dist/Button/Button.js +1 -0
  9. package/dist/Card/Card.d.ts +8 -8
  10. package/dist/Card/CardHeading.d.ts +3 -3
  11. package/dist/Card/CardHeadingGroup.d.ts +5 -5
  12. package/dist/Card/CardImage.d.ts +2 -2
  13. package/dist/Checkbox/Checkbox.d.ts +5 -5
  14. package/dist/Column/Column.d.ts +5 -5
  15. package/dist/DateInput/DateInput.d.ts +4 -4
  16. package/dist/DescriptionList/DescriptionList.d.ts +5 -5
  17. package/dist/Dialog/Dialog.d.ts +6 -7
  18. package/dist/Field/Field.d.ts +5 -5
  19. package/dist/FieldSet/FieldSet.d.ts +31 -10
  20. package/dist/FieldSet/FieldSet.js +4 -3
  21. package/dist/Figure/Figure.d.ts +3 -3
  22. package/dist/Figure/FigureCaption.d.ts +5 -5
  23. package/dist/FileList/FileList.d.ts +2 -2
  24. package/dist/FileList/FileListItem.d.ts +4 -4
  25. package/dist/Grid/Grid.d.ts +2 -2
  26. package/dist/Grid/GridCell.d.ts +2 -2
  27. package/dist/Heading/Heading.d.ts +10 -11
  28. package/dist/Heading/Heading.js +1 -0
  29. package/dist/Hint/Hint.d.ts +1 -0
  30. package/dist/Hint/Hint.js +2 -2
  31. package/dist/Icon/Icon.d.ts +0 -4
  32. package/dist/IconButton/IconButton.d.ts +4 -2
  33. package/dist/IconButton/IconButton.js +1 -0
  34. package/dist/Image/Image.d.ts +5 -5
  35. package/dist/Image/Image.js +1 -1
  36. package/dist/ImageSlider/ImageSlider.d.ts +4 -4
  37. package/dist/ImageSlider/ImageSliderItem.d.ts +5 -5
  38. package/dist/ImageSlider/ImageSliderThumbnails.d.ts +5 -5
  39. package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.d.ts +2 -2
  40. package/dist/Label/Label.d.ts +25 -6
  41. package/dist/Label/Label.js +3 -2
  42. package/dist/Link/Link.d.ts +4 -4
  43. package/dist/LinkList/LinkList.d.ts +1 -1
  44. package/dist/LinkList/LinkListLink.d.ts +9 -4
  45. package/dist/LinkList/LinkListLink.js +2 -0
  46. package/dist/Logo/Logo.d.ts +2 -2
  47. package/dist/Menu/Menu.d.ts +31 -10
  48. package/dist/Menu/Menu.js +6 -1
  49. package/dist/Menu/MenuLink.d.ts +10 -4
  50. package/dist/OrderedList/OrderedList.d.ts +5 -5
  51. package/dist/Page/Page.d.ts +6 -2
  52. package/dist/Page/Page.js +1 -1
  53. package/dist/PageHeader/PageHeader.d.ts +8 -7
  54. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.d.ts +1 -1
  55. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +0 -4
  56. package/dist/PageHeader/PageHeaderMenuIcon.js +1 -1
  57. package/dist/PageHeader/PageHeaderMenuLink.d.ts +13 -6
  58. package/dist/PageHeader/PageHeaderMenuLink.js +3 -6
  59. package/dist/PageHeading/PageHeading.d.ts +5 -5
  60. package/dist/Pagination/LinkItem.d.ts +3 -3
  61. package/dist/Pagination/Pagination.d.ts +4 -4
  62. package/dist/Paragraph/Paragraph.d.ts +5 -9
  63. package/dist/PasswordInput/PasswordInput.d.ts +4 -4
  64. package/dist/Radio/Radio.d.ts +5 -5
  65. package/dist/Row/Row.d.ts +5 -5
  66. package/dist/SearchField/SearchField.d.ts +2 -2
  67. package/dist/SearchField/SearchFieldButton.js +1 -1
  68. package/dist/SearchField/SearchFieldInput.d.ts +2 -2
  69. package/dist/Select/Select.d.ts +5 -5
  70. package/dist/Spotlight/Spotlight.d.ts +6 -6
  71. package/dist/Spotlight/Spotlight.js +0 -4
  72. package/dist/StandaloneLink/StandaloneLink.d.ts +4 -4
  73. package/dist/Table/TableCaption.d.ts +0 -4
  74. package/dist/TableOfContents/TableOfContents.d.ts +7 -7
  75. package/dist/TableOfContents/TableOfContentsLink.d.ts +4 -4
  76. package/dist/Tabs/Tabs.d.ts +11 -11
  77. package/dist/Tabs/TabsButton.d.ts +5 -5
  78. package/dist/Tabs/TabsPanel.d.ts +5 -5
  79. package/dist/TextArea/TextArea.d.ts +12 -6
  80. package/dist/TextInput/TextInput.d.ts +4 -4
  81. package/dist/TimeInput/TimeInput.d.ts +4 -4
  82. package/dist/UnorderedList/UnorderedList.d.ts +5 -5
  83. package/dist/common/useIsAfterBreakpoint.d.ts +4 -0
  84. package/dist/common/useIsAfterBreakpoint.js +4 -4
  85. package/dist/index.cjs.js +62 -44
  86. package/dist/index.cjs.js.map +1 -1
  87. package/dist/index.d.ts +293 -218
  88. package/dist/index.esm.js +62 -44
  89. package/dist/index.esm.js.map +1 -1
  90. package/dist/tsconfig.build.tsbuildinfo +1 -0
  91. package/package.json +21 -20
  92. package/dist/Accordion/Accordion.test.d.ts +0 -5
  93. package/dist/Accordion/Accordion.test.js +0 -44
  94. package/dist/Accordion/AccordionSection.test.d.ts +0 -5
  95. package/dist/Accordion/AccordionSection.test.js +0 -100
  96. package/dist/ActionGroup/ActionGroup.test.d.ts +0 -5
  97. package/dist/ActionGroup/ActionGroup.test.js +0 -33
  98. package/dist/Alert/Alert.test.d.ts +0 -5
  99. package/dist/Alert/Alert.test.js +0 -74
  100. package/dist/Avatar/Avatar.test.d.ts +0 -5
  101. package/dist/Avatar/Avatar.test.js +0 -63
  102. package/dist/Badge/Badge.test.d.ts +0 -5
  103. package/dist/Badge/Badge.test.js +0 -43
  104. package/dist/Blockquote/Blockquote.test.d.ts +0 -5
  105. package/dist/Blockquote/Blockquote.test.js +0 -46
  106. package/dist/Breadcrumb/Breadcrumb.test.d.ts +0 -5
  107. package/dist/Breadcrumb/Breadcrumb.test.js +0 -45
  108. package/dist/Breadcrumb/BreadcrumbLink.test.d.ts +0 -5
  109. package/dist/Breadcrumb/BreadcrumbLink.test.js +0 -40
  110. package/dist/Breakout/Breakout.test.d.ts +0 -5
  111. package/dist/Breakout/Breakout.test.js +0 -62
  112. package/dist/Breakout/BreakoutCell.test.d.ts +0 -5
  113. package/dist/Breakout/BreakoutCell.test.js +0 -128
  114. package/dist/Button/Button.test.d.ts +0 -5
  115. package/dist/Button/Button.test.js +0 -114
  116. package/dist/CallToActionLink/CallToActionLink.test.d.ts +0 -5
  117. package/dist/CallToActionLink/CallToActionLink.test.js +0 -33
  118. package/dist/Card/Card.test.d.ts +0 -5
  119. package/dist/Card/Card.test.js +0 -33
  120. package/dist/Card/CardHeading.test.d.ts +0 -5
  121. package/dist/Card/CardHeading.test.js +0 -38
  122. package/dist/Card/CardHeadingGroup.test.d.ts +0 -5
  123. package/dist/Card/CardHeadingGroup.test.js +0 -38
  124. package/dist/Card/CardImage.test.d.ts +0 -5
  125. package/dist/Card/CardImage.test.js +0 -33
  126. package/dist/Card/CardLink.test.d.ts +0 -5
  127. package/dist/Card/CardLink.test.js +0 -33
  128. package/dist/CharacterCount/CharacterCount.test.d.ts +0 -5
  129. package/dist/CharacterCount/CharacterCount.test.js +0 -38
  130. package/dist/Checkbox/Checkbox.test.d.ts +0 -5
  131. package/dist/Checkbox/Checkbox.test.js +0 -142
  132. package/dist/Column/Column.test.d.ts +0 -5
  133. package/dist/Column/Column.test.js +0 -59
  134. package/dist/DateInput/DateInput.test.d.ts +0 -5
  135. package/dist/DateInput/DateInput.test.js +0 -58
  136. package/dist/DescriptionList/DescriptionList.test.d.ts +0 -5
  137. package/dist/DescriptionList/DescriptionList.test.js +0 -43
  138. package/dist/DescriptionList/DescriptionListDescription.test.d.ts +0 -5
  139. package/dist/DescriptionList/DescriptionListDescription.test.js +0 -33
  140. package/dist/DescriptionList/DescriptionListSection.test.d.ts +0 -5
  141. package/dist/DescriptionList/DescriptionListSection.test.js +0 -33
  142. package/dist/DescriptionList/DescriptionListTerm.test.d.ts +0 -5
  143. package/dist/DescriptionList/DescriptionListTerm.test.js +0 -33
  144. package/dist/Dialog/Dialog.test.d.ts +0 -5
  145. package/dist/Dialog/Dialog.test.js +0 -82
  146. package/dist/ErrorMessage/ErrorMessage.test.d.ts +0 -5
  147. package/dist/ErrorMessage/ErrorMessage.test.js +0 -53
  148. package/dist/Field/Field.test.d.ts +0 -5
  149. package/dist/Field/Field.test.js +0 -38
  150. package/dist/FieldSet/FieldSet.test.d.ts +0 -5
  151. package/dist/FieldSet/FieldSet.test.js +0 -63
  152. package/dist/Figure/Figure.test.d.ts +0 -5
  153. package/dist/Figure/Figure.test.js +0 -33
  154. package/dist/Figure/FigureCaption.test.d.ts +0 -5
  155. package/dist/Figure/FigureCaption.test.js +0 -38
  156. package/dist/FileInput/FileInput.test.d.ts +0 -5
  157. package/dist/FileInput/FileInput.test.js +0 -33
  158. package/dist/FileList/FileList.test.d.ts +0 -5
  159. package/dist/FileList/FileList.test.js +0 -33
  160. package/dist/FileList/FileListItem.test.d.ts +0 -5
  161. package/dist/FileList/FileListItem.test.js +0 -44
  162. package/dist/Grid/Grid.test.d.ts +0 -5
  163. package/dist/Grid/Grid.test.js +0 -69
  164. package/dist/Grid/GridCell.test.d.ts +0 -5
  165. package/dist/Grid/GridCell.test.js +0 -84
  166. package/dist/Heading/Heading.test.d.ts +0 -5
  167. package/dist/Heading/Heading.test.js +0 -70
  168. package/dist/Hint/Hint.test.d.ts +0 -5
  169. package/dist/Hint/Hint.test.js +0 -53
  170. package/dist/Icon/Icon.test.d.ts +0 -5
  171. package/dist/Icon/Icon.test.js +0 -60
  172. package/dist/IconButton/IconButton.test.d.ts +0 -5
  173. package/dist/IconButton/IconButton.test.js +0 -48
  174. package/dist/Image/Image.test.d.ts +0 -5
  175. package/dist/Image/Image.test.js +0 -43
  176. package/dist/ImageSlider/ImageSlider.test.d.ts +0 -5
  177. package/dist/ImageSlider/ImageSlider.test.js +0 -70
  178. package/dist/ImageSlider/ImageSliderControls.test.d.ts +0 -5
  179. package/dist/ImageSlider/ImageSliderControls.test.js +0 -25
  180. package/dist/ImageSlider/ImageSliderItem.test.d.ts +0 -5
  181. package/dist/ImageSlider/ImageSliderItem.test.js +0 -37
  182. package/dist/ImageSlider/ImageSliderScroller.test.d.ts +0 -5
  183. package/dist/ImageSlider/ImageSliderScroller.test.js +0 -37
  184. package/dist/ImageSlider/ImageSliderThumbnails.test.d.ts +0 -5
  185. package/dist/ImageSlider/ImageSliderThumbnails.test.js +0 -52
  186. package/dist/InvalidFormAlert/InvalidFormAlert.test.d.ts +0 -5
  187. package/dist/InvalidFormAlert/InvalidFormAlert.test.js +0 -108
  188. package/dist/Label/Label.test.d.ts +0 -5
  189. package/dist/Label/Label.test.js +0 -77
  190. package/dist/Link/Link.test.d.ts +0 -5
  191. package/dist/Link/Link.test.js +0 -43
  192. package/dist/LinkList/LinkList.test.d.ts +0 -5
  193. package/dist/LinkList/LinkList.test.js +0 -33
  194. package/dist/LinkList/LinkListLink.test.d.ts +0 -5
  195. package/dist/LinkList/LinkListLink.test.js +0 -54
  196. package/dist/Logo/Logo.test.d.ts +0 -5
  197. package/dist/Logo/Logo.test.js +0 -33
  198. package/dist/Mark/Mark.test.d.ts +0 -5
  199. package/dist/Mark/Mark.test.js +0 -33
  200. package/dist/Menu/Menu.test.d.ts +0 -5
  201. package/dist/Menu/Menu.test.js +0 -38
  202. package/dist/Menu/MenuLink.test.d.ts +0 -5
  203. package/dist/Menu/MenuLink.test.js +0 -56
  204. package/dist/OrderedList/OrderedList.test.d.ts +0 -5
  205. package/dist/OrderedList/OrderedList.test.js +0 -55
  206. package/dist/OrderedList/OrderedListItem.test.d.ts +0 -5
  207. package/dist/OrderedList/OrderedListItem.test.js +0 -32
  208. package/dist/Overlap/Overlap.test.d.ts +0 -5
  209. package/dist/Overlap/Overlap.test.js +0 -38
  210. package/dist/Page/Page.test.d.ts +0 -5
  211. package/dist/Page/Page.test.js +0 -33
  212. package/dist/PageFooter/PageFooter.test.d.ts +0 -5
  213. package/dist/PageFooter/PageFooter.test.js +0 -33
  214. package/dist/PageFooter/PageFooterMenu.test.d.ts +0 -5
  215. package/dist/PageFooter/PageFooterMenu.test.js +0 -35
  216. package/dist/PageFooter/PageFooterMenuLink.test.d.ts +0 -5
  217. package/dist/PageFooter/PageFooterMenuLink.test.js +0 -33
  218. package/dist/PageFooter/PageFooterSpotlight.test.d.ts +0 -5
  219. package/dist/PageFooter/PageFooterSpotlight.test.js +0 -33
  220. package/dist/PageHeader/PageHeader.test.d.ts +0 -6
  221. package/dist/PageHeader/PageHeader.test.js +0 -135
  222. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.d.ts +0 -5
  223. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.js +0 -38
  224. package/dist/PageHeader/PageHeaderMenuLink.test.d.ts +0 -5
  225. package/dist/PageHeader/PageHeaderMenuLink.test.js +0 -45
  226. package/dist/PageHeading/PageHeading.test.d.ts +0 -5
  227. package/dist/PageHeading/PageHeading.test.js +0 -40
  228. package/dist/Pagination/Pagination.test.d.ts +0 -5
  229. package/dist/Pagination/Pagination.test.js +0 -137
  230. package/dist/Paragraph/Paragraph.test.d.ts +0 -5
  231. package/dist/Paragraph/Paragraph.test.js +0 -62
  232. package/dist/PasswordInput/PasswordInput.test.d.ts +0 -5
  233. package/dist/PasswordInput/PasswordInput.test.js +0 -89
  234. package/dist/Radio/Radio.test.d.ts +0 -5
  235. package/dist/Radio/Radio.test.js +0 -134
  236. package/dist/Row/Row.test.d.ts +0 -5
  237. package/dist/Row/Row.test.js +0 -64
  238. package/dist/SearchField/SearchField.test.d.ts +0 -5
  239. package/dist/SearchField/SearchField.test.js +0 -50
  240. package/dist/SearchField/SearchFieldInput.test.d.ts +0 -5
  241. package/dist/SearchField/SearchFieldInput.test.js +0 -65
  242. package/dist/Select/Select.test.d.ts +0 -5
  243. package/dist/Select/Select.test.js +0 -74
  244. package/dist/Select/SelectOption.test.d.ts +0 -5
  245. package/dist/Select/SelectOption.test.js +0 -45
  246. package/dist/Select/SelectOptionGroup.test.d.ts +0 -5
  247. package/dist/Select/SelectOptionGroup.test.js +0 -45
  248. package/dist/SkipLink/SkipLink.test.d.ts +0 -5
  249. package/dist/SkipLink/SkipLink.test.js +0 -33
  250. package/dist/Spotlight/Spotlight.test.d.ts +0 -5
  251. package/dist/Spotlight/Spotlight.test.js +0 -46
  252. package/dist/StandaloneLink/StandaloneLink.test.d.ts +0 -5
  253. package/dist/StandaloneLink/StandaloneLink.test.js +0 -46
  254. package/dist/Switch/Switch.test.d.ts +0 -5
  255. package/dist/Switch/Switch.test.js +0 -69
  256. package/dist/Table/Table.test.d.ts +0 -5
  257. package/dist/Table/Table.test.js +0 -33
  258. package/dist/Table/TableBody.test.d.ts +0 -5
  259. package/dist/Table/TableBody.test.js +0 -34
  260. package/dist/Table/TableCaption.test.d.ts +0 -5
  261. package/dist/Table/TableCaption.test.js +0 -45
  262. package/dist/Table/TableCell.test.d.ts +0 -5
  263. package/dist/Table/TableCell.test.js +0 -36
  264. package/dist/Table/TableFooter.test.d.ts +0 -5
  265. package/dist/Table/TableFooter.test.js +0 -34
  266. package/dist/Table/TableHeader.test.d.ts +0 -5
  267. package/dist/Table/TableHeader.test.js +0 -34
  268. package/dist/Table/TableHeaderCell.test.d.ts +0 -5
  269. package/dist/Table/TableHeaderCell.test.js +0 -42
  270. package/dist/Table/TableRow.test.d.ts +0 -5
  271. package/dist/Table/TableRow.test.js +0 -35
  272. package/dist/TableOfContents/TableOfContents.test.d.ts +0 -5
  273. package/dist/TableOfContents/TableOfContents.test.js +0 -44
  274. package/dist/TableOfContents/TableOfContentsLink.test.d.ts +0 -5
  275. package/dist/TableOfContents/TableOfContentsLink.test.js +0 -34
  276. package/dist/TableOfContents/TableOfContentsList.test.d.ts +0 -5
  277. package/dist/TableOfContents/TableOfContentsList.test.js +0 -40
  278. package/dist/Tabs/Tabs.test.d.ts +0 -5
  279. package/dist/Tabs/Tabs.test.js +0 -104
  280. package/dist/Tabs/TabsButton.test.d.ts +0 -5
  281. package/dist/Tabs/TabsButton.test.js +0 -57
  282. package/dist/Tabs/TabsList.test.d.ts +0 -5
  283. package/dist/Tabs/TabsList.test.js +0 -32
  284. package/dist/Tabs/TabsPanel.test.d.ts +0 -5
  285. package/dist/Tabs/TabsPanel.test.js +0 -42
  286. package/dist/TextArea/TextArea.test.d.ts +0 -5
  287. package/dist/TextArea/TextArea.test.js +0 -105
  288. package/dist/TextInput/TextInput.test.d.ts +0 -5
  289. package/dist/TextInput/TextInput.test.js +0 -92
  290. package/dist/TimeInput/TimeInput.test.d.ts +0 -5
  291. package/dist/TimeInput/TimeInput.test.js +0 -51
  292. package/dist/UnorderedList/UnorderedList.test.d.ts +0 -5
  293. package/dist/UnorderedList/UnorderedList.test.js +0 -55
  294. package/dist/UnorderedList/UnorderedListItem.test.d.ts +0 -5
  295. package/dist/UnorderedList/UnorderedListItem.test.js +0 -32
  296. package/dist/common/formatFileSize.test.d.ts +0 -5
  297. package/dist/common/formatFileSize.test.js +0 -22
  298. package/dist/common/formatFileType.test.d.ts +0 -5
  299. package/dist/common/formatFileType.test.js +0 -27
  300. package/dist/common/useKeyboardFocus.test.d.ts +0 -5
  301. package/dist/common/useKeyboardFocus.test.js +0 -79
  302. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { getHeadingTag } from './getHeadingTag';
5
+ export const headingSizes = [1, 2, 3, 4];
5
6
  /**
6
7
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-heading--docs Heading docs at Amsterdam Design System}
7
8
  */
@@ -6,6 +6,7 @@ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
6
  type HintAndOptionalProps = {
7
7
  /** Show a custom hint text. */
8
8
  hint?: string;
9
+ inFieldSet?: boolean;
9
10
  /** Appends the text '(niet verplicht)' to the label or legend if no hint is provided. Use when the associated inputs are optional. */
10
11
  optional?: boolean;
11
12
  };
package/dist/Hint/Hint.js CHANGED
@@ -10,8 +10,8 @@ const getHintText = ({ hint, optional }) => {
10
10
  }
11
11
  return null;
12
12
  };
13
- export const Hint = forwardRef(({ className, hint, optional, ...restProps }, ref) => {
13
+ export const Hint = forwardRef(({ className, hint, inFieldSet, optional, ...restProps }, ref) => {
14
14
  const hintText = getHintText({ hint, optional });
15
- return (hintText && (_jsxs("span", { ...restProps, className: clsx('ams-hint', className), ref: ref, children: ["(", hintText, ")"] })));
15
+ return (hintText && (_jsxs("span", { ...restProps, className: clsx('ams-hint', inFieldSet && 'ams-hint--in-fieldset', className), ref: ref, children: ["(", hintText, ")"] })));
16
16
  });
17
17
  Hint.displayName = 'Hint';
@@ -1,7 +1,3 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
1
  /**
6
2
  * @license EUPL-1.2+
7
3
  * Copyright (c) 2021 Gemeente Utrecht
@@ -4,9 +4,11 @@
4
4
  */
5
5
  import type { ButtonHTMLAttributes } from 'react';
6
6
  import type { IconProps } from '../Icon';
7
+ export declare const iconButtonColors: readonly ["contrast", "inverse"];
8
+ export type IconButtonColor = (typeof iconButtonColors)[number];
7
9
  export type IconButtonProps = {
8
10
  /** Changes the text colour for readability on a light or dark background. */
9
- color?: 'contrast' | 'inverse';
11
+ color?: IconButtonColor;
10
12
  /** The accessible text for the button. Will be announced by screen readers. Should describe the button’s action. */
11
13
  label: string;
12
14
  /** The size of the icon. Match it to the text that the Icon Buttons aligns with. */
@@ -19,7 +21,7 @@ export type IconButtonProps = {
19
21
  */
20
22
  export declare const IconButton: import("react").ForwardRefExoticComponent<{
21
23
  /** Changes the text colour for readability on a light or dark background. */
22
- color?: "contrast" | "inverse";
24
+ color?: IconButtonColor;
23
25
  /** The accessible text for the button. Will be announced by screen readers. Should describe the button’s action. */
24
26
  label: string;
25
27
  /** The size of the icon. Match it to the text that the Icon Buttons aligns with. */
@@ -3,6 +3,7 @@ import { CloseIcon } from '@amsterdam/design-system-react-icons';
3
3
  import { clsx } from 'clsx';
4
4
  import { forwardRef } from 'react';
5
5
  import { Icon } from '../Icon';
6
+ export const iconButtonColors = ['contrast', 'inverse'];
6
7
  /**
7
8
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-buttons-icon-button--docs Icon Button docs at Amsterdam Design System}
8
9
  */
@@ -3,15 +3,15 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { ImgHTMLAttributes } from 'react';
6
- import { AspectRatioProps } from '../common/types';
7
- export type ImageProps = AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'> & {
6
+ import type { AspectRatioProps } from '../common/types';
7
+ export type ImageProps = {
8
8
  /** A textual description of the content of the image. */
9
9
  alt: string;
10
- };
10
+ } & AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'>;
11
11
  /**
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-image--docs Image docs at Amsterdam Design System}
13
13
  */
14
- export declare const Image: import("react").ForwardRefExoticComponent<AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> & {
14
+ export declare const Image: import("react").ForwardRefExoticComponent<{
15
15
  /** A textual description of the content of the image. */
16
16
  alt: string;
17
- } & import("react").RefAttributes<HTMLImageElement>>;
17
+ } & AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> & import("react").RefAttributes<HTMLImageElement>>;
@@ -5,5 +5,5 @@ import { generateAspectRatioClass } from './generateAspectRatioClass';
5
5
  /**
6
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-image--docs Image docs at Amsterdam Design System}
7
7
  */
8
- export const Image = forwardRef(({ aspectRatio, className, ...restProps }, ref) => (_jsx("img", { ...restProps, className: clsx('ams-image', generateAspectRatioClass(aspectRatio), className), ref: ref, width: 600 })));
8
+ export const Image = forwardRef(({ aspectRatio, className, width, ...restProps }, ref) => (_jsx("img", { ...restProps, className: clsx('ams-image', generateAspectRatioClass(aspectRatio), className), ref: ref, width: width ?? 600 })));
9
9
  Image.displayName = 'Image';
@@ -3,7 +3,7 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes } from 'react';
6
- import { ImageProps } from '../Image/Image';
6
+ import type { ImageProps } from '../Image/Image';
7
7
  export type ImageSliderImageProps = ImageProps;
8
8
  export type ImageSliderProps = {
9
9
  /** Display buttons to navigate to the previous or next image. */
@@ -44,9 +44,9 @@ export declare const ImageSlider: import("react").ForwardRefExoticComponent<{
44
44
  /** The label for the ‘previous’ button */
45
45
  previousLabel?: string;
46
46
  } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>> & {
47
- Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
48
- children?: import("react").ReactNode | undefined;
49
- } & {
47
+ Item: import("react").ForwardRefExoticComponent<{
50
48
  slideId: number;
49
+ } & HTMLAttributes<HTMLDivElement> & {
50
+ children?: import("react").ReactNode | undefined;
51
51
  } & import("react").RefAttributes<HTMLDivElement>>;
52
52
  };
@@ -3,13 +3,13 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type ImageSliderItemProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
6
+ export type ImageSliderItemProps = {
7
7
  /** The identifier of the item. Must match the key or order of the slides (starting at 0). */
8
8
  slideId: number;
9
- };
10
- export declare const ImageSliderItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
11
- children?: import("react").ReactNode | undefined;
12
- } & {
9
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
10
+ export declare const ImageSliderItem: import("react").ForwardRefExoticComponent<{
13
11
  /** The identifier of the item. Must match the key or order of the slides (starting at 0). */
14
12
  slideId: number;
13
+ } & HTMLAttributes<HTMLDivElement> & {
14
+ children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -3,12 +3,12 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes } from 'react';
6
- import { ImageSliderImageProps } from './ImageSlider';
7
- export type ImageSliderThumbnailsProps = HTMLAttributes<HTMLElement> & {
6
+ import type { ImageSliderImageProps } from './ImageSlider';
7
+ export type ImageSliderThumbnailsProps = {
8
8
  imageLabel?: string;
9
9
  thumbnails: ImageSliderImageProps[];
10
- };
11
- export declare const ImageSliderThumbnails: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
10
+ } & HTMLAttributes<HTMLElement>;
11
+ export declare const ImageSliderThumbnails: import("react").ForwardRefExoticComponent<{
12
12
  imageLabel?: string;
13
13
  thumbnails: ImageSliderImageProps[];
14
- } & import("react").RefAttributes<HTMLElement>>;
14
+ } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { Dispatch, SetStateAction } from 'react';
6
6
  import type { InvalidFormAlertProps } from './InvalidFormAlert';
7
- export declare const InvalidFormAlertWithErrors: import("react").ForwardRefExoticComponent<Omit<InvalidFormAlertProps, "errorCountLabel"> & {
7
+ export declare const InvalidFormAlertWithErrors: import("react").ForwardRefExoticComponent<{
8
8
  /** Whether the component has set focus once. */
9
9
  hasFocusedOnce: boolean;
10
10
  /** Callback to let parent component know whether focus has been set once. */
11
11
  setHasFocusedOnce: Dispatch<SetStateAction<boolean>>;
12
- } & import("react").RefAttributes<HTMLDivElement>>;
12
+ } & Omit<InvalidFormAlertProps, "errorCountLabel"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,20 +1,39 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
1
  /**
6
2
  * @license EUPL-1.2+
7
3
  * Copyright (c) 2021 Robbert Broersma
8
4
  * Copyright Gemeente Amsterdam
9
5
  */
10
6
  import type { LabelHTMLAttributes, PropsWithChildren } from 'react';
11
- import { HintProps } from '../Hint';
12
- export type LabelProps = HintProps & PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>>;
7
+ import type { HintProps } from '../Hint';
8
+ export type LabelProps = {
9
+ /**
10
+ * Whether the label is nested inside a fieldset.
11
+ * This will show the label in a lighter style.
12
+ */
13
+ inFieldSet?: boolean;
14
+ /**
15
+ * Render a level 1 heading around the label.
16
+ * Set this if the Field is the only content of the page.
17
+ */
18
+ isPageHeading?: boolean;
19
+ } & HintProps & PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>>;
13
20
  /**
14
21
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-label--docs Label docs at Amsterdam Design System}
15
22
  */
16
23
  export declare const Label: import("react").ForwardRefExoticComponent<{
24
+ /**
25
+ * Whether the label is nested inside a fieldset.
26
+ * This will show the label in a lighter style.
27
+ */
28
+ inFieldSet?: boolean;
29
+ /**
30
+ * Render a level 1 heading around the label.
31
+ * Set this if the Field is the only content of the page.
32
+ */
33
+ isPageHeading?: boolean;
34
+ } & {
17
35
  hint?: string;
36
+ inFieldSet?: boolean;
18
37
  optional?: boolean;
19
38
  } & import("react").HTMLAttributes<HTMLElement> & {
20
39
  children?: import("react").ReactNode | undefined;
@@ -5,7 +5,8 @@ import { Hint } from '../Hint';
5
5
  /**
6
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-label--docs Label docs at Amsterdam Design System}
7
7
  */
8
- export const Label = forwardRef(({ children, className, hint, optional, ...restProps }, ref) => {
9
- return (_jsxs("label", { ...restProps, className: clsx('ams-label', className), ref: ref, children: [children, " ", _jsx(Hint, { hint: hint, optional: optional })] }));
8
+ export const Label = forwardRef(({ children, className, hint, inFieldSet, isPageHeading, optional, ...restProps }, ref) => {
9
+ const labelElement = (_jsxs("label", { ...restProps, className: clsx('ams-label', inFieldSet && 'ams-label--in-fieldset', className), ref: ref, children: [children, " ", _jsx(Hint, { hint: hint, inFieldSet: inFieldSet, optional: optional })] }));
10
+ return isPageHeading ? _jsx("h1", { className: "ams-label__heading", children: labelElement }) : labelElement;
10
11
  });
11
12
  Label.displayName = 'Label';
@@ -3,14 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes } from 'react';
6
- export type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'> & {
6
+ export type LinkProps = {
7
7
  /** Changes the text colour for readability on a light or dark background. */
8
8
  color?: 'contrast' | 'inverse';
9
- };
9
+ } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'>;
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-link--docs Link docs at Amsterdam Design System}
12
12
  */
13
- export declare const Link: import("react").ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & {
13
+ export declare const Link: import("react").ForwardRefExoticComponent<{
14
14
  /** Changes the text colour for readability on a light or dark background. */
15
15
  color?: "contrast" | "inverse";
16
- } & import("react").RefAttributes<HTMLAnchorElement>>;
16
+ } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -11,7 +11,7 @@ export declare const LinkList: import("react").ForwardRefExoticComponent<HTMLAtt
11
11
  children?: import("react").ReactNode | undefined;
12
12
  } & import("react").RefAttributes<HTMLUListElement>> & {
13
13
  Link: import("react").ForwardRefExoticComponent<{
14
- color?: "contrast" | "inverse";
14
+ color?: "inverse" | "contrast";
15
15
  icon?: import("..").IconProps["svg"];
16
16
  size?: "small" | "large";
17
17
  } & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -4,9 +4,13 @@
4
4
  */
5
5
  import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
6
  import type { IconProps } from '../Icon';
7
+ export declare const linkListLinkColors: readonly ["contrast", "inverse"];
8
+ type LinkListLinkColor = (typeof linkListLinkColors)[number];
9
+ export declare const linkListLinkSizes: readonly ["small", "large"];
10
+ type LinkListLinkSize = (typeof linkListLinkSizes)[number];
7
11
  export type LinkListLinkProps = {
8
12
  /** Changes the text colour for readability on a light or dark background. */
9
- color?: 'contrast' | 'inverse';
13
+ color?: LinkListLinkColor;
10
14
  /**
11
15
  * An icon to display instead of the default chevron.
12
16
  * Don’t mix custom icons with chevrons in one list.
@@ -14,12 +18,12 @@ export type LinkListLinkProps = {
14
18
  */
15
19
  icon?: IconProps['svg'];
16
20
  /** The size of the text. Use the same size for all items in the list. */
17
- size?: 'small' | 'large';
21
+ size?: LinkListLinkSize;
18
22
  } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
19
23
  /** One link with a Link List. */
20
24
  export declare const LinkListLink: import("react").ForwardRefExoticComponent<{
21
25
  /** Changes the text colour for readability on a light or dark background. */
22
- color?: "contrast" | "inverse";
26
+ color?: LinkListLinkColor;
23
27
  /**
24
28
  * An icon to display instead of the default chevron.
25
29
  * Don’t mix custom icons with chevrons in one list.
@@ -27,7 +31,8 @@ export declare const LinkListLink: import("react").ForwardRefExoticComponent<{
27
31
  */
28
32
  icon?: IconProps["svg"];
29
33
  /** The size of the text. Use the same size for all items in the list. */
30
- size?: "small" | "large";
34
+ size?: LinkListLinkSize;
31
35
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
32
36
  children?: import("react").ReactNode | undefined;
33
37
  } & import("react").RefAttributes<HTMLAnchorElement>>;
38
+ export {};
@@ -3,6 +3,8 @@ import { ChevronForwardIcon } from '@amsterdam/design-system-react-icons';
3
3
  import { clsx } from 'clsx';
4
4
  import { forwardRef } from 'react';
5
5
  import { Icon } from '../Icon';
6
+ export const linkListLinkColors = ['contrast', 'inverse'];
7
+ export const linkListLinkSizes = ['small', 'large'];
6
8
  /** One link with a Link List. */
7
9
  export const LinkListLink = forwardRef(({ children, className, color, icon = ChevronForwardIcon, size, ...restProps }, ref) => {
8
10
  return (_jsx("li", { children: _jsxs("a", { className: clsx('ams-link-list__link', color && `ams-link-list__link--${color}`, size && `ams-link-list__link--${size}`, className), ref: ref, ...restProps, children: [_jsx(Icon, { size: size, svg: icon }), children] }) }));
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
6
6
  export type LogoBrand = 'amsterdam' | 'ggd-amsterdam' | 'museum-weesp' | 'stadsarchief' | 'stadsbank-van-lening' | 'vga-verzekeringen';
7
- export type LogoProps = SVGProps<SVGSVGElement> & {
7
+ export type LogoProps = {
8
8
  /** The name of the brand for which to display the logo. */
9
9
  brand?: LogoBrand;
10
- };
10
+ } & SVGProps<SVGSVGElement>;
11
11
  /**
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-logo--docs Logo docs at Amsterdam Design System}
13
13
  */
@@ -3,22 +3,43 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type MenuProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
6
+ export type MenuProps = {
7
+ /**
8
+ * A name for this menu, which screen readers will announce.
9
+ * Only applies to the `inWideWindow` appearance: otherwise, the menu is in the Page Header, which ensures accessibility itself.
10
+ * @default Hoofdnavigatie
11
+ */
7
12
  accessibleName?: string;
8
- };
9
- export declare const MenuRoot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
10
- children?: import("react").ReactNode | undefined;
11
- } & {
13
+ /** Hides the component on narrow windows. */
14
+ inWideWindow?: boolean;
15
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
16
+ export declare const MenuRoot: import("react").ForwardRefExoticComponent<{
17
+ /**
18
+ * A name for this menu, which screen readers will announce.
19
+ * Only applies to the `inWideWindow` appearance: otherwise, the menu is in the Page Header, which ensures accessibility itself.
20
+ * @default Hoofdnavigatie
21
+ */
12
22
  accessibleName?: string;
13
- } & import("react").RefAttributes<HTMLElement>>;
23
+ /** Hides the component on narrow windows. */
24
+ inWideWindow?: boolean;
25
+ } & HTMLAttributes<HTMLElement> & {
26
+ children?: import("react").ReactNode | undefined;
27
+ } & import("react").RefAttributes<any>>;
14
28
  /**
15
29
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-menu--docs Menu docs at Amsterdam Design System}
16
30
  */
17
- export declare const Menu: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
18
- children?: import("react").ReactNode | undefined;
19
- } & {
31
+ export declare const Menu: import("react").ForwardRefExoticComponent<{
32
+ /**
33
+ * A name for this menu, which screen readers will announce.
34
+ * Only applies to the `inWideWindow` appearance: otherwise, the menu is in the Page Header, which ensures accessibility itself.
35
+ * @default Hoofdnavigatie
36
+ */
20
37
  accessibleName?: string;
21
- } & import("react").RefAttributes<HTMLElement>> & {
38
+ /** Hides the component on narrow windows. */
39
+ inWideWindow?: boolean;
40
+ } & HTMLAttributes<HTMLElement> & {
41
+ children?: import("react").ReactNode | undefined;
42
+ } & import("react").RefAttributes<any>> & {
22
43
  Link: import("react").ForwardRefExoticComponent<{
23
44
  color?: "contrast" | "inverse";
24
45
  icon: import("..").IconProps["svg"];
package/dist/Menu/Menu.js CHANGED
@@ -2,7 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { MenuLink } from './MenuLink';
5
- export const MenuRoot = forwardRef(({ accessibleName = 'Hoofdnavigatie', children, className, ...restProps }, ref) => (_jsxs("nav", { ...restProps, "aria-labelledby": "primary-navigation", className: clsx('ams-menu', className), ref: ref, children: [_jsx("h2", { className: "ams-visually-hidden", id: "primary-navigation", children: accessibleName }), _jsx("ul", { className: "ams-menu__list", children: children })] })));
5
+ export const MenuRoot = forwardRef(({ accessibleName = 'Hoofdnavigatie', children, className, inWideWindow, ...restProps }, ref) => {
6
+ // In a medium or narrow window, the Menu is a child of the `nav` of Page Header.
7
+ // In a wide window, we render a `nav` element and the related accessibility features.
8
+ const Tag = inWideWindow ? 'nav' : 'div';
9
+ return (_jsxs(Tag, { ...restProps, "aria-labelledby": inWideWindow ? 'primary-navigation' : undefined, className: clsx('ams-menu', inWideWindow && `ams-menu--in-wide-window`, className), ref: ref, children: [inWideWindow && (_jsx("h2", { className: "ams-visually-hidden", id: "primary-navigation", children: accessibleName })), _jsx("ul", { className: "ams-menu__list", children: children })] }));
10
+ });
6
11
  MenuRoot.displayName = 'Menu';
7
12
  /**
8
13
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-menu--docs Menu docs at Amsterdam Design System}
@@ -5,15 +5,21 @@
5
5
  import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
6
  import type { IconProps } from '../Icon';
7
7
  export type MenuLinkProps = {
8
- /** Changes the text colour for readability on a light or dark background. */
8
+ /**
9
+ * Changes the text colour for readability on a light or dark background.
10
+ * @deprecated The menu has a dark background now, so this is no longer needed.
11
+ */
9
12
  color?: 'contrast' | 'inverse';
10
- /** An icon to display instead of the default chevron. Don’t mix custom icons with chevrons in one list. */
13
+ /** The icon to display for the menu icon. Use the filled variant. */
11
14
  icon: IconProps['svg'];
12
15
  } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
13
16
  export declare const MenuLink: import("react").ForwardRefExoticComponent<{
14
- /** Changes the text colour for readability on a light or dark background. */
17
+ /**
18
+ * Changes the text colour for readability on a light or dark background.
19
+ * @deprecated The menu has a dark background now, so this is no longer needed.
20
+ */
15
21
  color?: "contrast" | "inverse";
16
- /** An icon to display instead of the default chevron. Don’t mix custom icons with chevrons in one list. */
22
+ /** The icon to display for the menu icon. Use the filled variant. */
17
23
  icon: IconProps["svg"];
18
24
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
19
25
  children?: import("react").ReactNode | undefined;
@@ -3,26 +3,26 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { OlHTMLAttributes, PropsWithChildren } from 'react';
6
- export type OrderedListProps = PropsWithChildren<OlHTMLAttributes<HTMLOListElement>> & {
6
+ export type OrderedListProps = {
7
7
  /** Changes the text colour for readability on a dark background. */
8
8
  color?: 'inverse';
9
9
  /** Whether the list items show a marker. */
10
10
  markers?: boolean;
11
11
  /** The size of the text. */
12
12
  size?: 'small';
13
- };
13
+ } & PropsWithChildren<OlHTMLAttributes<HTMLOListElement>>;
14
14
  /**
15
15
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-ordered-list--docs Ordered List docs at Amsterdam Design System}
16
16
  */
17
- export declare const OrderedList: import("react").ForwardRefExoticComponent<OlHTMLAttributes<HTMLOListElement> & {
18
- children?: import("react").ReactNode | undefined;
19
- } & {
17
+ export declare const OrderedList: import("react").ForwardRefExoticComponent<{
20
18
  /** Changes the text colour for readability on a dark background. */
21
19
  color?: "inverse";
22
20
  /** Whether the list items show a marker. */
23
21
  markers?: boolean;
24
22
  /** The size of the text. */
25
23
  size?: "small";
24
+ } & OlHTMLAttributes<HTMLOListElement> & {
25
+ children?: import("react").ReactNode | undefined;
26
26
  } & import("react").RefAttributes<HTMLOListElement>> & {
27
27
  Item: import("react").ForwardRefExoticComponent<import("react").LiHTMLAttributes<HTMLLIElement> & {
28
28
  children?: import("react").ReactNode | undefined;
@@ -3,10 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type PageProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
6
+ export type PageProps = {
7
+ withMenu?: boolean;
8
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
7
9
  /**
8
10
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-page--docs Page docs at Amsterdam Design System}
9
11
  */
10
- export declare const Page: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
12
+ export declare const Page: import("react").ForwardRefExoticComponent<{
13
+ withMenu?: boolean;
14
+ } & HTMLAttributes<HTMLDivElement> & {
11
15
  children?: import("react").ReactNode | undefined;
12
16
  } & import("react").RefAttributes<HTMLDivElement>>;
package/dist/Page/Page.js CHANGED
@@ -4,5 +4,5 @@ import { forwardRef } from 'react';
4
4
  /**
5
5
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-page--docs Page docs at Amsterdam Design System}
6
6
  */
7
- export const Page = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-page', className), ref: ref, children: children })));
7
+ export const Page = forwardRef(({ children, className, withMenu, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-page', withMenu && 'ams-page--with-menu', className), ref: ref, children: children })));
8
8
  Page.displayName = 'Page';
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { AnchorHTMLAttributes, ComponentType, HTMLAttributes, ReactNode } from 'react';
6
6
  import type { LogoBrand } from '../Logo';
7
- export type PageHeaderProps = HTMLAttributes<HTMLElement> & {
7
+ export type PageHeaderProps = {
8
8
  /** The name of the application. */
9
9
  brandName?: string;
10
10
  /** The accessible name of the logo. */
@@ -25,11 +25,11 @@ export type PageHeaderProps = HTMLAttributes<HTMLElement> & {
25
25
  navigationLabel?: string;
26
26
  /** Whether the menu button is visible on wide screens. */
27
27
  noMenuButtonOnWideWindow?: boolean;
28
- };
28
+ } & HTMLAttributes<HTMLElement>;
29
29
  /**
30
30
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-page-header--docs Page Header docs at Amsterdam Design System}
31
31
  */
32
- export declare const PageHeader: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
32
+ export declare const PageHeader: import("react").ForwardRefExoticComponent<{
33
33
  /** The name of the application. */
34
34
  brandName?: string;
35
35
  /** The accessible name of the logo. */
@@ -50,11 +50,12 @@ export declare const PageHeader: import("react").ForwardRefExoticComponent<HTMLA
50
50
  navigationLabel?: string;
51
51
  /** Whether the menu button is visible on wide screens. */
52
52
  noMenuButtonOnWideWindow?: boolean;
53
- } & import("react").RefAttributes<HTMLElement>> & {
53
+ } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>> & {
54
54
  GridCellNarrowWindowOnly: import("react").ForwardRefExoticComponent<import("..").GridCellProps & import("react").RefAttributes<HTMLElement>>;
55
- MenuLink: import("react").ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
56
- children?: ReactNode | undefined;
57
- } & {
55
+ MenuLink: import("react").ForwardRefExoticComponent<{
58
56
  fixed?: boolean;
57
+ icon?: import("../Icon").IconProps["svg"];
58
+ } & AnchorHTMLAttributes<HTMLAnchorElement> & {
59
+ children?: ReactNode | undefined;
59
60
  } & import("react").RefAttributes<HTMLAnchorElement>>;
60
61
  };
@@ -2,5 +2,5 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
- import { GridCellProps } from '../Grid';
5
+ import type { GridCellProps } from '../Grid';
6
6
  export declare const PageHeaderGridCellNarrowWindowOnly: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,8 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
2
  import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  import { Grid } from '../Grid';
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const PageHeaderMenuIcon = (props) => (_jsxs("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("line", { className: "ams-page-header__menu-icon-top", x1: "0", x2: "100%", y1: "50%", y2: "50%" }), _jsx("line", { className: "ams-page-header__menu-icon-middle", x1: "0", x2: "100%", y1: "50%", y2: "50%" }), _jsx("line", { className: "ams-page-header__menu-icon-bottom", x1: "0", x2: "100%", y1: "50%", y2: "50%" })] }));
2
+ export const PageHeaderMenuIcon = (props) => (_jsxs("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { className: "ams-page-header__menu-icon-top", d: "M1 5h22v2H1z" }), _jsx("path", { className: "ams-page-header__menu-icon-middle", d: "M1 11h22v2H1z" }), _jsx("path", { className: "ams-page-header__menu-icon-bottom", d: "M1 17h22v2H1z" })] }));
@@ -2,12 +2,19 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
- import { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
- export type PageHeaderMenuLinkProps = PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>> & {
5
+ import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { IconProps } from '../Icon';
7
+ export type PageHeaderMenuLinkProps = {
8
+ /** Whether the link appears in the Page Header on narrow windows. */
7
9
  fixed?: boolean;
8
- };
9
- export declare const PageHeaderMenuLink: import("react").ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
10
- children?: import("react").ReactNode | undefined;
11
- } & {
10
+ /** An icon to display at the end of the label. */
11
+ icon?: IconProps['svg'];
12
+ } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
13
+ export declare const PageHeaderMenuLink: import("react").ForwardRefExoticComponent<{
14
+ /** Whether the link appears in the Page Header on narrow windows. */
12
15
  fixed?: boolean;
16
+ /** An icon to display at the end of the label. */
17
+ icon?: IconProps["svg"];
18
+ } & AnchorHTMLAttributes<HTMLAnchorElement> & {
19
+ children?: import("react").ReactNode | undefined;
13
20
  } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,9 +1,6 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
2
  import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
- export const PageHeaderMenuLink = forwardRef(({ children, className, fixed, ...restProps }, ref) => (_jsx("li", { className: clsx('ams-page-header__menu-item', fixed && 'ams-page-header__menu-item--fixed'), children: _jsx("a", { ...restProps, className: clsx('ams-page-header__menu-link', className), ref: ref, children: children }) })));
4
+ import { Icon } from '../Icon';
5
+ export const PageHeaderMenuLink = forwardRef(({ children, className, fixed, icon, ...restProps }, ref) => (_jsx("li", { className: clsx('ams-page-header__menu-item', fixed && 'ams-page-header__menu-item--fixed'), children: _jsxs("a", { ...restProps, className: clsx('ams-page-header__menu-link', className), ref: ref, children: [children, icon && _jsx(Icon, { svg: icon })] }) })));
9
6
  PageHeaderMenuLink.displayName = 'PageHeader.MenuLink';
@@ -3,17 +3,17 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type PageHeadingProps = PropsWithChildren<HTMLAttributes<HTMLHeadingElement>> & {
6
+ export type PageHeadingProps = {
7
7
  /** Changes the text colour for readability on a dark background. */
8
8
  color?: 'inverse';
9
- };
9
+ } & PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>;
10
10
  /**
11
11
  * @deprecated We no longer use this size of headings. Use `Heading` with level 1 instead.
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-page-heading--docs Page Heading docs at Amsterdam Design System}
13
13
  */
14
- export declare const PageHeading: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
15
- children?: import("react").ReactNode | undefined;
16
- } & {
14
+ export declare const PageHeading: import("react").ForwardRefExoticComponent<{
17
15
  /** Changes the text colour for readability on a dark background. */
18
16
  color?: "inverse";
17
+ } & HTMLAttributes<HTMLHeadingElement> & {
18
+ children?: import("react").ReactNode | undefined;
19
19
  } & import("react").RefAttributes<HTMLHeadingElement>>;