@aws/mynah-ui 4.29.0 → 4.30.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.
package/dist/static.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
+ import { CheckboxAbstract, CheckboxProps } from './components/form-items/checkbox';
5
6
  import { MynahIcons, MynahIconsType } from './components/icon';
6
7
  import { ChatItemBodyRenderer } from './helper/dom';
7
8
  import { SelectAbstract, SelectProps, RadioGroupAbstract, RadioGroupProps, ButtonAbstract, ButtonProps, TextInputProps, TextInputAbstract, TextAreaProps, TextAreaAbstract, ToggleOption } from './main';
@@ -396,7 +397,12 @@ type RadioGroupFormItem = BaseFormItem & {
396
397
  icon?: MynahIcons | MynahIconsType;
397
398
  }>;
398
399
  };
399
- export type ChatItemFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem;
400
+ type CheckboxFormItem = BaseFormItem & {
401
+ type: 'switch' | 'checkbox';
402
+ value?: 'true' | 'false';
403
+ label?: string;
404
+ };
405
+ export type ChatItemFormItem = TextBasedFormItem | OtherFormItem | RadioGroupFormItem | CheckboxFormItem;
400
406
  export type FilterOption = ChatItemFormItem;
401
407
  export interface ChatPrompt {
402
408
  prompt?: string;
@@ -585,6 +591,7 @@ type ExtractMethods<T> = PickMatching<T, any>;
585
591
  export interface ComponentOverrides {
586
592
  Button?: new (props: ButtonProps) => ExtractMethods<ButtonAbstract>;
587
593
  RadioGroup?: new (props: RadioGroupProps) => ExtractMethods<RadioGroupAbstract>;
594
+ Checkbox?: new (props: CheckboxProps) => ExtractMethods<CheckboxAbstract>;
588
595
  Select?: new (props: SelectProps) => ExtractMethods<SelectAbstract>;
589
596
  TextInput?: new (props: TextInputProps) => ExtractMethods<TextInputAbstract>;
590
597
  TextArea?: new (props: TextAreaProps) => ExtractMethods<TextAreaAbstract>;
package/docs/DATAMODEL.md CHANGED
@@ -2507,7 +2507,7 @@ Let's take a look to the data type of a form item:
2507
2507
  ```typescript
2508
2508
  interface ChatItemFormItem {
2509
2509
  id: string; // id is mandatory to understand to get the specific values for each form item when a button is clicked
2510
- type: 'select' | 'textarea' | 'textinput' | 'numericinput' | 'stars' | 'radiogroup'; // type (see below for each of them)
2510
+ type: 'select' | 'textarea' | 'textinput' | 'numericinput' | 'stars' | 'radiogroup' | 'toggle' | 'checkbox' | 'switch' ; // type (see below for each of them)
2511
2511
  mandatory?: boolean; // If it is set to true, buttons in the same card with waitMandatoryFormItems set to true will wait them to be filled
2512
2512
  title?: string; // Label of the input
2513
2513
  autoFocus: boolean; // focus to the input when it is created, default=> false. (Only for textual form items)
@@ -2623,6 +2623,21 @@ mynahUI.addChatItem(tabId, {
2623
2623
  }
2624
2624
  ],
2625
2625
  },
2626
+ {
2627
+ id: 'is-online',
2628
+ type: 'checkbox',
2629
+ value: 'true',
2630
+ label: 'Yes',
2631
+ title: `Are you working online?`,
2632
+ },
2633
+ {
2634
+ id: 'is-monorepo',
2635
+ type: 'switch',
2636
+ label: 'Yes',
2637
+ icon: 'deploy',
2638
+ title: `Are you working in a monorepo project?`,
2639
+ tooltip: "If you're working more on monorepos, check this"
2640
+ },
2626
2641
  {
2627
2642
  id: 'working-hours',
2628
2643
  type: 'numericinput',
@@ -2747,15 +2762,17 @@ Action Id: submit
2747
2762
  Action Text: Submit
2748
2763
 
2749
2764
  Options:
2750
- expertise-area:
2765
+ expertise-area: frontend
2751
2766
  preferred-ide: vscode
2752
2767
  remote-ide: remote
2753
- working-hours:
2768
+ is-online: false
2769
+ is-monorepo: true
2770
+ working-hours: 30
2754
2771
  email: d@a.c
2755
- name: amazonq aws
2772
+ name: aws amazonq
2756
2773
  ease-of-usage-rating: 4
2757
2774
  accuracy-rating: 4
2758
- general-rating:
2775
+ general-rating: 4
2759
2776
  description: aws
2760
2777
  ```
2761
2778
 
package/docs/USAGE.md CHANGED
@@ -419,7 +419,6 @@ The function provides a couple of callbacks which can be used to control the she
419
419
 
420
420
  ```typescript
421
421
  const { update, close, changeTarget, getTargetElementId } = mynahUI.openDetailedList({
422
- tabId,
423
422
  detailedList: {}, // The DetailedList, for the data model check DATAMODEL.md
424
423
  events: {
425
424
  onFilterValueChange: (filterValues: Record<string, any>, isValid: boolean) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws/mynah-ui",
3
3
  "displayName": "AWS Mynah UI",
4
- "version": "4.29.0",
4
+ "version": "4.30.1",
5
5
  "description": "AWS Toolkit VSCode and Intellij IDE Extension Mynah UI",
6
6
  "publisher": "Amazon Web Services",
7
7
  "license": "Apache License 2.0",