@amsterdam/design-system-react 0.2.0 → 0.3.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 (44) hide show
  1. package/dist/Accordion/Accordion.d.ts +3 -4
  2. package/dist/Breadcrumb/Breadcrumb.d.ts +2 -1
  3. package/dist/Card/Card.d.ts +1 -1
  4. package/dist/Footer/Footer.d.ts +2 -1
  5. package/dist/Grid/GridCell.d.ts +9 -13
  6. package/dist/Grid/index.d.ts +0 -1
  7. package/dist/Header/Header.d.ts +15 -0
  8. package/dist/Header/index.d.ts +2 -0
  9. package/dist/Heading/Heading.d.ts +2 -2
  10. package/dist/Icon/Icon.d.ts +1 -1
  11. package/dist/Image/Image.d.ts +2 -1
  12. package/dist/Image/index.d.ts +1 -2
  13. package/dist/Logo/Logo.d.ts +1 -2
  14. package/dist/Logo/index.d.ts +1 -1
  15. package/dist/Mark/Mark.d.ts +8 -0
  16. package/dist/Mark/Mark.test.d.ts +1 -0
  17. package/dist/Mark/index.d.ts +2 -0
  18. package/dist/Overlap/Overlap.d.ts +8 -0
  19. package/dist/Overlap/Overlap.test.d.ts +1 -0
  20. package/dist/Overlap/index.d.ts +1 -0
  21. package/dist/PageMenu/PageMenu.d.ts +1 -2
  22. package/dist/SearchField/SearchField.d.ts +14 -0
  23. package/dist/SearchField/SearchField.test.d.ts +1 -0
  24. package/dist/SearchField/SearchFieldButton.d.ts +9 -0
  25. package/dist/SearchField/SearchFieldInput.d.ts +10 -0
  26. package/dist/SearchField/SearchFieldInput.test.d.ts +1 -0
  27. package/dist/SearchField/index.d.ts +2 -0
  28. package/dist/SkipLink/SkipLink.d.ts +8 -0
  29. package/dist/SkipLink/SkipLink.test.d.ts +1 -0
  30. package/dist/SkipLink/index.d.ts +2 -0
  31. package/dist/{Highlight/Highlight.d.ts → Spotlight/Spotlight.d.ts} +2 -2
  32. package/dist/Spotlight/Spotlight.test.d.ts +1 -0
  33. package/dist/Spotlight/index.d.ts +2 -0
  34. package/dist/TextInput/TextInput.d.ts +8 -0
  35. package/dist/TextInput/TextInput.test.d.ts +1 -0
  36. package/dist/TextInput/index.d.ts +2 -0
  37. package/dist/index.cjs.js +369 -208
  38. package/dist/index.cjs.js.map +1 -1
  39. package/dist/index.d.ts +7 -1
  40. package/dist/index.esm.js +365 -209
  41. package/dist/index.esm.js.map +1 -1
  42. package/package.json +14 -16
  43. package/dist/Highlight/index.d.ts +0 -2
  44. /package/dist/{Highlight/Highlight.test.d.ts → Header/Header.test.d.ts} +0 -0
@@ -2,15 +2,14 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright (c) 2023 Gemeente Amsterdam
4
4
  */
5
- import { ForwardRefExoticComponent, HTMLAttributes, PropsWithChildren, ReactNode, RefAttributes } from 'react';
5
+ import { ForwardRefExoticComponent, HTMLAttributes, PropsWithChildren, RefAttributes } from 'react';
6
6
  import { AccordionSection } from './AccordionSection';
7
7
  import { HeadingLevel } from '../Heading/Heading';
8
- export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
9
- children?: ReactNode;
8
+ export interface AccordionProps extends PropsWithChildren<HTMLAttributes<HTMLDivElement>> {
10
9
  headingLevel: HeadingLevel;
11
10
  section?: boolean;
12
11
  }
