@amsterdam/design-system-react 1.1.0 → 2.0.1

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 +23 -23
@@ -7,21 +7,21 @@ export declare const spotlightTags: readonly ["article", "aside", "div", "footer
7
7
  type SpotlightTag = (typeof spotlightTags)[number];
8
8
  export declare const spotlightColors: readonly ["azure", "green", "lime", "magenta", "orange", "yellow"];
9
9
  type SpotlightColor = (typeof spotlightColors)[number];
10
- export type SpotlightProps = {
10
+ export type SpotlightProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
11
11
  /** The HTML element to use. */
12
12
  as?: SpotlightTag;
13
13
  /** The background colour. */
14
14
  color?: SpotlightColor;
15
- } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
15
+ };
16
16
  /**
17
17
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-spotlight--docs Spotlight docs at Amsterdam Design System}
18
18
  */
19
- export declare const Spotlight: import("react").ForwardRefExoticComponent<{
19
+ export declare const Spotlight: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
20
+ children?: import("react").ReactNode | undefined;
21
+ } & {
20
22
  /** The HTML element to use. */
21
23
  as?: SpotlightTag;
22
24
  /** The background colour. */
23
25
  color?: SpotlightColor;
24
- } & HTMLAttributes<HTMLElement> & {
25
- children?: import("react").ReactNode | undefined;
26
26
  } & import("react").RefAttributes<unknown>>;
27
27
  export {};
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  * @license EUPL-1.2+
4
4
  * Copyright Gemeente Amsterdam
5
5
  */
6
- import clsx from 'clsx';
6
+ import { clsx } from 'clsx';
7
7
  import { forwardRef } from 'react';
8
8
  export const spotlightTags = ['article', 'aside', 'div', 'footer', 'section'];
9
9
  export const spotlightColors = ['azure', 'green', 'lime', 'magenta', 'orange', 'yellow'];
@@ -5,8 +5,8 @@ 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 { Spotlight, spotlightColors, spotlightTags } from './Spotlight';
9
8
  import { ariaRoleForTag } from '../common/accessibility';
9
+ import { Spotlight, spotlightColors, spotlightTags } from './Spotlight';
10
10
  import '@testing-library/jest-dom';
