@abgov/react-components 7.2.2 → 7.4.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.
@@ -1,4 +1,4 @@
1
- import { JSX } from 'react';
1
+ import { ReactNode, JSX } from 'react';
2
2
  import { DataAttributes } from '@abgov/ui-components-common';
3
3
  interface WCProps {
4
4
  heading?: string;
@@ -22,7 +22,7 @@ declare module "react" {
22
22
  export interface GoabAppHeaderProps extends DataAttributes {
23
23
  /** Set the service name to display in the app header. */
24
24
  heading?: string;
25
- /** V2 only: Secondary text displayed under the service name. */
25
+ /** Secondary text displayed under the service name. */
26
26
  secondaryText?: string;
27
27
  /** Set the URL to link from the alberta.ca logo. A full url is required. */
28
28
  url?: string;
@@ -31,12 +31,20 @@ export interface GoabAppHeaderProps extends DataAttributes {
31
31
  /** Sets the breakpoint in px for the full menu to display. */
32
32
  fullMenuBreakpoint?: number;
33
33
  /** Content rendered inside the app header, typically navigation links. */
34
- children?: React.ReactNode;
34
+ children?: ReactNode;
35
35
  /** Callback fired when the menu button is clicked. When provided, clicking the menu button dispatches a custom event instead of toggling the menu. */
36
36
  onMenuClick?: () => void;
37
37
  /** Sets a data-testid attribute for automated testing. */
38
38
  testId?: string;
39
+ /** Banner content displayed above the header. */
40
+ banner?: ReactNode;
41
+ /** Phase badge content displayed beside the service name. */
42
+ phase?: ReactNode;
43
+ /** Links and app header menus appear in the navigation bar below the header. Use plain links for single items and app header menu for grouped items with a dropdown. */
44
+ navigation?: ReactNode;
45
+ /** Actions like user account menus appear on the right side of the header. Use menu button for dropdowns with actions. */
46
+ utilities?: ReactNode;
39
47
  }
40
48
  /** Provide structure to help users find their way around the service. */
41
- export declare function GoabAppHeader({ onMenuClick, children, secondaryText, ...rest }: GoabAppHeaderProps): JSX.Element;
49
+ export declare function GoabAppHeader({ onMenuClick, children, secondaryText, banner, phase, navigation, utilities, ...rest }: GoabAppHeaderProps): JSX.Element;
42
50
  export {};
@@ -19,7 +19,7 @@ export interface GoabAppHeaderMenuProps extends DataAttributes {
19
19
  leadingIcon?: GoabIconType;
20
20
  /** Sets a data-testid attribute for automated testing. */
21
21
  testId?: string;
22
- /** Slot name used to place this menu in the correct slot of the parent component. */
22
+ /** @deprecated Sets the slot name for the component. Deprecated: use AppHeader navigation prop instead. */
23
23
  slotName?: string;
24
24
  /** Content rendered inside the menu dropdown, typically navigation links. */
25
25
  children?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { DataAttributes, GoabBadgeEmphasis, GoabBadgeSize, GoabBadgeType, GoabIconType, Margins } from '@abgov/ui-components-common';
2
- import { JSX } from 'react';
2
+ import { JSX, ReactNode } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  type: GoabBadgeType;
5
5
  icon?: string;
@@ -23,8 +23,8 @@ export interface GoabBadgeProps extends Margins, DataAttributes {
23
23
  type: GoabBadgeType;
24
24
  /** @deprecated Use iconType instead. When true, displays an icon in the badge. */
25
25
  icon?: boolean;
26
- /** Text label of the badge. */
27
- content?: string;
26
+ /** Content displayed in the badge. Accepts a string or ReactNode for custom content. */
27
+ content?: ReactNode;
28
28
  /** Sets a data-testid attribute for automated testing. */
29
29
  testId?: string;
30
30
  /** Accessible label for screen readers. */
@@ -37,5 +37,5 @@ export interface GoabBadgeProps extends Margins, DataAttributes {
37
37
  emphasis?: GoabBadgeEmphasis;
38
38
  }
39
39
  /** Small labels which hold small amounts of information, system feedback, or states. */
40
- export declare function GoabBadge({ icon, iconType, size, emphasis, ...rest }: GoabBadgeProps): JSX.Element;
40
+ export declare function GoabBadge({ content, icon, iconType, size, emphasis, ...rest }: GoabBadgeProps): JSX.Element;
41
41
  export {};
@@ -4,6 +4,7 @@ export interface WCProps extends Margins {
4
4
  gap?: Spacing;
5
5
  direction?: GoabBlockDirection;
6
6
  alignment?: GoabBlockAlignment;
7
+ stretch?: string;
7
8
  "min-width"?: string;
8
9
  "max-width"?: string;
9
10
  width?: string;
@@ -23,6 +24,8 @@ export interface GoabBlockProps extends Margins, DataAttributes {
23
24
  direction?: GoabBlockDirection;
24
25
  /** Primary axis alignment of child components. @default "normal" */
25
26
  alignment?: GoabBlockAlignment;
27
+ /** When true, children fill the cross-axis (e.g. width in a column block) regardless of alignment. @default false */
28
+ stretch?: boolean;
26
29
  /** Sets the minimum width of the block container. */
27
30
  minWidth?: string;
28
31
  /** Sets the maximum width of the block container. */
@@ -35,4 +38,4 @@ export interface GoabBlockProps extends Margins, DataAttributes {
35
38
  children?: ReactNode;
36
39
  }
37
40
  /** Group components into a block with consistent space between. */
38
- export declare function GoabBlock({ testId, children, ...rest }: GoabBlockProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function GoabBlock({ testId, stretch, children, ...rest }: GoabBlockProps): import("react/jsx-runtime").JSX.Element;
@@ -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,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { GoabDropdownItemMountType } from '@abgov/ui-components-common';
2
3
  interface WCProps {
3
4
  value: string;
@@ -18,17 +19,19 @@ export interface GoabDropdownItemProps {
18
19
  value: string;
19
20
  /** Display label for the dropdown item. */
20
21
  label?: string;
21
- /** Text used to filter and match this item in typeahead search. */
22
+ /** Rich item content. On selection, `label` is shown and `filter` defaults to the content's text. */
22
23
  filter?: string;
23
24
  /** Sets a data-testid attribute for automated testing. */
24
25
  testId?: string;
25
26
  /** Controls how the item is registered with the parent dropdown. */
26
27
  mountType?: GoabDropdownItemMountType;
28
+ /** Rich content rendered for this item in the dropdown menu. When set, `label` is shown in the dropdown input on selection and `filter` defaults to the content's text. */
29
+ children?: ReactNode;
27
30
  /** @deprecated */
28
31
  name?: string;
29
32
  }
30
33
  /** Present a list of options to the user to select from. */
31
34
  export declare function GoabDropdownOption(props: GoabDropdownItemProps): import("react/jsx-runtime").JSX.Element;
32
35
  /** Present a list of options to the user to select from. */
33
- export declare function GoabDropdownItem({ value, label, filter, name, mountType, }: GoabDropdownItemProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function GoabDropdownItem({ value, label, filter, name, mountType, children, }: GoabDropdownItemProps): import("react/jsx-runtime").JSX.Element;
34
37
  export {};
@@ -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;
@@ -0,0 +1,66 @@
1
+ import { GoabDropdownMultiselectLabelFormatOptions, GoabDropdownMultiselectOnChangeDetail, GoabDropdownMultiselectSize, GoabIconType, Margins } from '@abgov/ui-components-common';
2
+ import { JSX } from 'react';
3
+ interface WCProps extends Margins {
4
+ ref: React.RefObject<HTMLElement | null>;
5
+ name: string;
6
+ value?: string[];
7
+ placeholder?: string;
8
+ disabled?: string;
9
+ error?: string;
10
+ filterable?: string;
11
+ "leading-icon"?: string;
12
+ testid?: string;
13
+ "aria-label"?: string;
14
+ "aria-labelledby"?: string;
15
+ "max-height"?: string;
16
+ width?: string;
17
+ size?: GoabDropdownMultiselectSize;
18
+ "label-format"?: string;
19
+ "show-select-all"?: string;
20
+ }
21
+ declare module "react" {
22
+ namespace JSX {
23
+ interface IntrinsicElements {
24
+ "goa-dropdown-multiselect": WCProps & React.HTMLAttributes<HTMLElement>;
25
+ }
26
+ }
27
+ }
28
+ export interface GoabDropdownMultiselectProps extends Margins {
29
+ /** @required Identifier for the group. Used in change events. */
30
+ name: string;
31
+ /** Array of currently selected checkbox value. */
32
+ value?: string[];
33
+ /** Text shown when nothing is selected. */
34
+ placeholder?: string;
35
+ /** Enables filtering of options by typing in the trigger. */
36
+ filterable?: boolean;
37
+ /** Icon shown to the left of the dropdown input. */
38
+ leadingIcon?: GoabIconType;
39
+ /** Disables the component. @default false */
40
+ disabled?: boolean;
41
+ /** Shows an error state. @default false */
42
+ error?: boolean;
43
+ /** Sets a data-testid attribute for automated testing. */
44
+ testId?: string;
45
+ /** Provides an accessible label when no visible label is associated. */
46
+ ariaLabel?: string;
47
+ /** References an external element that labels this component. */
48
+ ariaLabelledBy?: string;
49
+ /** Sets the maximum height of the dropdown content area. @default "276px" */
50
+ maxHeight?: string;
51
+ /** Sets a fixed width for the component and popover panel. */
52
+ width?: string;
53
+ /** Sets the size variant. @default "default" */
54
+ size?: GoabDropdownMultiselectSize;
55
+ /** The display label format of the closed dropdown. When 'count' the display label shows only "n items" in the label, when 'list' it shows a comma separated list of selected item labels. @default "list" */
56
+ labelFormat?: GoabDropdownMultiselectLabelFormatOptions;
57
+ /** Shows a "Select All" checkbox at the top of the options list. @default false */
58
+ showSelectAll?: boolean;
59
+ /** Dropdown items rendered inside the component (GoabDropdownItem elements). */
60
+ children?: React.ReactNode;
61
+ /** Callback fired when the selected value change. */
62
+ onChange?: (detail: GoabDropdownMultiselectOnChangeDetail) => void;
63
+ }
64
+ /** A dropdown that presents a list of checkboxes for multiple selection. */
65
+ export declare function GoabDropdownMultiselect({ name, value, placeholder, disabled, error, filterable, leadingIcon, showSelectAll, testId, ariaLabel, ariaLabelledBy, maxHeight, width, size, labelFormat, children, onChange, mt, mr, mb, ml, }: GoabDropdownMultiselectProps): JSX.Element;
66
+ export default GoabDropdownMultiselect;
@@ -1,8 +1,10 @@
1
+ import { ReactNode } from 'react';
1
2
  import { DataAttributes, GoabFilterChipTheme, GoabIconType, Margins } from '@abgov/ui-components-common';
2
3
  interface WCProps extends Margins {
3
4
  icontheme: GoabFilterChipTheme;
4
5
  error?: string;
5
- content: string;
6
+ content?: string;
7
+ arialabel?: string;
6
8
  secondarytext?: string;
7
9
  leadingicon?: GoabIconType;
8
10
  testid?: string;
@@ -18,8 +20,10 @@ declare module "react" {
18
20
  }
19
21
  }
20
22
  export interface GoabFilterChipProps extends Margins, DataAttributes {
21
- /** @required Text label of the chip. */
22
- content: string;
23
+ /** @required Content displayed in the chip. Accepts a string or ReactNode for custom content. */
24
+ content: ReactNode;
25
+ /** Accessible content used to label the filter chip controls. */
26
+ ariaLabel?: string;
23
27
  /** Theme style of the leading icon. @default "outline" */
24
28
  iconTheme?: GoabFilterChipTheme;
25
29
  /** Shows an error state. */
@@ -34,5 +38,5 @@ export interface GoabFilterChipProps extends Margins, DataAttributes {
34
38
  onClick?: () => void;
35
39
  }
36
40
  /** Allow the user to enter information, filter content, and make selections. */
37
- export declare const GoabFilterChip: ({ iconTheme, error, onClick, ...rest }: GoabFilterChipProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const GoabFilterChip: ({ content, iconTheme, error, onClick, ...rest }: GoabFilterChipProps) => import("react/jsx-runtime").JSX.Element;
38
42
  export default GoabFilterChip;
@@ -1,10 +1,11 @@
1
- import { GoabIconButtonVariant, GoabIconSize, GoabIconTheme, GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
1
+ import { GoabIconButtonType, GoabIconButtonVariant, GoabIconSize, GoabIconTheme, GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
2
2
  import { JSX, ReactNode } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  icon: GoabIconType;
5
5
  size?: GoabIconSize;
6
6
  theme?: GoabIconTheme;
7
7
  variant?: GoabIconButtonVariant;
8
+ type?: GoabIconButtonType;
8
9
  title?: string;
9
10
  disabled?: string;
10
11
  arialabel?: string;
@@ -29,6 +30,8 @@ export interface GoabIconButtonProps extends Margins, DataAttributes {
29
30
  size?: GoabIconSize;
30
31
  /** Styles the button to show color, light, dark or destructive action. @default "color" */
31
32
  variant?: GoabIconButtonVariant;
33
+ /** Sets the visual style of the button. @default "default" */
34
+ type?: GoabIconButtonType;
32
35
  /** Sets the theme of the icon inside the button. "outline" for stroked icons, "filled" for solid icons. @default "outline" */
33
36
  theme?: GoabIconTheme;
34
37
  /** Sets the title of the button. */
@@ -51,5 +54,5 @@ export interface GoabIconButtonProps extends Margins, DataAttributes {
51
54
  children?: ReactNode;
52
55
  }
53
56
  /** A compact button with an icon and no text. */
54
- export declare function GoabIconButton({ variant, size, theme, disabled, onClick, actionArgs, actionArg, children, ...rest }: GoabIconButtonProps): JSX.Element;
57
+ export declare function GoabIconButton({ variant, type, size, theme, disabled, onClick, actionArgs, actionArg, children, ...rest }: GoabIconButtonProps): JSX.Element;
55
58
  export {};
@@ -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;
@@ -0,0 +1,39 @@
1
+ import { DataAttributes, GoabScrollPanelDirectionType } from '@abgov/ui-components-common';
2
+ import { default as React, ReactNode, JSX } from 'react';
3
+ interface WCProps {
4
+ height?: string;
5
+ testid?: string;
6
+ direction?: string;
7
+ }
8
+ declare module "react" {
9
+ namespace JSX {
10
+ interface IntrinsicElements {
11
+ "goa-scroll-panel": WCProps & React.HTMLAttributes<HTMLElement>;
12
+ }
13
+ }
14
+ }
15
+ export interface GoabScrollPanelProps extends DataAttributes {
16
+ /** Content rendered in the sticky header region. */
17
+ header?: ReactNode;
18
+ /** Content rendered in the scrollable body region. */
19
+ children?: ReactNode;
20
+ /** Content rendered in the sticky footer region. */
21
+ footer?: ReactNode;
22
+ /**
23
+ * Sets the height of the panel. Accepts any valid CSS height value, including
24
+ * calc()/min()/clamp() and viewport units (e.g. "400px", "100%", "100vh",
25
+ * "calc(100vh - 4rem)"). Invalid values fall back to "100%". Defaults to "100%".
26
+ * The parent element must establish a height context for "100%" to resolve.
27
+ */
28
+ height?: string;
29
+ /** Sets a data-testid attribute for automated testing. */
30
+ testId?: string;
31
+ /**
32
+ * The scroll direction(s). When content overflows, enables scrolling and shadow
33
+ * indicators for the specified direction(s). Accepts "vertical", "horizontal", or "both".
34
+ * Defaults to "vertical".
35
+ */
36
+ direction?: GoabScrollPanelDirectionType;
37
+ }
38
+ export declare function GoabScrollPanel({ header, children, footer, height, testId, direction, ...rest }: GoabScrollPanelProps): JSX.Element;
39
+ export default GoabScrollPanel;
@@ -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;
@@ -0,0 +1,22 @@
1
+ import { GoabWorkspaceLayoutScrollState } from '@abgov/ui-components-common';
2
+ export interface GoabWorkspaceLayoutScrollStateValue {
3
+ scrollPosition: GoabWorkspaceLayoutScrollState;
4
+ isScrollable: boolean;
5
+ }
6
+ export declare const GoabWorkspaceLayoutScrollStateDefault: GoabWorkspaceLayoutScrollStateValue;
7
+ /** @internal — provided by GoabWorkspaceLayout, consumed via the hook below. */
8
+ export declare const GoabWorkspaceLayoutScrollStateContext: import('react').Context<GoabWorkspaceLayoutScrollStateValue>;
9
+ /**
10
+ * Hook that returns the current scroll state of the nearest enclosing
11
+ * GoabWorkspaceLayout. Returns `{ scrollPosition: 'no-scroll', isScrollable: false }`
12
+ * if no layout is mounted.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const { scrollPosition, isScrollable } = useGoabWorkspaceLayoutScrollState();
17
+ * const isCollapsed =
18
+ * scrollPosition === GoabWorkspaceLayoutScrollState.MIDDLE ||
19
+ * scrollPosition === GoabWorkspaceLayoutScrollState.AT_BOTTOM;
20
+ * ```
21
+ */
22
+ export declare function useGoabWorkspaceLayoutScrollState(): GoabWorkspaceLayoutScrollStateValue;
@@ -0,0 +1,42 @@
1
+ import { DataAttributes, GoabWorkspaceLayoutOnScrollStateChangeDetail } from '@abgov/ui-components-common';
2
+ import { default as React, ReactNode, JSX } from 'react';
3
+ interface WCProps {
4
+ testid?: string;
5
+ }
6
+ declare module "react" {
7
+ namespace JSX {
8
+ interface IntrinsicElements {
9
+ "goa-workspace-layout": WCProps & React.HTMLAttributes<HTMLElement> & {
10
+ ref: React.RefObject<HTMLElement | null>;
11
+ };
12
+ }
13
+ }
14
+ }
15
+ export interface GoabWorkspaceLayoutProps extends DataAttributes {
16
+ /** Content rendered in the side navigation region (e.g. work-side-menu). */
17
+ sideMenu?: ReactNode;
18
+ /** Content rendered in the sticky page header region. */
19
+ pageHeader?: ReactNode;
20
+ /** Content rendered in the sticky page footer region. */
21
+ pageFooter?: ReactNode;
22
+ /**
23
+ * A GoabPushDrawer rendered as a sibling of the main card, inside the same
24
+ * workspace shell. Use this slot when the page needs a push drawer alongside
25
+ * the workspace layout — it gives the drawer the shell-level height and flex
26
+ * context it expects, so the consumer does not have to wrap the layout in
27
+ * their own flex container. The side menu is not pushed; only the card is.
28
+ */
29
+ pushDrawer?: ReactNode;
30
+ /** Main scrollable content. */
31
+ children?: ReactNode;
32
+ /** Sets a data-testid attribute for automated testing. */
33
+ testId?: string;
34
+ /**
35
+ * Called whenever the internal scroll state changes (no-scroll → at-top →
36
+ * middle → at-bottom)
37
+ */
38
+ onScrollStateChange?: (detail: GoabWorkspaceLayoutOnScrollStateChangeDetail) => void;
39
+ }
40
+ export declare function GoabWorkspaceLayout({ sideMenu, pageHeader, pageFooter, pushDrawer, children, testId, onScrollStateChange, ...rest }: GoabWorkspaceLayoutProps): JSX.Element;
41
+ export default GoabWorkspaceLayout;
42
+ export { useGoabWorkspaceLayoutScrollState, type GoabWorkspaceLayoutScrollStateValue, } from './workspace-layout-scroll-state';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "7.2.2",
3
+ "version": "7.4.0",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"