@abgov/react-components 4.5.0 → 4.7.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 +7 -3
- package/index.d.ts +6 -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/form-step/form-step.d.ts +19 -0
- package/lib/form-stepper/form-stepper.d.ts +21 -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 +0 -1
- package/lib/microsite-header/microsite-header.d.ts +1 -0
- package/lib/modal/modal.d.ts +3 -2
- package/lib/notification/notification.d.ts +4 -1
- package/lib/page-block/page-block.d.ts +1 -0
- package/lib/pages/pages.d.ts +18 -0
- package/lib/pagination/pagination.d.ts +1 -0
- package/lib/popover/popover.d.ts +20 -0
- package/lib/skeleton/skeleton.d.ts +3 -2
- 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 +6898 -3782
- package/react-components.umd.js +6776 -3657
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
8
|
npm i @abgov/react-components
|
|
@@ -23,8 +23,12 @@ Add the following to the head element
|
|
|
23
23
|
></script>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Import the styles in the `src/index.css` file
|
|
26
|
+
Import the web-component styles in the `src/index.css` file
|
|
27
27
|
|
|
28
28
|
```css
|
|
29
29
|
@import "@abgov/web-components/index.css";
|
|
30
30
|
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
[Visit Design System](https://ui-components.alberta.ca)
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import "@abgov/web-components";
|
|
2
|
+
export * from "./lib/pages/pages";
|
|
2
3
|
export type { GoAIconType } from "./lib/icon/icon";
|
|
3
4
|
export type { GoABadgeType } from "./lib/badge/badge";
|
|
5
|
+
export * from "./lib/accordion/accordion";
|
|
6
|
+
export * from "./lib/form-step/form-step";
|
|
7
|
+
export * from "./lib/form-stepper/form-stepper";
|
|
4
8
|
export * from "./lib/app-header/app-header";
|
|
5
9
|
export * from "./lib/badge/badge";
|
|
6
10
|
export * from "./lib/block/block";
|
|
@@ -11,6 +15,7 @@ export * from "./lib/checkbox/checkbox";
|
|
|
11
15
|
export * from "./lib/chip/chip";
|
|
12
16
|
export * from "./lib/circular-progress/circular-progress";
|
|
13
17
|
export * from "./lib/container/container";
|
|
18
|
+
export * from "./lib/details/details";
|
|
14
19
|
export * from "./lib/divider/divider";
|
|
15
20
|
export * from "./lib/dropdown/dropdown";
|
|
16
21
|
export * from "./lib/dropdown/dropdown-item";
|
|
@@ -31,6 +36,7 @@ export * from "./lib/one-column-layout/one-column-layout";
|
|
|
31
36
|
export * from "./lib/page-block/page-block";
|
|
32
37
|
export * from "./lib/radio-group/radio-group";
|
|
33
38
|
export * from "./lib/pagination/pagination";
|
|
39
|
+
export * from "./lib/popover/popover";
|
|
34
40
|
export * from "./lib/skeleton/skeleton";
|
|
35
41
|
export * from "./lib/spacer/spacer";
|
|
36
42
|
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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type Status = "complete" | "incomplete";
|
|
3
|
+
interface WCProps {
|
|
4
|
+
text: string;
|
|
5
|
+
status?: Status;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
"goa-form-step": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface FormStepProps {
|
|
15
|
+
text: string;
|
|
16
|
+
status?: Status;
|
|
17
|
+
}
|
|
18
|
+
export declare function GoAFormStep(props: FormStepProps): JSX.Element;
|
|
19
|
+
export default GoAFormStep;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
ref?: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
+
step?: number;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
namespace JSX {
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
"goa-form-stepper": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface FormStepperProps extends Margins {
|
|
15
|
+
step?: number;
|
|
16
|
+
testId: string;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
onChange?: (step: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function GoAFormStepper({ testId, step, mt, mb, ml, mr, onChange, children, }: FormStepperProps): JSX.Element;
|
|
21
|
+
export default GoAFormStepper;
|
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
package/lib/modal/modal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare type ModalTransition = "fast" | "slow" | "none";
|
|
|
3
3
|
export declare type CalloutVariant = "information" | "important" | "emergency" | "success" | "event";
|
|
4
4
|
interface WCProps {
|
|
5
5
|
ref: React.RefObject<HTMLElement>;
|
|
6
|
-
heading?:
|
|
6
|
+
heading?: React.ReactNode;
|
|
7
7
|
open?: boolean;
|
|
8
8
|
width?: string;
|
|
9
9
|
closable?: boolean;
|
|
@@ -19,7 +19,7 @@ declare global {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
interface Props {
|
|
22
|
-
heading?:
|
|
22
|
+
heading?: React.ReactNode;
|
|
23
23
|
width?: string;
|
|
24
24
|
actions?: React.ReactElement;
|
|
25
25
|
onClose?: () => void;
|
|
@@ -28,6 +28,7 @@ interface Props {
|
|
|
28
28
|
open?: boolean;
|
|
29
29
|
type?: string;
|
|
30
30
|
calloutVariant?: CalloutVariant;
|
|
31
|
+
testId?: string;
|
|
31
32
|
}
|
|
32
33
|
export declare const GoAModal: FC<Props>;
|
|
33
34
|
export default GoAModal;
|
|
@@ -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,18 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
4
|
+
current?: number;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
namespace JSX {
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
"goa-pages": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface PagesProps extends Margins {
|
|
14
|
+
current?: number;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function GoAPages(props: PagesProps): JSX.Element;
|
|
18
|
+
export default GoAPages;
|
|
@@ -20,6 +20,7 @@ export interface PaginationProps extends Margins {
|
|
|
20
20
|
pageNumber: number;
|
|
21
21
|
variant?: "all" | "links-only";
|
|
22
22
|
onChange: (page: number) => void;
|
|
23
|
+
testId?: string;
|
|
23
24
|
}
|
|
24
25
|
export declare function GoAPagination(props: PaginationProps): JSX.Element;
|
|
25
26
|
export default GoAPagination;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from "react";
|
|
2
|
+
interface WCProps {
|
|
3
|
+
maxwidth?: string;
|
|
4
|
+
padded?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
namespace JSX {
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
"goa-popover": WCProps & React.HTMLAttributes<HTMLElement>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface Props {
|
|
14
|
+
target?: ReactNode;
|
|
15
|
+
testId?: string;
|
|
16
|
+
maxWidth?: string;
|
|
17
|
+
padded?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const GoAPopover: FC<Props>;
|
|
20
|
+
export default GoAPopover;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Margins } from "../../common/styling";
|
|
3
|
-
export declare type SkeletonType = "image" | "text" | "title" | "text-small" | "avatar" | "header" | "paragraph" | "thumbnail" | "card" | "profile";
|
|
3
|
+
export declare type SkeletonType = "image" | "text" | "title" | "text-small" | "avatar" | "header" | "paragraph" | "thumbnail" | "card" | "profile" | "article";
|
|
4
4
|
declare type SkeletonSize = 1 | 2 | 3 | 4;
|
|
5
5
|
interface WCProps extends Margins {
|
|
6
6
|
maxwidth?: string;
|
|
@@ -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;
|