@abgov/react-components 6.4.1 → 6.5.0-alpha.1

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.
@@ -0,0 +1,26 @@
1
+ import { GoabFieldsetOnChangeDetail, GoabFieldsetOnContinueDetail, GoabFormDispatchOn, Margins } from '@abgov/ui-components-common';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface WCProps extends Margins {
5
+ ref?: React.RefObject<HTMLElement | null>;
6
+ id?: string;
7
+ "section-title"?: string;
8
+ "dispatch-on"?: string;
9
+ }
10
+ declare module "react" {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ "goa-fieldset": WCProps & React.HTMLAttributes<HTMLElement>;
14
+ }
15
+ }
16
+ }
17
+ interface GoabFieldsetProps extends Margins {
18
+ id?: string;
19
+ sectionTitle?: string;
20
+ dispatchOn?: GoabFormDispatchOn;
21
+ onContinue?: (event: GoabFieldsetOnContinueDetail) => void;
22
+ onChange?: (event: GoabFieldsetOnChangeDetail) => void;
23
+ children: ReactNode;
24
+ }
25
+ export declare function GoabFieldset({ id, sectionTitle, dispatchOn, onContinue, onChange, children, }: GoabFieldsetProps): import("react/jsx-runtime").JSX.Element;
26
+ export default GoabFieldset;
@@ -0,0 +1,59 @@
1
+ import { GoabPublicFormPageButtonVisibility, GoabPublicFormPageOnFieldsetChangeDetail, GoabPublicFormPageOnCompleteDetail, GoabPublicFormPageOnContinueDetail, GoabPublicFormPageStep, Margins } from '@abgov/ui-components-common';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface WCProps extends Margins {
5
+ ref?: React.RefObject<HTMLElement | null>;
6
+ id?: string;
7
+ heading?: string;
8
+ "sub-heading"?: string;
9
+ "section-title"?: string;
10
+ "back-url"?: string;
11
+ type?: string;
12
+ "button-text"?: string;
13
+ "button-visibility"?: string;
14
+ first?: boolean;
15
+ last?: boolean;
16
+ "summary-heading"?: string;
17
+ }
18
+ declare module "react" {
19
+ namespace JSX {
20
+ interface IntrinsicElements {
21
+ "goa-public-form-page": WCProps & React.HTMLAttributes<HTMLElement>;
22
+ }
23
+ }
24
+ }
25
+ interface GoabPublicFormPageProps extends Margins {
26
+ id?: string;
27
+ heading?: string;
28
+ subHeading?: string;
29
+ summaryHeading?: string;
30
+ sectionTitle?: string;
31
+ backUrl?: string;
32
+ type?: GoabPublicFormPageStep;
33
+ buttonText?: string;
34
+ buttonVisibility?: GoabPublicFormPageButtonVisibility;
35
+ first?: boolean;
36
+ last?: boolean;
37
+ /**
38
+ * Triggered when the form page continues to the next step
39
+ * @param event - The continue event details
40
+ */
41
+ onContinue?: (event: GoabPublicFormPageOnContinueDetail) => void;
42
+ /**
43
+ * Triggered when the user clicks the back link
44
+ */
45
+ onBack?: () => void;
46
+ /**
47
+ * Triggered when the form fieldset content changes
48
+ * @param event - The fieldset change event details
49
+ */
50
+ onFieldsetChange?: (event: GoabPublicFormPageOnFieldsetChangeDetail) => void;
51
+ /**
52
+ * Triggered when the form is completed
53
+ * @param event - The complete event details
54
+ */
55
+ onComplete?: (event: GoabPublicFormPageOnCompleteDetail) => void;
56
+ children: ReactNode;
57
+ }
58
+ export declare function GoabPublicFormPage({ id, heading, subHeading, summaryHeading, sectionTitle, backUrl, type, buttonText, buttonVisibility, first, last, onContinue, onBack, onFieldsetChange, onComplete, children, mt, mr, mb, ml, }: GoabPublicFormPageProps): import("react/jsx-runtime").JSX.Element;
59
+ export default GoabPublicFormPage;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ interface WCProps {
3
+ ref?: React.RefObject<HTMLElement | null>;
4
+ heading?: string;
5
+ }
6
+ declare module "react" {
7
+ namespace JSX {
8
+ interface IntrinsicElements {
9
+ "goa-public-form-summary": WCProps & React.HTMLAttributes<HTMLElement>;
10
+ }
11
+ }
12
+ }
13
+ interface GoabPublicFormSummaryProps {
14
+ heading?: string;
15
+ }
16
+ export declare function GoabPublicFormSummary({ heading, }: GoabPublicFormSummaryProps): import("react/jsx-runtime").JSX.Element;
17
+ export default GoabPublicFormSummary;
@@ -0,0 +1,25 @@
1
+ import { GoabFormState, GoabPublicFormOnInitDetail, GoabPublicFormStatus } from '@abgov/ui-components-common';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface WCProps {
5
+ ref?: React.RefObject<HTMLElement | null>;
6
+ status?: string;
7
+ name?: string;
8
+ }
9
+ declare module "react" {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ "goa-public-form": WCProps & React.HTMLAttributes<HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+ interface GoabPublicFormProps {
17
+ status?: GoabPublicFormStatus;
18
+ name?: string;
19
+ onInit?: (event: GoabPublicFormOnInitDetail) => void;
20
+ onComplete?: (event: GoabFormState) => void;
21
+ onStateChange?: (event: GoabFormState) => void;
22
+ children: ReactNode;
23
+ }
24
+ export declare function GoabPublicForm({ status, name, onInit, onComplete, onStateChange, children, }: GoabPublicFormProps): import("react/jsx-runtime").JSX.Element;
25
+ export default GoabPublicForm;
@@ -8,6 +8,8 @@ interface WCProps extends Margins {
8
8
  error?: string;
9
9
  helptext?: string;
10
10
  maxwidth?: string;
11
+ "public-form-summary-order"?: number;
12
+ name?: string;
11
13
  id?: string;
12
14
  testid?: string;
13
15
  }
@@ -25,9 +27,17 @@ export interface GoabFormItemProps extends Margins {
25
27
  error?: string | React.ReactNode;
26
28
  helpText?: string | React.ReactNode;
27
29
  maxWidth?: string;
30
+ /**
31
+ * Public form: to arrange fields in the summary
32
+ */
33
+ publicFormSummaryOrder?: number;
34
+ /**
35
+ * Public form: allow to override the label value within the form-summary to provide a shorter description of the value
36
+ */
37
+ name?: string;
28
38
  children?: React.ReactNode;
29
39
  testId?: string;
30
40
  id?: string;
31
41
  }
32
- export declare function GoabFormItem({ children, helpText, error, requirement, label, labelSize, maxWidth, mt, mr, mb, ml, testId, id, }: GoabFormItemProps): JSX.Element;
42
+ export declare function GoabFormItem({ children, helpText, error, requirement, label, labelSize, maxWidth, publicFormSummaryOrder, name, mt, mr, mb, ml, testId, id, }: GoabFormItemProps): JSX.Element;
33
43
  export default GoabFormItem;
@@ -68,7 +68,7 @@ type OnFocus<T = string> = (detail: GoabInputOnFocusDetail<T>) => void;
68
68
  type OnBlur<T = string> = (detail: GoaInputOnBlurDetail<T>) => void;
69
69
  type OnKeyPress<T = string> = (detail: GoabInputOnKeyPressDetail<T>) => void;
70
70
  export interface GoabInputProps extends BaseProps {
71
- onChange: OnChange<string>;
71
+ onChange?: OnChange<string>;
72
72
  value?: string;
73
73
  min?: number | string;
74
74
  max?: number | string;
@@ -78,7 +78,7 @@ export interface GoabInputProps extends BaseProps {
78
78
  onKeyPress?: OnKeyPress<string>;
79
79
  }
80
80
  interface GoabNumberInputProps extends BaseProps {
81
- onChange: OnChange<number>;
81
+ onChange?: OnChange<number>;
82
82
  value?: number;
83
83
  min?: number;
84
84
  max?: number;
@@ -88,7 +88,7 @@ interface GoabNumberInputProps extends BaseProps {
88
88
  onKeyPress?: OnKeyPress<number>;
89
89
  }
90
90
  interface GoabDateInputProps extends BaseProps {
91
- onChange: OnChange<GoabDate>;
91
+ onChange?: OnChange<GoabDate>;
92
92
  value?: GoabDate;
93
93
  min?: GoabDate;
94
94
  max?: GoabDate;
@@ -6,6 +6,7 @@ interface WCProps extends Margins {
6
6
  ref: React.RefObject<HTMLElement | null>;
7
7
  name: string;
8
8
  value?: string;
9
+ id?: string;
9
10
  orientation?: GoabRadioGroupOrientation;
10
11
  disabled?: string;
11
12
  error?: string;
@@ -22,13 +23,14 @@ declare module "react" {
22
23
  export interface GoabRadioGroupProps extends Margins {
23
24
  name: string;
24
25
  value?: string;
26
+ id?: string;
25
27
  disabled?: boolean;
26
28
  orientation?: GoabRadioGroupOrientation;
27
29
  testId?: string;
28
30
  error?: boolean;
29
31
  ariaLabel?: string;
30
32
  children?: React.ReactNode;
31
- onChange: (detail: GoabRadioGroupOnChangeDetail) => void;
33
+ onChange?: (detail: GoabRadioGroupOnChangeDetail) => void;
32
34
  }
33
- export declare function GoabRadioGroup({ name, value, children, orientation, disabled, error, testId, ariaLabel, mt, mr, mb, ml, onChange, }: GoabRadioGroupProps): JSX.Element;
35
+ export declare function GoabRadioGroup({ name, value, children, orientation, disabled, error, id, testId, ariaLabel, mt, mr, mb, ml, onChange, }: GoabRadioGroupProps): JSX.Element;
34
36
  export default GoabRadioGroup;
@@ -39,7 +39,7 @@ export interface GoabTextAreaProps extends Margins {
39
39
  ariaLabel?: string;
40
40
  countBy?: GoabTextAreaCountBy;
41
41
  maxCount?: number;
42
- onChange: (event: GoabTextAreaOnChangeDetail) => void;
42
+ onChange?: (event: GoabTextAreaOnChangeDetail) => void;
43
43
  onKeyPress?: (event: GoabTextAreaOnKeyPressDetail) => void;
44
44
  }
45
45
  export declare function GoabTextArea({ name, value, placeholder, rows, readOnly, disabled, countBy, maxCount, width, maxWidth, testId, error, ariaLabel, mt, mr, mb, ml, onChange, onKeyPress, }: GoabTextAreaProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "6.4.1",
3
+ "version": "6.5.0-alpha.1",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -1,30 +0,0 @@
1
- import { GoabFieldsetOnContinueDetail, Margins } from '@abgov/ui-components-common';
2
- import { ReactNode } from 'react';
3
-
4
- interface WCProps extends Margins {
5
- ref?: React.RefObject<HTMLElement | null>;
6
- id: string;
7
- heading?: string;
8
- buttontext?: string;
9
- last?: string;
10
- first?: string;
11
- }
12
- declare module "react" {
13
- namespace JSX {
14
- interface IntrinsicElements {
15
- "goa-public-form-page": WCProps & React.HTMLAttributes<HTMLElement>;
16
- }
17
- }
18
- }
19
- interface GoabFieldsetProps extends Margins {
20
- id: string;
21
- first?: boolean;
22
- last?: boolean;
23
- heading?: string;
24
- buttonText?: string;
25
- errors?: Record<string, string>;
26
- onContinue?: (event: GoabFieldsetOnContinueDetail) => boolean | void | undefined;
27
- children: ReactNode;
28
- }
29
- export declare function GoabFieldset({ heading, buttonText, id, onContinue, children, mt, mr, mb, ml, first, last, }: GoabFieldsetProps): import("react/jsx-runtime").JSX.Element;
30
- export default GoabFieldset;