@amsterdam/design-system-react 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dist/Accordion/Accordion.d.ts +7 -7
  2. package/dist/Accordion/Accordion.js +2 -6
  3. package/dist/Accordion/Accordion.test.js +4 -4
  4. package/dist/Accordion/AccordionContext.d.ts +1 -2
  5. package/dist/Accordion/AccordionContext.js +3 -2
  6. package/dist/Accordion/AccordionSection.d.ts +5 -5
  7. package/dist/Accordion/AccordionSection.js +6 -9
  8. package/dist/Accordion/AccordionSection.test.js +18 -5
  9. package/dist/ActionGroup/ActionGroup.js +1 -5
  10. package/dist/Alert/Alert.d.ts +16 -4
  11. package/dist/Alert/Alert.js +3 -7
  12. package/dist/Alert/Alert.test.js +24 -13
  13. package/dist/Avatar/Avatar.js +1 -5
  14. package/dist/Avatar/Avatar.test.js +2 -1
  15. package/dist/Badge/Badge.d.ts +4 -4
  16. package/dist/Badge/Badge.js +1 -5
  17. package/dist/Blockquote/Blockquote.d.ts +5 -5
  18. package/dist/Blockquote/Blockquote.js +1 -5
  19. package/dist/Breadcrumb/Breadcrumb.js +0 -4
  20. package/dist/Breadcrumb/Breadcrumb.test.js +1 -1
  21. package/dist/Breadcrumb/BreadcrumbLink.js +0 -4
  22. package/dist/Breakout/Breakout.js +2 -6
  23. package/dist/Breakout/Breakout.test.js +1 -1
  24. package/dist/Breakout/BreakoutCell.d.ts +3 -3
  25. package/dist/Breakout/BreakoutCell.js +1 -5
  26. package/dist/Breakout/BreakoutCell.test.js +2 -2
  27. package/dist/Button/Button.d.ts +4 -4
  28. package/dist/Button/Button.js +1 -5
  29. package/dist/CallToActionLink/CallToActionLink.d.ts +12 -0
  30. package/dist/CallToActionLink/CallToActionLink.js +8 -0
  31. package/dist/CallToActionLink/CallToActionLink.test.d.ts +5 -0
  32. package/dist/CallToActionLink/CallToActionLink.test.js +33 -0
  33. package/dist/CallToActionLink/index.d.ts +6 -0
  34. package/dist/CallToActionLink/index.js +5 -0
  35. package/dist/Card/Card.d.ts +8 -8
  36. package/dist/Card/Card.js +1 -5
  37. package/dist/Card/CardHeading.d.ts +3 -3
  38. package/dist/Card/CardHeading.js +2 -6
  39. package/dist/Card/CardHeading.test.js +1 -1
  40. package/dist/Card/CardHeadingGroup.d.ts +5 -5
  41. package/dist/Card/CardHeadingGroup.js +1 -5
  42. package/dist/Card/CardImage.d.ts +2 -2
  43. package/dist/Card/CardImage.js +1 -5
  44. package/dist/Card/CardLink.js +1 -5
  45. package/dist/CharacterCount/CharacterCount.d.ts +4 -4
  46. package/dist/CharacterCount/CharacterCount.js +1 -5
  47. package/dist/Checkbox/Checkbox.d.ts +15 -9
  48. package/dist/Checkbox/Checkbox.js +4 -8
  49. package/dist/Checkbox/Checkbox.test.js +9 -0
  50. package/dist/Column/Column.d.ts +5 -5
  51. package/dist/Column/Column.js +1 -5
  52. package/dist/Column/Column.test.js +1 -1
  53. package/dist/DateInput/DateInput.d.ts +4 -4
  54. package/dist/DateInput/DateInput.js +1 -5
  55. package/dist/DescriptionList/DescriptionList.d.ts +5 -5
  56. package/dist/DescriptionList/DescriptionList.js +1 -5
  57. package/dist/DescriptionList/DescriptionListDescription.js +1 -5
  58. package/dist/DescriptionList/DescriptionListSection.js +1 -5
  59. package/dist/DescriptionList/DescriptionListTerm.js +1 -5
  60. package/dist/DescriptionList/index.d.ts +1 -1
  61. package/dist/Dialog/Dialog.d.ts +6 -6
  62. package/dist/Dialog/Dialog.js +2 -6
  63. package/dist/ErrorMessage/ErrorMessage.d.ts +11 -4
  64. package/dist/ErrorMessage/ErrorMessage.js +2 -6
  65. package/dist/Field/Field.d.ts +5 -5
  66. package/dist/Field/Field.js +1 -5
  67. package/dist/FieldSet/FieldSet.d.ts +7 -7
  68. package/dist/FieldSet/FieldSet.js +1 -5
  69. package/dist/Figure/Figure.d.ts +3 -3
  70. package/dist/Figure/Figure.js +1 -5
  71. package/dist/Figure/FigureCaption.d.ts +5 -5
  72. package/dist/Figure/FigureCaption.js +1 -5
  73. package/dist/FileInput/FileInput.js +1 -5
  74. package/dist/FileList/FileList.d.ts +3 -3
  75. package/dist/FileList/FileList.js +1 -5
  76. package/dist/FileList/FileListItem.d.ts +4 -4
  77. package/dist/FileList/FileListItem.js +2 -6
  78. package/dist/Grid/Grid.d.ts +2 -2
  79. package/dist/Grid/Grid.js +1 -5
  80. package/dist/Grid/Grid.test.js +1 -1
  81. package/dist/Grid/GridCell.d.ts +2 -2
  82. package/dist/Grid/GridCell.js +1 -5
  83. package/dist/Grid/GridCell.test.js +1 -1
  84. package/dist/Heading/Heading.d.ts +18 -7
  85. package/dist/Heading/Heading.js +1 -10
  86. package/dist/Heading/Heading.test.js +1 -3
  87. package/dist/Hint/Hint.d.ts +3 -3
  88. package/dist/Hint/Hint.js +1 -5
  89. package/dist/Icon/Icon.d.ts +15 -3
  90. package/dist/Icon/Icon.js +14 -13
  91. package/dist/Icon/Icon.test.js +5 -0
  92. package/dist/IconButton/IconButton.js +1 -5
  93. package/dist/Image/Image.d.ts +4 -4
  94. package/dist/Image/Image.js +2 -6
  95. package/dist/Image/Image.test.js +2 -2
  96. package/dist/Image/index.d.ts +1 -1
  97. package/dist/Image/index.js +1 -1
  98. package/dist/ImageSlider/ImageSlider.d.ts +3 -3
  99. package/dist/ImageSlider/ImageSlider.js +2 -6
  100. package/dist/ImageSlider/ImageSliderControls.js +2 -6
  101. package/dist/ImageSlider/ImageSliderItem.d.ts +5 -5
  102. package/dist/ImageSlider/ImageSliderItem.js +1 -5
  103. package/dist/ImageSlider/ImageSliderScroller.js +1 -5
  104. package/dist/ImageSlider/ImageSliderThumbnails.d.ts +4 -4
  105. package/dist/ImageSlider/ImageSliderThumbnails.js +2 -6
  106. package/dist/InvalidFormAlert/InvalidFormAlert.d.ts +4 -4
  107. package/dist/InvalidFormAlert/InvalidFormAlert.js +0 -4
  108. package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.js +5 -6
  109. package/dist/Label/Label.d.ts +10 -5
  110. package/dist/Label/Label.js +1 -10
  111. package/dist/Link/Link.d.ts +4 -4
  112. package/dist/Link/Link.js +1 -5
  113. package/dist/LinkList/LinkList.d.ts +1 -1
  114. package/dist/LinkList/LinkList.js +1 -5
  115. package/dist/LinkList/LinkListLink.d.ts +13 -4
  116. package/dist/LinkList/LinkListLink.js +3 -7
  117. package/dist/LinkList/LinkListLink.test.js +1 -1
  118. package/dist/Logo/Logo.d.ts +2 -2
  119. package/dist/Logo/Logo.js +1 -5
  120. package/dist/Logo/brand/LogoAmsterdam.js +2 -5
  121. package/dist/Logo/brand/LogoGgdAmsterdam.js +2 -5
  122. package/dist/Logo/brand/LogoMuseumWeesp.js +2 -5
  123. package/dist/Logo/brand/LogoStadsarchief.js +2 -5
  124. package/dist/Logo/brand/LogoStadsbankVanLening.js +2 -5
  125. package/dist/Logo/brand/LogoVgaVerzekeringen.js +2 -5
  126. package/dist/Logo/index.d.ts +1 -1
  127. package/dist/Mark/Mark.js +1 -5
  128. package/dist/Menu/Menu.d.ts +28 -0
  129. package/dist/Menu/Menu.js +10 -0
  130. package/dist/Menu/Menu.test.d.ts +5 -0
  131. package/dist/Menu/Menu.test.js +38 -0
  132. package/dist/Menu/MenuLink.d.ts +20 -0
  133. package/dist/Menu/MenuLink.js +8 -0
  134. package/dist/Menu/MenuLink.test.d.ts +5 -0
  135. package/dist/Menu/MenuLink.test.js +56 -0
  136. package/dist/Menu/index.d.ts +7 -0
  137. package/dist/Menu/index.js +5 -0
  138. package/dist/OrderedList/OrderedList.d.ts +5 -5
  139. package/dist/OrderedList/OrderedList.js +1 -5
  140. package/dist/OrderedList/OrderedList.test.js +1 -1
  141. package/dist/OrderedList/OrderedListItem.js +1 -5
  142. package/dist/Overlap/Overlap.js +1 -5
  143. package/dist/Page/Page.js +1 -5
  144. package/dist/PageFooter/PageFooter.js +1 -5
  145. package/dist/PageFooter/PageFooterMenu.js +1 -5
  146. package/dist/PageFooter/PageFooterMenuLink.js +1 -5
  147. package/dist/PageFooter/PageFooterSpotlight.js +1 -5
  148. package/dist/PageHeader/PageHeader.d.ts +7 -7
  149. package/dist/PageHeader/PageHeader.js +3 -7
  150. package/dist/PageHeader/PageHeader.test.js +1 -1
  151. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +1 -1
  152. package/dist/PageHeader/PageHeaderMenuLink.d.ts +5 -5
  153. package/dist/PageHeader/PageHeaderMenuLink.js +1 -1
  154. package/dist/PageHeading/PageHeading.d.ts +6 -5
  155. package/dist/PageHeading/PageHeading.js +2 -5
  156. package/dist/Pagination/Pagination.d.ts +52 -10
  157. package/dist/Pagination/Pagination.js +5 -9
  158. package/dist/Pagination/Pagination.test.js +23 -10
  159. package/dist/Pagination/getRange.js +4 -2
  160. package/dist/Paragraph/Paragraph.d.ts +10 -5
  161. package/dist/Paragraph/Paragraph.js +1 -10
  162. package/dist/PasswordInput/PasswordInput.d.ts +4 -4
  163. package/dist/PasswordInput/PasswordInput.js +1 -5
  164. package/dist/PasswordInput/PasswordInput.test.js +1 -1
  165. package/dist/Radio/Radio.d.ts +15 -9
  166. package/dist/Radio/Radio.js +4 -8
  167. package/dist/Radio/Radio.test.js +9 -0
  168. package/dist/Row/Row.d.ts +5 -5
  169. package/dist/Row/Row.js +1 -5
  170. package/dist/Row/Row.test.js +1 -1
  171. package/dist/SearchField/SearchField.d.ts +3 -5
  172. package/dist/SearchField/SearchField.js +1 -5
  173. package/dist/SearchField/SearchFieldButton.js +0 -4
  174. package/dist/SearchField/SearchFieldInput.d.ts +2 -2
  175. package/dist/SearchField/SearchFieldInput.js +1 -5
  176. package/dist/Select/Select.d.ts +5 -5
  177. package/dist/Select/Select.js +1 -5
  178. package/dist/Select/SelectOption.js +1 -5
  179. package/dist/Select/SelectOptionGroup.js +1 -5
  180. package/dist/SkipLink/SkipLink.js +1 -5
  181. package/dist/Spotlight/Spotlight.d.ts +5 -5
  182. package/dist/Spotlight/Spotlight.js +1 -1
  183. package/dist/Spotlight/Spotlight.test.js +1 -1
  184. package/dist/StandaloneLink/StandaloneLink.d.ts +15 -8
  185. package/dist/StandaloneLink/StandaloneLink.js +4 -6
  186. package/dist/StandaloneLink/StandaloneLink.test.js +6 -4
  187. package/dist/Switch/Switch.js +1 -5
  188. package/dist/Table/Table.js +1 -5
  189. package/dist/Table/TableBody.js +1 -5
  190. package/dist/Table/TableCaption.d.ts +5 -0
  191. package/dist/Table/TableCaption.js +1 -10
  192. package/dist/Table/TableCell.js +1 -5
  193. package/dist/Table/TableFooter.js +1 -5
  194. package/dist/Table/TableHeader.js +1 -5
  195. package/dist/Table/TableHeaderCell.js +1 -5
  196. package/dist/Table/TableRow.js +1 -5
  197. package/dist/TableOfContents/TableOfContents.d.ts +9 -9
  198. package/dist/TableOfContents/TableOfContents.js +4 -7
  199. package/dist/TableOfContents/TableOfContentsLink.d.ts +4 -4
  200. package/dist/TableOfContents/TableOfContentsLink.js +0 -4
  201. package/dist/TableOfContents/TableOfContentsList.js +1 -5
  202. package/dist/TableOfContents/TableOfContentsList.test.js +1 -1
  203. package/dist/Tabs/Tabs.d.ts +11 -11
  204. package/dist/Tabs/Tabs.js +1 -5
  205. package/dist/Tabs/TabsButton.d.ts +5 -5
  206. package/dist/Tabs/TabsButton.js +1 -5
  207. package/dist/Tabs/TabsList.js +1 -5
  208. package/dist/Tabs/TabsPanel.d.ts +5 -5
  209. package/dist/Tabs/TabsPanel.js +1 -5
  210. package/dist/Tabs/index.d.ts +2 -2
  211. package/dist/TextArea/TextArea.d.ts +4 -4
  212. package/dist/TextArea/TextArea.js +1 -5
  213. package/dist/TextInput/TextInput.d.ts +4 -4
  214. package/dist/TextInput/TextInput.js +1 -5
  215. package/dist/TimeInput/TimeInput.d.ts +4 -4
  216. package/dist/TimeInput/TimeInput.js +1 -5
  217. package/dist/UnorderedList/UnorderedList.d.ts +5 -5
  218. package/dist/UnorderedList/UnorderedList.js +1 -5
  219. package/dist/UnorderedList/UnorderedList.test.js +1 -1
  220. package/dist/UnorderedList/UnorderedListItem.js +1 -5
  221. package/dist/common/formatFileType.d.ts +1 -1
  222. package/dist/common/formatFileType.js +10 -10
  223. package/dist/common/useKeyboardFocus.js +6 -6
  224. package/dist/common/useKeyboardFocus.test.js +2 -6
  225. package/dist/index.cjs.js +731 -619
  226. package/dist/index.cjs.js.map +1 -1
  227. package/dist/index.d.ts +394 -267
  228. package/dist/index.esm.js +633 -523
  229. package/dist/index.esm.js.map +1 -1
  230. package/dist/index.js +2 -0
  231. package/dist/tsconfig.tsbuildinfo +1 -1
  232. package/package.json +21 -21
