@aws/mynah-ui 4.15.10 → 4.16.0-beta.1

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.
@@ -0,0 +1 @@
1
+ npm run test:e2e
@@ -9,6 +9,7 @@ export interface ButtonProps {
9
9
  classNames?: string[];
10
10
  attributes?: Record<string, string>;
11
11
  icon?: HTMLElement | ExtendedHTMLElement;
12
+ testId?: string;
12
13
  label?: HTMLElement | ExtendedHTMLElement | string;
13
14
  tooltip?: string;
14
15
  tooltipVerticalDirection?: OverlayVerticalDirection;
@@ -19,6 +19,7 @@ export declare const PARTS_CLASS_NAME = "typewriter-part";
19
19
  export declare const PARTS_CLASS_NAME_VISIBLE = "typewriter";
20
20
  export interface CardBodyProps {
21
21
  body?: string;
22
+ testId?: string;
22
23
  children?: Array<ExtendedHTMLElement | HTMLElement | string | DomBuilderObject>;
23
24
  childLocation?: 'above-body' | 'below-body';
24
25
  highlightRangeWithTooltip?: ReferenceTrackerInformation[];
@@ -6,11 +6,11 @@ import { ExtendedHTMLElement } from '../../helper/dom';
6
6
  import { ChatItemButton } from '../../static';
7
7
  import { ChatItemFormItemsWrapper } from './chat-item-form-items';
8
8
  export interface ChatItemButtonsWrapperProps {
9
- tabId: string;
9
+ tabId?: string;
10
10
  classNames?: string[];
11
11
  buttons: ChatItemButton[];
12
- formItems: ChatItemFormItemsWrapper | null;
13
- onActionClick: (action: ChatItemButton, e?: Event) => void;
12
+ formItems?: ChatItemFormItemsWrapper | null;
13
+ onActionClick?: (action: ChatItemButton, e?: Event) => void;
14
14
  }
15
15
  export declare class ChatItemButtonsWrapper {
16
16
  private readonly props;
@@ -7,6 +7,7 @@ import { CardRenderDetails, CodeBlockActions, OnCodeBlockActionFunction, OnCopie
7
7
  import { CardBody } from '../card/card-body';
8
8
  export interface ChatItemCardContentProps {
9
9
  body?: string;
10
+ testId?: string;
10
11
  renderAsStream?: boolean;
11
12
  classNames?: string[];
12
13
  codeReference?: ReferenceTrackerInformation[];
@@ -17,6 +17,7 @@ export declare class ChatPromptInput {
17
17
  private readonly promptTextInputCommand;
18
18
  private readonly remainingCharsIndicator;
19
19
  private readonly sendButton;
20
+ private readonly progressIndicator;
20
21
  private readonly promptAttachment;
21
22
  private quickPickTriggerIndex;
22
23
  private quickPickType;
@@ -0,0 +1,11 @@
1
+ import { ExtendedHTMLElement } from '../../../helper/dom';
2
+ export interface PromptInputProgressProps {
3
+ tabId: string;
4
+ }
5
+ export declare class PromptInputProgress {
6
+ render: ExtendedHTMLElement;
7
+ private readonly progressIndicator;
8
+ private progressData;
9
+ private readonly props;
10
+ constructor(props: PromptInputProgressProps);
11
+ }
@@ -6,6 +6,7 @@ import { DomBuilderObject, ExtendedHTMLElement } from '../helper/dom';
6
6
  import '../styles/components/_collapsible-content.scss';
7
7
  interface CollapsibleContentProps {
8
8
  title: string | ExtendedHTMLElement | HTMLElement | DomBuilderObject;
9
+ testId?: string;
9
10
  children: Array<string | ExtendedHTMLElement | HTMLElement | DomBuilderObject>;
10
11
  classNames?: string[];
11
12
  initialCollapsedState?: boolean;
@@ -16,6 +16,8 @@ export interface RadioGroupProps {
16
16
  optional?: boolean;
17
17
  options?: SelectOption[];
18
18
  onChange?: (value: string) => void;
19
+ wrapperTestId?: string;
20
+ optionTestId?: string;
19
21
  }
20
22
  export declare abstract class RadioGroupAbstract {
21
23
  render: ExtendedHTMLElement;
@@ -19,6 +19,8 @@ export interface SelectProps {
19
19
  options?: SelectOption[];
20
20
  placeholder?: string;
21
21
  onChange?: (value: string) => void;
22
+ wrapperTestId?: string;
23
+ optionTestId?: string;
22
24
  }
23
25
  export declare abstract class SelectAbstract {
24
26
  render: ExtendedHTMLElement;
@@ -12,6 +12,8 @@ export interface StarsProps {
12
12
  value?: string;
13
13
  onChange?: (value: string) => void;
14
14
  initStar?: StarValues;
15
+ wrapperTestId?: string;
16
+ optionTestId?: string;
15
17
  }
16
18
  export declare class Stars {
17
19
  private readonly starsContainer;
@@ -11,6 +11,7 @@ export interface TextAreaProps {
11
11
  placeholder?: string;
12
12
  value?: string;
13
13
  onChange?: (value: string) => void;
14
+ testId?: string;
14
15
  }
15
16
  export declare abstract class TextAreaAbstract {
16
17
  render: ExtendedHTMLElement;
@@ -12,6 +12,7 @@ export interface TextInputProps {
12
12
  type?: 'text' | 'number' | 'email';
13
13
  value?: string;
14
14
  onChange?: (value: string) => void;
15
+ testId?: string;
15
16
  }
16
17
  export declare abstract class TextInputAbstract {
17
18
  render: ExtendedHTMLElement;
@@ -56,6 +56,7 @@ export declare enum OverlayVerticalDirection {
56
56
  CENTER = "vertical-direction-at-center"
57
57
  }
58
58
  export interface OverlayProps {
59
+ testId?: string;
59
60
  referenceElement?: HTMLElement | ExtendedHTMLElement;
60
61
  referencePoint?: {
61
62
  top: number;
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { ExtendedHTMLElement } from '../helper/dom';
6
+ import '../styles/components/_collapsible-content.scss';
7
+ import { ChatItemButton, ProgressField } from '../static';
8
+ import '../styles/components/_progress.scss';
9
+ interface ProgressIndicatorProps extends ProgressField {
10
+ testId?: string;
11
+ classNames?: string[];
12
+ onClick?: () => void;
13
+ onActionClick?: (actionName: ChatItemButton, e?: Event) => void;
14
+ }
15
+ export declare class ProgressIndicator {
16
+ render: ExtendedHTMLElement;
17
+ private readonly wrapper;
18
+ private readonly text;
19
+ private readonly valueText;
20
+ private readonly valueBar;
21
+ private buttonsWrapper;
22
+ private props;
23
+ constructor(props: ProgressIndicatorProps);
24
+ private readonly getButtonsWrapper;
25
+ isEmpty: () => boolean;
26
+ update: (props: Partial<ProgressField> | null) => void;
27
+ }
28
+ export {};
@@ -14,6 +14,7 @@ export interface ToggleOption {
14
14
  disabledTooltip?: string | ExtendedHTMLElement;
15
15
  }
16
16
  export interface ToggleProps {
17
+ testId?: string;
17
18
  options: ToggleOption[];
18
19
  direction?: 'horizontal' | 'vertical';
19
20
  value?: string | null;
@@ -25,6 +25,7 @@ export interface DomBuilderObject extends GenericDomBuilderAttributes {
25
25
  type: string;
26
26
  children?: Array<string | DomBuilderObject | HTMLElement | ExtendedHTMLElement> | undefined;
27
27
  innerHTML?: string | undefined;
28
+ testId?: string;
28
29
  persistent?: boolean | undefined;
29
30
  }
30
31
  export interface DomBuilderObjectFilled {
@@ -33,6 +34,7 @@ export interface DomBuilderObjectFilled {
33
34
  events?: Record<string, (event?: any) => any>;
34
35
  children?: Array<string | DomBuilderObject | HTMLElement | ExtendedHTMLElement>;
35
36
  innerHTML?: string | undefined;
37
+ testId?: string;
36
38
  persistent?: boolean;
37
39
  }
38
40
  export interface ExtendedHTMLElement extends HTMLInputElement {
@@ -0,0 +1,141 @@
1
+ declare const _default: {
2
+ selector: string;
3
+ prompt: {
4
+ wrapper: string;
5
+ attachmentWrapper: string;
6
+ attachment: string;
7
+ attachmentRemove: string;
8
+ send: string;
9
+ input: string;
10
+ inputWrapper: string;
11
+ remainingCharsIndicator: string;
12
+ selectedCommand: string;
13
+ quickPicksWrapper: string;
14
+ quickPicksGroup: string;
15
+ quickPicksGroupTitle: string;
16
+ quickPickItem: string;
17
+ footerInfo: string;
18
+ footerInfoBody: string;
19
+ stickyCard: string;
20
+ progress: string;
21
+ };
22
+ chat: {
23
+ wrapper: string;
24
+ chatItemsContainer: string;
25
+ middleBlockWrapper: string;
26
+ stopButton: string;
27
+ };
28
+ chatItem: {
29
+ type: {
30
+ any: string;
31
+ answer: string;
32
+ answerStream: string;
33
+ prompt: string;
34
+ aiPrompt: string;
35
+ systemPrompt: string;
36
+ };
37
+ card: string;
38
+ cardBody: string;
39
+ buttons: {
40
+ wrapper: string;
41
+ button: string;
42
+ };
43
+ chatItemFollowup: {
44
+ optionsWrapper: string;
45
+ optionButton: string;
46
+ title: string;
47
+ wrapper: string;
48
+ };
49
+ syntaxHighlighter: {
50
+ wrapper: string;
51
+ codeBlock: string;
52
+ lineNumbers: string;
53
+ language: string;
54
+ buttonsWrapper: string;
55
+ button: string;
56
+ };
57
+ chatItemForm: {
58
+ wrapper: string;
59
+ title: string;
60
+ itemSelectWrapper: string;
61
+ itemSelect: string;
62
+ itemRadioWrapper: string;
63
+ itemRadio: string;
64
+ itemInput: string;
65
+ itemStarsWrapper: string;
66
+ itemStars: string;
67
+ itemTextArea: string;
68
+ };
69
+ vote: {
70
+ wrapper: string;
71
+ upvote: string;
72
+ upvoteLabel: string;
73
+ downvote: string;
74
+ downvoteLabel: string;
75
+ reportButton: string;
76
+ thanks: string;
77
+ };
78
+ relatedLinks: {
79
+ showMore: string;
80
+ wrapper: string;
81
+ title: string;
82
+ linkWrapper: string;
83
+ link: string;
84
+ linkPreviewOverlay: string;
85
+ linkPreviewOverlayCard: string;
86
+ };
87
+ fileTree: {
88
+ wrapper: string;
89
+ title: string;
90
+ license: string;
91
+ folder: string;
92
+ file: string;
93
+ fileAction: string;
94
+ fileTooltipWrapper: string;
95
+ };
96
+ };
97
+ feedbackForm: {
98
+ wrapper: string;
99
+ title: string;
100
+ optionsSelectWrapper: string;
101
+ optionsSelect: string;
102
+ comment: string;
103
+ closeButton: string;
104
+ cancelButton: string;
105
+ submitButton: string;
106
+ };
107
+ customFeedbackForm: {
108
+ wrapper: string;
109
+ title: string;
110
+ description: string;
111
+ closeButton: string;
112
+ };
113
+ tabBar: {
114
+ wrapper: string;
115
+ buttonsWrapper: string;
116
+ button: string;
117
+ menuButton: string;
118
+ menuOption: string;
119
+ tabsWrapper: string;
120
+ tabOptionWrapper: string;
121
+ tabOption: string;
122
+ tabOptionLabel: string;
123
+ tabOptionCloseButton: string;
124
+ tabAddButton: string;
125
+ maxTabsReachedOverlay: string;
126
+ tabCloseConfirmationOverlay: string;
127
+ tabCloseConfirmationBody: string;
128
+ tabCloseConfirmationCancelButton: string;
129
+ tabCloseConfirmationAcceptButton: string;
130
+ };
131
+ noTabs: {
132
+ wrapper: string;
133
+ newTabButton: string;
134
+ };
135
+ notification: {
136
+ wrapper: string;
137
+ title: string;
138
+ content: string;
139
+ };
140
+ };
141
+ export default _default;
package/dist/main.d.ts CHANGED
@@ -17,6 +17,7 @@ export { SelectProps, SelectAbstract } from './components/form-items/select';
17
17
  export { TextInputProps, TextInputAbstract } from './components/form-items/text-input';
18
18
  export { TextAreaProps, TextAreaAbstract } from './components/form-items/text-area';
19
19
  export { ChatItemCardContent, ChatItemCardContentProps } from './components/chat-item/chat-item-card-content';
20
+ export { default as MynahUITestIds } from './helper/test-ids';
20
21
  export interface MynahUIProps {
21
22
  rootSelector?: string;
22
23
  defaults?: MynahUITabStoreTab;
@@ -29,6 +30,10 @@ export interface MynahUIProps {
29
30
  onStopChatResponse?: (tabId: string, eventId?: string) => void;
30
31
  onResetStore?: (tabId: string) => void;
31
32
  onChatPrompt?: (tabId: string, prompt: ChatPrompt, eventId?: string) => void;
33
+ onChatPromptProgressActionButtonClicked?: (tabId: string, action: {
34
+ id: string;
35
+ text?: string;
36
+ }, eventId?: string) => void;
32
37
  onFollowUpClicked?: (tabId: string, messageId: string, followUp: ChatItemAction, eventId?: string) => void;
33
38
  onInBodyButtonClicked?: (tabId: string, messageId: string, action: {
34
39
  id: string;