groovinads-ui 1.2.60 → 1.2.61

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/README.md CHANGED
@@ -30,6 +30,7 @@ The library includes the following components:
30
30
  - [Checkbox](#checkbox): For multiple option selections.
31
31
  - [Input](#input): For user data entry.
32
32
  - [InputChip](#inputChip): For dynamically managing and displaying keywords.
33
+ - [InputEmail] (#inputEmail) : For managing email lists, including adding, displaying, and deleting email addresses.
33
34
  - [Radio](#radio): For exclusive selections.
34
35
  - [Switch](#switch): For toggle states.
35
36
  - [Textarea](#textarea): For multiline text input.
@@ -525,7 +526,7 @@ export default InputComponent;
525
526
  | `type` | String | No | `color` `date` `datetime-local` `email` `file` `image` `month` `number` `password` `tel` `text` `time` `url` `week` | `text` | Type of input |
526
527
  | `value` | String / Number | No | n/a | n/a | The value of the input. |
527
528
 
528
- ### inputChip
529
+ ### InputChip
529
530
  ```jsx
530
531
  import React, { useState } from 'react';
531
532
  import { InputChip } from 'groovinads-ui';
@@ -546,7 +547,7 @@ const ExampleIputChip = () => (
546
547
  recomendedKeywords={5}
547
548
  maxKeywords={15}
548
549
  requiredText='You can only add up to 15 keywords.'
549
- />
550
+ />
550
551
 
551
552
  {/* INITIALIZED EMPTY, WITHOUT KEYWORDS */}
552
553
  <InputChip
@@ -555,9 +556,9 @@ const ExampleIputChip = () => (
555
556
  setKeywordsList={setKeywordsList2}
556
557
  nonRecomendedKeywords={nonRecomendedKeywords}
557
558
  maxKeywordLength={10}
558
- maxKeywords={15}
559
- requiredText='You can only add up to 15 keywords.'
560
- counter={true}
559
+ maxKeywords={15}
560
+ requiredText='You can only add up to 15 keywords.'
561
+ counter={true}
561
562
  />
562
563
  </>
563
564
  );
@@ -577,6 +578,43 @@ export default ExampleInputChip;
577
578
  | ` maxKeywords ` | Number | Yes | n/a | n/a | Indicates the maximum number of allowed keywords. When the keywordsList reaches this limit, an error message defined in requiredText will be displayed. Additionally, if the counter is enabled, its status will change to the 'danger' color. |
578
579
  | `requiredText` | String | Yes | n/a | n/a | Texto que se mostrará como error cuando la lista de keywords (keywordsList) alcance el límite máximo definido en maxKeywords. |
579
580
 
581
+ ### InputEmail
582
+ ``` jsx
583
+ // Example Usage
584
+ import React, { useState } from 'react';
585
+ import { InputEmail } from '../components/Inputs';
586
+
587
+ const ExampleInputEmail = () => {
588
+ const [showModal, setShowModal] = useState(true); // Received from the parent component.
589
+
590
+ return (
591
+ <InputEmail
592
+ titleList='Added emails'
593
+ label='Email addresses'
594
+ textButton='Add'
595
+ textError='You must enter a valid email address'
596
+ /* The responses from the three APIs expect an array of strings (or an empty array) */
597
+ apiGetEmail='incert/your/endpoint'
598
+ apiPostEmail='incert/your/endpoint'
599
+ apiDeleteEmail='incert/your/endpoint'
600
+ showModal={showModal} // showModal indicates the visibility of the parent component of InputEmail.
601
+ />
602
+ );
603
+ };
604
+ export default ExampleInputChip;
605
+
606
+ ```
607
+ Property | Type | Required | Options | Default | Description |
608
+ | ------------------ | ------ | -------- | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
609
+ | ` apiDeleteEmail ` | String | Yes | n/a | n/a | Endpoint required to remove emails from the list of added emails. |
610
+ | ` apiGetEmail ` | Array | Yes | n/a | n/a | Endpoint required to fetch the email list. The response should be an array of strings (or empy array) displayed below the input and `titleList`. |
611
+ | ` apiPostEmail ` | String | Yes | n/a | n/a | Endpoint required to update the list of added emails. It is used to add emails to the existing list.|
612
+ | ` label ` | String | No | n/a | '' | Allows adding custom text as the input label. |
613
+ | ` showModal ` | Boolean | No | `true` `false` | `true` | If true, the email list received from apiGetEmail will be shown when rendering InputEmail. |
614
+ | ` textButton ` | String | No | n/a | '' | Allows adding custom text to the button for adding emails. |
615
+ | ` textError ` | String | No | n/a | '' | Allows adding custom error text when entering an invalid email address. |
616
+ | ` titleList ` | String | No | n/a | '' | Allows adding a custom text that will be shown as the title of the email list. |
617
+
580
618
  ### Radio
581
619
 
582
620
  ```jsx