@abgov/react-components 5.0.0-alpha.7 → 5.0.0-alpha.8
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 +109 -7
- package/index.js.map +1 -1
- package/index.mjs +109 -7
- package/index.mjs.map +1 -1
- package/lib/checkbox/checkbox.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +1 -1
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/fieldset/fieldset.d.ts +29 -0
- package/lib/input/input.d.ts +3 -3
- package/lib/link/link.d.ts +21 -0
- package/lib/link-button/link-button.d.ts +24 -0
- package/lib/radio-group/radio-group.d.ts +1 -1
- package/lib/text/text.d.ts +28 -0
- package/lib/textarea/textarea.d.ts +1 -1
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ export interface GoADatePickerProps extends Margins {
|
|
|
26
26
|
testId?: string;
|
|
27
27
|
relative?: boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
|
-
onChange
|
|
29
|
+
onChange?: (name: string, value: Date | undefined) => void;
|
|
30
30
|
}
|
|
31
31
|
export declare function GoADatePicker({ name, value, error, min, max, testId, disabled, mt, mr, mb, ml, relative, onChange, }: GoADatePickerProps): JSX.Element;
|
|
32
32
|
export default GoADatePicker;
|
|
@@ -29,7 +29,7 @@ declare global {
|
|
|
29
29
|
export interface GoADropdownProps extends Margins {
|
|
30
30
|
name?: string;
|
|
31
31
|
value?: string[] | string;
|
|
32
|
-
onChange
|
|
32
|
+
onChange?: (name: string, values: string[] | string) => void;
|
|
33
33
|
ariaLabel?: string;
|
|
34
34
|
ariaLabelledBy?: string;
|
|
35
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/input/input.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ type OnFocus<T = string> = (name: string, value: T) => void;
|
|
|
65
65
|
type OnBlur<T = string> = (name: string, value: T) => void;
|
|
66
66
|
type OnKeyPress<T = string> = (name: string, value: T, key: string) => void;
|
|
67
67
|
export interface GoAInputProps extends BaseProps {
|
|
68
|
-
onChange
|
|
68
|
+
onChange?: OnChange<string>;
|
|
69
69
|
value?: string;
|
|
70
70
|
min?: number | string;
|
|
71
71
|
max?: number | string;
|
|
@@ -75,7 +75,7 @@ export interface GoAInputProps extends BaseProps {
|
|
|
75
75
|
onKeyPress?: OnKeyPress<string>;
|
|
76
76
|
}
|
|
77
77
|
interface GoANumberInputProps extends BaseProps {
|
|
78
|
-
onChange
|
|
78
|
+
onChange?: OnChange<number>;
|
|
79
79
|
value?: number;
|
|
80
80
|
min?: number;
|
|
81
81
|
max?: number;
|
|
@@ -85,7 +85,7 @@ interface GoANumberInputProps extends BaseProps {
|
|
|
85
85
|
onKeyPress?: OnKeyPress<number>;
|
|
86
86
|
}
|
|
87
87
|
interface GoADateInputProps extends BaseProps {
|
|
88
|
-
onChange
|
|
88
|
+
onChange?: OnChange<GoADate>;
|
|
89
89
|
value?: GoADate;
|
|
90
90
|
min?: GoADate;
|
|
91
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;
|
|
@@ -27,7 +27,7 @@ export interface GoARadioGroupProps extends Margins {
|
|
|
27
27
|
error?: boolean;
|
|
28
28
|
ariaLabel?: string;
|
|
29
29
|
children?: React.ReactNode;
|
|
30
|
-
onChange
|
|
30
|
+
onChange?: (name: string, value: string) => void;
|
|
31
31
|
}
|
|
32
32
|
export declare function GoARadioGroup({ name, value, children, orientation, disabled, error, testId, ariaLabel, mt, mr, mb, ml, onChange, }: GoARadioGroupProps): JSX.Element;
|
|
33
33
|
export default GoARadioGroup;
|
|
@@ -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;
|
|
@@ -36,7 +36,7 @@ export interface GoATextAreaProps extends Margins {
|
|
|
36
36
|
ariaLabel?: string;
|
|
37
37
|
countBy?: CountBy;
|
|
38
38
|
maxCount?: number;
|
|
39
|
-
onChange
|
|
39
|
+
onChange?: (name: string, value: string) => void;
|
|
40
40
|
onKeyPress?: (name: string, value: string, key: string) => void;
|
|
41
41
|
}
|
|
42
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;
|