@@ -3,60 +3,102 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes, ComponentType, HTMLAttributes } from 'react';
6
- export type PaginationProps = {
6
+ export type PaginationProps = HTMLAttributes<HTMLElement> & {
7
+ /** The accessible name for the Pagination component. */
8
+ accessibleName?: string;
9
+ /**
10
+ * Connects the component with an internal element that defines its accessible name.
11
+ * Note: must be unique for the page.
12
+ */
13
+ accessibleNameId?: string;
7
14
  /** The React component to use for the links. */
8
15
  linkComponent?: ComponentType<AnchorHTMLAttributes<HTMLAnchorElement>>;
9
16
  /** The template used to construct the link hrefs. */
10
17
  linkTemplate: (page: number) => string;
11
18
  /** The maximum amount of pages shown. Minimum value: 5. */
12
19
  maxVisiblePages?: number;
20
+ /** The accessible name for the link to the next page. */
21
+ nextAccessibleName?: string;
13
22
  /** The visible label for the link to the next page. */
14
23
  nextLabel?: string;
15
- /** The accessible name for the link to the next page. */
24
+ /**
25
+ * @deprecated Use `nextAccessibleName` instead.
26
+ * The accessible name for the link to the next page.
27
+ */
16
28
  nextVisuallyHiddenLabel?: string;
17
29
  /** The current page number. */
18
30
  page?: number;
31
+ /** The accessible name for the link to the previous page. */
32
+ previousAccessibleName?: string;
19
33
  /** The visible label for the link to the previous page. */
20
34
  previousLabel?: string;
21
- /** The accessible name for the link to the previous page. */
35
+ /**
36
+ * @deprecated Use `previousAccessibleName` instead.
37
+ * The accessible name for the link to the previous page.
38
+ */
22
39
  previousVisuallyHiddenLabel?: string;
23
40
  /** The total amount of pages. */
24
41
  totalPages: number;
25
- /** The accessible name for the Pagination component. */
42
+ /**
43
+ * @deprecated Use `accessibleName` instead.
44
+ * The accessible name for the Pagination component.
45
+ */
26
46
  visuallyHiddenLabel?: string;
27
47
  /**
48
+ * @deprecated Use `accessibleNameId` instead.
28
49
  * Connects the component with an internal element that defines its accessible name.
29
50
  * Note: must be unique for the page.
30
51
  */
31
52
  visuallyHiddenLabelId?: string;
32
- } & HTMLAttributes<HTMLElement>;
53
+ };
33
54
  /**
34
55
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-pagination--docs Pagination docs at Amsterdam Design System}
35
56
  */
