@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
@@ -31,44 +31,44 @@ const useDialog = () => {
31
31
  }
32
32
 
33
33
  export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "closedby"> {
34
- /** Content inside the Dialog.
34
+ /** Content inside the component.
35
35
  *
36
- * This should be a `<Dialog.Header>` and `<Dialog.Body>`, although arbitrary JSX children are also accepted. */
37
- children: string | ReactNode
38
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
36
+ * This should be a set of `<Dialog.Header>` and `<Dialog.Body>`. */
37
+ children?: ReactNode
38
+ /** Specify additional CSS classes. */
39
39
  className?: string
40
- /** **(Optional)** Specify how the dialog can be closed. Set this to `none` to disable escape key and click-outside behaviour.
40
+ /** Specify how the Dialog can be closed. Set this to `none` to disable escape key and click-outside behaviour.
41
41
  *
42
42
  * Default: `any` */
43
43
  closedBy?: "any" | "none"
44
- /** **(Optional)** Specify the Dialog id. Will be auto-generated if not set. */
44
+ /** Specify the component id. Will be auto-generated if not set. */
45
45
  id?: string
46
- /** Specify an accessible label for the dialog that will be read out by screen readers. */
46
+ /** Specify an accessible label for the Dialog that will be read out by screen readers. */
47
47
  label: string
48
- /** **(Optional)** Specify the Dialog mode.
48
+ /** Specify the Dialog mode.
49
49
  *
50
50
  * Default: `dialog`
51
51
  */
52
52
  mode?: "sheet" | "dialog"
53
- /** **(Optional)** Specific a callback to run when the Dialog closes. */
53
+ /** Specify a callback to run when the Dialog closes. */
54
54
  onClose?: ReactEventHandler<HTMLDialogElement>
55
- /** **(Optional)** Specific a callback to run when the Dialog opens. */
55
+ /** Specify a callback to run when the Dialog opens. */
56
56
  onOpen?: ReactEventHandler<HTMLDialogElement>
57
- /** **(Optional)** Specific a callback to run when the Dialog opens or closes. */
57
+ /** Specify a callback to run when the Dialog opens or closes. */
58
58
  onToggle?: ReactEventHandler<HTMLDialogElement>
59
59
  /** Specify the Dialog open state. This should reflect the value of your `useState`.
60
60
  *
61
61
  * Default: `false`
62
62
  */
63
63
  open: boolean
64
- /** **(Optional)** Specify the Dialog position. This only applies when the `mode` is set to `sheet`.
64
+ /** Specify the Dialog position. This only applies when the `mode` is set to `sheet`.
65
65
  *
66
66
  * Default: `bottom`
67
67
  */
68
68
  position?: "right" | "bottom" | "left"
69
- /** **(Optional)** Specify a custom React ref for this component. */
69
+ /** Specify a custom React ref for this component. */
70
70
  ref?: Ref<HTMLDialogElement>
71
- /** **(Optional)** Specify an ARIA role for the dialog. Use `alertdialog` if the message includes urgent information that requires an explicit user action.
71
+ /** Specify an ARIA role for the Dialog. Use `alertdialog` if the message includes urgent information that requires an explicit user action.
72
72
  *
73
73
  * Default: `dialog`
74
74
  */
@@ -76,20 +76,20 @@ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement
76
76
  }
77
77
 
78
78
  interface DialogHeaderProps extends HTMLAttributes<HTMLDivElement> {
79
- /** **(Optional)** Content inside the Dialog Header. */
79
+ /** Content inside the component. */
80
80
  children?: React.ReactNode
81
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
81
+ /** Specify additional CSS classes. */
82
82
  className?: string
83
- /** **(Optional)** Specify whether to render the close button.
83
+ /** Specify whether to render the close button.
84
84
  *
85
85
  * Default: `true`
86
86
  */
87
87
  closeButton?: boolean
88
88
  }
89
89
  interface DialogBodyProps extends HTMLAttributes<HTMLDivElement> {
90
- /** **(Optional)** Content inside the Dialog Body. */
90
+ /** Content inside the component. */
91
91
  children?: React.ReactNode
92
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
92
+ /** Specify additional CSS classes. */
93
93
  className?: string
94
94
  }
