@abgov/react-components 6.7.1-alpha.5 → 6.8.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.
@@ -1,4 +1,4 @@
1
- import { GoabBadgeType, Margins } from '@abgov/ui-components-common';
1
+ import { GoabBadgeType, Margins, GoabIconType } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  type: GoabBadgeType;
@@ -6,6 +6,7 @@ interface WCProps extends Margins {
6
6
  content?: string;
7
7
  arialabel?: string;
8
8
  testid?: string;
9
+ icontype?: GoabIconType;
9
10
  }
10
11
  declare module "react" {
11
12
  namespace JSX {
@@ -20,8 +21,9 @@ export interface GoabBadgeProps extends Margins {
20
21
  content?: string;
21
22
  testId?: string;
22
23
  ariaLabel?: string;
24
+ iconType?: GoabIconType;
23
25
  }
24
- export declare function GoabBadge({ type, content, icon, testId, mt, mr, mb, ml, ariaLabel, }: GoabBadgeProps): JSX.Element;
26
+ export declare function GoabBadge({ type, content, icon, testId, mt, mr, mb, ml, ariaLabel, iconType, }: GoabBadgeProps): JSX.Element;
25
27
  /**
26
28
  * @deprecated
27
29
  */
@@ -12,6 +12,7 @@ interface WCProps extends Margins {
12
12
  id?: string;
13
13
  name: string;
14
14
  checked?: string;
15
+ indeterminate?: string;
15
16
  disabled?: string;
16
17
  error?: string;
17
18
  text?: string;
@@ -27,6 +28,7 @@ export interface GoabCheckboxProps extends Margins {
27
28
  id?: string;
28
29
  name: string;
29
30
  checked?: boolean;
31
+ indeterminate?: boolean;
30
32
  disabled?: boolean;
31
33
  error?: boolean;
32
34
  text?: string;
@@ -41,5 +43,5 @@ export interface GoabCheckboxProps extends Margins {
41
43
  onChange?: (detail: GoabCheckboxOnChangeDetail) => void;
42
44
  }
43
45
  export type Props = GoabCheckboxProps;
44
- export declare function GoabCheckbox({ id, name, testId, error, disabled, checked, value, text, description, reveal, revealAriaLabel, maxWidth, children, onChange, ariaLabel, mt, mr, mb, ml, }: GoabCheckboxProps): JSX.Element;
46
+ export declare function GoabCheckbox({ id, name, testId, error, disabled, checked, indeterminate, value, text, description, reveal, revealAriaLabel, maxWidth, children, onChange, ariaLabel, mt, mr, mb, ml, }: GoabCheckboxProps): JSX.Element;
45
47
  export default GoabCheckbox;
@@ -0,0 +1,30 @@
1
+ import { GoabCheckboxListOnChangeDetail, Margins } from '@abgov/ui-components-common';
2
+ import { JSX } from 'react';
3
+ declare module "react" {
4
+ namespace JSX {
5
+ interface IntrinsicElements {
6
+ "goa-checkbox-list": WCProps & React.HTMLAttributes<HTMLElement>;
7
+ }
8
+ }
9
+ }
10
+ interface WCProps extends Margins {
11
+ ref: React.RefObject<HTMLElement | null>;
12
+ name: string;
13
+ value?: string[];
14
+ disabled?: string;
15
+ error?: string;
16
+ testid?: string;
17
+ maxwidth?: string;
18
+ }
19
+ export interface GoabCheckboxListProps extends Margins {
20
+ name: string;
21
+ value?: string[];
22
+ disabled?: boolean;
23
+ error?: boolean;
24
+ testId?: string;
25
+ maxWidth?: string;
26
+ children?: React.ReactNode;
27
+ onChange?: (detail: GoabCheckboxListOnChangeDetail) => void;
28
+ }
29
+ export declare function GoabCheckboxList({ name, value, disabled, error, testId, maxWidth, children, onChange, mt, mr, mb, ml, }: GoabCheckboxListProps): JSX.Element;
30
+ export default GoabCheckboxList;
@@ -0,0 +1,23 @@
1
+ import { GoabIconType } from '@abgov/ui-components-common';
2
+ import { JSX } from 'react';
3
+ interface WCProps {
4
+ text: string;
5
+ action: string;
6
+ icon?: GoabIconType;
7
+ testid?: string;
8
+ }
9
+ declare module "react" {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ "goa-menu-action": WCProps & React.HTMLAttributes<HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+ export interface GoabMenuActionProps {
17
+ text: string;
18
+ action: string;
19
+ icon?: GoabIconType;
20
+ testId?: string;
21
+ }
22
+ export declare function GoabMenuAction({ text, icon, action, testId }: GoabMenuActionProps): JSX.Element;
23
+ export default GoabMenuAction;
@@ -0,0 +1,71 @@
1
+ import { GoabButtonType } from '@abgov/ui-components-common';
2
+ import { ReactNode, JSX } from 'react';
3
+ /**
4
+ * Props definition for the `goab-menu-button` Web Component.
5
+ * @typedef {Object} WCProps
6
+ *
7
+ * @property {string} text - The text label to be displayed on the button.
8
+ * @property {GoabButtonType} type - The button type, e.g., "primary", "secondary", etc.
9
+ * @property {string} [testid] - A test identifier for automated testing purposes.
10
+ * @property {React.RefObject<HTMLElement | null>} ref - A reference object pointing to the Web Component's DOM element.
11
+ */
12
+ interface WCProps {
13
+ text: string;
14
+ type: GoabButtonType;
15
+ testid?: string;
16
+ ref: React.RefObject<HTMLElement | null>;
17
+ }
18
+ /**
19
+ * Extends React's `JSX` namespace to include the custom `goa-menu-button` Web Component.
20
+ * The `goa-menu-button` supports additional React-specific props.
21
+ */
22
+ declare module "react" {
23
+ namespace JSX {
24
+ interface IntrinsicElements {
25
+ "goa-menu-button": WCProps & React.HTMLAttributes<HTMLElement>;
26
+ }
27
+ }
28
+ }
29
+ /**
30
+ * Props for the `GoabMenuButton` React component.
31
+ *
32
+ * @typedef {Object} GoabMenuButtonProps
33
+ *
34
+ * @property {string} text - The text label to display on the button.
35
+ * @property {GoabButtonType} [type="primary"] - The button type, e.g., "primary", "secondary". Defaults to "primary".
36
+ * @property {string} [testId] - A test identifier for automated testing purposes.
37
+ * @property {Function} [onAction] - Callback function invoked when an action event is emitted by the component.
38
+ * @property {ReactNode} [children] - Optional child elements to be rendered inside the button.
39
+ */
40
+ export interface GoabMenuButtonProps {
41
+ text: string;
42
+ type?: GoabButtonType;
43
+ testId?: string;
44
+ onAction?: (action: string) => void;
45
+ children?: ReactNode;
46
+ }
47
+ /**
48
+ * A React wrapper component for the `goa-menu-button` Web Component.
49
+ *
50
+ * This component provides seamless integration of the Web Component into a React application, including React-specific props and event handling.
51
+ *
52
+ * @function GoabMenuButton
53
+ * @param {GoabMenuButtonProps} props - The props for the component.
54
+ *
55
+ * @returns {JSX.Element} A JSX element wrapping the `goa-menu-button` Web Component.
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * <GoabMenuButton
60
+ * text="Example Button"
61
+ * type="secondary"
62
+ * onAction={(action) => console.log(`Action: ${action}`)}
63
+ * >
64
+ * <GoabMenuAction text="Option 1" action="option1" />
65
+ * <GoabMenuAction text="Option 2" action="option2" />
66
+ * <GoabMenuAction text="Option 3" action="option3" />
67
+ * </GoabMenuButton>
68
+ * ```
69
+ */
70
+ export declare function GoabMenuButton({ text, type, testId, onAction, children, }: GoabMenuButtonProps): JSX.Element;
71
+ export default GoabMenuButton;
@@ -7,6 +7,7 @@ interface WCProps extends Margins {
7
7
  position?: GoabPopoverPosition;
8
8
  relative?: string;
9
9
  testid?: string;
10
+ tabindex?: number;
10
11
  }
11
12
  declare module "react" {
12
13
  namespace JSX {
@@ -23,10 +24,11 @@ export interface GoabPopoverProps extends Margins {
23
24
  padded?: boolean;
24
25
  position?: GoabPopoverPosition;
25
26
  children: ReactNode;
27
+ tabIndex?: number;
26
28
  /***
27
29
  * @deprecated This property has no effect and will be removed in a future version
28
30
  */
29
31
  relative?: boolean;
30
32
  }
31
- export declare function GoabPopover({ target, testId, maxWidth, minWidth, padded, position, relative, children, mt, mr, mb, ml, }: GoabPopoverProps): JSX.Element;
33
+ export declare function GoabPopover({ target, testId, maxWidth, minWidth, padded, position, relative, children, tabIndex, mt, mr, mb, ml, }: GoabPopoverProps): JSX.Element;
32
34
  export default GoabPopover;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "6.7.1-alpha.5",
3
+ "version": "6.8.0-alpha.2",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"