@abgov/react-components 5.0.0 → 5.2.0
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/index.d.ts +4 -0
- package/index.js +186 -58
- package/index.js.map +1 -1
- package/index.mjs +186 -58
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +1 -0
- package/lib/app-header/app-header.d.ts +1 -0
- package/lib/app-header-menu/app-header-menu.d.ts +1 -0
- package/lib/badge/badge.d.ts +1 -0
- package/lib/block/block.d.ts +1 -0
- package/lib/button/button.d.ts +1 -0
- package/lib/button-group/button-group.d.ts +1 -0
- package/lib/calendar/calendar.d.ts +1 -0
- package/lib/callout/callout.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +2 -1
- package/lib/chip/chip.d.ts +1 -0
- package/lib/circular-progress/circular-progress.d.ts +1 -0
- package/lib/container/container.d.ts +1 -0
- package/lib/date-picker/date-picker.d.ts +7 -2
- package/lib/details/details.d.ts +1 -0
- package/lib/divider/divider.d.ts +4 -1
- package/lib/dropdown/dropdown.d.ts +2 -1
- package/lib/fieldset/fieldset.d.ts +29 -0
- package/lib/file-upload-card/file-upload-card.d.ts +1 -0
- package/lib/file-upload-input/file-upload-input.d.ts +1 -0
- package/lib/footer/footer.d.ts +1 -0
- package/lib/footer-meta-section/footer-meta-section.d.ts +4 -1
- package/lib/footer-nav-section/footer-nav-section.d.ts +1 -0
- package/lib/form-item/form-item.d.ts +1 -0
- package/lib/form-stepper/form-stepper.d.ts +1 -0
- package/lib/grid/grid.d.ts +1 -0
- package/lib/hero-banner/hero-banner.d.ts +1 -0
- package/lib/icon-button/icon-button.d.ts +1 -0
- package/lib/input/input.d.ts +4 -3
- package/lib/link/link.d.ts +21 -0
- package/lib/link-button/link-button.d.ts +24 -0
- package/lib/microsite-header/microsite-header.d.ts +6 -2
- package/lib/modal/modal.d.ts +1 -0
- package/lib/notification/notification.d.ts +1 -0
- package/lib/page-block/page-block.d.ts +1 -0
- package/lib/pagination/pagination.d.ts +1 -0
- package/lib/popover/popover.d.ts +1 -0
- package/lib/radio-group/radio-group.d.ts +2 -1
- package/lib/side-menu/side-menu.d.ts +4 -1
- package/lib/side-menu-group/side-menu-group.d.ts +1 -0
- package/lib/side-menu-heading/side-menu-heading.d.ts +1 -0
- package/lib/skeleton/skeleton.d.ts +1 -0
- package/lib/spacer/spacer.d.ts +1 -0
- package/lib/spinner/spinner.d.ts +1 -0
- package/lib/table/table.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +1 -0
- package/lib/text/text.d.ts +28 -0
- package/lib/textarea/textarea.d.ts +2 -1
- package/lib/tooltip/tooltip.d.ts +1 -0
- package/package.json +1 -1
package/lib/badge/badge.d.ts
CHANGED
package/lib/block/block.d.ts
CHANGED
package/lib/button/button.d.ts
CHANGED
package/lib/callout/callout.d.ts
CHANGED
|
@@ -18,11 +18,12 @@ interface WCProps extends Margins {
|
|
|
18
18
|
arialabel?: string;
|
|
19
19
|
description?: string | React.ReactNode;
|
|
20
20
|
maxwidth?: string;
|
|
21
|
+
testid?: string;
|
|
21
22
|
}
|
|
22
23
|
export interface GoACheckboxProps extends Margins {
|
|
23
24
|
id?: string;
|
|
24
25
|
name: string;
|
|
25
|
-
checked
|
|
26
|
+
checked?: boolean;
|
|
26
27
|
disabled?: boolean;
|
|
27
28
|
error?: boolean;
|
|
28
29
|
text?: string;
|
package/lib/chip/chip.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ interface WCProps extends Margins {
|
|
|
6
6
|
error?: boolean;
|
|
7
7
|
min?: string;
|
|
8
8
|
max?: string;
|
|
9
|
+
relative?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
testid?: string;
|
|
9
12
|
}
|
|
10
13
|
declare global {
|
|
11
14
|
namespace JSX {
|
|
@@ -21,7 +24,9 @@ export interface GoADatePickerProps extends Margins {
|
|
|
21
24
|
min?: Date;
|
|
22
25
|
max?: Date;
|
|
23
26
|
testId?: string;
|
|
24
|
-
|
|
27
|
+
relative?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
onChange?: (name: string, value: Date | undefined) => void;
|
|
25
30
|
}
|
|
26
|
-
export declare function GoADatePicker({ name, value, error, min, max, testId, mt, mr, mb, ml, onChange, }: GoADatePickerProps): JSX.Element;
|
|
31
|
+
export declare function GoADatePicker({ name, value, error, min, max, testId, disabled, mt, mr, mb, ml, relative, onChange, }: GoADatePickerProps): JSX.Element;
|
|
27
32
|
export default GoADatePicker;
|
package/lib/details/details.d.ts
CHANGED
package/lib/divider/divider.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Margins } from "../../common/styling";
|
|
2
|
+
interface WCProps extends Margins {
|
|
3
|
+
testid?: string;
|
|
4
|
+
}
|
|
2
5
|
declare global {
|
|
3
6
|
namespace JSX {
|
|
4
7
|
interface IntrinsicElements {
|
|
5
|
-
"goa-divider":
|
|
8
|
+
"goa-divider": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
6
9
|
}
|
|
7
10
|
}
|
|
8
11
|
}
|
|
@@ -17,6 +17,7 @@ interface WCProps extends Margins {
|
|
|
17
17
|
width?: string;
|
|
18
18
|
relative?: boolean;
|
|
19
19
|
id?: string;
|
|
20
|
+
testid?: string;
|
|
20
21
|
}
|
|
21
22
|
declare global {
|
|
22
23
|
namespace JSX {
|
|
@@ -28,7 +29,7 @@ declare global {
|
|
|
28
29
|
export interface GoADropdownProps extends Margins {
|
|
29
30
|
name?: string;
|
|
30
31
|
value?: string[] | string;
|
|
31
|
-
onChange
|
|
32
|
+
onChange?: (name: string, values: string[] | string) => void;
|
|
32
33
|
ariaLabel?: string;
|
|
33
34
|
ariaLabelledBy?: string;
|
|
34
35
|
id?: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
ref?: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
+
id: string;
|
|
6
|
+
heading?: string;
|
|
7
|
+
buttontext?: string;
|
|
8
|
+
last?: boolean | null;
|
|
9
|
+
first?: boolean | null;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
"goa-fieldset": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
interface GoAFieldsetProps extends Margins {
|
|
19
|
+
id: string;
|
|
20
|
+
first?: boolean;
|
|
21
|
+
last?: boolean;
|
|
22
|
+
heading?: string;
|
|
23
|
+
buttonText?: string;
|
|
24
|
+
errors?: Record<string, string>;
|
|
25
|
+
onContinue?: (el: HTMLElement, state: Record<string, string>) => boolean | void | undefined;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare function GoAFieldset({ heading, buttonText, id, onContinue, children, mt, mr, mb, ml, first, last, }: GoAFieldsetProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export default GoAFieldset;
|
package/lib/footer/footer.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
interface WCProps {
|
|
3
|
+
testid?: string;
|
|
4
|
+
}
|
|
2
5
|
declare global {
|
|
3
6
|
namespace JSX {
|
|
4
7
|
interface IntrinsicElements {
|
|
5
|
-
"goa-app-footer-meta-section": React.HTMLAttributes<HTMLElement>;
|
|
8
|
+
"goa-app-footer-meta-section": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
6
9
|
}
|
|
7
10
|
}
|
|
8
11
|
}
|
package/lib/grid/grid.d.ts
CHANGED
package/lib/input/input.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ interface WCProps extends Margins {
|
|
|
24
24
|
prefix?: string;
|
|
25
25
|
suffix?: string;
|
|
26
26
|
arialabel?: string;
|
|
27
|
+
testid?: string;
|
|
27
28
|
min?: string | number;
|
|
28
29
|
max?: string | number;
|
|
29
30
|
step?: number;
|
|
@@ -64,7 +65,7 @@ type OnFocus<T = string> = (name: string, value: T) => void;
|
|
|
64
65
|
type OnBlur<T = string> = (name: string, value: T) => void;
|
|
65
66
|
type OnKeyPress<T = string> = (name: string, value: T, key: string) => void;
|
|
66
67
|
export interface GoAInputProps extends BaseProps {
|
|
67
|
-
onChange
|
|
68
|
+
onChange?: OnChange<string>;
|
|
68
69
|
value?: string;
|
|
69
70
|
min?: number | string;
|
|
70
71
|
max?: number | string;
|
|
@@ -74,7 +75,7 @@ export interface GoAInputProps extends BaseProps {
|
|
|
74
75
|
onKeyPress?: OnKeyPress<string>;
|
|
75
76
|
}
|
|
76
77
|
interface GoANumberInputProps extends BaseProps {
|
|
77
|
-
onChange
|
|
78
|
+
onChange?: OnChange<number>;
|
|
78
79
|
value?: number;
|
|
79
80
|
min?: number;
|
|
80
81
|
max?: number;
|
|
@@ -84,7 +85,7 @@ interface GoANumberInputProps extends BaseProps {
|
|
|
84
85
|
onKeyPress?: OnKeyPress<number>;
|
|
85
86
|
}
|
|
86
87
|
interface GoADateInputProps extends BaseProps {
|
|
87
|
-
onChange
|
|
88
|
+
onChange?: OnChange<GoADate>;
|
|
88
89
|
value?: GoADate;
|
|
89
90
|
min?: GoADate;
|
|
90
91
|
max?: GoADate;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
import { GoAIconType } from "../icon/icon";
|
|
4
|
+
interface WCProps extends Margins {
|
|
5
|
+
leadingicon?: GoAIconType;
|
|
6
|
+
trailingicon?: GoAIconType;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
namespace JSX {
|
|
10
|
+
interface IntrinsicElements {
|
|
11
|
+
"goa-link": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
interface GoALinkProps extends Margins {
|
|
16
|
+
leadingIcon?: GoAIconType;
|
|
17
|
+
trailingIcon?: GoAIconType;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function GoALink(props: GoALinkProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default GoALink;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
import { GoAIconType } from "../icon/icon";
|
|
4
|
+
export type GoALinkButtonType = "start" | "primary" | "secondary" | "tertiary";
|
|
5
|
+
interface WCProps extends Margins {
|
|
6
|
+
type?: GoALinkButtonType;
|
|
7
|
+
leadingicon?: GoAIconType;
|
|
8
|
+
trailingicon?: GoAIconType;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
namespace JSX {
|
|
12
|
+
interface IntrinsicElements {
|
|
13
|
+
"goa-link-button": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
interface GoALinkButtonProps extends Margins {
|
|
18
|
+
type?: GoALinkButtonType;
|
|
19
|
+
leadingIcon?: GoAIconType;
|
|
20
|
+
trailingIcon?: GoAIconType;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function GoALinkButton({ type, ...props }: GoALinkButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default GoALinkButton;
|
|
@@ -15,16 +15,20 @@ interface WCProps {
|
|
|
15
15
|
maxcontentwidth?: string;
|
|
16
16
|
feedbackurltarget?: GoALinkTarget;
|
|
17
17
|
headerurltarget?: GoALinkTarget;
|
|
18
|
+
hasfeedbackhandler?: boolean;
|
|
19
|
+
ref: React.RefObject<HTMLElement>;
|
|
20
|
+
testid?: string;
|
|
18
21
|
}
|
|
19
22
|
export interface GoAHeaderProps {
|
|
20
23
|
type: GoAServiceLevel;
|
|
21
|
-
version?:
|
|
24
|
+
version?: React.ReactNode;
|
|
22
25
|
feedbackUrl?: string;
|
|
23
26
|
testId?: string;
|
|
24
27
|
maxContentWidth?: string;
|
|
25
28
|
feedbackUrlTarget?: GoALinkTarget;
|
|
26
29
|
headerUrlTarget?: GoALinkTarget;
|
|
30
|
+
onFeedbackClick?: () => void;
|
|
27
31
|
}
|
|
28
32
|
export type HeaderProps = GoAHeaderProps;
|
|
29
|
-
export declare function GoAMicrositeHeader({ type, version, feedbackUrl, maxContentWidth, feedbackUrlTarget, headerUrlTarget, testId, }: GoAHeaderProps): JSX.Element;
|
|
33
|
+
export declare function GoAMicrositeHeader({ type, version, feedbackUrl, maxContentWidth, feedbackUrlTarget, headerUrlTarget, testId, onFeedbackClick, }: GoAHeaderProps): JSX.Element;
|
|
30
34
|
export default GoAMicrositeHeader;
|
package/lib/modal/modal.d.ts
CHANGED
package/lib/popover/popover.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ interface WCProps extends Margins {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
error?: boolean;
|
|
11
11
|
arialabel?: string;
|
|
12
|
+
testid?: string;
|
|
12
13
|
}
|
|
13
14
|
declare global {
|
|
14
15
|
namespace JSX {
|
|
@@ -26,7 +27,7 @@ export interface GoARadioGroupProps extends Margins {
|
|
|
26
27
|
error?: boolean;
|
|
27
28
|
ariaLabel?: string;
|
|
28
29
|
children?: React.ReactNode;
|
|
29
|
-
onChange
|
|
30
|
+
onChange?: (name: string, value: string) => void;
|
|
30
31
|
}
|
|
31
32
|
export declare function GoARadioGroup({ name, value, children, orientation, disabled, error, testId, ariaLabel, mt, mr, mb, ml, onChange, }: GoARadioGroupProps): JSX.Element;
|
|
32
33
|
export default GoARadioGroup;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
interface WCProps {
|
|
3
|
+
testid?: string;
|
|
4
|
+
}
|
|
2
5
|
declare global {
|
|
3
6
|
namespace JSX {
|
|
4
7
|
interface IntrinsicElements {
|
|
5
|
-
"goa-side-menu": React.HTMLAttributes<HTMLElement>;
|
|
8
|
+
"goa-side-menu": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
6
9
|
}
|
|
7
10
|
}
|
|
8
11
|
}
|
package/lib/spacer/spacer.d.ts
CHANGED
package/lib/spinner/spinner.d.ts
CHANGED
package/lib/table/table.d.ts
CHANGED
package/lib/tabs/tabs.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
type MaxWidth = string | "none";
|
|
4
|
+
interface WCProps extends Margins {
|
|
5
|
+
as?: TextElement | HeadingElement;
|
|
6
|
+
size?: Size;
|
|
7
|
+
maxwidth?: MaxWidth;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
namespace JSX {
|
|
11
|
+
interface IntrinsicElements {
|
|
12
|
+
"goa-text": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5";
|
|
17
|
+
export type TextElement = "span" | "div" | "p";
|
|
18
|
+
type HeadingSize = "heading-xl" | "heading-l" | "heading-m" | "heading-s" | "heading-xs";
|
|
19
|
+
type BodySize = "body-l" | "body-m" | "body-s" | "body-xs";
|
|
20
|
+
export type Size = HeadingSize | BodySize;
|
|
21
|
+
interface GoATextProps extends Margins {
|
|
22
|
+
as?: TextElement | HeadingElement;
|
|
23
|
+
size?: Size;
|
|
24
|
+
maxWidth?: MaxWidth;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function GoAText(props: GoATextProps): JSX.Element;
|
|
28
|
+
export default GoAText;
|
|
@@ -13,6 +13,7 @@ interface WCProps extends Margins {
|
|
|
13
13
|
arialabel?: string;
|
|
14
14
|
countby?: CountBy;
|
|
15
15
|
maxcount?: number;
|
|
16
|
+
testid?: string;
|
|
16
17
|
}
|
|
17
18
|
declare global {
|
|
18
19
|
namespace JSX {
|
|
@@ -35,7 +36,7 @@ export interface GoATextAreaProps extends Margins {
|
|
|
35
36
|
ariaLabel?: string;
|
|
36
37
|
countBy?: CountBy;
|
|
37
38
|
maxCount?: number;
|
|
38
|
-
onChange
|
|
39
|
+
onChange?: (name: string, value: string) => void;
|
|
39
40
|
onKeyPress?: (name: string, value: string, key: string) => void;
|
|
40
41
|
}
|
|
41
42
|
export declare function GoATextarea({ name, value, placeholder, rows, disabled, countBy, maxCount, width, maxWidth, testId, error, ariaLabel, mt, mr, mb, ml, onChange, onKeyPress, }: GoATextAreaProps): JSX.Element;
|
package/lib/tooltip/tooltip.d.ts
CHANGED