95
95
 
@@ -7,25 +7,27 @@ import { useSlots } from "@/hooks/useSlots"
7
7
  import { hasUserBg } from "@/utils"
8
8
 
9
9
  export interface ExpandableProps extends DetailsHTMLAttributes<HTMLDetailsElement> {
10
- /** Main content inside the component. This should be an `Expandable.Summary` and `Expandable.Content`. */
11
- children: React.ReactNode
12
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
10
+ /** Content inside the component.
11
+ *
12
+ * This should be a set of `<Expandable.Summary>` and `<Expandable.Content>`. */
13
+ children?: React.ReactNode
14
+ /** Specify additional CSS classes. */
13
15
  className?: string
14
- /** **(Optional)** Specify a custom React ref for this component. */
16
+ /** Specify a custom React ref for this component. */
15
17
  ref?: Ref<HTMLDetailsElement>
16
18
  }
17
19
 
18
20
  interface ExpandableSummaryProps extends HTMLAttributes<HTMLElement> {
19
- /** **(Optional)** Content inside the Summary. */
21
+ /** Content inside the component. */
20
22
  children?: React.ReactNode
21
- /** **(Optional)** Specify additional CSS classes to be applied to the Summary. */
23
+ /** Specify additional CSS classes. */
22
24
  className?: string
23
25
  }
24
26
 
25
27
  interface ExpandableContentProps extends HTMLAttributes<HTMLElement> {
26
- /** **(Optional)** Content inside the Expandable. */
28
+ /** Content inside the component. */
27
29
  children?: React.ReactNode
28
- /** **(Optional)** Specify additional CSS classes to be applied to the content wrapper. */
30
+ /** Specify additional CSS classes. */
29
31
  className?: string
30
32
  }
31
33
 
@@ -14,19 +14,19 @@ import { getSlotProp } from "@/utils"
14
14
  import { FieldConfig, FieldContext } from "./Field.context"
15
15
 
16
16
  interface FieldProps extends HTMLAttributes<HTMLDivElement> {
17
- /** **(Optional)** Specify whether the Field should render inside a box. */
17
+ /** Specify whether the Field should render inside a box. */
18
18
  boxed?: boolean
19
- /** Form elements inside the Field.
19
+ /** Content inside the component.
20
20
  *
21
- * Usually this will be a combination of `Field.Label`, `Field.Hint`, `Field.Error` and an associated control such as `TextInput` or `Checkbox`. */
22
- children: React.ReactNode
23
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
21
+ * This should be a set of `<Field.Label>`, `<Field.Hint>`, `<Field.Error>` and an associated form component. */
22
+ children?: React.ReactNode
23
+ /** Specify additional CSS classes. */
24
24
  classname?: string
25
- /** **(Optional)** Specify the Field error state. Use this to apply visual styling to the field control. */
25
+ /** Specify the component error state. */
26
26
  error?: boolean
27
- /** **(Optional)** Specify whether the Field should show the left-hand error bar if it is in an error state. */
27
+ /** Specify whether the Field should show the left-hand error bar if it is in an error state. */
28
28
  hideErrorBar?: boolean
29
- /** **(Optional)** Specify a custom React ref for this component. */
29
+ /** Specify a custom React ref for this component. */
30
30
  ref?: Ref<HTMLDivElement>
31
31
  }
32
32
 
@@ -3,11 +3,11 @@ import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
3
3
  import clsx from "clsx"
4
4
 
5
5
  export interface ErrorProps extends HTMLAttributes<HTMLSpanElement> {
6
- /** **(Optional)** Error text for the form element. Accepts any valid JSX or string. */
7
- children?: string | ReactNode
8
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
6
+ /** Content inside the component. */
7
+ children?: ReactNode
8
+ /** Specify additional CSS classes. */
9
9
  className?: string
10
- /** **(Optional)** Specify a custom React ref for this component. */
10
+ /** Specify a custom React ref for this component. */
11
11
  ref?: Ref<HTMLSpanElement>
12
12
  }
13
13
 
@@ -3,11 +3,11 @@ import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
3
3
  import clsx from "clsx"
