@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
|
@@ -6,19 +6,19 @@ import { useField } from "@/components/Field/Field.context"
|
|
|
6
6
|
import { StandardSizes } from "@/types"
|
|
7
7
|
|
|
8
8
|
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
|
|
9
|
-
/**
|
|
9
|
+
/** Specify additional CSS classes. */
|
|
10
10
|
className?: string
|
|
11
|
-
/**
|
|
11
|
+
/** Specify the disabled state. */
|
|
12
12
|
disabled?: boolean
|
|
13
|
-
/**
|
|
13
|
+
/** Specify the component error state. */
|
|
14
14
|
error?: boolean
|
|
15
|
-
/**
|
|
15
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
16
16
|
id?: string
|
|
17
|
-
/** Specify the
|
|
17
|
+
/** Specify the component name. */
|
|
18
18
|
name: string
|
|
19
|
-
/**
|
|
19
|
+
/** Specify a custom React ref for this component. */
|
|
20
20
|
ref?: Ref<HTMLInputElement>
|
|
21
|
-
/**
|
|
21
|
+
/** Specify the component size. */
|
|
22
22
|
size?: StandardSizes
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -16,29 +16,23 @@ import { StandardSizes } from "@/types"
|
|
|
16
16
|
import { getSlotProp, hasUserBorder } from "@/utils"
|
|
17
17
|
|
|
18
18
|
export interface SearchboxProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
19
|
-
/**
|
|
19
|
+
/** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
|
|
20
20
|
action?: string
|
|
21
|
-
/**
|
|
22
|
-
button?: Pick<ButtonProps, "className" | "loadingText"> & { label?: React.ReactNode }
|
|
23
|
-
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
21
|
+
/** Specify additional CSS classes. */
|
|
24
22
|
className?: string
|
|
25
|
-
/**
|
|
23
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
26
24
|
id?: string
|
|
27
25
|
/** Specify the label displayed above the search field. Hidden by default, but visible to screen readers. */
|
|
28
26
|
label: string
|
|
29
|
-
/**
|
|
27
|
+
/** Specify whether the label should be visible to humans or screenreaders. */
|
|
30
28
|
labelVisible?: boolean
|
|
31
|
-
/**
|
|
32
|
-
name?: string
|
|
33
|
-
/** **(Optional)** Callback to run when the form is submitted. If this is an async function, it will be awaited and the Searchbox will be in a pending state until the promise is resolved. */
|
|
29
|
+
/** Callback to run when the form is submitted. If this is an async function, it will be awaited and the Searchbox will be in a pending state until the promise is resolved. */
|
|
34
30
|
onSubmit?: React.SubmitEventHandler<HTMLElement> | undefined
|
|
35
|
-
/**
|
|
36
|
-
placeholder?: string
|
|
37
|
-
/** **(Optional)** Specify a custom React ref for this component. */
|
|
31
|
+
/** Specify a custom React ref for this component. */
|
|
38
32
|
ref?: RefObject<HTMLFormElement | null>
|
|
39
|
-
/**
|
|
33
|
+
/** Specify the component size. */
|
|
40
34
|
size?: StandardSizes
|
|
41
|
-
/**
|
|
35
|
+
/** Specify the component variant. */
|
|
42
36
|
variant?: "solid" | "ghost"
|
|
43
37
|
}
|
|
44
38
|
|
|
@@ -14,43 +14,43 @@ import { useField } from "@/components/Field/Field.context"
|
|
|
14
14
|
import { StandardSizes } from "@/types"
|
|
15
15
|
|
|
16
16
|
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
17
|
-
/**
|
|
17
|
+
/** Content inside the component.
|
|
18
|
+
*
|
|
19
|
+
* This should be a set of `<Select.Option>` or `<Select.OptionGroup>`. */
|
|
18
20
|
children?: ReactNode
|
|
19
|
-
/**
|
|
21
|
+
/** Specify additional CSS classes. */
|
|
20
22
|
className?: string
|
|
21
|
-
/**
|
|
23
|
+
/** Specify whether the Select should be disabled. */
|
|
22
24
|
disabled?: boolean
|
|
23
|
-
/**
|
|
25
|
+
/** Specify the Select error state. */
|
|
24
26
|
error?: boolean
|
|
25
|
-
/**
|
|
27
|
+
/** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
|
|
26
28
|
*
|
|
27
29
|
* Default: false
|
|
28
30
|
*/
|
|
29
31
|
fit?: boolean
|
|
30
|
-
/**
|
|
32
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
31
33
|
id?: string
|
|
32
34
|
/** Specify the Select name. */
|
|
33
35
|
name: string
|
|
34
|
-
/**
|
|
36
|
+
/** Specify a custom React ref for this component. */
|
|
35
37
|
ref?: Ref<HTMLSelectElement>
|
|
36
|
-
/**
|
|
38
|
+
/** Specify the component size. */
|
|
37
39
|
size?: StandardSizes
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
interface SelectOptionGroupProps extends OptgroupHTMLAttributes<HTMLOptGroupElement> {
|
|
41
|
-
/**
|
|
43
|
+
/** Content inside the component. */
|
|
42
44
|
children?: ReactNode
|
|
43
45
|
/** Specify the Select option group label. */
|
|
44
46
|
label: string
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
interface SelectOptionProps extends OptionHTMLAttributes<HTMLOptionElement> {
|
|
48
|
-
/**
|
|
50
|
+
/** Content inside the component. */
|
|
49
51
|
children?: ReactNode
|
|
50
|
-
/**
|
|
52
|
+
/** Specify additional CSS classes. */
|
|
51
53
|
className?: string
|
|
52
|
-
/** Value of Select option. */
|
|
53
|
-
value: string
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const Select = ({
|
|
@@ -7,20 +7,23 @@ import { ChevronRightIcon } from "@/components/icons"
|
|
|
7
7
|
import { Image, ImageProps } from "@/components/Image"
|
|
8
8
|
|
|
9
9
|
export interface SignpostProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
-
/**
|
|
10
|
+
/** Specify a custom element for the component.
|
|
11
|
+
*
|
|
12
|
+
* Default: `<a>`.
|
|
13
|
+
*/
|
|
11
14
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
12
15
|
as?: React.FC<any> | ForwardRefExoticComponent<any> | string
|
|
13
|
-
/**
|
|
14
|
-
children
|
|
15
|
-
/**
|
|
16
|
+
/** Content inside the component. */
|
|
17
|
+
children?: React.ReactNode
|
|
18
|
+
/** Specify additional CSS classes. */
|
|
16
19
|
className?: string
|
|
17
|
-
/**
|
|
20
|
+
/** Specify the level of the Signpost heading. */
|
|
18
21
|
headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6"
|
|
19
22
|
/** Specify the URL that the Signpost component will link to when clicked. */
|
|
20
23
|
href?: string
|
|
21
|
-
/**
|
|
24
|
+
/** Specify properties of the Signpost Image. */
|
|
22
25
|
image?: ImageProps
|
|
23
|
-
/**
|
|
26
|
+
/** Specify a custom React ref for this component. */
|
|
24
27
|
ref?: Ref<HTMLDivElement>
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -8,14 +8,15 @@ interface SkipNavLink {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface SkipNavProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
/**
|
|
11
|
+
/** Specify additional CSS classes. */
|
|
12
12
|
className?: string
|
|
13
|
-
/**
|
|
13
|
+
/** Specify whether the component is visible immediately or only when tabbing. Useful for testing purposes only. */
|
|
14
14
|
isVisible?: boolean
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
15
|
+
/** Specify links to show in the component. Each item needs a `href` and `label`.
|
|
16
|
+
*
|
|
17
|
+
* Default: A single link anchored to `#main`. */
|
|
17
18
|
links?: SkipNavLink[]
|
|
18
|
-
/**
|
|
19
|
+
/** Specify a custom React ref for this component. */
|
|
19
20
|
ref?: Ref<HTMLDivElement>
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -3,16 +3,18 @@ import type { HTMLAttributes, JSX, Ref, SVGAttributes } from "react"
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
5
|
export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
6
|
+
/** Content inside the component.
|
|
7
|
+
*
|
|
8
|
+
* This should be a set of `<Squircle.Svg>` and `<Squircle.Text>`. */
|
|
7
9
|
children?: React.ReactNode
|
|
8
|
-
/**
|
|
10
|
+
/** Specify additional CSS classes. */
|
|
9
11
|
className?: string
|
|
10
|
-
/**
|
|
12
|
+
/** Specify a custom React ref for this component. */
|
|
11
13
|
ref?: Ref<HTMLDivElement>
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export interface SquircleSvgProps extends SVGAttributes<SVGElement> {
|
|
15
|
-
/**
|
|
17
|
+
/** Specify the component size. */
|
|
16
18
|
size?: string | number
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -6,18 +6,21 @@ import React from "react"
|
|
|
6
6
|
import { hasUserBg } from "@/utils"
|
|
7
7
|
|
|
8
8
|
export interface TagProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
9
|
-
/**
|
|
9
|
+
/** Specify a custom element for the component.
|
|
10
|
+
*
|
|
11
|
+
* Default: `<span>` or `<a>`.
|
|
12
|
+
*/
|
|
10
13
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
11
14
|
as?: React.FC<any> | ForwardRefExoticComponent<any> | string
|
|
12
|
-
/**
|
|
15
|
+
/** Content inside the component. */
|
|
13
16
|
children?: React.ReactNode
|
|
14
|
-
/**
|
|
17
|
+
/** Specify additional CSS classes. */
|
|
15
18
|
className?: string
|
|
16
|
-
/**
|
|
19
|
+
/** Specify the target URL. */
|
|
17
20
|
href?: string
|
|
18
|
-
/**
|
|
21
|
+
/** Specify a custom React ref for this component. */
|
|
19
22
|
ref?: Ref<HTMLElement>
|
|
20
|
-
/**
|
|
23
|
+
/** Specify the component size. */
|
|
21
24
|
size?: "sm" | "md"
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -10,36 +10,36 @@ export interface TextInputProps extends Omit<
|
|
|
10
10
|
InputHTMLAttributes<HTMLInputElement>,
|
|
11
11
|
"prefix" | "size" | "type"
|
|
12
12
|
> {
|
|
13
|
-
/**
|
|
13
|
+
/** Specify additional CSS classes. */
|
|
14
14
|
className?: string
|
|
15
|
-
/**
|
|
15
|
+
/** Specify the disabled state. */
|
|
16
16
|
disabled?: boolean
|
|
17
|
-
/**
|
|
17
|
+
/** Specify the component error state. */
|
|
18
18
|
error?: boolean
|
|
19
|
-
/**
|
|
19
|
+
/** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
|
|
20
20
|
*
|
|
21
21
|
* Default: false
|
|
22
22
|
*/
|
|
23
23
|
fit?: boolean
|
|
24
|
-
/**
|
|
24
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
25
25
|
id?: string
|
|
26
|
-
/** Specify the
|
|
26
|
+
/** Specify the component name. */
|
|
27
27
|
name: string
|
|
28
|
-
/**
|
|
28
|
+
/** Specify placeholder text. Do not use in place of a form label. */
|
|
29
29
|
placeholder?: string
|
|
30
|
-
/**
|
|
30
|
+
/** Specify the prefix. */
|
|
31
31
|
prefix?: React.ReactNode
|
|
32
|
-
/**
|
|
32
|
+
/** Specify whether the prefix should be rendered inside the input. */
|
|
33
33
|
prefixInline?: boolean
|
|
34
|
-
/**
|
|
34
|
+
/** Specify a custom React ref for this component. */
|
|
35
35
|
ref?: Ref<HTMLInputElement>
|
|
36
|
-
/**
|
|
36
|
+
/** Specify the component size. */
|
|
37
37
|
size?: StandardSizes
|
|
38
|
-
/**
|
|
38
|
+
/** Specify the suffix. */
|
|
39
39
|
suffix?: React.ReactNode
|
|
40
|
-
/**
|
|
40
|
+
/** Specify whether the suffix should be rendered inside the input. */
|
|
41
41
|
suffixInline?: boolean
|
|
42
|
-
/**
|
|
42
|
+
/** Specify the underlying input type. */
|
|
43
43
|
type?:
|
|
44
44
|
| "text"
|
|
45
45
|
| "email"
|
|
@@ -56,7 +56,7 @@ export interface TextInputProps extends Omit<
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const TextInput = ({
|
|
59
|
-
"aria-placeholder": ariaPlaceholder,
|
|
59
|
+
// "aria-placeholder": ariaPlaceholder,
|
|
60
60
|
className,
|
|
61
61
|
disabled,
|
|
62
62
|
error = false,
|
|
@@ -76,7 +76,7 @@ const TextInput = ({
|
|
|
76
76
|
const field = useField()
|
|
77
77
|
|
|
78
78
|
const componentProps = {
|
|
79
|
-
"aria-placeholder": placeholder ?? ariaPlaceholder ?? undefined,
|
|
79
|
+
// "aria-placeholder": placeholder ?? ariaPlaceholder ?? undefined,
|
|
80
80
|
className: clsx("coop-text-input", className),
|
|
81
81
|
"data-error": error || undefined,
|
|
82
82
|
"data-fit": fit || undefined,
|
|
@@ -16,44 +16,48 @@ const charCountMessage = (remaining: number) => {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
19
|
-
/**
|
|
19
|
+
/** Specify additional CSS classes. */
|
|
20
20
|
className?: string
|
|
21
|
-
/** Specify the number of columns (characters per row) in the Textarea.
|
|
21
|
+
/** Specify the number of columns (characters per row) in the Textarea.
|
|
22
|
+
*
|
|
23
|
+
* Default: `30`.
|
|
24
|
+
*/
|
|
22
25
|
cols?: number
|
|
23
|
-
/**
|
|
26
|
+
/** Specify whether to show the character counter underneath the Textarea. */
|
|
24
27
|
counter?: boolean
|
|
25
|
-
/**
|
|
28
|
+
/** Specify whether the Textarea should allow more characters than its `maxLength` value.
|
|
26
29
|
*
|
|
27
|
-
*
|
|
30
|
+
* Default: `false`. Users can enter more characters than the maximum but will be warned if they go over the limit.
|
|
28
31
|
*/
|
|
29
32
|
cutoff?: boolean
|
|
30
|
-
/**
|
|
33
|
+
/** Specify the disabled state. */
|
|
31
34
|
disabled?: boolean
|
|
32
|
-
/**
|
|
35
|
+
/** Specify the component error state */
|
|
33
36
|
error?: boolean
|
|
34
|
-
/**
|
|
37
|
+
/** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
|
|
35
38
|
*
|
|
36
|
-
* Default: false
|
|
39
|
+
* Default: `false`
|
|
37
40
|
*/
|
|
38
41
|
fit?: boolean
|
|
39
|
-
/**
|
|
42
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
40
43
|
id?: string
|
|
41
|
-
/**
|
|
42
|
-
maxLength?: number
|
|
43
|
-
/** Specify the Textarea name. */
|
|
44
|
+
/** Specify the component name. */
|
|
44
45
|
name: string
|
|
45
|
-
/**
|
|
46
|
+
/** Specify placeholder text. Do not use in place of a form label. */
|
|
46
47
|
placeholder?: string
|
|
47
|
-
/**
|
|
48
|
+
/** Specify a custom React ref for this component. */
|
|
48
49
|
ref?: Ref<HTMLTextAreaElement>
|
|
49
|
-
/**
|
|
50
|
+
/** Specify the number of rows (lines of text) in the Textarea.
|
|
51
|
+
*
|
|
52
|
+
* Default: `4`.
|
|
53
|
+
*/
|
|
50
54
|
rows?: number
|
|
51
|
-
/**
|
|
55
|
+
/** Specify the component size. */
|
|
52
56
|
size?: StandardSizes
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
const Textarea = ({
|
|
56
|
-
"aria-placeholder": ariaPlaceholder,
|
|
60
|
+
// "aria-placeholder": ariaPlaceholder,
|
|
57
61
|
className,
|
|
58
62
|
cols = 30,
|
|
59
63
|
counter = false,
|
|
@@ -74,7 +78,7 @@ const Textarea = ({
|
|
|
74
78
|
const field = useField()
|
|
75
79
|
|
|
76
80
|
const componentProps = {
|
|
77
|
-
"aria-placeholder": placeholder ?? ariaPlaceholder ?? undefined,
|
|
81
|
+
// "aria-placeholder": placeholder ?? ariaPlaceholder ?? undefined,
|
|
78
82
|
className: clsx("coop-textarea", className),
|
|
79
83
|
cols,
|
|
80
84
|
"data-error": error ?? undefined,
|
|
@@ -14,40 +14,45 @@ import {
|
|
|
14
14
|
import { useSlots } from "@/hooks/useSlots"
|
|
15
15
|
|
|
16
16
|
export interface ValidationSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
17
|
-
/**
|
|
17
|
+
/** Specify if the summary should be focused and the parent form scrolled into view if there are errors.
|
|
18
18
|
*
|
|
19
|
-
* Default: true
|
|
19
|
+
* Default: `true`
|
|
20
20
|
*/
|
|
21
21
|
autoScroll?: boolean
|
|
22
|
-
/**
|
|
22
|
+
/** Content inside the component.
|
|
23
|
+
*
|
|
24
|
+
* This should be a set of `<ValidationSummary.Heading>`, `<ValidationSummary.Prompt>` and `<ValidationSummary.Errors>`. */
|
|
23
25
|
children?: ReactNode
|
|
24
|
-
/**
|
|
26
|
+
/** Specify additional CSS classes. */
|
|
25
27
|
className?: string
|
|
26
|
-
/**
|
|
28
|
+
/** Specify if the summary should always render regardless of error state. Use this if you want to control the logic in your own code.
|
|
27
29
|
*
|
|
28
|
-
* Default: false
|
|
30
|
+
* Default: `false`
|
|
29
31
|
*/
|
|
30
32
|
forceMount?: boolean
|
|
31
|
-
/**
|
|
33
|
+
/** Specify a custom React ref for this component. */
|
|
32
34
|
ref?: Ref<HTMLDivElement>
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
interface ValidationSummaryHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
36
|
-
/**
|
|
38
|
+
/** Specify a custom element for the component.
|
|
39
|
+
*
|
|
40
|
+
* Default: `<h2>`.
|
|
41
|
+
*/
|
|
37
42
|
as?: "h2" | "h3" | "h4" | "h5" | "h6"
|
|
38
|
-
/**
|
|
43
|
+
/** Content inside the component.
|
|
39
44
|
*
|
|
40
|
-
*
|
|
45
|
+
* Default: `There's a problem`.
|
|
41
46
|
*/
|
|
42
47
|
children?: React.ReactNode
|
|
43
|
-
/**
|
|
48
|
+
/** Specify additional CSS classes. */
|
|
44
49
|
className?: string
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
interface ValidationSummaryPromptProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
-
/**
|
|
53
|
+
/** Content inside the component.
|
|
49
54
|
*
|
|
50
|
-
*
|
|
55
|
+
* Default: `Check the form. You must:`.
|
|
51
56
|
*/
|
|
52
57
|
children?: React.ReactNode
|
|
53
58
|
}
|
|
@@ -62,7 +67,7 @@ interface FieldError {
|
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
interface ValidationSummaryErrorsProps extends HTMLAttributes<HTMLDivElement> {
|
|
65
|
-
/**
|
|
70
|
+
/** Specify the validation error array. Refer to the FieldError type for the shape.. */
|
|
66
71
|
errors?: Record<string, FieldError>
|
|
67
72
|
}
|
|
68
73
|
|