@amsterdam/design-system-react 3.0.0 → 3.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 (55) hide show
  1. package/dist/Accordion/Accordion.js +1 -1
  2. package/dist/Accordion/AccordionContext.d.ts +1 -2
  3. package/dist/Accordion/AccordionContext.js +3 -4
  4. package/dist/Accordion/AccordionSection.js +1 -1
  5. package/dist/Badge/Badge.d.ts +5 -0
  6. package/dist/Badge/Badge.js +3 -2
  7. package/dist/Checkbox/Checkbox.d.ts +5 -4
  8. package/dist/ImageSlider/ImageSlider.d.ts +3 -22
  9. package/dist/ImageSlider/ImageSlider.js +31 -86
  10. package/dist/ImageSlider/ImageSliderControl.d.ts +2 -0
  11. package/dist/ImageSlider/ImageSliderControl.js +5 -0
  12. package/dist/ImageSlider/ImageSliderThumbnails.d.ts +5 -6
  13. package/dist/ImageSlider/ImageSliderThumbnails.js +7 -12
  14. package/dist/ImageSlider/index.d.ts +0 -1
  15. package/dist/ImageSlider/utils/debounce.d.ts +1 -0
  16. package/dist/ImageSlider/utils/debounce.js +8 -0
  17. package/dist/ImageSlider/utils/index.d.ts +4 -0
  18. package/dist/ImageSlider/utils/index.js +4 -0
  19. package/dist/ImageSlider/utils/scrollToCurrentSlideOnResize.d.ts +7 -0
  20. package/dist/ImageSlider/utils/scrollToCurrentSlideOnResize.js +11 -0
  21. package/dist/ImageSlider/utils/scrollToSlide.d.ts +2 -0
  22. package/dist/ImageSlider/utils/scrollToSlide.js +9 -0
  23. package/dist/ImageSlider/utils/setCurrentSlideIdToVisibleSlide.d.ts +8 -0
  24. package/dist/ImageSlider/utils/setCurrentSlideIdToVisibleSlide.js +10 -0
  25. package/dist/PageHeader/PageHeader.d.ts +6 -1
  26. package/dist/PageHeader/PageHeader.js +2 -2
  27. package/dist/ProgressList/ProgressList.d.ts +43 -0
  28. package/dist/ProgressList/ProgressList.js +19 -0
  29. package/dist/ProgressList/ProgressListContext.d.ts +10 -0
  30. package/dist/ProgressList/ProgressListContext.js +11 -0
  31. package/dist/ProgressList/ProgressListStep.d.ts +23 -0
  32. package/dist/ProgressList/ProgressListStep.js +12 -0
  33. package/dist/ProgressList/ProgressListSubstep.d.ts +16 -0
  34. package/dist/ProgressList/ProgressListSubstep.js +7 -0
  35. package/dist/ProgressList/ProgressListSubsteps.d.ts +9 -0
  36. package/dist/ProgressList/ProgressListSubsteps.js +5 -0
  37. package/dist/ProgressList/index.d.ts +9 -0
  38. package/dist/ProgressList/index.js +5 -0
  39. package/dist/Radio/Radio.d.ts +5 -4
  40. package/dist/index.cjs.js +671 -632
  41. package/dist/index.cjs.js.map +1 -1
  42. package/dist/index.d.ts +107 -57
  43. package/dist/index.esm.js +673 -635
  44. package/dist/index.esm.js.map +1 -1
  45. package/dist/index.js +1 -0
  46. package/dist/tsconfig.build.tsbuildinfo +1 -1
  47. package/package.json +9 -9
  48. package/dist/ImageSlider/ImageSliderContext.d.ts +0 -13
  49. package/dist/ImageSlider/ImageSliderContext.js +0 -14
  50. package/dist/ImageSlider/ImageSliderControls.d.ts +0 -17
  51. package/dist/ImageSlider/ImageSliderControls.js +0 -13
  52. package/dist/ImageSlider/ImageSliderItem.d.ts +0 -15
  53. package/dist/ImageSlider/ImageSliderItem.js +0 -11
  54. package/dist/ImageSlider/ImageSliderScroller.d.ts +0 -9
  55. package/dist/ImageSlider/ImageSliderScroller.js +0 -5
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export type ProgressListStepProps = {
7
+ /** Whether the step contains a list of substeps. This is needed to draw the connecting lines correctly. */
8
+ hasSubsteps?: boolean;
9
+ /** The heading text for this step. */
10
+ heading: string;
11
+ /** The current progress state of the step. */
12
+ status?: 'current' | 'completed';
13
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
14
+ export declare const ProgressListStep: import("react").ForwardRefExoticComponent<{
15
+ /** Whether the step contains a list of substeps. This is needed to draw the connecting lines correctly. */
16
+ hasSubsteps?: boolean;
17
+ /** The heading text for this step. */
18
+ heading: string;
19
+ /** The current progress state of the step. */
20
+ status?: "current" | "completed";
21
+ } & HTMLAttributes<HTMLElement> & {
22
+ children?: import("react").ReactNode | undefined;
23
+ } & import("react").RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ArrowForwardIcon } from '@amsterdam/design-system-react-icons';
3
+ import { clsx } from 'clsx';
4
+ import { forwardRef, useContext } from 'react';
5
+ import { Heading } from '../Heading';
6
+ import { Icon } from '../Icon';
7
+ import { ProgressListContext } from './ProgressListContext';
8
+ export const ProgressListStep = forwardRef(({ children, className, hasSubsteps, heading, status, ...restProps }, ref) => {
9
+ const { headingLevel } = useContext(ProgressListContext);
10
+ return (_jsxs("li", { "aria-current": status === 'current' ? 'step' : undefined, className: clsx(className, 'ams-progress-list__step', hasSubsteps && 'ams-progress-list__step--has-substeps', status && `ams-progress-list__step--${status}`), ref: ref, ...restProps, children: [_jsxs("div", { className: "ams-progress-list__indicator", children: [_jsx("div", { className: "ams-progress-list__marker", children: _jsx("span", { className: "ams-progress-list__marker-shape", children: status === 'current' && _jsx(Icon, { color: "inverse", svg: ArrowForwardIcon }) }) }), _jsx("span", { className: "ams-progress-list__connector" })] }), _jsxs("div", { className: "ams-progress-list__content", children: [_jsx(Heading, { className: "ams-progress-list__heading", level: headingLevel, children: heading }), children] })] }));
11
+ });
12
+ ProgressListStep.displayName = 'ProgressList.Step';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { ProgressListStepProps } from './ProgressListStep';
7
+ export type ProgressListSubstepProps = {
8
+ /** The current progress state of the substep. */
9
+ status?: ProgressListStepProps['status'];
10
+ } & PropsWithChildren<HTMLAttributes<HTMLElement>>;
11
+ export declare const ProgressListSubstep: import("react").ForwardRefExoticComponent<{
12
+ /** The current progress state of the substep. */
13
+ status?: ProgressListStepProps["status"];
14
+ } & HTMLAttributes<HTMLElement> & {
15
+ children?: import("react").ReactNode | undefined;
16
+ } & import("react").RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { clsx } from 'clsx';
3
+ import { forwardRef } from 'react';
4
+ export const ProgressListSubstep = forwardRef(({ children, className, status, ...restProps }, ref) => {
5
+ return (_jsxs("li", { "aria-current": status === 'current' ? 'step' : undefined, className: clsx('ams-progress-list-substeps__step', status && `ams-progress-list-substeps__step--${status}`, className), ref: ref, ...restProps, children: [_jsxs("div", { className: "ams-progress-list-substeps__indicator", children: [_jsx("div", { className: "ams-progress-list-substeps__marker", children: _jsx("span", { className: "ams-progress-list-substeps__marker-shape" }) }), _jsx("span", { className: "ams-progress-list-substeps__connector" })] }), _jsx("div", { className: "ams-progress-list-substeps__content", children: children })] }));
6
+ });
7
+ ProgressListSubstep.displayName = 'ProgressList.Substep';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ import type { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export type ProgressListSubstepsProps = PropsWithChildren<HTMLAttributes<HTMLOListElement>>;
7
+ export declare const ProgressListSubsteps: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLOListElement> & {
8
+ children?: import("react").ReactNode | undefined;
9
+ } & import("react").RefAttributes<HTMLOListElement>>;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { clsx } from 'clsx';
3
+ import { forwardRef } from 'react';
4
+ export const ProgressListSubsteps = forwardRef(({ children, className, ...restProps }, ref) => (_jsx("ol", { ...restProps, className: clsx('ams-progress-list-substeps', className), ref: ref, children: children })));
5
+ ProgressListSubsteps.displayName = 'ProgressList.Substeps';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ export { ProgressList } from './ProgressList';
6
+ export type { ProgressListProps } from './ProgressList';
7
+ export type { ProgressListStepProps } from './ProgressListStep';
8
+ export type { ProgressListSubstepProps } from './ProgressListSubstep';
9
+ export type { ProgressListSubstepsProps } from './ProgressListSubsteps';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+ export { ProgressList } from './ProgressList';
@@ -2,13 +2,14 @@
2
2
  * @license EUPL-1.2+
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
- import type { InputHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
5
+ import type { InputHTMLAttributes, PropsWithChildren } from 'react';
6
+ import type { IconProps } from '../Icon';
6
7
  export type RadioProps = {
7
8
  /**
8
9
  * An icon to display instead of the default icon.
9
10
  * @default RadioIcon
10
11
  */
11
- icon?: Function | ReactNode;
12
+ icon?: IconProps['svg'];
12
13
  /** Whether the value fails a validation rule. */
13
14
  invalid?: boolean;
14
15
  } & PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, 'aria-invalid' | 'type'>>;
@@ -20,9 +21,9 @@ export declare const Radio: import("react").ForwardRefExoticComponent<{
20
21
  * An icon to display instead of the default icon.
21
22
  * @default RadioIcon
22
23
  */
23
- icon?: Function | ReactNode;
24
+ icon?: IconProps["svg"];
24
25
  /** Whether the value fails a validation rule. */
25
26
  invalid?: boolean;
26
27
  } & Omit<InputHTMLAttributes<HTMLInputElement>, "aria-invalid" | "type"> & {
27
- children?: ReactNode | undefined;
28
+ children?: import("react").ReactNode | undefined;
28
29
  } & import("react").RefAttributes<HTMLInputElement>>;