@coopdigital/react 1.22.3 → 1.22.5
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 +6 -6
- 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
|
@@ -31,44 +31,44 @@ const useDialog = () => {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "closedby"> {
|
|
34
|
-
/** Content inside the
|
|
34
|
+
/** Content inside the component.
|
|
35
35
|
*
|
|
36
|
-
* This should be a `<Dialog.Header>` and `<Dialog.Body
|
|
37
|
-
children
|
|
38
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
44
|
+
/** Specify the component id. Will be auto-generated if not set. */
|
|
45
45
|
id?: string
|
|
46
|
-
/** Specify an accessible label for the
|
|
46
|
+
/** Specify an accessible label for the Dialog that will be read out by screen readers. */
|
|
47
47
|
label: string
|
|
48
|
-
/**
|
|
48
|
+
/** Specify the Dialog mode.
|
|
49
49
|
*
|
|
50
50
|
* Default: `dialog`
|
|
51
51
|
*/
|
|
52
52
|
mode?: "sheet" | "dialog"
|
|
53
|
-
/**
|
|
53
|
+
/** Specify a callback to run when the Dialog closes. */
|
|
54
54
|
onClose?: ReactEventHandler<HTMLDialogElement>
|
|
55
|
-
/**
|
|
55
|
+
/** Specify a callback to run when the Dialog opens. */
|
|
56
56
|
onOpen?: ReactEventHandler<HTMLDialogElement>
|
|
57
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
69
|
+
/** Specify a custom React ref for this component. */
|
|
70
70
|
ref?: Ref<HTMLDialogElement>
|
|
71
|
-
/**
|
|
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
|
-
/**
|
|
79
|
+
/** Content inside the component. */
|
|
80
80
|
children?: React.ReactNode
|
|
81
|
-
/**
|
|
81
|
+
/** Specify additional CSS classes. */
|
|
82
82
|
className?: string
|
|
83
|
-
/**
|
|
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
|
-
/**
|
|
90
|
+
/** Content inside the component. */
|
|
91
91
|
children?: React.ReactNode
|
|
92
|
-
/**
|
|
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
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
21
|
+
/** Content inside the component. */
|
|
20
22
|
children?: React.ReactNode
|
|
21
|
-
/**
|
|
23
|
+
/** Specify additional CSS classes. */
|
|
22
24
|
className?: string
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
interface ExpandableContentProps extends HTMLAttributes<HTMLElement> {
|
|
26
|
-
/**
|
|
28
|
+
/** Content inside the component. */
|
|
27
29
|
children?: React.ReactNode
|
|
28
|
-
/**
|
|
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
|
-
/**
|
|
17
|
+
/** Specify whether the Field should render inside a box. */
|
|
18
18
|
boxed?: boolean
|
|
19
|
-
/**
|
|
19
|
+
/** Content inside the component.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
children
|
|
23
|
-
/**
|
|
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
|
-
/**
|
|
25
|
+
/** Specify the component error state. */
|
|
26
26
|
error?: boolean
|
|
27
|
-
/**
|
|
27
|
+
/** Specify whether the Field should show the left-hand error bar if it is in an error state. */
|
|
28
28
|
hideErrorBar?: boolean
|
|
29
|
-
/**
|
|
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
|
-
/**
|
|
7
|
-
children?:
|
|
8
|
-
/**
|
|
6
|
+
/** Content inside the component. */
|
|
7
|
+
children?: ReactNode
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string
|
|
10
|
-
/**
|
|
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
|
-
/**
|
|
7
|
-
children?:
|
|
8
|
-
/**
|
|
6
|
+
/** Content inside the component. */
|
|
7
|
+
children?: ReactNode
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string
|
|
10
|
-
/**
|
|
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
|
-
/**
|
|
8
|
-
children?:
|
|
9
|
-
/**
|
|
7
|
+
/** Content inside the component. */
|
|
8
|
+
children?: React.ReactNode
|
|
9
|
+
/** Specify additional CSS classes. */
|
|
10
10
|
className?: string
|
|
11
|
-
/**
|
|
11
|
+
/** Specify whether the Label is visible to humans or screen readers only. */
|
|
12
12
|
isVisible?: boolean
|
|
13
|
-
/**
|
|
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:
|
|
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
|
-
/**
|
|
6
|
-
children?:
|
|
7
|
-
/**
|
|
5
|
+
/** Content inside the component. */
|
|
6
|
+
children?: React.ReactNode
|
|
7
|
+
/** Specify additional CSS classes. */
|
|
8
8
|
className?: string
|
|
9
|
-
/**
|
|
9
|
+
/** Specify whether the Legend is visible to humans or screen readers only. */
|
|
10
10
|
isVisible?: boolean
|
|
11
|
-
/**
|
|
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
|
-
/**
|
|
10
|
+
/** Content inside the component.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
children
|
|
14
|
-
/**
|
|
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
|
-
/**
|
|
16
|
+
/** Specify the disabled state. Applies to all descendants. */
|
|
17
17
|
disabled?: boolean
|
|
18
|
-
/**
|
|
18
|
+
/** Specify the component error state. */
|
|
19
19
|
error?: boolean
|
|
20
|
-
/**
|
|
20
|
+
/** Specify whether the Fieldset should show the left-hand error bar if it is in an error state. */
|
|
21
21
|
hideErrorBar?: boolean
|
|
22
|
-
/**
|
|
22
|
+
/** Specify a custom React ref for this component. */
|
|
23
23
|
ref?: Ref<HTMLFieldSetElement>
|
|
24
|
-
/**
|
|
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
|
-
/**
|
|
55
|
+
/** Specify whether all descendant Fields should render inside a box. */
|
|
56
56
|
boxed?: boolean
|
|
57
|
-
/**
|
|
58
|
-
children?:
|
|
59
|
-
/**
|
|
57
|
+
/** Content inside the component. */
|
|
58
|
+
children?: React.ReactNode
|
|
59
|
+
/** Specify additional CSS classes. */
|
|
60
60
|
className?: string
|
|
61
|
-
/**
|
|
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
|
-
/**
|
|
9
|
-
children
|
|
10
|
-
/**
|
|
8
|
+
/** Content inside the component. */
|
|
9
|
+
children?: ReactNode
|
|
10
|
+
/** Specify additional CSS classes. */
|
|
11
11
|
className?: string
|
|
12
|
-
/**
|
|
12
|
+
/** Specify the Flourish color. */
|
|
13
13
|
fill?: Darks | Lights | Tints | OfferRed | BrandBlue | White | Black
|
|
14
|
-
/**
|
|
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
|
-
/**
|
|
7
|
-
children?:
|
|
8
|
-
/**
|
|
6
|
+
/** Content inside the component. */
|
|
7
|
+
children?: ReactNode
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string
|
|
10
|
-
/**
|
|
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
|
|
4
|
+
/** Specify text to describe the Image. */
|
|
5
5
|
alt: string
|
|
6
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
8
|
+
/** Specify additional CSS classes. */
|
|
9
9
|
className?: string
|
|
10
|
-
/**
|
|
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
|
-
/**
|
|
5
|
+
/** Specify alternative text for the Logo.
|
|
6
|
+
*
|
|
7
|
+
* Default: `Co-op`.
|
|
8
|
+
*/
|
|
6
9
|
alt?: string
|
|
7
|
-
/**
|
|
10
|
+
/** Specify additional CSS classes. */
|
|
8
11
|
className?: string
|
|
9
|
-
/**
|
|
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
|
-
*
|
|
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={
|
|
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
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
/**
|
|
12
|
+
/** Specify the crop mode. */
|
|
11
13
|
crop?: "square" | "wide" | "thin" | "squircle" | "none"
|
|
12
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
17
|
+
/** Content inside the component.
|
|
18
|
+
*
|
|
19
|
+
* This can be any valid JSX including an optional `<Pill.Badge>`. */
|
|
15
20
|
children?: React.ReactNode
|
|
16
|
-
/**
|
|
21
|
+
/** Specify additional CSS classes. */
|
|
17
22
|
className?: string
|
|
18
|
-
/**
|
|
23
|
+
/** Specify the target URL. */
|
|
19
24
|
href?: string
|
|
20
|
-
/**
|
|
25
|
+
/** Specify a custom React ref for this component. */
|
|
21
26
|
ref?: Ref<HTMLElement>
|
|
22
|
-
/**
|
|
27
|
+
/** Specify the component size. */
|
|
23
28
|
size?: StandardSizes
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
interface PillBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
27
|
-
/**
|
|
32
|
+
/** Content inside the component. */
|
|
28
33
|
children?: React.ReactNode
|
|
29
|
-
/**
|
|
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
|
|
17
|
+
/** Content inside the component.
|
|
18
18
|
*
|
|
19
|
-
* This should be a
|
|
20
|
-
children
|
|
21
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
28
|
+
/** When true, the element passed as a child becomes the root element. */
|
|
29
29
|
asChild?: RadixPopoverTriggerProps["asChild"]
|
|
30
|
-
/**
|
|
30
|
+
/** Content inside the component. */
|
|
31
31
|
children?: React.ReactNode
|
|
32
|
-
/**
|
|
32
|
+
/** Specify additional CSS classes. */
|
|
33
33
|
className?: string
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface PopoverContentProps extends RadixPopoverContentProps {
|
|
37
|
-
/**
|
|
37
|
+
/** Specify horizontal alignment of the Popover against the trigger. May change when collisions occur. */
|
|
38
38
|
align?: RadixPopoverContentProps["align"]
|
|
39
|
-
/**
|
|
39
|
+
/** Specify pixel offset from the "start" or "end" alignment. */
|
|
40
40
|
alignOffset?: RadixPopoverContentProps["alignOffset"]
|
|
41
|
-
/**
|
|
41
|
+
/** Specify whether the Popover should reposition itself if it falls out of the viewport. */
|
|
42
42
|
avoidCollisions?: RadixPopoverContentProps["avoidCollisions"]
|
|
43
|
-
/**
|
|
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
|
-
/**
|
|
48
|
+
/** Specify additional CSS classes. */
|
|
46
49
|
className?: string
|
|
47
|
-
/**
|
|
50
|
+
/** Specify pixel boundary for collision safe area. */
|
|
48
51
|
collisionPadding?: RadixPopoverContentProps["collisionPadding"]
|
|
49
|
-
/**
|
|
52
|
+
/** Specify a custom React ref for this component. */
|
|
50
53
|
ref?: Ref<HTMLDivElement>
|
|
51
|
-
/**
|
|
54
|
+
/** Specify placement of the Popover against the trigger. Will change when collisions occur. */
|
|
52
55
|
side?: RadixPopoverContentProps["side"]
|
|
53
|
-
/**
|
|
56
|
+
/** Specify pixel offset from the trigger element. */
|
|
54
57
|
sideOffset?: RadixPopoverContentProps["sideOffset"]
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
interface PopoverCloseProps extends RadixPopoverCloseProps {
|
|
58
|
-
/**
|
|
61
|
+
/** When true, the element passed as a child becomes the root element. */
|
|
59
62
|
asChild?: RadixPopoverCloseProps["asChild"]
|
|
60
|
-
/**
|
|
63
|
+
/** Content inside the component. */
|
|
61
64
|
children?: React.ReactNode
|
|
62
|
-
/**
|
|
65
|
+
/** Specify additional CSS classes. */
|
|
63
66
|
className?: string
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
interface PopoverAnchorProps extends RadixPopoverAnchorProps {
|
|
67
|
-
/**
|
|
70
|
+
/** When true, the element passed as a child becomes the root element. */
|
|
68
71
|
asChild?: RadixPopoverAnchorProps["asChild"]
|
|
69
|
-
/**
|
|
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
|
-
/**
|
|
9
|
-
children?:
|
|
10
|
-
/**
|
|
8
|
+
/** Content inside the component. */
|
|
9
|
+
children?: ReactNode
|
|
10
|
+
/** Specify additional CSS classes. */
|
|
11
11
|
className?: string
|
|
12
|
-
/**
|
|
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
|
-
/**
|
|
16
|
+
/** Specify a custom React ref for this component. */
|
|
17
17
|
ref?: Ref<HTMLDivElement>
|
|
18
|
-
/**
|
|
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
|
-
/**
|
|
23
|
+
/** Specify the spacing.
|
|
24
24
|
*
|
|
25
25
|
* Default: `md`
|
|
26
26
|
*/
|