@aws/mynah-ui 3.4.0 → 4.0.0
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.
- package/dist/components/chat-item/chat-item-buttons.d.ts +21 -0
- package/dist/components/chat-item/chat-item-card.d.ts +4 -0
- package/dist/components/chat-item/chat-item-followup-option.d.ts +2 -0
- package/dist/components/chat-item/chat-item-form-items.d.ts +23 -0
- package/dist/components/chat-item/chat-prompt-input-sticky-card.d.ts +12 -0
- package/dist/components/chat-item/chat-wrapper.d.ts +1 -0
- package/dist/components/feedback-form/feedback-form.d.ts +0 -1
- package/dist/components/form-items/radio-group.d.ts +28 -0
- package/dist/components/form-items/select.d.ts +29 -0
- package/dist/components/form-items/stars.d.ts +22 -0
- package/dist/components/form-items/text-area.d.ts +21 -0
- package/dist/components/form-items/text-input.d.ts +22 -0
- package/dist/components/icon.d.ts +2 -1
- package/dist/main.d.ts +5 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +27 -2
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
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 { ChatItemButton } from '../../static';
|
|
7
|
+
import { ChatItemFormItemsWrapper } from './chat-item-form-items';
|
|
8
|
+
export interface ChatItemButtonsWrapperProps {
|
|
9
|
+
tabId: string;
|
|
10
|
+
buttons: ChatItemButton[];
|
|
11
|
+
formItems: ChatItemFormItemsWrapper | null;
|
|
12
|
+
onActionClick: (action: ChatItemButton) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class ChatItemButtonsWrapper {
|
|
15
|
+
private readonly props;
|
|
16
|
+
private readonly actions;
|
|
17
|
+
render: ExtendedHTMLElement;
|
|
18
|
+
constructor(props: ChatItemButtonsWrapperProps);
|
|
19
|
+
private readonly handleValidationChange;
|
|
20
|
+
private readonly disableAll;
|
|
21
|
+
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { ExtendedHTMLElement } from '../../helper/dom';
|
|
6
6
|
import { ChatItem } from '../../static';
|
|
7
7
|
import { CardBody } from '../card/card-body';
|
|
8
|
+
import { ChatItemFormItemsWrapper } from './chat-item-form-items';
|
|
9
|
+
import { ChatItemButtonsWrapper } from './chat-item-buttons';
|
|
8
10
|
export interface ChatItemCardProps {
|
|
9
11
|
tabId: string;
|
|
10
12
|
chatItem: ChatItem;
|
|
@@ -15,6 +17,8 @@ export declare class ChatItemCard {
|
|
|
15
17
|
contentBody: CardBody;
|
|
16
18
|
chatAvatar: ExtendedHTMLElement;
|
|
17
19
|
updateStack: Array<Partial<ChatItem>>;
|
|
20
|
+
chatFormItems: ChatItemFormItemsWrapper | null;
|
|
21
|
+
chatButtons: ChatItemButtonsWrapper | null;
|
|
18
22
|
typewriterItemIndex: number;
|
|
19
23
|
previousTypewriterItemIndex: number;
|
|
20
24
|
typewriterId: string;
|
|
@@ -13,7 +13,9 @@ export declare class ChatItemFollowUpOption {
|
|
|
13
13
|
render: ExtendedHTMLElement;
|
|
14
14
|
private followupTooltip;
|
|
15
15
|
private followupTooltipTimeout;
|
|
16
|
+
private disabled;
|
|
16
17
|
constructor(props: ChatItemFollowUpOptionProps);
|
|
17
18
|
private readonly showCroppedFollowupText;
|
|
18
19
|
readonly hideCroppedFollowupText: () => void;
|
|
20
|
+
readonly setEnabled: (enabled: boolean) => void;
|
|
19
21
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { ChatItem } from '../../static';
|
|
7
|
+
export interface ChatItemFormItemsWrapperProps {
|
|
8
|
+
tabId: string;
|
|
9
|
+
chatItem: ChatItem;
|
|
10
|
+
}
|
|
11
|
+
export declare class ChatItemFormItemsWrapper {
|
|
12
|
+
private readonly props;
|
|
13
|
+
private readonly options;
|
|
14
|
+
private readonly validationItems;
|
|
15
|
+
private isValid;
|
|
16
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
17
|
+
render: ExtendedHTMLElement;
|
|
18
|
+
constructor(props: ChatItemFormItemsWrapperProps);
|
|
19
|
+
private readonly getValidationHandler;
|
|
20
|
+
isFormValid: () => boolean;
|
|
21
|
+
disableAll: () => void;
|
|
22
|
+
getAllValues: () => Record<string, string>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export interface ChatPromptInputStickyCardProps {
|
|
7
|
+
tabId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ChatPromptInputStickyCard {
|
|
10
|
+
render: ExtendedHTMLElement;
|
|
11
|
+
constructor(props: ChatPromptInputStickyCardProps);
|
|
12
|
+
}
|
|
@@ -15,6 +15,7 @@ export declare class ChatWrapper {
|
|
|
15
15
|
private readonly promptInputElement;
|
|
16
16
|
private readonly promptInput;
|
|
17
17
|
private readonly promptInfo;
|
|
18
|
+
private readonly promptStickyCard;
|
|
18
19
|
private lastChatItemCard;
|
|
19
20
|
render: ExtendedHTMLElement;
|
|
20
21
|
constructor(props: ChatWrapperProps);
|
|
@@ -9,7 +9,6 @@ export interface FeedbackFormProps {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class FeedbackForm {
|
|
11
11
|
private feedbackFormWrapper;
|
|
12
|
-
private readonly feedbackSelect;
|
|
13
12
|
private readonly feedbackOptionsWrapper;
|
|
14
13
|
private readonly feedbackComment;
|
|
15
14
|
private readonly feedbackSubmitButton;
|
|
@@ -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
|
+
interface SelectOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RadioGroupProps {
|
|
11
|
+
classNames?: string[];
|
|
12
|
+
attributes?: Record<string, string>;
|
|
13
|
+
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
14
|
+
value?: string;
|
|
15
|
+
optional?: boolean;
|
|
16
|
+
options?: SelectOption[];
|
|
17
|
+
onChange?: (value: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare class RadioGroup {
|
|
20
|
+
private readonly radioGroupElement;
|
|
21
|
+
private readonly groupName;
|
|
22
|
+
render: ExtendedHTMLElement;
|
|
23
|
+
constructor(props: RadioGroupProps);
|
|
24
|
+
setValue: (value: string) => void;
|
|
25
|
+
getValue: () => string;
|
|
26
|
+
setEnabled: (enabled: boolean) => void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { MynahIcons } from '../icon';
|
|
7
|
+
interface SelectOption {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SelectProps {
|
|
12
|
+
classNames?: string[];
|
|
13
|
+
attributes?: Record<string, string>;
|
|
14
|
+
icon?: MynahIcons;
|
|
15
|
+
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
16
|
+
value?: string;
|
|
17
|
+
optional?: boolean;
|
|
18
|
+
options?: SelectOption[];
|
|
19
|
+
onChange?: (value: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare class Select {
|
|
22
|
+
private readonly selectElement;
|
|
23
|
+
render: ExtendedHTMLElement;
|
|
24
|
+
constructor(props: SelectProps);
|
|
25
|
+
setValue: (value: string) => void;
|
|
26
|
+
getValue: () => string;
|
|
27
|
+
setEnabled: (enabled: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export type StarValues = 1 | 2 | 3 | 4 | 5;
|
|
7
|
+
export interface StarsProps {
|
|
8
|
+
classNames?: string[];
|
|
9
|
+
attributes?: Record<string, string>;
|
|
10
|
+
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
initStar?: StarValues;
|
|
14
|
+
}
|
|
15
|
+
export declare class Stars {
|
|
16
|
+
private readonly starsContainer;
|
|
17
|
+
render: ExtendedHTMLElement;
|
|
18
|
+
constructor(props: StarsProps);
|
|
19
|
+
setValue: (star: StarValues) => void;
|
|
20
|
+
getValue: () => string;
|
|
21
|
+
setEnabled: (enabled: boolean) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
export interface TextAreaProps {
|
|
7
|
+
classNames?: string[];
|
|
8
|
+
attributes?: Record<string, string>;
|
|
9
|
+
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class TextArea {
|
|
15
|
+
private readonly inputElement;
|
|
16
|
+
render: ExtendedHTMLElement;
|
|
17
|
+
constructor(props: TextAreaProps);
|
|
18
|
+
setValue: (value: string) => void;
|
|
19
|
+
getValue: () => string;
|
|
20
|
+
setEnabled: (enabled: boolean) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export interface TextInputProps {
|
|
7
|
+
classNames?: string[];
|
|
8
|
+
attributes?: Record<string, string>;
|
|
9
|
+
label?: HTMLElement | ExtendedHTMLElement | string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
numeric?: boolean;
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class TextInput {
|
|
16
|
+
private readonly inputElement;
|
|
17
|
+
render: ExtendedHTMLElement;
|
|
18
|
+
constructor(props: TextInputProps);
|
|
19
|
+
setValue: (value: string) => void;
|
|
20
|
+
getValue: () => string;
|
|
21
|
+
setEnabled: (enabled: boolean) => void;
|
|
22
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -19,7 +19,11 @@ export interface MynahUIProps {
|
|
|
19
19
|
onResetStore?: (tabId: string) => void;
|
|
20
20
|
onChatPrompt?: (tabId: string, prompt: ChatPrompt) => void;
|
|
21
21
|
onFollowUpClicked?: (tabId: string, messageId: string, followUp: ChatItemAction) => void;
|
|
22
|
-
|
|
22
|
+
onInBodyButtonClicked?: (tabId: string, messageId: string, action: {
|
|
23
|
+
id: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
formItemValues?: Record<string, string>;
|
|
26
|
+
}) => void;
|
|
23
27
|
onTabChange?: (tabId: string) => void;
|
|
24
28
|
onTabAdd?: (tabId: string) => void;
|
|
25
29
|
onTabRemove?: (tabId: string) => void;
|