4
4
 
5
5
  export interface HintProps extends HTMLAttributes<HTMLDivElement> {
6
- /** **(Optional)** Hint text for the form element. Accepts any valid JSX or string. */
7
- children?: string | ReactNode
8
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
6
+ /** Content inside the component. */
7
+ children?: ReactNode
8
+ /** Specify additional CSS classes. */
9
9
  className?: string
10
- /** **(Optional)** Specify a custom React ref for this component. */
10
+ /** Specify a custom React ref for this component. */
11
11
  ref?: Ref<HTMLDivElement>
12
12
  }
13
13
 
@@ -4,19 +4,21 @@ import { JSX, LabelHTMLAttributes, Ref } from "react"
4
4
  import { useField } from "@/components/Field/Field.context"
5
5
 
6
6
  export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
7
- /** **(Optional)** Main label for the form element. Accepts any valid JSX or string. */
8
- children?: string | React.ReactNode
9
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
7
+ /** Content inside the component. */
8
+ children?: React.ReactNode
9
+ /** Specify additional CSS classes. */
10
10
  className?: string
11
- /** **(Optional)** Specify whether the label is visible for humans or only for screen readers. */
11
+ /** Specify whether the Label is visible to humans or screen readers only. */
12
12
  isVisible?: boolean
13
- /** **(Optional)** Specify a custom React ref for this component. */
13
+ /** Specify a custom React ref for this component. */
14
14
  ref?: Ref<HTMLLabelElement>
15
15
  }
16
16
 
