@coopdigital/react 1.22.2 → 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.
Files changed (76) hide show
  1. package/dist/components/AlertBanner/AlertBanner.d.ts +9 -7
  2. package/dist/components/Author/Author.d.ts +9 -7
  3. package/dist/components/Box/Box.d.ts +10 -7
  4. package/dist/components/Button/Button.d.ts +15 -12
  5. package/dist/components/Card/Card.d.ts +42 -32
  6. package/dist/components/Checkbox/Checkbox.d.ts +7 -7
  7. package/dist/components/DatePicker/DatePicker.d.ts +17 -17
  8. package/dist/components/Dialog/Dialog.d.ts +19 -19
  9. package/dist/components/Expandable/Expandable.d.ts +10 -8
  10. package/dist/components/Field/Field.d.ts +8 -8
  11. package/dist/components/FieldMarkers/Error.d.ts +4 -4
  12. package/dist/components/FieldMarkers/Hint.d.ts +4 -4
  13. package/dist/components/FieldMarkers/Label.d.ts +5 -5
  14. package/dist/components/FieldMarkers/Label.js +3 -2
  15. package/dist/components/FieldMarkers/Legend.d.ts +5 -5
  16. package/dist/components/Fieldset/Fieldset.d.ts +14 -14
  17. package/dist/components/Flourish/Flourish.d.ts +5 -5
  18. package/dist/components/Form/Form.d.ts +4 -4
  19. package/dist/components/Image/Image.d.ts +3 -7
  20. package/dist/components/Image/Image.js +2 -0
  21. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -6
  22. package/dist/components/Logo/Logo.d.ts +6 -7
  23. package/dist/components/PasswordInput/PasswordInput.d.ts +3 -3
  24. package/dist/components/PasswordInput/PasswordInput.js +2 -2
  25. package/dist/components/Picture/Picture.d.ts +7 -5
  26. package/dist/components/Pill/Pill.d.ts +13 -8
  27. package/dist/components/Popover/Popover.d.ts +25 -22
  28. package/dist/components/Prose/Prose.d.ts +7 -7
  29. package/dist/components/Radio/Radio.d.ts +7 -7
  30. package/dist/components/Searchbox/Searchbox.d.ts +8 -16
  31. package/dist/components/Select/Select.d.ts +13 -13
  32. package/dist/components/Signpost/Signpost.d.ts +10 -7
  33. package/dist/components/SkipNav/SkipNav.d.ts +6 -5
  34. package/dist/components/Squircle/Squircle.d.ts +6 -4
  35. package/dist/components/Tag/Tag.d.ts +9 -6
  36. package/dist/components/TextInput/TextInput.d.ts +15 -15
  37. package/dist/components/TextInput/TextInput.js +1 -2
  38. package/dist/components/Textarea/Textarea.d.ts +22 -18
  39. package/dist/components/Textarea/Textarea.js +1 -2
  40. package/dist/components/ValidationSummary/ValidationSummary.d.ts +19 -14
  41. package/package.json +2 -2
  42. package/src/components/AlertBanner/AlertBanner.tsx +9 -7
  43. package/src/components/Author/Author.tsx +9 -7
  44. package/src/components/Box/Box.tsx +10 -7
  45. package/src/components/Button/Button.tsx +15 -12
  46. package/src/components/Card/Card.tsx +42 -37
  47. package/src/components/Checkbox/Checkbox.tsx +7 -7
  48. package/src/components/DatePicker/DatePicker.tsx +17 -18
  49. package/src/components/Dialog/Dialog.tsx +19 -19
  50. package/src/components/Expandable/Expandable.tsx +10 -8
  51. package/src/components/Field/Field.tsx +8 -8
  52. package/src/components/FieldMarkers/Error.tsx +4 -4
  53. package/src/components/FieldMarkers/Hint.tsx +4 -4
  54. package/src/components/FieldMarkers/Label.tsx +9 -6
  55. package/src/components/FieldMarkers/Legend.tsx +5 -5
  56. package/src/components/Fieldset/Fieldset.tsx +14 -14
  57. package/src/components/Flourish/Flourish.tsx +5 -5
  58. package/src/components/Form/Form.tsx +4 -4
  59. package/src/components/Image/Image.tsx +8 -9
  60. package/src/components/LoadingSpinner/LoadingSpinner.tsx +2 -6
  61. package/src/components/Logo/Logo.tsx +6 -7
  62. package/src/components/PasswordInput/PasswordInput.tsx +4 -3
  63. package/src/components/Picture/Picture.tsx +7 -5
  64. package/src/components/Pill/Pill.tsx +13 -8
  65. package/src/components/Popover/Popover.tsx +25 -22
  66. package/src/components/Prose/Prose.tsx +7 -7
  67. package/src/components/Radio/Radio.tsx +7 -7
  68. package/src/components/Searchbox/Searchbox.tsx +8 -14
  69. package/src/components/Select/Select.tsx +13 -13
  70. package/src/components/Signpost/Signpost.tsx +10 -7
  71. package/src/components/SkipNav/SkipNav.tsx +6 -5
  72. package/src/components/Squircle/Squircle.tsx +6 -4
  73. package/src/components/Tag/Tag.tsx +9 -6
  74. package/src/components/TextInput/TextInput.tsx +16 -16
  75. package/src/components/Textarea/Textarea.tsx +23 -19
  76. 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
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
9
+ /** Specify additional CSS classes. */
10
10
  className?: string
