@aws/mynah-ui 4.35.0-beta.2 → 4.35.0-beta.4

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.
@@ -10,11 +10,18 @@ export interface ButtonProps {
10
10
  icon?: HTMLElement | ExtendedHTMLElement;
11
11
  testId?: string;
12
12
  label?: HTMLElement | ExtendedHTMLElement | string;
13
+ confirmation?: {
14
+ confirmButtonText: string;
15
+ cancelButtonText: string;
16
+ title: string;
17
+ description?: string;
18
+ };
13
19
  tooltip?: string;
14
20
  tooltipVerticalDirection?: OverlayVerticalDirection;
15
21
  tooltipHorizontalDirection?: OverlayHorizontalDirection;
16
22
  children?: Array<HTMLElement | ExtendedHTMLElement | string>;
17
23
  disabled?: boolean;
24
+ hidden?: boolean;
18
25
  primary?: boolean;
19
26
  border?: boolean;
20
27
  status?: 'main' | 'primary' | 'info' | 'success' | 'warning' | 'error' | 'clear' | 'dimmed-clear';
@@ -26,6 +33,7 @@ export interface ButtonProps {
26
33
  export declare abstract class ButtonAbstract {
27
34
  render: ExtendedHTMLElement;
28
35
  updateLabel: (label: HTMLElement | ExtendedHTMLElement | string) => void;
36
+ setHidden: (hidden: boolean) => void;
29
37
  setEnabled: (enabled: boolean) => void;
30
38
  hideTooltip: () => void;
31
39
  }
@@ -34,5 +42,6 @@ export declare class Button extends ButtonAbstract {
34
42
  constructor(props: ButtonProps);
35
43
  updateLabel: (label: HTMLElement | ExtendedHTMLElement | string) => void;
36
44
  setEnabled: (enabled: boolean) => void;
45
+ setHidden: (hidden: boolean) => void;
37
46
  hideTooltip: () => void;
38
47
  }
@@ -3,10 +3,11 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { DomBuilderObject, ExtendedHTMLElement } from '../../helper/dom';
6
- import { EngagementType } from '../../static';
6
+ import { EngagementType, Status } from '../../static';
7
7
  export interface CardProps extends Partial<DomBuilderObject> {
8
8
  border?: boolean;
9
9
  background?: boolean;
10
+ status?: Status;
10
11
  padding?: 'small' | 'medium' | 'large' | 'none';
11
12
  children?: Array<HTMLElement | ExtendedHTMLElement | string>;
12
13
  onCardEngaged?: (engagement: {
@@ -30,5 +30,6 @@ export declare class ChatItemFormItemsWrapper {
30
30
  private readonly isItemValid;
31
31
  isFormValid: () => boolean;
32
32
  disableAll: () => void;
33
- getAllValues: () => Record<string, string | string[]>;
33
+ enableAll: () => void;
34
+ getAllValues: () => Record<string, string | Array<Record<string, string>>>;
34
35
  }
@@ -14,5 +14,5 @@ export declare class PromptOptions {
14
14
  constructor(props: PromptOptionsProps);
15
15
  private readonly getFilterOptionsWrapper;
16
16
  readonly update: (filterOptions?: FilterOption[], buttons?: ChatItemButton[]) => void;
17
- readonly getOptionValues: () => Record<string, string | string[]>;
17
+ readonly getOptionValues: () => Record<string, string | Array<Record<string, string>>>;
18
18
  }
@@ -4,15 +4,21 @@ export interface DetailedListItemWrapperProps {
4
4
  listItem: DetailedListItem;
5
5
  descriptionTextDirection?: 'ltr' | 'rtl';
6
6
  onSelect?: (detailedListItem: DetailedListItem) => void;
7
- onActionClick?: (action: ChatItemButton) => void;
7
+ onClick?: (detailedListItem: DetailedListItem) => void;
8
+ onActionClick?: (action: ChatItemButton, detailedListItem?: DetailedListItem) => void;
8
9
  selectable?: boolean;
10
+ clickable?: boolean;
9
11
  textDirection?: 'row' | 'column';
10
12
  }
11
13
  export declare class DetailedListItemWrapper {
12
14
  render: ExtendedHTMLElement;
15
+ private tooltipOverlay;
16
+ private tooltipTimeout;
13
17
  private readonly props;
14
18
  private actionMenuOverlay;
15
19
  constructor(props: DetailedListItemWrapperProps);
20
+ private readonly showTooltip;
21
+ readonly hideTooltip: () => void;
16
22
  readonly setFocus: (isFocused: boolean, scrollIntoView: boolean) => void;
17
23
  readonly getItem: () => DetailedListItem;
18
24
  private readonly showActionMenuOverlay;
@@ -7,8 +7,11 @@ export interface DetailedListSheetProps {
7
7
  onFilterValueChange?: (filterValues: Record<string, any>, isValid: boolean) => void;
8
8
  onKeyPress?: (e: KeyboardEvent) => void;
9
9
  onItemSelect?: (detailedListItem: DetailedListItem) => void;
10
+ onItemClick?: (detailedListItem: DetailedListItem) => void;
11
+ onBackClick?: () => void;
10
12
  onTitleActionClick?: (action: ChatItemButton) => void;
11
- onActionClick?: (action: ChatItemButton) => void;
13
+ onActionClick?: (action: ChatItemButton, listItem?: DetailedListItem) => void;
14
+ onFilterActionClick?: (action: ChatItemButton, filterValues?: Record<string, any>, isValid?: boolean) => void;
12
15
  onClose?: () => void;
13
16
  };
14
17
  }
@@ -17,7 +20,7 @@ export declare class DetailedListSheet {
17
20
  detailedListWrapper: DetailedListWrapper;
18
21
  private readonly keyPressHandler;
19
22
  constructor(props: DetailedListSheetProps);
20
- open: () => void;
21
- update: (detailedList: DetailedList) => void;
23
+ open: (showBackButton?: boolean) => void;
24
+ update: (detailedList: DetailedList, showBackButton?: boolean) => void;
22
25
  close: () => void;
23
26
  }
@@ -6,11 +6,14 @@ export interface DetailedListWrapperProps {
6
6
  onFilterValueChange?: (filterValues: Record<string, any>, isValid: boolean) => void;
7
7
  onGroupActionClick?: (action: ChatItemButton) => void;
8
8
  onItemSelect?: (detailedListItem: DetailedListItem) => void;
9
- onItemActionClick?: (action: ChatItemButton) => void;
9
+ onItemClick?: (detailedListItem: DetailedListItem) => void;
10
+ onItemActionClick?: (action: ChatItemButton, detailedListItem?: DetailedListItem) => void;
11
+ onFilterActionClick?: (action: ChatItemButton, filterValues?: Record<string, any>, isValid?: boolean) => void;
10
12
  }
11
13
  export declare class DetailedListWrapper {
12
14
  render: ExtendedHTMLElement;
13
15
  private readonly detailedListItemGroupsContainer;
16
+ private filterForm;
14
17
  private readonly filtersContainer;
15
18
  private readonly filterActionsContainer;
16
19
  private readonly headerContainer;
@@ -3,21 +3,21 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../../helper/dom';
6
- import { ChatItemFormItem, ListItemEntry } from '../../static';
6
+ import { ListItemEntry, SingularFormItem } from '../../static';
7
7
  export interface FormItemListProps {
8
- items: ChatItemFormItem[];
9
- entries: ListItemEntry[];
8
+ items: SingularFormItem[];
9
+ value?: ListItemEntry[];
10
10
  classNames?: string[];
11
11
  attributes?: Record<string, string>;
12
12
  label?: HTMLElement | ExtendedHTMLElement | string;
13
13
  description?: ExtendedHTMLElement;
14
14
  wrapperTestId?: string;
15
- onChange?: (values: string[]) => void;
15
+ onChange?: (values: Array<Record<string, string | Array<Record<string, string>>>>) => void;
16
16
  }
17
17
  export declare abstract class FormItemListAbstract {
18
18
  render: ExtendedHTMLElement;
19
19
  setValue: (value: ListItemEntry[]) => void;
20
- getValue: () => string[];
20
+ getValue: () => Array<Record<string, string>>;
21
21
  setEnabled: (enabled: boolean) => void;
22
22
  }
23
23
  export declare class FormItemListInternal extends FormItemListAbstract {
@@ -25,19 +25,19 @@ export declare class FormItemListInternal extends FormItemListAbstract {
25
25
  private readonly addButton;
26
26
  private readonly props;
27
27
  private readonly rows;
28
- private formData;
29
28
  render: ExtendedHTMLElement;
30
29
  constructor(props: FormItemListProps);
31
30
  private addRow;
32
31
  private removeRow;
33
32
  setValue: (value: ListItemEntry[]) => void;
34
- getValue: () => string[];
33
+ getValue: () => Array<Record<string, string>>;
35
34
  setEnabled: (enabled: boolean) => void;
35
+ isFormValid: () => boolean;
36
36
  }
37
37
  export declare class FormItemList extends FormItemListAbstract {
38
38
  render: ExtendedHTMLElement;
39
39
  constructor(props: FormItemListProps);
40
40
  setValue: (value: ListItemEntry[]) => void;
41
- getValue: () => string[];
41
+ getValue: () => Array<Record<string, string>>;
42
42
  setEnabled: (enabled: boolean) => void;
43
43
  }
@@ -10,6 +10,7 @@ export declare enum MynahIcons {
10
10
  AT = "at",
11
11
  MENU = "menu",
12
12
  MINUS = "minus",
13
+ MINUS_CIRCLE = "minus-circled",
13
14
  SEARCH = "search",
14
15
  PLUS = "plus",
15
16
  PAPER_CLIP = "paper-clip",
@@ -31,6 +32,7 @@ export declare enum MynahIcons {
31
32
  NOTIFICATION = "notification",
32
33
  EYE = "eye",
33
34
  ELLIPSIS = "ellipsis",
35
+ ELLIPSIS_H = "ellipsis-h",
34
36
  OK = "ok",
35
37
  UP_OPEN = "up-open",
36
38
  DOWN_OPEN = "down-open",
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { ExtendedHTMLElement } from '../helper/dom';
6
+ import { TabBarAction, TabBarMainAction } from '../static';
6
7
  export interface TabBarButtonsWrapperProps {
7
8
  onButtonClick?: (selectedTabId: string, buttonId: string) => void;
8
9
  }
@@ -15,3 +16,16 @@ export declare class TabBarButtonsWrapper {
15
16
  private readonly handleTabBarButtonsChange;
16
17
  private readonly getTabsBarButtonsRender;
17
18
  }
19
+ interface TabBarButtonWithMultipleOptionsProps {
20
+ onButtonClick: (action: TabBarAction) => void;
21
+ tabBarActionButton: TabBarMainAction;
22
+ }
23
+ export declare class TabBarButtonWithMultipleOptions {
24
+ render: ExtendedHTMLElement;
25
+ private buttonOptionsOverlay;
26
+ private readonly props;
27
+ constructor(props: TabBarButtonWithMultipleOptionsProps);
28
+ private readonly showButtonOptionsOverlay;
29
+ private readonly hideButtonOptionsOverlay;
30
+ }
31
+ export {};
@@ -2,28 +2,41 @@
2
2
  * Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { ChatItemButton, DomBuilderObject, ExtendedHTMLElement } from '../main';
5
+ import { ChatItemButton, DomBuilderObject, ExtendedHTMLElement, MynahIcons, Status, TabBarAction } from '../main';
6
+ import { MynahIconsType } from './icon';
6
7
  export interface SheetProps {
7
8
  title?: string;
8
9
  children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
9
10
  fullScreen?: boolean;
11
+ showBackButton?: boolean;
10
12
  description?: string;
11
- actions?: ChatItemButton[];
13
+ status?: {
14
+ icon?: MynahIcons | MynahIconsType;
15
+ title?: string;
16
+ description?: string;
17
+ status?: Status;
18
+ };
19
+ actions?: TabBarAction[];
12
20
  onClose: () => void;
13
- onActionClick?: (action: ChatItemButton) => void;
21
+ onBack: () => void;
22
+ onActionClick?: (action: TabBarAction) => void;
14
23
  }
15
24
  export declare class Sheet {
25
+ private backButton;
16
26
  private sheetTitle;
17
27
  private sheetTitleActions;
28
+ private sheetStatus;
18
29
  private sheetDescription;
19
30
  sheetContainer: ExtendedHTMLElement;
20
31
  sheetWrapper: ExtendedHTMLElement;
21
32
  onClose: () => void;
33
+ onBack: () => void;
22
34
  onActionClick: ((action: ChatItemButton) => void) | undefined;
23
35
  constructor();
24
36
  private readonly getTitle;
25
37
  private readonly getTitleActions;
26
38
  private readonly getDescription;
39
+ private readonly getStatus;
27
40
  close: () => void;
28
41
  show: () => void;
29
42
  }
@@ -128,6 +128,7 @@ declare const _default: {
128
128
  detailedList: {
129
129
  action: string;
130
130
  actionMenu: string;
131
+ status: string;
131
132
  };
132
133
  tabBar: {
133
134
  wrapper: string;
package/dist/main.d.ts CHANGED
@@ -207,8 +207,8 @@ export declare class MynahUI {
207
207
  * Simply creates and shows a custom form
208
208
  */
209
209
  showCustomForm: (tabId: string, formItems?: ChatItemFormItem[], buttons?: ChatItemButton[], title?: string, description?: string) => void;
210
- openDetailedList: (data: DetailedListSheetProps) => {
211
- update: (data: DetailedList) => void;
210
+ openDetailedList: (data: DetailedListSheetProps, showBackButton?: boolean) => {
211
+ update: (data: DetailedList, showBackButton?: boolean) => void;
212
212
  close: () => void;
213
213
  changeTarget: (direction: 'up' | 'down', snapOnLastAndFirst?: boolean) => void;
214
214
  getTargetElementId: () => string | undefined;