@amsterdam/design-system-react 0.14.1 → 0.16.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 (591) hide show
  1. package/README.md +1 -1
  2. package/dist/Accordion/Accordion.d.ts +35 -0
  3. package/dist/Accordion/Accordion.js +22 -0
  4. package/dist/Accordion/Accordion.test.d.ts +1 -0
  5. package/dist/Accordion/Accordion.test.js +40 -0
  6. package/dist/Accordion/AccordionContext.d.ts +12 -0
  7. package/dist/Accordion/AccordionContext.js +11 -0
  8. package/dist/Accordion/AccordionSection.d.ts +19 -0
  9. package/dist/Accordion/AccordionSection.js +22 -0
  10. package/dist/Accordion/AccordionSection.test.d.ts +1 -0
  11. package/dist/Accordion/AccordionSection.test.js +83 -0
  12. package/dist/Accordion/index.d.ts +3 -0
  13. package/dist/Accordion/index.js +1 -0
  14. package/dist/ActionGroup/ActionGroup.d.ts +9 -0
  15. package/dist/ActionGroup/ActionGroup.js +9 -0
  16. package/dist/ActionGroup/ActionGroup.test.d.ts +1 -0
  17. package/dist/ActionGroup/ActionGroup.test.js +29 -0
  18. package/dist/ActionGroup/index.d.ts +2 -0
  19. package/dist/ActionGroup/index.js +1 -0
  20. package/dist/Alert/Alert.d.ts +46 -0
  21. package/dist/Alert/Alert.js +22 -0
  22. package/dist/Alert/Alert.test.d.ts +1 -0
  23. package/dist/Alert/Alert.test.js +59 -0
  24. package/dist/Alert/index.d.ts +2 -0
  25. package/dist/Alert/index.js +1 -0
  26. package/dist/Avatar/Avatar.d.ts +24 -0
  27. package/dist/Avatar/Avatar.js +25 -0
  28. package/dist/Avatar/Avatar.test.d.ts +1 -0
  29. package/dist/Avatar/Avatar.test.js +58 -0
  30. package/dist/Avatar/index.d.ts +2 -0
  31. package/dist/Avatar/index.js +1 -0
  32. package/dist/Badge/Badge.d.ts +20 -0
  33. package/dist/Badge/Badge.js +10 -0
  34. package/dist/Badge/Badge.test.d.ts +1 -0
  35. package/dist/Badge/Badge.test.js +39 -0
  36. package/dist/Badge/index.d.ts +2 -0
  37. package/dist/Badge/index.js +1 -0
  38. package/dist/Blockquote/Blockquote.d.ts +15 -0
  39. package/dist/Blockquote/Blockquote.js +9 -0
  40. package/dist/Blockquote/Blockquote.test.d.ts +1 -0
  41. package/dist/Blockquote/Blockquote.test.js +42 -0
  42. package/dist/Blockquote/index.d.ts +2 -0
  43. package/dist/Blockquote/index.js +1 -0
  44. package/dist/Breadcrumb/Breadcrumb.d.ts +11 -0
  45. package/dist/Breadcrumb/Breadcrumb.js +11 -0
  46. package/dist/Breadcrumb/Breadcrumb.test.d.ts +1 -0
  47. package/dist/Breadcrumb/Breadcrumb.test.js +41 -0
  48. package/dist/Breadcrumb/BreadcrumbLink.d.ts +7 -0
  49. package/dist/Breadcrumb/BreadcrumbLink.js +9 -0
  50. package/dist/Breadcrumb/BreadcrumbLink.test.d.ts +1 -0
  51. package/dist/Breadcrumb/BreadcrumbLink.test.js +36 -0
  52. package/dist/Breadcrumb/index.d.ts +3 -0
  53. package/dist/Breadcrumb/index.js +1 -0
  54. package/dist/Breakout/Breakout.d.ts +15 -0
  55. package/dist/Breakout/Breakout.js +12 -0
  56. package/dist/Breakout/Breakout.test.d.ts +1 -0
  57. package/dist/Breakout/Breakout.test.js +58 -0
  58. package/dist/Breakout/BreakoutCell.d.ts +37 -0
  59. package/dist/Breakout/BreakoutCell.js +11 -0
  60. package/dist/Breakout/BreakoutCell.test.d.ts +1 -0
  61. package/dist/Breakout/BreakoutCell.test.js +124 -0
  62. package/dist/Breakout/breakoutCellClasses.d.ts +6 -0
  63. package/dist/Breakout/breakoutCellClasses.js +11 -0
  64. package/dist/Breakout/index.d.ts +3 -0
  65. package/dist/Breakout/index.js +1 -0
  66. package/dist/Button/Button.d.ts +31 -0
  67. package/dist/Button/Button.js +10 -0
  68. package/dist/Button/Button.test.d.ts +1 -0
  69. package/dist/Button/Button.test.js +110 -0
  70. package/dist/Button/index.d.ts +2 -0
  71. package/dist/Button/index.js +1 -0
  72. package/dist/Card/Card.d.ts +28 -0
  73. package/dist/Card/Card.js +19 -0
  74. package/dist/Card/Card.test.d.ts +1 -0
  75. package/dist/Card/Card.test.js +29 -0
  76. package/dist/Card/CardHeading.d.ts +11 -0
  77. package/dist/Card/CardHeading.js +10 -0
  78. package/dist/Card/CardHeading.test.d.ts +1 -0
  79. package/dist/Card/CardHeading.test.js +34 -0
  80. package/dist/Card/CardHeadingGroup.d.ts +15 -0
  81. package/dist/Card/CardHeadingGroup.js +10 -0
  82. package/dist/Card/CardHeadingGroup.test.d.ts +1 -0
  83. package/dist/Card/CardHeadingGroup.test.js +34 -0
  84. package/dist/Card/CardImage.d.ts +7 -0
  85. package/dist/Card/CardImage.js +10 -0
  86. package/dist/Card/CardImage.test.d.ts +1 -0
  87. package/dist/Card/CardImage.test.js +29 -0
  88. package/dist/Card/CardLink.d.ts +9 -0
  89. package/dist/Card/CardLink.js +9 -0
  90. package/dist/Card/CardLink.test.d.ts +1 -0
  91. package/dist/Card/CardLink.test.js +29 -0
  92. package/dist/Card/index.d.ts +4 -0
  93. package/dist/Card/index.js +1 -0
  94. package/dist/CharacterCount/CharacterCount.d.ts +17 -0
  95. package/dist/CharacterCount/CharacterCount.js +9 -0
  96. package/dist/CharacterCount/CharacterCount.test.d.ts +1 -0
  97. package/dist/CharacterCount/CharacterCount.test.js +34 -0
  98. package/dist/CharacterCount/index.d.ts +2 -0
  99. package/dist/CharacterCount/index.js +1 -0
  100. package/dist/Checkbox/Checkbox.d.ts +19 -0
  101. package/dist/Checkbox/Checkbox.js +24 -0
  102. package/dist/Checkbox/Checkbox.test.d.ts +1 -0
  103. package/dist/Checkbox/Checkbox.test.js +123 -0
  104. package/dist/Checkbox/index.d.ts +2 -0
  105. package/dist/Checkbox/index.js +1 -0
  106. package/dist/Column/Column.d.ts +57 -0
  107. package/dist/Column/Column.js +11 -0
  108. package/dist/Column/Column.test.d.ts +1 -0
  109. package/dist/Column/Column.test.js +55 -0
  110. package/dist/Column/index.d.ts +2 -0
  111. package/dist/Column/index.js +1 -0
  112. package/dist/DateInput/DateInput.d.ts +20 -0
  113. package/dist/DateInput/DateInput.js +10 -0
  114. package/dist/DateInput/DateInput.test.d.ts +1 -0
  115. package/dist/DateInput/DateInput.test.js +54 -0
  116. package/dist/DateInput/index.d.ts +2 -0
  117. package/dist/DateInput/index.js +1 -0
  118. package/dist/DescriptionList/DescriptionList.d.ts +30 -0
  119. package/dist/DescriptionList/DescriptionList.js +18 -0
  120. package/dist/DescriptionList/DescriptionList.test.d.ts +1 -0
  121. package/dist/DescriptionList/DescriptionList.test.js +39 -0
  122. package/dist/DescriptionList/DescriptionListDescription.d.ts +9 -0
  123. package/dist/DescriptionList/DescriptionListDescription.js +9 -0
  124. package/dist/DescriptionList/DescriptionListDescription.test.d.ts +1 -0
  125. package/dist/DescriptionList/DescriptionListDescription.test.js +29 -0
  126. package/dist/DescriptionList/DescriptionListSection.d.ts +9 -0
  127. package/dist/DescriptionList/DescriptionListSection.js +9 -0
  128. package/dist/DescriptionList/DescriptionListSection.test.d.ts +1 -0
  129. package/dist/DescriptionList/DescriptionListSection.test.js +29 -0
  130. package/dist/DescriptionList/DescriptionListTerm.d.ts +9 -0
  131. package/dist/DescriptionList/DescriptionListTerm.js +9 -0
  132. package/dist/DescriptionList/DescriptionListTerm.test.d.ts +1 -0
  133. package/dist/DescriptionList/DescriptionListTerm.test.js +29 -0
  134. package/dist/DescriptionList/index.d.ts +4 -0
  135. package/dist/DescriptionList/index.js +1 -0
  136. package/dist/Dialog/Dialog.d.ts +27 -0
  137. package/dist/Dialog/Dialog.js +17 -0
  138. package/dist/Dialog/Dialog.test.d.ts +1 -0
  139. package/dist/Dialog/Dialog.test.js +78 -0
  140. package/dist/Dialog/index.d.ts +2 -0
  141. package/dist/Dialog/index.js +1 -0
  142. package/dist/ErrorMessage/ErrorMessage.d.ts +19 -0
  143. package/dist/ErrorMessage/ErrorMessage.js +11 -0
  144. package/dist/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  145. package/dist/ErrorMessage/ErrorMessage.test.js +49 -0
  146. package/dist/ErrorMessage/index.d.ts +2 -0
  147. package/dist/ErrorMessage/index.js +1 -0
  148. package/dist/Field/Field.d.ts +15 -0
  149. package/dist/Field/Field.js +9 -0
  150. package/dist/Field/Field.test.d.ts +1 -0
  151. package/dist/Field/Field.test.js +34 -0
  152. package/dist/Field/index.d.ts +2 -0
  153. package/dist/Field/index.js +1 -0
  154. package/dist/FieldSet/FieldSet.d.ts +23 -0
  155. package/dist/FieldSet/FieldSet.js +12 -0
  156. package/dist/FieldSet/FieldSet.test.d.ts +1 -0
  157. package/dist/FieldSet/FieldSet.test.js +59 -0
  158. package/dist/FieldSet/index.d.ts +2 -0
  159. package/dist/FieldSet/index.js +1 -0
  160. package/dist/Figure/Figure.d.ts +15 -0
  161. package/dist/Figure/Figure.js +11 -0
  162. package/dist/Figure/Figure.test.d.ts +1 -0
  163. package/dist/Figure/Figure.test.js +29 -0
  164. package/dist/Figure/FigureCaption.d.ts +15 -0
  165. package/dist/Figure/FigureCaption.js +9 -0
  166. package/dist/Figure/FigureCaption.test.d.ts +1 -0
  167. package/dist/Figure/FigureCaption.test.js +34 -0
  168. package/dist/Figure/index.d.ts +2 -0
  169. package/dist/Figure/index.js +1 -0
  170. package/dist/FileInput/FileInput.d.ts +7 -0
  171. package/dist/FileInput/FileInput.js +9 -0
  172. package/dist/FileInput/FileInput.test.d.ts +1 -0
  173. package/dist/FileInput/FileInput.test.js +29 -0
  174. package/dist/FileInput/index.d.ts +2 -0
  175. package/dist/FileInput/index.js +1 -0
  176. package/dist/FileList/FileList.d.ts +17 -0
  177. package/dist/FileList/FileList.js +13 -0
  178. package/dist/FileList/FileList.test.d.ts +1 -0
  179. package/dist/FileList/FileList.test.js +29 -0
  180. package/dist/FileList/FileListItem.d.ts +13 -0
  181. package/dist/FileList/FileListItem.js +14 -0
  182. package/dist/FileList/FileListItem.test.d.ts +1 -0
  183. package/dist/FileList/FileListItem.test.js +40 -0
  184. package/dist/FileList/index.d.ts +2 -0
  185. package/dist/FileList/index.js +1 -0
  186. package/dist/Grid/Grid.d.ts +40 -0
  187. package/dist/Grid/Grid.js +15 -0
  188. package/dist/Grid/Grid.test.d.ts +1 -0
  189. package/dist/Grid/Grid.test.js +65 -0
  190. package/dist/Grid/GridCell.d.ts +25 -0
  191. package/dist/Grid/GridCell.js +11 -0
  192. package/dist/Grid/GridCell.test.d.ts +1 -0
  193. package/dist/Grid/GridCell.test.js +80 -0
  194. package/dist/Grid/gridCellClasses.d.ts +8 -0
  195. package/dist/Grid/gridCellClasses.js +18 -0
  196. package/dist/Grid/index.d.ts +3 -0
  197. package/dist/Grid/index.js +1 -0
  198. package/dist/Grid/paddingClasses.d.ts +2 -0
  199. package/dist/Grid/paddingClasses.js +13 -0
  200. package/dist/Heading/Heading.d.ts +24 -0
  201. package/dist/Heading/Heading.js +15 -0
  202. package/dist/Heading/Heading.test.d.ts +1 -0
  203. package/dist/Heading/Heading.test.js +68 -0
  204. package/dist/Heading/getHeadingTag.d.ts +2 -0
  205. package/dist/Heading/getHeadingTag.js +13 -0
  206. package/dist/Heading/index.d.ts +2 -0
  207. package/dist/Heading/index.js +1 -0
  208. package/dist/Hint/Hint.d.ts +16 -0
  209. package/dist/Hint/Hint.js +21 -0
  210. package/dist/Hint/Hint.test.d.ts +1 -0
  211. package/dist/Hint/Hint.test.js +49 -0
  212. package/dist/Hint/index.d.ts +2 -0
  213. package/dist/Hint/index.js +1 -0
  214. package/dist/Icon/Icon.d.ts +30 -0
  215. package/dist/Icon/Icon.js +12 -0
  216. package/dist/Icon/Icon.test.d.ts +1 -0
  217. package/dist/Icon/Icon.test.js +51 -0
  218. package/dist/Icon/index.d.ts +2 -0
  219. package/dist/Icon/index.js +1 -0
  220. package/dist/IconButton/IconButton.d.ts +26 -0
  221. package/dist/IconButton/IconButton.js +11 -0
  222. package/dist/IconButton/IconButton.test.d.ts +1 -0
  223. package/dist/IconButton/IconButton.test.js +44 -0
  224. package/dist/IconButton/index.d.ts +2 -0
  225. package/dist/IconButton/index.js +1 -0
  226. package/dist/Image/Image.d.ts +14 -0
  227. package/dist/Image/Image.js +10 -0
  228. package/dist/Image/Image.test.d.ts +1 -0
  229. package/dist/Image/Image.test.js +39 -0
  230. package/dist/Image/generateAspectRatioClass.d.ts +1 -0
  231. package/dist/Image/generateAspectRatioClass.js +1 -0
  232. package/dist/Image/index.d.ts +3 -0
  233. package/dist/Image/index.js +2 -0
  234. package/dist/ImageSlider/ImageSlider.d.ts +49 -0
  235. package/dist/ImageSlider/ImageSlider.js +98 -0
  236. package/dist/ImageSlider/ImageSlider.test.d.ts +1 -0
  237. package/dist/ImageSlider/ImageSlider.test.js +66 -0
  238. package/dist/ImageSlider/ImageSliderContext.d.ts +13 -0
  239. package/dist/ImageSlider/ImageSliderContext.js +14 -0
  240. package/dist/ImageSlider/ImageSliderControls.d.ts +17 -0
  241. package/dist/ImageSlider/ImageSliderControls.js +17 -0
  242. package/dist/ImageSlider/ImageSliderControls.test.d.ts +1 -0
  243. package/dist/ImageSlider/ImageSliderControls.test.js +21 -0
  244. package/dist/ImageSlider/ImageSliderItem.d.ts +15 -0
  245. package/dist/ImageSlider/ImageSliderItem.js +15 -0
  246. package/dist/ImageSlider/ImageSliderItem.test.d.ts +1 -0
  247. package/dist/ImageSlider/ImageSliderItem.test.js +33 -0
  248. package/dist/ImageSlider/ImageSliderScroller.d.ts +9 -0
  249. package/dist/ImageSlider/ImageSliderScroller.js +9 -0
  250. package/dist/ImageSlider/ImageSliderScroller.test.d.ts +1 -0
  251. package/dist/ImageSlider/ImageSliderScroller.test.js +33 -0
  252. package/dist/ImageSlider/ImageSliderThumbnails.d.ts +14 -0
  253. package/dist/ImageSlider/ImageSliderThumbnails.js +32 -0
  254. package/dist/ImageSlider/ImageSliderThumbnails.test.d.ts +1 -0
  255. package/dist/ImageSlider/ImageSliderThumbnails.test.js +48 -0
  256. package/dist/ImageSlider/index.d.ts +3 -0
  257. package/dist/ImageSlider/index.js +1 -0
  258. package/dist/InvalidFormAlert/InvalidFormAlert.d.ts +68 -0
  259. package/dist/InvalidFormAlert/InvalidFormAlert.js +20 -0
  260. package/dist/InvalidFormAlert/InvalidFormAlert.test.d.ts +1 -0
  261. package/dist/InvalidFormAlert/InvalidFormAlert.test.js +104 -0
  262. package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.d.ts +12 -0
  263. package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.js +22 -0
  264. package/dist/InvalidFormAlert/index.d.ts +2 -0
  265. package/dist/InvalidFormAlert/index.js +1 -0
  266. package/dist/InvalidFormAlert/useAddErrorCountToDocumentTitle.d.ts +11 -0
  267. package/dist/InvalidFormAlert/useAddErrorCountToDocumentTitle.js +26 -0
  268. package/dist/Label/Label.d.ts +14 -0
  269. package/dist/Label/Label.js +13 -0
  270. package/dist/Label/Label.test.d.ts +1 -0
  271. package/dist/Label/Label.test.js +73 -0
  272. package/dist/Label/index.d.ts +1 -0
  273. package/dist/Label/index.js +1 -0
  274. package/dist/Link/Link.d.ts +13 -0
  275. package/dist/Link/Link.js +9 -0
  276. package/dist/Link/Link.test.d.ts +1 -0
  277. package/dist/Link/Link.test.js +39 -0
  278. package/dist/Link/index.d.ts +2 -0
  279. package/dist/Link/index.js +1 -0
  280. package/dist/LinkList/LinkList.d.ts +17 -0
  281. package/dist/LinkList/LinkList.js +14 -0
  282. package/dist/LinkList/LinkList.test.d.ts +1 -0
  283. package/dist/LinkList/LinkList.test.js +29 -0
  284. package/dist/LinkList/LinkListLink.d.ts +24 -0
  285. package/dist/LinkList/LinkListLink.js +14 -0
  286. package/dist/LinkList/LinkListLink.test.d.ts +1 -0
  287. package/dist/LinkList/LinkListLink.test.js +50 -0
  288. package/dist/LinkList/index.d.ts +3 -0
  289. package/dist/LinkList/index.js +1 -0
  290. package/dist/Logo/Logo.d.ts +11 -0
  291. package/dist/Logo/Logo.js +21 -0
  292. package/dist/Logo/Logo.test.d.ts +1 -0
  293. package/dist/Logo/Logo.test.js +29 -0
  294. package/dist/Logo/brand/LogoAmsterdam.d.ts +3 -0
  295. package/dist/Logo/brand/LogoAmsterdam.js +5 -0
  296. package/dist/Logo/brand/LogoGgdAmsterdam.d.ts +3 -0
  297. package/dist/Logo/brand/LogoGgdAmsterdam.js +5 -0
  298. package/dist/Logo/brand/LogoMuseumWeesp.d.ts +3 -0
  299. package/dist/Logo/brand/LogoMuseumWeesp.js +5 -0
  300. package/dist/Logo/brand/LogoStadsarchief.d.ts +3 -0
  301. package/dist/Logo/brand/LogoStadsarchief.js +5 -0
  302. package/dist/Logo/brand/LogoStadsbankVanLening.d.ts +3 -0
  303. package/dist/Logo/brand/LogoStadsbankVanLening.js +5 -0
  304. package/dist/Logo/brand/LogoVgaVerzekeringen.d.ts +3 -0
  305. package/dist/Logo/brand/LogoVgaVerzekeringen.js +5 -0
  306. package/dist/Logo/brand/index.d.ts +6 -0
  307. package/dist/Logo/brand/index.js +6 -0
  308. package/dist/Logo/index.d.ts +2 -0
  309. package/dist/Logo/index.js +1 -0
  310. package/dist/Mark/Mark.d.ts +9 -0
  311. package/dist/Mark/Mark.js +9 -0
  312. package/dist/Mark/Mark.test.d.ts +1 -0
  313. package/dist/Mark/Mark.test.js +29 -0
  314. package/dist/Mark/index.d.ts +2 -0
  315. package/dist/Mark/index.js +1 -0
  316. package/dist/OrderedList/OrderedList.d.ts +27 -0
  317. package/dist/OrderedList/OrderedList.js +11 -0
  318. package/dist/OrderedList/OrderedList.test.d.ts +1 -0
  319. package/dist/OrderedList/OrderedList.test.js +51 -0
  320. package/dist/OrderedList/OrderedListItem.d.ts +9 -0
  321. package/dist/OrderedList/OrderedListItem.js +9 -0
  322. package/dist/OrderedList/OrderedListItem.test.d.ts +1 -0
  323. package/dist/OrderedList/OrderedListItem.test.js +28 -0
  324. package/dist/OrderedList/index.d.ts +3 -0
  325. package/dist/OrderedList/index.js +1 -0
  326. package/dist/Overlap/Overlap.d.ts +9 -0
  327. package/dist/Overlap/Overlap.js +9 -0
  328. package/dist/Overlap/Overlap.test.d.ts +1 -0
  329. package/dist/Overlap/Overlap.test.js +34 -0
  330. package/dist/Overlap/index.d.ts +2 -0
  331. package/dist/Overlap/index.js +1 -0
  332. package/dist/Page/Page.d.ts +9 -0
  333. package/dist/Page/Page.js +9 -0
  334. package/dist/Page/Page.test.d.ts +1 -0
  335. package/dist/Page/Page.test.js +29 -0
  336. package/dist/Page/index.d.ts +2 -0
  337. package/dist/Page/index.js +1 -0
  338. package/dist/PageFooter/PageFooter.d.ts +19 -0
  339. package/dist/PageFooter/PageFooter.js +17 -0
  340. package/dist/PageFooter/PageFooter.test.d.ts +1 -0
  341. package/dist/PageFooter/PageFooter.test.js +29 -0
  342. package/dist/PageFooter/PageFooterMenu.d.ts +9 -0
  343. package/dist/PageFooter/PageFooterMenu.js +9 -0
  344. package/dist/PageFooter/PageFooterMenu.test.d.ts +1 -0
  345. package/dist/PageFooter/PageFooterMenu.test.js +31 -0
  346. package/dist/PageFooter/PageFooterMenuLink.d.ts +9 -0
  347. package/dist/PageFooter/PageFooterMenuLink.js +9 -0
  348. package/dist/PageFooter/PageFooterMenuLink.test.d.ts +1 -0
  349. package/dist/PageFooter/PageFooterMenuLink.test.js +29 -0
  350. package/dist/PageFooter/PageFooterSpotlight.d.ts +9 -0
  351. package/dist/PageFooter/PageFooterSpotlight.js +9 -0
  352. package/dist/PageFooter/PageFooterSpotlight.test.d.ts +1 -0
  353. package/dist/PageFooter/PageFooterSpotlight.test.js +29 -0
  354. package/dist/PageFooter/index.d.ts +5 -0
  355. package/dist/PageFooter/index.js +1 -0
  356. package/dist/PageHeader/PageHeader.d.ts +49 -0
  357. package/dist/PageHeader/PageHeader.js +31 -0
  358. package/dist/PageHeader/PageHeader.test.d.ts +2 -0
  359. package/dist/PageHeader/PageHeader.test.js +120 -0
  360. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.d.ts +2 -0
  361. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +6 -0
  362. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.d.ts +1 -0
  363. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.js +34 -0
  364. package/dist/PageHeader/PageHeaderMenuIcon.d.ts +2 -0
  365. package/dist/PageHeader/PageHeaderMenuIcon.js +2 -0
  366. package/dist/PageHeader/PageHeaderMenuLink.d.ts +9 -0
  367. package/dist/PageHeader/PageHeaderMenuLink.js +5 -0
  368. package/dist/PageHeader/PageHeaderMenuLink.test.d.ts +1 -0
  369. package/dist/PageHeader/PageHeaderMenuLink.test.js +41 -0
  370. package/dist/PageHeader/index.d.ts +3 -0
  371. package/dist/PageHeader/index.js +1 -0
  372. package/dist/PageHeader/matchMedia.mock.d.ts +0 -0
  373. package/dist/PageHeader/matchMedia.mock.js +15 -0
  374. package/dist/PageHeading/PageHeading.d.ts +15 -0
  375. package/dist/PageHeading/PageHeading.js +9 -0
  376. package/dist/PageHeading/PageHeading.test.d.ts +1 -0
  377. package/dist/PageHeading/PageHeading.test.js +36 -0
  378. package/dist/PageHeading/index.d.ts +2 -0
  379. package/dist/PageHeading/index.js +1 -0
  380. package/dist/Pagination/LinkItem.d.ts +7 -0
  381. package/dist/Pagination/LinkItem.js +7 -0
  382. package/dist/Pagination/Pagination.d.ts +59 -0
  383. package/dist/Pagination/Pagination.js +23 -0
  384. package/dist/Pagination/Pagination.test.d.ts +1 -0
  385. package/dist/Pagination/Pagination.test.js +120 -0
  386. package/dist/Pagination/Spacer.d.ts +1 -0
  387. package/dist/Pagination/Spacer.js +2 -0
  388. package/dist/Pagination/getRange.d.ts +16 -0
  389. package/dist/Pagination/getRange.js +41 -0
  390. package/dist/Pagination/index.d.ts +2 -0
  391. package/dist/Pagination/index.js +1 -0
  392. package/dist/Paragraph/Paragraph.d.ts +20 -0
  393. package/dist/Paragraph/Paragraph.js +10 -0
  394. package/dist/Paragraph/Paragraph.test.d.ts +1 -0
  395. package/dist/Paragraph/Paragraph.test.js +58 -0
  396. package/dist/Paragraph/index.d.ts +2 -0
  397. package/dist/Paragraph/index.js +1 -0
  398. package/dist/PasswordInput/PasswordInput.d.ts +13 -0
  399. package/dist/PasswordInput/PasswordInput.js +9 -0
  400. package/dist/PasswordInput/PasswordInput.test.d.ts +1 -0
  401. package/dist/PasswordInput/PasswordInput.test.js +85 -0
  402. package/dist/PasswordInput/index.d.ts +2 -0
  403. package/dist/PasswordInput/index.js +1 -0
  404. package/dist/Radio/Radio.d.ts +19 -0
  405. package/dist/Radio/Radio.js +16 -0
  406. package/dist/Radio/Radio.test.d.ts +1 -0
  407. package/dist/Radio/Radio.test.js +121 -0
  408. package/dist/Radio/RadioIcon.d.ts +3 -0
  409. package/dist/Radio/RadioIcon.js +3 -0
  410. package/dist/Radio/index.d.ts +2 -0
  411. package/dist/Radio/index.js +1 -0
  412. package/dist/Row/Row.d.ts +67 -0
  413. package/dist/Row/Row.js +11 -0
  414. package/dist/Row/Row.test.d.ts +1 -0
  415. package/dist/Row/Row.test.js +60 -0
  416. package/dist/Row/index.d.ts +2 -0
  417. package/dist/Row/index.js +1 -0
  418. package/dist/SearchField/SearchField.d.ts +294 -0
  419. package/dist/SearchField/SearchField.js +14 -0
  420. package/dist/SearchField/SearchField.test.d.ts +1 -0
  421. package/dist/SearchField/SearchField.test.js +46 -0
  422. package/dist/SearchField/SearchFieldButton.d.ts +8 -0
  423. package/dist/SearchField/SearchFieldButton.js +10 -0
  424. package/dist/SearchField/SearchFieldInput.d.ts +11 -0
  425. package/dist/SearchField/SearchFieldInput.js +12 -0
  426. package/dist/SearchField/SearchFieldInput.test.d.ts +1 -0
  427. package/dist/SearchField/SearchFieldInput.test.js +61 -0
  428. package/dist/SearchField/index.d.ts +2 -0
  429. package/dist/SearchField/index.js +1 -0
  430. package/dist/Select/Select.d.ts +22 -0
  431. package/dist/Select/Select.js +12 -0
  432. package/dist/Select/Select.test.d.ts +1 -0
  433. package/dist/Select/Select.test.js +70 -0
  434. package/dist/Select/SelectOption.d.ts +9 -0
  435. package/dist/Select/SelectOption.js +9 -0
  436. package/dist/Select/SelectOption.test.d.ts +1 -0
  437. package/dist/Select/SelectOption.test.js +41 -0
  438. package/dist/Select/SelectOptionGroup.d.ts +9 -0
  439. package/dist/Select/SelectOptionGroup.js +9 -0
  440. package/dist/Select/SelectOptionGroup.test.d.ts +1 -0
  441. package/dist/Select/SelectOptionGroup.test.js +41 -0
  442. package/dist/Select/index.d.ts +3 -0
  443. package/dist/Select/index.js +1 -0
  444. package/dist/SkipLink/SkipLink.d.ts +9 -0
  445. package/dist/SkipLink/SkipLink.js +9 -0
  446. package/dist/SkipLink/SkipLink.test.d.ts +1 -0
  447. package/dist/SkipLink/SkipLink.test.js +29 -0
  448. package/dist/SkipLink/index.d.ts +2 -0
  449. package/dist/SkipLink/index.js +1 -0
  450. package/dist/Spotlight/Spotlight.d.ts +24 -0
  451. package/dist/Spotlight/Spotlight.js +11 -0
  452. package/dist/Spotlight/Spotlight.test.d.ts +1 -0
  453. package/dist/Spotlight/Spotlight.test.js +42 -0
  454. package/dist/Spotlight/index.d.ts +2 -0
  455. package/dist/Spotlight/index.js +1 -0
  456. package/dist/StandaloneLink/StandaloneLink.d.ts +17 -0
  457. package/dist/StandaloneLink/StandaloneLink.js +10 -0
  458. package/dist/StandaloneLink/StandaloneLink.test.d.ts +1 -0
  459. package/dist/StandaloneLink/StandaloneLink.test.js +40 -0
  460. package/dist/StandaloneLink/index.d.ts +2 -0
  461. package/dist/StandaloneLink/index.js +1 -0
  462. package/dist/Switch/Switch.d.ts +9 -0
  463. package/dist/Switch/Switch.js +12 -0
  464. package/dist/Switch/Switch.test.d.ts +1 -0
  465. package/dist/Switch/Switch.test.js +65 -0
  466. package/dist/Switch/index.d.ts +2 -0
  467. package/dist/Switch/index.js +1 -0
  468. package/dist/Table/Table.d.ts +31 -0
  469. package/dist/Table/Table.js +25 -0
  470. package/dist/Table/Table.test.d.ts +1 -0
  471. package/dist/Table/Table.test.js +29 -0
  472. package/dist/Table/TableBody.d.ts +9 -0
  473. package/dist/Table/TableBody.js +9 -0
  474. package/dist/Table/TableBody.test.d.ts +1 -0
  475. package/dist/Table/TableBody.test.js +30 -0
  476. package/dist/Table/TableCaption.d.ts +10 -0
  477. package/dist/Table/TableCaption.js +10 -0
  478. package/dist/Table/TableCaption.test.d.ts +1 -0
  479. package/dist/Table/TableCaption.test.js +41 -0
  480. package/dist/Table/TableCell.d.ts +9 -0
  481. package/dist/Table/TableCell.js +9 -0
  482. package/dist/Table/TableCell.test.d.ts +1 -0
  483. package/dist/Table/TableCell.test.js +32 -0
  484. package/dist/Table/TableFooter.d.ts +9 -0
  485. package/dist/Table/TableFooter.js +9 -0
  486. package/dist/Table/TableFooter.test.d.ts +1 -0
  487. package/dist/Table/TableFooter.test.js +30 -0
  488. package/dist/Table/TableHeader.d.ts +9 -0
  489. package/dist/Table/TableHeader.js +9 -0
  490. package/dist/Table/TableHeader.test.d.ts +1 -0
  491. package/dist/Table/TableHeader.test.js +30 -0
  492. package/dist/Table/TableHeaderCell.d.ts +9 -0
  493. package/dist/Table/TableHeaderCell.js +9 -0
  494. package/dist/Table/TableHeaderCell.test.d.ts +1 -0
  495. package/dist/Table/TableHeaderCell.test.js +38 -0
  496. package/dist/Table/TableRow.d.ts +9 -0
  497. package/dist/Table/TableRow.js +9 -0
  498. package/dist/Table/TableRow.test.d.ts +1 -0
  499. package/dist/Table/TableRow.test.js +31 -0
  500. package/dist/Table/index.d.ts +2 -0
  501. package/dist/Table/index.js +1 -0
  502. package/dist/TableOfContents/TableOfContents.d.ts +33 -0
  503. package/dist/TableOfContents/TableOfContents.js +18 -0
  504. package/dist/TableOfContents/TableOfContents.test.d.ts +1 -0
  505. package/dist/TableOfContents/TableOfContents.test.js +40 -0
  506. package/dist/TableOfContents/TableOfContentsLink.d.ts +13 -0
  507. package/dist/TableOfContents/TableOfContentsLink.js +9 -0
  508. package/dist/TableOfContents/TableOfContentsLink.test.d.ts +1 -0
  509. package/dist/TableOfContents/TableOfContentsLink.test.js +30 -0
  510. package/dist/TableOfContents/TableOfContentsList.d.ts +9 -0
  511. package/dist/TableOfContents/TableOfContentsList.js +11 -0
  512. package/dist/TableOfContents/TableOfContentsList.test.d.ts +1 -0
  513. package/dist/TableOfContents/TableOfContentsList.test.js +36 -0
  514. package/dist/TableOfContents/index.d.ts +4 -0
  515. package/dist/TableOfContents/index.js +1 -0
  516. package/dist/Tabs/Tabs.d.ts +31 -0
  517. package/dist/Tabs/Tabs.js +56 -0
  518. package/dist/Tabs/Tabs.test.d.ts +1 -0
  519. package/dist/Tabs/Tabs.test.js +100 -0
  520. package/dist/Tabs/TabsButton.d.ts +15 -0
  521. package/dist/Tabs/TabsButton.js +19 -0
  522. package/dist/Tabs/TabsButton.test.d.ts +1 -0
  523. package/dist/Tabs/TabsButton.test.js +43 -0
  524. package/dist/Tabs/TabsContext.d.ts +11 -0
  525. package/dist/Tabs/TabsContext.js +10 -0
  526. package/dist/Tabs/TabsList.d.ts +9 -0
  527. package/dist/Tabs/TabsList.js +20 -0
  528. package/dist/Tabs/TabsList.test.d.ts +1 -0
  529. package/dist/Tabs/TabsList.test.js +28 -0
  530. package/dist/Tabs/TabsPanel.d.ts +15 -0
  531. package/dist/Tabs/TabsPanel.js +16 -0
  532. package/dist/Tabs/TabsPanel.test.d.ts +1 -0
  533. package/dist/Tabs/TabsPanel.test.js +38 -0
  534. package/dist/Tabs/index.d.ts +5 -0
  535. package/dist/Tabs/index.js +1 -0
  536. package/dist/TextArea/TextArea.d.ts +17 -0
  537. package/dist/TextArea/TextArea.js +9 -0
  538. package/dist/TextArea/TextArea.test.d.ts +1 -0
  539. package/dist/TextArea/TextArea.test.js +101 -0
  540. package/dist/TextArea/index.d.ts +2 -0
  541. package/dist/TextArea/index.js +1 -0
  542. package/dist/TextInput/TextInput.d.ts +20 -0
  543. package/dist/TextInput/TextInput.js +10 -0
  544. package/dist/TextInput/TextInput.test.d.ts +1 -0
  545. package/dist/TextInput/TextInput.test.js +88 -0
  546. package/dist/TextInput/index.d.ts +2 -0
  547. package/dist/TextInput/index.js +1 -0
  548. package/dist/TimeInput/TimeInput.d.ts +13 -0
  549. package/dist/TimeInput/TimeInput.js +9 -0
  550. package/dist/TimeInput/TimeInput.test.d.ts +1 -0
  551. package/dist/TimeInput/TimeInput.test.js +47 -0
  552. package/dist/TimeInput/index.d.ts +2 -0
  553. package/dist/TimeInput/index.js +1 -0
  554. package/dist/UnorderedList/UnorderedList.d.ts +27 -0
  555. package/dist/UnorderedList/UnorderedList.js +13 -0
  556. package/dist/UnorderedList/UnorderedList.test.d.ts +1 -0
  557. package/dist/UnorderedList/UnorderedList.test.js +51 -0
  558. package/dist/UnorderedList/UnorderedListItem.d.ts +9 -0
  559. package/dist/UnorderedList/UnorderedListItem.js +9 -0
  560. package/dist/UnorderedList/UnorderedListItem.test.d.ts +1 -0
  561. package/dist/UnorderedList/UnorderedListItem.test.js +28 -0
  562. package/dist/UnorderedList/index.d.ts +3 -0
  563. package/dist/UnorderedList/index.js +1 -0
  564. package/dist/common/accessibility.d.ts +13 -0
  565. package/dist/common/accessibility.js +13 -0
  566. package/dist/common/formatFileSize.d.ts +10 -0
  567. package/dist/common/formatFileSize.js +17 -0
  568. package/dist/common/formatFileSize.test.d.ts +1 -0
  569. package/dist/common/formatFileSize.test.js +18 -0
  570. package/dist/common/formatFileType.d.ts +10 -0
  571. package/dist/common/formatFileType.js +34 -0
  572. package/dist/common/formatFileType.test.d.ts +1 -0
  573. package/dist/common/formatFileType.test.js +23 -0
  574. package/dist/common/shortSize.d.ts +12 -0
  575. package/dist/common/shortSize.js +15 -0
  576. package/dist/common/types.d.ts +11 -0
  577. package/dist/common/types.js +9 -0
  578. package/dist/common/useIsAfterBreakpoint.d.ts +3 -0
  579. package/dist/common/useIsAfterBreakpoint.js +24 -0
  580. package/dist/common/useKeyboardFocus.d.ts +23 -0
  581. package/dist/common/useKeyboardFocus.js +56 -0
  582. package/dist/common/useKeyboardFocus.test.d.ts +1 -0
  583. package/dist/common/useKeyboardFocus.test.js +79 -0
  584. package/dist/index.cjs.js +1512 -1564
  585. package/dist/index.cjs.js.map +1 -1
  586. package/dist/index.d.ts +339 -345
  587. package/dist/index.esm.js +1509 -1560
  588. package/dist/index.esm.js.map +1 -1
  589. package/dist/index.js +64 -0
  590. package/dist/tsconfig.tsbuildinfo +1 -0
  591. package/package.json +23 -24
