@abgov/react-components 6.11.0 → 7.0.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.
Files changed (134) hide show
  1. package/index.d.ts +5 -0
  2. package/index.js +3736 -1776
  3. package/index.js.map +1 -1
  4. package/index.mjs +3676 -1716
  5. package/index.mjs.map +1 -1
  6. package/lib/accordion/accordion.d.ts +13 -2
  7. package/lib/app-header/app-header.d.ts +14 -2
  8. package/lib/app-header-menu/app-header-menu.d.ts +14 -7
  9. package/lib/badge/badge.d.ts +32 -18
  10. package/lib/block/block.d.ts +9 -0
  11. package/lib/button/button.d.ts +37 -0
  12. package/lib/button-group/button-group.d.ts +5 -0
  13. package/lib/calendar/calendar.d.ts +25 -1
  14. package/lib/callout/callout.d.ts +31 -2
  15. package/lib/card/card-actions.d.ts +2 -0
  16. package/lib/card/card-content.d.ts +2 -0
  17. package/lib/card/card-group.d.ts +2 -0
  18. package/lib/card/card-image.d.ts +3 -0
  19. package/lib/card/card.d.ts +5 -0
  20. package/lib/checkbox/checkbox.d.ts +49 -3
  21. package/lib/checkbox-list/checkbox-list.d.ts +21 -8
  22. package/lib/chip/chip.d.ts +11 -2
  23. package/lib/circular-progress/circular-progress.d.ts +7 -0
  24. package/lib/container/container.d.ts +18 -5
  25. package/lib/data-grid/data-grid.d.ts +6 -1
  26. package/lib/date-picker/date-picker.d.ts +35 -4
  27. package/lib/details/details.d.ts +7 -1
  28. package/lib/divider/divider.d.ts +2 -0
  29. package/lib/drawer/drawer.d.ts +27 -2
  30. package/lib/dropdown/dropdown-item.d.ts +23 -0
  31. package/lib/dropdown/dropdown.d.ts +56 -5
  32. package/lib/file-upload-card/file-upload-card.d.ts +27 -0
  33. package/lib/file-upload-input/file-upload-input.d.ts +23 -1
  34. package/lib/filter-chip/filter-chip.d.ts +31 -3
  35. package/lib/footer/footer.d.ts +20 -3
  36. package/lib/footer-meta-section/footer-meta-section.d.ts +13 -0
  37. package/lib/footer-nav-section/footer-nav-section.d.ts +18 -1
  38. package/lib/form/fieldset.d.ts +7 -1
  39. package/lib/form/public-form-page.d.ts +13 -5
  40. package/lib/form/public-form-summary.d.ts +2 -0
  41. package/lib/form/public-form.d.ts +8 -1
  42. package/lib/form/public-subform-index.d.ts +7 -1
  43. package/lib/form/public-subform.d.ts +8 -1
  44. package/lib/form/task-list.d.ts +4 -1
  45. package/lib/form/task.d.ts +4 -1
  46. package/lib/form-item/form-item.d.ts +37 -8
  47. package/lib/form-step/form-step.d.ts +3 -0
  48. package/lib/form-stepper/form-stepper.d.ts +5 -0
  49. package/lib/grid/grid.d.ts +6 -1
  50. package/lib/hero-banner/hero-banner-actions.d.ts +2 -0
  51. package/lib/hero-banner/hero-banner.d.ts +9 -0
  52. package/lib/icon/icon.d.ts +13 -0
  53. package/lib/icon-button/icon-button.d.ts +18 -2
  54. package/lib/input/input.d.ts +89 -4
  55. package/lib/linear-progress/linear-progress.d.ts +6 -0
  56. package/lib/link/link.d.ts +33 -4
  57. package/lib/menu-button/menu-action.d.ts +5 -0
  58. package/lib/menu-button/menu-button.d.ts +20 -52
  59. package/lib/microsite-header/microsite-header.d.ts +9 -0
  60. package/lib/modal/modal.d.ts +34 -1
  61. package/lib/notification/notification.d.ts +30 -2
  62. package/lib/one-column-layout/one-column-layout.d.ts +2 -0
  63. package/lib/page-block/page-block.d.ts +4 -0
  64. package/lib/pages/pages.d.ts +3 -0
  65. package/lib/pagination/pagination.d.ts +25 -2
  66. package/lib/popover/popover.d.ts +11 -5
  67. package/lib/push-drawer/push-drawer.d.ts +17 -8
  68. package/lib/radio-group/radio-group.d.ts +36 -2
  69. package/lib/radio-group/radio.d.ts +38 -1
  70. package/lib/side-menu/side-menu.d.ts +16 -2
  71. package/lib/side-menu-group/side-menu-group.d.ts +19 -1
  72. package/lib/side-menu-heading/side-menu-heading.d.ts +19 -2
  73. package/lib/skeleton/skeleton.d.ts +7 -1
  74. package/lib/spacer/spacer.d.ts +4 -0
  75. package/lib/spinner/spinner.d.ts +6 -0
  76. package/lib/tab/tab.d.ts +6 -1
  77. package/lib/table/table-sort-header.d.ts +20 -2
  78. package/lib/table/table.d.ts +31 -2
  79. package/lib/tabs/tabs.d.ts +29 -2
  80. package/lib/temporary-notification-ctrl/temporary-notification-ctrl.d.ts +4 -0
  81. package/lib/text/text.d.ts +8 -1
  82. package/lib/textarea/textarea.d.ts +49 -1
  83. package/lib/three-column-layout/three-column-layout.d.ts +11 -1
  84. package/lib/tooltip/tooltip.d.ts +7 -0
  85. package/lib/two-column-layout/two-column-layout.d.ts +9 -2
  86. package/lib/work-side-menu/work-side-menu.d.ts +47 -0
  87. package/lib/work-side-menu-group/work-side-menu-group.d.ts +30 -0
  88. package/lib/work-side-menu-item/work-side-menu-item.d.ts +44 -0
  89. package/lib/work-side-notification-item/work-side-notification-item.d.ts +40 -0
  90. package/lib/work-side-notification-panel/work-side-notification-panel.d.ts +32 -0
  91. package/package.json +1 -6
  92. package/experimental/badge/badge.d.ts +0 -33
  93. package/experimental/button/button.d.ts +0 -43
  94. package/experimental/calendar/calendar.d.ts +0 -30
  95. package/experimental/callout/callout.d.ts +0 -33
  96. package/experimental/checkbox/checkbox.d.ts +0 -52
  97. package/experimental/date-picker/date-picker.d.ts +0 -43
  98. package/experimental/drawer/drawer.d.ts +0 -31
  99. package/experimental/dropdown/dropdown-item.d.ts +0 -26
  100. package/experimental/dropdown/dropdown.d.ts +0 -62
  101. package/experimental/file-upload-card/file-upload-card.d.ts +0 -32
  102. package/experimental/file-upload-input/file-upload-input.d.ts +0 -27
  103. package/experimental/filter-chip/filter-chip.d.ts +0 -31
  104. package/experimental/footer/footer.d.ts +0 -24
  105. package/experimental/footer-meta-section/footer-meta-section.d.ts +0 -18
  106. package/experimental/footer-nav-section/footer-nav-section.d.ts +0 -22
  107. package/experimental/form-hook.d.ts +0 -8
  108. package/experimental/form-item/form-item.d.ts +0 -46
  109. package/experimental/index.d.ts +0 -32
  110. package/experimental/input/input.d.ts +0 -124
  111. package/experimental/link/link.d.ts +0 -32
  112. package/experimental/modal/modal.d.ts +0 -44
  113. package/experimental/notification/notification.d.ts +0 -31
  114. package/experimental/pagination/pagination.d.ts +0 -29
  115. package/experimental/radio-group/radio-group.d.ts +0 -40
  116. package/experimental/radio-group/radio.d.ts +0 -42
  117. package/experimental/side-menu/side-menu.d.ts +0 -19
  118. package/experimental/side-menu-group/side-menu-group.d.ts +0 -24
  119. package/experimental/side-menu-heading/side-menu-heading.d.ts +0 -23
  120. package/experimental/table/table-sort-header.d.ts +0 -20
  121. package/experimental/table/table.d.ts +0 -30
  122. package/experimental/tabs/tabs.d.ts +0 -27
  123. package/experimental/textarea/textarea.d.ts +0 -53
  124. package/experimental/work-side-menu/work-side-menu.d.ts +0 -34
  125. package/experimental/work-side-menu-group/work-side-menu-group.d.ts +0 -22
  126. package/experimental/work-side-menu-item/work-side-menu-item.d.ts +0 -32
  127. package/experimental.js +0 -1245
  128. package/experimental.js.map +0 -1
  129. package/experimental.mjs +0 -1245
  130. package/experimental.mjs.map +0 -1
  131. package/parseISO-BHUUf1QW.mjs +0 -1693
  132. package/parseISO-BHUUf1QW.mjs.map +0 -1
  133. package/parseISO-Dj57mwuH.js +0 -1692
  134. package/parseISO-Dj57mwuH.js.map +0 -1
