@amsterdam/design-system-react 2.1.0 → 3.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 (279) hide show
  1. package/README.md +1 -1
  2. package/dist/Avatar/Avatar.d.ts +2 -2
  3. package/dist/Card/Card.d.ts +1 -1
  4. package/dist/Card/CardHeading.d.ts +1 -1
  5. package/dist/Checkbox/Checkbox.d.ts +1 -1
  6. package/dist/Column/Column.d.ts +1 -1
  7. package/dist/DateInput/DateInput.d.ts +1 -1
  8. package/dist/FieldSet/FieldSet.d.ts +11 -0
  9. package/dist/FieldSet/FieldSet.js +3 -3
  10. package/dist/Grid/Grid.d.ts +1 -1
  11. package/dist/Grid/GridCell.d.ts +1 -1
  12. package/dist/Hint/Hint.d.ts +1 -0
  13. package/dist/Hint/Hint.js +2 -2
  14. package/dist/Image/Image.js +1 -1
  15. package/dist/Label/Label.d.ts +11 -0
  16. package/dist/Label/Label.js +2 -2
  17. package/dist/LinkList/LinkList.d.ts +1 -1
  18. package/dist/Logo/Logo.d.ts +10 -5
  19. package/dist/Logo/Logo.js +17 -9
  20. package/dist/Menu/MenuLink.d.ts +2 -2
  21. package/dist/Page/Page.d.ts +6 -2
  22. package/dist/Page/Page.js +1 -1
  23. package/dist/PageFooter/PageFooter.d.ts +4 -1
  24. package/dist/PageFooter/PageFooterMenu.d.ts +27 -2
  25. package/dist/PageFooter/PageFooterMenu.js +6 -2
  26. package/dist/PageHeader/PageHeader.d.ts +14 -4
  27. package/dist/PageHeader/PageHeader.js +3 -2
  28. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +2 -1
  29. package/dist/PageHeader/PageHeaderMenuIcon.js +1 -1
  30. package/dist/PageHeader/PageHeaderMenuLink.d.ts +7 -0
  31. package/dist/PageHeader/PageHeaderMenuLink.js +3 -2
  32. package/dist/Paragraph/Paragraph.d.ts +2 -2
  33. package/dist/Paragraph/Paragraph.js +8 -1
  34. package/dist/PasswordInput/PasswordInput.d.ts +1 -1
  35. package/dist/Radio/Radio.d.ts +1 -1
  36. package/dist/Row/Row.d.ts +1 -1
  37. package/dist/SearchField/SearchField.d.ts +1 -1
  38. package/dist/Spotlight/Spotlight.d.ts +1 -1
  39. package/dist/TimeInput/TimeInput.d.ts +1 -1
  40. package/dist/common/useIsAfterBreakpoint.d.ts +4 -4
  41. package/dist/common/useIsAfterBreakpoint.js +12 -13
  42. package/dist/index.cjs.js +95 -62
  43. package/dist/index.cjs.js.map +1 -1
  44. package/dist/index.d.ts +1958 -61
  45. package/dist/index.esm.js +96 -63
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/tsconfig.build.tsbuildinfo +1 -1
  48. package/package.json +11 -16
  49. package/dist/Accordion/Accordion.test.d.ts +0 -5
  50. package/dist/Accordion/Accordion.test.js +0 -44
  51. package/dist/Accordion/AccordionSection.test.d.ts +0 -5
  52. package/dist/Accordion/AccordionSection.test.js +0 -100
  53. package/dist/ActionGroup/ActionGroup.test.d.ts +0 -5
  54. package/dist/ActionGroup/ActionGroup.test.js +0 -33
  55. package/dist/Alert/Alert.test.d.ts +0 -5
  56. package/dist/Alert/Alert.test.js +0 -74
  57. package/dist/App/App.d.ts +0 -12
  58. package/dist/App/App.js +0 -8
  59. package/dist/App/App.test.d.ts +0 -5
  60. package/dist/App/App.test.js +0 -33
  61. package/dist/App/index.d.ts +0 -6
  62. package/dist/App/index.js +0 -5
  63. package/dist/AppNavigation/AppNavigation.d.ts +0 -45
  64. package/dist/AppNavigation/AppNavigation.js +0 -18
  65. package/dist/AppNavigation/AppNavigation.test.d.ts +0 -5
  66. package/dist/AppNavigation/AppNavigation.test.js +0 -33
  67. package/dist/AppNavigation/AppNavigationButton.d.ts +0 -18
  68. package/dist/AppNavigation/AppNavigationButton.js +0 -17
  69. package/dist/AppNavigation/AppNavigationLink.d.ts +0 -19
  70. package/dist/AppNavigation/AppNavigationLink.js +0 -19
  71. package/dist/AppNavigation/AppNavigationMenu.d.ts +0 -9
  72. package/dist/AppNavigation/AppNavigationMenu.js +0 -5
  73. package/dist/AppNavigation/index.d.ts +0 -6
  74. package/dist/AppNavigation/index.js +0 -5
  75. package/dist/Avatar/Avatar.test.d.ts +0 -5
  76. package/dist/Avatar/Avatar.test.js +0 -63
  77. package/dist/Badge/Badge.test.d.ts +0 -5
  78. package/dist/Badge/Badge.test.js +0 -43
  79. package/dist/Blockquote/Blockquote.test.d.ts +0 -5
  80. package/dist/Blockquote/Blockquote.test.js +0 -46
  81. package/dist/Breadcrumb/Breadcrumb.test.d.ts +0 -5
  82. package/dist/Breadcrumb/Breadcrumb.test.js +0 -45
  83. package/dist/Breadcrumb/BreadcrumbLink.test.d.ts +0 -5
  84. package/dist/Breadcrumb/BreadcrumbLink.test.js +0 -40
  85. package/dist/Breakout/Breakout.test.d.ts +0 -5
  86. package/dist/Breakout/Breakout.test.js +0 -62
  87. package/dist/Breakout/BreakoutCell.test.d.ts +0 -5
  88. package/dist/Breakout/BreakoutCell.test.js +0 -128
  89. package/dist/Button/Button.test.d.ts +0 -5
  90. package/dist/Button/Button.test.js +0 -114
  91. package/dist/CallToActionLink/CallToActionLink.test.d.ts +0 -5
  92. package/dist/CallToActionLink/CallToActionLink.test.js +0 -33
  93. package/dist/Card/Card.test.d.ts +0 -5
  94. package/dist/Card/Card.test.js +0 -33
  95. package/dist/Card/CardHeading.test.d.ts +0 -5
  96. package/dist/Card/CardHeading.test.js +0 -38
  97. package/dist/Card/CardHeadingGroup.test.d.ts +0 -5
  98. package/dist/Card/CardHeadingGroup.test.js +0 -38
  99. package/dist/Card/CardImage.test.d.ts +0 -5
  100. package/dist/Card/CardImage.test.js +0 -33
  101. package/dist/Card/CardLink.test.d.ts +0 -5
  102. package/dist/Card/CardLink.test.js +0 -33
  103. package/dist/CharacterCount/CharacterCount.test.d.ts +0 -5
  104. package/dist/CharacterCount/CharacterCount.test.js +0 -38
  105. package/dist/Checkbox/Checkbox.test.d.ts +0 -5
  106. package/dist/Checkbox/Checkbox.test.js +0 -142
  107. package/dist/Column/Column.test.d.ts +0 -5
  108. package/dist/Column/Column.test.js +0 -59
  109. package/dist/DateInput/DateInput.test.d.ts +0 -5
  110. package/dist/DateInput/DateInput.test.js +0 -58
  111. package/dist/DescriptionList/DescriptionList.test.d.ts +0 -5
  112. package/dist/DescriptionList/DescriptionList.test.js +0 -43
  113. package/dist/DescriptionList/DescriptionListDescription.test.d.ts +0 -5
  114. package/dist/DescriptionList/DescriptionListDescription.test.js +0 -33
  115. package/dist/DescriptionList/DescriptionListSection.test.d.ts +0 -5
  116. package/dist/DescriptionList/DescriptionListSection.test.js +0 -33
  117. package/dist/DescriptionList/DescriptionListTerm.test.d.ts +0 -5
  118. package/dist/DescriptionList/DescriptionListTerm.test.js +0 -33
  119. package/dist/Dialog/Dialog.test.d.ts +0 -5
  120. package/dist/Dialog/Dialog.test.js +0 -82
  121. package/dist/ErrorMessage/ErrorMessage.test.d.ts +0 -5
  122. package/dist/ErrorMessage/ErrorMessage.test.js +0 -53
  123. package/dist/Field/Field.test.d.ts +0 -5
  124. package/dist/Field/Field.test.js +0 -38
  125. package/dist/FieldSet/FieldSet.test.d.ts +0 -5
  126. package/dist/FieldSet/FieldSet.test.js +0 -70
  127. package/dist/Figure/Figure.test.d.ts +0 -5
  128. package/dist/Figure/Figure.test.js +0 -33
  129. package/dist/Figure/FigureCaption.test.d.ts +0 -5
  130. package/dist/Figure/FigureCaption.test.js +0 -38
  131. package/dist/FileInput/FileInput.test.d.ts +0 -5
  132. package/dist/FileInput/FileInput.test.js +0 -33
  133. package/dist/FileList/FileList.test.d.ts +0 -5
  134. package/dist/FileList/FileList.test.js +0 -33
  135. package/dist/FileList/FileListItem.test.d.ts +0 -5
  136. package/dist/FileList/FileListItem.test.js +0 -44
  137. package/dist/Grid/Grid.test.d.ts +0 -5
  138. package/dist/Grid/Grid.test.js +0 -69
  139. package/dist/Grid/GridCell.test.d.ts +0 -5
  140. package/dist/Grid/GridCell.test.js +0 -84
  141. package/dist/Heading/Heading.test.d.ts +0 -5
  142. package/dist/Heading/Heading.test.js +0 -70
  143. package/dist/Hint/Hint.test.d.ts +0 -5
  144. package/dist/Hint/Hint.test.js +0 -53
  145. package/dist/Icon/Icon.test.d.ts +0 -5
  146. package/dist/Icon/Icon.test.js +0 -60
  147. package/dist/IconButton/IconButton.test.d.ts +0 -5
  148. package/dist/IconButton/IconButton.test.js +0 -48
  149. package/dist/Image/Image.test.d.ts +0 -5
  150. package/dist/Image/Image.test.js +0 -43
  151. package/dist/ImageSlider/ImageSlider.test.d.ts +0 -5
  152. package/dist/ImageSlider/ImageSlider.test.js +0 -70
  153. package/dist/ImageSlider/ImageSliderControls.test.d.ts +0 -5
  154. package/dist/ImageSlider/ImageSliderControls.test.js +0 -25
  155. package/dist/ImageSlider/ImageSliderItem.test.d.ts +0 -5
  156. package/dist/ImageSlider/ImageSliderItem.test.js +0 -37
  157. package/dist/ImageSlider/ImageSliderScroller.test.d.ts +0 -5
  158. package/dist/ImageSlider/ImageSliderScroller.test.js +0 -37
  159. package/dist/ImageSlider/ImageSliderThumbnails.test.d.ts +0 -5
  160. package/dist/ImageSlider/ImageSliderThumbnails.test.js +0 -52
  161. package/dist/InvalidFormAlert/InvalidFormAlert.test.d.ts +0 -5
  162. package/dist/InvalidFormAlert/InvalidFormAlert.test.js +0 -108
  163. package/dist/Label/Label.test.d.ts +0 -5
  164. package/dist/Label/Label.test.js +0 -82
  165. package/dist/Link/Link.test.d.ts +0 -5
  166. package/dist/Link/Link.test.js +0 -43
  167. package/dist/LinkList/LinkList.test.d.ts +0 -5
  168. package/dist/LinkList/LinkList.test.js +0 -33
  169. package/dist/LinkList/LinkListLink.test.d.ts +0 -5
  170. package/dist/LinkList/LinkListLink.test.js +0 -54
  171. package/dist/Logo/Logo.test.d.ts +0 -5
  172. package/dist/Logo/Logo.test.js +0 -33
  173. package/dist/Mark/Mark.test.d.ts +0 -5
  174. package/dist/Mark/Mark.test.js +0 -33
  175. package/dist/Menu/Menu.test.d.ts +0 -5
  176. package/dist/Menu/Menu.test.js +0 -55
  177. package/dist/Menu/MenuLink.test.d.ts +0 -5
  178. package/dist/Menu/MenuLink.test.js +0 -56
  179. package/dist/OrderedList/OrderedList.test.d.ts +0 -5
  180. package/dist/OrderedList/OrderedList.test.js +0 -55
  181. package/dist/OrderedList/OrderedListItem.test.d.ts +0 -5
  182. package/dist/OrderedList/OrderedListItem.test.js +0 -32
  183. package/dist/Overlap/Overlap.test.d.ts +0 -5
  184. package/dist/Overlap/Overlap.test.js +0 -38
  185. package/dist/Page/Page.test.d.ts +0 -5
  186. package/dist/Page/Page.test.js +0 -33
  187. package/dist/PageFooter/PageFooter.test.d.ts +0 -5
  188. package/dist/PageFooter/PageFooter.test.js +0 -33
  189. package/dist/PageFooter/PageFooterMenu.test.d.ts +0 -5
  190. package/dist/PageFooter/PageFooterMenu.test.js +0 -35
  191. package/dist/PageFooter/PageFooterMenuLink.test.d.ts +0 -5
  192. package/dist/PageFooter/PageFooterMenuLink.test.js +0 -33
  193. package/dist/PageFooter/PageFooterSpotlight.test.d.ts +0 -5
  194. package/dist/PageFooter/PageFooterSpotlight.test.js +0 -33
  195. package/dist/PageHeader/PageHeader.test.d.ts +0 -6
  196. package/dist/PageHeader/PageHeader.test.js +0 -131
  197. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.d.ts +0 -5
  198. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.js +0 -38
  199. package/dist/PageHeader/PageHeaderMenuLink.test.d.ts +0 -5
  200. package/dist/PageHeader/PageHeaderMenuLink.test.js +0 -45
  201. package/dist/PageHeading/PageHeading.test.d.ts +0 -5
  202. package/dist/PageHeading/PageHeading.test.js +0 -40
  203. package/dist/Pagination/Pagination.test.d.ts +0 -5
  204. package/dist/Pagination/Pagination.test.js +0 -137
  205. package/dist/Paragraph/Paragraph.test.d.ts +0 -5
  206. package/dist/Paragraph/Paragraph.test.js +0 -62
  207. package/dist/PasswordInput/PasswordInput.test.d.ts +0 -5
  208. package/dist/PasswordInput/PasswordInput.test.js +0 -89
  209. package/dist/Radio/Radio.test.d.ts +0 -5
  210. package/dist/Radio/Radio.test.js +0 -134
  211. package/dist/Row/Row.test.d.ts +0 -5
  212. package/dist/Row/Row.test.js +0 -64
  213. package/dist/SearchField/SearchField.test.d.ts +0 -5
  214. package/dist/SearchField/SearchField.test.js +0 -33
  215. package/dist/SearchField/SearchFieldButton.test.d.ts +0 -5
  216. package/dist/SearchField/SearchFieldButton.test.js +0 -47
  217. package/dist/SearchField/SearchFieldInput.test.d.ts +0 -5
  218. package/dist/SearchField/SearchFieldInput.test.js +0 -65
  219. package/dist/Select/Select.test.d.ts +0 -5
  220. package/dist/Select/Select.test.js +0 -74
  221. package/dist/Select/SelectOption.test.d.ts +0 -5
  222. package/dist/Select/SelectOption.test.js +0 -45
  223. package/dist/Select/SelectOptionGroup.test.d.ts +0 -5
  224. package/dist/Select/SelectOptionGroup.test.js +0 -45
  225. package/dist/SkipLink/SkipLink.test.d.ts +0 -5
  226. package/dist/SkipLink/SkipLink.test.js +0 -33
  227. package/dist/Spotlight/Spotlight.test.d.ts +0 -5
  228. package/dist/Spotlight/Spotlight.test.js +0 -46
  229. package/dist/StandaloneLink/StandaloneLink.test.d.ts +0 -5
  230. package/dist/StandaloneLink/StandaloneLink.test.js +0 -46
  231. package/dist/Switch/Switch.test.d.ts +0 -5
  232. package/dist/Switch/Switch.test.js +0 -69
  233. package/dist/Table/Table.test.d.ts +0 -5
  234. package/dist/Table/Table.test.js +0 -33
  235. package/dist/Table/TableBody.test.d.ts +0 -5
  236. package/dist/Table/TableBody.test.js +0 -34
  237. package/dist/Table/TableCaption.test.d.ts +0 -5
  238. package/dist/Table/TableCaption.test.js +0 -45
  239. package/dist/Table/TableCell.test.d.ts +0 -5
  240. package/dist/Table/TableCell.test.js +0 -36
  241. package/dist/Table/TableFooter.test.d.ts +0 -5
  242. package/dist/Table/TableFooter.test.js +0 -34
  243. package/dist/Table/TableHeader.test.d.ts +0 -5
  244. package/dist/Table/TableHeader.test.js +0 -34
  245. package/dist/Table/TableHeaderCell.test.d.ts +0 -5
  246. package/dist/Table/TableHeaderCell.test.js +0 -42
  247. package/dist/Table/TableRow.test.d.ts +0 -5
  248. package/dist/Table/TableRow.test.js +0 -35
  249. package/dist/TableOfContents/TableOfContents.test.d.ts +0 -5
  250. package/dist/TableOfContents/TableOfContents.test.js +0 -44
  251. package/dist/TableOfContents/TableOfContentsLink.test.d.ts +0 -5
  252. package/dist/TableOfContents/TableOfContentsLink.test.js +0 -34
  253. package/dist/TableOfContents/TableOfContentsList.test.d.ts +0 -5
  254. package/dist/TableOfContents/TableOfContentsList.test.js +0 -40
  255. package/dist/Tabs/Tabs.test.d.ts +0 -5
  256. package/dist/Tabs/Tabs.test.js +0 -104
  257. package/dist/Tabs/TabsButton.test.d.ts +0 -5
  258. package/dist/Tabs/TabsButton.test.js +0 -57
  259. package/dist/Tabs/TabsList.test.d.ts +0 -5
  260. package/dist/Tabs/TabsList.test.js +0 -32
  261. package/dist/Tabs/TabsPanel.test.d.ts +0 -5
  262. package/dist/Tabs/TabsPanel.test.js +0 -42
  263. package/dist/TextArea/TextArea.test.d.ts +0 -5
  264. package/dist/TextArea/TextArea.test.js +0 -105
  265. package/dist/TextInput/TextInput.test.d.ts +0 -5
  266. package/dist/TextInput/TextInput.test.js +0 -92
  267. package/dist/TimeInput/TimeInput.test.d.ts +0 -5
  268. package/dist/TimeInput/TimeInput.test.js +0 -51
  269. package/dist/UnorderedList/UnorderedList.test.d.ts +0 -5
  270. package/dist/UnorderedList/UnorderedList.test.js +0 -55
  271. package/dist/UnorderedList/UnorderedListItem.test.d.ts +0 -5
  272. package/dist/UnorderedList/UnorderedListItem.test.js +0 -32
  273. package/dist/common/formatFileSize.test.d.ts +0 -5
  274. package/dist/common/formatFileSize.test.js +0 -22
  275. package/dist/common/formatFileType.test.d.ts +0 -5
  276. package/dist/common/formatFileType.test.js +0 -27
  277. package/dist/common/useKeyboardFocus.test.d.ts +0 -5
  278. package/dist/common/useKeyboardFocus.test.js +0 -79
  279. package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Amsterdam Design System: React components