36
- export declare const Pagination: import("react").ForwardRefExoticComponent<{
57
+ export declare const Pagination: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
58
+ /** The accessible name for the Pagination component. */
59
+ accessibleName?: string;
60
+ /**
61
+ * Connects the component with an internal element that defines its accessible name.
62
+ * Note: must be unique for the page.
63
+ */
64
+ accessibleNameId?: string;
37
65
  /** The React component to use for the links. */
38
66
  linkComponent?: ComponentType<AnchorHTMLAttributes<HTMLAnchorElement>>;
39
67
  /** The template used to construct the link hrefs. */
40
68
  linkTemplate: (page: number) => string;
41
69
  /** The maximum amount of pages shown. Minimum value: 5. */
42
70
  maxVisiblePages?: number;
71
+ /** The accessible name for the link to the next page. */
72
+ nextAccessibleName?: string;
43
73
  /** The visible label for the link to the next page. */
44
74
  nextLabel?: string;
45
- /** The accessible name for the link to the next page. */
75
+ /**
76
+ * @deprecated Use `nextAccessibleName` instead.
77
+ * The accessible name for the link to the next page.
78
+ */
46
79
  nextVisuallyHiddenLabel?: string;
47
80
  /** The current page number. */
48
81
  page?: number;
82
+ /** The accessible name for the link to the previous page. */
83
+ previousAccessibleName?: string;
49
84
  /** The visible label for the link to the previous page. */
50
85
  previousLabel?: string;
51
- /** The accessible name for the link to the previous page. */
86
+ /**
87
+ * @deprecated Use `previousAccessibleName` instead.
88
+ * The accessible name for the link to the previous page.
89
+ */
52
90
  previousVisuallyHiddenLabel?: string;
53
91
  /** The total amount of pages. */
54
92
  totalPages: number;
55
- /** The accessible name for the Pagination component. */
93
+ /**
94
+ * @deprecated Use `accessibleName` instead.
95
+ * The accessible name for the Pagination component.
96
+ */
56
97
  visuallyHiddenLabel?: string;
57
98
  /**
99
+ * @deprecated Use `accessibleNameId` instead.
58
100
  * Connects the component with an internal element that defines its accessible name.
59
101
  * Note: must be unique for the page.
60
102
  */
61
103
  visuallyHiddenLabelId?: string;
62
- } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
104
+ } & import("react").RefAttributes<HTMLElement>>;
@@ -1,19 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
2
  import { ChevronBackwardIcon, ChevronForwardIcon } from '@amsterdam/design-system-react-icons';