@@ -1,23 +1,52 @@
1
- import { GoabFormItemLabelSize, GoabFormItemRequirement, Margins, DataAttributes } from '@abgov/ui-components-common';
1
+ import { GoabFormItemLabelSize, GoabFormItemRequirement, GoabFormItemType, Margins, DataAttributes } from '@abgov/ui-components-common';
2
2
  import { JSX } from 'react';
3
+ interface WCProps extends Margins {
4
+ label?: string;
5
+ labelsize?: GoabFormItemLabelSize;
6
+ requirement?: GoabFormItemRequirement;
7
+ error?: string;
8
+ helptext?: string;
9
+ maxwidth?: string;
10
+ "public-form-summary-order"?: number;
11
+ name?: string;
12
+ id?: string;
13
+ testid?: string;
14
+ type?: GoabFormItemType;
15
+ version?: string;
16
+ }
17
+ declare module "react" {
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ "goa-form-item": WCProps & React.HTMLAttributes<HTMLElement>;
21
+ }
22
+ }
23
+ }
3
24
  export interface GoabFormItemProps extends Margins, DataAttributes {
25
+ /** Creates a label for the form item. */
4
26
  label?: string;
27
+ /** Sets the label size. 'regular' for standard, 'large' for emphasis. @default "regular" */
5
28
  labelSize?: GoabFormItemLabelSize;
29
+ /** Marks the field with an optional or required label indicator. */
6
30
  requirement?: GoabFormItemRequirement;
31
+ /** Error text displayed under the form field. Leave blank to indicate a valid field. Accepts a string or ReactNode for custom error content. */
7
32
  error?: string | React.ReactNode;
33
+ /** Help text displayed under the form field to provide additional explanation. Accepts a string or ReactNode for custom help content. */
8
34
  helpText?: string | React.ReactNode;
35
+ /** Sets the maximum width of the form item. @default "none" */
9
36
  maxWidth?: string;
10
- /**
11
- * Public form: to arrange fields in the summary
12
- */
37
+ /** Specifies the input type for appropriate message spacing. Used with checkbox-list or radio-group. */
38
+ type?: GoabFormItemType;
39
+ /** Sets the display order within the form summary. For public-form use only. */
13
40
  publicFormSummaryOrder?: number;
14
- /**
15
- * Public form: allow to override the label value within the form-summary to provide a shorter description of the value
16
- */
41
+ /** Overrides the label value within the form-summary to provide a shorter description. For public-form use only. */
17
42
  name?: string;
43
+ /** Content rendered inside the form item, typically an input component. */
18
44
  children?: React.ReactNode;
45
+ /** Sets a data-testid attribute for automated testing. */
19
46
  testId?: string;
47
+ /** Sets the id attribute on the form item element. */
20
48
  id?: string;
21
49
  }