package/README.md CHANGED
@@ -24,7 +24,7 @@ npm install @amsterdam/design-system-assets @amsterdam/design-system-css @amster
24
24
  ```
25
25
 
26
26
  The React components themselves are unstyled.
27
- [Override the design tokens](https://github.com/Amsterdam/design-system/blob/main/proprietary/tokens/README.md) to use them with a different branding.
27
+ [Override the design tokens](https://github.com/Amsterdam/design-system/blob/main/packages-proprietary/tokens/README.md) to use them with a different branding.
28
28
 
29
29
  ## Usage
30
30
 
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { HeadingProps } from '../Heading/Heading';
7
+ export type AccordionProps = {
8
+ /**
9
+ * The hierarchical level of this Accordion’s Section Headings within the document.
10
+ * There is no default value; determine the correct level for each instance.
11
+ * Note: this intentionally does not change the font size.
12
+ **/
13
+ headingLevel: HeadingProps['level'];
14
+ /** The HTML element to use for each Accordion Section. */
15
+ sectionAs?: 'div' | 'section';
16
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
17
+ export declare const Accordion: import("react").ForwardRefExoticComponent<{
18
+ /**
19
+ * The hierarchical level of this Accordion’s Section Headings within the document.
20
+ * There is no default value; determine the correct level for each instance.
21
+ * Note: this intentionally does not change the font size.
22
+ **/
23
+ headingLevel: HeadingProps["level"];
24
+ /** The HTML element to use for each Accordion Section. */
25
+ sectionAs?: "div" | "section";
26
+ } & HTMLAttributes<HTMLDivElement> & {
27
+ children?: import("react").ReactNode | undefined;
28
+ } & import("react").RefAttributes<HTMLDivElement>> & {
29
+ Section: import("react").ForwardRefExoticComponent<{
30
+ expanded?: boolean;
31
+ label: string;
32
+ } & HTMLAttributes<HTMLElement> & {
33
+ children?: import("react").ReactNode | undefined;
34
+ } & import("react").RefAttributes<HTMLDivElement>>;
35
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import clsx from 'clsx';
7
+ import { forwardRef, useImperativeHandle, useRef } from 'react';
8
+ import AccordionContext from './AccordionContext';
9
+ import { AccordionSection } from './AccordionSection';
10
+ import { useKeyboardFocus } from '../common/useKeyboardFocus';
11
+ const AccordionRoot = forwardRef(({ children, className, headingLevel, sectionAs = 'section' }, ref) => {
12
+ const innerRef = useRef(null);
13
+ // use a passed ref if it's there, otherwise use innerRef
14
+ useImperativeHandle(ref, () => innerRef.current);
15
+ const { keyDown } = useKeyboardFocus(innerRef, {
16
+ focusableElements: ['.ams-accordion__button:not([disabled])'],
17
+ rotating: true,
18
+ });
19
+ return (_jsx(AccordionContext.Provider, { value: { headingLevel: headingLevel, sectionAs: sectionAs }, children: _jsx("div", { className: clsx('ams-accordion', className), onKeyDown: keyDown, ref: innerRef, children: children }) }));
20
+ });
21
+ AccordionRoot.displayName = 'Accordion';
22
+ export const Accordion = Object.assign(AccordionRoot, { Section: AccordionSection });
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { render, screen } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ import { createRef } from 'react';
5
+ import { Accordion } from './Accordion';
6
+ import '@testing-library/jest-dom';
7
+ describe('Accordion', () => {
8
+ it('renders an accordion', () => {
9
+ const { container } = render(_jsx(Accordion, { headingLevel: 1 }));
10
+ const accordion = container.querySelector('.ams-accordion');
11
+ expect(accordion).toBeInTheDocument();
12
+ expect(accordion).toBeVisible();
13
+ });
14
+ it('renders an extra class name', () => {
15
+ const { container } = render(_jsx(Accordion, { className: "test", headingLevel: 1 }));
16
+ const accordion = container.querySelector('.ams-accordion');
17
+ expect(accordion).toHaveClass('test');
18
+ });
19
+ it('sets focus on Accordion buttons when using arrow keys', async () => {
20
+ const user = userEvent.setup();
21
+ render(_jsxs(Accordion, { headingLevel: 1, children: [_jsx(Accordion.Section, { label: "one" }), _jsx(Accordion.Section, { label: "two" }), _jsx(Accordion.Section, { label: "three" })] }));
22
+ const firstButton = screen.getByRole('button', { name: 'one' });
23
+ const thirdButton = screen.getByRole('button', { name: 'three' });
24
+ await user.click(firstButton);
25
+ expect(firstButton).toHaveFocus();
26
+ // Click the down arrow key twice
27
+ await user.keyboard('{ArrowDown}');
28
+ await user.keyboard('{ArrowDown}');
29
+ expect(thirdButton).toHaveFocus();
30
+ expect(firstButton).not.toHaveFocus();
31
+ await user.keyboard('{ArrowDown}');
32
+ expect(firstButton).toHaveFocus();
33
+ });
34
+ it('supports ForwardRef in React', () => {
35
+ const ref = createRef();
36
+ const { container } = render(_jsx(Accordion, { headingLevel: 1, ref: ref }));
37
+ const accordion = container.querySelector('.ams-accordion');
38
+ expect(ref.current).toBe(accordion);
39
+ });
40
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { AccordionProps } from './Accordion';
6
+ import type { HeadingProps } from '../Heading/Heading';
7
+ export type AccordionContextValue = {
8
+ headingLevel: HeadingProps['level'] | null;
9
+ sectionAs?: AccordionProps['sectionAs'];
10
+ };
11
+ declare const AccordionContext: import("react").Context<AccordionContextValue>;
12
+ export default AccordionContext;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import { createContext } from 'react';
6
+ const defaultValues = {
7
+ headingLevel: null,
8
+ sectionAs: 'section',
9
+ };
10
+ const AccordionContext = createContext(defaultValues);
11
+ export default AccordionContext;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export type AccordionSectionProps = {
7
+ /** Whether the content is displayed initially. */
8
+ expanded?: boolean;
9
+ /** The heading text. */
10
+ label: string;
11
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
12
+ export declare const AccordionSection: import("react").ForwardRefExoticComponent<{
13
+ /** Whether the content is displayed initially. */
14
+ expanded?: boolean;
15
+ /** The heading text. */
16
+ label: string;
17
+ } & HTMLAttributes<HTMLElement> & {
18
+ children?: import("react").ReactNode | undefined;
19
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import { ChevronDownIcon } from '@amsterdam/design-system-react-icons';
7
+ import clsx from 'clsx';
8
+ import { forwardRef, useContext, useId, useState } from 'react';
9
+ import AccordionContext from './AccordionContext';
10
+ import { getHeadingTag } from '../Heading/getHeadingTag';
11
+ import { Icon } from '../Icon/Icon';
12
+ export const AccordionSection = forwardRef(({ children, className, expanded = false, label, ...restProps }, ref) => {
13
+ const { headingLevel, sectionAs } = useContext(AccordionContext);
14
+ const [isExpanded, setIsExpanded] = useState(expanded);
15
+ const HeadingTag = getHeadingTag(headingLevel);
16
+ const SectionTag = sectionAs || 'section';
17
+ const id = useId();
18
+ const buttonId = `button-${id}`;
19
+ const panelId = `panel-${id}`;
20
+ return (_jsxs("div", { className: clsx('ams-accordion__section', className), ref: ref, ...restProps, children: [_jsx(HeadingTag, { className: "ams-accordion__header", children: _jsxs("button", { "aria-controls": panelId, "aria-expanded": isExpanded, className: "ams-accordion__button", id: buttonId, onClick: () => setIsExpanded(!isExpanded), type: "button", children: [_jsx(Icon, { className: "ams-accordion__icon", size: "heading-4", svg: ChevronDownIcon }), label] }) }), _jsx(SectionTag, { "aria-labelledby": buttonId, className: clsx('ams-accordion__panel', { 'ams-accordion__panel--expanded': isExpanded }), id: panelId, children: children })] }));
21
+ });
22
+ AccordionSection.displayName = 'Accordion.Section';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,83 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render, screen } from '@testing-library/react';
3
+ import { createRef } from 'react';
4
+ import { Accordion } from './Accordion';
5
+ import '@testing-library/jest-dom';
6
+ describe('Accordion section', () => {
7
+ const testLabel = 'Test title';
8
+ const testContent = 'Test content';
9
+ it('renders an accordion section', () => {
10
+ const { container } = render(_jsx(Accordion.Section, { label: testLabel, children: testContent }));
11
+ const accordionSection = container.querySelector('.ams-accordion__section');
12
+ expect(accordionSection).toBeInTheDocument();
13
+ expect(accordionSection).toBeVisible();
14
+ });
15
+ it('renders the accordion section BEM class names', () => {
16
+ const { container } = render(_jsx(Accordion.Section, { label: testLabel, children: testContent }));
17
+ const heading = screen.getByRole('heading', {
18
+ name: testLabel,
19
+ });
20
+ const button = screen.getByRole('button', {
21
+ name: testLabel,
22
+ });
23
+ const section = container.querySelector('.ams-accordion__panel');
24
+ expect(heading).toHaveClass('ams-accordion__header');
25
+ expect(button).toHaveClass('ams-accordion__button');
26
+ expect(section).toBeInTheDocument();
27
+ });
28
+ it('adds and removes --expanded class when the button is clicked', () => {
29
+ const { getByText } = render(_jsx(Accordion.Section, { label: testLabel, children: testContent }));
30
+ const button = screen.getByRole('button', {
31
+ name: testLabel,
32
+ });
33
+ const sectionContent = getByText(testContent);
34
+ expect(sectionContent).not.toHaveClass('ams-accordion__panel--expanded');
35
+ fireEvent.click(button);
36
+ expect(sectionContent).toHaveClass('ams-accordion__panel--expanded');
37
+ fireEvent.click(button);
38
+ expect(sectionContent).not.toHaveClass('ams-accordion__panel--expanded');
39
+ });
40
+ it('adds --expanded class when expanded prop is true', () => {
41
+ const { getByText } = render(_jsx(Accordion.Section, { expanded: true, label: testLabel, children: testContent }));
42
+ const sectionContent = getByText(testContent);
43
+ expect(sectionContent).toHaveClass('ams-accordion__panel--expanded');
44
+ });
45
+ it('renders a section HTML tag by defaultt', () => {
46
+ render(_jsx(Accordion, { headingLevel: 1, children: _jsx(Accordion.Section, { label: testLabel, children: testContent }) }));
47
+ const sectionQuery = screen.queryByRole('region');
48
+ expect(sectionQuery).toBeInTheDocument();
49
+ });
50
+ it('does not render a section HTML tag when the sectionAs is "div"', () => {
51
+ render(_jsx(Accordion, { headingLevel: 1, sectionAs: "div", children: _jsx(Accordion.Section, { label: testLabel, children: testContent }) }));
52
+ const sectionQuery = screen.queryByRole('region');
53
+ expect(sectionQuery).not.toBeInTheDocument();
54
+ });
55
+ it('renders an accessible heading', () => {
56
+ render(_jsx(Accordion, { headingLevel: 3, children: _jsx(Accordion.Section, { label: testLabel, children: testContent }) }));
57
+ const heading = screen.getByRole('heading', {
58
+ level: 3,
59
+ name: testLabel,
60
+ });
61
+ expect(heading).toBeInTheDocument();
62
+ expect(heading).toBeVisible();
63
+ });
64
+ it('renders an icon', () => {
65
+ render(_jsx(Accordion.Section, { label: testLabel, children: testContent }));
66
+ const button = screen.getByRole('button', {
67
+ name: testLabel,
68
+ });
69
+ const icon = button ? button.querySelector('svg:only-child') : null;
70
+ expect(icon).toBeInTheDocument();
71
+ });
72
+ it('renders an extra class name', () => {
73
+ const { container } = render(_jsx(Accordion.Section, { className: "test", label: testLabel, children: testContent }));
74
+ const accordionSection = container.querySelector('.ams-accordion__section');
75
+ expect(accordionSection).toHaveClass('test');
76
+ });
77
+ it('supports ForwardRef in React', () => {
78
+ const ref = createRef();
79
+ const { container } = render(_jsx(Accordion.Section, { label: testLabel, ref: ref, children: testContent }));
80
+ const accordionSection = container.querySelector('.ams-accordion__section');
81
+ expect(ref.current).toBe(accordionSection);
82
+ });
83
+ });
@@ -0,0 +1,3 @@
1
+ export { Accordion } from './Accordion';
2
+ export type { AccordionProps } from './Accordion';
3
+ export type { AccordionSectionProps } from './AccordionSection';
@@ -0,0 +1 @@
1
+ export { Accordion } from './Accordion';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export type ActionGroupProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
7
+ export declare const ActionGroup: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
8
+ children?: import("react").ReactNode | undefined;
9
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import clsx from 'clsx';
7
+ import { forwardRef } from 'react';
8
+ export const ActionGroup = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-action-group', className), ref: ref, role: "group", children: children })));
9
+ ActionGroup.displayName = 'ActionGroup';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen } from '@testing-library/react';
3
+ import { createRef } from 'react';
4
+ import { ActionGroup } from './ActionGroup';
5
+ import '@testing-library/jest-dom';
6
+ describe('Action Group', () => {
7
+ it('renders', () => {
8
+ render(_jsx(ActionGroup, {}));
9
+ const component = screen.getByRole('group');
10
+ expect(component).toBeInTheDocument();
11
+ expect(component).toBeVisible();
12
+ });
13
+ it('renders a design system BEM class name', () => {
14
+ render(_jsx(ActionGroup, {}));
15
+ const component = screen.getByRole('group');
16
+ expect(component).toHaveClass('ams-action-group');
17
+ });
18
+ it('renders an extra class name', () => {
19
+ render(_jsx(ActionGroup, { className: "extra" }));
20
+ const component = screen.getByRole('group');
21
+ expect(component).toHaveClass('ams-action-group extra');
22
+ });
23
+ it('supports ForwardRef in React', () => {
24
+ const ref = createRef();
25
+ render(_jsx(ActionGroup, { ref: ref }));
26
+ const component = screen.getByRole('group');
27
+ expect(ref.current).toBe(component);
28
+ });
29
+ });
@@ -0,0 +1,2 @@
1
+ export { ActionGroup } from './ActionGroup';
2
+ export type { ActionGroupProps } from './ActionGroup';
@@ -0,0 +1 @@
1
+ export { ActionGroup } from './ActionGroup';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { HeadingProps } from '../Heading';
7
+ type Severity = 'error' | 'success' | 'warning';
8
+ export type AlertProps = {
9
+ /** Whether the user can dismiss the Alert. Adds a button to its top right. */
10
+ closeable?: boolean;
11
+ /** The label for the button that dismisses the Alert. */
12
+ closeButtonLabel?: string;
13
+ /** The text for the Heading. */
14
+ heading: string;
15
+ /**
16
+ * The hierarchical level of the Alert’s Heading within the document.
17
+ * There is no default value; determine the correct level for each instance.
18
+ * Note: this intentionally does not change the font size.
19
+ **/
20
+ headingLevel: HeadingProps['level'];
21
+ /** A function to run when dismissing. */
22
+ onClose?: () => void;
23
+ /** The significance of the message conveyed. */
24
+ severity?: Severity;
25
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
26
+ export declare const Alert: import("react").ForwardRefExoticComponent<{
27
+ /** Whether the user can dismiss the Alert. Adds a button to its top right. */
28
+ closeable?: boolean;
29
+ /** The label for the button that dismisses the Alert. */
30
+ closeButtonLabel?: string;
31
+ /** The text for the Heading. */
32
+ heading: string;
33
+ /**
34
+ * The hierarchical level of the Alert’s Heading within the document.
35
+ * There is no default value; determine the correct level for each instance.
36
+ * Note: this intentionally does not change the font size.
37
+ **/
38
+ headingLevel: HeadingProps["level"];
39
+ /** A function to run when dismissing. */
40
+ onClose?: () => void;
41
+ /** The significance of the message conveyed. */
42
+ severity?: Severity;
43
+ } & HTMLAttributes<HTMLDivElement> & {
44
+ children?: import("react").ReactNode | undefined;
45
+ } & import("react").RefAttributes<HTMLDivElement>>;
46
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import { AlertIcon, CheckmarkIcon, InfoIcon } from '@amsterdam/design-system-react-icons';
7
+ import clsx from 'clsx';
8
+ import { forwardRef } from 'react';
9
+ import { Heading } from '../Heading';
10
+ import { Icon } from '../Icon';
11
+ import { IconButton } from '../IconButton';
12
+ import { Row } from '../Row';
13
+ const iconSvgBySeverity = {
14
+ error: AlertIcon,
15
+ success: CheckmarkIcon,
16
+ warning: AlertIcon,
17
+ };
18
+ export const Alert = forwardRef(({ children, className, closeable, closeButtonLabel = 'Sluiten', heading, headingLevel, onClose, severity, ...restProps }, ref) => {
19
+ const SeverityIcon = severity ? iconSvgBySeverity[severity] : InfoIcon;
20
+ return (_jsxs("section", { ...restProps, className: clsx('ams-alert', severity && `ams-alert--${severity}`, className), ref: ref, children: [_jsx("div", { className: "ams-alert__severity-indicator", children: _jsx(Icon, { color: "inverse", size: "heading-4", svg: SeverityIcon }) }), _jsxs("div", { className: "ams-alert__content", children: [_jsxs(Row, { align: "between", alignVertical: "start", children: [_jsx(Heading, { level: headingLevel, size: "level-4", children: heading }), closeable && _jsx(IconButton, { label: closeButtonLabel, onClick: onClose, size: "heading-4" })] }), children] })] }));
21
+ });
22
+ Alert.displayName = 'Alert';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render, screen } from '@testing-library/react';
3
+ import { createRef } from 'react';
4
+ import { Alert } from './Alert';
5
+ import '@testing-library/jest-dom';
6
+ describe('Alert', () => {
7
+ it('renders', () => {
8
+ const { container } = render(_jsx(Alert, { heading: "Let op!", headingLevel: 2 }));
9
+ const component = container.querySelector(':only-child');
10
+ const icon = component?.querySelector('.ams-alert__severity-indicator > .ams-icon');
11
+ expect(component).toBeInTheDocument();
12
+ expect(component).toBeVisible();
13
+ expect(icon).toBeInTheDocument();
14
+ expect(icon).toBeVisible();
15
+ });
16
+ it('renders a design system BEM class name', () => {
17
+ const { container } = render(_jsx(Alert, { heading: "Let op!", headingLevel: 2 }));
18
+ const component = container.querySelector(':only-child');
19
+ expect(component).toHaveClass('ams-alert');
20
+ });
21
+ it('renders an extra class name', () => {
22
+ const { container } = render(_jsx(Alert, { className: "extra", heading: "Let op!", headingLevel: 2 }));
23
+ const component = container.querySelector(':only-child');
24
+ expect(component).toHaveClass('ams-alert extra');
25
+ });
26
+ it('supports ForwardRef in React', () => {
27
+ const ref = createRef();
28
+ const { container } = render(_jsx(Alert, { heading: "Let op!", headingLevel: 2, ref: ref }));
29
+ const component = container.querySelector(':only-child');
30
+ expect(ref.current).toBe(component);
31
+ });
32
+ it('renders a heading', () => {
33
+ render(_jsx(Alert, { heading: "Test heading", headingLevel: 2 }));
34
+ const heading = screen.getByRole('heading', {
35
+ name: 'Test heading',
36
+ });
37
+ expect(heading).toBeInTheDocument();
38
+ });
39
+ it('renders the close button', () => {
40
+ const { container } = render(_jsx(Alert, { closeable: true, heading: "Let op!", headingLevel: 2 }));
41
+ const component = container.querySelector(':only-child');
42
+ const closeButton = component?.querySelector('.ams-icon-button');
43
+ expect(closeButton).toBeInTheDocument();
44
+ expect(closeButton).toBeVisible();
45
+ });
46
+ it('renders the close button with a label', () => {
47
+ render(_jsx(Alert, { closeable: true, closeButtonLabel: "Close", heading: "Let op!", headingLevel: 2 }));
48
+ const closeButton = screen.getByRole('button', { name: 'Close' });
49
+ expect(closeButton).toBeInTheDocument();
50
+ });
51
+ it('fires the onClose event when the close button is clicked', () => {
52
+ const onClose = jest.fn();
53
+ const { container } = render(_jsx(Alert, { closeable: true, heading: "Let op!", headingLevel: 2, onClose: onClose }));
54
+ const component = container.querySelector(':only-child');
55
+ const closeButton = component?.querySelector('.ams-icon-button');
56
+ fireEvent.click(closeButton);
57
+ expect(onClose).toHaveBeenCalled();
58
+ });
59
+ });
@@ -0,0 +1,2 @@
1
+ export { Alert } from './Alert';
2
+ export type { AlertProps } from './Alert';
@@ -0,0 +1 @@
1
+ export { Alert } from './Alert';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes } from 'react';
6
+ export declare const avatarColors: readonly ["azure", "green", "lime", "magenta", "orange", "yellow"];
7
+ type AvatarColor = (typeof avatarColors)[number];
8
+ export type AvatarProps = {
9
+ /** The background colour. */
10
+ color?: AvatarColor;
11
+ /** The url for the user’s image. Its center will be displayed. Should be square and scaled down. */
12
+ imageSrc?: string;
13
+ /** The text content. Should be the user’s initials. The first two characters will be displayed. */
14
+ label: string;
15
+ } & HTMLAttributes<HTMLSpanElement>;
16
+ export declare const Avatar: import("react").ForwardRefExoticComponent<{
17
+ /** The background colour. */
18
+ color?: AvatarColor;
19
+ /** The url for the user’s image. Its center will be displayed. Should be square and scaled down. */
20
+ imageSrc?: string;
21
+ /** The text content. Should be the user’s initials. The first two characters will be displayed. */
22
+ label: string;
23
+ } & HTMLAttributes<HTMLSpanElement> & import("react").RefAttributes<HTMLSpanElement>>;
24
+ export {};
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import { PersonalLoginIcon } from '@amsterdam/design-system-react-icons';
7
+ import clsx from 'clsx';
8
+ import { forwardRef } from 'react';
9
+ import { Icon } from '../Icon';
10
+ export const avatarColors = ['azure', 'green', 'lime', 'magenta', 'orange', 'yellow'];
11
+ const AvatarContent = ({ imageSrc, initials }) => {
12
+ if (imageSrc) {
13
+ return _jsx("img", { alt: "", src: imageSrc });
14
+ }
15
+ if (initials.length) {
16
+ return _jsx("span", { "aria-hidden": true, children: initials });
17
+ }
18
+ return _jsx(Icon, { size: "small", svg: PersonalLoginIcon });
19
+ };
20
+ export const Avatar = forwardRef(({ className, color, imageSrc, label, ...restProps }, ref) => {
21
+ const initials = label.slice(0, 2).toUpperCase();
22
+ const a11yLabel = initials.length === 0 ? 'Gebruiker' : `Initialen gebruiker: ${initials}`;
23
+ return (_jsxs("span", { ...restProps, className: clsx('ams-avatar', color && `ams-avatar--${color}`, imageSrc && 'ams-avatar--has-image', className), ref: ref, children: [_jsx("span", { className: "ams-visually-hidden", children: a11yLabel }), _jsx(AvatarContent, { imageSrc: imageSrc, initials: initials })] }));
24
+ });
25
+ Avatar.displayName = 'Avatar';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen } from '@testing-library/react';
3
+ import { createRef } from 'react';
4
+ import { Avatar, avatarColors } from './Avatar';
5
+ import '@testing-library/jest-dom';
6
+ describe('Avatar', () => {
7
+ it('renders', () => {
8
+ render(_jsx(Avatar, { label: "NR" }));
9
+ const component = screen.getByText('Initialen gebruiker: NR');
10
+ expect(component).toBeInTheDocument();
11
+ expect(component).toBeVisible();
12
+ });
13
+ it('renders a design system BEM class name', () => {
14
+ const { container } = render(_jsx(Avatar, { label: "RS" }));
15
+ const component = container.querySelector(':only-child');
16
+ expect(component).toHaveClass('ams-avatar');
17
+ });
18
+ it('renders an extra class name', () => {
19
+ const { container } = render(_jsx(Avatar, { className: "extra", label: "VS" }));
20
+ const component = container.querySelector(':only-child');
21
+ expect(component).toHaveClass('ams-avatar extra');
22
+ });
23
+ it('renders with a label consisting of no more than two, uppercase letters', () => {
24
+ const { container } = render(_jsx(Avatar, { label: "Design System" }));
25
+ const component = container.querySelector(':only-child');
26
+ expect(component).toHaveTextContent('DE');
27
+ });
28
+ it('renders with default content and title', () => {
29
+ const { container } = render(_jsx(Avatar, { label: "" }));
30
+ const component = screen.getByText('Gebruiker');
31
+ const svg = container.querySelector('svg');
32
+ expect(component).toBeVisible();
33
+ expect(svg).toBeVisible();
34
+ });
35
+ it('renders with a profile picture', () => {
36
+ const { container } = render(_jsx(Avatar, { imageSrc: "image-source", label: "RS" }));
37
+ const component = screen.getByText('Initialen gebruiker: RS');
38
+ const image = container.querySelector('[src="image-source"]');
39
+ expect(component).toBeVisible();
40
+ expect(image).toBeVisible();
41
+ });
42
+ it('shortens a label that is too long', () => {
43
+ const { container } = render(_jsx(Avatar, { label: "ABC" }));
44
+ const component = container.querySelector(':only-child');
45
+ expect(component).toHaveTextContent('AB');
46
+ });
47
+ avatarColors.map((color) => it(`renders with ${color} color`, () => {
48
+ const { container } = render(_jsx(Avatar, { color: color, label: "AL" }));
49
+ const component = container.querySelector(':only-child');
50
+ expect(component).toHaveClass(`ams-avatar--${color}`);
51
+ }));
52
+ it('supports ForwardRef in React', () => {
53
+ const ref = createRef();
54
+ const { container } = render(_jsx(Avatar, { label: "AL", ref: ref }));
55
+ const component = container.querySelector(':only-child');
56
+ expect(ref.current).toBe(component);
57
+ });
58
+ });
@@ -0,0 +1,2 @@
1
+ export { Avatar } from './Avatar';
2
+ export type { AvatarProps } from './Avatar';
@@ -0,0 +1 @@
1
+ export { Avatar } from './Avatar';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes } from 'react';
6
+ export declare const badgeColors: readonly ["azure", "lime", "magenta", "orange", "purple", "red", "yellow"];
7
+ type BadgeColor = (typeof badgeColors)[number];
8
+ export type BadgeProps = {
9
+ /** The background colour. */
10
+ color?: BadgeColor;
11
+ /** The text content. */
12
+ label: string | number;
13
+ } & HTMLAttributes<HTMLElement>;
14
+ export declare const Badge: import("react").ForwardRefExoticComponent<{
15
+ /** The background colour. */
16
+ color?: BadgeColor;
17
+ /** The text content. */
18
+ label: string | number;
19
+ } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
20
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @license EUPL-1.2+
4
+ * Copyright Gemeente Amsterdam
5
+ */
6
+ import clsx from 'clsx';
7
+ import { forwardRef } from 'react';
8
+ export const badgeColors = ['azure', 'lime', 'magenta', 'orange', 'purple', 'red', 'yellow'];
9
+ export const Badge = forwardRef(({ className, color, label, ...restProps }, ref) => (_jsx("span", { ...restProps, className: clsx('ams-badge', color && `ams-badge--${color}`, className), ref: ref, children: label })));
10
+ Badge.displayName = 'Badge';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';