11
11
  describe('Spotlight', () => {
12
12
  it('renders', () => {
@@ -3,18 +3,25 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes } from 'react';
6
- export type StandaloneLinkProps = {
6
+ import type { IconProps } from '../Icon';
7
+ export type StandaloneLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'> & {
7
8
  /** Changes the text colour for readability on a light or dark background. */
8
9
  color?: 'contrast' | 'inverse';
9
- /** Adds an icon to the link, showing it before the link text. */
10
- icon?: Function;
11
- } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'>;
10
+ /**
11
+ * The icon to show before the link text.
12
+ * @default ChevronForwardIcon
13
+ */
14
+ icon?: IconProps['svg'];
15
+ };
12
16
  /**
13
17
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-standalone-link--docs Standalone Link docs at Amsterdam Design System}
14
18
  */
15
- export declare const StandaloneLink: import("react").ForwardRefExoticComponent<{
19
+ export declare const StandaloneLink: import("react").ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & {
16
20
  /** Changes the text colour for readability on a light or dark background. */
17
21
  color?: "contrast" | "inverse";
18
- /** Adds an icon to the link, showing it before the link text. */
19
- icon?: Function;
20
- } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & import("react").RefAttributes<HTMLAnchorElement>>;
22
+ /**
23
+ * The icon to show before the link text.
24
+ * @default ChevronForwardIcon
25
+ */
26
+ icon?: IconProps["svg"];
27
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,13 +1,11 @@
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 { ChevronForwardIcon } from '@amsterdam/design-system-react-icons';
3
+ import { clsx } from 'clsx';
7
4
  import { forwardRef } from 'react';
8
5
  import { Icon } from '../Icon';
6
+ // The `ams-standalone-link--with-icon` class is @deprecated and will be removed in a future release.
9
7
  /**
10
8
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-standalone-link--docs Standalone Link docs at Amsterdam Design System}
11
9
  */
12
- export const StandaloneLink = forwardRef(({ children, className, color, icon, ...restProps }, ref) => (_jsxs("a", { ...restProps, className: clsx('ams-standalone-link', color && `ams-standalone-link--${color}`, icon && 'ams-standalone-link--with-icon', className), ref: ref, children: [icon && _jsx(Icon, { svg: icon }), children] })));
10
+ export const StandaloneLink = forwardRef(({ children, className, color, icon = ChevronForwardIcon, ...restProps }, ref) => (_jsxs("a", { ...restProps, className: clsx('ams-standalone-link ams-standalone-link--with-icon', color && `ams-standalone-link--${color}`, className), ref: ref, children: [_jsx(Icon, { svg: icon }), children] })));
13
11
  StandaloneLink.displayName = 'StandaloneLink';
@@ -1,12 +1,9 @@
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 { StandaloneLink } from './StandaloneLink';
9
5
  import '@testing-library/jest-dom';
6
+ const TestIcon = (props) => _jsx("svg", { ...props, className: "test-class" });
10
7
  describe('Standalone Link', () => {
11
8
  it('renders with href attribute', () => {
12
9
  render(_jsx(StandaloneLink, { href: "#" }));
@@ -25,6 +22,11 @@ describe('Standalone Link', () => {
25
22
  const component = screen.getByRole('link');
26
23
  expect(component).toHaveClass('ams-standalone-link extra');
27
24
  });
25
+ it('renders a custom icon', () => {
26
+ const { container } = render(_jsx(StandaloneLink, { icon: TestIcon }));
27
+ const icon = container.querySelector('svg');
28
+ expect(icon).toHaveClass('test-class');
29
+ });
28
30
  it('renders the class name for contrast color', () => {
29
31
  render(_jsx(StandaloneLink, { color: "contrast", href: "#" }));
30
32
  const component = screen.getByRole('link');
@@ -1,9 +1,5 @@
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
  /**
9
5
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-switch--docs Switch docs at Amsterdam Design System}
@@ -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 { TableBody } from './TableBody';
9
5
  import { TableCaption } from './TableCaption';
@@ -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 TableBody = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("tbody", { ...restProps, className: clsx('ams-table__body', className), ref: ref, children: children })));
9
5
  TableBody.displayName = 'Table.Body';
@@ -2,6 +2,11 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
+ /**
6
+ * @license EUPL-1.2
7
+ * Copyright (c) 2022 Robbert Broersma
8
+ * Copyright Gemeente Amsterdam
9
+ */
5
10
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
11
  export type TableCaptionProps = PropsWithChildren<HTMLAttributes<HTMLTableCaptionElement>>;
7
12
  export declare const TableCaption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableCaptionElement> & {
@@ -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) 2022 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
  export const TableCaption = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("caption", { ...restProps, className: clsx('ams-table__caption', className), ref: ref, children: children })));
14
5
  TableCaption.displayName = 'Table.Caption';
@@ -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 TableCell = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("td", { ...restProps, className: clsx('ams-table__cell', className), ref: ref, children: children })));
9
5
  TableCell.displayName = 'Table.Cell';
@@ -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 TableFooter = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("tfoot", { ...restProps, className: clsx('ams-table__footer', className), ref: ref, children: children })));
9
5
  TableFooter.displayName = 'Table.Footer';
@@ -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 TableHeader = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("thead", { ...restProps, className: clsx('ams-table__header', className), ref: ref, children: children })));
9
5
  TableHeader.displayName = 'Table.Header';
@@ -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 TableHeaderCell = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("th", { ...restProps, className: clsx('ams-table__header-cell', className), ref: ref, children: children })));
9
5
  TableHeaderCell.displayName = 'Table.HeaderCell';
@@ -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 TableRow = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("tr", { ...restProps, className: clsx('ams-table__row', className), ref: ref, children: children })));
9
5
  TableRow.displayName = 'Table.Row';
@@ -4,32 +4,32 @@
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
6
  import type { HeadingProps } from '../Heading';
