@aws/mynah-ui 4.28.1-beta.1 → 4.29.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-card.d.ts +2 -0
- package/dist/components/chat-item/chat-item-form-items.d.ts +4 -0
- package/dist/components/chat-item/chat-wrapper.d.ts +0 -2
- package/dist/components/detailed-list/detailed-list.d.ts +0 -1
- package/dist/components/form-items/radio-group.d.ts +1 -0
- package/dist/components/icon.d.ts +3 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/static.d.ts +5 -0
- package/docs/DATAMODEL.md +123 -2
- package/docs/img/data-model/chatItems/formItemsTooltip.png +0 -0
- package/docs/img/data-model/chatItems/iconStatus.png +0 -0
- package/package.json +1 -1
- package/ui-tests/dist/27f62b53b93858475a7f.ttf +0 -0
- package/ui-tests/dist/d50a80138ec4f2fb5e9f.ttf +0 -0
- package/ui-tests/dist/index.html +9 -0
- package/ui-tests/dist/main.js +1362 -0
- package/ui-tests/dist/main.js.map +1 -0
package/dist/static.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ export interface TreeNodeDetails {
|
|
|
293
293
|
export interface ChatItemContent {
|
|
294
294
|
header?: (ChatItemContent & {
|
|
295
295
|
icon?: MynahIcons | MynahIconsType;
|
|
296
|
+
iconStatus?: 'main' | 'primary' | 'clear' | Status;
|
|
296
297
|
status?: {
|
|
297
298
|
status?: Status;
|
|
298
299
|
icon?: MynahIcons | MynahIconsType;
|
|
@@ -347,9 +348,12 @@ export interface ChatItem extends ChatItemContent {
|
|
|
347
348
|
snapToTop?: boolean;
|
|
348
349
|
autoCollapse?: boolean;
|
|
349
350
|
canBeVoted?: boolean;
|
|
351
|
+
canBeDismissed?: boolean;
|
|
352
|
+
title?: string;
|
|
350
353
|
fullWidth?: boolean;
|
|
351
354
|
padding?: boolean;
|
|
352
355
|
icon?: MynahIcons | MynahIconsType;
|
|
356
|
+
iconStatus?: 'main' | 'primary' | 'clear' | Status;
|
|
353
357
|
hoverEffect?: boolean;
|
|
354
358
|
status?: Status;
|
|
355
359
|
}
|
|
@@ -364,6 +368,7 @@ interface BaseFormItem {
|
|
|
364
368
|
placeholder?: string;
|
|
365
369
|
value?: string;
|
|
366
370
|
description?: string;
|
|
371
|
+
tooltip?: string;
|
|
367
372
|
icon?: MynahIcons | MynahIconsType;
|
|
368
373
|
}
|
|
369
374
|
export type TextBasedFormItem = BaseFormItem & {
|
package/docs/DATAMODEL.md
CHANGED
|
@@ -109,7 +109,7 @@ interface MynahUIDataModel {
|
|
|
109
109
|
*/
|
|
110
110
|
compactMode?: boolean;
|
|
111
111
|
/**
|
|
112
|
-
* Tab content header details, only visibile when
|
|
112
|
+
* Tab content header details, only visibile when not null / undefined
|
|
113
113
|
*/
|
|
114
114
|
tabHeaderDetails?: TabHeaderDetails | null;
|
|
115
115
|
/**
|
|
@@ -1106,7 +1106,15 @@ type CodeBlockActions = Record<'copy' | 'insert-to-cursor' | string, CodeBlockAc
|
|
|
1106
1106
|
|
|
1107
1107
|
// #################################
|
|
1108
1108
|
interface ChatItemContent {
|
|
1109
|
-
header?: ChatItemContent
|
|
1109
|
+
header?: (ChatItemContent & {
|
|
1110
|
+
icon?: MynahIcons | MynahIconsType;
|
|
1111
|
+
iconStatus?: 'main' | 'primary' | 'clear' | Status;
|
|
1112
|
+
status?: {
|
|
1113
|
+
status?: Status;
|
|
1114
|
+
icon?: MynahIcons | MynahIconsType;
|
|
1115
|
+
text?: string;
|
|
1116
|
+
};
|
|
1117
|
+
}) | null;
|
|
1110
1118
|
body?: string | null;
|
|
1111
1119
|
customRenderer?: string | ChatItemBodyRenderer | ChatItemBodyRenderer[] | null;
|
|
1112
1120
|
followUp?: {
|
|
@@ -1157,6 +1165,7 @@ interface ChatItem extends ChatItemContent{
|
|
|
1157
1165
|
autoCollapse?: boolean;
|
|
1158
1166
|
canBeVoted?: boolean;
|
|
1159
1167
|
icon?: MynahIcons;
|
|
1168
|
+
iconStatus?: 'main' | 'primary' | 'clear' | Status;
|
|
1160
1169
|
hoverEffect?: boolean;
|
|
1161
1170
|
status?: 'info' | 'success' | 'warning' | 'error';
|
|
1162
1171
|
}
|
|
@@ -2503,6 +2512,7 @@ interface ChatItemFormItem {
|
|
|
2503
2512
|
title?: string; // Label of the input
|
|
2504
2513
|
autoFocus: boolean; // focus to the input when it is created, default=> false. (Only for textual form items)
|
|
2505
2514
|
description?: string; // The description, showing under the input field itself
|
|
2515
|
+
tooltip?: string; // The tooltip, showing when you hover to the whole input field
|
|
2506
2516
|
icon?: MynahIcons; // An icon displaying at the start of the input, renders on all inputs except for stars and radiogroup
|
|
2507
2517
|
validationPatterns?: {
|
|
2508
2518
|
operator?: 'and' | 'or';
|
|
@@ -2720,6 +2730,14 @@ Ok, finally, when we click the `Submit` button, as it is configured that way, it
|
|
|
2720
2730
|
</p>
|
|
2721
2731
|
|
|
2722
2732
|
|
|
2733
|
+
And how the tooltip looks like:
|
|
2734
|
+
|
|
2735
|
+
<p align="center">
|
|
2736
|
+
<img src="./img/data-model/chatItems/formItemsTooltip.png" alt="formItems" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
2737
|
+
</p>
|
|
2738
|
+
|
|
2739
|
+
|
|
2740
|
+
|
|
2723
2741
|
**Note:** As you can see. `Cancel` button has the value for `keepCardAfterClick` and `waitMandatoryItems` as `false` which means that `Cancel` button won't be disabled even if the form is not valid _(mandatory fields not filled)_ and when clicked it will remove the whole card.
|
|
2724
2742
|
|
|
2725
2743
|
A sample return to the [onInBodyButtonClicked](./PROPERTIES.md#oninbodybuttonclicked) function
|
|
@@ -2812,6 +2830,109 @@ mynahUI.addChatItem(tabId, {
|
|
|
2812
2830
|
|
|
2813
2831
|
---
|
|
2814
2832
|
|
|
2833
|
+
## `iconStatus`
|
|
2834
|
+
It allows you give a background status color only to the icon. Can be given to both the `header` and main card icons.
|
|
2835
|
+
|
|
2836
|
+
See the example below.
|
|
2837
|
+
|
|
2838
|
+
```typescript
|
|
2839
|
+
const mynahUI = new MynahUI({
|
|
2840
|
+
tabs: {
|
|
2841
|
+
'tab-1': {
|
|
2842
|
+
...
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
});
|
|
2846
|
+
|
|
2847
|
+
mynahUI.addChatItem(tabId, {
|
|
2848
|
+
type: ChatItemType.ANSWER,
|
|
2849
|
+
title: 'SAVE THE DATE',
|
|
2850
|
+
header: {
|
|
2851
|
+
icon: 'calendar',
|
|
2852
|
+
iconStatus: 'primary',
|
|
2853
|
+
body: '## Soon, a new version will be released!'
|
|
2854
|
+
},
|
|
2855
|
+
fullWidth: true,
|
|
2856
|
+
canBeDismissed: true,
|
|
2857
|
+
body: "We're improving the performance, adding new features or making new UX changes every week. Save the date for new updates!."
|
|
2858
|
+
});
|
|
2859
|
+
```
|
|
2860
|
+
|
|
2861
|
+
<p align="center">
|
|
2862
|
+
<img src="./img/data-model/chatItems/iconStatus.png" alt="icon" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
2863
|
+
</p>
|
|
2864
|
+
|
|
2865
|
+
---
|
|
2866
|
+
|
|
2867
|
+
|
|
2868
|
+
## `canBeDismissed`
|
|
2869
|
+
It allows you put a close button on top of the card. It appears even above the `header` section.
|
|
2870
|
+
|
|
2871
|
+
See the example below.
|
|
2872
|
+
|
|
2873
|
+
```typescript
|
|
2874
|
+
const mynahUI = new MynahUI({
|
|
2875
|
+
tabs: {
|
|
2876
|
+
'tab-1': {
|
|
2877
|
+
...
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
|
|
2882
|
+
mynahUI.addChatItem(tabId, {
|
|
2883
|
+
type: ChatItemType.ANSWER,
|
|
2884
|
+
title: 'SAVE THE DATE',
|
|
2885
|
+
header: {
|
|
2886
|
+
icon: 'calendar',
|
|
2887
|
+
iconStatus: 'primary',
|
|
2888
|
+
body: '## Soon, a new version will be released!'
|
|
2889
|
+
},
|
|
2890
|
+
fullWidth: true,
|
|
2891
|
+
canBeDismissed: true,
|
|
2892
|
+
body: "We're improving the performance, adding new features or making new UX changes every week. Save the date for new updates!."
|
|
2893
|
+
});
|
|
2894
|
+
```
|
|
2895
|
+
|
|
2896
|
+
<p align="center">
|
|
2897
|
+
<img src="./img/data-model/chatItems/iconStatus.png" alt="icon" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
2898
|
+
</p>
|
|
2899
|
+
|
|
2900
|
+
---
|
|
2901
|
+
|
|
2902
|
+
## `title`
|
|
2903
|
+
It allows you give a dimmed color title to the card itself other than the `header` section. It is simple, just a string. And can be combined with the `canBeDismissed` too.
|
|
2904
|
+
|
|
2905
|
+
See the example below.
|
|
2906
|
+
|
|
2907
|
+
```typescript
|
|
2908
|
+
const mynahUI = new MynahUI({
|
|
2909
|
+
tabs: {
|
|
2910
|
+
'tab-1': {
|
|
2911
|
+
...
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
});
|
|
2915
|
+
|
|
2916
|
+
mynahUI.addChatItem(tabId, {
|
|
2917
|
+
type: ChatItemType.ANSWER,
|
|
2918
|
+
title: 'SAVE THE DATE',
|
|
2919
|
+
header: {
|
|
2920
|
+
icon: 'calendar',
|
|
2921
|
+
iconStatus: 'primary',
|
|
2922
|
+
body: '## Soon, a new version will be released!'
|
|
2923
|
+
},
|
|
2924
|
+
fullWidth: true,
|
|
2925
|
+
canBeDismissed: true,
|
|
2926
|
+
body: "We're improving the performance, adding new features or making new UX changes every week. Save the date for new updates!."
|
|
2927
|
+
});
|
|
2928
|
+
```
|
|
2929
|
+
|
|
2930
|
+
<p align="center">
|
|
2931
|
+
<img src="./img/data-model/chatItems/iconStatus.png" alt="icon" style="max-width:500px; width:100%;border: 1px solid #e0e0e0;">
|
|
2932
|
+
</p>
|
|
2933
|
+
|
|
2934
|
+
---
|
|
2935
|
+
|
|
2815
2936
|
## `followUp`
|
|
2816
2937
|
Followups allows you to add predefined direct triggers for the user for ease of use. Instead of typing a followup question, they can select from the provided ones. But you can also use them to get user input some from multiple choice options before going further for example.
|
|
2817
2938
|
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|