@coopdigital/react 1.22.3 → 1.22.4
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/components/AlertBanner/AlertBanner.d.ts +9 -7
- package/dist/components/Author/Author.d.ts +9 -7
- package/dist/components/Box/Box.d.ts +10 -7
- package/dist/components/Button/Button.d.ts +15 -12
- package/dist/components/Card/Card.d.ts +42 -32
- package/dist/components/Checkbox/Checkbox.d.ts +7 -7
- package/dist/components/DatePicker/DatePicker.d.ts +17 -17
- package/dist/components/Dialog/Dialog.d.ts +19 -19
- package/dist/components/Expandable/Expandable.d.ts +10 -8
- package/dist/components/Field/Field.d.ts +8 -8
- package/dist/components/FieldMarkers/Error.d.ts +4 -4
- package/dist/components/FieldMarkers/Hint.d.ts +4 -4
- package/dist/components/FieldMarkers/Label.d.ts +5 -5
- package/dist/components/FieldMarkers/Label.js +3 -2
- package/dist/components/FieldMarkers/Legend.d.ts +5 -5
- package/dist/components/Fieldset/Fieldset.d.ts +14 -14
- package/dist/components/Flourish/Flourish.d.ts +5 -5
- package/dist/components/Form/Form.d.ts +4 -4
- package/dist/components/Image/Image.d.ts +3 -7
- package/dist/components/Image/Image.js +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -6
- package/dist/components/Logo/Logo.d.ts +6 -7
- package/dist/components/PasswordInput/PasswordInput.d.ts +3 -3
- package/dist/components/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/Picture/Picture.d.ts +7 -5
- package/dist/components/Pill/Pill.d.ts +13 -8
- package/dist/components/Popover/Popover.d.ts +25 -22
- package/dist/components/Prose/Prose.d.ts +7 -7
- package/dist/components/Radio/Radio.d.ts +7 -7
- package/dist/components/Searchbox/Searchbox.d.ts +8 -16
- package/dist/components/Select/Select.d.ts +13 -13
- package/dist/components/Signpost/Signpost.d.ts +10 -7
- package/dist/components/SkipNav/SkipNav.d.ts +6 -5
- package/dist/components/Squircle/Squircle.d.ts +6 -4
- package/dist/components/Tag/Tag.d.ts +9 -6
- package/dist/components/TextInput/TextInput.d.ts +15 -15
- package/dist/components/TextInput/TextInput.js +1 -2
- package/dist/components/Textarea/Textarea.d.ts +22 -18
- package/dist/components/Textarea/Textarea.js +1 -2
- package/dist/components/ValidationSummary/ValidationSummary.d.ts +19 -14
- package/package.json +2 -2
- package/src/components/AlertBanner/AlertBanner.tsx +9 -7
- package/src/components/Author/Author.tsx +9 -7
- package/src/components/Box/Box.tsx +10 -7
- package/src/components/Button/Button.tsx +15 -12
- package/src/components/Card/Card.tsx +42 -37
- package/src/components/Checkbox/Checkbox.tsx +7 -7
- package/src/components/DatePicker/DatePicker.tsx +17 -18
- package/src/components/Dialog/Dialog.tsx +19 -19
- package/src/components/Expandable/Expandable.tsx +10 -8
- package/src/components/Field/Field.tsx +8 -8
- package/src/components/FieldMarkers/Error.tsx +4 -4
- package/src/components/FieldMarkers/Hint.tsx +4 -4
- package/src/components/FieldMarkers/Label.tsx +9 -6
- package/src/components/FieldMarkers/Legend.tsx +5 -5
- package/src/components/Fieldset/Fieldset.tsx +14 -14
- package/src/components/Flourish/Flourish.tsx +5 -5
- package/src/components/Form/Form.tsx +4 -4
- package/src/components/Image/Image.tsx +8 -9
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +2 -6
- package/src/components/Logo/Logo.tsx +6 -7
- package/src/components/PasswordInput/PasswordInput.tsx +4 -3
- package/src/components/Picture/Picture.tsx +7 -5
- package/src/components/Pill/Pill.tsx +13 -8
- package/src/components/Popover/Popover.tsx +25 -22
- package/src/components/Prose/Prose.tsx +7 -7
- package/src/components/Radio/Radio.tsx +7 -7
- package/src/components/Searchbox/Searchbox.tsx +8 -14
- package/src/components/Select/Select.tsx +13 -13
- package/src/components/Signpost/Signpost.tsx +10 -7
- package/src/components/SkipNav/SkipNav.tsx +6 -5
- package/src/components/Squircle/Squircle.tsx +6 -4
- package/src/components/Tag/Tag.tsx +9 -6
- package/src/components/TextInput/TextInput.tsx +16 -16
- package/src/components/Textarea/Textarea.tsx +23 -19
- package/src/components/ValidationSummary/ValidationSummary.tsx +19 -14
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/AlertBanner/AlertBanner.d.ts
|
|
3
3
|
export interface AlertBannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** Content inside the component.
|
|
5
|
+
*
|
|
6
|
+
* This should be an `<AlertBanner.Heading>` followed by any valid JSX. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
7
9
|
className?: string;
|
|
8
|
-
/**
|
|
10
|
+
/** Specify a custom React ref for this component. */
|
|
9
11
|
ref?: Ref<HTMLDivElement>;
|
|
10
|
-
/**
|
|
12
|
+
/** Specify the component variant. */
|
|
11
13
|
variant?: "black" | "default";
|
|
12
14
|
}
|
|
13
15
|
interface AlertBannerHeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
14
|
-
/**
|
|
16
|
+
/** Content inside the component. */
|
|
15
17
|
children?: React.ReactNode;
|
|
16
|
-
/**
|
|
18
|
+
/** Specify additional CSS classes. */
|
|
17
19
|
className?: string;
|
|
18
20
|
}
|
|
19
21
|
declare const AlertBanner: {
|
|
@@ -3,19 +3,21 @@ import "../Image/index.js";
|
|
|
3
3
|
import { HTMLAttributes, JSX, Ref } from "react";
|
|
4
4
|
//#region src/components/Author/Author.d.ts
|
|
5
5
|
export interface AuthorProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
6
|
+
/** Specify the Author name. */
|
|
7
7
|
author?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Specify the date.
|
|
11
|
+
*
|
|
12
|
+
* Recommended format `dd mmmm yyyy` eg: 1 January 2000. */
|
|
11
13
|
date?: string;
|
|
12
|
-
/**
|
|
14
|
+
/** Specify the text that will prefix the date, e.g. "Updated". */
|
|
13
15
|
datePrefix?: string;
|
|
14
|
-
/**
|
|
16
|
+
/** Specify properties of the Author Image. */
|
|
15
17
|
image?: ImageProps;
|
|
16
|
-
/**
|
|
18
|
+
/** Specify a custom React ref for this component. */
|
|
17
19
|
ref?: Ref<HTMLDivElement>;
|
|
18
|
-
/**
|
|
20
|
+
/** Specify the component size. */
|
|
19
21
|
size?: "sm" | "md";
|
|
20
22
|
}
|
|
21
23
|
declare const Author: {
|
|
@@ -2,17 +2,20 @@ import { StandardSizesWithNone } from "../../types/index.js";
|
|
|
2
2
|
import React, { ForwardRefExoticComponent, HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/Box/Box.d.ts
|
|
4
4
|
export interface BoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
5
|
+
/** Specify a custom element for the component
|
|
6
|
+
*
|
|
7
|
+
* Default: `<div>`
|
|
8
|
+
*/
|
|
6
9
|
as?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
7
|
-
/**
|
|
8
|
-
children?:
|
|
9
|
-
/**
|
|
10
|
+
/** Content inside the component. */
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/** Specify additional CSS classes. */
|
|
10
13
|
className?: string;
|
|
11
|
-
/**
|
|
14
|
+
/** Specify the padding. */
|
|
12
15
|
padding?: StandardSizesWithNone;
|
|
13
|
-
/**
|
|
16
|
+
/** Specify the border radius. */
|
|
14
17
|
radius?: StandardSizesWithNone;
|
|
15
|
-
/**
|
|
18
|
+
/** Specify a custom React ref for this component. */
|
|
16
19
|
ref?: Ref<HTMLDivElement>;
|
|
17
20
|
}
|
|
18
21
|
export declare const Box: ({ as, children, className, padding, radius, ref, ...props }: BoxProps) => JSX.Element;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes, ForwardRefExoticComponent, JSX, Ref } from "react";
|
|
2
2
|
//#region src/components/Button/Button.d.ts
|
|
3
3
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
-
/**
|
|
4
|
+
/** Specify a custom element for the component.
|
|
5
|
+
*
|
|
6
|
+
* Default: `<button>` or `<a>`.
|
|
7
|
+
*/
|
|
5
8
|
as?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
6
|
-
/**
|
|
9
|
+
/** Content inside the component. */
|
|
7
10
|
children?: React.ReactNode;
|
|
8
|
-
/**
|
|
11
|
+
/** Specify additional CSS classes. */
|
|
9
12
|
className?: string;
|
|
10
|
-
/**
|
|
13
|
+
/** Specify the target URL. */
|
|
11
14
|
href?: string;
|
|
12
|
-
/**
|
|
15
|
+
/** Specify whether the Button should be disabled. This will not actually disable the button, just make it look disabled. */
|
|
13
16
|
isDisabled?: boolean;
|
|
14
|
-
/**
|
|
17
|
+
/** Specify whether the Button should be full width. */
|
|
15
18
|
isFullWidth?: boolean;
|
|
16
|
-
/**
|
|
19
|
+
/** Force the Button into a loading state. */
|
|
17
20
|
isLoading?: boolean;
|
|
18
|
-
/**
|
|
21
|
+
/** Specify text to show when the Button is in a loading state. */
|
|
19
22
|
loadingText?: string;
|
|
20
|
-
/**
|
|
23
|
+
/** Callback to run when clicked. If this is an async function, it will be awaited and the button will be in a pending state until the promise is resolved. */
|
|
21
24
|
onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
22
|
-
/**
|
|
25
|
+
/** Specify a custom React ref for this component. */
|
|
23
26
|
ref?: Ref<HTMLElement>;
|
|
24
|
-
/**
|
|
27
|
+
/** Specify the component size. */
|
|
25
28
|
size?: "sm" | "md" | "lg";
|
|
26
|
-
/**
|
|
29
|
+
/** Specify the component variant. */
|
|
27
30
|
variant?: "solid" | "ghost" | "text";
|
|
28
31
|
}
|
|
29
32
|
declare const Button: {
|
|
@@ -6,86 +6,96 @@ import "../Picture/index.js";
|
|
|
6
6
|
import React, { AnchorHTMLAttributes, ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react";
|
|
7
7
|
//#region src/components/Card/Card.d.ts
|
|
8
8
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
9
|
+
/** Specify how the Card behaves across screen sizes.
|
|
10
10
|
*
|
|
11
11
|
* For finer control, use utility classes or custom CSS to control flex-direction. */
|
|
12
12
|
adaptive?: "sm" | "md";
|
|
13
|
-
/**
|
|
13
|
+
/** Specify an element for the component.
|
|
14
14
|
*
|
|
15
|
-
* Default:
|
|
15
|
+
* Default: `<article>`
|
|
16
16
|
*/
|
|
17
17
|
as?: "article" | "section" | "figure" | "div";
|
|
18
|
-
/**
|
|
18
|
+
/** Content inside the component.
|
|
19
|
+
*
|
|
20
|
+
* This should be a set of `<Card.Badge>`, `<Card.Content>` and / or `<Card.Picture>`. */
|
|
19
21
|
children?: React.ReactNode;
|
|
20
|
-
/**
|
|
22
|
+
/** Specify additional CSS classes. */
|
|
21
23
|
className?: string;
|
|
22
|
-
/**
|
|
24
|
+
/** Specify the component orientation. */
|
|
23
25
|
orientation?: "vertical" | "horizontal";
|
|
24
|
-
/**
|
|
26
|
+
/** Specify the component padding. */
|
|
25
27
|
padding?: StandardSizes;
|
|
26
|
-
/**
|
|
28
|
+
/** Specify the component border radius. */
|
|
27
29
|
radius?: StandardSizes;
|
|
28
|
-
/**
|
|
30
|
+
/** Specify a custom React ref for this component. */
|
|
29
31
|
ref?: Ref<HTMLDivElement>;
|
|
30
|
-
/**
|
|
32
|
+
/** Enable additional styles to use the Card as a signpost.
|
|
31
33
|
*
|
|
32
34
|
* Text is vertically aligned centrally and the Icon is enlarged. */
|
|
33
35
|
signpost?: boolean;
|
|
34
36
|
}
|
|
35
37
|
interface CardHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
36
|
-
/**
|
|
38
|
+
/** Specify a custom element for the component.
|
|
37
39
|
*
|
|
38
|
-
* Default:
|
|
40
|
+
* Default: `<h3>`
|
|
39
41
|
*/
|
|
40
42
|
as?: "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "strong" | "figcaption";
|
|
41
|
-
/**
|
|
43
|
+
/** Content inside the component. */
|
|
42
44
|
children?: React.ReactNode;
|
|
43
|
-
/**
|
|
45
|
+
/** Specify additional CSS classes. */
|
|
44
46
|
className?: string;
|
|
45
47
|
}
|
|
46
48
|
interface CardIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
47
|
-
/**
|
|
49
|
+
/** Content inside the component. */
|
|
48
50
|
children?: React.ReactNode;
|
|
49
|
-
/**
|
|
51
|
+
/** Specify additional CSS classes. */
|
|
50
52
|
className?: string;
|
|
51
53
|
}
|
|
52
54
|
interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
53
|
-
/**
|
|
55
|
+
/** Content inside the component.
|
|
56
|
+
*
|
|
57
|
+
* This should be a set of `<Card.Link>`, `<Card.Heading>` and / or `<Card.Icon>` followed by any valid JSX.
|
|
58
|
+
*/
|
|
54
59
|
children?: React.ReactNode;
|
|
55
|
-
/**
|
|
60
|
+
/** Specify additional CSS classes. */
|
|
56
61
|
className?: string;
|
|
57
62
|
}
|
|
58
63
|
interface CardLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
59
|
-
/**
|
|
64
|
+
/** Specify an element for the component.
|
|
65
|
+
*
|
|
66
|
+
* Default: `<a>`.
|
|
67
|
+
*/
|
|
60
68
|
as?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
61
|
-
/**
|
|
69
|
+
/** Content inside the component.
|
|
70
|
+
*
|
|
71
|
+
* Usually this will be a `<Card.Heading>` but can be any valid JSX.
|
|
72
|
+
*/
|
|
62
73
|
children?: React.ReactNode;
|
|
63
|
-
/**
|
|
74
|
+
/** Specify additional CSS classes. */
|
|
64
75
|
className?: string;
|
|
65
76
|
}
|
|
66
77
|
interface CardBadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
67
|
-
/**
|
|
78
|
+
/** Specify alignment relative to container.
|
|
68
79
|
*
|
|
69
|
-
* Default: `right
|
|
80
|
+
* Default: `right`.
|
|
70
81
|
*/
|
|
71
82
|
align?: "left" | "right";
|
|
72
|
-
/**
|
|
83
|
+
/** Content inside the component. */
|
|
73
84
|
children?: React.ReactNode;
|
|
74
|
-
/**
|
|
85
|
+
/** Specify additional CSS classes. */
|
|
75
86
|
className?: string;
|
|
76
|
-
/**
|
|
87
|
+
/** Specify position relative to top corner.
|
|
77
88
|
*
|
|
78
|
-
* Default: `popout
|
|
89
|
+
* Default: `popout`.
|
|
79
90
|
*/
|
|
80
91
|
position?: "inset" | "popout";
|
|
81
92
|
}
|
|
82
93
|
interface CardPictureProps extends PictureProps {
|
|
83
|
-
/**
|
|
94
|
+
/** Specify alignment relative to container.
|
|
95
|
+
*
|
|
96
|
+
* Default: `left`.
|
|
97
|
+
*/
|
|
84
98
|
align?: "left" | "right";
|
|
85
|
-
/** **(Optional)** Content inside the component. */
|
|
86
|
-
children?: React.ReactNode;
|
|
87
|
-
/** **(Optional)** Specify additional CSS classes. */
|
|
88
|
-
className?: string;
|
|
89
99
|
}
|
|
90
100
|
declare const Card: {
|
|
91
101
|
({ adaptive, as, children, className, orientation, padding, radius, ref, signpost, ...props }: CardProps): JSX.Element;
|
|
@@ -2,19 +2,19 @@ import { StandardSizes } from "../../types/index.js";
|
|
|
2
2
|
import { InputHTMLAttributes, JSX, Ref } from "react";
|
|
3
3
|
//#region src/components/Checkbox/Checkbox.d.ts
|
|
4
4
|
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
|
|
5
|
-
/**
|
|
5
|
+
/** Specify additional CSS classes. */
|
|
6
6
|
className?: string;
|
|
7
|
-
/**
|
|
7
|
+
/** Specify the disabled state. */
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
/**
|
|
9
|
+
/** Specify the component error state. */
|
|
10
10
|
error?: boolean;
|
|
11
|
-
/**
|
|
11
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
12
12
|
id?: string;
|
|
13
|
-
/** Specify the
|
|
13
|
+
/** Specify the component name. */
|
|
14
14
|
name: string;
|
|
15
|
-
/**
|
|
15
|
+
/** Specify a custom React ref for this component. */
|
|
16
16
|
ref?: Ref<HTMLInputElement>;
|
|
17
|
-
/**
|
|
17
|
+
/** Specify the component size. */
|
|
18
18
|
size?: StandardSizes;
|
|
19
19
|
}
|
|
20
20
|
declare const Checkbox: {
|
|
@@ -8,49 +8,49 @@ type OnDateSelectHandler = (selected: string | string[] | {
|
|
|
8
8
|
to?: string;
|
|
9
9
|
} | undefined) => void;
|
|
10
10
|
export interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onSelect" | "onChange" | "onChangeCapture" | "size" | "type"> {
|
|
11
|
-
/**
|
|
11
|
+
/** Specify additional CSS classes. */
|
|
12
12
|
className?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** Specify whether the DatePicker should close when selecting a date. Has no effect in range mode. */
|
|
14
14
|
closeOnSelect?: boolean;
|
|
15
|
-
/**
|
|
15
|
+
/** Specify the date format. This affects the values displayed to users and the accepted format for manual inputs. */
|
|
16
16
|
dateFormat?: string;
|
|
17
|
-
/**
|
|
17
|
+
/** Specify whether the DatePicker should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/** Specify dates to be disabled. Refer to react-day-picker docs for full configuration. */
|
|
20
20
|
disabledDates?: DayPickerProps["disabled"];
|
|
21
|
-
/**
|
|
21
|
+
/** Specify the upper bound for the DatePicker.
|
|
22
22
|
*
|
|
23
23
|
* Default: today plus one year.
|
|
24
24
|
*/
|
|
25
25
|
endDate?: Date;
|
|
26
|
-
/**
|
|
26
|
+
/** Specify the component error state. */
|
|
27
27
|
error?: boolean;
|
|
28
|
-
/**
|
|
28
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
29
29
|
id?: string;
|
|
30
|
-
/**
|
|
30
|
+
/** Specify the initial month view for the DatePicker. Combine with `initialSelected` to pre-select a date.
|
|
31
31
|
*
|
|
32
32
|
* Default: today.
|
|
33
33
|
*/
|
|
34
34
|
initialDate?: Date | DateRange;
|
|
35
|
-
/**
|
|
35
|
+
/** Specify whether the initial date should be pre-selected. */
|
|
36
36
|
initialSelected?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** Specify the DatePicker mode. */
|
|
38
38
|
mode?: Mode;
|
|
39
|
-
/** Specify the
|
|
39
|
+
/** Specify the component name. */
|
|
40
40
|
name: string;
|
|
41
41
|
/** Provided only for compatibility with form libraries. Use `onSelect` instead. */
|
|
42
42
|
onChange?: OnDateSelectHandler;
|
|
43
|
-
/**
|
|
43
|
+
/** Callback to run when a date is selected and validated.
|
|
44
44
|
*
|
|
45
45
|
* Contains the selected value, which is either an ISO-8601 formatted date string, or an object with from and to values. */
|
|
46
46
|
onSelect?: OnDateSelectHandler;
|
|
47
|
-
/**
|
|
47
|
+
/** Specify a custom React ref for this component. */
|
|
48
48
|
ref?: Ref<HTMLInputElement>;
|
|
49
|
-
/**
|
|
49
|
+
/** Specify whether this is a required field. */
|
|
50
50
|
required?: boolean;
|
|
51
|
-
/**
|
|
51
|
+
/** Specify the component size. */
|
|
52
52
|
size?: StandardSizes;
|
|
53
|
-
/**
|
|
53
|
+
/** Specify the lower bound for the DatePicker.
|
|
54
54
|
*
|
|
55
55
|
* Default: today minus one year.
|
|
56
56
|
*/
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import React, { DialogHTMLAttributes, HTMLAttributes, JSX, ReactEventHandler, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/Dialog/Dialog.d.ts
|
|
3
3
|
export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "closedby"> {
|
|
4
|
-
/** Content inside the
|
|
4
|
+
/** Content inside the component.
|
|
5
5
|
*
|
|
6
|
-
* This should be a `<Dialog.Header>` and `<Dialog.Body
|
|
7
|
-
children
|
|
8
|
-
/**
|
|
6
|
+
* This should be a set of `<Dialog.Header>` and `<Dialog.Body>`. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Specify how the Dialog can be closed. Set this to `none` to disable escape key and click-outside behaviour.
|
|
11
11
|
*
|
|
12
12
|
* Default: `any` */
|
|
13
13
|
closedBy?: "any" | "none";
|
|
14
|
-
/**
|
|
14
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
15
15
|
id?: string;
|
|
16
|
-
/** Specify an accessible label for the
|
|
16
|
+
/** Specify an accessible label for the Dialog that will be read out by screen readers. */
|
|
17
17
|
label: string;
|
|
18
|
-
/**
|
|
18
|
+
/** Specify the Dialog mode.
|
|
19
19
|
*
|
|
20
20
|
* Default: `dialog`
|
|
21
21
|
*/
|
|
22
22
|
mode?: "sheet" | "dialog";
|
|
23
|
-
/**
|
|
23
|
+
/** Specify a callback to run when the Dialog closes. */
|
|
24
24
|
onClose?: ReactEventHandler<HTMLDialogElement>;
|
|
25
|
-
/**
|
|
25
|
+
/** Specify a callback to run when the Dialog opens. */
|
|
26
26
|
onOpen?: ReactEventHandler<HTMLDialogElement>;
|
|
27
|
-
/**
|
|
27
|
+
/** Specify a callback to run when the Dialog opens or closes. */
|
|
28
28
|
onToggle?: ReactEventHandler<HTMLDialogElement>;
|
|
29
29
|
/** Specify the Dialog open state. This should reflect the value of your `useState`.
|
|
30
30
|
*
|
|
31
31
|
* Default: `false`
|
|
32
32
|
*/
|
|
33
33
|
open: boolean;
|
|
34
|
-
/**
|
|
34
|
+
/** Specify the Dialog position. This only applies when the `mode` is set to `sheet`.
|
|
35
35
|
*
|
|
36
36
|
* Default: `bottom`
|
|
37
37
|
*/
|
|
38
38
|
position?: "right" | "bottom" | "left";
|
|
39
|
-
/**
|
|
39
|
+
/** Specify a custom React ref for this component. */
|
|
40
40
|
ref?: Ref<HTMLDialogElement>;
|
|
41
|
-
/**
|
|
41
|
+
/** Specify an ARIA role for the Dialog. Use `alertdialog` if the message includes urgent information that requires an explicit user action.
|
|
42
42
|
*
|
|
43
43
|
* Default: `dialog`
|
|
44
44
|
*/
|
|
45
45
|
role?: "dialog" | "alertdialog";
|
|
46
46
|
}
|
|
47
47
|
interface DialogHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
-
/**
|
|
48
|
+
/** Content inside the component. */
|
|
49
49
|
children?: React.ReactNode;
|
|
50
|
-
/**
|
|
50
|
+
/** Specify additional CSS classes. */
|
|
51
51
|
className?: string;
|
|
52
|
-
/**
|
|
52
|
+
/** Specify whether to render the close button.
|
|
53
53
|
*
|
|
54
54
|
* Default: `true`
|
|
55
55
|
*/
|
|
56
56
|
closeButton?: boolean;
|
|
57
57
|
}
|
|
58
58
|
interface DialogBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
59
|
-
/**
|
|
59
|
+
/** Content inside the component. */
|
|
60
60
|
children?: React.ReactNode;
|
|
61
|
-
/**
|
|
61
|
+
/** Specify additional CSS classes. */
|
|
62
62
|
className?: string;
|
|
63
63
|
}
|
|
64
64
|
declare const Dialog: {
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { DetailsHTMLAttributes, HTMLAttributes, JSX, Ref } from "react";
|
|
2
2
|
//#region src/components/Expandable/Expandable.d.ts
|
|
3
3
|
export interface ExpandableProps extends DetailsHTMLAttributes<HTMLDetailsElement> {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** Content inside the component.
|
|
5
|
+
*
|
|
6
|
+
* This should be a set of `<Expandable.Summary>` and `<Expandable.Content>`. */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
7
9
|
className?: string;
|
|
8
|
-
/**
|
|
10
|
+
/** Specify a custom React ref for this component. */
|
|
9
11
|
ref?: Ref<HTMLDetailsElement>;
|
|
10
12
|
}
|
|
11
13
|
interface ExpandableSummaryProps extends HTMLAttributes<HTMLElement> {
|
|
12
|
-
/**
|
|
14
|
+
/** Content inside the component. */
|
|
13
15
|
children?: React.ReactNode;
|
|
14
|
-
/**
|
|
16
|
+
/** Specify additional CSS classes. */
|
|
15
17
|
className?: string;
|
|
16
18
|
}
|
|
17
19
|
interface ExpandableContentProps extends HTMLAttributes<HTMLElement> {
|
|
18
|
-
/**
|
|
20
|
+
/** Content inside the component. */
|
|
19
21
|
children?: React.ReactNode;
|
|
20
|
-
/**
|
|
22
|
+
/** Specify additional CSS classes. */
|
|
21
23
|
className?: string;
|
|
22
24
|
}
|
|
23
25
|
declare const Expandable: {
|
|
@@ -4,19 +4,19 @@ import { LabelProps } from "../FieldMarkers/Label.js";
|
|
|
4
4
|
import React, { HTMLAttributes, JSX, Ref } from "react";
|
|
5
5
|
//#region src/components/Field/Field.d.ts
|
|
6
6
|
interface FieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/**
|
|
7
|
+
/** Specify whether the Field should render inside a box. */
|
|
8
8
|
boxed?: boolean;
|
|
9
|
-
/**
|
|
9
|
+
/** Content inside the component.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
children
|
|
13
|
-
/**
|
|
11
|
+
* This should be a set of `<Field.Label>`, `<Field.Hint>`, `<Field.Error>` and an associated form component. */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/** Specify additional CSS classes. */
|
|
14
14
|
classname?: string;
|
|
15
|
-
/**
|
|
15
|
+
/** Specify the component error state. */
|
|
16
16
|
error?: boolean;
|
|
17
|
-
/**
|
|
17
|
+
/** Specify whether the Field should show the left-hand error bar if it is in an error state. */
|
|
18
18
|
hideErrorBar?: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/** Specify a custom React ref for this component. */
|
|
20
20
|
ref?: Ref<HTMLDivElement>;
|
|
21
21
|
}
|
|
22
22
|
declare const Field: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/FieldMarkers/Error.d.ts
|
|
3
3
|
export interface ErrorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
-
/**
|
|
5
|
-
children?:
|
|
6
|
-
/**
|
|
4
|
+
/** Content inside the component. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Specify additional CSS classes. */
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Specify a custom React ref for this component. */
|
|
9
9
|
ref?: Ref<HTMLSpanElement>;
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HTMLAttributes, JSX, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/FieldMarkers/Hint.d.ts
|
|
3
3
|
export interface HintProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
children?:
|
|
6
|
-
/**
|
|
4
|
+
/** Content inside the component. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Specify additional CSS classes. */
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Specify a custom React ref for this component. */
|
|
9
9
|
ref?: Ref<HTMLDivElement>;
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { JSX, LabelHTMLAttributes, Ref } from "react";
|
|
2
2
|
//#region src/components/FieldMarkers/Label.d.ts
|
|
3
3
|
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
4
|
-
/**
|
|
5
|
-
children?:
|
|
6
|
-
/**
|
|
4
|
+
/** Content inside the component. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Specify additional CSS classes. */
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Specify whether the Label is visible to humans or screen readers only. */
|
|
9
9
|
isVisible?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/** Specify a custom React ref for this component. */
|
|
11
11
|
ref?: Ref<HTMLLabelElement>;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
@@ -2,11 +2,12 @@ import { useField } from "../Field/Field.context.js";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/FieldMarkers/Label.tsx
|
|
5
|
-
const Label = ({ children, className, isVisible = true, ref, ...props }) => {
|
|
5
|
+
const Label = ({ children, className, htmlFor, id, isVisible = true, ref, ...props }) => {
|
|
6
6
|
const field = useField();
|
|
7
7
|
const componentProps = {
|
|
8
8
|
className: clsx("coop-field-label", !isVisible && "sr-only", className),
|
|
9
|
-
htmlFor:
|
|
9
|
+
htmlFor: htmlFor ?? (field?.id ? field.id + (field?.suffix ?? "") : void 0),
|
|
10
|
+
id: id ?? (field?.id ? field.id + "_label" : void 0),
|
|
10
11
|
...props
|
|
11
12
|
};
|
|
12
13
|
return /* @__PURE__ */ jsx("label", {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { HTMLAttributes, JSX, Ref } from "react";
|
|
2
2
|
//#region src/components/FieldMarkers/Legend.d.ts
|
|
3
3
|
export interface LegendProps extends HTMLAttributes<HTMLLegendElement> {
|
|
4
|
-
/**
|
|
5
|
-
children?:
|
|
6
|
-
/**
|
|
4
|
+
/** Content inside the component. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Specify additional CSS classes. */
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Specify whether the Legend is visible to humans or screen readers only. */
|
|
9
9
|
isVisible?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/** Specify a custom React ref for this component. */
|
|
11
11
|
ref?: Ref<HTMLLegendElement>;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|