@abgov/react-components 7.1.0 → 7.2.0-dev.10

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,5 +1,5 @@
1
1
  import { ReactNode, JSX } from 'react';
2
- import { GoabAccordionHeadingSize, GoabAccordionIconPosition, Margins, DataAttributes } from '@abgov/ui-components-common';
2
+ import { GoabAccordionHeadingSize, GoabAccordionIconPosition, GoabAccordionHeadingType, Margins, DataAttributes } from '@abgov/ui-components-common';
3
3
  interface WCProps extends Margins {
4
4
  open?: string;
5
5
  headingsize?: GoabAccordionHeadingSize;
@@ -9,6 +9,7 @@ interface WCProps extends Margins {
9
9
  maxwidth?: string;
10
10
  testid?: string;
11
11
  iconposition?: GoabAccordionIconPosition;
12
+ headingType?: GoabAccordionHeadingType;
12
13
  }
13
14
  declare module "react" {
14
15
  namespace JSX {
@@ -30,17 +31,21 @@ export interface GoabAccordionProps extends Margins, DataAttributes {
30
31
  secondaryText?: string;
31
32
  /** Sets content rendered within the accordion heading, alongside the heading text. */
32
33
  headingContent?: ReactNode;
34
+ /** Sets content rendered in the accordion heading, right-aligned before the expand/collapse icon. */
35
+ actions?: ReactNode;
33
36
  /** Sets the maximum width of the accordion. @default "none" */
34
37
  maxWidth?: string;
35
38
  /** Sets a data-testid attribute for automated testing. */
36
39
  testId?: string;
37
40
  /** Sets the position of the expand/collapse icon. @default "left" */
38
41
  iconPosition?: GoabAccordionIconPosition;
42
+ /** Sets the accordion style variant. @default "normal" */
43
+ headingType?: GoabAccordionHeadingType;
39
44
  /** Callback fired when the accordion is opened or closed. Receives the new open state as a boolean. */
40
45
  onChange?: (open: boolean) => void;
41
46
  /** Content rendered inside the accordion body. */
42
47
  children?: ReactNode;
43
48
  }
44
49
  /** Let users show and hide sections of related content on a page. */
45
- export declare function GoabAccordion({ open, onChange, headingContent, children, ...rest }: GoabAccordionProps): JSX.Element;
50
+ export declare function GoabAccordion({ open, onChange, headingContent, headingType, actions, children, ...rest }: GoabAccordionProps): JSX.Element;
46
51
  export default GoabAccordion;
@@ -18,19 +18,19 @@ declare module "react" {
18
18
  }
19
19
  }
20
20
  export interface GoabChipProps extends Margins, DataAttributes {
21
- /** @required @deprecated Use GoAFilterChip instead. The text content displayed in the chip. */
21
+ /** @required @deprecated Use GoabFilterChip instead. The text content displayed in the chip. */
22
22
  content: string;
23
- /** @deprecated Use GoAFilterChip instead. When true, shows a delete icon and makes chip clickable. */
23
+ /** @deprecated Use GoabFilterChip instead. When true, shows a delete icon and makes chip clickable. */
24
24
  deletable?: boolean;
25
- /** @deprecated Use GoAFilterChip instead. Icon displayed at the start of the chip. */
25
+ /** @deprecated Use GoabFilterChip instead. Icon displayed at the start of the chip. */
26
26
  leadingIcon?: string;
27
- /** @deprecated Use GoAFilterChip instead. The icon theme - outline or filled. */
27
+ /** @deprecated Use GoabFilterChip instead. The icon theme - outline or filled. */
28
28
  iconTheme?: GoabChipTheme;
29
- /** @deprecated Use GoAFilterChip instead. Shows an error state on the chip. */
29
+ /** @deprecated Use GoabFilterChip instead. Shows an error state on the chip. */
30
30
  error?: boolean;
31
- /** @deprecated Use GoAFilterChip instead. The chip variant style. */
31
+ /** @deprecated Use GoabFilterChip instead. The chip variant style. */
32
32
  variant?: GoabChipVariant;
33
- /** @deprecated Use GoAFilterChip instead. Sets a data-testid attribute for automated testing. */
33
+ /** @deprecated Use GoabFilterChip instead. Sets a data-testid attribute for automated testing. */
34
34
  testId?: string;
35
35
  /** Callback fired when the chip is clicked or deleted. */
36
36
  onClick?: () => void;
@@ -34,9 +34,9 @@ export interface GoabContainerProps extends Margins, DataAttributes {
34
34
  maxHeight?: string;
35
35
  /** Sets a data-testid attribute for automated testing. */
36
36
  testId?: string;
37
- /** Content rendered in the container's title/heading area. */
37
+ /** @deprecated Use title instead. Alias for the title prop. */
38
38
  heading?: ReactNode;
39
- /** @deprecated Use heading instead. Alias for the heading prop. */
39
+ /** Content rendered in the container's title/heading area. */
40
40
  title?: ReactNode;
41
41
  /** Content rendered in the container's actions area, typically buttons or controls. */
42
42
  actions?: ReactNode;
@@ -56,7 +56,7 @@ export interface GoabDropdownProps extends Margins, DataAttributes {
56
56
  leadingIcon?: GoabIconType;
57
57
  /** Maximum height of the dropdown menu. Non-native only. @default "276px" */
58
58
  maxHeight?: string;
59
- /** When true, allows multiple items to be selected. */
59
+ /** When true, allows multiple items to be selected. @internal */
60
60
  multiselect?: boolean;
61
61
  /** When true, renders the native select HTML element. */
62
62
  native?: boolean;
@@ -26,6 +26,8 @@ export interface GoabHeroBannerProps {
26
26
  testId?: string;
27
27
  /** Content rendered inside the hero banner body. */
28
28
  children?: React.ReactNode;
29
+ /** Content rendered in the actions slot. */
30
+ actions?: React.ReactNode;
29
31
  /** Maximum width of the content area. @default "100%" */
30
32
  maxContentWidth?: string;
31
33
  /** Hero Banner background color when no background image is provided. @default "#f8f8f8" */
@@ -34,5 +36,5 @@ export interface GoabHeroBannerProps {
34
36
  textColor?: string;
35
37
  }
36
38
  /** A visual band of text, including an image and a call to action. */
37
- export declare function GoabHeroBanner({ heading, backgroundUrl, minHeight, maxContentWidth, backgroundColor, textColor, children, testId, }: GoabHeroBannerProps): JSX.Element;
39
+ export declare function GoabHeroBanner({ heading, backgroundUrl, minHeight, maxContentWidth, backgroundColor, textColor, children, actions, testId, }: GoabHeroBannerProps): JSX.Element;
38
40
  export default GoabHeroBanner;
@@ -136,6 +136,7 @@ interface GoabDateInputProps extends BaseProps {
136
136
  }
137
137
  /** A single-line field where users can input and edit text. */
138
138
  export declare function GoabInput({ variant, textAlign, size, focused, disabled, readonly, error, leadingContent, trailingContent, onTrailingIconClick, onChange, onFocus, onBlur, onKeyPress, ...rest }: GoabInputProps & {
139
+ /** Sets the type of the input field. @default "text" */
139
140
  type?: GoabInputType;
140
141
  }): JSX.Element;
141
142
  /** A single-line field where users can input and edit text. */
@@ -21,7 +21,7 @@ interface WCProps {
21
21
  export interface GoabHeaderProps {
22
22
  /** @required The service type which determines the badge style. "live" shows official government site text, "alpha" and "beta" show development stage badges. */
23
23
  type: GoabServiceLevel;
24
- /** App or service version displayed on the right side of the header. Accepts a string or custom ReactNode for rich content. */
24
+ /** App or service version displayed on the right side of the header. */
25
25
  version?: string | React.ReactNode;
26
26
  /** URL to a feedback page displayed when provided. */
27
27
  feedbackUrl?: string;
@@ -39,7 +39,7 @@ export interface GoabRadioItemProps extends Margins {
39
39
  maxWidth?: string;
40
40
  /** Disables this radio option. Also disabled if the parent RadioGroup is disabled. */
41
41
  disabled?: boolean;
42
- /** Sets this radio option as checked/selected. */
42
+ /** @internal Sets this radio option as checked/selected. */
43
43
  checked?: boolean;
44
44
  /** Shows an error state on this radio option. */
45
45
  error?: boolean;
package/lib/tab/tab.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { JSX } from 'react';
2
2
  interface WCProps {
3
- heading?: React.ReactNode;
3
+ heading?: string | React.ReactNode;
4
4
  disabled?: string;
5
5
  slug?: string;
6
6
  }
@@ -13,7 +13,7 @@ declare module "react" {
13
13
  }
14
14
  export interface GoabTabItemProps {
15
15
  /** The text label for this tab. Can also pass React nodes for custom heading content. */
16
- heading?: React.ReactNode;
16
+ heading?: string | React.ReactNode;
17
17
  /** When true, disables the tab so it cannot be selected. */
18
18
  disabled?: boolean;
19
19
  /** Content rendered inside the tab panel. */
@@ -4,6 +4,7 @@ interface WCProps {
4
4
  name?: string;
5
5
  direction?: GoabTableSortDirection;
6
6
  "sort-order"?: GoabTableSortOrder;
7
+ version?: "1" | "2";
7
8
  }
8
9
  declare module "react" {
9
10
  namespace JSX {
@@ -3,7 +3,6 @@ import { ReactNode } from 'react';
3
3
  interface WCProps extends Margins {
4
4
  ref?: React.RefObject<HTMLElement | null>;
5
5
  width?: string;
6
- stickyheader?: string;
7
6
  variant?: GoabTableVariant;
8
7
  "sort-mode"?: GoabTableSortMode;
9
8
  testid?: string;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { GoabThemeMode } from '@abgov/ui-components-common';
3
+ interface GoabThemeContextValue {
4
+ mode: GoabThemeMode;
5
+ setMode: (mode: GoabThemeMode) => void;
6
+ toggle: () => void;
7
+ }
8
+ export interface GoabThemeProviderProps {
9
+ children: ReactNode;
10
+ defaultMode?: GoabThemeMode;
11
+ }
12
+ export declare function GoabThemeProvider({ children, defaultMode, }: GoabThemeProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function useTheme(): GoabThemeContextValue;
14
+ export {};
@@ -17,7 +17,7 @@ declare module "react" {
17
17
  export interface GoabTooltipProps extends Margins, DataAttributes {
18
18
  /** Position of the tooltip with respect to the child element. @default "top" */
19
19
  position?: GoabTooltipPosition;
20
- /** The content of the tooltip. Accepts a string or a ReactNode. */
20
+ /** The content of the tooltip. Accepts plain text or rich content. */
21
21
  content?: string | ReactNode;
22
22
  /** Horizontal alignment of the tooltip relative to the child element. @default "center" */
23
23
  hAlign?: GoabTooltipHorizontalAlignment;
@@ -22,7 +22,7 @@ export interface GoabWorkSideMenuItemProps {
22
22
  label: string;
23
23
  /** The URL the menu item links to. When absent, renders as a button instead of a link. */
24
24
  url?: string;
25
- /** Badge text displayed alongside the menu item (e.g., notification count). */
25
+ /** @deprecated Use trailingContent instead. Badge text displayed alongside the menu item (e.g., notification count). */
26
26
  badge?: string;
27
27
  /** When true, indicates this is the currently active menu item. */
28
28
  current?: boolean;
@@ -32,12 +32,14 @@ export interface GoabWorkSideMenuItemProps {
32
32
  icon?: string;
33
33
  /** Sets a data-testid attribute for automated testing. */
34
34
  testId?: string;
35
- /** Sets the visual style of the badge. Use "emergency" for urgent items, "success" for positive status. @default "normal" */
35
+ /** @deprecated Use trailingContent instead. Sets the visual style of the badge. Use "emergency" for urgent items, "success" for positive status. @default "normal" */
36
36
  type?: GoabWorkSideMenuItemType;
37
37
  /** Content rendered inside the menu item. */
38
38
  children?: React.ReactNode;
39
39
  /** Content rendered inside the popover panel attached to this menu item. */
40
40
  popoverContent?: React.ReactNode;
41
+ /** Content rendered after the label in the trailing area of the menu item. */
42
+ trailingContent?: React.ReactNode;
41
43
  }
42
44
  /** Individual menu item within the work side menu. */
43
45
  export declare function GoabWorkSideMenuItem(props: GoabWorkSideMenuItemProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "7.1.0",
3
+ "version": "7.2.0-dev.10",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"