@dhasdk/simple-ui 1.0.26 → 1.0.28

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
@@ -16,6 +16,7 @@ Tooltip
16
16
  ## Table of Contents
17
17
 
18
18
  - [Installation](#installation-and-setup)
19
+ - [ChangeLog](#changelog)
19
20
  - [Accordion](#accordion)
20
21
  - [AppointmentPicker](#appointment-picker)
21
22
  - [Badge](#badge)
@@ -26,6 +27,7 @@ Tooltip
26
27
  - [CharacterCounter](#charactercounter)
27
28
  - [CheckBox](#checkbox)
28
29
  - [DatePicker](#datepicker)
30
+ - [ExpandableText](#expandabletext)
29
31
  - [Input](#input)
30
32
  - [List](#list)
31
33
  - [Modal](#modal)
@@ -69,7 +71,14 @@ Tooltip
69
71
  - Elsewhere in your file, use the component as documented below
70
72
 
71
73
 
72
- <!-- A C C O R D I O N ----------------------------------------------------------------------------------- -->
74
+ <!-- C H A N G E L O G --------------------------------------------------------------- -->
75
+
76
+ ## ChangeLog
77
+
78
+ 1.0.28 - added an **`ExpandabledText`** component
79
+
80
+
81
+ <!-- A C C O R D I O N -------------------------------------------------------------- -->
73
82
 
74
83
  ## Accordion
75
84
 
@@ -812,6 +821,58 @@ Default Variant
812
821
  [Top of Page](#table-of-contents)
813
822
 
814
823
 
824
+ <!-- E X P A N D A B L E T E X T --------------------------------------------------------- -->
825
+
826
+ ## ExpandableText
827
+
828
+ ExpandableText is a component with a div wrapper that takes in a **`children`** string value, and
829
+ displays a default number of characters with a **more** button. When the button is clicked, the
830
+ text is expanded, and an optional **collapse** button is then shown that can collapse the text
831
+ back to its original sizing.
832
+
833
+ Props exist to style the container, the **more** button, the **collapse** button, to set the
834
+ number of characters to display by default, as well as alternate text for each of the two
835
+ buttons.
836
+
837
+ <!-- children,
838
+ initialChars = 40,
839
+ buttonText = "more",
840
+ classNameMoreButton,
841
+ classNameCollapseButton,
842
+ collapseButton = false,
843
+ collapseText = "collapse",
844
+ className, -->
845
+
846
+ ### Props
847
+
848
+ | Prop | Type | Optional | Default | Description |
849
+ | ----------- | -------- | -------- | -------- | -------------------------------------------- |
850
+ | buttonText | string | Yes | **`'more'`** | text label for the 'more' button
851
+ | className | string | Yes | **`''`** | tailwind classes to style the component container with |
852
+ | classNameCollapseButton | string | Yes | **`ml-2 text-blue-600 underline hover:text-blue-800 focus:outline-none`** | tailwind classes to style the collapse button |
853
+ | classNameMoreButton | string | Yes | **`ml-2 text-blue-600 underline hover:text-blue-800 focus:outline-none`** | tailwind classes to style the collapse button |
854
+ | collapseButton | boolean | Yes | **`false`** | to display a collapse button or not |
855
+ | collapseText | string | Yes | **`'collapse'`** | text label for 'collapse' button |
856
+ | initialChars | integer | Yes | 40 | number of characters to display by default |
857
+
858
+ ### Example Usage
859
+
860
+ Default Variant
861
+
862
+ ```jsx
863
+ <ExpandableText
864
+ collapseButton={true}
865
+ className='mt-4'
866
+ classNameCollapseButton='block mt-2 strong text-red-600'>
867
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
868
+ </ExpandableText>
869
+ ```
870
+
871
+
872
+ ### Dependencies
873
+
874
+ [Top of Page](#table-of-contents)
875
+
815
876
 
816
877
  <!-- I N P U T ------------------------------------------------------------------------------ -->
817
878