@dhasdk/simple-ui 1.0.68 → 1.0.70

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
@@ -43,6 +43,7 @@ Tooltip
43
43
  - [Slider](#slider)
44
44
  - [Status](#status)
45
45
  - [Tabs](#tabs)
46
+ - [TextArea](#textarea)
46
47
  - [Toggle](#toggle)
47
48
  - [Tooltip](#tooltip)
48
49
 
@@ -53,6 +54,10 @@ Tooltip
53
54
 
54
55
  ## Changelog
55
56
 
57
+ 1.0.70 - bug fix for **`onExpand`** handler in **`Accordion`**, added a separate **`onExpand`** handler to **`AccordionParent`** that is called with an index + boolean expanded.
58
+
59
+ 1.0.69 - added a **`classNameIcon`** prop to **`RadioGroup`** to style the SVG icon used for radio input items. Also added the **`TextArea`** component and documentation.
60
+
56
61
  1.0.68 - added a **`classNameLabelText`** prop to **`RadioGroup`** that styles the text only portion of the radio item
57
62
 
58
63
  1.0.67 - corrected RadioGroup documentation re id type inside **`RadioOption`**
@@ -186,6 +191,7 @@ Finally, if Accordion props are specified inside the parent component, those val
186
191
  | classNameHr | string | Yes | CSS classes applied to the HR that sits between the accordion heading and content body when open and the prop useBackground is true. |
187
192
  | dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element inside AccordionGroup that wraps individual Accordion components |
188
193
  | hr | boolean | Yes | true | This boolean value when true directs the display an hr element between the Accordion heading and body when in the open state. |
194
+ | onExpand | **`(expand: boolean, index: number) => void`** | Yes | void | Calls the passed in handler with a boolean indicating whether this Child Accordion is expanded and the Child Accordions index value (0 based). Note: This handler uses a different interface than the one applied directly to **`Accordion`**. |
189
195
  | ...props | string | No | | takes additional props that are not specifically defined in the component, i.e. aria-label |
190
196
  | singleOpen | boolean | Yes | false | This boolean value directs the accordion to allow only one opened child content body at a time. Setting a value of false will allow multiple to be opened at once. |
191
197
  | useBackground | boolean | Yes | true | This boolean value causes the accordion content block to use the same background as the accordion heading. When true, an hr is also present at the top of the content block to separate the heading from the content. This hr can be styled separately using the classNameHr prop. |
@@ -208,7 +214,8 @@ Finally, if Accordion props are specified inside the parent component, those val
208
214
  | dataTestIdBody | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that that contains the body of the opened Accordion component. Only present when the Accordion is in the opened state, used for testing purposes |
209
215
  | hr | boolean | Yes | true | This boolean value when true directs the display an hr element between the Accordion heading and body when in the open state. |
210
216
  | index | number | string | yes | undefined | optional index value for a specific accordion in the stack. if not present, label is used. |
211
- | onExpand | (setOpen: CallbackFunction) => void | Yes | undefined | Callback function that is executed when Accordin is expanded. |
217
+ | onExpand | **`(expand: boolean) => void`** | Yes | void | Calls the passed in handler with a boolean indicating whether this Child Accordion is expanded. Note: This handler does not take or pass an index value
218
+ like the **`AccordionParent`** component does. |
212
219
  | ...props | string | No | | takes additional props that are not specifically defined in the component, i.e. aria-label |
213
220
  <!-- | rounded | boolean | Yes | false | This boolean value indicates whether to display rounded corners or not. By using this prop vs custom classes, only the top of the heading is rounded in an opened state, and only the bottom of the content block is rounded also. | -->
214
221
  | singleOpen | boolean | Yes | false | This boolean value directs the accordion to allow only one opened child content body at a time. Setting a value of false will allow multiple to be opened at once. |
@@ -1441,6 +1448,7 @@ Full list of props below
1441
1448
  | title | **`string`** | Yes | **`undefined`** | A title for the radio group component. Will be displayed above the radio group. |
1442
1449
  | classNameContainer | **`string`** | Yes | **`undefined`** | a group of alternate css classes that can be specified by the developer for use in the container (fieldset) element. |
1443
1450
  | classNameInput | **`string`** | Yes | see below | a group of alternate css classes that can be specified by the developer for use in the input element of the component. |
1451
+ | classNameIcon | **`string`** | Yes | | TailwindCSS classes that can be applied to the SVG icon, affects the fill regon. |
1444
1452
  | classNameLabel | **`string`** | Yes | see below | a group of alternate css classes that can be specified by the developer for use in the label element of the component. |
1445
1453
  | classNameLabelText | **`string`** | Yes | **`ml-1`** | a group of alternate css classes that can be specified by the developer for use in the text portion of label inside the component. |
1446
1454
  | dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
@@ -2397,6 +2405,65 @@ Tabs - a simple example
2397
2405
  [Top of Page](#table-of-contents)
2398
2406
 
2399
2407
 
2408
+ <!-- T E X T A R E A -------------------------------------------------------------------- -->
2409
+
2410
+ ## TextArea
2411
+
2412
+ The **`TextArea`** component provides an HTML **`TextArea`** that includes default styling plus the option of a counter. className props are provided separately for the base component, the label, and the counter.
2413
+
2414
+ In addition to the normal component props listed below, this component can also take the standard html attributes usable with a normal html TextArea element.
2415
+
2416
+ ### Props
2417
+
2418
+ | Prop | Type | Optional | Default | Description |
2419
+ | ----------- | -------- | -------- | -------- | ----------- |
2420
+ | className | **`string`** | Yes | (1) below | classNames to apply to the base TextArea element. |
2421
+ | classNameCounter | **`string`** | Yes | (2) below | A group of alternate css classes that can be specified by the developer and applied to the div that contains the character counter. |
2422
+ | classNameLabel | **`string`** | Yes | (3) below | A group of alternate css classes that can be specified by the developer and applied to the label element for the **`TextArea`**. |
2423
+ | counter | **`boolean`** | Yes | **`false`** | If true, a character counter is include that corresponds to characters typed inside the **`TextArea`** component.|
2424
+ | label | **`string`** | Yes | undefined | The label text for the **`TextArea`** component (optional) |
2425
+ | maxLength | **`number`** | Yes | undefined | The number of characters to limit the **`TextArea`** to. |
2426
+ | onValueChange | (value: string) => void | Yes | undefined | A callback method that is called for every new character typed inside the TextArea element. |
2427
+ | value | string | Yes | undefined | The default value to set the TextArea element content to |
2428
+ | ...props | string | Yes | undefined | takes additional props that are not specifically defined in the component, i.e. **`aria-label`** |
2429
+
2430
+
2431
+ (1) Base CSS Classes (**`className`**)
2432
+ - w-16 h-8 flex items-center p-1 rounded-full cursor-pointer transition-colors duration-300
2433
+ Toggle portion Base CSS Classes
2434
+ - bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-300
2435
+
2436
+ (1) Counter CSS Classes (**`classNameCounter`**)
2437
+ - w-16 h-8 flex items-center p-1 rounded-full cursor-pointer transition-colors duration-300
2438
+ Toggle portion Base CSS Classes
2439
+ - bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-300
2440
+
2441
+ (1) Label CSS Classes (**`classNameLabel`**)
2442
+ - w-16 h-8 flex items-center p-1 rounded-full cursor-pointer transition-colors duration-300
2443
+ Toggle portion Base CSS Classes
2444
+ - bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-300
2445
+
2446
+
2447
+ ### Example Usage
2448
+
2449
+ ```jsx
2450
+ const [textAreaValue, setTextAreaValue] = useState('');
2451
+ // ...
2452
+ <TextArea className="w-full h-18" counter
2453
+ onValueChange={(v) => setTextAreaValue(v)}
2454
+ placeholder="...the next great American novel"
2455
+ counter
2456
+ />
2457
+ <p className=""><span className="font-bold">Results of callback: </span> {textAreaValue}</p>
2458
+
2459
+ ```
2460
+
2461
+ ### Dependencies
2462
+
2463
+ **_none_**
2464
+
2465
+ [Top of Page](#table-of-contents)
2466
+
2400
2467
  <!-- T O G G L E -------------------------------------------------------------------- -->
2401
2468
 
2402
2469
  ## Toggle