@abgov/react-components 3.4.0-beta.8 → 4.0.0-alpha.2

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.
Files changed (75) hide show
  1. package/README.md +44 -97
  2. package/experimental/index.d.ts +0 -10
  3. package/experimental/package.json +1 -1
  4. package/experimental/react-components.esm.js +0 -1714
  5. package/experimental/react-components.umd.js +5 -1735
  6. package/index.d.ts +33 -16
  7. package/lib/app-header/app-header.d.ts +18 -0
  8. package/lib/badge/badge.d.ts +28 -0
  9. package/lib/button/button.d.ts +27 -35
  10. package/lib/button-group/button-group.d.ts +18 -0
  11. package/lib/callout/callout.d.ts +14 -23
  12. package/lib/card/card-actions.d.ts +16 -0
  13. package/lib/card/card-content.d.ts +13 -0
  14. package/lib/card/card-group.d.ts +16 -0
  15. package/lib/card/card-image.d.ts +18 -0
  16. package/lib/card/card.d.ts +18 -0
  17. package/lib/card/index.d.ts +5 -0
  18. package/lib/checkbox/checkbox.d.ts +27 -36
  19. package/lib/chip/chip.d.ts +23 -0
  20. package/lib/circular-progress/circular-progress.d.ts +29 -0
  21. package/lib/container/container.d.ts +23 -0
  22. package/lib/dropdown/dropdown-option.d.ts +21 -0
  23. package/lib/dropdown/dropdown.d.ts +37 -0
  24. package/lib/flex/index.d.ts +1 -0
  25. package/lib/flex/row.d.ts +7 -0
  26. package/lib/form/form-item.d.ts +22 -0
  27. package/lib/form/index.d.ts +1 -0
  28. package/lib/form/validators.d.ts +10 -0
  29. package/lib/hero-banner/hero-banner-actions.d.ts +4 -0
  30. package/lib/hero-banner/hero-banner.d.ts +18 -0
  31. package/lib/icons/icon-button.d.ts +27 -0
  32. package/lib/icons/icon.d.ts +37 -0
  33. package/lib/icons/index.d.ts +2 -0
  34. package/lib/input/input.d.ts +73 -0
  35. package/lib/microsite-header/microsite-header.d.ts +21 -0
  36. package/lib/modal/modal.d.ts +25 -0
  37. package/lib/notification/notification.d.ts +14 -35
  38. package/lib/page-block/page-block.d.ts +9 -0
  39. package/lib/radio-group/radio-group.d.ts +21 -44
  40. package/lib/radio-group/radio.d.ts +27 -0
  41. package/lib/skeleton/skeleton.d.ts +19 -0
  42. package/lib/spinner/spinner.d.ts +26 -0
  43. package/lib/textarea/textarea.d.ts +30 -0
  44. package/package.json +5 -4
  45. package/react-components.esm.js +755 -2355
  46. package/react-components.umd.js +815 -2397
  47. package/experimental/badge/badge.component.d.ts +0 -8
  48. package/experimental/common.d.ts +0 -3
  49. package/experimental/element-loader/element-loader.d.ts +0 -18
  50. package/experimental/form/form.actions.component.d.ts +0 -3
  51. package/experimental/form/form.component.d.ts +0 -10
  52. package/experimental/form/form.item.component.d.ts +0 -7
  53. package/experimental/form/formFieldValidator.d.ts +0 -4
  54. package/experimental/icons/icons.d.ts +0 -13
  55. package/experimental/input/input.component.d.ts +0 -15
  56. package/experimental/modal/modal.component.d.ts +0 -44
  57. package/experimental/scrollable/scrollable.component.d.ts +0 -12
  58. package/experimental/skeleton/skeleton-element.d.ts +0 -8
  59. package/experimental/skeleton/skeleton-grid-column.d.ts +0 -9
  60. package/experimental/skeleton/skeleton-image-content.d.ts +0 -9
  61. package/experimental/skeleton/skeleton-titled-content.d.ts +0 -9
  62. package/lib/card/card.component.d.ts +0 -26
  63. package/lib/card-group/card.group.component.d.ts +0 -24
  64. package/lib/dropdown/dropdown.component.d.ts +0 -59
  65. package/lib/dropdown/dropdown.context.d.ts +0 -17
  66. package/lib/dropdown/option/option.component.d.ts +0 -10
  67. package/lib/dropdown/option-group/option-group.component.d.ts +0 -6
  68. package/lib/header/header.d.ts +0 -10
  69. package/lib/hero-banner/content/hero-banner-content.component.d.ts +0 -7
  70. package/lib/hero-banner/hero-banner.component.d.ts +0 -11
  71. package/lib/hero-banner/link/hero-banner-link.component.d.ts +0 -8
  72. package/lib/microsite-logo/microsite-logo.d.ts +0 -8
  73. package/lib/page-loader/page-loader.d.ts +0 -43
  74. package/lib/radio-group/radio/radio.d.ts +0 -17
  75. package/lib/radio-group/radio-group.context.d.ts +0 -6
