@abgov/react-components 4.4.0 → 4.6.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/README.md +10 -7
- package/index.d.ts +3 -0
- package/lib/accordion/accordion.d.ts +27 -0
- package/lib/app-header/app-header.d.ts +1 -0
- package/lib/badge/badge.d.ts +0 -1
- 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/callout/callout.d.ts +2 -1
- package/lib/card/card.d.ts +1 -0
- package/lib/chip/chip.d.ts +2 -1
- package/lib/circular-progress/circular-progress.d.ts +2 -1
- package/lib/container/container.d.ts +1 -0
- package/lib/details/details.d.ts +18 -0
- package/lib/divider/divider.d.ts +3 -1
- package/lib/dropdown/dropdown.d.ts +0 -1
- package/lib/footer/footer.d.ts +2 -1
- package/lib/footer-nav-section/footer-nav-section.d.ts +2 -1
- package/lib/form/form-item.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/icon.d.ts +2 -1
- package/lib/icon-button/icon-button.d.ts +1 -0
- package/lib/input/input.d.ts +2 -1
- package/lib/microsite-header/microsite-header.d.ts +1 -0
- package/lib/modal/modal.d.ts +1 -0
- package/lib/notification/notification.d.ts +4 -1
- package/lib/page-block/page-block.d.ts +1 -0
- package/lib/pagination/pagination.d.ts +26 -0
- package/lib/skeleton/skeleton.d.ts +2 -1
- package/lib/spacer/spacer.d.ts +1 -0
- package/lib/spinner/spinner.d.ts +0 -1
- package/lib/table/table.d.ts +3 -0
- package/package.json +1 -1
- package/react-components.esm.js +3260 -1635
- package/react-components.umd.js +3248 -1623
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# React UI Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This library contains react components from the Government of Alberta.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm i @abgov/react-components
|
|
9
|
-
npm i @abgov/web-components
|
|
10
|
-
npm i @abgov/styles@alpha
|
|
8
|
+
npm i @abgov/react-components
|
|
9
|
+
npm i @abgov/web-components
|
|
11
10
|
```
|
|
12
11
|
|
|
13
12
|
Link ionicons in app/index.html
|
|
@@ -24,8 +23,12 @@ Add the following to the head element
|
|
|
24
23
|
></script>
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
Import the styles in the `src/index.css` file
|
|
26
|
+
Import the web-component styles in the `src/index.css` file
|
|
28
27
|
|
|
29
28
|
```css
|
|
30
|
-
@import "@abgov/
|
|
29
|
+
@import "@abgov/web-components/index.css";
|
|
31
30
|
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
[Visit Design System](https://ui-components.alberta.ca)
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@abgov/web-components";
|
|
2
2
|
export type { GoAIconType } from "./lib/icon/icon";
|
|
3
3
|
export type { GoABadgeType } from "./lib/badge/badge";
|
|
4
|
+
export * from "./lib/accordion/accordion";
|
|
4
5
|
export * from "./lib/app-header/app-header";
|
|
5
6
|
export * from "./lib/badge/badge";
|
|
6
7
|
export * from "./lib/block/block";
|
|
@@ -11,6 +12,7 @@ export * from "./lib/checkbox/checkbox";
|
|
|
11
12
|
export * from "./lib/chip/chip";
|
|
12
13
|
export * from "./lib/circular-progress/circular-progress";
|
|
13
14
|
export * from "./lib/container/container";
|
|
15
|
+
export * from "./lib/details/details";
|
|
14
16
|
export * from "./lib/divider/divider";
|
|
15
17
|
export * from "./lib/dropdown/dropdown";
|
|
16
18
|
export * from "./lib/dropdown/dropdown-item";
|
|
@@ -30,6 +32,7 @@ export * from "./lib/notification/notification";
|
|
|
30
32
|
export * from "./lib/one-column-layout/one-column-layout";
|
|
31
33
|
export * from "./lib/page-block/page-block";
|
|
32
34
|
export * from "./lib/radio-group/radio-group";
|
|
35
|
+
export * from "./lib/pagination/pagination";
|
|
33
36
|
export * from "./lib/skeleton/skeleton";
|
|
34
37
|
export * from "./lib/spacer/spacer";
|
|
35
38
|
export * from "./lib/spinner/spinner";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
declare type HeadingSize = "small" | "medium";
|
|
4
|
+
interface WCProps extends Margins {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
headingSize?: HeadingSize;
|
|
7
|
+
heading: string;
|
|
8
|
+
secondaryText?: string;
|
|
9
|
+
headingContent?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
"goa-accordion": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
interface Props extends Margins {
|
|
19
|
+
open?: boolean;
|
|
20
|
+
headingSize?: HeadingSize;
|
|
21
|
+
secondaryText?: string;
|
|
22
|
+
heading: string;
|
|
23
|
+
headingContent?: ReactNode;
|
|
24
|
+
testid?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const GoAAccordion: FC<Props>;
|
|
27
|
+
export default GoAAccordion;
|
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
|
@@ -15,7 +15,8 @@ declare global {
|
|
|
15
15
|
export interface CalloutProps extends Margins {
|
|
16
16
|
heading?: string;
|
|
17
17
|
type?: CalloutType;
|
|
18
|
+
testId?: string;
|
|
18
19
|
children?: React.ReactNode;
|
|
19
20
|
}
|
|
20
|
-
export declare const GoACallout: ({ heading, type, children, mt, mr, mb, ml, }: CalloutProps) => JSX.Element;
|
|
21
|
+
export declare const GoACallout: ({ heading, type, testId, children, mt, mr, mb, ml, }: CalloutProps) => JSX.Element;
|
|
21
22
|
export default GoACallout;
|
package/lib/card/card.d.ts
CHANGED
package/lib/chip/chip.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface Props extends Margins {
|
|
|
23
23
|
error?: boolean;
|
|
24
24
|
content: string;
|
|
25
25
|
variant?: ChipVariant;
|
|
26
|
+
testId?: string;
|
|
26
27
|
}
|
|
27
|
-
export declare const GoAChip: ({ leadingIcon, deletable, error, variant, content, onClick, mt, mr, mb, ml, }: Props) => JSX.Element;
|
|
28
|
+
export declare const GoAChip: ({ leadingIcon, deletable, error, variant, content, onClick, mt, mr, mb, ml, testId, }: Props) => JSX.Element;
|
|
28
29
|
export default GoAChip;
|
|
@@ -21,6 +21,7 @@ export interface CircularProgressProps {
|
|
|
21
21
|
message?: string;
|
|
22
22
|
visible?: boolean;
|
|
23
23
|
progress?: number;
|
|
24
|
+
testId?: string;
|
|
24
25
|
}
|
|
25
|
-
export declare const GoACircularProgress: ({ visible, message, progress, variant, size, }: CircularProgressProps) => JSX.Element;
|
|
26
|
+
export declare const GoACircularProgress: ({ visible, message, progress, variant, size, testId, }: CircularProgressProps) => JSX.Element;
|
|
26
27
|
export default GoACircularProgress;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
heading: string;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
namespace JSX {
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
"goa-details": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export interface DetailsProps extends Margins {
|
|
14
|
+
heading: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function GoADetails(props: DetailsProps): JSX.Element;
|
|
18
|
+
export default GoADetails;
|
package/lib/divider/divider.d.ts
CHANGED
package/lib/footer/footer.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare global {
|
|
|
12
12
|
export interface FooterProps {
|
|
13
13
|
maxContentWidth?: string;
|
|
14
14
|
children?: ReactNode;
|
|
15
|
+
testId?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare function GoAAppFooter({ maxContentWidth, children }: FooterProps): JSX.Element;
|
|
17
|
+
export declare function GoAAppFooter({ maxContentWidth, children, testId, }: FooterProps): JSX.Element;
|
|
17
18
|
export default GoAAppFooter;
|
|
@@ -13,7 +13,8 @@ declare global {
|
|
|
13
13
|
interface FooterNavSectionProps {
|
|
14
14
|
maxColumnCount?: number;
|
|
15
15
|
heading?: string;
|
|
16
|
+
testId?: string;
|
|
16
17
|
children?: ReactNode;
|
|
17
18
|
}
|
|
18
|
-
export declare function GoAAppFooterNavSection({ heading, maxColumnCount, children, }: FooterNavSectionProps): JSX.Element;
|
|
19
|
+
export declare function GoAAppFooterNavSection({ heading, maxColumnCount, testId, children, }: FooterNavSectionProps): JSX.Element;
|
|
19
20
|
export default GoAAppFooterNavSection;
|
package/lib/form/form-item.d.ts
CHANGED
package/lib/grid/grid.d.ts
CHANGED
package/lib/icon/icon.d.ts
CHANGED
|
@@ -28,11 +28,12 @@ interface Props extends Margins {
|
|
|
28
28
|
type: GoAIconType;
|
|
29
29
|
size?: IconSize;
|
|
30
30
|
theme?: IconTheme;
|
|
31
|
+
testId?: string;
|
|
31
32
|
}
|
|
32
33
|
interface WCProps extends Margins {
|
|
33
34
|
type: GoAIconType;
|
|
34
35
|
theme?: IconTheme;
|
|
35
36
|
size?: IconSize;
|
|
36
37
|
}
|
|
37
|
-
export declare function GoAIcon({ type, theme, size, mt, mr, mb, ml, }: Props): JSX.Element;
|
|
38
|
+
export declare function GoAIcon({ type, theme, size, mt, mr, mb, ml, testId, }: Props): JSX.Element;
|
|
38
39
|
export {};
|
package/lib/input/input.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ interface WCProps extends Margins {
|
|
|
11
11
|
value: string;
|
|
12
12
|
id?: string;
|
|
13
13
|
autocapitalize?: GoAAutoCapitalize;
|
|
14
|
+
debounce?: number;
|
|
14
15
|
placeholder?: string;
|
|
15
16
|
leadingicon?: string;
|
|
16
17
|
trailingicon?: string;
|
|
@@ -23,7 +24,6 @@ interface WCProps extends Margins {
|
|
|
23
24
|
width?: string;
|
|
24
25
|
prefix?: string;
|
|
25
26
|
suffix?: string;
|
|
26
|
-
testid?: string;
|
|
27
27
|
arialabel?: string;
|
|
28
28
|
min?: string | number;
|
|
29
29
|
max?: string | number;
|
|
@@ -39,6 +39,7 @@ declare global {
|
|
|
39
39
|
interface BaseProps extends Margins {
|
|
40
40
|
name: string;
|
|
41
41
|
id?: string;
|
|
42
|
+
debounce?: number;
|
|
42
43
|
disabled?: boolean;
|
|
43
44
|
autoCapitalize?: GoAAutoCapitalize;
|
|
44
45
|
placeholder?: string;
|
package/lib/modal/modal.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare type NotificationType = "important" | "information" | "event" | "emergency";
|
|
3
3
|
interface WCProps {
|
|
4
|
+
ref: React.RefObject<HTMLElement>;
|
|
4
5
|
type: NotificationType;
|
|
5
6
|
}
|
|
6
7
|
declare global {
|
|
@@ -13,6 +14,8 @@ declare global {
|
|
|
13
14
|
interface Props {
|
|
14
15
|
type?: NotificationType;
|
|
15
16
|
children?: React.ReactNode;
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
testId?: string;
|
|
16
19
|
}
|
|
17
|
-
export declare const GoANotification: ({ type, children }: Props) => JSX.Element;
|
|
20
|
+
export declare const GoANotification: ({ type, children, testId, onDismiss, }: Props) => JSX.Element;
|
|
18
21
|
export default GoANotification;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
ref?: React.MutableRefObject<HTMLElement | undefined>;
|
|
5
|
+
itemcount: number;
|
|
6
|
+
perpagecount?: number;
|
|
7
|
+
pagenumber: number;
|
|
8
|
+
variant?: "all" | "links-only";
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
namespace JSX {
|
|
12
|
+
interface IntrinsicElements {
|
|
13
|
+
"goa-pagination": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export interface PaginationProps extends Margins {
|
|
18
|
+
itemCount: number;
|
|
19
|
+
perPageCount?: number;
|
|
20
|
+
pageNumber: number;
|
|
21
|
+
variant?: "all" | "links-only";
|
|
22
|
+
onChange: (page: number) => void;
|
|
23
|
+
testId?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function GoAPagination(props: PaginationProps): JSX.Element;
|
|
26
|
+
export default GoAPagination;
|
|
@@ -20,6 +20,7 @@ export interface SkeletonProps extends Margins {
|
|
|
20
20
|
size?: SkeletonSize;
|
|
21
21
|
lineCount?: number;
|
|
22
22
|
type: SkeletonType;
|
|
23
|
+
testId?: string;
|
|
23
24
|
}
|
|
24
|
-
export declare const GoASkeleton: ({ maxWidth, size, lineCount, type, mt, mr, mb, ml, }: SkeletonProps) => JSX.Element;
|
|
25
|
+
export declare const GoASkeleton: ({ maxWidth, size, lineCount, type, testId, mt, mr, mb, ml, }: SkeletonProps) => JSX.Element;
|
|
25
26
|
export default GoASkeleton;
|
package/lib/spacer/spacer.d.ts
CHANGED
package/lib/spinner/spinner.d.ts
CHANGED
package/lib/table/table.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
import { Margins } from "../../common/styling";
|
|
3
3
|
export declare type TableVariant = "normal" | "relaxed";
|
|
4
4
|
interface WCProps extends Margins {
|
|
5
|
+
ref?: React.MutableRefObject<HTMLElement | null>;
|
|
5
6
|
width?: string;
|
|
6
7
|
stickyheader?: boolean;
|
|
7
8
|
variant?: TableVariant;
|
|
@@ -15,7 +16,9 @@ declare global {
|
|
|
15
16
|
}
|
|
16
17
|
export interface TableProps extends Margins {
|
|
17
18
|
width?: string;
|
|
19
|
+
onSort?: (sortBy: string, sortDir: number) => void;
|
|
18
20
|
variant?: TableVariant;
|
|
21
|
+
testId?: string;
|
|
19
22
|
children: ReactNode;
|
|
20
23
|
}
|
|
21
24
|
export declare function GoATable(props: TableProps): JSX.Element;
|