@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 CHANGED
@@ -1,13 +1,12 @@
1
1
  # React UI Components
2
2
 
3
- This library contains react components from the Government of Alberta.
3
+ ![npm (scoped)](https://img.shields.io/npm/v/@abgov/react-components?color=%230081a2&label=react-components&style=flat-square)
4
4
 
5
- Add Dependencies
5
+ This library contains react components from the Government of Alberta.
6
6
 
7
7
  ```bash
8
- npm i @abgov/react-components@alpha
9
- npm i @abgov/web-components@alpha
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/styles/styles.esm.css";
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;
@@ -16,6 +16,7 @@ interface Props {
16
16
  url?: string;
17
17
  maxContentWidth?: string;
18
18
  children?: React.ReactNode;
19
+ testId?: string;
19
20
  }
20
21
  export declare const GoAAppHeader: FC<Props>;
21
22
  export default GoAAppHeader;
@@ -11,7 +11,6 @@ interface WCProps extends Margins {
11
11
  type: GoABadgeType;
12
12
  icon?: boolean;
13
13
  content?: string;
14
- testid?: string;
15
14
  }
16
15
  declare global {
17
16
  namespace JSX {
@@ -16,6 +16,7 @@ export interface BlockProps extends Margins {
16
16
  gap?: Spacing;
17
17
  direction?: Direction;
18
18
  alignment?: Alignment;
19
+ testId?: string;
19
20
  children?: ReactNode;
20
21
  }
21
22
  export declare function GoABlock(props: BlockProps): JSX.Element;
@@ -28,6 +28,7 @@ interface ButtonProps extends Margins {
28
28
  leadingIcon?: GoAIconType;
29
29
  trailingIcon?: GoAIconType;
30
30
  onClick?: () => void;
31
+ testId?: string;
31
32
  children?: ReactNode;
32
33
  }
33
34
  export declare const GoAButton: FC<ButtonProps>;
@@ -16,6 +16,7 @@ declare global {
16
16
  interface ButtonGroupProps extends Margins {
17
17
  alignment: Alignment;
18
18
  gap?: Gap;
19
+ testId?: string;
19
20
  children?: React.ReactNode;
20
21
  }
21
22
  export declare const GoAButtonGroup: FC<ButtonGroupProps>;
@@ -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;
@@ -15,6 +15,7 @@ declare global {
15
15
  interface Props extends Margins {
16
16
  elevation?: number;
17
17
  width?: string;
18
+ testId?: string;
18
19
  children?: React.ReactNode;
19
20
  }
20
21
  export declare const GoACard: FC<Props>;
@@ -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;
@@ -22,6 +22,7 @@ interface Props extends Margins {
22
22
  padding?: ContainerPadding;
23
23
  actions?: ReactNode;
24
24
  children?: ReactNode;
25
+ testId?: string;
25
26
  }
26
27
  export declare const GoAContainer: FC<Props>;
27
28
  export default GoAContainer;
@@ -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;
@@ -7,5 +7,7 @@ declare global {
7
7
  }
8
8
  }
9
9
  }
10
- export declare function GoADivider(props: Margins): JSX.Element;
10
+ export declare function GoADivider(props: Margins & {
11
+ testId?: string;
12
+ }): JSX.Element;
11
13
  export default GoADivider;
@@ -13,7 +13,6 @@ interface WCProps extends Margins {
13
13
  name?: string;
14
14
  native?: boolean;
15
15
  placeholder?: string;
16
- testid?: string;
17
16
  value?: string;
18
17
  width?: string;
19
18
  }
@@ -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;
@@ -20,6 +20,7 @@ interface GoAFormItemProps extends Margins {
20
20
  error?: string;
21
21
  helpText?: string;
22
22
  children?: React.ReactNode;
23
+ testId?: string;
23
24
  }
24
25
  export declare const GoAFormItem: FC<GoAFormItemProps>;
25
26
  export default GoAFormItem;
@@ -14,6 +14,7 @@ declare global {
14
14
  interface Props extends Margins {
15
15
  gap?: Spacing;
16
16
  minChildWidth: string;
17
+ testId?: string;
17
18
  children?: React.ReactNode;
18
19
  }
19
20
  export declare const GoAGrid: FC<Props>;
@@ -15,6 +15,7 @@ interface Props {
15
15
  heading: string;
16
16
  backgroundUrl: string;
17
17
  minHeight?: string;
18
+ testId?: string;
18
19
  children?: React.ReactNode;
19
20
  }
20
21
  export declare const GoAHeroBanner: FC<Props>;
@@ -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 {};
@@ -25,6 +25,7 @@ interface Props extends Margins {
25
25
  disabled?: boolean;
26
26
  children?: React.ReactNode;
27
27
  onClick?: () => void;
28
+ testId?: string;
28
29
  }
29
30
  export declare const GoAIconButton: FC<Props>;
30
31
  export {};
@@ -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;
@@ -16,6 +16,7 @@ export interface HeaderProps {
16
16
  type: ServiceLevel;
17
17
  version?: string;
18
18
  feedbackUrl?: string;
19
+ testId?: string;
19
20
  }
20
21
  export declare const GoAMicrositeHeader: FC<HeaderProps>;
21
22
  export default GoAMicrositeHeader;
@@ -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;
@@ -11,6 +11,7 @@ declare global {
11
11
  }
12
12
  export interface PageBlockProps {
13
13
  width: "full" | string;
14
+ testId?: string;
14
15
  children?: ReactNode;
15
16
  }
16
17
  export declare const GoAPageBlock: FC<PageBlockProps>;
@@ -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;
@@ -14,6 +14,7 @@ declare global {
14
14
  export interface SpacerProps {
15
15
  hSpacing?: Spacing | "fill";
16
16
  vSpacing?: Spacing;
17
+ testId?: string;
17
18
  }
18
19
  export declare function GoASpacer(props: SpacerProps): JSX.Element;
19
20
  export default GoASpacer;
@@ -6,7 +6,6 @@ interface WCProps {
6
6
  type: SpinnerType;
7
7
  invert?: boolean;
8
8
  progress?: number;
9
- testid?: string;
10
9
  }
11
10
  declare global {
12
11
  namespace JSX {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.4.0",
3
+ "version": "4.6.0",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"