7
- export type TableOfContentsProps = {
7
+ export type TableOfContentsProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
8
8
  /** The text for the Heading. */
9
9
  heading?: string;
10
10
  /**
11
11
  * The hierarchical level of the Heading within the document.
12
- * Note: this intentionally does not change the font size.
12
+ * Visually, it always has the size of a level 3 Heading.
13
13
  */
14
14
  headingLevel?: HeadingProps['level'];
15
- } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
15
+ };
16
16
  /**
17
17
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-table-of-contents--docs Table Of Contents docs at Amsterdam Design System}
18
18
  */
19
- export declare const TableOfContents: import("react").ForwardRefExoticComponent<{
19
+ export declare const TableOfContents: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
20
+ children?: import("react").ReactNode | undefined;
21
+ } & {
20
22
  /** The text for the Heading. */
21
23
  heading?: string;
22
24
  /**
23
25
  * The hierarchical level of the Heading within the document.
24
- * Note: this intentionally does not change the font size.
26
+ * Visually, it always has the size of a level 3 Heading.
25
27
  */
26
28
  headingLevel?: HeadingProps["level"];
27
- } & HTMLAttributes<HTMLElement> & {
28
- children?: import("react").ReactNode | undefined;
29
29
  } & import("react").RefAttributes<HTMLElement>> & {
30
- Link: import("react").ForwardRefExoticComponent<{
30
+ Link: import("react").ForwardRefExoticComponent<import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
31
31
  label: string;
32
- } & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
32
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
33
33
  List: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & {
34
34
  children?: import("react").ReactNode | undefined;
35
35
  } & import("react").RefAttributes<HTMLUListElement>>;
@@ -1,15 +1,12 @@
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 } from 'react';
4
+ import { Heading } from '../Heading';
8
5
  import { TableOfContentsLink } from './TableOfContentsLink';
9
6
  import { TableOfContentsList } from './TableOfContentsList';
10
- import { Heading } from '../Heading';
7
+ // The 'ams-table-of-contents__heading' class is @deprecated and will be removed in a future release.
11
8
  const TableOfContentsRoot = forwardRef(({ children, className, heading, headingLevel = 2, ...restProps }, ref) => {
12
- return (_jsxs("nav", { ...restProps, className: clsx('ams-table-of-contents', className), ref: ref, children: [heading && (_jsx(Heading, { className: "ams-table-of-contents__heading", level: headingLevel, size: "level-4", children: heading })), children] }));
9
+ return (_jsxs("nav", { ...restProps, className: clsx('ams-table-of-contents', className), ref: ref, children: [heading && (_jsx(Heading, { className: "ams-table-of-contents__heading", level: headingLevel, size: "level-3", children: heading })), children] }));
13
10
  });
14
11
  TableOfContentsRoot.displayName = 'TableOfContents';
15
12
  /**
@@ -3,11 +3,11 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes } from 'react';
6
- export type TableOfContentsLinkProps = {
6
+ export type TableOfContentsLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
7
7
  /** The text for the link. */
8
8
  label: string;
9
- } & AnchorHTMLAttributes<HTMLAnchorElement>;
10
- export declare const TableOfContentsLink: import("react").ForwardRefExoticComponent<{
9
+ };
10
+ export declare const TableOfContentsLink: import("react").ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
11
11
  /** The text for the link. */
12
12
  label: string;
13
- } & AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
13
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,8 +1,4 @@
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 { clsx } from 'clsx';
7
3
  import { forwardRef } from 'react';
8
4
  export const TableOfContentsLink = forwardRef(({ children, className, label, ...restProps }, ref) => (_jsxs("li", { className: "ams-table-of-contents__item", children: [_jsx("a", { ...restProps, className: clsx('ams-table-of-contents__link', className), ref: ref, children: label }), children] })));
