@abgov/react-components 7.2.0-dev.20 → 7.2.0-dev.22

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,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 {};
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "7.2.0-dev.20",
3
+ "version": "7.2.0-dev.22",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"