11
- /** **(Optional)** Specify whether the Radio should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
11
+ /** Specify the disabled state. */
12
12
  disabled?: boolean
13
- /** **(Optional)** Specify the Radio error state. */
13
+ /** Specify the component error state. */
14
14
  error?: boolean
15
- /** **(Optional)** Specify the Radio id. Will be auto-generated if not set. */
15
+ /** Specify the component id. Will be auto-generated if not set. */
16
16
  id?: string
17
- /** Specify the Radio name. */
17
+ /** Specify the component name. */
18
18
  name: string
19
- /** **(Optional)** Specify a custom React ref for this component. */
19
+ /** Specify a custom React ref for this component. */
20
20
  ref?: Ref<HTMLInputElement>
21
- /** **(Optional)** Specify the Radio size. */
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
- /** **(Optional)** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
19
+ /** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
20
20
  action?: string
21
- /** **(Optional)** Specify props to forward to the Button element. Use `label` to set Button text. */
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
- /** **(Optional)** Specify the TextInput id. Will be auto-generated if not set. */
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
- /** **(Optional)** Specify whether the label should be visible to humans or screenreaders. */
27
+ /** Specify whether the label should be visible to humans or screenreaders. */
30
28
  labelVisible?: boolean
31
- /** **(Optional)** Specify the TextInput name, also used as the URL search parameter. Defaults to `query`. */
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
- /** **(Optional)** Specify the TextInput placeholder text Do not use in place of a form label. */
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
- /** **(Optional)** Specify the Searchbox size. */
33
+ /** Specify the component size. */
40
34
  size?: StandardSizes
41
- /** **(Optional)** Specify the Searchbox variant. */
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
- /** **(Optional)** Options inside the Select. This should be a set of `Select.Option` or `Select.OptionGroup` components. */
17
+ /** Content inside the component.
18
+ *
19
+ * This should be a set of `<Select.Option>` or `<Select.OptionGroup>`. */
18
20
  children?: ReactNode
19
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
21
+ /** Specify additional CSS classes. */
20
22
  className?: string
21
- /** **(Optional)** Specify whether the Select should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
23
+ /** Specify whether the Select should be disabled. */
22
24
  disabled?: boolean
23
- /** **(Optional)** Specify the Select error state. */
25
+ /** Specify the Select error state. */
24
26
  error?: boolean
25
- /** **(Optional)** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
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
- /** **(Optional)** Specify the Select id. Will be auto-generated if not set. */
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
- /** **(Optional)** Specify a custom React ref for this component. */
36
+ /** Specify a custom React ref for this component. */
35
37
  ref?: Ref<HTMLSelectElement>
36
- /** **(Optional)** Specify the Select size. */
38
+ /** Specify the component size. */
37
39
  size?: StandardSizes
38
40
  }
39
41
 