@@ -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 TableOfContentsList = forwardRef(({ children, className, ...restProps }, ref) => {
9
5
  return (_jsx("ul", { ...restProps, className: clsx('ams-table-of-contents__list', className), ref: ref, children: children }));
@@ -25,7 +25,7 @@ describe('Table of Contents list', () => {
25
25
  });
26
26
  it('renders its subcomponent', () => {
27
27
  const listItems = ['Item 1', 'Item 2', 'Item 3'];
28
- const { container } = render(_jsx(TableOfContents.List, { children: listItems.map((item, index) => (_jsx(TableOfContents.Link, { label: `Link ${item}` }, index))) }));
28
+ const { container } = render(_jsx(TableOfContents.List, { children: listItems.map((item) => (_jsx(TableOfContents.Link, { label: `Link ${item}` }, item))) }));
29
29
  const list = screen.getByRole('list');
30
30
  const items = container.querySelectorAll('.ams-table-of-contents__item');
31
31
  expect(list).toBeInTheDocument();
@@ -3,32 +3,32 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type TabsProps = {
6
+ export type TabsProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
7
7
  /** The identifier of the initially active Tab. Corresponds to its Panel `id` value. */
8
8
  activeTab?: string;
9
9
  onTabChange?: (panelId: string) => void;
10
- } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
10
+ };
11
11
  /**
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-tabs--docs Tabs docs at Amsterdam Design System}
13
13
  */
14
- export declare const Tabs: import("react").ForwardRefExoticComponent<{
14
+ export declare const Tabs: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
15
+ children?: import("react").ReactNode | undefined;
16
+ } & {
15
17
  /** The identifier of the initially active Tab. Corresponds to its Panel `id` value. */
16
18
  activeTab?: string;
17
19
  onTabChange?: (panelId: string) => void;
18
- } & HTMLAttributes<HTMLDivElement> & {
19
- children?: import("react").ReactNode | undefined;
20
20
  } & import("react").RefAttributes<HTMLDivElement>> & {
21
- Button: import("react").ForwardRefExoticComponent<{
22
- 'aria-controls': string;
23
- } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
21
+ Button: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
24
22
  children?: import("react").ReactNode | undefined;
23
+ } & {
24
+ 'aria-controls': string;
25
25
  } & import("react").RefAttributes<HTMLButtonElement>>;
26
26
  List: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
27
27
  children?: import("react").ReactNode | undefined;
28
28
  } & import("react").RefAttributes<HTMLDivElement>>;
29
- Panel: import("react").ForwardRefExoticComponent<{
30
- id: string;
31
- } & HTMLAttributes<HTMLDivElement> & {
29
+ Panel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
32
30
  children?: import("react").ReactNode | undefined;
31
+ } & {
32
+ id: string;
33
33
  } & import("react").RefAttributes<HTMLDivElement>>;
34
34
  };
package/dist/Tabs/Tabs.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, useEffect, useMemo, useState } from 'react';
8
4
  import { TabsButton } from './TabsButton';
9
5
  import { TabsContext } from './TabsContext';
@@ -3,13 +3,13 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { ButtonHTMLAttributes, PropsWithChildren } from 'react';
6
- export type TabsButtonProps = {
6
+ export type TabsButtonProps = PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & {
7
7
  /** The identifier of the corresponding tab panel. */
8
8
  'aria-controls': string;
9
- } & PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>;
10
- export declare const TabsButton: import("react").ForwardRefExoticComponent<{
9
+ };
10
+ export declare const TabsButton: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
11
+ children?: import("react").ReactNode | undefined;
12
+ } & {
11
13
  /** The identifier of the corresponding tab panel. */
12
14
  'aria-controls': string;
13
- } & ButtonHTMLAttributes<HTMLButtonElement> & {
14
- children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,9 +1,5 @@
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, startTransition, useContext } from 'react';
8
4
  import { TabsContext } from './TabsContext';