22
- export declare function GoabFormItem({ error, helpText, publicFormSummaryOrder, children, ...rest }: GoabFormItemProps): JSX.Element;
50
+ /** Wraps an input control with a text label, requirement label, helper text, and error text. */
51
+ export declare function GoabFormItem({ error, helpText, publicFormSummaryOrder, children, type, ...rest }: GoabFormItemProps): JSX.Element;
23
52
  export default GoabFormItem;
@@ -11,8 +11,11 @@ declare module "react" {
11
11
  }
12
12
  }
13
13
  export interface GoabFormStepProps {
14
+ /** @required The step label text displayed to users. */
14
15
  text: string;
16
+ /** The completion status of the step. Affects visual styling and icons. */
15
17
  status?: GoabFormStepStatus;
16
18
  }
19
+ /** Individual step in a multi-step form. */
17
20
  export declare function GoabFormStep(props: GoabFormStepProps): import("react/jsx-runtime").JSX.Element;
18
21
  export default GoabFormStep;
@@ -13,10 +13,15 @@ declare module "react" {
13
13
  }
14
14
  }
15
15
  export interface GoabFormStepperProps extends Margins {
16
+ /** The current step state value (1-based index). Leaving it blank (-1) will allow any step to be accessed. */
16
17
  step?: number;
18
+ /** Sets a data-testid attribute for automated testing. */
17
19
  testId?: string;
20
+ /** Content rendered inside the form stepper, typically GoabFormStep components. */
18
21
  children?: ReactNode;
22
+ /** Callback fired when the active step changes. */
19
23
  onChange?: (detail: GoabFormStepperOnChangeDetail) => void;
20
24
  }
25
+ /** Provides a visual representation of a form through a series of steps. */
21
26
  export declare function GoabFormStepper({ testId, step, mt, mb, ml, mr, onChange, children, }: GoabFormStepperProps): import("react/jsx-runtime").JSX.Element;
22
27
  export default GoabFormStepper;
@@ -13,10 +13,15 @@ declare module "react" {
13
13
  }
14
14
  }
15
15
  export interface GoabGridProps extends Margins {
16
- gap?: Spacing;
16
+ /** @required Minimum width of the child elements. */
17
17
  minChildWidth: string;
18
+ /** Gap between child items. @default "m" */
19
+ gap?: Spacing;
20
+ /** Sets a data-testid attribute for automated testing. */
18
21
  testId?: string;
22
+ /** Content rendered inside the grid layout. */
19
23
  children?: React.ReactNode;
20
24
  }
25
+ /** Arrange a number of components into a responsive grid pattern. */
21
26
  export declare function GoabGrid({ gap, minChildWidth, mt, mr, mb, ml, testId, children, }: GoabGridProps): JSX.Element;
22
27
  export default GoabGrid;
@@ -1,6 +1,8 @@
1
1
  import { JSX } from 'react';
2
2
  export type GoabHeroBannerActionsType = {
3
+ /** Content rendered inside the hero banner actions slot, typically buttons or links. */
3
4
  children?: React.ReactNode;
4
5
  };
6
+ /** Displays action content in the hero banner actions area. */
5
7
  export declare function GoabHeroBannerActions({ children, }: GoabHeroBannerActionsType): JSX.Element;
6
8
  export default GoabHeroBannerActions;
@@ -16,14 +16,23 @@ declare module "react" {
16
16
  }
17
17
  }
18
18
  export interface GoabHeroBannerProps {
19
+ /** @required Main heading text. */
19
20
  heading: string;
21
+ /** Background image url. */
20
22
  backgroundUrl?: string;
23
+ /** Minimum height of the hero banner. Defaults to 600px when a background image is provided. */
21
24
  minHeight?: string;
25
+ /** Sets a data-testid attribute for automated testing. */
22
26
  testId?: string;
27
+ /** Content rendered inside the hero banner body. */
23
28
  children?: React.ReactNode;
29
+ /** Maximum width of the content area. @default "100%" */
24
30
  maxContentWidth?: string;
31
+ /** Hero Banner background color when no background image is provided. @default "#f8f8f8" */
25
32
  backgroundColor?: string;
33
+ /** Text color within the hero banner. */
26
34
  textColor?: string;
27
35
  }