40
42
  interface SelectOptionGroupProps extends OptgroupHTMLAttributes<HTMLOptGroupElement> {
41
- /** **(Optional)** Main content inside the Select option. It can be any valid JSX or string. */
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
- /** **(Optional)** Main content inside the Select option. It can be any valid JSX or string. */
50
+ /** Content inside the component. */
49
51
  children?: ReactNode
50
- /** **(Optional)** Specify additional CSS classes to be applied to the Select option. */
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
- /** **(Optional)** Specify a custom element to override default `a`. */
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
- /** Main content inside the component. It can be any valid JSX or string. */
14
- children: React.ReactNode
15
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
16
+ /** Content inside the component. */
17
+ children?: React.ReactNode
18
+ /** Specify additional CSS classes. */
16
19
  className?: string
17
- /** **(Optional)** Specify the level of the Signpost heading. */
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
- /** **(Optional)** Specify properties of the Signpost Image. */
24
+ /** Specify properties of the Signpost Image. */
22
25
  image?: ImageProps
23
- /** **(Optional)** Specify a custom React ref for this component. */
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
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
11
+ /** Specify additional CSS classes. */
12
12
  className?: string
13
- /** **(Optional)** Specify whether the SkipNav is visible immediately or only when tabbing. Useful for testing purposes only. */
13
+ /** Specify whether the component is visible immediately or only when tabbing. Useful for testing purposes only. */
14
14
  isVisible?: boolean
15
- /** **(Optional)** Specify links to show in the SkipNav.
16
- * Each item needs a `href` and `label`. Defaults to a single link anchored to `#main`. */
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
- /** **(Optional)** Specify a custom React ref for this component. */
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
- /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
6
+ /** Content inside the component.
7
+ *
8
+ * This should be a set of `<Squircle.Svg>` and `<Squircle.Text>`. */
7
9
  children?: React.ReactNode
8
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
10
+ /** Specify additional CSS classes. */
9
11
  className?: string
10
- /** **(Optional)** Specify a custom React ref for this component. */
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
- /** **(Optional)** Specify the Squircle size. */
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
- /** **(Optional)** Specify a custom element to override default `a` or `span`. */
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
- /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
15
+ /** Content inside the component. */
13
16
  children?: React.ReactNode
14
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
17
+ /** Specify additional CSS classes. */
15
18
  className?: string
16
- /** **(Optional)** Specify the URL that the Tag component will link to when clicked. */
19
+ /** Specify the target URL. */
17
20
  href?: string
18
- /** **(Optional)** Specify a custom React ref for this component. */
21
+ /** Specify a custom React ref for this component. */
19
22
  ref?: Ref<HTMLElement>
20
- /** **(Optional)** Specify the Tag size. */
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
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
13
+ /** Specify additional CSS classes. */
14
14
  className?: string
15
- /** **(Optional)** Specify whether the TextInput should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
15
+ /** Specify the disabled state. */
16
16
  disabled?: boolean
17
- /** **(Optional)** Specify the TextInput error state. */
17
+ /** Specify the component error state. */
18
18
  error?: boolean
19
- /** **(Optional)** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
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
- /** **(Optional)** Specify the TextInput id. Will be auto-generated if not set. */
24
+ /** Specify the component id. Will be auto-generated if not set. */
25
25
  id?: string
26
- /** Specify the TextInput name. */
26
+ /** Specify the component name. */
27
27
  name: string
28
- /** **(Optional)** Specify the TextInput placeholder text. Do not use in place of a form label. */
28
+ /** Specify placeholder text. Do not use in place of a form label. */
29
29
  placeholder?: string
30
- /** **(Optional)** Specify the prefix. It can be any valid JSX or string. */
30
+ /** Specify the prefix. */
31
31
  prefix?: React.ReactNode
32
- /** **(Optional)** Specify whether the prefix should be rendered inside the input. */
32
+ /** Specify whether the prefix should be rendered inside the input. */
33
33
  prefixInline?: boolean
34
- /** **(Optional)** Specify a custom React ref for this component. */
34
+ /** Specify a custom React ref for this component. */
35
35
  ref?: Ref<HTMLInputElement>
36
- /** **(Optional)** Specify the TextInput size. */
36
+ /** Specify the component size. */
37
37
  size?: StandardSizes
38
- /** **(Optional)** Specify the suffix. It can be any valid JSX or string. */
38
+ /** Specify the suffix. */
39
39
  suffix?: React.ReactNode
40
- /** **(Optional)** Specify whether the suffix should be rendered inside the input. */
40
+ /** Specify whether the suffix should be rendered inside the input. */
41
41
  suffixInline?: boolean
42
- /** **(Optional)** Specify the TextInput type. */
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
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
19
+ /** Specify additional CSS classes. */
20
20
  className?: string
21
- /** Specify the number of columns (characters per row) in the Textarea. Defaults to `30`. */
21
+ /** Specify the number of columns (characters per row) in the Textarea.
22
+ *
23
+ * Default: `30`.
24
+ */
22
25
  cols?: number
23
- /** **(Optional)** Specify whether to show the character counter underneath the Textarea. */
26
+ /** Specify whether to show the character counter underneath the Textarea. */
24
27
  counter?: boolean
25
- /** **(Optional)** Specify whether the Textarea should allow more characters than its `maxLength` value.
28
+ /** Specify whether the Textarea should allow more characters than its `maxLength` value.
26
29
  *
27
- * Defaults to `false`, meaning users can enter more characters than the maximum but will be warned if they go over the limit.
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
- /** **(Optional)** Specify whether the Textarea should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
33
+ /** Specify the disabled state. */
31
34
  disabled?: boolean
32
- /** **(Optional)** Specify the Textarea error state */
35
+ /** Specify the component error state */
33
36
  error?: boolean
34
- /** **(Optional)** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
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
- /** **(Optional)** Specify the Textarea id. Will be auto-generated if not set. */
42
+ /** Specify the component id. Will be auto-generated if not set. */
40
43
  id?: string
41
- /** **(Optional)** Specify the Textarea maxLength. This is the maximum number of characters users can enter. */
42
- maxLength?: number
43
- /** Specify the Textarea name. */
44
+ /** Specify the component name. */
44
45
  name: string
45
- /** **(Optional)** Specify the Textarea placeholder text. Do not use in place of a form label. */
46
+ /** Specify placeholder text. Do not use in place of a form label. */
46
47
  placeholder?: string
47
- /** **(Optional)** Specify a custom React ref for this component. */
48
+ /** Specify a custom React ref for this component. */
48
49
  ref?: Ref<HTMLTextAreaElement>
49
- /** **(Optional)** Specify the number of rows (lines of text) in the Textarea. Defaults to `4`. */
50
+ /** Specify the number of rows (lines of text) in the Textarea.
51
+ *
52
+ * Default: `4`.
53
+ */
50
54
  rows?: number
51
- /** **(Optional)** Specify the Textarea size. */
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
- /** **(Optional)** Specify if the summary should be focused and the parent form scrolled into view if there are errors.
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
- /** **(Optional)** This should be a set of `ValidationSummary.Heading`, `ValidationSummary.Prompt` and `ValidationSummary.Errors` components. */
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
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
26
+ /** Specify additional CSS classes. */
25
27
  className?: string
26
- /** **(Optional)** Specify if the summary should always render regardless of error state. Use this if you want to control the logic in your own code.
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
- /** **(Optional)** Specify a custom React ref for this component. */
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
- /** **(Optional)** Specify a custom element to use instead of `h2`. */
38
+ /** Specify a custom element for the component.
39
+ *
40
+ * Default: `<h2>`.
41
+ */
37
42
  as?: "h2" | "h3" | "h4" | "h5" | "h6"
38
- /** **(Optional)** Content inside the Heading.
43
+ /** Content inside the component.
39
44
  *
40
- * Defaults to `There's a problem`.
45
+ * Default: `There's a problem`.
41
46
  */
42
47
  children?: React.ReactNode
43
- /** **(Optional)** Specify additional CSS classes to be applied to the Heading. */
48
+ /** Specify additional CSS classes. */
44
49
  className?: string
45
50
  }
46
51
 
47
52
  interface ValidationSummaryPromptProps extends HTMLAttributes<HTMLDivElement> {
48
- /** **(Optional)** Content inside the Prompt.
53
+ /** Content inside the component.
49
54
  *
50
- * Defaults to `Check the form. You must:`.
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
- /** **(Optional)** Content inside the Errors. */
70
+ /** Specify the validation error array. Refer to the FieldError type for the shape.. */
66
71
  errors?: Record<string, FieldError>
67
72
  }
68
73