7
- import clsx from 'clsx';
3
+ import { clsx } from 'clsx';
8
4
  import { forwardRef } from 'react';
5
+ import { Icon } from '../Icon/Icon';
6
+ import { getRange } from './getRange';
9
7
  import { LinkItem } from './LinkItem';
10
8
  import { Spacer } from './Spacer';
11
- import { getRange } from './getRange';
12
- import { Icon } from '../Icon/Icon';
13
9
  /**
14
10
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-pagination--docs Pagination docs at Amsterdam Design System}
15
11
  */
16
- export const Pagination = forwardRef(({ className, linkComponent = (props) => _jsx("a", { ...props }), linkTemplate, maxVisiblePages = 7, nextLabel = 'volgende', nextVisuallyHiddenLabel = 'Volgende pagina', page = 1, previousLabel = 'vorige', previousVisuallyHiddenLabel = 'Vorige pagina', totalPages, visuallyHiddenLabel = 'Paginering', visuallyHiddenLabelId = 'ams-pagination-a11y-label', ...restProps }, ref) => {
12
+ export const Pagination = forwardRef(({ accessibleName, accessibleNameId, className, linkComponent = (props) => _jsx("a", { ...props }), linkTemplate, maxVisiblePages = 7, nextAccessibleName, nextLabel = 'volgende', nextVisuallyHiddenLabel, page = 1, previousAccessibleName, previousLabel = 'vorige', previousVisuallyHiddenLabel, totalPages, visuallyHiddenLabel, visuallyHiddenLabelId, ...restProps }, ref) => {
17
13
  // Don't show pagination if you only have one page
18
14
  if (totalPages <= 1) {
19
15
  return null;
@@ -21,6 +17,6 @@ export const Pagination = forwardRef(({ className, linkComponent = (props) => _j
21
17
  const Link = linkComponent;
22
18
  // Get array of page numbers and / or spacers
23
19
  const range = getRange(page, totalPages, maxVisiblePages);
24
- return (_jsxs("nav", { ...restProps, "aria-labelledby": visuallyHiddenLabelId, className: clsx('ams-pagination', className), ref: ref, children: [_jsx("span", { className: "ams-visually-hidden", id: visuallyHiddenLabelId, children: visuallyHiddenLabel }), page !== 1 && (_jsxs(Link, { className: "ams-pagination__link", href: linkTemplate(page - 1), rel: "prev", children: [_jsx(Icon, { svg: ChevronBackwardIcon }), _jsx("span", { className: "ams-visually-hidden", children: previousVisuallyHiddenLabel }), _jsx("span", { "aria-hidden": true, children: previousLabel })] })), _jsx("ol", { className: "ams-pagination__list", children: range.map((pageNumberOrSpacer) => typeof pageNumberOrSpacer === 'number' ? (_jsx(LinkItem, { currentPage: page, linkComponent: linkComponent, linkTemplate: linkTemplate, pageNumber: pageNumberOrSpacer }, pageNumberOrSpacer)) : (_jsx(Spacer, {}, pageNumberOrSpacer))) }), page !== totalPages && (_jsxs(Link, { className: "ams-pagination__link", href: linkTemplate(page + 1), rel: "next", children: [_jsx("span", { className: "ams-visually-hidden", children: nextVisuallyHiddenLabel }), _jsx("span", { "aria-hidden": true, children: nextLabel }), _jsx(Icon, { svg: ChevronForwardIcon })] }))] }));
20
+ return (_jsxs("nav", { ...restProps, "aria-labelledby": accessibleNameId || visuallyHiddenLabelId || 'ams-pagination-a11y-label', className: clsx('ams-pagination', className), ref: ref, children: [_jsx("span", { className: "ams-visually-hidden", id: accessibleNameId || visuallyHiddenLabelId || 'ams-pagination-a11y-label', children: accessibleName || visuallyHiddenLabel || 'Paginering' }), page !== 1 && (_jsxs(Link, { className: "ams-pagination__link", href: linkTemplate(page - 1), rel: "prev", children: [_jsx(Icon, { svg: ChevronBackwardIcon }), _jsx("span", { className: "ams-visually-hidden", children: previousAccessibleName || previousVisuallyHiddenLabel || 'Vorige pagina' }), _jsx("span", { "aria-hidden": true, children: previousLabel })] })), _jsx("ol", { className: "ams-pagination__list", children: range.map((pageNumberOrSpacer) => typeof pageNumberOrSpacer === 'number' ? (_jsx(LinkItem, { currentPage: page, linkComponent: linkComponent, linkTemplate: linkTemplate, pageNumber: pageNumberOrSpacer }, pageNumberOrSpacer)) : (_jsx(Spacer, {}, pageNumberOrSpacer))) }), page !== totalPages && (_jsxs(Link, { className: "ams-pagination__link", href: linkTemplate(page + 1), rel: "next", children: [_jsx("span", { className: "ams-visually-hidden", children: nextAccessibleName || nextVisuallyHiddenLabel || 'Volgende pagina' }), _jsx("span", { "aria-hidden": true, children: nextLabel }), _jsx(Icon, { svg: ChevronForwardIcon })] }))] }));
25
21
  });
26
22
  Pagination.displayName = 'Pagination';
@@ -1,8 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
2
  import { render, screen } from '@testing-library/react';
7
3
  import { createRef } from 'react';
8
4
  import { Pagination } from './Pagination';
@@ -25,8 +21,8 @@ describe('Pagination', () => {
25
21
  const component = screen.getByRole('navigation', { name: 'Paginering' });
26
22
  expect(component).toHaveClass('ams-pagination extra');
27
23
  });
28
- it('should render all the pages when totalPages < maxVisiblePages', () => {
29
- render(_jsx(Pagination, { linkTemplate: linkTemplate, maxVisiblePages: 7, totalPages: 6 }));
24
+ it('should render all the pages when totalPages <= maxVisiblePages', () => {
25
+ render(_jsx(Pagination, { linkTemplate: linkTemplate, maxVisiblePages: 6, totalPages: 6 }));
30
26
  const listItem = screen.getAllByRole('listitem', { hidden: true });
31
27
  const range = ['1', '2', '3', '4', '5', '6'];
32
28
  range.forEach((item, index) => {
@@ -50,7 +46,7 @@ describe('Pagination', () => {
50
46
  });
51
47
  });
52
48
  it('should render the pages including one (first) spacer in the correct location when totalPages > maxVisiblePages and page > maxVisiblePages', () => {
53
- render(_jsx(Pagination, { linkTemplate: linkTemplate, maxVisiblePages: 7, page: 8, totalPages: 10 }));
49
+ render(_jsx(Pagination, { linkTemplate: linkTemplate, maxVisiblePages: 7, page: 7, totalPages: 10 }));
54
50
  const listItem = screen.getAllByRole('listitem', { hidden: true });
55
51
  const range = ['1', '…', '6', '7', '8', '9', '10'];
56
52
  range.forEach((item, index) => {
@@ -71,11 +67,16 @@ describe('Pagination', () => {
71
67
  expect(currentPageLink).toHaveAttribute('href', '#?pagina=4');
72
68
  expect(nextPageLink).toHaveAttribute('href', '#?pagina=5');
73
69
  });
74
- it('sets a custom id for the accessible label', () => {
70
+ it('sets a custom id for the accessible label - deprecated', () => {
75
71
  render(_jsx(Pagination, { linkTemplate: linkTemplate, totalPages: 10, visuallyHiddenLabelId: "custom-id" }));
76
72
  const component = screen.getByRole('navigation', { name: 'Paginering' });
77
73
  expect(component).toHaveAttribute('aria-labelledby', 'custom-id');
78
74
  });
75
+ it('sets a custom id for the accessible name', () => {
76
+ render(_jsx(Pagination, { accessibleNameId: "custom-id", linkTemplate: linkTemplate, totalPages: 10 }));
77
+ const component = screen.getByRole('navigation', { name: 'Paginering' });
78
+ expect(component).toHaveAttribute('aria-labelledby', 'custom-id');
79
+ });
79
80
  it('should not render when totalPages is 1 or less', () => {
80
81
  render(_jsx(Pagination, { linkTemplate: linkTemplate, totalPages: 1 }));
81
82
  expect(screen.queryByRole('navigation')).not.toBeInTheDocument();
@@ -97,18 +98,30 @@ describe('Pagination', () => {
97
98
  expect(nextLink).toHaveTextContent('next');
98
99
  expect(nextLink).toHaveAttribute('rel', 'next');
99
100
  });
100
- it('renders an accessible label for the navigation', () => {
101
+ it('renders an accessible label for the navigation - deprecated', () => {
101
102
  render(_jsx(Pagination, { linkTemplate: linkTemplate, totalPages: 10, visuallyHiddenLabel: "Pagination" }));
102
103
  const component = screen.getByRole('navigation', { name: 'Pagination' });
103
104
  expect(component).toBeInTheDocument();
104
105
  });
105
- it('renders accessible labels for the ‘previous’ and ‘next’ links', () => {
106
+ it('renders an accessible name for the navigation', () => {
107
+ render(_jsx(Pagination, { accessibleName: "Pagination", linkTemplate: linkTemplate, totalPages: 10 }));
108
+ const component = screen.getByRole('navigation', { name: 'Pagination' });
109
+ expect(component).toBeInTheDocument();
110
+ });
111
+ it('renders accessible labels for the ‘previous’ and ‘next’ links - deprecated', () => {
106
112
  render(_jsx(Pagination, { linkTemplate: linkTemplate, nextVisuallyHiddenLabel: "Next page", page: 4, previousVisuallyHiddenLabel: "Previous page", totalPages: 10 }));
107
113
  const previousLink = screen.getByRole('link', { name: 'Previous page' });
108
114
  const nextLink = screen.getByRole('link', { name: 'Next page' });
109
115
  expect(previousLink).toBeInTheDocument();
110
116
  expect(nextLink).toBeInTheDocument();
111
117
  });
118
+ it('renders accessible names for the ‘previous’ and ‘next’ links', () => {
119
+ render(_jsx(Pagination, { linkTemplate: linkTemplate, nextAccessibleName: "Next page", page: 4, previousAccessibleName: "Previous page", totalPages: 10 }));
120
+ const previousLink = screen.getByRole('link', { name: 'Previous page' });
121
+ const nextLink = screen.getByRole('link', { name: 'Next page' });
122
+ expect(previousLink).toBeInTheDocument();
123
+ expect(nextLink).toBeInTheDocument();
124
+ });
112
125
  it('renders a custom link component', () => {
113
126
  const CustomLink = (props) => _jsx("a", { "data-test": true, ...props });
114
127
  render(_jsx(Pagination, { linkComponent: CustomLink, linkTemplate: linkTemplate, totalPages: 10 }));
@@ -32,11 +32,13 @@ export function getRange(currentPage, totalPages, maxVisiblePages) {
32
32
  if (index === 0 && pageNr !== 1) {
33
33
  return [1, 'firstSpacer'];
34
34
  }
35
- if (totalPages > visiblePages && index === visiblePages - 2 && currentPage < totalPages - 2) {
35
+ if (totalPages > visiblePages &&
36
+ index === visiblePages - 2 &&
37
+ currentPage < totalPages - Math.floor(visiblePages / 2)) {
36
38
  return [...acc, 'lastSpacer', totalPages];
37
39
  }
38
40
  // Skip a number when spacer is already added
39
- if ((acc.includes('firstSpacer') && index === 1) || (acc.includes('lastSpacer') && index === visiblePages - 1)) {
41
+ if (acc[index] === 'firstSpacer' || acc[index - 1] === 'lastSpacer') {
40
42
  return acc;
41
43
  }
42
44
  return [...acc, pageNr];
@@ -2,21 +2,26 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
+ /**
6
+ * @license EUPL-1.2+
7
+ * Copyright (c) 2021 Robbert Broersma
8
+ * Copyright Gemeente Amsterdam
9
+ */
5
10
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type ParagraphProps = {
11
+ export type ParagraphProps = PropsWithChildren<HTMLAttributes<HTMLParagraphElement>> & {
7
12
  /** Changes the text colour for readability on a dark background. */
8
13
  color?: 'inverse';
9
14
  /** The size of the text. */
10
15
  size?: 'small' | 'large';
11
- } & PropsWithChildren<HTMLAttributes<HTMLParagraphElement>>;
16
+ };
12
17
  /**
13
18
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-paragraph--docs Paragraph docs at Amsterdam Design System}
14
19
  */
15
- export declare const Paragraph: import("react").ForwardRefExoticComponent<{
20
+ export declare const Paragraph: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & {
21
+ children?: import("react").ReactNode | undefined;
22
+ } & {
16
23
  /** Changes the text colour for readability on a dark background. */
17
24
  color?: "inverse";
18
25
  /** The size of the text. */
19
26
  size?: "small" | "large";
20
- } & HTMLAttributes<HTMLParagraphElement> & {
21
- children?: import("react").ReactNode | undefined;
22
27
  } & import("react").RefAttributes<HTMLParagraphElement>>;
@@ -1,14 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- /**
7
- * @license EUPL-1.2+
8
- * Copyright (c) 2021 Robbert Broersma
9
- * Copyright Gemeente Amsterdam
10
- */
11
- import clsx from 'clsx';
2
+ import { clsx } from 'clsx';
12
3
  import { forwardRef } from 'react';
13
4
  /**
14
5
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-paragraph--docs Paragraph docs at Amsterdam Design System}
@@ -3,14 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { InputHTMLAttributes } from 'react';
6
- export type PasswordInputProps = {
6
+ export type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'type'> & {
7
7
  /** Whether the value fails a validation rule. */
8
8
  invalid?: boolean;
9
- } & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'type'>;
9
+ };
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-password-input--docs Password Input docs at Amsterdam Design System}
12
12
  */
13
- export declare const PasswordInput: import("react").ForwardRefExoticComponent<{
13
+ export declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoCapitalize" | "spellCheck" | "autoCorrect" | "aria-invalid" | "type"> & {
14
14
  /** Whether the value fails a validation rule. */
15
15
  invalid?: boolean;
16
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "autoCapitalize" | "spellCheck" | "autoCorrect" | "aria-invalid" | "type"> & import("react").RefAttributes<HTMLInputElement>>;
16
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  /**
9
5
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-password-input--docs Password Input docs at Amsterdam Design System}
@@ -6,8 +6,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
6
6
  import { render, screen } from '@testing-library/react';
7
7
  import userEvent from '@testing-library/user-event';
8
8
  import { createRef, useState } from 'react';
9
- import { PasswordInput } from './PasswordInput';
10
9
  import { Label } from '../Label';
10
+ import { PasswordInput } from './PasswordInput';
11
11
  import '@testing-library/jest-dom';
12
12
  describe('Password input', () => {
13
13
  it('renders', () => {
@@ -3,20 +3,26 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
6
- export type RadioProps = {
7
- /** An icon to display instead of the default icon. */
8
- icon?: ReactNode;
6
+ export type RadioProps = PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>> & {
7
+ /**
8
+ * An icon to display instead of the default icon.
9
+ * @default RadioIcon
10
+ */
11
+ icon?: Function | ReactNode;
9
12
  /** Whether the value fails a validation rule. */
10
13
  invalid?: boolean;
11
- } & PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>>;
14
+ };
12
15
  /**
13
16
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-radio--docs Radio docs at Amsterdam Design System}
14
17
  */
15
- export declare const Radio: import("react").ForwardRefExoticComponent<{
16
- /** An icon to display instead of the default icon. */
17
- icon?: ReactNode;
18
+ export declare const Radio: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
19
+ children?: ReactNode | undefined;
20
+ } & {
21
+ /**
22
+ * An icon to display instead of the default icon.
23
+ * @default RadioIcon
24
+ */
25
+ icon?: Function | ReactNode;
18
26
  /** Whether the value fails a validation rule. */
19
27
  invalid?: boolean;
20
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
21
- children?: ReactNode | undefined;
22
28
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,19 +1,15 @@
1
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 clsx from 'clsx';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef, useId } from 'react';
8
4
  import RadioIcon from './RadioIcon';
9
5
  /**
10
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-radio--docs Radio docs at Amsterdam Design System}
11
7
  */
12
- export const Radio = forwardRef(({ children, className, icon, invalid, ...restProps }, ref) => {
13
- const id = useId();
8
+ export const Radio = forwardRef(({ children, className, icon = RadioIcon, id, invalid, ...restProps }, ref) => {
9
+ const inputId = id || useId();
14
10
  return (
15
11
  // This div is here because NVDA doesn't match the input to the label
16
12
  // without a containing element
17
- _jsxs("div", { className: clsx('ams-radio', className), children: [_jsx("input", { ...restProps, "aria-invalid": invalid || undefined, className: "ams-radio__input", id: id, ref: ref, type: "radio" }), _jsxs("label", { className: "ams-radio__label", htmlFor: id, children: [_jsx("span", { className: "ams-radio__icon-container", children: icon ?? _jsx(RadioIcon, {}) }), children] })] }));
13
+ _jsxs("div", { className: clsx('ams-radio', className), children: [_jsx("input", { ...restProps, "aria-invalid": invalid || undefined, className: "ams-radio__input", id: inputId, ref: ref, type: "radio" }), _jsxs("label", { className: "ams-radio__label", htmlFor: inputId, children: [_jsx("span", { className: "ams-radio__icon-container", hidden: true, children: typeof icon === 'function' ? icon() : icon }), children] })] }));
18
14
  });
19
15
  Radio.displayName = 'Radio';
@@ -111,6 +111,15 @@ describe('Radio', () => {
111
111
  label?.click();
112
112
  expect(handleChange).toHaveBeenCalled();
113
113
  });
114
+ it('can use a custom id', () => {
115
+ const handleChange = jest.fn();
116
+ const { container } = render(_jsx(Radio, { id: "test-id", onChange: handleChange }));
117
+ const input = screen.getByRole('radio');
118
+ expect(input).toHaveAttribute('id', 'test-id');
119
+ const label = container.querySelector('label');
120
+ label?.click();
121
+ expect(handleChange).toHaveBeenCalled();
122
+ });
114
123
  it('shows a custom icon', () => {
115
124
  const { container } = render(_jsx(Radio, { icon: _jsx(StarIcon, { className: "test-class" }) }));
116
125
  const icon = container.querySelector('svg');
package/dist/Row/Row.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const rowTags: readonly ["article", "div", "section"];
8
8
  type RowTag = (typeof rowTags)[number];
9
9
  export declare const rowGapSizes: readonly ["none", "x-small", "small", "large", "x-large"];
10
10
  type RowGap = (typeof rowGapSizes)[number];
11
- export type RowProps = {
11
+ export type RowProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
12
12
  /**
13
13
  * The horizontal alignment of the items in the row.
14
14
  * @default start
@@ -34,11 +34,13 @@ export type RowProps = {
34
34
  * @default false
35
35
  */
36
36
  wrap?: boolean;
37
- } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
37
+ };
38
38
  /**
39
39
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-layout-row--docs Row docs at Amsterdam Design System}
40
40
  */
41
- export declare const Row: import("react").ForwardRefExoticComponent<{
41
+ export declare const Row: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
42
+ children?: import("react").ReactNode | undefined;
43
+ } & {
42
44
  /**
43
45
  * The horizontal alignment of the items in the row.
44
46
  * @default start
@@ -64,7 +66,5 @@ export declare const Row: import("react").ForwardRefExoticComponent<{
64
66
  * @default false
65
67
  */
66
68
  wrap?: boolean;
67
- } & HTMLAttributes<HTMLElement> & {
68
- children?: import("react").ReactNode | undefined;
69
69
  } & import("react").RefAttributes<unknown>>;
70
70
  export {};
package/dist/Row/Row.js CHANGED
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  export const rowTags = ['article', 'div', 'section'];
9
5
  export const rowGapSizes = ['none', 'x-small', 'small', 'large', 'x-large'];
@@ -5,9 +5,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  */
6
6
  import { render, screen } from '@testing-library/react';
7
7
  import { createRef } from 'react';
8
- import { Row, rowGapSizes, rowTags } from './Row';
9
8
  import { ariaRoleForTag } from '../common/accessibility';
10
9
  import { crossAlignOptions, mainAlignOptions } from '../common/types';
10
+ import { Row, rowGapSizes, rowTags } from './Row';
11
11
  import '@testing-library/jest-dom';
12
12
  describe('Row', () => {
13
13
  it('renders', () => {
@@ -137,7 +137,7 @@ export declare const SearchField: import("react").ForwardRefExoticComponent<HTML
137
137
  onBlurCapture?: import("react").FocusEventHandler<HTMLButtonElement> | undefined;
138
138
  onChange?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
139
139
  onChangeCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
140
- onBeforeInput?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
140
+ onBeforeInput?: import("react").InputEventHandler<HTMLButtonElement> | undefined;
141
141
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
142
142
  onInput?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
143
143
  onInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
@@ -187,8 +187,6 @@ export declare const SearchField: import("react").ForwardRefExoticComponent<HTML
187
187
  onProgressCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
188
188
  onRateChange?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
189
189
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
190
- onResize?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
191
- onResizeCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
192
190
  onSeeked?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
193
191
  onSeekedCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
194
192
  onSeeking?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
@@ -290,8 +288,8 @@ export declare const SearchField: import("react").ForwardRefExoticComponent<HTML
290
288
  formTarget?: string | undefined | undefined;
291
289
  name?: string | undefined | undefined;
292
290
  } & import("react").RefAttributes<HTMLButtonElement>>;
293
- Input: import("react").ForwardRefExoticComponent<{
291
+ Input: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
294
292
  invalid?: boolean;
295
293
  label?: string;
296
- } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
294
+ } & import("react").RefAttributes<HTMLInputElement>>;
297
295
  };
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  import { SearchFieldButton } from './SearchFieldButton';
9
5
  import { SearchFieldInput } from './SearchFieldInput';
@@ -1,8 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
2
  import { SearchIcon } from '@amsterdam/design-system-react-icons';
7
3
  import { forwardRef } from 'react';
8
4
  import { Button } from '../Button';
@@ -3,9 +3,9 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { InputHTMLAttributes } from 'react';
6
- export declare const SearchFieldInput: import("react").ForwardRefExoticComponent<{
6
+ export declare const SearchFieldInput: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
7
7
  /** Whether the value fails a validation rule. */
8
8
  invalid?: boolean;
9
9
  /** Describes the field for screen readers. */
10
10
  label?: string;
11
- } & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
11
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import clsx from 'clsx';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef, useId } from 'react';
8
4
  export const SearchFieldInput = forwardRef(({ className, dir, invalid, label = 'Zoeken', ...restProps }, ref) => {
9
5
  const id = useId();
@@ -3,18 +3,18 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { PropsWithChildren, SelectHTMLAttributes } from 'react';
6
- export type SelectProps = {
6
+ export type SelectProps = PropsWithChildren<Omit<SelectHTMLAttributes<HTMLSelectElement>, 'aria-invalid'>> & {
7
7
  /** Whether the value fails a validation rule. */
8
8
  invalid?: boolean;
9
- } & PropsWithChildren<Omit<SelectHTMLAttributes<HTMLSelectElement>, 'aria-invalid'>>;
9
+ };
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-select--docs Select docs at Amsterdam Design System}
12
12
  */
13
- export declare const Select: import("react").ForwardRefExoticComponent<{
13
+ export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectHTMLAttributes<HTMLSelectElement>, "aria-invalid"> & {
14
+ children?: import("react").ReactNode | undefined;
15
+ } & {
14
16
  /** Whether the value fails a validation rule. */
15
17
  invalid?: boolean;
16
- } & Omit<SelectHTMLAttributes<HTMLSelectElement>, "aria-invalid"> & {
17
- children?: import("react").ReactNode | undefined;
18
18
  } & import("react").RefAttributes<HTMLSelectElement>> & {
19
19
  Group: import("react").ForwardRefExoticComponent<import("./SelectOptionGroup").SelectOptionGroupProps & {
20
20
  children?: import("react").ReactNode | undefined;
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  import { SelectOption } from './SelectOption';
9
5
  import { SelectOptionGroup } from './SelectOptionGroup';
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  export const SelectOption = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("option", { ...restProps, className: clsx('ams-select__option', className), ref: ref, children: children })));
9
5
  SelectOption.displayName = 'Select.Option';
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  export const SelectOptionGroup = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("optgroup", { ...restProps, className: clsx('ams-select__group', className), ref: ref, children: children })));
9
5
  SelectOptionGroup.displayName = 'Select.Group';
@@ -1,9 +1,5 @@
1
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';
2
+ import { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  /**
9
5
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-skip-link--docs Skip Link docs at Amsterdam Design System}