@@ -1,8 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- interface GoABadgeProps {
3
- type: 'information' | 'success' | 'warning' | 'emergency' | 'dark' | 'midtone' | 'light' | 'inactive';
4
- icon?: ReactNode;
5
- content?: string;
6
- }
7
- export declare const GoABadge: FC<GoABadgeProps>;
8
- export {};
@@ -1,3 +0,0 @@
1
- export interface TestProps {
2
- testId?: string;
3
- }
@@ -1,18 +0,0 @@
1
- /// <reference types="react" />
2
- import PropTypes from 'prop-types';
3
- import './element-loader.scss';
4
- export interface ElementLoaderProps {
5
- visible?: boolean;
6
- baseColour: string;
7
- spinnerColour: string;
8
- size: number;
9
- }
10
- export declare const GoAElementLoader: {
11
- ({ visible, baseColour, spinnerColour, size, }: ElementLoaderProps): JSX.Element;
12
- propTypes: {
13
- visible: PropTypes.Requireable<boolean>;
14
- baseColour: PropTypes.Requireable<string>;
15
- spinnerColour: PropTypes.Requireable<string>;
16
- size: PropTypes.Requireable<number>;
17
- };
18
- };
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const GoAFormActions: FC;
3
- export default GoAFormActions;
@@ -1,10 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { GoAFormItem } from './form.item.component';
3
- import { GoAFormActions } from './form.actions.component';
4
- import './form.scss';
5
- export declare const GoAForm: FC;
6
- declare const _default: {
7
- GoAForm: React.FC<{}>;
8
- };
9
- export default _default;
10
- export { GoAFormItem, GoAFormActions };
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- interface GoAFormItemProps {
3
- helpText?: string;
4
- error?: string;
5
- }
6
- export declare const GoAFormItem: FC<GoAFormItemProps>;
7
- export default GoAFormItem;
@@ -1,4 +0,0 @@
1
- export declare const requiredValidator: (val: any) => string[];
2
- export declare const passwordMatchedValidator: (val: any, formData: any) => string[];
3
- export declare const emailValidator: (val: any) => string[];
4
- export declare const phoneValidator: (val: any) => string[];
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { TestProps } from '../common';
3
- import './icons.css';
4
- declare type IconType = 'close';
5
- declare type IconSize = 'small' | 'medium' | 'large';
6
- interface Props extends TestProps {
7
- type: IconType;
8
- onClick: () => void;
9
- size?: IconSize;
10
- variant?: 'circular' | 'goa';
11
- }
12
- export declare function GoAIcon({ type, variant, onClick, size }: Props): JSX.Element;
13
- export {};
@@ -1,15 +0,0 @@
1
- import { FC } from 'react';
2
- import './input.scss';
3
- declare type Props = {
4
- validate?: (value: string) => boolean;
5
- name?: string;
6
- type: string;
7
- message?: string;
8
- required?: boolean;
9
- helpText?: string;
10
- multiLine?: boolean;
11
- navigator?: boolean;
12
- onChange?: (value: string) => void;
13
- };
14
- export declare const GoAInput: FC<Props>;
15
- export default GoAInput;
@@ -1,44 +0,0 @@
1
- /******************************************************************************
2
- * <div class="modal-root">
3
- * <div class="modal" style="opacity: 1">
4
- * <img
5
- * class="modal-close"
6
- * src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGNsYXNzPSdpb25pY29uJyB2aWV3Qm94PScwIDAgNTEyIDUxMic+PHRpdGxlPkNsb3NlPC90aXRsZT48cGF0aCBmaWxsPSdub25lJyBzdHJva2U9J2N1cnJlbnRDb2xvcicgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJyBzdHJva2Utd2lkdGg9JzMyJyBkPSdNMzY4IDM2OEwxNDQgMTQ0TTM2OCAxNDRMMTQ0IDM2OCcvPjwvc3ZnPg=="
7
- * alt="Close"
8
- * />
9
- * <div class="modal-content">
10
- * <div class="modal-title">Show a little bit of text</div>
11
- * <div class="goa-scrollable">
12
- * <div style="overflow: hidden auto; height: 100%; padding: 0rem 1rem">
13
- * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
14
- * magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
15
- * consequat.
16
- * </div>
17
- * </div>
18
- * <div class="modal-actions">
19
- * <button class="goa-button goa--tertiary" type="button">Cancel</button>
20
- * <button class="goa-button" type="submit">Save</button>
21
- * </div>
22
- * </div>
23
- * </div>
24
- * <div class="modal-background" style="opacity: 1"></div>
25
- * </div>
26
- /*****************************************************************************/
27
- import { FC } from 'react';
28
- import './modal.css';
29
- import { TestProps } from '../common';
30
- /**
31
- * Modal - Main Component
32
- */
33
- interface ModalProps {
34
- isOpen?: boolean;
35
- onClose?: () => void;
36
- }
37
- interface ModalTestProps extends TestProps {
38
- backgroundTestId?: string;
39
- }
40
- export declare const GoAModal: FC<ModalProps & ModalTestProps>;
41
- export default GoAModal;
42
- export declare const GoAModalActions: FC;
43
- export declare const GoAModalContent: FC<TestProps>;
44
- export declare const GoAModalTitle: FC<TestProps>;
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- import { TestProps } from '../common';
3
- import './scrollable.css';
4
- interface Props {
5
- vertical?: boolean;
6
- horizontal?: boolean;
7
- hPadding?: number;
8
- vPadding?: number;
9
- height?: number;
10
- }
11
- export declare const GoAScrollable: FC<Props & TestProps>;
12
- export default GoAScrollable;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import './skeleton-element.scss';
3
- declare type indicatorType = 'text' | 'avatar' | 'title' | 'paragraph' | 'thumbnail' | 'card';
4
- export interface SkeletonProps {
5
- type?: indicatorType;
6
- }
7
- export declare const GoASkeletonElement: ({ type }: SkeletonProps) => JSX.Element;
8
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import './skeleton-element.scss';
3
- export interface DisplayProps {
4
- /**
5
- * The number of rows to display.
6
- */
7
- rows?: number;
8
- }
9
- export declare const GoASkeletonGridColumnContent: ({ rows }: DisplayProps) => JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import './skeleton-element.scss';
3
- export interface DisplayProps {
4
- /**
5
- * The number of rows to display.
6
- */
7
- rows?: number;
8
- }
9
- export declare const GoASkeletonImageContent: ({ rows }: DisplayProps) => JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import './skeleton-element.scss';
3
- export interface DisplayProps {
4
- /**
5
- * The number of rows to display.
6
- */
7
- rows?: number;
8
- }
9
- export declare const GoASkeletonContent: ({ rows }: DisplayProps) => JSX.Element;
@@ -1,26 +0,0 @@
1
- import React, { FC, ReactNode } from 'react';
2
- import '../../theme.scss';
3
- import './card.scss';
4
- interface Props {
5
- /** Card title, required */
6
- title: string | ReactNode;
7
- /** Card content*/
8
- content?: string | ReactNode;
9
- /** Deprecated: Use content*/
10
- description?: string;
11
- /** Card image , display on top of title */
12
- cardImageUrl?: string;
13
- /** Minimum width of the card */
14
- minWidth?: string;
15
- /** Maximum width of the card */
16
- maxWidth?: string;
17
- /** Navigation to relate website from Card title */
18
- titleUrl?: string;
19
- /** customize footer by passing react component code */
20
- children?: React.ReactNode;
21
- other?: unknown;
22
- }
23
- export declare const GoACard: FC<Props>;
24
- export default GoACard;
25
- export declare const GoALoadingCardWithImage: (props: Props) => JSX.Element;
26
- export declare const GoALoadingCardNoImage: (props: Props) => JSX.Element;
@@ -1,24 +0,0 @@
1
- import React, { FC } from 'react';
2
- import './card.group.scss';
3
- declare type CardGroupLayout = 'basic' | 'column';
4
- interface CardItem {
5
- title: string;
6
- /** Card description */
7
- description?: string;
8
- /** Card image , display on top of title */
9
- cardImageUrl?: string;
10
- /** Display card size to allow card responsively show in different device*/
11
- cardWidth?: number;
12
- /** Navigation to relate webside from Card title */
13
- titleUrl?: string;
14
- /** customize footer by passing react component code */
15
- children?: React.ReactNode;
16
- }
17
- interface Props {
18
- title?: string;
19
- children?: React.ReactNode;
20
- layout: CardGroupLayout;
21
- cardItems?: CardItem[];
22
- }
23
- export declare const GoACardGroup: FC<Props>;
24
- export default GoACardGroup;
@@ -1,59 +0,0 @@
1
- import { FC } from 'react';
2
- import { DropdownOption } from './dropdown.context';
3
- import './dropdown.component.scss';
4
- import GoAOption from './option/option.component';
5
- import GoAOptionGroup from './option-group/option-group.component';
6
- declare type DropDownrops = {
7
- /**
8
- * Title of dropdown
9
- */
10
- title: string;
11
- /**
12
- * SubTitle of dropdown. The subtitle is normally used to indicate the state of dropdown.
13
- */
14
- subTitle?: string;
15
- /**
16
- * description of dropdown. Description is the message shown on the menu.
17
- */
18
- description?: string;
19
- /**
20
- * Maximum height of the dropdown.
21
- */
22
- menuHeight?: number;
23
- /**
24
- * If true, allowe multiple selection. Otherwise, single selection is used as default.
25
- */
26
- multiple?: boolean;
27
- /**
28
- * If true, disable the dropdown.
29
- */
30
- disabled?: boolean;
31
- /**
32
- * Overwrite the discription when the dropdown is disabled.
33
- */
34
- display?: string;
35
- /**
36
- * Error messgae
37
- */
38
- errorMessage?: string;
39
- key?: string;
40
- /**
41
- * If true, the menu of the dropdown changes to input model. This is useful, if we need to add custom filter for the dropdown list.
42
- */
43
- menuEditable?: boolean;
44
- /**
45
- * Callback function if dropdown menu is in input model.
46
- */
47
- menuInputChanged?: (text: string) => void;
48
- /**
49
- * The property will overwrite the default toggle behavior.
50
- */
51
- open?: boolean;
52
- /**
53
- * Callback function for option change event.
54
- */
55
- selectionChanged: (option: DropdownOption) => void;
56
- };
57
- export declare const GoADropdown: FC<DropDownrops>;
58
- export default GoADropdown;
59
- export { GoAOption, GoAOptionGroup };
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { GoAOptionProps } from './option/option.component';
3
- export declare class DropdownOption {
4
- value: string;
5
- label: string;
6
- selected: boolean;
7
- constructor(val: string, label: string, sel: boolean);
8
- }
9
- /** Used to store the options in the dropdown */
10
- export interface KeyOptionPair {
11
- [value: string]: DropdownOption;
12
- }
13
- /** Interface for the context for the dropdown and its children */
14
- export interface DropdownContextProps {
15
- selectionChanged?: (option: GoAOptionProps) => void;
16
- }
17
- export declare const DropdownContext: import("react").Context<DropdownContextProps>;
@@ -1,10 +0,0 @@
1
- import { FC } from 'react';
2
- export interface GoAOptionProps {
3
- label: string;
4
- value: string;
5
- selected?: boolean;
6
- defaultSelected?: boolean;
7
- children?: any;
8
- }
9
- export declare const GoAOption: FC<GoAOptionProps>;
10
- export default GoAOption;
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- interface Props {
3
- label: string;
4
- }
5
- export declare const GoAOptionGroup: FC<Props>;
6
- export default GoAOptionGroup;
@@ -1,10 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import './header.scss';
3
- declare type ServiceLevel = 'alpha' | 'beta' | 'live';
4
- export interface HeaderProps {
5
- serviceName: string;
6
- serviceHome: string;
7
- serviceLevel: ServiceLevel;
8
- }
9
- export declare const GoAHeader: FunctionComponent<HeaderProps>;
10
- export default GoAHeader;
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- import './hero-banner-content.component.scss';
3
- interface Props {
4
- content: string;
5
- }
6
- export declare const GoAHeroBannerContent: FC<Props>;
7
- export default GoAHeroBannerContent;
@@ -1,11 +0,0 @@
1
- import { FC } from 'react';
2
- import './hero-banner.component.scss';
3
- interface Props {
4
- title: string;
5
- backgroundUrl: string;
6
- content?: string;
7
- linkText?: string;
8
- linkUrl?: string;
9
- }
10
- export declare const GoAHeroBanner: FC<Props>;
11
- export default GoAHeroBanner;
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import './hero-banner-link.component.scss';
3
- interface Props {
4
- linkText: string;
5
- linkUrl: string;
6
- }
7
- declare const GoAHeroBannerLink: FC<Props>;
8
- export default GoAHeroBannerLink;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import './microsite-logo.scss';
3
- export interface MicrositeLogoProps {
4
- serviceName: string;
5
- serviceHome: string;
6
- }
7
- export declare const MicrositeLogo: (props: MicrositeLogoProps) => JSX.Element;
8
- export default MicrositeLogo;
@@ -1,43 +0,0 @@
1
- /// <reference types="react" />
2
- import PropTypes from 'prop-types';
3
- import './page-loader.scss';
4
- declare type indicatorType = 'infinite' | 'progress';
5
- declare type displayTypeIndicator = 'large' | 'small';
6
- export interface PageLoaderProps {
7
- /**
8
- * The type of page loader, deterministic and indeterministic.
9
- */
10
- type?: indicatorType;
11
- /**
12
- * The message to display while loading.
13
- */
14
- message?: string;
15
- /**
16
- * Sets the page loader visibility state.
17
- */
18
- visible?: boolean;
19
- /**
20
- * Sets the percentage value of the page loader while set to progress type, 0 - 100 percent.
21
- */
22
- value?: number;
23
- /**
24
- * Sets the page to locked and does not accept user input.
25
- */
26
- pagelock?: boolean;
27
- /**
28
- * Sets the progress indicator display type size.
29
- */
30
- displayType?: displayTypeIndicator;
31
- }
32
- export declare const GoAPageLoader: {
33
- ({ type, visible, message, value, pagelock, displayType }: PageLoaderProps): JSX.Element;
34
- propTypes: {
35
- visible: PropTypes.Requireable<boolean>;
36
- message: PropTypes.Requireable<string>;
37
- value: PropTypes.Requireable<number>;
38
- type: PropTypes.Requireable<string>;
39
- pagelock: PropTypes.Requireable<boolean>;
40
- displayType: PropTypes.Requireable<string>;
41
- };
42
- };
43
- export default GoAPageLoader;
@@ -1,17 +0,0 @@
1
- import React, { FC } from 'react';
2
- import './radio.scss';
3
- export declare type LabelPosition = 'before' | 'after';
4
- export interface Data {
5
- text: string;
6
- value: string;
7
- }
8
- export interface Props {
9
- value: string;
10
- name?: string;
11
- labelPosition?: LabelPosition;
12
- disabled?: boolean;
13
- required?: boolean;
14
- children: React.ReactNode;
15
- }
16
- export declare const GoARadio: FC<Props>;
17
- export default GoARadio;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare const RadioContext: React.Context<{
3
- selectedValue: string;
4
- }>;
5
- export declare const RadioGroupContext: (initialValue: any, required: any, children: any) => JSX.Element;
6
- export default RadioGroupContext;