@amsterdam/design-system-react 2.0.2 → 2.1.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 (110) hide show
  1. package/dist/Accordion/Accordion.d.ts +3 -3
  2. package/dist/Accordion/AccordionSection.d.ts +5 -5
  3. package/dist/App/App.d.ts +12 -0
  4. package/dist/App/App.js +8 -0
  5. package/dist/App/App.test.d.ts +5 -0
  6. package/dist/App/App.test.js +33 -0
  7. package/dist/App/index.d.ts +6 -0
  8. package/dist/App/index.js +5 -0
  9. package/dist/AppNavigation/AppNavigation.d.ts +45 -0
  10. package/dist/AppNavigation/AppNavigation.js +18 -0
  11. package/dist/AppNavigation/AppNavigation.test.d.ts +5 -0
  12. package/dist/AppNavigation/AppNavigation.test.js +33 -0
  13. package/dist/AppNavigation/AppNavigationButton.d.ts +18 -0
  14. package/dist/AppNavigation/AppNavigationButton.js +17 -0
  15. package/dist/AppNavigation/AppNavigationLink.d.ts +19 -0
  16. package/dist/AppNavigation/AppNavigationLink.js +19 -0
  17. package/dist/AppNavigation/AppNavigationMenu.d.ts +9 -0
  18. package/dist/AppNavigation/AppNavigationMenu.js +5 -0
  19. package/dist/AppNavigation/index.d.ts +6 -0
  20. package/dist/AppNavigation/index.js +5 -0
  21. package/dist/Badge/Badge.d.ts +4 -4
  22. package/dist/Blockquote/Blockquote.d.ts +5 -5
  23. package/dist/Breakout/BreakoutCell.d.ts +2 -2
  24. package/dist/Button/Button.d.ts +7 -5
  25. package/dist/Button/Button.js +1 -0
  26. package/dist/Card/Card.d.ts +9 -9
  27. package/dist/Card/CardHeading.d.ts +4 -4
  28. package/dist/Card/CardHeadingGroup.d.ts +5 -5
  29. package/dist/Card/CardImage.d.ts +2 -2
  30. package/dist/Checkbox/Checkbox.d.ts +5 -5
  31. package/dist/Column/Column.d.ts +5 -5
  32. package/dist/DateInput/DateInput.d.ts +4 -4
  33. package/dist/DescriptionList/DescriptionList.d.ts +5 -5
  34. package/dist/Dialog/Dialog.d.ts +6 -7
  35. package/dist/Field/Field.d.ts +5 -5
  36. package/dist/FieldSet/FieldSet.d.ts +20 -10
  37. package/dist/FieldSet/FieldSet.js +4 -3
  38. package/dist/FieldSet/FieldSet.test.js +7 -0
  39. package/dist/Figure/Figure.d.ts +3 -3
  40. package/dist/Figure/FigureCaption.d.ts +5 -5
  41. package/dist/FileList/FileList.d.ts +2 -2
  42. package/dist/FileList/FileListItem.d.ts +4 -4
  43. package/dist/Grid/Grid.d.ts +2 -2
  44. package/dist/Grid/GridCell.d.ts +2 -2
  45. package/dist/Heading/Heading.d.ts +10 -11
  46. package/dist/Heading/Heading.js +1 -0
  47. package/dist/Icon/Icon.d.ts +0 -4
  48. package/dist/IconButton/IconButton.d.ts +4 -2
  49. package/dist/IconButton/IconButton.js +1 -0
  50. package/dist/Image/Image.d.ts +5 -5
  51. package/dist/ImageSlider/ImageSlider.d.ts +4 -4
  52. package/dist/ImageSlider/ImageSliderItem.d.ts +5 -5
  53. package/dist/ImageSlider/ImageSliderThumbnails.d.ts +5 -5
  54. package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.d.ts +2 -2
  55. package/dist/Label/Label.d.ts +14 -6
  56. package/dist/Label/Label.js +3 -2
  57. package/dist/Label/Label.test.js +5 -0
  58. package/dist/Link/Link.d.ts +4 -4
  59. package/dist/LinkList/LinkListLink.d.ts +9 -4
  60. package/dist/LinkList/LinkListLink.js +2 -0
  61. package/dist/Logo/Logo.d.ts +2 -2
  62. package/dist/Menu/Menu.d.ts +31 -10
  63. package/dist/Menu/Menu.js +6 -1
  64. package/dist/Menu/Menu.test.js +28 -11
  65. package/dist/Menu/MenuLink.d.ts +8 -2
  66. package/dist/Menu/MenuLink.test.js +1 -1
  67. package/dist/OrderedList/OrderedList.d.ts +5 -5
  68. package/dist/PageHeader/PageHeader.d.ts +7 -7
  69. package/dist/PageHeader/PageHeader.test.js +0 -4
  70. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.d.ts +1 -1
  71. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +0 -4
  72. package/dist/PageHeader/PageHeaderMenuLink.d.ts +6 -6
  73. package/dist/PageHeader/PageHeaderMenuLink.js +0 -4
  74. package/dist/PageHeading/PageHeading.d.ts +5 -5
  75. package/dist/Pagination/LinkItem.d.ts +3 -3
  76. package/dist/Pagination/Pagination.d.ts +4 -4
  77. package/dist/Paragraph/Paragraph.d.ts +5 -9
  78. package/dist/PasswordInput/PasswordInput.d.ts +4 -4
  79. package/dist/Radio/Radio.d.ts +5 -5
  80. package/dist/Row/Row.d.ts +5 -5
  81. package/dist/SearchField/SearchField.d.ts +3 -3
  82. package/dist/SearchField/SearchField.test.js +2 -19
  83. package/dist/SearchField/SearchFieldButton.js +1 -1
  84. package/dist/SearchField/SearchFieldButton.test.d.ts +5 -0
  85. package/dist/SearchField/SearchFieldButton.test.js +47 -0
  86. package/dist/SearchField/SearchFieldInput.d.ts +2 -2
  87. package/dist/Select/Select.d.ts +5 -5
  88. package/dist/Spotlight/Spotlight.d.ts +6 -6
  89. package/dist/Spotlight/Spotlight.js +0 -4
  90. package/dist/StandaloneLink/StandaloneLink.d.ts +4 -4
  91. package/dist/Table/TableCaption.d.ts +0 -4
  92. package/dist/TableOfContents/TableOfContents.d.ts +7 -7
  93. package/dist/TableOfContents/TableOfContentsLink.d.ts +4 -4
  94. package/dist/Tabs/Tabs.d.ts +11 -11
  95. package/dist/Tabs/TabsButton.d.ts +5 -5
  96. package/dist/Tabs/TabsPanel.d.ts +5 -5
  97. package/dist/TextArea/TextArea.d.ts +12 -6
  98. package/dist/TextInput/TextInput.d.ts +4 -4
  99. package/dist/TimeInput/TimeInput.d.ts +4 -4
  100. package/dist/UnorderedList/UnorderedList.d.ts +5 -5
  101. package/dist/common/useIsAfterBreakpoint.d.ts +4 -0
  102. package/dist/common/useIsAfterBreakpoint.js +4 -4
  103. package/dist/index.cjs.js +35 -18
  104. package/dist/index.cjs.js.map +1 -1
  105. package/dist/index.d.ts +61 -1860
  106. package/dist/index.esm.js +35 -18
  107. package/dist/index.esm.js.map +1 -1
  108. package/dist/tsconfig.build.tsbuildinfo +1 -0
  109. package/dist/tsconfig.tsbuildinfo +1 -1
  110. package/package.json +20 -19