9
5
  export const TabsButton = forwardRef(({ 'aria-controls': ariaControls, children, className, onClick, ...restProps }, ref) => {
@@ -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, useImperativeHandle, useRef } from 'react';
8
4
  import { useKeyboardFocus } from '../common/useKeyboardFocus';
9
5
  export const TabsList = forwardRef(({ children, className, ...restProps }, ref) => {
@@ -3,13 +3,13 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type TabsPanelProps = {
6
+ export type TabsPanelProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
7
7
  /** The identifier of the Tab Panel. */
8
8
  id: string;
9
- } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
10
- export declare const TabsPanel: import("react").ForwardRefExoticComponent<{
9
+ };
10
+ export declare const TabsPanel: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
11
+ children?: import("react").ReactNode | undefined;
12
+ } & {
11
13
  /** The identifier of the Tab Panel. */
12
14
  id: string;
13
- } & HTMLAttributes<HTMLDivElement> & {
14
- children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -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, useContext } from 'react';
8
4
  import { TabsContext } from './TabsContext';
9
5
  export const TabsPanel = forwardRef(({ children, className, id, ...restProps }, ref) => {
@@ -4,6 +4,6 @@
4
4
  */
5
5
  export { Tabs } from './Tabs';
6
6
  export type { TabsProps } from './Tabs';
7
- export type { TabsPanelProps } from './TabsPanel';
8
- export type { TabsListProps } from './TabsList';
9
7
  export type { TabsButtonProps } from './TabsButton';
8
+ export type { TabsListProps } from './TabsList';
9
+ export type { TabsPanelProps } from './TabsPanel';
@@ -3,18 +3,18 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { TextareaHTMLAttributes } from 'react';
6
- export type TextAreaProps = {
6
+ export type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'aria-invalid'> & {
7
7
  /** Whether the value fails a validation rule. */
8
8
  invalid?: boolean;
9
9
  /** Allows the user to resize the text box. The default is resizing in both directions. */
10
10
  resize?: 'none' | 'horizontal' | 'vertical';
11
- } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'aria-invalid'>;
11
+ };
12
12
  /**
13
13
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-text-area--docs Text Area docs at Amsterdam Design System}
14
14
  */
15
- export declare const TextArea: import("react").ForwardRefExoticComponent<{
15
+ export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "aria-invalid"> & {
16
16
  /** Whether the value fails a validation rule. */
17
17
  invalid?: boolean;
18
18
  /** Allows the user to resize the text box. The default is resizing in both directions. */
19
19
  resize?: "none" | "horizontal" | "vertical";
20
- } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "aria-invalid"> & import("react").RefAttributes<HTMLTextAreaElement>>;
20
+ } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -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-text-area--docs Text Area docs at Amsterdam Design System}
@@ -5,19 +5,19 @@
5
5
  import type { InputHTMLAttributes } from 'react';
6
6
  export declare const textInputTypes: readonly ["email", "tel", "text", "url"];
7
7
  type TextInputType = (typeof textInputTypes)[number];
8
- export type TextInputProps = {
8
+ export type TextInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid'> & {
9
9
  /** Whether the value fails a validation rule. */
10
10
  invalid?: boolean;
11
11
  /** The kind of data that the user should provide. */
12
12
  type?: TextInputType;
13
- } & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid'>;
13
+ };
14
14
  /**
15
15
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-text-input--docs Text Input docs at Amsterdam Design System}
16
16
  */
17
- export declare const TextInput: import("react").ForwardRefExoticComponent<{
17
+ export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid"> & {
18
18
  /** Whether the value fails a validation rule. */
19
19
  invalid?: boolean;
20
20
  /** The kind of data that the user should provide. */
21
21
  type?: TextInputType;
22
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid"> & import("react").RefAttributes<HTMLInputElement>>;
22
+ } & import("react").RefAttributes<HTMLInputElement>>;
23
23
  export {};
@@ -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 textInputTypes = ['email', 'tel', 'text', 'url'];
9
5
  /**
@@ -3,14 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { InputHTMLAttributes } from 'react';
6
- export type TimeInputProps = {
6
+ export type TimeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'> & {
7
7
  /** Whether the value fails a validation rule. */
8
8
  invalid?: boolean;
9
- } & Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>;
9
+ };
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-time-input--docs Time Input docs at Amsterdam Design System}
12
12
  */
13
- export declare const TimeInput: import("react").ForwardRefExoticComponent<{
13
+ export declare const TimeInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
14
14
  /** Whether the value fails a validation rule. */
15
15
  invalid?: boolean;
16
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "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-time-input--docs Time Input docs at Amsterdam Design System}