36
+ /** A visual band of text, including an image and a call to action. */
28
37
  export declare function GoabHeroBanner({ heading, backgroundUrl, minHeight, maxContentWidth, backgroundColor, textColor, children, testId, }: GoabHeroBannerProps): JSX.Element;
29
38
  export default GoabHeroBanner;
@@ -10,14 +10,25 @@ declare module "react" {
10
10
  }
11
11
  }
12
12
  export interface GoabIconProps extends Margins, DataAttributes {
13
+ /** @required The icon type to display. See GoabIconType for available icons. */
13
14
  type: GoabIconType | GoabIconOverridesType;
15
+ /** Sets the size of the icon. Accepts numeric (1-6) or named sizes. @default "medium" */
14
16
  size?: GoabIconSize;
17
+ /** Sets the icon theme. 'outline' shows stroked icons, 'filled' shows solid icons. @default "outline" */
15
18
  theme?: GoabIconTheme;
19
+ /** When true, inverts the icon colors for use on dark backgrounds. */
16
20
  inverted?: string | boolean;
21
+ /** Sets a custom fill color for the icon. Accepts any valid CSS color value. */
17
22
  fillColor?: string;
23
+ /** Sets the opacity of the icon from 0 (transparent) to 1 (opaque). @default 1 */
18
24
  opacity?: number;
25
+ /** Adds an accessible title to the icon SVG. Used by screen readers. */
19
26
  title?: string;
27
+ /** Defines how the icon will be announced by screen readers. */
20
28
  ariaLabel?: string;
29
+ /** Sets the ARIA role for the icon. Use 'presentation' for decorative icons. @default "img" */
30
+ role?: string;
31
+ /** Sets a data-testid attribute for automated testing. */
21
32
  testId?: string;
22
33
  }