4
4
 
5
5
  This package provides all React components from the [Amsterdam Design System](https://designsystem.amsterdam).
6
- Use it to compose pages in your website or application.
6
+ Use it to compose pages in your websites.
7
7
 
8
8
  ## Introduction
9
9
 
@@ -8,7 +8,7 @@ type AvatarColor = (typeof avatarColors)[number];
8
8
  export type AvatarProps = {
9
9
  /** The background colour. */
10
10
  color?: AvatarColor;
11
- /** The url for the user’s image. Its center will be displayed. Should be square and scaled down. */
11
+ /** The url for the user’s image. Its centre will be displayed. Should be square and scaled down. */
12
12
  imageSrc?: string;
13
13
  /** The text content. Should be the user’s initials. The first two characters will be displayed. */
14
14
  label: string;
@@ -19,7 +19,7 @@ export type AvatarProps = {
19
19
  export declare const Avatar: import("react").ForwardRefExoticComponent<{
20
20
  /** The background colour. */
21
21
  color?: AvatarColor;
22
- /** The url for the user’s image. Its center will be displayed. Should be square and scaled down. */
22
+ /** The url for the user’s image. Its centre will be displayed. Should be square and scaled down. */
23
23
  imageSrc?: string;
24
24
  /** The text content. Should be the user’s initials. The first two characters will be displayed. */
25
25
  label: string;
@@ -12,7 +12,7 @@ export declare const Card: import("react").ForwardRefExoticComponent<HTMLAttribu
12
12
  } & import("react").RefAttributes<HTMLElement>> & {
13
13
  Heading: import("react").ForwardRefExoticComponent<{
14
14
  color?: "inverse";
15
- level: 2 | 1 | 3 | 4;
15
+ level: 1 | 2 | 3 | 4;
16
16
  size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
17
17
  } & HTMLAttributes<HTMLHeadingElement> & {
18
18
  children?: import("react").ReactNode | undefined;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const CardHeading: import("react").ForwardRefExoticComponent<{
6
6
  color?: "inverse";
7
- level: 2 | 1 | 3 | 4;
7
+ level: 1 | 2 | 3 | 4;
8
8
  size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
9
9
  } & import("react").HTMLAttributes<HTMLHeadingElement> & {
10
10
  children?: import("react").ReactNode | undefined;
@@ -27,6 +27,6 @@ export declare const Checkbox: import("react").ForwardRefExoticComponent<{
27
27
  indeterminate?: boolean;
28
28
  /** Whether the value fails a validation rule. */
29
29
  invalid?: boolean;
30
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "aria-invalid"> & {
30
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
31
31
  children?: ReactNode | undefined;
32
32
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -56,5 +56,5 @@ export declare const Column: import("react").ForwardRefExoticComponent<{
56
56
  gap?: ColumnGap;
57
57
  } & HTMLAttributes<HTMLElement> & {
58
58
  children?: import("react").ReactNode | undefined;
59
- } & import("react").RefAttributes<unknown>>;
59
+ } & import("react").RefAttributes<any>>;
60
60
  export {};
@@ -19,5 +19,5 @@ export declare const DateInput: import("react").ForwardRefExoticComponent<{
19
19
  invalid?: boolean;
20
20
  /** The kind of data that the user should provide. */
21
21
  type?: DateInputType;
22
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "aria-invalid"> & import("react").RefAttributes<HTMLInputElement>>;
22
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & import("react").RefAttributes<HTMLInputElement>>;
23
23
  export {};
@@ -5,6 +5,11 @@
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
6
  import type { HintProps } from '../Hint';
7
7
  export type FieldSetProps = {
8
+ /**
9
+ * Whether the fieldset is nested inside another fieldset.
10
+ * This will show the legend in a lighter style.
11
+ */
12
+ inFieldSet?: boolean;
8
13
  /** Whether the field set has an input with a validation error. */
9
14
  invalid?: boolean;
10
15
  /** The text for the caption. */
@@ -19,6 +24,11 @@ export type FieldSetProps = {
19
24
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field-set--docs Field Set docs at Amsterdam Design System}
20
25
  */
21
26
  export declare const FieldSet: import("react").ForwardRefExoticComponent<{
27
+ /**
28
+ * Whether the fieldset is nested inside another fieldset.
29
+ * This will show the legend in a lighter style.
30
+ */
31
+ inFieldSet?: boolean;
22
32
  /** Whether the field set has an input with a validation error. */
23
33
  invalid?: boolean;
24
34
  /** The text for the caption. */
@@ -30,6 +40,7 @@ export declare const FieldSet: import("react").ForwardRefExoticComponent<{
30
40
  legendIsPageHeading?: boolean;
31
41
  } & {
32
42
  hint?: string;
43
+ inFieldSet?: boolean;
33
44
  optional?: boolean;
34
45
  } & HTMLAttributes<HTMLElement> & {
35
46
  children?: import("react").ReactNode | undefined;
@@ -5,8 +5,8 @@ import { Hint } from '../Hint';
5
5
  /**
6
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field-set--docs Field Set docs at Amsterdam Design System}
7
7
  */
8
- export const FieldSet = forwardRef(({ children, className, hint, invalid, legend, legendIsPageHeading, optional, ...restProps }, ref) => {
9
- const legendContent = (_jsxs(_Fragment, { children: [legend, " ", _jsx(Hint, { hint: hint, optional: optional })] }));
10
- return (_jsxs("fieldset", { ...restProps, className: clsx('ams-field-set', invalid && 'ams-field-set--invalid', className), ref: ref, children: [_jsx("legend", { className: "ams-field-set__legend", children: legendIsPageHeading ? _jsx("h1", { className: "ams-field-set__heading", children: legendContent }) : legendContent }), children] }));
8
+ export const FieldSet = forwardRef(({ children, className, hint, inFieldSet, invalid, legend, legendIsPageHeading, optional, ...restProps }, ref) => {
9
+ const legendContent = (_jsxs(_Fragment, { children: [legend, " ", _jsx(Hint, { hint: hint, inFieldSet: inFieldSet, optional: optional })] }));
10
+ return (_jsxs("fieldset", { ...restProps, className: clsx('ams-field-set', invalid && 'ams-field-set--invalid', className), ref: ref, children: [_jsx("legend", { className: clsx('ams-field-set__legend', inFieldSet && 'ams-field-set__legend--in-fieldset'), children: legendIsPageHeading ? _jsx("h1", { className: "ams-field-set__heading", children: legendContent }) : legendContent }), children] }));
11
11
  });
12
12
  FieldSet.displayName = 'FieldSet';
@@ -38,6 +38,6 @@ export type GridProps = {
38
38
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-layout-grid--docs Grid docs at Amsterdam Design System}
39
39
  */
40
40
  export declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<any>> & {
41
- Cell: import("react").ForwardRefExoticComponent<import("./GridCell").GridCellProps & import("react").RefAttributes<unknown>>;
41
+ Cell: import("react").ForwardRefExoticComponent<import("./GridCell").GridCellProps & import("react").RefAttributes<any>>;
42
42
  };
43
43
  export {};
@@ -21,5 +21,5 @@ export type GridCellProps = {
21
21
  /** The HTML tag to use. */
22
22
  as?: GridCellTag;
23
23
  } & PropsWithChildren<HTMLAttributes<HTMLElement>> & (GridCellSpanAllProp | GridCellSpanAndStartProps);
24
- export declare const GridCell: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<unknown>>;
24
+ export declare const GridCell: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<any>>;
25
25
  export {};
@@ -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';
@@ -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';
@@ -6,6 +6,11 @@
6
6
  import type { LabelHTMLAttributes, PropsWithChildren } from 'react';
7
7
  import type { HintProps } from '../Hint';
8
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;
9
14
  /**
10
15
  * Render a level 1 heading around the label.
11
16
  * Set this if the Field is the only content of the page.
@@ -16,6 +21,11 @@ export type LabelProps = {
16
21
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-label--docs Label docs at Amsterdam Design System}
17
22
  */
18
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;
19
29
  /**
20
30
  * Render a level 1 heading around the label.
21
31
  * Set this if the Field is the only content of the page.
@@ -23,6 +33,7 @@ export declare const Label: import("react").ForwardRefExoticComponent<{
23
33
  isPageHeading?: boolean;
24
34
  } & {
25
35
  hint?: string;
36
+ inFieldSet?: boolean;
26
37
  optional?: boolean;
27
38
  } & import("react").HTMLAttributes<HTMLElement> & {
28
39
  children?: import("react").ReactNode | undefined;
@@ -5,8 +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, isPageHeading, optional, ...restProps }, ref) => {
9
- const labelElement = (_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
10
  return isPageHeading ? _jsx("h1", { className: "ams-label__heading", children: labelElement }) : labelElement;
11
11
  });
12
12
  Label.displayName = 'Label';
@@ -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> & {
@@ -2,13 +2,18 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
- import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
6
- export type LogoBrand = 'amsterdam' | 'ggd-amsterdam' | 'museum-weesp' | 'stadsarchief' | 'stadsbank-van-lening' | 'vga-verzekeringen';
5
+ import type { ComponentType, SVGProps } from 'react';
6
+ export declare const logoBrands: readonly ["amsterdam", "ggd-amsterdam", "museum-weesp", "stadsarchief", "stadsbank-van-lening", "vga-verzekeringen"];
7
+ export type LogoBrand = (typeof logoBrands)[number];
7
8
  export type LogoProps = {
8
- /** The name of the brand for which to display the logo. */
9
- brand?: LogoBrand;
9
+ /** The name of the brand for which to display the logo, or configuration for a custom logo. */
10
+ brand?: LogoBrand | LogoBrandConfig;
10
11
  } & SVGProps<SVGSVGElement>;
12
+ export type LogoBrandConfig = {
13
+ label: string;
14
+ svg: ComponentType<SVGProps<SVGSVGElement>>;
15
+ };
11
16
  /**
12
17
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-logo--docs Logo docs at Amsterdam Design System}
13
18
  */
14
- export declare const Logo: ForwardRefExoticComponent<Omit<LogoProps, "ref"> & RefAttributes<SVGSVGElement>>;
19
+ export declare const Logo: import("react").ForwardRefExoticComponent<Omit<LogoProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
package/dist/Logo/Logo.js CHANGED
@@ -2,38 +2,46 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { LogoAmsterdam, LogoGgdAmsterdam, LogoMuseumWeesp, LogoStadsarchief, LogoStadsbankVanLening, LogoVgaVerzekeringen, } from './brand';
5
+ export const logoBrands = [
6
+ 'amsterdam',
7
+ 'ggd-amsterdam',
8
+ 'museum-weesp',
9
+ 'stadsarchief',
10
+ 'stadsbank-van-lening',
11
+ 'vga-verzekeringen',
12
+ ];
5
13
  const logoConfig = {
6
14
  amsterdam: {
7
15
  label: 'Gemeente Amsterdam logo',
8
- logo: LogoAmsterdam,
16
+ svg: LogoAmsterdam,
9
17
  },
10
18
  'ggd-amsterdam': {
11
19
  label: 'GGD Amsterdam logo',
12
- logo: LogoGgdAmsterdam,
20
+ svg: LogoGgdAmsterdam,
13
21
  },
14
22
  'museum-weesp': {
15
23
  label: 'Gemeente Amsterdam Museum Weesp logo',
16
- logo: LogoMuseumWeesp,
24
+ svg: LogoMuseumWeesp,
17
25
  },
18
26
  stadsarchief: {
19
27
  label: 'Gemeente Amsterdam Stadsarchief logo',
20
- logo: LogoStadsarchief,
28
+ svg: LogoStadsarchief,
21
29
  },
22
30
  'stadsbank-van-lening': {
23
31
  label: 'Gemeente Amsterdam Stadsbank van Lening logo',
24
- logo: LogoStadsbankVanLening,
32
+ svg: LogoStadsbankVanLening,
25
33
  },
26
34
  'vga-verzekeringen': {
27
35
  label: 'Gemeente Amsterdam VGA Verzekeringen logo',
28
- logo: LogoVgaVerzekeringen,
36
+ svg: LogoVgaVerzekeringen,
29
37
  },
30
38
  };
31
39
  /**
32
40
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-logo--docs Logo docs at Amsterdam Design System}
33
41
  */
34
42
  export const Logo = forwardRef(({ 'aria-label': ariaLabel, brand = 'amsterdam', className, ...restProps }, ref) => {
35
- const LogoComponent = logoConfig[brand].logo;
36
- const logoLabel = logoConfig[brand].label;
37
- return (_jsx(LogoComponent, { ...restProps, "aria-label": ariaLabel || logoLabel, className: clsx('ams-logo', className), ref: ref }));
43
+ const config = typeof brand === 'string' ? logoConfig[brand] : brand;
44
+ const { label, svg: LogoComponent } = config;
45
+ return (_jsx(LogoComponent, { ...restProps, "aria-label": ariaLabel || label, className: clsx('ams-logo', className), ref: ref }));
38
46
  });
39
47
  Logo.displayName = 'Logo';
@@ -10,7 +10,7 @@ export type MenuLinkProps = {
10
10
  * @deprecated The menu has a dark background now, so this is no longer needed.
11
11
  */
12
12
  color?: 'contrast' | 'inverse';
13
- /** 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. */
14
14
  icon: IconProps['svg'];
15
15
  } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
16
16
  export declare const MenuLink: import("react").ForwardRefExoticComponent<{
@@ -19,7 +19,7 @@ export declare const MenuLink: import("react").ForwardRefExoticComponent<{
19
19
  * @deprecated The menu has a dark background now, so this is no longer needed.
20
20
  */
21
21
  color?: "contrast" | "inverse";
22
- /** 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. */
23
23
  icon: IconProps["svg"];
24
24
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
25
25
  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';
@@ -10,7 +10,10 @@ export type PageFooterProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
10
10
  export declare const PageFooter: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
11
11
  children?: import("react").ReactNode | undefined;
12
12
  } & import("react").RefAttributes<HTMLElement>> & {
13
- Menu: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & {
13
+ Menu: import("react").ForwardRefExoticComponent<{
14
+ heading?: string;
15
+ headingLevel?: import("..").HeadingProps["level"];
16
+ } & HTMLAttributes<HTMLUListElement> & {
14
17
  children?: import("react").ReactNode | undefined;
15
18
  } & import("react").RefAttributes<HTMLUListElement>>;
16
19
  MenuLink: import("react").ForwardRefExoticComponent<import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -3,7 +3,32 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type PageFooterMenuProps = PropsWithChildren<HTMLAttributes<HTMLUListElement>>;
7
- export declare const PageFooterMenu: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & {
6
+ import type { HeadingProps } from '../Heading';
7
+ export type PageFooterMenuProps = {
8
+ /**
9
+ * Describes the menu for users of assistive technology.
10
+ * The heading gets visually hidden – sighted users can infer the meaning of the menu from its appearance.
11
+ * @default Over deze website
12
+ */
13
+ heading?: string;
14
+ /**
15
+ * The hierarchical level of the Footer Menu’s Heading within the document.
16
+ * The default value is 2. This will almost always be correct – but verify this yourself.
17
+ */
18
+ headingLevel?: HeadingProps['level'];
19
+ } & PropsWithChildren<HTMLAttributes<HTMLUListElement>>;
20
+ export declare const PageFooterMenu: import("react").ForwardRefExoticComponent<{
21
+ /**
22
+ * Describes the menu for users of assistive technology.
23
+ * The heading gets visually hidden – sighted users can infer the meaning of the menu from its appearance.
24
+ * @default Over deze website
25
+ */
26
+ heading?: string;
27
+ /**
28
+ * The hierarchical level of the Footer Menu’s Heading within the document.
29
+ * The default value is 2. This will almost always be correct – but verify this yourself.
30
+ */
31
+ headingLevel?: HeadingProps["level"];
32
+ } & HTMLAttributes<HTMLUListElement> & {
8
33
  children?: import("react").ReactNode | undefined;
9
34
  } & import("react").RefAttributes<HTMLUListElement>>;
@@ -1,5 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
- export const PageFooterMenu = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("ul", { ...restProps, className: clsx('ams-page-footer__menu', className), ref: ref, children: children })));
4
+ import { getHeadingTag } from '../Heading/getHeadingTag';
5
+ export const PageFooterMenu = forwardRef(({ children, className, heading = 'Over deze website', headingLevel = 2, ...restProps }, ref) => {
6
+ const HeadingTag = getHeadingTag(headingLevel);
7
+ return (_jsxs(_Fragment, { children: [_jsx(HeadingTag, { className: "ams-visually-hidden", children: heading }), _jsx("ul", { ...restProps, className: clsx('ams-page-footer__menu', className), ref: ref, children: children })] }));
8
+ });
5
9
  PageFooterMenu.displayName = 'PageFooter.Menu';
@@ -4,21 +4,26 @@
4
4
  */
5
5
  import type { AnchorHTMLAttributes, ComponentType, HTMLAttributes, ReactNode } from 'react';
6
6
  import type { LogoBrand } from '../Logo';
7
+ import type { LogoBrandConfig } from '../Logo/Logo';
7
8
  export type PageHeaderProps = {
8
9
  /** The name of the application. */
9
10
  brandName?: string;
10
11
  /** The accessible name of the logo. */
11
12
  logoAccessibleName?: string;
12
13
  /** The name of the brand for which to display the logo. */
13
- logoBrand?: LogoBrand;
14
+ logoBrand?: LogoBrand | LogoBrandConfig;
14
15
  /** The url for the link on the logo. */
15
16
  logoLink?: string;
16
17
  /** The React component to use for the logo link. */
17
18
  logoLinkComponent?: ComponentType<AnchorHTMLAttributes<HTMLAnchorElement>>;
18
19
  /** The accessible text for the link on the logo. */
19
20
  logoLinkTitle?: string;
20
- /** The text for the menu button. */
21
+ /** The visible text for the menu button. */
21
22
  menuButtonText?: string;
23
+ /** The text for screen readers when the button hides the menu. */
24
+ menuButtonTextForHide?: string;
25
+ /** The text for screen readers when the button shows the menu. */
26
+ menuButtonTextForShow?: string;
22
27
  /** A slot for the menu items. Use PageHeader.MenuLink here. */
23
28
  menuItems?: ReactNode;
24
29
  /** The accessible label for the navigation section. */
@@ -35,15 +40,19 @@ export declare const PageHeader: import("react").ForwardRefExoticComponent<{
35
40
  /** The accessible name of the logo. */
36
41
  logoAccessibleName?: string;
37
42
  /** The name of the brand for which to display the logo. */
38
- logoBrand?: LogoBrand;
43
+ logoBrand?: LogoBrand | LogoBrandConfig;
39
44
  /** The url for the link on the logo. */
40
45
  logoLink?: string;
41
46
  /** The React component to use for the logo link. */
42
47
  logoLinkComponent?: ComponentType<AnchorHTMLAttributes<HTMLAnchorElement>>;
43
48
  /** The accessible text for the link on the logo. */
44
49
  logoLinkTitle?: string;
45
- /** The text for the menu button. */
50
+ /** The visible text for the menu button. */
46
51
  menuButtonText?: string;
52
+ /** The text for screen readers when the button hides the menu. */
53
+ menuButtonTextForHide?: string;
54
+ /** The text for screen readers when the button shows the menu. */
55
+ menuButtonTextForShow?: string;
47
56
  /** A slot for the menu items. Use PageHeader.MenuLink here. */
48
57
  menuItems?: ReactNode;
49
58
  /** The accessible label for the navigation section. */
@@ -54,6 +63,7 @@ export declare const PageHeader: import("react").ForwardRefExoticComponent<{
54
63
  GridCellNarrowWindowOnly: import("react").ForwardRefExoticComponent<import("..").GridCellProps & import("react").RefAttributes<HTMLElement>>;
55
64
  MenuLink: import("react").ForwardRefExoticComponent<{
56
65
  fixed?: boolean;
66
+ icon?: import("../Icon").IconProps["svg"];
57
67
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
58
68
  children?: ReactNode | undefined;
59
69
  } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -8,7 +8,7 @@ import { PageHeaderGridCellNarrowWindowOnly } from './PageHeaderGridCellNarrowWi
8
8
  import { PageHeaderMenuIcon } from './PageHeaderMenuIcon';
9
9
  import { PageHeaderMenuLink } from './PageHeaderMenuLink';
10
10
  const LogoLinkContent = ({ brandName, logoAccessibleName, logoBrand, }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: clsx(logoBrand === 'amsterdam' && Boolean(brandName) && 'ams-page-header__logo-container'), children: _jsx(Logo, { "aria-label": logoAccessibleName, brand: logoBrand }) }), brandName && (_jsx("span", { "aria-hidden": "true", className: "ams-page-header__brand-name", children: brandName }))] }));
11
- const PageHeaderRoot = forwardRef(({ brandName, children, className, logoAccessibleName, logoBrand = 'amsterdam', logoLink = '/', logoLinkComponent = (props) => _jsx("a", { ...props }), logoLinkTitle = `Ga naar de homepage${brandName ? ` van ${brandName}` : ''}`, menuButtonText = 'Menu', menuItems, navigationLabel = 'Hoofdnavigatie', noMenuButtonOnWideWindow, ...restProps }, ref) => {
11
+ const PageHeaderRoot = forwardRef(({ brandName, children, className, logoAccessibleName, logoBrand = 'amsterdam', logoLink = '/', logoLinkComponent = (props) => _jsx("a", { ...props }), logoLinkTitle = `Ga naar de homepage${brandName ? ` van ${brandName}` : ''}`, menuButtonText = 'Menu', menuButtonTextForHide = 'Verberg navigatiemenu', menuButtonTextForShow = 'Laat navigatiemenu zien', menuItems, navigationLabel = 'Hoofdnavigatie', noMenuButtonOnWideWindow, ...restProps }, ref) => {
12
12
  const [open, setOpen] = useState(false);
13
13
  const Link = logoLinkComponent;
14
14
  const hasMegaMenu = Boolean(children);
@@ -19,7 +19,8 @@ const PageHeaderRoot = forwardRef(({ brandName, children, className, logoAccessi
19
19
  setOpen(false);
20
20
  }
21
21
  }, [isWideWindow]);
22
- return (_jsxs("header", { ...restProps, className: clsx('ams-page-header', className), ref: ref, children: [_jsxs(Link, { className: "ams-page-header__logo-link", href: logoLink, children: [_jsx(LogoLinkContent, { brandName: brandName, logoAccessibleName: logoAccessibleName, logoBrand: logoBrand }), _jsx("span", { className: "ams-visually-hidden", children: ` ${logoLinkTitle}` })] }), (hasMegaMenu || menuItems) && (_jsxs("nav", { "aria-labelledby": "primary-navigation", className: "ams-page-header__navigation", children: [_jsx("h2", { "aria-hidden": true, className: "ams-visually-hidden", id: "primary-navigation", children: navigationLabel }), _jsx("div", { "aria-hidden": true, className: "ams-page-header__logo-link ams-page-header__logo-link--hidden", hidden: true, children: _jsx(LogoLinkContent, { brandName: brandName, logoBrand: logoBrand }) }), _jsxs("ul", { className: "ams-page-header__menu", children: [menuItems, hasMegaMenu && (_jsx("li", { className: clsx(noMenuButtonOnWideWindow && 'ams-page-header__mega-menu-button-item--hide-on-wide-window'), children: _jsxs("button", { "aria-controls": "ams-page-header-mega-menu", "aria-expanded": open, className: "ams-page-header__mega-menu-button", onClick: () => setOpen(!open), type: "button", children: [_jsx("span", { className: "ams-page-header__mega-menu-button-label", children: menuButtonText }), _jsx("span", { "aria-hidden": "true", className: "ams-page-header__mega-menu-button-hidden-label", children: menuButtonText }), _jsx(Icon, { svg: _jsx(PageHeaderMenuIcon, { className: clsx('ams-page-header__menu-icon', open && 'ams-page-header__menu-icon--open') }) })] }) }))] }), hasMegaMenu && (_jsx("div", { className: clsx('ams-page-header__mega-menu', !open && 'ams-page-header__mega-menu--closed'), id: "ams-page-header-mega-menu", children: children }))] }))] }));
22
+ return (_jsxs("header", { ...restProps, className: clsx('ams-page-header', className), ref: ref, children: [_jsxs(Link, { className: "ams-page-header__logo-link", href: logoLink, children: [_jsx(LogoLinkContent, { brandName: brandName, logoAccessibleName: logoAccessibleName, logoBrand: logoBrand }), _jsx("span", { className: "ams-visually-hidden", children: ` ${logoLinkTitle}` })] }), (hasMegaMenu || menuItems) && (_jsxs("nav", { "aria-labelledby": "primary-navigation", className: "ams-page-header__navigation", children: [_jsx("h2", { "aria-hidden": true, className: "ams-visually-hidden", id: "primary-navigation", children: navigationLabel }), _jsx("div", { "aria-hidden": true, className: "ams-page-header__logo-link ams-page-header__logo-link--hidden", hidden: true, children: _jsx(LogoLinkContent, { brandName: brandName, logoBrand: logoBrand }) }), _jsxs("ul", { className: "ams-page-header__menu", children: [menuItems, hasMegaMenu && (_jsx("li", { className: clsx('ams-page-header__mega-menu-button-item', noMenuButtonOnWideWindow && 'ams-page-header__mega-menu-button-item--hide-on-wide-window'), hidden // Hide the list item containing the menu button until its CSS loads. If it doesn't load, the menu will always be visible.
23
+ : true, children: _jsxs("button", { "aria-controls": "ams-page-header-mega-menu", "aria-expanded": open, className: "ams-page-header__mega-menu-button", onClick: () => setOpen(!open), type: "button", children: [_jsx("span", { "aria-hidden": "true", className: "ams-page-header__mega-menu-button-label", children: menuButtonText }), _jsx("span", { className: "ams-visually-hidden", children: open ? menuButtonTextForHide : menuButtonTextForShow }), _jsx("span", { "aria-hidden": "true", className: "ams-page-header__mega-menu-button-hidden-label", children: menuButtonText }), _jsx(Icon, { svg: _jsx(PageHeaderMenuIcon, { className: clsx('ams-page-header__menu-icon', open && 'ams-page-header__menu-icon--open') }) })] }) }))] }), hasMegaMenu && (_jsx("div", { className: clsx('ams-page-header__mega-menu', !open && 'ams-page-header__mega-menu--closed'), id: "ams-page-header-mega-menu", children: children }))] }))] }));
23
24
  });
24
25
  PageHeaderRoot.displayName = 'PageHeader';
25
26
  /**
@@ -2,5 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { Grid } from '../Grid';
5
- export const PageHeaderGridCellNarrowWindowOnly = forwardRef(({ children, className, ...restProps }, ref) => (_jsx(Grid.Cell, { ...restProps, className: clsx('ams-page-header__grid-cell-narrow-window-only', className), ref: ref, children: children })));
5
+ export const PageHeaderGridCellNarrowWindowOnly = forwardRef(({ children, className, ...restProps }, ref) => (_jsx(Grid.Cell, { ...restProps, className: clsx('ams-page-header__grid-cell-narrow-window-only', className), hidden // Hide until its CSS loads; this cell duplicates the non-fixed links in the Page Header Menu.
6
+ : true, ref: ref, children: children })));
6
7
  PageHeaderGridCellNarrowWindowOnly.displayName = 'PageHeader.GridCellNarrowWindowOnly';
@@ -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" })] }));
@@ -3,11 +3,18 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { IconProps } from '../Icon';
6
7
  export type PageHeaderMenuLinkProps = {
8
+ /** Whether the link appears in the Page Header on narrow windows. */
7
9
  fixed?: boolean;
10
+ /** An icon to display at the end of the label. */
11
+ icon?: IconProps['svg'];
8
12
  } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
9
13
  export declare const PageHeaderMenuLink: import("react").ForwardRefExoticComponent<{
14
+ /** Whether the link appears in the Page Header on narrow windows. */
10
15
  fixed?: boolean;
16
+ /** An icon to display at the end of the label. */
17
+ icon?: IconProps["svg"];
11
18
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
12
19
  children?: import("react").ReactNode | undefined;
13
20
  } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,5 +1,6 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
- 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 })] }) })));
5
6
  PageHeaderMenuLink.displayName = 'PageHeader.MenuLink';
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 Robbert Broersma
4
4
  * Copyright Gemeente Amsterdam
5
5
  */
6
- import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
7
7
  export type ParagraphProps = {
8
8
  /** Changes the text colour for readability on a dark background. */
9
9
  color?: 'inverse';
@@ -19,5 +19,5 @@ export declare const Paragraph: import("react").ForwardRefExoticComponent<{
19
19
  /** The size of the text. */
20
20
  size?: "small" | "large";
21
21
  } & HTMLAttributes<HTMLParagraphElement> & {
22
- children?: import("react").ReactNode | undefined;
22
+ children?: ReactNode | undefined;
23
23
  } & import("react").RefAttributes<HTMLParagraphElement>>;
@@ -1,8 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
+ const wrapChildren = (size, children) => {
5
+ if (size === 'large')
6
+ return _jsx("b", { className: "ams-paragraph__b", children: children });
7
+ if (size === 'small')
8
+ return _jsx("small", { className: "ams-paragraph__small", children: children });
9
+ return children;
10
+ };
4
11
  /**
5
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-paragraph--docs Paragraph docs at Amsterdam Design System}
6
13
  */
7
- export const Paragraph = forwardRef(({ children, className, color, size, ...restProps }, ref) => (_jsx("p", { className: clsx('ams-paragraph', color && `ams-paragraph--${color}`, size && `ams-paragraph--${size}`, className), ref: ref, ...restProps, children: children })));
14
+ export const Paragraph = forwardRef(({ children, className, color, size, ...restProps }, ref) => (_jsx("p", { className: clsx('ams-paragraph', color && `ams-paragraph--${color}`, size && `ams-paragraph--${size}`, className), ref: ref, ...restProps, children: wrapChildren(size, children) })));
8
15
  Paragraph.displayName = 'Paragraph';
@@ -13,4 +13,4 @@ export type PasswordInputProps = {
13
13
  export declare const PasswordInput: import("react").ForwardRefExoticComponent<{
14
14
  /** Whether the value fails a validation rule. */
15
15
  invalid?: boolean;
16
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "aria-invalid" | "autoCapitalize" | "spellCheck" | "autoCorrect"> & import("react").RefAttributes<HTMLInputElement>>;
16
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "autoCapitalize" | "spellCheck" | "autoCorrect" | "aria-invalid" | "type"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -23,6 +23,6 @@ export declare const Radio: import("react").ForwardRefExoticComponent<{
23
23
  icon?: Function | ReactNode;
24
24
  /** Whether the value fails a validation rule. */
25
25
  invalid?: boolean;
26
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "aria-invalid"> & {
26
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
27
27
  children?: ReactNode | undefined;
28
28
  } & import("react").RefAttributes<HTMLInputElement>>;
package/dist/Row/Row.d.ts CHANGED
@@ -66,5 +66,5 @@ export declare const Row: import("react").ForwardRefExoticComponent<{
66
66
  wrap?: boolean;
67
67
  } & HTMLAttributes<HTMLElement> & {
68
68
  children?: import("react").ReactNode | undefined;
69
- } & import("react").RefAttributes<unknown>>;
69
+ } & import("react").RefAttributes<any>>;
70
70
  export {};