17
17
  export const Label = ({
18
18
  children,
19
19
  className,
20
+ htmlFor,
21
+ id,
20
22
  isVisible = true,
21
23
  ref,
22
24
  ...props
@@ -24,7 +26,8 @@ export const Label = ({
24
26
  const field = useField()
25
27
  const componentProps = {
26
28
  className: clsx("coop-field-label", !isVisible && "sr-only", className),
27
- htmlFor: props.htmlFor ?? (field?.id ? field.id + (field?.suffix ?? "") : undefined),
29
+ htmlFor: htmlFor ?? (field?.id ? field.id + (field?.suffix ?? "") : undefined),
30
+ id: id ?? (field?.id ? field.id + "_label" : undefined),
28
31
  ...props,
29
32
  }
30
33
  return (
@@ -2,13 +2,13 @@ import clsx from "clsx"
2
2
  import { HTMLAttributes, JSX, Ref } from "react"
3
3
 
4
4
  export interface LegendProps extends HTMLAttributes<HTMLLegendElement> {
5
- /** **(Optional)** Main legend for the fieldset. Accepts any valid JSX or string. */
6
- children?: string | React.ReactNode
7
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
5
+ /** Content inside the component. */
6
+ children?: React.ReactNode
7
+ /** Specify additional CSS classes. */
8
8
  className?: string
9
- /** **(Optional)** Specify whether the legend should be visible to humans or screen readers. */
9
+ /** Specify whether the Legend is visible to humans or screen readers only. */
10
10
  isVisible?: boolean
11
- /** **(Optional)** Specify a custom React ref for this component. */
11
+ /** Specify a custom React ref for this component. */
12
12
  ref?: Ref<HTMLLegendElement>
13
13
  }
14
14
 
@@ -7,21 +7,21 @@ import { Legend as BaseLegend, type LegendProps } from "@/components/FieldMarker
7
7
  import { StandardSizes } from "@/types"
8
8
 
9
9
  export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
10
- /** Form elements inside the Fieldset.
10
+ /** Content inside the component.
11
11
  *
12
- * Usually this will be a combination of `Fieldset.Legend` and `Fieldset.Fields`. */
13
- children: React.ReactNode
14
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
12
+ * This should be a set of `<Fieldset.Legend>`, `<Fieldset.Hint>`, `<Fieldset.Error>` and `<Fieldset.Fields>`. */
13
+ children?: React.ReactNode
14
+ /** Specify additional CSS classes. */
15
15
  className?: string
16
- /** **(Optional)** Specify whether the Fieldset, and all of its descendents, should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
16
+ /** Specify the disabled state. Applies to all descendants. */
17
17
  disabled?: boolean
18
- /** **(Optional)** Specify the Fieldset error state. Use this to apply visual styling to the field control. */
18
+ /** Specify the component error state. */
19
19
  error?: boolean
20
- /** **(Optional)** Specify whether the Fieldset should show the left-hand error bar if it is in an error state. */
20
+ /** Specify whether the Fieldset should show the left-hand error bar if it is in an error state. */
21
21
  hideErrorBar?: boolean
22
- /** **(Optional)** Specify a custom React ref for this component. */
22
+ /** Specify a custom React ref for this component. */
23
23
  ref?: Ref<HTMLFieldSetElement>
24
- /** **(Optional)** Specify the size of the Fieldset and all its descendents. */
24
+ /** Specify the size of the component. Applies to all descendants. */
25
25
  size?: StandardSizes
26
26
  }
27
27
  const Fieldset = ({
@@ -52,13 +52,13 @@ const Fieldset = ({
52
52
  }
53
53
 
54
54
  interface FieldsetFieldsProps extends HTMLAttributes<HTMLDivElement> {
55
- /** **(Optional)** Specify whether all descendent Fields should render inside a box. */
55
+ /** Specify whether all descendant Fields should render inside a box. */
56
56
  boxed?: boolean
57
- /** **(Optional)** Form elements inside the Fieldset.Fields container. */
58
- children?: string | React.ReactNode
59
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
57
+ /** Content inside the component. */
58
+ children?: React.ReactNode
59
+ /** Specify additional CSS classes. */
60
60
  className?: string
61
- /** **(Optional)** Specify the CheckboxGroup orientation. */
61
+ /** Specify the component orientation. */
62
62
  orientation?: "horizontal" | "vertical"
63
63
  }
64
64
 
@@ -5,13 +5,13 @@ import clsx from "clsx"
5
5
  import { Black, BrandBlue, Darks, Lights, OfferRed, Tints, White } from "@/types/colors"
6
6
 
7
7
  export interface FlourishProps extends SVGProps<SVGSVGElement> {
8
- /** Specify the text to be highlighted by the Flourish. */
9
- children: string | ReactNode
10
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
8
+ /** Content inside the component. */
9
+ children?: ReactNode
10
+ /** Specify additional CSS classes. */
11
11
  className?: string
12
- /** **(Optional)** Specify the Flourish color. */
12
+ /** Specify the Flourish color. */
13
13
  fill?: Darks | Lights | Tints | OfferRed | BrandBlue | White | Black
14
- /** **(Optional)** Specify a custom React ref for this component. */
14
+ /** Specify a custom React ref for this component. */
15
15
  ref?: Ref<SVGSVGElement>
16
16
  }
17
17
 
@@ -3,11 +3,11 @@ import type { FormHTMLAttributes, JSX, ReactNode, Ref } from "react"
3
3
  import clsx from "clsx"
4
4
 
5
5
  export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
6
- /** **(Optional)** Main content inside the form. This will usually be a collection of Field, Fieldset and Button components. */
7
- children?: string | ReactNode
8
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
6
+ /** Content inside the component. */
7
+ children?: ReactNode
8
+ /** Specify additional CSS classes. */
9
9
  className?: string
10
- /** **(Optional)** Specify a custom React ref for this component. */
10
+ /** Specify a custom React ref for this component. */
11
11
  ref?: Ref<HTMLFormElement>
12
12
  }
13
13
 
@@ -1,16 +1,12 @@
1
1
  import type { ImgHTMLAttributes, JSX, Ref } from "react"
2
2
 
3
3
  export interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
4
- /** Specify text to describe the image. Refer to Experience Library guidelines on writing good alt text. */
4
+ /** Specify text to describe the Image. */
5
5
  alt: string
6
- /** **(Optional)** Specify the height of the image. */
7
- height?: string
8
- /** **(Optional)** Specify a custom React ref for this component. */
6
+ /** Specify a custom React ref for this component. */
9
7
  ref?: Ref<HTMLImageElement>
10
- /** Specify the Image source URL. */
8
+ /** Specify the source URL. */
11
9
  src: string
12
- /** **(Optional)** Specify the width of the image. */
13
- width?: string
14
10
  }
15
11
 
16
12
  const getContentfulParams = ({
@@ -18,10 +14,13 @@ const getContentfulParams = ({
18
14
  src,
19
15
  width,
20
16
  }: {
21
- height?: string
17
+ height?: string | number
22
18
  src: string
23
- width: string
19
+ width: string | number
24
20
  }) => {
21
+ width = width.toString()
22
+ height = height ? height?.toString() : undefined
23
+
25
24
  const url = !src.startsWith("http") ? new URL("https://" + src) : new URL(src)
26
25
  const params = [
27
26
  ["fm", "webp"],
@@ -5,14 +5,10 @@ import clsx from "clsx"
5
5
  import { LoadingIcon } from "@/components/icons"
6
6
 
7
7
  export interface LoadingSpinnerProps extends SVGProps<SVGSVGElement> {
8
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
8
+ /** Specify additional CSS classes. */
9
9
  className?: string
10
- /** **(Optional)** Specify a custom React ref for this component. */
10
+ /** Specify a custom React ref for this component. */
11
11
  ref?: Ref<SVGSVGElement>
12
- /** **(Optional)** Specify LoadingSpinner stroke. */
13
- stroke?: string
14
- /** **(Optional)** Specify LoadingSpinner stroke width. */
15
- strokeWidth?: string
16
12
  }
17
13
 
18
14
  export const LoadingSpinner = ({
@@ -2,18 +2,17 @@ import type { JSX, SVGProps } from "react"
2
2
 
3
3
  import clsx from "clsx"
4
4
  export interface LogoProps extends SVGProps<SVGSVGElement> {
5
- /** **(Optional)** Specify the Logo alternative text. */
5
+ /** Specify alternative text for the Logo.
6
+ *
7
+ * Default: `Co-op`.
8
+ */
6
9
  alt?: string
7
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
10
+ /** Specify additional CSS classes. */
8
11
  className?: string
9
- /** **(Optional)** Specify the Logo fill color.
12
+ /** Specify the fill color.
10
13
  *
11
14
  * Default: brand-blue. */
12
15
  fill?: "white" | "black" | "brand-blue"
13
- /** **(Optional)** Specify the Logo height. */
14
- height?: number
15
- /** **(Optional)** Specify the Logo width. */
16
- width?: number
17
16
  }
18
17
 
19
18
  export const Logo = ({
@@ -12,9 +12,9 @@ export interface PasswordInputProps extends Omit<
12
12
  "prefix" | "prefixInline" | "suffix" | "suffixInline" | "type"
13
13
  > {
14
14
  /**
15
- * **(Optional)** Specify if the show/hide toggle button should be shown.
15
+ * Specify if the show/hide toggle button should be shown.
16
16
  *
17
- * Default: false
17
+ * Default: `false`.
18
18
  */
19
19
  showToggle?: boolean
20
20
  }
@@ -22,6 +22,7 @@ export interface PasswordInputProps extends Omit<
22
22
  const PasswordInput = ({
23
23
  disabled,
24
24
  id,
25
+ ref,
25
26
  showToggle = false,
26
27
  size,
27
28
  ...props
@@ -41,7 +42,7 @@ const PasswordInput = ({
41
42
  autoCapitalize="none"
42
43
  disabled={disabled}
43
44
  id={inputId}
44
- ref={props.ref}
45
+ ref={ref}
45
46
  size={size}
46
47
  spellCheck="false"
47
48
  type={isVisible ? "text" : "password"}
@@ -3,13 +3,15 @@ import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
3
3
  import clsx from "clsx"
4
4
 
5
5
  export interface PictureProps extends HTMLAttributes<HTMLPictureElement> {
6
- /** **(Optional)** Content inside the component. */
7
- children?: string | ReactNode
8
- /** **(Optional)** Specify additional CSS classes. */
6
+ /** Content inside the component.
7
+ *
8
+ * Usually this should be an `<Image>`. */
9
+ children?: ReactNode
10
+ /** Specify additional CSS classes. */
9
11
  className?: string
10
- /** **(Optional)** Specify the image crop mode. */
12
+ /** Specify the crop mode. */
11
13
  crop?: "square" | "wide" | "thin" | "squircle" | "none"
12
- /** **(Optional)** Specify a custom React ref for this component. */
14
+ /** Specify a custom React ref for this component. */
13
15
  ref?: Ref<HTMLPictureElement>
14
16
  }
15
17
 
@@ -8,25 +8,30 @@ import { StandardSizes } from "@/types"
8
8
  import { hasUserBg } from "@/utils"
9
9
 
10
10
  export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
11
- /** **(Optional)** Specify a custom element to override default `a` or `span`. */
11
+ /** Specify a custom element for the component.
12
+ *
13
+ * Default: `<span>` or `<a>`.
14
+ */
12
15
  // oxlint-disable-next-line typescript/no-explicit-any
13
16
  as?: React.FC<any> | ForwardRefExoticComponent<any> | string
14
- /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
17
+ /** Content inside the component.
18
+ *
19
+ * This can be any valid JSX including an optional `<Pill.Badge>`. */
15
20
  children?: React.ReactNode
16
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
21
+ /** Specify additional CSS classes. */
17
22
  className?: string
18
- /** **(Optional)** Specify the URL that the Pill component will link to when clicked. */
23
+ /** Specify the target URL. */
19
24
  href?: string
20
- /** **(Optional)** Specify a custom React ref for this component. */
25
+ /** Specify a custom React ref for this component. */
21
26
  ref?: Ref<HTMLElement>
22
- /** **(Optional)** Specify the Pill size. */
27
+ /** Specify the component size. */
23
28
  size?: StandardSizes
24
29
  }
25
30
 
26
31
  interface PillBadgeProps extends HTMLAttributes<HTMLSpanElement> {
27
- /** **(Optional)** Content inside the Badge. */
32
+ /** Content inside the component. */
28
33
  children?: React.ReactNode
29
- /** **(Optional)** Specify additional CSS classes to be applied to the Badge. */
34
+ /** Specify additional CSS classes. */
30
35
  className?: string
31
36
  }
32
37
 
@@ -14,59 +14,62 @@ import { useSlots } from "@/hooks/useSlots"
14
14
  import { bgClassToColor, hasUserBg } from "@/utils"
15
15
 
16
16
  export interface PopoverProps extends RadixPopoverProps {
17
- /** Content inside the Popover.
17
+ /** Content inside the component.
18
18
  *
19
- * This should be a `Popover.Trigger` and `Popover.Content`, with an optional `Popover.Close`. Other children will be ignored. */
20
- children: string | ReactNode
21
- /** **(Optional)** Callback to run when the Popover is opened or closed. */
19
+ * This should be a set of `<Popover.Trigger>` and `<Popover.Content>`. */
20
+ children?: ReactNode
21
+ /** Callback to run when the Popover is opened or closed. */
22
22
  onOpenChange?: RadixPopoverProps["onOpenChange"]
23
- /** **(Optional)** Force the Popover state. Must be used together with `onOpenChange`. */
23
+ /** Force the Popover state. Must be used together with `onOpenChange`. */
24
24
  open?: RadixPopoverProps["open"]
25
25
  }
26
26
 
27
27
  interface PopoverTriggerProps extends RadixPopoverTriggerProps {
28
- /** **(Optional)** When true, the element passed as a child becomes the trigger root element. */
28
+ /** When true, the element passed as a child becomes the root element. */
29
29
  asChild?: RadixPopoverTriggerProps["asChild"]
30
- /** **(Optional)** Content inside the Popover Trigger. */
30
+ /** Content inside the component. */
31
31
  children?: React.ReactNode
32
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
32
+ /** Specify additional CSS classes. */
33
33
  className?: string
34
34
  }
35
35
 
36
36
  interface PopoverContentProps extends RadixPopoverContentProps {
37
- /** **(Optional)** Specify horizontal alignment of the Popover against the trigger. May change when collisions occur. */
37
+ /** Specify horizontal alignment of the Popover against the trigger. May change when collisions occur. */
38
38
  align?: RadixPopoverContentProps["align"]
39
- /** **(Optional)** Specify pixel offset from the "start" or "end" alignment. */
39
+ /** Specify pixel offset from the "start" or "end" alignment. */
40
40
  alignOffset?: RadixPopoverContentProps["alignOffset"]
41
- /** **(Optional)** Specify whether the Popover should reposition itself if it falls out of the viewport. */
41
+ /** Specify whether the Popover should reposition itself if it falls out of the viewport. */
42
42
  avoidCollisions?: RadixPopoverContentProps["avoidCollisions"]
43
- /** **(Optional)** Content inside the Popover window. */
43
+ /** Content inside the component.
44
+ *
45
+ * This can be any valid JSX including an optional `<Popover.Close>`.
46
+ */
44
47
  children?: React.ReactNode
45
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
48
+ /** Specify additional CSS classes. */
46
49
  className?: string
47
- /** **(Optional)** Specify pixel boundary for collision safe area. */
50
+ /** Specify pixel boundary for collision safe area. */
48
51
  collisionPadding?: RadixPopoverContentProps["collisionPadding"]
49
- /** **(Optional)** Specify a custom React ref for this component. */
52
+ /** Specify a custom React ref for this component. */
50
53
  ref?: Ref<HTMLDivElement>
51
- /** **(Optional)** Specify placement of the Popover against the trigger. Will change when collisions occur. */
54
+ /** Specify placement of the Popover against the trigger. Will change when collisions occur. */
52
55
  side?: RadixPopoverContentProps["side"]
53
- /** **(Optional)** Specify pixel offset from the trigger element. */
56
+ /** Specify pixel offset from the trigger element. */
54
57
  sideOffset?: RadixPopoverContentProps["sideOffset"]
55
58
  }
56
59
 
57
60
  interface PopoverCloseProps extends RadixPopoverCloseProps {
58
- /** **(Optional)** When true, the element passed as a child becomes the close button root element. */
61
+ /** When true, the element passed as a child becomes the root element. */
59
62
  asChild?: RadixPopoverCloseProps["asChild"]
60
- /** **(Optional)** Content inside the Popover Close element. */
63
+ /** Content inside the component. */
61
64
  children?: React.ReactNode
62
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
65
+ /** Specify additional CSS classes. */
63
66
  className?: string
64
67
  }
65
68
 
66
69
  interface PopoverAnchorProps extends RadixPopoverAnchorProps {
67
- /** **(Optional)** When true, the element passed as a child becomes the anchor root element. */
70
+ /** When true, the element passed as a child becomes the root element. */
68
71
  asChild?: RadixPopoverAnchorProps["asChild"]
69
- /** **(Optional)** Content inside the Popover Anchor element. */
72
+ /** Content inside the component. */
70
73
  children?: React.ReactNode
71
74
  }
72
75
 
@@ -5,22 +5,22 @@ import clsx from "clsx"
5
5
  import { StandardSizes } from "@/types"
6
6
 
7
7
  export interface ProseProps extends HTMLAttributes<HTMLDivElement> {
8
- /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
9
- children?: string | ReactNode
10
- /** **(Optional)** Specify additional CSS classes to be applied to the component. */
8
+ /** Content inside the component. */
9
+ children?: ReactNode
10
+ /** Specify additional CSS classes. */
11
11
  className?: string
12
- /** **(Optional)** Specify if the Prose container should stretch to 100% width.
12
+ /** Specify if the container should stretch to 100% width.
13
13
  *
14
14
  * If this not set, the container will be 100% width up to a maximum of 864px / 54rem */
15
15
  full?: boolean
16
- /** **(Optional)** Specify a custom React ref for this component. */
16
+ /** Specify a custom React ref for this component. */
17
17
  ref?: Ref<HTMLDivElement>
18
- /** **(Optional)** Specify font size behaviour. When set to `lg`, body copy will increase to 20px on larger screens.
18
+ /** Specify font size behaviour. When set to `lg`, body copy will increase to 20px on larger screens.
19
19
  *
20
20
  * Default: `md`
21
21
  */
22
22
  size?: "md" | "lg"
23
- /** **(Optional)** Specify the Prose spacing.
23
+ /** Specify the spacing.
24
24
  *
25
25
  * Default: `md`
26
26
  */