23
34
  interface WCProps extends Margins {
@@ -29,7 +40,9 @@ interface WCProps extends Margins {
29
40
  opacity?: number;
30
41
  title?: string;
31
42
  arialabel?: string;
43
+ role?: string;
32
44
  testid?: string;
33
45
  }
46
+ /** A simple and universal graphic symbol representing an action, object, or concept to help guide the user. */
34
47
  export declare function GoabIcon({ inverted, ...rest }: GoabIconProps): JSX.Element;
35
48
  export {};
@@ -1,8 +1,9 @@
1
- import { GoabIconButtonVariant, GoabIconSize, GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
1
+ import { 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
+ theme?: GoabIconTheme;
6
7
  variant?: GoabIconButtonVariant;
7
8
  title?: string;
8
9
  disabled?: string;
@@ -22,18 +23,33 @@ declare module "react" {
22
23
  }
23
24
  }
24
25
  export interface GoabIconButtonProps extends Margins, DataAttributes {
26
+ /** @required Sets the icon. */
25
27
  icon: GoabIconType;
28
+ /** Sets the size of button. @default "medium" */
26
29
  size?: GoabIconSize;
30
+ /** Styles the button to show color, light, dark or destructive action. @default "color" */
27
31
  variant?: GoabIconButtonVariant;
32
+ /** Sets the theme of the icon inside the button. "outline" for stroked icons, "filled" for solid icons. @default "outline" */
33
+ theme?: GoabIconTheme;
34
+ /** Sets the title of the button. */
28
35
  title?: string;
36
+ /** Disables the button. */
29
37
  disabled?: boolean;
38
+ /** Callback fired when the icon button is clicked. */
30
39
  onClick?: () => void;
40
+ /** Sets a data-testid attribute for automated testing. */
31
41
  testId?: string;
42
+ /** Sets the aria-label of the button. */
32
43
  ariaLabel?: string;
44
+ /** Action identifier passed in click events for event delegation patterns. */
33
45
  action?: string;
46
+ /** Multiple argument values passed with the action in click events. */
34
47
  actionArgs?: Record<string, unknown>;
48
+ /** Single argument value passed with the action in click events. */
35
49
  actionArg?: string;
50
+ /** Content rendered inside the icon button. */
36
51
  children?: ReactNode;
37
52
  }
38
- export declare function GoabIconButton({ variant, size, disabled, onClick, actionArgs, actionArg, children, ...rest }: GoabIconButtonProps): JSX.Element;
53
+ /** 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;
39
55
  export {};
@@ -1,46 +1,117 @@
1
1
  import { JSX } from 'react';
2
- import { GoabAutoCapitalize, GoabDate, GoabIconType, GoabInputOnBlurDetail, GoabInputOnChangeDetail, GoabInputOnFocusDetail, GoabInputOnKeyPressDetail, GoabInputType, Margins, DataAttributes } from '@abgov/ui-components-common';
3
- export interface IgnoreMe {
4
- ignore: string;
2
+ import { GoabAutoCapitalize, GoabDate, GoabIconType, GoabInputOnBlurDetail, GoabInputOnChangeDetail, GoabInputOnFocusDetail, GoabInputOnKeyPressDetail, GoabInputSize, GoabInputType, Margins, DataAttributes } from '@abgov/ui-components-common';
3
+ interface WCProps extends Margins {
4
+ type?: GoabInputType;
5
+ name: string;
6
+ value?: string;
7
+ id?: string;
8
+ autocapitalize?: GoabAutoCapitalize;
9
+ autocomplete?: string;
10
+ debounce?: number;
11
+ placeholder?: string;
12
+ leadingicon?: string;
13
+ trailingicon?: string;
14
+ variant: string;
15
+ disabled?: string;
16
+ error?: string;
17
+ readonly?: string;
18
+ focused?: string;
19
+ handletrailingiconclick: string;
20
+ width?: string;
21
+ prefix?: string;
22
+ suffix?: string;
23
+ arialabel?: string;
24
+ testid?: string;
25
+ textalign?: string;
26
+ size?: GoabInputSize;
27
+ min?: string | number;
28
+ max?: string | number;
29
+ step?: number;
30
+ maxlength?: number;
31
+ version?: string;
32
+ trailingiconarialabel?: string;
33
+ }
34
+ declare module "react" {
35
+ namespace JSX {
36
+ interface IntrinsicElements {
37
+ "goa-input": WCProps & React.HTMLAttributes<HTMLInputElement> & {
38
+ ref?: React.RefObject<HTMLInputElement | null>;
39
+ };
40
+ }
41
+ }
5
42
  }
6
43
  interface BaseProps extends Margins, DataAttributes {
44
+ /** Name of input value that is received in event detail payloads. */
7
45
  name: string;
46
+ /** Sets the id attribute of the input element. */
8
47
  id?: string;
48
+ /** Debounce delay in milliseconds before firing the change event. 0 means no debounce. */
9
49
  debounce?: number;
50
+ /** Sets the input disabled state. */
10
51
  disabled?: boolean;
52
+ /** Controls automatic capitalization behavior on supported mobile browsers. */
11
53
  autoCapitalize?: GoabAutoCapitalize;
54
+ /** Sets the autocomplete attribute for the input element. */
12
55
  autoComplete?: string;
56
+ /** Sets placeholder text when the input is empty. */
13
57
  placeholder?: string;
58
+ /** Sets the icon shown before the value. */
14
59
  leadingIcon?: GoabIconType;
60
+ /** Sets the icon shown after the value. */
15
61
  trailingIcon?: GoabIconType;
62
+ /** Callback fired when the trailing icon is clicked. */
16
63
  onTrailingIconClick?: () => void;
64
+ /** Sets the visual style variant. @default "goa" */
17
65
  variant?: "goa" | "bare";
66
+ /** Sets focus on initial render or controlled updates. */
18
67
  focused?: boolean;
68
+ /** Sets the readonly state. */
19
69
  readonly?: boolean;
70
+ /** Sets the error state styling. */
20
71
  error?: boolean;
72
+ /** Sets the width of the input field. */
21
73
  width?: string;
74
+ /** @deprecated Use leadingContent instead. */
22
75
  prefix?: string;
76
+ /** @deprecated Use trailingContent instead. */
23
77
  suffix?: string;
78
+ /** Sets a data-testid attribute for automated testing. */
24
79
  testId?: string;
80
+ /** Sets the aria-label used by assistive technologies. */
25
81
  ariaLabel?: string;
82
+ /** Sets content in the leading slot. */
26
83
  leadingContent?: React.ReactNode;
84
+ /** Sets content in the trailing slot. */
27
85
  trailingContent?: React.ReactNode;
86
+ /** Sets the maximum number of characters. */
28
87
  maxLength?: number;
88
+ /** Sets the aria-label for an interactive trailing icon. */
29
89
  trailingIconAriaLabel?: string;
90
+ /** Sets text alignment. @default "left" */
30
91
  textAlign?: "left" | "right";
92
+ /** Sets the input size. @default "default" */
93
+ size?: GoabInputSize;
31
94
  }
32
95
  type OnChange<T = string> = (detail: GoabInputOnChangeDetail<T>) => void;
33
96
  type OnFocus<T = string> = (detail: GoabInputOnFocusDetail<T>) => void;
34
97
  type OnBlur<T = string> = (detail: GoabInputOnBlurDetail<T>) => void;
35
98
  type OnKeyPress<T = string> = (detail: GoabInputOnKeyPressDetail<T>) => void;
36
99
  export interface GoabInputProps extends BaseProps {
100
+ /** Callback fired when the input value changes. Receives GoabInputOnChangeDetail. */
37
101
  onChange?: OnChange<string>;
102
+ /** Bound to the current value of the input field. */
38
103
  value?: string;
104
+ /** Minimum value. Supports any number, or ISO 8601 format for date/datetime types. */
39
105
  min?: number | string;
106
+ /** Maximum value. Supports any number, or ISO 8601 format for date/datetime types. */
40
107
  max?: number | string;
108
+ /** How much a number or date value should change by. @default 1 */
41
109
  step?: number;
110
+ /** Callback fired when the input receives focus. Receives GoabInputOnFocusDetail. */
42
111
  onFocus?: OnFocus<string>;
112
+ /** Callback fired when the input loses focus. Receives GoabInputOnBlurDetail. */
43
113
  onBlur?: OnBlur<string>;
114
+ /** Callback fired when a key is pressed in the input. Receives GoabInputOnKeyPressDetail. */
44
115
  onKeyPress?: OnKeyPress<string>;
45
116
  }
46
117
  interface GoabNumberInputProps extends BaseProps {
@@ -63,20 +134,34 @@ interface GoabDateInputProps extends BaseProps {
63
134
  onBlur?: OnBlur<GoabDate>;
64
135
  onKeyPress?: OnKeyPress<GoabDate>;
65
136
  }
66
- export declare function GoabInput({ variant, textAlign, focused, disabled, readonly, error, leadingContent, trailingContent, onTrailingIconClick, onChange, onFocus, onBlur, onKeyPress, ...rest }: GoabInputProps & {
137
+ /** A single-line field where users can input and edit text. */
138
+ export declare function GoabInput({ variant, textAlign, size, focused, disabled, readonly, error, leadingContent, trailingContent, onTrailingIconClick, onChange, onFocus, onBlur, onKeyPress, ...rest }: GoabInputProps & {
67
139
  type?: GoabInputType;
68
140
  }): JSX.Element;
141
+ /** A single-line field where users can input and edit text. */
69
142
  export declare function GoabInputText(props: GoabInputProps): JSX.Element;
143
+ /** A single-line field where users can enter masked password text. */
70
144
  export declare function GoabInputPassword(props: GoabInputProps): JSX.Element;
145
+ /** A single-line field where users can enter or select a date. */
71
146
  export declare function GoabInputDate({ value, min, max, ...props }: GoabDateInputProps): JSX.Element;
147
+ /** A single-line field where users can enter or select a time. */
72
148
  export declare function GoabInputTime({ value, min, max, ...props }: GoabInputProps): JSX.Element;
149
+ /** A single-line field where users can enter a date and time. */
73
150
  export declare function GoabInputDateTime({ value, min, max, ...props }: GoabDateInputProps): JSX.Element;
151
+ /** A single-line field where users can enter an email address. */
74
152
  export declare function GoabInputEmail(props: GoabInputProps): JSX.Element;
153
+ /** A single-line field where users can enter search terms. */
75
154
  export declare function GoabInputSearch(props: GoabInputProps): JSX.Element;
155
+ /** A single-line field where users can enter a URL. */
76
156
  export declare function GoabInputUrl(props: GoabInputProps): JSX.Element;
157
+ /** A single-line field where users can enter a phone number. */
77
158
  export declare function GoabInputTel(props: GoabInputProps): JSX.Element;
159
+ /** A control that allows users to select a file for upload. */
78
160
  export declare function GoabInputFile(props: GoabInputProps): JSX.Element;
161
+ /** A single-line field where users can enter or select a month. */
79
162
  export declare function GoabInputMonth(props: GoabInputProps): JSX.Element;
163
+ /** A single-line field where users can input and edit numeric values. */
80
164
  export declare function GoabInputNumber({ min, max, value, textAlign, ...props }: GoabNumberInputProps): JSX.Element;
165
+ /** A range input where users can choose a numeric value within minimum and maximum limits. */
81
166
  export declare function GoabInputRange(props: GoabInputProps): JSX.Element;
82
167
  export default GoabInput;
@@ -13,11 +13,17 @@ declare module "react" {
13
13
  }
14
14
  }
15
15
  export interface GoabLinearProgressProps {
16
+ /** Progress value (0-100). When undefined, shows an indeterminate loading animation. */
16
17
  progress?: number | null;
18
+ /** Controls visibility of the percentage text. @default "visible" */
17
19
  percentVisibility?: "visible" | "hidden" | undefined;
20
+ /** Accessible label for the progress bar. */
18
21
  ariaLabel?: string;
22
+ /** ID of the element that labels this progress bar. */
19
23
  ariaLabelledBy?: string;
24
+ /** Sets a data-testid attribute for automated testing. */
20
25
  testId?: string;
21
26
  }
27
+ /** Provide visual feedback to users while loading. */
22
28
  export declare const GoabLinearProgress: ({ progress, percentVisibility, ariaLabel, ariaLabelledBy, testId, }: GoabLinearProgressProps) => import("react/jsx-runtime").JSX.Element;
23
29
  export default GoabLinearProgress;
@@ -1,13 +1,42 @@
1
1
  import { ReactNode } from 'react';
2
- import { GoabIconType, Margins, DataAttributes } from '@abgov/ui-components-common';
3
- interface GoabLinkProps extends Margins, DataAttributes {
2
+ import { GoabIconType, GoabLinkColor, GoabLinkSize, Margins, DataAttributes } from '@abgov/ui-components-common';
3
+ interface WCProps extends Margins {
4
+ leadingicon?: GoabIconType;
5
+ trailingicon?: GoabIconType;
6
+ action?: string;
7
+ actionArgs?: string;
8
+ actionArg?: string;
9
+ testid?: string;
10
+ color?: GoabLinkColor;
11
+ size?: GoabLinkSize;
12
+ }
13
+ declare module "react" {
14
+ namespace JSX {
15
+ interface IntrinsicElements {
16
+ "goa-link": WCProps & React.HTMLAttributes<HTMLElement>;
17
+ }
18
+ }
19
+ }
20
+ export interface GoabLinkProps extends Margins, DataAttributes {
21
+ /** @required Content rendered inside the link. */
22
+ children: ReactNode;
23
+ /** Icon displayed before the link text. */
4
24
  leadingIcon?: GoabIconType;
25
+ /** Icon displayed after the link text. */
5
26
  trailingIcon?: GoabIconType;
27
+ /** Custom action event name to dispatch when the link is clicked. */
6
28
  action?: string;
29
+ /** Object of arguments to pass with the action event. */
7
30
  actionArgs?: Record<string, unknown>;
31
+ /** Single argument to pass with the action event. Deprecated, use actionArgs instead. */
8
32
  actionArg?: string;
33
+ /** Sets the color theme. 'interactive' for blue, 'dark' for black, 'light' for white text. @default "interactive" */
34
+ color?: GoabLinkColor;
35
+ /** Sets the text size and corresponding icon size. @default "medium" */
36
+ size?: GoabLinkSize;
37
+ /** Sets a data-testid attribute for automated testing. */
9
38
  testId?: string;
10
- children: ReactNode;
11
39
  }
12
- export declare function GoabLink({ actionArgs, actionArg, children, ...rest }: GoabLinkProps): import("react/jsx-runtime").JSX.Element;
40
+ /** Wraps an anchor element to add icons or margins. */
41
+ export declare function GoabLink({ actionArgs, actionArg, color, size, children, ...rest }: GoabLinkProps): import("react/jsx-runtime").JSX.Element;
13
42
  export default GoabLink;
@@ -14,10 +14,15 @@ declare module "react" {
14
14
  }
15
15
  }
16
16
  export interface GoabMenuActionProps extends DataAttributes {
17
+ /** @required Display text for the menu action. */
17
18
  text: string;
19
+ /** @required Action identifier included in the click event. */
18
20
  action: string;
21
+ /** Icon displayed before the text. */
19
22
  icon?: GoabIconType;
23
+ /** Sets a data-testid attribute for automated testing. */
20
24
  testId?: string;
21
25
  }
26
+ /** Individual action item within a menu button. */
22
27
  export declare function GoabMenuAction(props: GoabMenuActionProps): JSX.Element;
23
28
  export default GoabMenuAction;
@@ -1,27 +1,16 @@
1
- import { DataAttributes, GoabButtonType, GoabIconType, GoabMenuButtonOnActionDetail } from '@abgov/ui-components-common';
1
+ import { DataAttributes, GoabButtonSize, GoabButtonType, GoabButtonVariant, GoabIconType, GoabMenuButtonOnActionDetail } from '@abgov/ui-components-common';
2
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 {GoaIconType} leadingIcon - Optional leading icon appearing within the button.
10
- * @property {string} [testid] - A test identifier for automated testing purposes.
11
- * @property {React.RefObject<HTMLElement | null>} ref - A reference object pointing to the Web Component's DOM element.
12
- */
13
3
  interface WCProps {
14
- text: string;
4
+ text?: string;
15
5
  type: GoabButtonType;
6
+ size?: GoabButtonSize;
7
+ variant?: GoabButtonVariant;
16
8
  "max-width"?: string;
17
9
  "leading-icon"?: GoabIconType;
10
+ "aria-label"?: string;
18
11
  testid?: string;
19
12
  ref: React.RefObject<HTMLElement | null>;
20
13
  }
21
- /**
22
- * Extends React's `JSX` namespace to include the custom `goa-menu-button` Web Component.
23
- * The `goa-menu-button` supports additional React-specific props.
24
- */
25
14
  declare module "react" {
26
15
  namespace JSX {
27
16
  interface IntrinsicElements {
@@ -29,49 +18,28 @@ declare module "react" {
29
18
  }
30
19
  }
31
20
  }
32
- /**
33
- * Props for the `GoabMenuButton` React component.
34
- *
35
- * @typedef {Object} GoabMenuButtonProps
36
- *
37
- * @property {string} text - The text label to display on the button.
38
- * @property {GoabButtonType} [type="primary"] - The button type, e.g., "primary", "secondary". Defaults to "primary".
39
- * @property {GoaIconType} leadingIcon - Optional leading icon appearing within the button.
40
- * @property {string} [testId] - A test identifier for automated testing purposes.
41
- * @property {Function} [onAction] - Callback function invoked when an action event is emitted by the component.
42
- * @property {ReactNode} [children] - Optional child elements to be rendered inside the button.
43
- */
44
21
  export interface GoabMenuButtonProps extends DataAttributes {
45
- text: string;
22
+ /** The button label text. When provided, displays as a text button with a dropdown icon. */
23
+ text?: string;
24
+ /** The button style variant. @default "primary" */
46
25
  type?: GoabButtonType;
26
+ /** Sets the size of the button. @default "normal" */
27
+ size?: GoabButtonSize;
28
+ /** Sets the color variant for semantic meaning. @default "normal" */
29
+ variant?: GoabButtonVariant;
30
+ /** Maximum width of the dropdown menu. */
47
31
  maxWidth?: string;
32
+ /** Icon displayed before the button text. When no text is provided, displays as an icon button. */
48
33
  leadingIcon?: GoabIconType;
34
+ /** Sets the aria-label for the icon button in icon-only mode. @default "Open menu" */
35
+ ariaLabel?: string;
36
+ /** Sets a data-testid attribute for automated testing. */
49
37
  testId?: string;
38
+ /** Callback fired when a menu action is selected. */
50
39
  onAction?: (detail: GoabMenuButtonOnActionDetail) => void;
40
+ /** Content rendered inside the menu button, typically GoabMenuAction items. */
51
41
  children?: ReactNode;
52
42
  }
53
- /**
54
- * A React wrapper component for the `goa-menu-button` Web Component.
55
- *
56
- * This component provides seamless integration of the Web Component into a React application, including React-specific props and event handling.
57
- *
58
- * @function GoabMenuButton
59
- * @param {GoabMenuButtonProps} props - The props for the component.
60
- *
61
- * @returns {JSX.Element} A JSX element wrapping the `goa-menu-button` Web Component.
62
- *
63
- * @example
64
- * ```tsx
65
- * <GoabMenuButton
66
- * text="Example Button"
67
- * type="secondary"
68
- * onAction={(action) => console.log(`Action: ${action}`)}
69
- * >
70
- * <GoabMenuAction text="Option 1" action="option1" />
71
- * <GoabMenuAction text="Option 2" action="option2" />
72
- * <GoabMenuAction text="Option 3" action="option3" />
73
- * </GoabMenuButton>
74
- * ```
75
- */
43
+ /** A button with more than one action. */
76
44
  export declare function GoabMenuButton({ type, testId, onAction, children, ...rest }: GoabMenuButtonProps): JSX.Element;
77
45
  export default GoabMenuButton;
@@ -19,14 +19,23 @@ interface WCProps {
19
19
  testid?: string;
20
20
  }
21
21
  export interface GoabHeaderProps {
22
+ /** @required The service type which determines the badge style. "live" shows official government site text, "alpha" and "beta" show development stage badges. */
22
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. */
23
25
  version?: string | React.ReactNode;
26
+ /** URL to a feedback page displayed when provided. */
24
27
  feedbackUrl?: string;
28
+ /** Sets a data-testid attribute for automated testing. */
25
29
  testId?: string;
30
+ /** Maximum width of the content area. @default "100%" */
26
31
  maxContentWidth?: string;
32
+ /** Sets the target attribute for the feedback URL link. @default "blank" */
27
33
  feedbackUrlTarget?: GoabLinkTarget;
34
+ /** Sets the target attribute for the header link. @default "blank" */
28
35
  headerUrlTarget?: GoabLinkTarget;
36
+ /** Callback fired when the feedback link is clicked, enables custom feedback handling. */
29
37
  onFeedbackClick?: () => void;
30
38
  }
39
+ /** Communicate what stage the service is at, connect to Alberta.ca, and gather feedback on your service. */
31
40
  export declare function GoabMicrositeHeader({ type, version, feedbackUrl, maxContentWidth, feedbackUrlTarget, headerUrlTarget, testId, onFeedbackClick, }: GoabHeaderProps): JSX.Element;
32
41
  export default GoabMicrositeHeader;
@@ -1,14 +1,46 @@
1
1
  import { GoabModalCalloutVariant, GoabModalRole, GoabModalTransition } from '@abgov/ui-components-common';
2
- import { ReactElement, ReactNode, JSX } from 'react';
2
+ import { ReactElement, ReactNode, RefObject, JSX } from 'react';
3
+ interface WCProps {
4
+ ref: RefObject<HTMLElement | null>;
5
+ heading?: ReactNode;
6
+ open?: string;
7
+ maxwidth?: string;
8
+ closable: string;
9
+ /**
10
+ * @deprecated The role property is deprecated and will be removed in a future version.
11
+ * The modal will always use role="dialog".
12
+ */
13
+ role?: GoabModalRole;
14
+ transition?: GoabModalTransition;
15
+ calloutvariant?: GoabModalCalloutVariant;
16
+ testid?: string;
17
+ version?: string;
18
+ }
19
+ declare module "react" {
20
+ namespace JSX {
21
+ interface IntrinsicElements {
22
+ "goa-modal": WCProps & React.HTMLAttributes<HTMLElement>;
23
+ }
24
+ }
25
+ }
3
26
  export interface GoabModalProps {
27
+ /** The heading text displayed at the top of the modal. */
4
28
  heading?: ReactNode;
29
+ /** Set the max allowed width of the modal. @default "60ch" */
5
30
  maxWidth?: string;
31
+ /** Content rendered in the modal's actions slot, typically action buttons. */
6
32
  actions?: ReactElement<any>;
33
+ /** Callback fired when the modal is closed. When provided, enables the close button and backdrop click-to-close behavior. */
7
34
  onClose?: () => void;
35
+ /** Sets the animation transition when opening/closing. 'fast' or 'slow' for animated, 'none' for instant. */
8
36
  transition?: GoabModalTransition;
37
+ /** Content rendered inside the modal body. */
9
38
  children?: ReactNode;
39
+ /** Controls if the modal is visible or not. */
10
40
  open?: boolean;
41
+ /** Sets the context and colour of the callout modal. Required when used as a callout type. */
11
42
  calloutVariant?: GoabModalCalloutVariant;
43
+ /** Sets a data-testid attribute for automated testing. */
12
44
  testId?: string;
13
45
  /**
14
46
  * @deprecated The role property is deprecated and will be removed in a future version.
@@ -16,5 +48,6 @@ export interface GoabModalProps {
16
48
  */
17
49
  role?: GoabModalRole;
18
50
  }
51
+ /** An overlay that appears in front of all other content, and requires a user to take an action before continuing. */
19
52
  export declare function GoabModal({ heading, children, maxWidth, open, actions, transition, calloutVariant, onClose, testId, }: GoabModalProps): JSX.Element;
20
53
  export default GoabModal;