@@ -5,20 +5,20 @@
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
6
  export declare const descriptionListTermsWidths: readonly ["narrow", "medium", "wide"];
7
7
  type DescriptionListTermsWidth = (typeof descriptionListTermsWidths)[number];
8
- export type DescriptionListProps = PropsWithChildren<HTMLAttributes<HTMLDListElement>> & {
8
+ export type DescriptionListProps = {
9
9
  /** Changes the text colour for readability on a dark background. */
10
10
  color?: 'inverse';
11
11
  termsWidth?: DescriptionListTermsWidth;
12
- };
12
+ } & PropsWithChildren<HTMLAttributes<HTMLDListElement>>;
13
13
  /**
14
14
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-description-list--docs Description List docs at Amsterdam Design System}
15
15
  */
16
- export declare const DescriptionList: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDListElement> & {
17
- children?: import("react").ReactNode | undefined;
18
- } & {
16
+ export declare const DescriptionList: import("react").ForwardRefExoticComponent<{
19
17
  /** Changes the text colour for readability on a dark background. */
20
18
  color?: "inverse";
21
19
  termsWidth?: DescriptionListTermsWidth;
20
+ } & HTMLAttributes<HTMLDListElement> & {
21
+ children?: import("react").ReactNode | undefined;
22
22
  } & import("react").RefAttributes<HTMLDListElement>> & {
23
23
  Description: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
24
24
  children?: import("react").ReactNode | undefined;
@@ -2,28 +2,27 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
- import type { DialogHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
6
- import { MouseEvent } from 'react';
7
- export type DialogProps = PropsWithChildren<DialogHTMLAttributes<HTMLDialogElement>> & {
5
+ import type { DialogHTMLAttributes, MouseEvent, PropsWithChildren, ReactNode } from 'react';
6
+ export type DialogProps = {
8
7
  /** The label for the button that dismisses the Dialog. */
9
8
  closeButtonLabel?: string;
10
9
  /** Content for the footer, often one Button or an Action Group containing more of them. */
11
10
  footer?: ReactNode;
12
11
  /** The text for the Heading. */
13
12
  heading: string;
14
- };
13
+ } & PropsWithChildren<DialogHTMLAttributes<HTMLDialogElement>>;
15
14
  /**
16
15
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-containers-dialog--docs Dialog docs at Amsterdam Design System}
17
16
  */
18
- export declare const Dialog: import("react").ForwardRefExoticComponent<DialogHTMLAttributes<HTMLDialogElement> & {
19
- children?: ReactNode | undefined;
20
- } & {
17
+ export declare const Dialog: import("react").ForwardRefExoticComponent<{
21
18
  /** The label for the button that dismisses the Dialog. */
22
19
  closeButtonLabel?: string;
23
20
  /** Content for the footer, often one Button or an Action Group containing more of them. */
24
21
  footer?: ReactNode;
25
22
  /** The text for the Heading. */
26
23
  heading: string;
24
+ } & DialogHTMLAttributes<HTMLDialogElement> & {
25
+ children?: ReactNode | undefined;
27
26
  } & import("react").RefAttributes<HTMLDialogElement>> & {
28
27
  close: (event: MouseEvent<HTMLButtonElement>) => void | undefined;
29
28
  open: (id: string) => void;
@@ -3,16 +3,16 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type FieldProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
6
+ export type FieldProps = {
7
7
  /** Whether the field has an input with a validation error */
8
8
  invalid?: boolean;
9
- };
9
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field--docs Field docs at Amsterdam Design System}
12
12
  */
13
- export declare const Field: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
14
- children?: import("react").ReactNode | undefined;
15
- } & {
13
+ export declare const Field: import("react").ForwardRefExoticComponent<{
16
14
  /** Whether the field has an input with a validation error */
17
15
  invalid?: boolean;
16
+ } & HTMLAttributes<HTMLDivElement> & {
17
+ children?: import("react").ReactNode | undefined;
18
18
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -3,24 +3,34 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- import { HintProps } from '../Hint';
7
- export type FieldSetProps = HintProps & PropsWithChildren<HTMLAttributes<HTMLFieldSetElement>> & {
8
- /** Whether the field set has an input with a validation error */
6
+ import type { HintProps } from '../Hint';
7
+ export type FieldSetProps = {
8
+ /** Whether the field set has an input with a validation error. */
9
9
  invalid?: boolean;
10
10
  /** The text for the caption. */
11
11
  legend: string;
12
- };
12
+ /**
13
+ * Render a level 1 heading in the legend.
14
+ * Set this if the Field Set is the only content of the page.
15
+ */
16
+ legendIsPageHeading?: boolean;
17
+ } & HintProps & PropsWithChildren<HTMLAttributes<HTMLFieldSetElement>>;
13
18
  /**
14
19
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field-set--docs Field Set docs at Amsterdam Design System}
15
20
  */
16
21
  export declare const FieldSet: import("react").ForwardRefExoticComponent<{
22
+ /** Whether the field set has an input with a validation error. */
23
+ invalid?: boolean;
24
+ /** The text for the caption. */
25
+ legend: string;
26
+ /**
27
+ * Render a level 1 heading in the legend.
28
+ * Set this if the Field Set is the only content of the page.
29
+ */
30
+ legendIsPageHeading?: boolean;
31
+ } & {
17
32
  hint?: string;
18
33
  optional?: boolean;
19
34
  } & HTMLAttributes<HTMLElement> & {
20
35
  children?: import("react").ReactNode | undefined;
21
- } & HTMLAttributes<HTMLFieldSetElement> & {
22
- /** Whether the field set has an input with a validation error */
23
- invalid?: boolean;
24
- /** The text for the caption. */
25
- legend: string;
26
- } & import("react").RefAttributes<HTMLFieldSetElement>>;
36
+ } & HTMLAttributes<HTMLFieldSetElement> & import("react").RefAttributes<HTMLFieldSetElement>>;
@@ -1,11 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { Hint } from '../Hint';
5
5
  /**
6
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field-set--docs Field Set docs at Amsterdam Design System}
7
7
  */
8
- export const FieldSet = forwardRef(({ children, className, hint, invalid, legend, optional, ...restProps }, ref) => {
9
- return (_jsxs("fieldset", { ...restProps, className: clsx('ams-field-set', invalid && 'ams-field-set--invalid', className), ref: ref, children: [_jsxs("legend", { className: "ams-field-set__legend", children: [legend, " ", _jsx(Hint, { hint: hint, optional: optional })] }), children] }));
8
+ export const FieldSet = forwardRef(({ children, className, hint, invalid, legend, legendIsPageHeading, optional, ...restProps }, ref) => {
9
+ const legendContent = (_jsxs(_Fragment, { children: [legend, " ", _jsx(Hint, { hint: hint, optional: optional })] }));
10
+ return (_jsxs("fieldset", { ...restProps, className: clsx('ams-field-set', invalid && 'ams-field-set--invalid', className), ref: ref, children: [_jsx("legend", { className: "ams-field-set__legend", children: legendIsPageHeading ? _jsx("h1", { className: "ams-field-set__heading", children: legendContent }) : legendContent }), children] }));
10
11
  });
11
12
  FieldSet.displayName = 'FieldSet';
@@ -60,4 +60,11 @@ describe('FieldSet', () => {
60
60
  const component = screen.getByRole('group', { name: 'Legend (required)' });
61
61
  expect(component).toBeInTheDocument();
62
62
  });
63
+ it('renders a heading in the legend', () => {
64
+ render(_jsx(FieldSet, { legend: "Legend", legendIsPageHeading: true }));
65
+ const heading = screen.getByRole('heading', {
66
+ name: 'Legend',
67
+ });
68
+ expect(heading).toBeInTheDocument();
69
+ });
63
70
  });
@@ -10,9 +10,9 @@ export type FigureProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
10
10
  export declare const Figure: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
11
11
  children?: import("react").ReactNode | undefined;
12
12
  } & import("react").RefAttributes<HTMLElement>> & {
13
- Caption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
14
- children?: import("react").ReactNode | undefined;
15
- } & {
13
+ Caption: import("react").ForwardRefExoticComponent<{
16
14
  color?: "inverse";
15
+ } & HTMLAttributes<HTMLElement> & {
16
+ children?: import("react").ReactNode | undefined;
17
17
  } & import("react").RefAttributes<HTMLElement>>;
18
18
  };
@@ -3,13 +3,13 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type FigureCaptionProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
6
+ export type FigureCaptionProps = {
7
7
  /** Changes the text colour for readability on a dark background. */
8
8
  color?: 'inverse';
9
- };
10
- export declare const FigureCaption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
11
- children?: import("react").ReactNode | undefined;
12
- } & {
9
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
10
+ export declare const FigureCaption: import("react").ForwardRefExoticComponent<{
13
11
  /** Changes the text colour for readability on a dark background. */
14
12
  color?: "inverse";
13
+ } & HTMLAttributes<HTMLElement> & {
14
+ children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLElement>>;
@@ -13,8 +13,8 @@ export declare const FileListRoot: import("react").ForwardRefExoticComponent<HTM
13
13
  export declare const FileList: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLOListElement>> & {
16
- Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
16
+ Item: import("react").ForwardRefExoticComponent<{
17
17
  file: File;
18
18
  onDelete?: () => void;
19
- } & import("react").RefAttributes<HTMLLIElement>>;
19
+ } & HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
20
20
  };
@@ -3,11 +3,11 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes } from 'react';
6
- export type FileListItemProps = HTMLAttributes<HTMLLIElement> & {
6
+ export type FileListItemProps = {
7
7
  file: File;
8
8
  onDelete?: () => void;
9
- };
10
- export declare const FileListItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
9
+ } & HTMLAttributes<HTMLLIElement>;
10
+ export declare const FileListItem: import("react").ForwardRefExoticComponent<{
11
11
  file: File;
12
12
  onDelete?: () => void;
13
- } & import("react").RefAttributes<HTMLLIElement>>;
13
+ } & HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
@@ -28,12 +28,12 @@ type GridPaddingTopAndBottomProps = {
28
28
  paddingTop?: GridPadding;
29
29
  paddingVertical?: never;
30
30
  };
31
- export type GridProps = (GridPaddingVerticalProp | GridPaddingTopAndBottomProps) & PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
31
+ export type GridProps = {
32
32
  /** The HTML tag to use. */
33
33
  as?: GridTag;
34
34
  /** The amount of space between rows. */
35
35
  gapVertical?: GridGap;
36
- };
36
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>> & (GridPaddingVerticalProp | GridPaddingTopAndBottomProps);
37
37
  /**
38
38
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-layout-grid--docs Grid docs at Amsterdam Design System}
39
39
  */
@@ -17,9 +17,9 @@ type GridCellSpanAndStartProps = {
17
17
  /** The index of the grid column the cell starts at. */
18
18
  start?: GridColumnNumber | GridColumnNumbers;
19
19
  };
20
- export type GridCellProps = (GridCellSpanAllProp | GridCellSpanAndStartProps) & PropsWithChildren<HTMLAttributes<HTMLElement>> & {
20
+ export type GridCellProps = {
21
21
  /** The HTML tag to use. */
22
22
  as?: GridCellTag;
23
- };
23
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>> & (GridCellSpanAllProp | GridCellSpanAndStartProps);
24
24
  export declare const GridCell: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<unknown>>;
25
25
  export {};
@@ -1,37 +1,36 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
1
  /**
6
2
  * @license EUPL-1.2+
7
3
  * Copyright (c) 2021 Robbert Broersma
8
4
  * Copyright Gemeente Amsterdam
9
5
  */
10
6
  import type { HTMLAttributes, PropsWithChildren } from 'react';
11
- export type HeadingProps = PropsWithChildren<HTMLAttributes<HTMLHeadingElement>> & {
7
+ export declare const headingSizes: readonly [1, 2, 3, 4];
8
+ type HeadingSize = (typeof headingSizes)[number];
9
+ export type HeadingProps = {
12
10
  /** Changes the text colour for readability on a dark background. */
13
11
  color?: 'inverse';
14
12
  /** The hierarchical level within the document. */
15
- level: 1 | 2 | 3 | 4;
13
+ level: HeadingSize;
16
14
  /**
17
15
  * Uses larger or smaller text without changing its position in the heading hierarchy.
18
16
  * The value ‘level-6’ is deprecated. Use level 5 instead.
19
17
  */
20
18
  size?: 'level-1' | 'level-2' | 'level-3' | 'level-4' | 'level-5' | 'level-6';
21
- };
19
+ } & PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>;
22
20
  /**
23
21
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-heading--docs Heading docs at Amsterdam Design System}
24
22
  */
25
- export declare const Heading: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
26
- children?: import("react").ReactNode | undefined;
27
- } & {
23
+ export declare const Heading: import("react").ForwardRefExoticComponent<{
28
24
  /** Changes the text colour for readability on a dark background. */
29
25
  color?: "inverse";
30
26
  /** The hierarchical level within the document. */
31
- level: 1 | 2 | 3 | 4;
27
+ level: HeadingSize;
32
28
  /**
33
29
  * Uses larger or smaller text without changing its position in the heading hierarchy.
34
30
  * The value ‘level-6’ is deprecated. Use level 5 instead.
35
31
  */
36
32
  size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
33
+ } & HTMLAttributes<HTMLHeadingElement> & {
34
+ children?: import("react").ReactNode | undefined;
37
35
  } & import("react").RefAttributes<HTMLHeadingElement>>;
36
+ export {};
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { clsx } from 'clsx';
3
3
  import { forwardRef } from 'react';
4
4
  import { getHeadingTag } from './getHeadingTag';
5
+ export const headingSizes = [1, 2, 3, 4];
5
6
  /**
6
7
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-heading--docs Heading docs at Amsterdam Design System}
7
8
  */
@@ -1,7 +1,3 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
1
  /**
6
2
  * @license EUPL-1.2+
7
3
  * Copyright (c) 2021 Gemeente Utrecht
@@ -4,9 +4,11 @@
4
4
  */
5
5
  import type { ButtonHTMLAttributes } from 'react';
6
6
  import type { IconProps } from '../Icon';
7
+ export declare const iconButtonColors: readonly ["contrast", "inverse"];
8
+ export type IconButtonColor = (typeof iconButtonColors)[number];
7
9
  export type IconButtonProps = {
8
10
  /** Changes the text colour for readability on a light or dark background. */
9
- color?: 'contrast' | 'inverse';
11
+ color?: IconButtonColor;
10
12
  /** The accessible text for the button. Will be announced by screen readers. Should describe the button’s action. */
11
13
  label: string;
12
14
  /** The size of the icon. Match it to the text that the Icon Buttons aligns with. */
@@ -19,7 +21,7 @@ export type IconButtonProps = {
19
21
  */
20
22
  export declare const IconButton: import("react").ForwardRefExoticComponent<{
21
23
  /** Changes the text colour for readability on a light or dark background. */
22
- color?: "contrast" | "inverse";
24
+ color?: IconButtonColor;
23
25
  /** The accessible text for the button. Will be announced by screen readers. Should describe the button’s action. */
24
26
  label: string;
25
27
  /** The size of the icon. Match it to the text that the Icon Buttons aligns with. */
@@ -3,6 +3,7 @@ import { CloseIcon } from '@amsterdam/design-system-react-icons';
3
3
  import { clsx } from 'clsx';
4
4
  import { forwardRef } from 'react';
5
5
  import { Icon } from '../Icon';
6
+ export const iconButtonColors = ['contrast', 'inverse'];
6
7
  /**
7
8
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-buttons-icon-button--docs Icon Button docs at Amsterdam Design System}
8
9
  */
@@ -3,15 +3,15 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { ImgHTMLAttributes } from 'react';
6
- import { AspectRatioProps } from '../common/types';
7
- export type ImageProps = AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'> & {
6
+ import type { AspectRatioProps } from '../common/types';
7
+ export type ImageProps = {
8
8
  /** A textual description of the content of the image. */
9
9
  alt: string;
10
- };
10
+ } & AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'>;
11
11
  /**
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-image--docs Image docs at Amsterdam Design System}
13
13
  */
14
- export declare const Image: import("react").ForwardRefExoticComponent<AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> & {
14
+ export declare const Image: import("react").ForwardRefExoticComponent<{
15
15
  /** A textual description of the content of the image. */
16
16
  alt: string;
17
- } & import("react").RefAttributes<HTMLImageElement>>;
17
+ } & AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> & import("react").RefAttributes<HTMLImageElement>>;
@@ -3,7 +3,7 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes } from 'react';
6
- import { ImageProps } from '../Image/Image';
6
+ import type { ImageProps } from '../Image/Image';
7
7
  export type ImageSliderImageProps = ImageProps;
8
8
  export type ImageSliderProps = {
9
9
  /** Display buttons to navigate to the previous or next image. */
@@ -44,9 +44,9 @@ export declare const ImageSlider: import("react").ForwardRefExoticComponent<{
44
44
  /** The label for the ‘previous’ button */
45
45
  previousLabel?: string;
46
46
  } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>> & {
47
- Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
48
- children?: import("react").ReactNode | undefined;
49
- } & {
47
+ Item: import("react").ForwardRefExoticComponent<{
50
48
  slideId: number;
49
+ } & HTMLAttributes<HTMLDivElement> & {
50
+ children?: import("react").ReactNode | undefined;
51
51
  } & import("react").RefAttributes<HTMLDivElement>>;
52
52
  };
@@ -3,13 +3,13 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes, PropsWithChildren } from 'react';
6
- export type ImageSliderItemProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
6
+ export type ImageSliderItemProps = {
7
7
  /** The identifier of the item. Must match the key or order of the slides (starting at 0). */
8
8
  slideId: number;
9
- };
10
- export declare const ImageSliderItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
11
- children?: import("react").ReactNode | undefined;
12
- } & {
9
+ } & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
10
+ export declare const ImageSliderItem: import("react").ForwardRefExoticComponent<{
13
11
  /** The identifier of the item. Must match the key or order of the slides (starting at 0). */
14
12
  slideId: number;
13
+ } & HTMLAttributes<HTMLDivElement> & {
14
+ children?: import("react").ReactNode | undefined;
15
15
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -3,12 +3,12 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { HTMLAttributes } from 'react';
6
- import { ImageSliderImageProps } from './ImageSlider';
7
- export type ImageSliderThumbnailsProps = HTMLAttributes<HTMLElement> & {
6
+ import type { ImageSliderImageProps } from './ImageSlider';
7
+ export type ImageSliderThumbnailsProps = {
8
8
  imageLabel?: string;
9
9
  thumbnails: ImageSliderImageProps[];
10
- };
11
- export declare const ImageSliderThumbnails: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
10
+ } & HTMLAttributes<HTMLElement>;
11
+ export declare const ImageSliderThumbnails: import("react").ForwardRefExoticComponent<{
12
12
  imageLabel?: string;
13
13
  thumbnails: ImageSliderImageProps[];
14
- } & import("react").RefAttributes<HTMLElement>>;
14
+ } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { Dispatch, SetStateAction } from 'react';
6
6
  import type { InvalidFormAlertProps } from './InvalidFormAlert';
7
- export declare const InvalidFormAlertWithErrors: import("react").ForwardRefExoticComponent<Omit<InvalidFormAlertProps, "errorCountLabel"> & {
7
+ export declare const InvalidFormAlertWithErrors: import("react").ForwardRefExoticComponent<{
8
8
  /** Whether the component has set focus once. */
9
9
  hasFocusedOnce: boolean;
10
10
  /** Callback to let parent component know whether focus has been set once. */
11
11
  setHasFocusedOnce: Dispatch<SetStateAction<boolean>>;
12
- } & import("react").RefAttributes<HTMLDivElement>>;
12
+ } & Omit<InvalidFormAlertProps, "errorCountLabel"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,19 +1,27 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
1
  /**
6
2
  * @license EUPL-1.2+
7
3
  * Copyright (c) 2021 Robbert Broersma
8
4
  * Copyright Gemeente Amsterdam
9
5
  */
10
6
  import type { LabelHTMLAttributes, PropsWithChildren } from 'react';
11
- import { HintProps } from '../Hint';
12
- export type LabelProps = HintProps & PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>>;
7
+ import type { HintProps } from '../Hint';
8
+ export type LabelProps = {
9
+ /**
10
+ * Render a level 1 heading around the label.
11
+ * Set this if the Field is the only content of the page.
12
+ */
13
+ isPageHeading?: boolean;
14
+ } & HintProps & PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>>;
13
15
  /**
14
16
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-label--docs Label docs at Amsterdam Design System}
15
17
  */
16
18
  export declare const Label: import("react").ForwardRefExoticComponent<{
19
+ /**
20
+ * Render a level 1 heading around the label.
21
+ * Set this if the Field is the only content of the page.
22
+ */
23
+ isPageHeading?: boolean;
24
+ } & {
17
25
  hint?: string;
18
26
  optional?: boolean;
19
27
  } & import("react").HTMLAttributes<HTMLElement> & {
@@ -5,7 +5,8 @@ import { Hint } from '../Hint';
5
5
  /**
6
6
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-label--docs Label docs at Amsterdam Design System}
7
7
  */
8
- export const Label = forwardRef(({ children, className, hint, optional, ...restProps }, ref) => {
9
- return (_jsxs("label", { ...restProps, className: clsx('ams-label', className), ref: ref, children: [children, " ", _jsx(Hint, { hint: hint, optional: optional })] }));
8
+ export const Label = forwardRef(({ children, className, hint, isPageHeading, optional, ...restProps }, ref) => {
9
+ const labelElement = (_jsxs("label", { ...restProps, className: clsx('ams-label', className), ref: ref, children: [children, " ", _jsx(Hint, { hint: hint, optional: optional })] }));
10
+ return isPageHeading ? _jsx("h1", { className: "ams-label__heading", children: labelElement }) : labelElement;
10
11
  });
11
12
  Label.displayName = 'Label';
@@ -74,4 +74,9 @@ describe('Label', () => {
74
74
  const label = container.querySelector('label:only-child');
75
75
  expect(label).toHaveTextContent('Label (required)');
76
76
  });
77
+ it('renders a Heading component', () => {
78
+ render(_jsx(Label, { isPageHeading: true, children: "Label" }));
79
+ const heading = screen.getByRole('heading', { name: 'Label' });
80
+ expect(heading).toBeInTheDocument();
81
+ });
77
82
  });
@@ -3,14 +3,14 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
  import type { AnchorHTMLAttributes } from 'react';
6
- export type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'> & {
6
+ export type LinkProps = {
7
7
  /** Changes the text colour for readability on a light or dark background. */
8
8
  color?: 'contrast' | 'inverse';
9
- };
9
+ } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'placeholder'>;
10
10
  /**
11
11
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-navigation-link--docs Link docs at Amsterdam Design System}
12
12
  */
13
- export declare const Link: import("react").ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & {
13
+ export declare const Link: import("react").ForwardRefExoticComponent<{
14
14
  /** Changes the text colour for readability on a light or dark background. */
15
15
  color?: "contrast" | "inverse";
16
- } & import("react").RefAttributes<HTMLAnchorElement>>;
16
+ } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "placeholder"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -4,9 +4,13 @@
4
4
  */
5
5
  import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
6
  import type { IconProps } from '../Icon';
7
+ export declare const linkListLinkColors: readonly ["contrast", "inverse"];
8
+ type LinkListLinkColor = (typeof linkListLinkColors)[number];
9
+ export declare const linkListLinkSizes: readonly ["small", "large"];
10
+ type LinkListLinkSize = (typeof linkListLinkSizes)[number];
7
11
  export type LinkListLinkProps = {
8
12
  /** Changes the text colour for readability on a light or dark background. */
9
- color?: 'contrast' | 'inverse';
13
+ color?: LinkListLinkColor;
10
14
  /**
11
15
  * An icon to display instead of the default chevron.
12
16
  * Don’t mix custom icons with chevrons in one list.
@@ -14,12 +18,12 @@ export type LinkListLinkProps = {
14
18
  */
15
19
  icon?: IconProps['svg'];
16
20
  /** The size of the text. Use the same size for all items in the list. */
17
- size?: 'small' | 'large';
21
+ size?: LinkListLinkSize;
18
22
  } & PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>>;
19
23
  /** One link with a Link List. */
20
24
  export declare const LinkListLink: import("react").ForwardRefExoticComponent<{
21
25
  /** Changes the text colour for readability on a light or dark background. */
22
- color?: "contrast" | "inverse";
26
+ color?: LinkListLinkColor;
23
27
  /**
24
28
  * An icon to display instead of the default chevron.
25
29
  * Don’t mix custom icons with chevrons in one list.
@@ -27,7 +31,8 @@ export declare const LinkListLink: import("react").ForwardRefExoticComponent<{
27
31
  */
28
32
  icon?: IconProps["svg"];
29
33
  /** The size of the text. Use the same size for all items in the list. */
30
- size?: "small" | "large";
34
+ size?: LinkListLinkSize;
31
35
  } & AnchorHTMLAttributes<HTMLAnchorElement> & {
32
36
  children?: import("react").ReactNode | undefined;
33
37
  } & import("react").RefAttributes<HTMLAnchorElement>>;
38
+ export {};
@@ -3,6 +3,8 @@ import { ChevronForwardIcon } from '@amsterdam/design-system-react-icons';
3
3
  import { clsx } from 'clsx';
4
4
  import { forwardRef } from 'react';
5
5
  import { Icon } from '../Icon';
6
+ export const linkListLinkColors = ['contrast', 'inverse'];
7
+ export const linkListLinkSizes = ['small', 'large'];
6
8
  /** One link with a Link List. */
7
9
  export const LinkListLink = forwardRef(({ children, className, color, icon = ChevronForwardIcon, size, ...restProps }, ref) => {
8
10
  return (_jsx("li", { children: _jsxs("a", { className: clsx('ams-link-list__link', color && `ams-link-list__link--${color}`, size && `ams-link-list__link--${size}`, className), ref: ref, ...restProps, children: [_jsx(Icon, { size: size, svg: icon }), children] }) }));
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
6
6
  export type LogoBrand = 'amsterdam' | 'ggd-amsterdam' | 'museum-weesp' | 'stadsarchief' | 'stadsbank-van-lening' | 'vga-verzekeringen';
7
- export type LogoProps = SVGProps<SVGSVGElement> & {
7
+ export type LogoProps = {
8
8
  /** The name of the brand for which to display the logo. */
9
9
  brand?: LogoBrand;
10
- };
10
+ } & SVGProps<SVGSVGElement>;
11
11
  /**
12
12
  * @see {@link https://designsystem.amsterdam/?path=/docs/components-media-logo--docs Logo docs at Amsterdam Design System}
13
13
  */