@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.
- package/dist/Accordion/Accordion.d.ts +7 -7
- package/dist/Accordion/Accordion.js +2 -6
- package/dist/Accordion/Accordion.test.js +4 -4
- package/dist/Accordion/AccordionContext.d.ts +1 -2
- package/dist/Accordion/AccordionContext.js +3 -2
- package/dist/Accordion/AccordionSection.d.ts +5 -5
- package/dist/Accordion/AccordionSection.js +6 -9
- package/dist/Accordion/AccordionSection.test.js +18 -5
- package/dist/ActionGroup/ActionGroup.js +1 -5
- package/dist/Alert/Alert.d.ts +16 -4
- package/dist/Alert/Alert.js +3 -7
- package/dist/Alert/Alert.test.js +24 -13
- package/dist/Avatar/Avatar.js +1 -5
- package/dist/Avatar/Avatar.test.js +2 -1
- package/dist/Badge/Badge.d.ts +4 -4
- package/dist/Badge/Badge.js +1 -5
- package/dist/Blockquote/Blockquote.d.ts +5 -5
- package/dist/Blockquote/Blockquote.js +1 -5
- package/dist/Breadcrumb/Breadcrumb.js +0 -4
- package/dist/Breadcrumb/Breadcrumb.test.js +1 -1
- package/dist/Breadcrumb/BreadcrumbLink.js +0 -4
- package/dist/Breakout/Breakout.js +2 -6
- package/dist/Breakout/Breakout.test.js +1 -1
- package/dist/Breakout/BreakoutCell.d.ts +3 -3
- package/dist/Breakout/BreakoutCell.js +1 -5
- package/dist/Breakout/BreakoutCell.test.js +2 -2
- package/dist/Button/Button.d.ts +4 -4
- package/dist/Button/Button.js +1 -5
- package/dist/CallToActionLink/CallToActionLink.d.ts +12 -0
- package/dist/CallToActionLink/CallToActionLink.js +8 -0
- package/dist/CallToActionLink/CallToActionLink.test.d.ts +5 -0
- package/dist/CallToActionLink/CallToActionLink.test.js +33 -0
- package/dist/CallToActionLink/index.d.ts +6 -0
- package/dist/CallToActionLink/index.js +5 -0
- package/dist/Card/Card.d.ts +8 -8
- package/dist/Card/Card.js +1 -5
- package/dist/Card/CardHeading.d.ts +3 -3
- package/dist/Card/CardHeading.js +2 -6
- package/dist/Card/CardHeading.test.js +1 -1
- package/dist/Card/CardHeadingGroup.d.ts +5 -5
- package/dist/Card/CardHeadingGroup.js +1 -5
- package/dist/Card/CardImage.d.ts +2 -2
- package/dist/Card/CardImage.js +1 -5
- package/dist/Card/CardLink.js +1 -5
- package/dist/CharacterCount/CharacterCount.d.ts +4 -4
- package/dist/CharacterCount/CharacterCount.js +1 -5
- package/dist/Checkbox/Checkbox.d.ts +15 -9
- package/dist/Checkbox/Checkbox.js +4 -8
- package/dist/Checkbox/Checkbox.test.js +9 -0
- package/dist/Column/Column.d.ts +5 -5
- package/dist/Column/Column.js +1 -5
- package/dist/Column/Column.test.js +1 -1
- package/dist/DateInput/DateInput.d.ts +4 -4
- package/dist/DateInput/DateInput.js +1 -5
- package/dist/DescriptionList/DescriptionList.d.ts +5 -5
- package/dist/DescriptionList/DescriptionList.js +1 -5
- package/dist/DescriptionList/DescriptionListDescription.js +1 -5
- package/dist/DescriptionList/DescriptionListSection.js +1 -5
- package/dist/DescriptionList/DescriptionListTerm.js +1 -5
- package/dist/DescriptionList/index.d.ts +1 -1
- package/dist/Dialog/Dialog.d.ts +6 -6
- package/dist/Dialog/Dialog.js +2 -6
- package/dist/ErrorMessage/ErrorMessage.d.ts +11 -4
- package/dist/ErrorMessage/ErrorMessage.js +2 -6
- package/dist/Field/Field.d.ts +5 -5
- package/dist/Field/Field.js +1 -5
- package/dist/FieldSet/FieldSet.d.ts +7 -7
- package/dist/FieldSet/FieldSet.js +1 -5
- package/dist/Figure/Figure.d.ts +3 -3
- package/dist/Figure/Figure.js +1 -5
- package/dist/Figure/FigureCaption.d.ts +5 -5
- package/dist/Figure/FigureCaption.js +1 -5
- package/dist/FileInput/FileInput.js +1 -5
- package/dist/FileList/FileList.d.ts +3 -3
- package/dist/FileList/FileList.js +1 -5
- package/dist/FileList/FileListItem.d.ts +4 -4
- package/dist/FileList/FileListItem.js +2 -6
- package/dist/Grid/Grid.d.ts +2 -2
- package/dist/Grid/Grid.js +1 -5
- package/dist/Grid/Grid.test.js +1 -1
- package/dist/Grid/GridCell.d.ts +2 -2
- package/dist/Grid/GridCell.js +1 -5
- package/dist/Grid/GridCell.test.js +1 -1
- package/dist/Heading/Heading.d.ts +18 -7
- package/dist/Heading/Heading.js +1 -10
- package/dist/Heading/Heading.test.js +1 -3
- package/dist/Hint/Hint.d.ts +3 -3
- package/dist/Hint/Hint.js +1 -5
- package/dist/Icon/Icon.d.ts +15 -3
- package/dist/Icon/Icon.js +14 -13
- package/dist/Icon/Icon.test.js +5 -0
- package/dist/IconButton/IconButton.js +1 -5
- package/dist/Image/Image.d.ts +4 -4
- package/dist/Image/Image.js +2 -6
- package/dist/Image/Image.test.js +2 -2
- package/dist/Image/index.d.ts +1 -1
- package/dist/Image/index.js +1 -1
- package/dist/ImageSlider/ImageSlider.d.ts +3 -3
- package/dist/ImageSlider/ImageSlider.js +2 -6
- package/dist/ImageSlider/ImageSliderControls.js +2 -6
- package/dist/ImageSlider/ImageSliderItem.d.ts +5 -5
- package/dist/ImageSlider/ImageSliderItem.js +1 -5
- package/dist/ImageSlider/ImageSliderScroller.js +1 -5
- package/dist/ImageSlider/ImageSliderThumbnails.d.ts +4 -4
- package/dist/ImageSlider/ImageSliderThumbnails.js +2 -6
- package/dist/InvalidFormAlert/InvalidFormAlert.d.ts +4 -4
- package/dist/InvalidFormAlert/InvalidFormAlert.js +0 -4
- package/dist/InvalidFormAlert/InvalidFormAlertWithErrors.js +5 -6
- package/dist/Label/Label.d.ts +10 -5
- package/dist/Label/Label.js +1 -10
- package/dist/Link/Link.d.ts +4 -4
- package/dist/Link/Link.js +1 -5
- package/dist/LinkList/LinkList.d.ts +1 -1
- package/dist/LinkList/LinkList.js +1 -5
- package/dist/LinkList/LinkListLink.d.ts +13 -4
- package/dist/LinkList/LinkListLink.js +3 -7
- package/dist/LinkList/LinkListLink.test.js +1 -1
- package/dist/Logo/Logo.d.ts +2 -2
- package/dist/Logo/Logo.js +1 -5
- package/dist/Logo/brand/LogoAmsterdam.js +2 -5
- package/dist/Logo/brand/LogoGgdAmsterdam.js +2 -5
- package/dist/Logo/brand/LogoMuseumWeesp.js +2 -5
- package/dist/Logo/brand/LogoStadsarchief.js +2 -5
- package/dist/Logo/brand/LogoStadsbankVanLening.js +2 -5
- package/dist/Logo/brand/LogoVgaVerzekeringen.js +2 -5
- package/dist/Logo/index.d.ts +1 -1
- package/dist/Mark/Mark.js +1 -5
- package/dist/Menu/Menu.d.ts +28 -0
- package/dist/Menu/Menu.js +10 -0
- package/dist/Menu/Menu.test.d.ts +5 -0
- package/dist/Menu/Menu.test.js +38 -0
- package/dist/Menu/MenuLink.d.ts +20 -0
- package/dist/Menu/MenuLink.js +8 -0
- package/dist/Menu/MenuLink.test.d.ts +5 -0
- package/dist/Menu/MenuLink.test.js +56 -0
- package/dist/Menu/index.d.ts +7 -0
- package/dist/Menu/index.js +5 -0
- package/dist/OrderedList/OrderedList.d.ts +5 -5
- package/dist/OrderedList/OrderedList.js +1 -5
- package/dist/OrderedList/OrderedList.test.js +1 -1
- package/dist/OrderedList/OrderedListItem.js +1 -5
- package/dist/Overlap/Overlap.js +1 -5
- package/dist/Page/Page.js +1 -5
- package/dist/PageFooter/PageFooter.js +1 -5
- package/dist/PageFooter/PageFooterMenu.js +1 -5
- package/dist/PageFooter/PageFooterMenuLink.js +1 -5
- package/dist/PageFooter/PageFooterSpotlight.js +1 -5
- package/dist/PageHeader/PageHeader.d.ts +7 -7
- package/dist/PageHeader/PageHeader.js +3 -7
- package/dist/PageHeader/PageHeader.test.js +1 -1
- package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +1 -1
- package/dist/PageHeader/PageHeaderMenuLink.d.ts +5 -5
- package/dist/PageHeader/PageHeaderMenuLink.js +1 -1
- package/dist/PageHeading/PageHeading.d.ts +6 -5
- package/dist/PageHeading/PageHeading.js +2 -5
- package/dist/Pagination/Pagination.d.ts +52 -10
- package/dist/Pagination/Pagination.js +5 -9
- package/dist/Pagination/Pagination.test.js +23 -10
- package/dist/Pagination/getRange.js +4 -2
- package/dist/Paragraph/Paragraph.d.ts +10 -5
- package/dist/Paragraph/Paragraph.js +1 -10
- package/dist/PasswordInput/PasswordInput.d.ts +4 -4
- package/dist/PasswordInput/PasswordInput.js +1 -5
- package/dist/PasswordInput/PasswordInput.test.js +1 -1
- package/dist/Radio/Radio.d.ts +15 -9
- package/dist/Radio/Radio.js +4 -8
- package/dist/Radio/Radio.test.js +9 -0
- package/dist/Row/Row.d.ts +5 -5
- package/dist/Row/Row.js +1 -5
- package/dist/Row/Row.test.js +1 -1
- package/dist/SearchField/SearchField.d.ts +3 -5
- package/dist/SearchField/SearchField.js +1 -5
- package/dist/SearchField/SearchFieldButton.js +0 -4
- package/dist/SearchField/SearchFieldInput.d.ts +2 -2
- package/dist/SearchField/SearchFieldInput.js +1 -5
- package/dist/Select/Select.d.ts +5 -5
- package/dist/Select/Select.js +1 -5
- package/dist/Select/SelectOption.js +1 -5
- package/dist/Select/SelectOptionGroup.js +1 -5
- package/dist/SkipLink/SkipLink.js +1 -5
- package/dist/Spotlight/Spotlight.d.ts +5 -5
- package/dist/Spotlight/Spotlight.js +1 -1
- package/dist/Spotlight/Spotlight.test.js +1 -1
- package/dist/StandaloneLink/StandaloneLink.d.ts +15 -8
- package/dist/StandaloneLink/StandaloneLink.js +4 -6
- package/dist/StandaloneLink/StandaloneLink.test.js +6 -4
- package/dist/Switch/Switch.js +1 -5
- package/dist/Table/Table.js +1 -5
- package/dist/Table/TableBody.js +1 -5
- package/dist/Table/TableCaption.d.ts +5 -0
- package/dist/Table/TableCaption.js +1 -10
- package/dist/Table/TableCell.js +1 -5
- package/dist/Table/TableFooter.js +1 -5
- package/dist/Table/TableHeader.js +1 -5
- package/dist/Table/TableHeaderCell.js +1 -5
- package/dist/Table/TableRow.js +1 -5
- package/dist/TableOfContents/TableOfContents.d.ts +9 -9
- package/dist/TableOfContents/TableOfContents.js +4 -7
- package/dist/TableOfContents/TableOfContentsLink.d.ts +4 -4
- package/dist/TableOfContents/TableOfContentsLink.js +0 -4
- package/dist/TableOfContents/TableOfContentsList.js +1 -5
- package/dist/TableOfContents/TableOfContentsList.test.js +1 -1
- package/dist/Tabs/Tabs.d.ts +11 -11
- package/dist/Tabs/Tabs.js +1 -5
- package/dist/Tabs/TabsButton.d.ts +5 -5
- package/dist/Tabs/TabsButton.js +1 -5
- package/dist/Tabs/TabsList.js +1 -5
- package/dist/Tabs/TabsPanel.d.ts +5 -5
- package/dist/Tabs/TabsPanel.js +1 -5
- package/dist/Tabs/index.d.ts +2 -2
- package/dist/TextArea/TextArea.d.ts +4 -4
- package/dist/TextArea/TextArea.js +1 -5
- package/dist/TextInput/TextInput.d.ts +4 -4
- package/dist/TextInput/TextInput.js +1 -5
- package/dist/TimeInput/TimeInput.d.ts +4 -4
- package/dist/TimeInput/TimeInput.js +1 -5
- package/dist/UnorderedList/UnorderedList.d.ts +5 -5
- package/dist/UnorderedList/UnorderedList.js +1 -5
- package/dist/UnorderedList/UnorderedList.test.js +1 -1
- package/dist/UnorderedList/UnorderedListItem.js +1 -5
- package/dist/common/formatFileType.d.ts +1 -1
- package/dist/common/formatFileType.js +10 -10
- package/dist/common/useKeyboardFocus.js +6 -6
- package/dist/common/useKeyboardFocus.test.js +2 -6
- package/dist/index.cjs.js +731 -619
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +394 -267
- package/dist/index.esm.js +633 -523
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -23
package/dist/Field/Field.d.ts
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
-
export type FieldProps = {
|
|
6
|
+
export type FieldProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
|
|
7
7
|
/** Whether the field has an input with a validation error */
|
|
8
8
|
invalid?: boolean;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
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<{
|
|
13
|
+
export declare const Field: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
children?: import("react").ReactNode | undefined;
|
|
15
|
+
} & {
|
|
14
16
|
/** Whether the field has an input with a validation error */
|
|
15
17
|
invalid?: boolean;
|
|
16
|
-
} & HTMLAttributes<HTMLDivElement> & {
|
|
17
|
-
children?: import("react").ReactNode | undefined;
|
|
18
18
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/Field/Field.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
|
/**
|
|
9
5
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field--docs Field docs at Amsterdam Design System}
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
6
|
import { HintProps } from '../Hint';
|
|
7
|
-
export type FieldSetProps = PropsWithChildren<HTMLAttributes<HTMLFieldSetElement>> & {
|
|
7
|
+
export type FieldSetProps = HintProps & PropsWithChildren<HTMLAttributes<HTMLFieldSetElement>> & {
|
|
8
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
13
|
/**
|
|
14
14
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-field-set--docs Field Set docs at Amsterdam Design System}
|
|
15
15
|
*/
|
|
16
|
-
export declare const FieldSet: import("react").ForwardRefExoticComponent<
|
|
16
|
+
export declare const FieldSet: import("react").ForwardRefExoticComponent<{
|
|
17
|
+
hint?: string;
|
|
18
|
+
optional?: boolean;
|
|
19
|
+
} & HTMLAttributes<HTMLElement> & {
|
|
17
20
|
children?: import("react").ReactNode | undefined;
|
|
18
|
-
} & {
|
|
21
|
+
} & HTMLAttributes<HTMLFieldSetElement> & {
|
|
19
22
|
/** Whether the field set has an input with a validation error */
|
|
20
23
|
invalid?: boolean;
|
|
21
24
|
/** The text for the caption. */
|
|
22
25
|
legend: string;
|
|
23
|
-
} & HTMLAttributes<HTMLElement> & {
|
|
24
|
-
hint?: string;
|
|
25
|
-
optional?: boolean;
|
|
26
26
|
} & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
@@ -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 } from 'react';
|
|
8
4
|
import { Hint } from '../Hint';
|
|
9
5
|
/**
|
package/dist/Figure/Figure.d.ts
CHANGED
|
@@ -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<{
|
|
14
|
-
color?: "inverse";
|
|
15
|
-
} & HTMLAttributes<HTMLElement> & {
|
|
13
|
+
Caption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
16
14
|
children?: import("react").ReactNode | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
color?: "inverse";
|
|
17
17
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
18
18
|
};
|
package/dist/Figure/Figure.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
|
import { FigureCaption } from './FigureCaption';
|
|
9
5
|
const FigureRoot = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("figure", { ...restProps, className: clsx('ams-figure', className), ref: ref, children: children })));
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
-
export type FigureCaptionProps = {
|
|
6
|
+
export type FigureCaptionProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
|
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<{
|
|
9
|
+
};
|
|
10
|
+
export declare const FigureCaption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
11
|
+
children?: import("react").ReactNode | undefined;
|
|
12
|
+
} & {
|
|
11
13
|
/** Changes the text colour for readability on a dark background. */
|
|
12
14
|
color?: "inverse";
|
|
13
|
-
} & HTMLAttributes<HTMLElement> & {
|
|
14
|
-
children?: import("react").ReactNode | undefined;
|
|
15
15
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -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 FigureCaption = forwardRef(({ children, className, color, ...restProps }, ref) => (_jsx("figcaption", { ...restProps, className: clsx('ams-figure__caption', color && `ams-figure__caption--${color}`, className), ref: ref, children: children })));
|
|
9
5
|
FigureCaption.displayName = 'Figure.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
|
/**
|
|
9
5
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-file-input--docs File Input docs at Amsterdam Design System}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
|
6
|
-
export type FileListProps =
|
|
6
|
+
export type FileListProps = PropsWithChildren<HTMLAttributes<HTMLUListElement>>;
|
|
7
7
|
export declare const FileListRoot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & {
|
|
8
8
|
children?: import("react").ReactNode | undefined;
|
|
9
9
|
} & import("react").RefAttributes<HTMLOListElement>>;
|
|
@@ -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<{
|
|
16
|
+
Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
|
|
17
17
|
file: File;
|
|
18
18
|
onDelete?: () => void;
|
|
19
|
-
} &
|
|
19
|
+
} & import("react").RefAttributes<HTMLLIElement>>;
|
|
20
20
|
};
|
|
@@ -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 { FileListItem } from './FileListItem';
|
|
9
5
|
export const FileListRoot = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("ul", { ...restProps, className: clsx('ams-file-list', className), ref: ref, children: children })));
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAttributes } from 'react';
|
|
6
|
-
export type FileListItemProps = {
|
|
6
|
+
export type FileListItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
7
7
|
file: File;
|
|
8
8
|
onDelete?: () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const FileListItem: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
};
|
|
10
|
+
export declare const FileListItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
|
|
11
11
|
file: File;
|
|
12
12
|
onDelete?: () => void;
|
|
13
|
-
} &
|
|
13
|
+
} & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -1,14 +1,10 @@
|
|
|
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 { DocumentIcon } from '@amsterdam/design-system-react-icons';
|
|
7
|
-
import clsx from 'clsx';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
8
4
|
import { forwardRef } from 'react';
|
|
9
5
|
import { Button } from '../Button';
|
|
10
|
-
import { Icon } from '../Icon';
|
|
11
6
|
import { formatFileSize } from '../common/formatFileSize';
|
|
12
7
|
import { formatFileType } from '../common/formatFileType';
|
|
8
|
+
import { Icon } from '../Icon';
|
|
13
9
|
export const FileListItem = forwardRef(({ className, file, onDelete, ...restProps }, ref) => (_jsxs("li", { ...restProps, className: clsx('ams-file-list__item', className), ref: ref, children: [_jsx("div", { className: "ams-file-list__item-preview", children: file.type.startsWith('image/') ? (_jsx("img", { alt: file.name, src: URL.createObjectURL(file) })) : (_jsx(Icon, { size: "heading-3", square: true, svg: DocumentIcon })) }), _jsxs("div", { className: "ams-file-list__item-info", children: [file.name, _jsxs("div", { className: "ams-file-input__item-details", children: ["(", formatFileType(file.type), ", ", formatFileSize(file.size), ")"] })] }), onDelete && (_jsx("div", { children: _jsx(Button, { onClick: () => onDelete(), variant: "tertiary", children: "Verwijder" }) }))] })));
|
|
14
10
|
FileListItem.displayName = 'FileList.Item';
|
package/dist/Grid/Grid.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ type GridPaddingTopAndBottomProps = {
|
|
|
28
28
|
paddingTop?: GridPadding;
|
|
29
29
|
paddingVertical?: never;
|
|
30
30
|
};
|
|
31
|
-
export type GridProps = {
|
|
31
|
+
export type GridProps = (GridPaddingVerticalProp | GridPaddingTopAndBottomProps) & PropsWithChildren<HTMLAttributes<HTMLDivElement>> & {
|
|
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
|
+
};
|
|
37
37
|
/**
|
|
38
38
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-layout-grid--docs Grid docs at Amsterdam Design System}
|
|
39
39
|
*/
|
package/dist/Grid/Grid.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
|
import { GridCell } from './GridCell';
|
|
9
5
|
import { paddingClasses } from './paddingClasses';
|
package/dist/Grid/Grid.test.js
CHANGED
|
@@ -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 { Grid, gridGaps, gridPaddings, gridTags } from './Grid';
|
|
9
8
|
import { ariaRoleForTag } from '../common/accessibility';
|
|
9
|
+
import { Grid, gridGaps, gridPaddings, gridTags } from './Grid';
|
|
10
10
|
import '@testing-library/jest-dom';
|
|
11
11
|
describe('Grid', () => {
|
|
12
12
|
it('renders', () => {
|
package/dist/Grid/GridCell.d.ts
CHANGED
|
@@ -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 = {
|
|
20
|
+
export type GridCellProps = (GridCellSpanAllProp | GridCellSpanAndStartProps) & PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
|
21
21
|
/** The HTML tag to use. */
|
|
22
22
|
as?: GridCellTag;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
export declare const GridCell: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<unknown>>;
|
|
25
25
|
export {};
|
package/dist/Grid/GridCell.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
|
import { gridCellClasses } from './gridCellClasses';
|
|
9
5
|
export const gridCellTags = ['article', 'aside', 'div', 'footer', 'header', 'main', 'nav', 'section'];
|
|
@@ -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 { ariaRoleForTag } from '../common/accessibility';
|
|
8
9
|
import { Grid } from './Grid';
|
|
9
10
|
import { gridCellTags } from './GridCell';
|
|
10
|
-
import { ariaRoleForTag } from '../common/accessibility';
|
|
11
11
|
import '@testing-library/jest-dom';
|
|
12
12
|
describe('Grid cell', () => {
|
|
13
13
|
it('renders', () => {
|
|
@@ -2,25 +2,36 @@
|
|
|
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 HeadingProps = {
|
|
11
|
+
export type HeadingProps = PropsWithChildren<HTMLAttributes<HTMLHeadingElement>> & {
|
|
7
12
|
/** Changes the text colour for readability on a dark background. */
|
|
8
13
|
color?: 'inverse';
|
|
9
14
|
/** The hierarchical level within the document. */
|
|
10
15
|
level: 1 | 2 | 3 | 4;
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Uses larger or smaller text without changing its position in the heading hierarchy.
|
|
18
|
+
* The value ‘level-6’ is deprecated. Use level 5 instead.
|
|
19
|
+
*/
|
|
12
20
|
size?: 'level-1' | 'level-2' | 'level-3' | 'level-4' | 'level-5' | 'level-6';
|
|
13
|
-
}
|
|
21
|
+
};
|
|
14
22
|
/**
|
|
15
23
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-text-heading--docs Heading docs at Amsterdam Design System}
|
|
16
24
|
*/
|
|
17
|
-
export declare const Heading: import("react").ForwardRefExoticComponent<{
|
|
25
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
|
|
26
|
+
children?: import("react").ReactNode | undefined;
|
|
27
|
+
} & {
|
|
18
28
|
/** Changes the text colour for readability on a dark background. */
|
|
19
29
|
color?: "inverse";
|
|
20
30
|
/** The hierarchical level within the document. */
|
|
21
31
|
level: 1 | 2 | 3 | 4;
|
|
22
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Uses larger or smaller text without changing its position in the heading hierarchy.
|
|
34
|
+
* The value ‘level-6’ is deprecated. Use level 5 instead.
|
|
35
|
+
*/
|
|
23
36
|
size?: "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6";
|
|
24
|
-
} & HTMLAttributes<HTMLHeadingElement> & {
|
|
25
|
-
children?: import("react").ReactNode | undefined;
|
|
26
37
|
} & import("react").RefAttributes<HTMLHeadingElement>>;
|
package/dist/Heading/Heading.js
CHANGED
|
@@ -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
|
import { getHeadingTag } from './getHeadingTag';
|
|
14
5
|
/**
|
|
@@ -38,19 +38,17 @@ describe('Heading', () => {
|
|
|
38
38
|
expect(h4).toBeInTheDocument();
|
|
39
39
|
});
|
|
40
40
|
it('renders the correct size level class', () => {
|
|
41
|
-
render(_jsxs(_Fragment, { children: [_jsx(Heading, { level: 1, size: "level-1", children: "Size level 1" }), _jsx(Heading, { level: 1, size: "level-2", children: "Size level 2" }), _jsx(Heading, { level: 1, size: "level-3", children: "Size level 3" }), _jsx(Heading, { level: 1, size: "level-4", children: "Size level 4" }), _jsx(Heading, { level: 1, size: "level-5", children: "Size level 5" })
|
|
41
|
+
render(_jsxs(_Fragment, { children: [_jsx(Heading, { level: 1, size: "level-1", children: "Size level 1" }), _jsx(Heading, { level: 1, size: "level-2", children: "Size level 2" }), _jsx(Heading, { level: 1, size: "level-3", children: "Size level 3" }), _jsx(Heading, { level: 1, size: "level-4", children: "Size level 4" }), _jsx(Heading, { level: 1, size: "level-5", children: "Size level 5" })] }));
|
|
42
42
|
const sizeLevel1 = screen.getByRole('heading', { level: 1, name: 'Size level 1' });
|
|
43
43
|
const sizeLevel2 = screen.getByRole('heading', { level: 1, name: 'Size level 2' });
|
|
44
44
|
const sizeLevel3 = screen.getByRole('heading', { level: 1, name: 'Size level 3' });
|
|
45
45
|
const sizeLevel4 = screen.getByRole('heading', { level: 1, name: 'Size level 4' });
|
|
46
46
|
const sizeLevel5 = screen.getByRole('heading', { level: 1, name: 'Size level 5' });
|
|
47
|
-
const sizeLevel6 = screen.getByRole('heading', { level: 1, name: 'Size level 6' });
|
|
48
47
|
expect(sizeLevel1).toHaveClass('ams-heading--1');
|
|
49
48
|
expect(sizeLevel2).toHaveClass('ams-heading--2');
|
|
50
49
|
expect(sizeLevel3).toHaveClass('ams-heading--3');
|
|
51
50
|
expect(sizeLevel4).toHaveClass('ams-heading--4');
|
|
52
51
|
expect(sizeLevel5).toHaveClass('ams-heading--5');
|
|
53
|
-
expect(sizeLevel6).toHaveClass('ams-heading--6');
|
|
54
52
|
});
|
|
55
53
|
it('renders the class name for inverse color', () => {
|
|
56
54
|
render(_jsx(Heading, { color: "inverse", level: 1, children: "Heading" }));
|
package/dist/Hint/Hint.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ type HintAndOptionalProps = {
|
|
|
9
9
|
/** Appends the text '(niet verplicht)' to the label or legend if no hint is provided. Use when the associated inputs are optional. */
|
|
10
10
|
optional?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export type HintProps = PropsWithChildren<HTMLAttributes<HTMLElement
|
|
13
|
-
export declare const Hint: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
12
|
+
export type HintProps = HintAndOptionalProps & PropsWithChildren<HTMLAttributes<HTMLElement>>;
|
|
13
|
+
export declare const Hint: import("react").ForwardRefExoticComponent<HintAndOptionalProps & HTMLAttributes<HTMLElement> & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
|
-
} &
|
|
15
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
16
16
|
export {};
|
package/dist/Hint/Hint.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { 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';
|
|
8
4
|
const getHintText = ({ hint, optional }) => {
|
|
9
5
|
if (hint) {
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
* @license EUPL-1.2+
|
|
3
3
|
* Copyright Gemeente Amsterdam
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license EUPL-1.2+
|
|
7
|
+
* Copyright (c) 2021 Gemeente Utrecht
|
|
8
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
9
|
+
* Copyright Gemeente Amsterdam
|
|
10
|
+
*/
|
|
5
11
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
6
|
-
export declare const iconSizes: readonly ["small", "large", "heading-3", "heading-4", "heading-5", "heading-6"];
|
|
12
|
+
export declare const iconSizes: readonly ["small", "large", "heading-0", "heading-1", "heading-2", "heading-3", "heading-4", "heading-5", "heading-6"];
|
|
7
13
|
type IconSize = (typeof iconSizes)[number];
|
|
8
14
|
export type IconProps = {
|
|
9
15
|
/** Changes the icon colour for readability on a dark background. */
|
|
10
16
|
color?: 'inverse';
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The size of the icon. Choose the size of the corresponding body text or heading.
|
|
19
|
+
* The values ‘heading-0’ and ‘heading-6’ are deprecated.
|
|
20
|
+
*/
|
|
12
21
|
size?: IconSize;
|
|
13
22
|
/** Whether the icon container should be made square. */
|
|
14
23
|
square?: boolean;
|
|
@@ -22,7 +31,10 @@ export type IconProps = {
|
|
|
22
31
|
export declare const Icon: import("react").ForwardRefExoticComponent<{
|
|
23
32
|
/** Changes the icon colour for readability on a dark background. */
|
|
24
33
|
color?: "inverse";
|
|
25
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The size of the icon. Choose the size of the corresponding body text or heading.
|
|
36
|
+
* The values ‘heading-0’ and ‘heading-6’ are deprecated.
|
|
37
|
+
*/
|
|
26
38
|
size?: IconSize;
|
|
27
39
|
/** Whether the icon container should be made square. */
|
|
28
40
|
square?: boolean;
|
package/dist/Icon/Icon.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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 Gemeente Utrecht
|
|
9
|
-
* Copyright (c) 2021 Robbert Broersma
|
|
10
|
-
* Copyright Gemeente Amsterdam
|
|
11
|
-
*/
|
|
12
|
-
import clsx from 'clsx';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
13
3
|
import { forwardRef } from 'react';
|
|
14
|
-
export const iconSizes = [
|
|
4
|
+
export const iconSizes = [
|
|
5
|
+
'small',
|
|
6
|
+
'large',
|
|
7
|
+
'heading-0', // Deprecated
|
|
8
|
+
'heading-1',
|
|
9
|
+
'heading-2',
|
|
10
|
+
'heading-3',
|
|
11
|
+
'heading-4',
|
|
12
|
+
'heading-5',
|
|
13
|
+
'heading-6', // Deprecated
|
|
14
|
+
];
|
|
15
15
|
/**
|
|
16
16
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-media-icon--docs Icon docs at Amsterdam Design System}
|
|
17
17
|
* @see {@link https://designsystem.amsterdam/?path=/docs/brand-assets-icons--docs Icons overview at Amsterdam Design System}
|
|
18
18
|
*/
|
|
19
|
-
export const Icon = forwardRef(({ className, color, size, square, svg, ...restProps }, ref) => (_jsx("span", { className: clsx('ams-icon', color && `ams-icon--${color}`, size && `ams-icon--${size}`, square && 'ams-icon--square', className),
|
|
19
|
+
export const Icon = forwardRef(({ className, color, size, square, svg, ...restProps }, ref) => (_jsx("span", { className: clsx('ams-icon', color && `ams-icon--${color}`, size && `ams-icon--${size}`, square && 'ams-icon--square', className), hidden // The icon is only shown when the CSS loads, so we hide it by default.
|
|
20
|
+
: true, ref: ref, ...restProps, children: typeof svg === 'function' ? svg() : svg })));
|
|
20
21
|
Icon.displayName = 'Icon';
|
package/dist/Icon/Icon.test.js
CHANGED
|
@@ -14,6 +14,11 @@ describe('Icon', () => {
|
|
|
14
14
|
const icon = container.querySelector('span:only-child');
|
|
15
15
|
expect(icon).toBeInTheDocument();
|
|
16
16
|
});
|
|
17
|
+
it('renders with a React node for the svg prop', () => {
|
|
18
|
+
const { container } = render(_jsx(Icon, { svg: _jsx(WarningIcon, {}) }));
|
|
19
|
+
const icon = container.querySelector('span:only-child');
|
|
20
|
+
expect(icon).toBeInTheDocument();
|
|
21
|
+
});
|
|
17
22
|
it('renders a design system BEM class name', () => {
|
|
18
23
|
const { container } = render(_jsx(Icon, { svg: WarningIcon }));
|
|
19
24
|
const icon = container.querySelector(':only-child');
|
|
@@ -1,10 +1,6 @@
|
|
|
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 { CloseIcon } from '@amsterdam/design-system-react-icons';
|
|
7
|
-
import clsx from 'clsx';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
8
4
|
import { forwardRef } from 'react';
|
|
9
5
|
import { Icon } from '../Icon';
|
|
10
6
|
/**
|
package/dist/Image/Image.d.ts
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { ImgHTMLAttributes } from 'react';
|
|
6
6
|
import { AspectRatioProps } from '../common/types';
|
|
7
|
-
export type ImageProps = {
|
|
7
|
+
export type ImageProps = AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, 'children'> & {
|
|
8
8
|
/** A textual description of the content of the image. */
|
|
9
9
|
alt: string;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
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<{
|
|
14
|
+
export declare const Image: import("react").ForwardRefExoticComponent<AspectRatioProps & Omit<ImgHTMLAttributes<HTMLImageElement>, "children"> & {
|
|
15
15
|
/** A textual description of the content of the image. */
|
|
16
16
|
alt: string;
|
|
17
|
-
} &
|
|
17
|
+
} & import("react").RefAttributes<HTMLImageElement>>;
|
package/dist/Image/Image.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
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 { generateAspectRatioClass } from './generateAspectRatioClass';
|
|
9
5
|
/**
|
|
10
6
|
* @see {@link https://designsystem.amsterdam/?path=/docs/components-media-image--docs Image docs at Amsterdam Design System}
|
|
11
7
|
*/
|
|
12
|
-
export const Image = forwardRef(({ aspectRatio, className, ...restProps }, ref) => (_jsx("img", { ...restProps, className: clsx('ams-image', generateAspectRatioClass(aspectRatio), className), ref: ref })));
|
|
8
|
+
export const Image = forwardRef(({ aspectRatio, className, ...restProps }, ref) => (_jsx("img", { ...restProps, className: clsx('ams-image', generateAspectRatioClass(aspectRatio), className), ref: ref, width: 600 })));
|
|
13
9
|
Image.displayName = 'Image';
|
package/dist/Image/Image.test.js
CHANGED
|
@@ -5,9 +5,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
*/
|
|
6
6
|
import { render } from '@testing-library/react';
|
|
7
7
|
import { createRef } from 'react';
|
|
8
|
-
import { Image } from './Image';
|
|
9
|
-
import { generateAspectRatioClass } from './generateAspectRatioClass';
|
|
10
8
|
import { aspectRatioOptions } from '../common/types';
|
|
9
|
+
import { generateAspectRatioClass } from './generateAspectRatioClass';
|
|
10
|
+
import { Image } from './Image';
|
|
11
11
|
import '@testing-library/jest-dom';
|
|
12
12
|
describe('Image', () => {
|
|
13
13
|
it('renders', () => {
|
package/dist/Image/index.d.ts
CHANGED
package/dist/Image/index.js
CHANGED
|
@@ -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<{
|
|
48
|
-
slideId: number;
|
|
49
|
-
} & HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
Item: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
50
48
|
children?: import("react").ReactNode | undefined;
|
|
49
|
+
} & {
|
|
50
|
+
slideId: number;
|
|
51
51
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
52
|
};
|
|
@@ -1,16 +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, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Image } from '../Image/Image';
|
|
8
5
|
import { ImageSliderContext } from './ImageSliderContext';
|
|
9
6
|
import { ImageSliderControls } from './ImageSliderControls';
|
|
10
7
|
import { ImageSliderItem } from './ImageSliderItem';
|
|
11
8
|
import { ImageSliderScroller } from './ImageSliderScroller';
|
|
12
9
|
import { ImageSliderThumbnails } from './ImageSliderThumbnails';
|
|
13
|
-
import { Image } from '../Image/Image';
|
|
14
10
|
export const ImageSliderRoot = forwardRef(({ className, controls, imageLabel = 'Afbeelding', images, nextLabel = 'Volgende', previousLabel = 'Vorige', ...restProps }, ref) => {
|
|
15
11
|
const [currentSlideId, setCurrentSlideId] = useState(0);
|
|
16
12
|
const [isAtStart, setIsAtStart] = useState(true);
|
|
@@ -1,13 +1,9 @@
|
|
|
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, useCallback, useContext } from 'react';
|
|
9
|
-
import { ImageSliderContext } from './ImageSliderContext';
|
|
10
5
|
import { Button } from '../Button';
|
|
6
|
+
import { ImageSliderContext } from './ImageSliderContext';
|
|
11
7
|
export const ImageSliderControls = forwardRef(({ className, nextLabel, previousLabel, ...restProps }, ref) => {
|
|
12
8
|
const { goToNextSlide, goToPreviousSlide, isAtEnd, isAtStart } = useContext(ImageSliderContext);
|
|
13
9
|
const handleClickPrevious = useCallback(() => goToPreviousSlide(), [goToPreviousSlide]);
|