13
- export interface AccordionComponent extends ForwardRefExoticComponent<PropsWithChildren<HTMLAttributes<HTMLDivElement>> & RefAttributes<HTMLDivElement> & AccordionProps> {
12
+ export interface AccordionComponent extends ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>> {
14
13
  Section: typeof AccordionSection;
15
14
  }
16
15
  export declare const Accordion: AccordionComponent;
@@ -1,5 +1,6 @@
1
1
  import { ForwardRefExoticComponent, HTMLAttributes, PropsWithChildren, RefAttributes } from 'react';
2
- interface BreadcrumbComponent extends ForwardRefExoticComponent<PropsWithChildren<HTMLAttributes<HTMLElement>> & RefAttributes<HTMLElement>> {
2
+ type BreadcrumbProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
3
+ interface BreadcrumbComponent extends ForwardRefExoticComponent<BreadcrumbProps & RefAttributes<HTMLElement>> {
3
4
  Item: typeof BreadcrumbItem;
4
5
  }
5
6
  export declare const Breadcrumb: BreadcrumbComponent;
@@ -12,7 +12,7 @@ export declare const CardLink: ForwardRefExoticComponent<AnchorHTMLAttributes<HT
12
12
  } & RefAttributes<HTMLAnchorElement>>;
13
13
  export interface CardProps extends PropsWithChildren<HTMLAttributes<HTMLElement>> {
14
14
  }
15
- export interface CardComponent extends ForwardRefExoticComponent<PropsWithChildren<HTMLAttributes<HTMLElement>> & RefAttributes<HTMLElement> & CardProps> {
15
+ export interface CardComponent extends ForwardRefExoticComponent<CardProps & RefAttributes<HTMLElement>> {
16
16
  HeadingGroup: typeof CardHeadingGroup;
17
17
  Link: typeof CardLink;
18
18
  }
@@ -9,7 +9,8 @@ export declare const FooterTop: ForwardRefExoticComponent<HTMLAttributes<HTMLDiv
9
9
  export declare const FooterBottom: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
10
10
  children?: import("react").ReactNode;
11
11
  } & RefAttributes<HTMLDivElement>>;
12
- interface FooterComponent extends ForwardRefExoticComponent<PropsWithChildren<HTMLAttributes<HTMLElement>> & RefAttributes<HTMLElement>> {
12
+ type FooterProps = PropsWithChildren<HTMLAttributes<HTMLElement>>;
13
+ interface FooterComponent extends ForwardRefExoticComponent<FooterProps & RefAttributes<HTMLElement>> {
13
14
  Top: typeof FooterTop;
14
15
  Bottom: typeof FooterBottom;
15
16
  }
@@ -1,22 +1,18 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright (c) 2023 Gemeente Amsterdam
4
- */
5
- import { HTMLAttributes, PropsWithChildren } from 'react';
6
- import type { GridColumnNumber, GridColumnNumbers } from './Grid';
7
- type GridCellFullWidthProp = {
8
- /** Whether the cell spans the full width of the grid. */
9
- fullWidth?: boolean;
10
- span?: never;
1
+ import { type HTMLAttributes, type PropsWithChildren } from 'react';
2
+ import { GridColumnNumber, GridColumnNumbers } from './Grid';
3
+ type GridCellSpanAllProp = {
4
+ /** Lets the cell span the full width of all grid variants. */
5
+ span: 'all';
11
6
  start?: never;
12
7
  };
13
- type GridCellColumnProps = {
14
- fullWidth?: never;
8
+ type GridCellSpanAndStartProps = {
15
9
  /** The amount of grid columns the cell spans. */
16
10
  span?: GridColumnNumber | GridColumnNumbers;
17
11
  /** The index of the grid column the cell starts at. */
18
12
  start?: GridColumnNumber | GridColumnNumbers;
19
13
  };
20
- export type GridCellProps = (GridCellFullWidthProp | GridCellColumnProps) & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
14
+ export type GridCellProps = {
15
+ as?: 'article' | 'div' | 'section';
16
+ } & (GridCellSpanAllProp | GridCellSpanAndStartProps) & PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
21
17
  export declare const GridCell: import("react").ForwardRefExoticComponent<GridCellProps & import("react").RefAttributes<HTMLDivElement>>;
22
18
  export {};
@@ -1,3 +1,2 @@
1
1
  export * from './Grid';
2
- export * from './GridCell';
3
2
  export type { GridCellProps } from './GridCell';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { HTMLAttributes, ReactNode } from 'react';
6
+ import type { LogoBrand } from '../Logo';
7
+ export interface HeaderProps extends HTMLAttributes<HTMLElement> {
8
+ logoBrand?: LogoBrand;
9
+ logoLink?: string;
10
+ logoLinkTitle?: string;
11
+ title?: string;
12
+ links?: ReactNode;
13
+ menu?: ReactNode;
14
+ }
15
+ export declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { Header } from './Header';
2
+ export type { HeaderProps } from './Header';
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { HTMLAttributes } from 'react';
7
7
  export type HeadingLevel = 1 | 2 | 3 | 4;
8
- type Size = 'level-1' | 'level-2' | 'level-3' | 'level-4';
8
+ type HeadingSize = 'level-1' | 'level-2' | 'level-3' | 'level-4' | 'level-5' | 'level-6';
9
9
  export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
10
10
  /**
11
11
  * Het hiërarchische niveau van de titel.
@@ -15,7 +15,7 @@ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
15
15
  * De visuele grootte van de titel.
16
16
  * Voeg dit toe om de titel groter of kleiner weer te geven zonder de semantische betekenis te veranderen.
17
17
  */
18
- size?: Size;
18
+ size?: HeadingSize;
19
19
  /**
20
20
  * De kleur van de titel
21
21
  * Gebruik deze property om de titel in tegenovergestelde kleur te tonen.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { HTMLAttributes } from 'react';
8
8
  export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
9
- size?: 'level-3' | 'level-4' | 'level-5' | 'level-6' | 'level-7';
9
+ size?: 'level-3' | 'level-4' | 'level-5' | 'level-6';
10
10
  svg: Function;
11
11
  }
12
12
  export declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<HTMLElement>>;
@@ -2,7 +2,8 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright (c) 2023 Gemeente Amsterdam
4
4
  */
5
- import { ImgHTMLAttributes } from 'react';
5
+ import { type ImgHTMLAttributes } from 'react';
6
6
  export interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
7
+ cover?: Boolean;
7
8
  }
8
9
  export declare const Image: import("react").ForwardRefExoticComponent<ImageProps & import("react").RefAttributes<HTMLImageElement>>;
@@ -1,2 +1 @@
1
- export { Image } from './Image';
2
- export type { ImageProps } from './Image';
1
+ export { Image, type ImageProps } from './Image';
@@ -3,9 +3,8 @@
3
3
  * Copyright (c) 2023 Gemeente Amsterdam
4
4
  */
5
5
  import { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
6
- type LogoBrand = 'amsterdam' | 'ggd-amsterdam' | 'stadsarchief' | 'stadsbank-van-lening' | 'vga-verzekeringen';
6
+ export type LogoBrand = 'amsterdam' | 'ggd-amsterdam' | 'stadsarchief' | 'stadsbank-van-lening' | 'vga-verzekeringen';
7
7
  export interface LogoProps extends SVGProps<SVGSVGElement> {
8
8
  brand?: LogoBrand;
9
9
  }
10
10
  export declare const Logo: ForwardRefExoticComponent<Omit<LogoProps, "ref"> & RefAttributes<SVGSVGElement>>;
11
- export {};
@@ -1,2 +1,2 @@
1
1
  export { Logo } from './Logo';
2
- export type { LogoProps } from './Logo';
2
+ export type { LogoProps, LogoBrand } from './Logo';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export interface MarkProps extends PropsWithChildren<HTMLAttributes<HTMLElement>> {
7
+ }
8
+ export declare const Mark: import("react").ForwardRefExoticComponent<MarkProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { Mark } from './Mark';
2
+ export type { MarkProps } from './Mark';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { type HTMLAttributes } from 'react';
6
+ export declare const Overlap: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
7
+ children?: import("react").ReactNode;
8
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1 @@
1
+ export { Overlap } from './Overlap';
@@ -12,7 +12,6 @@ type PageMenuProps = {
12
12
  } & PropsWithChildren<HTMLAttributes<HTMLUListElement>>;
13
13
  interface PageMenuComponent extends ForwardRefExoticComponent<PageMenuProps & RefAttributes<HTMLElement>> {
14
14
  Link: typeof PageMenuLink;
15
- Button: typeof PageMenuButton;
16
15
  }
17
16
  export declare const PageMenu: PageMenuComponent;
18
17
  export interface PageMenuLinkProps extends PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>> {
@@ -20,7 +19,7 @@ export interface PageMenuLinkProps extends PropsWithChildren<AnchorHTMLAttribute
20
19
  }
21
20
  export interface PageMenuButtonProps extends PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> {
22
21
  icon?: Function;
22
+ showOnMobile?: boolean;
23
23
  }
24
24
  declare const PageMenuLink: ForwardRefExoticComponent<PageMenuLinkProps & RefAttributes<HTMLAnchorElement>>;
25
- declare const PageMenuButton: ForwardRefExoticComponent<PageMenuButtonProps & RefAttributes<HTMLButtonElement>>;
26
25
  export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { ForwardRefExoticComponent, HTMLAttributes, PropsWithChildren, RefAttributes } from 'react';
6
+ import { SearchFieldButton } from './SearchFieldButton';
7
+ import { SearchFieldInput } from './SearchFieldInput';
8
+ export interface SearchFieldProps extends PropsWithChildren<HTMLAttributes<HTMLFormElement>> {
9
+ }
10
+ export interface SearchFieldComponent extends ForwardRefExoticComponent<SearchFieldProps & RefAttributes<HTMLFormElement>> {
11
+ Input: typeof SearchFieldInput;
12
+ Button: typeof SearchFieldButton;
13
+ }
14
+ export declare const SearchField: SearchFieldComponent;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { HTMLAttributes } from 'react';
6
+ interface SearchFieldButtonProps extends HTMLAttributes<HTMLButtonElement> {
7
+ }
8
+ export declare const SearchFieldButton: import("react").ForwardRefExoticComponent<SearchFieldButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { InputHTMLAttributes } from 'react';
6
+ interface SearchFieldInputProps extends InputHTMLAttributes<HTMLInputElement> {
7
+ label?: string;
8
+ }
9
+ export declare const SearchFieldInput: import("react").ForwardRefExoticComponent<SearchFieldInputProps & import("react").RefAttributes<HTMLInputElement>>;
10
+ export {};
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { SearchField } from './SearchField';
2
+ export type { SearchFieldProps } from './SearchField';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import type { AnchorHTMLAttributes, PropsWithChildren } from 'react';
6
+ export interface SkipLinkProps extends PropsWithChildren<AnchorHTMLAttributes<HTMLAnchorElement>> {
7
+ }
8
+ export declare const SkipLink: import("react").ForwardRefExoticComponent<SkipLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { SkipLink } from './SkipLink';
2
+ export type { SkipLinkProps } from './SkipLink';
@@ -3,8 +3,8 @@
3
3
  * Copyright (c) 2023 Gemeente Amsterdam
4
4
  */
5
5
  import { HTMLAttributes, PropsWithChildren } from 'react';
6
- export interface HighlightProps extends PropsWithChildren<HTMLAttributes<HTMLElement>> {
6
+ export interface SpotlightProps extends PropsWithChildren<HTMLAttributes<HTMLElement>> {
7
7
  as?: 'article' | 'aside' | 'div' | 'footer' | 'section';
8
8
  color?: 'blue' | 'dark-green' | 'green' | 'light-blue' | 'magenta' | 'orange' | 'purple' | 'yellow';
9
9
  }
10
- export declare const Highlight: import("react").ForwardRefExoticComponent<HighlightProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export declare const Spotlight: import("react").ForwardRefExoticComponent<SpotlightProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { Spotlight } from './Spotlight';
2
+ export type { SpotlightProps } from './Spotlight';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { InputHTMLAttributes } from 'react';
6
+ export interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
7
+ }
8
+ export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { TextInput } from './TextInput';
2
+ export type { TextInputProps } from './TextInput';