@abgov/react-components 7.2.0-dev.17 → 7.2.0-dev.18

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.
@@ -1,4 +1,4 @@
1
- import { DataAttributes, GoabCheckboxOnChangeDetail, GoabCheckboxSize, Margins } from '@abgov/ui-components-common';
1
+ import { DataAttributes, GoabCheckboxOnBlurDetail, GoabCheckboxOnChangeDetail, GoabCheckboxOnFocusDetail, GoabCheckboxSize, Margins } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
3
  declare module "react" {
4
4
  namespace JSX {
@@ -62,8 +62,12 @@ export interface GoabCheckboxProps extends Margins, DataAttributes {
62
62
  size?: GoabCheckboxSize;
63
63
  /** Callback fired when the checkbox selection changes. */
64
64
  onChange?: (detail: GoabCheckboxOnChangeDetail) => void;
65
+ /** Callback fired when the checkbox receives focus. */
66
+ onFocus?: (detail: GoabCheckboxOnFocusDetail) => void;
67
+ /** Callback fired when the checkbox loses focus. */
68
+ onBlur?: (detail: GoabCheckboxOnBlurDetail) => void;
65
69
  }
66
70
  export type Props = GoabCheckboxProps;
67
71
  /** Let the user select one or more options. */
68
- export declare function GoabCheckbox({ error, checked, indeterminate, disabled, value, description, reveal, onChange, name, children, size, ...rest }: GoabCheckboxProps): JSX.Element;
72
+ export declare function GoabCheckbox({ error, checked, indeterminate, disabled, value, description, reveal, onChange, onFocus, onBlur, name, children, size, ...rest }: GoabCheckboxProps): JSX.Element;
69
73
  export default GoabCheckbox;
@@ -1,4 +1,4 @@
1
- import { GoabCheckboxListOnChangeDetail, Margins } from '@abgov/ui-components-common';
1
+ import { GoabCheckboxListOnBlurDetail, GoabCheckboxListOnChangeDetail, GoabCheckboxListOnFocusDetail, Margins } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  ref: React.RefObject<HTMLElement | null>;
@@ -37,7 +37,11 @@ export interface GoabCheckboxListProps extends Margins {
37
37
  children?: React.ReactNode;
38
38
  /** Callback fired when the selected values change. */
39
39
  onChange?: (detail: GoabCheckboxListOnChangeDetail) => void;
40
+ /** Callback fired when focus enters any checkbox in the list. */
41
+ onFocus?: (detail: GoabCheckboxListOnFocusDetail) => void;
42
+ /** Callback fired when focus leaves all checkboxes in the list. */
43
+ onBlur?: (detail: GoabCheckboxListOnBlurDetail) => void;
40
44
  }
41
45
  /** A multiple selection input. */
42
- export declare function GoabCheckboxList({ name, value, disabled, error, testId, maxWidth, size, children, onChange, mt, mr, mb, ml, }: GoabCheckboxListProps): JSX.Element;
46
+ export declare function GoabCheckboxList({ name, value, disabled, error, testId, maxWidth, size, children, onChange, onFocus, onBlur, mt, mr, mb, ml, }: GoabCheckboxListProps): JSX.Element;
43
47
  export default GoabCheckboxList;
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { GoabDatePickerInputType, GoabDatePickerOnChangeDetail, Margins, DataAttributes } from '@abgov/ui-components-common';
2
+ import { GoabDatePickerInputType, GoabDatePickerOnBlurDetail, GoabDatePickerOnChangeDetail, GoabDatePickerOnFocusDetail, Margins, DataAttributes } from '@abgov/ui-components-common';
3
3
  interface WCProps extends Margins {
4
4
  name?: string;
5
5
  value?: string;
@@ -45,7 +45,11 @@ export interface GoabDatePickerProps extends Margins, DataAttributes {
45
45
  width?: string;
46
46
  /** Callback fired when the selected date changes. */
47
47
  onChange?: (detail: GoabDatePickerOnChangeDetail) => void;
48
+ /** Callback fired when focus enters any of the date picker's internal fields. */
49
+ onFocus?: (detail: GoabDatePickerOnFocusDetail) => void;
50
+ /** Callback fired when focus leaves all of the date picker's internal fields. */
51
+ onBlur?: (detail: GoabDatePickerOnBlurDetail) => void;
48
52
  }
49
53
  /** Lets users select a date through a calendar without the need to manually type it in a field. */
50
- export declare function GoabDatePicker({ value, error, min, max, disabled, relative, onChange, ...rest }: GoabDatePickerProps): JSX.Element;
54
+ export declare function GoabDatePicker({ value, error, min, max, disabled, relative, onChange, onFocus, onBlur, ...rest }: GoabDatePickerProps): JSX.Element;
51
55
  export default GoabDatePicker;
@@ -1,4 +1,4 @@
1
- import { GoabDropdownOnChangeDetail, GoabDropdownSize, GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
1
+ import { GoabDropdownOnBlurDetail, GoabDropdownOnChangeDetail, GoabDropdownOnFocusDetail, GoabDropdownSize, GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  arialabel?: string;
@@ -38,6 +38,10 @@ export interface GoabDropdownProps extends Margins, DataAttributes {
38
38
  value?: string[] | string;
39
39
  /** Callback fired when the selected value changes. */
40
40
  onChange?: (detail: GoabDropdownOnChangeDetail) => void;
41
+ /** Callback fired when the dropdown receives focus. */
42
+ onFocus?: (detail: GoabDropdownOnFocusDetail) => void;
43
+ /** Callback fired when the dropdown loses focus. */
44
+ onBlur?: (detail: GoabDropdownOnBlurDetail) => void;
41
45
  /** Defines how the selected value will be translated for the screen reader. If not specified it will fall back to the name. */
42
46
  ariaLabel?: string;
43
47
  /** The aria-labelledby attribute identifies the element that labels the dropdown. Normally it is the id of the label. */
@@ -76,5 +80,5 @@ export interface GoabDropdownProps extends Margins, DataAttributes {
76
80
  relative?: boolean;
77
81
  }
78
82
  /** Present a list of options to the user to select from. */
79
- export declare function GoabDropdown({ value, onChange, disabled, error, filterable, multiselect, native, relative, children, size, ...rest }: GoabDropdownProps): JSX.Element;
83
+ export declare function GoabDropdown({ value, onChange, onFocus, onBlur, disabled, error, filterable, multiselect, native, relative, children, size, ...rest }: GoabDropdownProps): JSX.Element;
80
84
  export default GoabDropdown;
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { GoabRadioGroupOnChangeDetail, GoabRadioGroupOrientation, GoabRadioGroupSize, Margins, DataAttributes } from '@abgov/ui-components-common';
2
+ import { GoabRadioGroupOnBlurDetail, GoabRadioGroupOnChangeDetail, GoabRadioGroupOnFocusDetail, GoabRadioGroupOrientation, GoabRadioGroupSize, Margins, DataAttributes } from '@abgov/ui-components-common';
3
3
  export * from './radio';
4
4
  interface WCProps extends Margins {
5
5
  name: string;
@@ -45,7 +45,11 @@ export interface GoabRadioGroupProps extends Margins, DataAttributes {
45
45
  children?: React.ReactNode;
46
46
  /** Callback fired when the selected radio item changes. */
47
47
  onChange?: (detail: GoabRadioGroupOnChangeDetail) => void;
48
+ /** Callback fired when focus enters any radio item in the group. */
49
+ onFocus?: (detail: GoabRadioGroupOnFocusDetail) => void;
50
+ /** Callback fired when focus leaves all radio items in the group. */
51
+ onBlur?: (detail: GoabRadioGroupOnBlurDetail) => void;
48
52
  }
49
53
  /** Allow users to select one option from a set. */
50
- export declare function GoabRadioGroup({ disabled, error, onChange, name, children, size, ...rest }: GoabRadioGroupProps): JSX.Element;
54
+ export declare function GoabRadioGroup({ disabled, error, onChange, onFocus, onBlur, name, children, size, ...rest }: GoabRadioGroupProps): JSX.Element;
51
55
  export default GoabRadioGroup;
@@ -1,4 +1,4 @@
1
- import { GoabTextAreaCountBy, GoabTextAreaOnChangeDetail, GoabTextAreaOnKeyPressDetail, GoabTextAreaOnBlurDetail, GoabTextAreaSize, Margins, DataAttributes } from '@abgov/ui-components-common';
1
+ import { GoabTextAreaCountBy, GoabTextAreaOnChangeDetail, GoabTextAreaOnKeyPressDetail, GoabTextAreaOnBlurDetail, GoabTextAreaOnFocusDetail, GoabTextAreaSize, Margins, DataAttributes } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  name: string;
@@ -64,9 +64,11 @@ export interface GoabTextAreaProps extends Margins, DataAttributes {
64
64
  onChange?: (event: GoabTextAreaOnChangeDetail) => void;
65
65
  /** Callback fired when a key is pressed within the textarea. */
66
66
  onKeyPress?: (event: GoabTextAreaOnKeyPressDetail) => void;
67
+ /** Callback fired when the textarea receives focus. */
68
+ onFocus?: (event: GoabTextAreaOnFocusDetail) => void;
67
69
  /** Callback fired when the textarea loses focus. */
68
70
  onBlur?: (event: GoabTextAreaOnBlurDetail) => void;
69
71
  }
70
72
  /** A multi-line field where users can input and edit text. */
71
- export declare function GoabTextArea({ readOnly, disabled, error, onChange, onKeyPress, onBlur, ...rest }: GoabTextAreaProps): JSX.Element;
73
+ export declare function GoabTextArea({ readOnly, disabled, error, onChange, onKeyPress, onFocus, onBlur, ...rest }: GoabTextAreaProps): JSX.Element;
72
74
  export default GoabTextArea;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "7.2.0-dev.17",
3
+ "version": "7.2.0-dev.18",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"