@dhasdk/simple-ui 1.0.67 → 1.0.69
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 +65 -0
- package/index.css +1 -1
- package/index.d.ts +2 -0
- package/index.js +14 -14
- package/index.mjs +1054 -1005
- package/lib/RadioGroup.d.ts +2 -0
- package/lib/TextArea.d.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,12 @@ Tooltip
|
|
|
53
53
|
|
|
54
54
|
## Changelog
|
|
55
55
|
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
1.0.68 - added a **`classNameLabelText`** prop to **`RadioGroup`** that styles the text only portion of the radio item
|
|
59
|
+
|
|
60
|
+
1.0.67 - corrected RadioGroup documentation re id type inside **`RadioOption`**
|
|
61
|
+
|
|
56
62
|
1.0.66 - added **`inline`** prop to **`RadioGroup`**, allows for a flex-row layout of RadioGroup items as opposed to the default flex-column layout
|
|
57
63
|
|
|
58
64
|
1.0.65 - changed **label** on **`Input`** component to a **`ReactNode`** type. Also updated **aria-label**
|
|
@@ -1437,7 +1443,9 @@ Full list of props below
|
|
|
1437
1443
|
| title | **`string`** | Yes | **`undefined`** | A title for the radio group component. Will be displayed above the radio group. |
|
|
1438
1444
|
| classNameContainer | **`string`** | Yes | **`undefined`** | a group of alternate css classes that can be specified by the developer for use in the container (fieldset) element. |
|
|
1439
1445
|
| 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. |
|
|
1446
|
+
| classNameIcon | **`string`** | Yes | | TailwindCSS classes that can be applied to the SVG icon, affects the fill regon. |
|
|
1440
1447
|
| 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. |
|
|
1448
|
+
| 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. |
|
|
1441
1449
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1442
1450
|
| inline | boolean | Yes | false | If **`true`**, the radio group is layed out in a flex-row instead of a flex-column. |
|
|
1443
1451
|
| method | (id: string, value: string) => void | Yes | undefined | A callback method that is called anytime a radio item is clicked on. The value **`method={(id, value) => console.log("id/value: " + id + "/" + value)}`** might print something like **id/value: 2/value-2** |
|
|
@@ -2392,6 +2400,63 @@ Tabs - a simple example
|
|
|
2392
2400
|
[Top of Page](#table-of-contents)
|
|
2393
2401
|
|
|
2394
2402
|
|
|
2403
|
+
<!-- T E X T A R E A -------------------------------------------------------------------- -->
|
|
2404
|
+
|
|
2405
|
+
## TextArea
|
|
2406
|
+
|
|
2407
|
+
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.
|
|
2408
|
+
|
|
2409
|
+
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.
|
|
2410
|
+
|
|
2411
|
+
### Props
|
|
2412
|
+
|
|
2413
|
+
| Prop | Type | Optional | Default | Description |
|
|
2414
|
+
| ----------- | -------- | -------- | -------- | ----------- |
|
|
2415
|
+
| className | **`string`** | Yes | (1) below | classNames to apply to the base TextArea element. |
|
|
2416
|
+
| 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. |
|
|
2417
|
+
| 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`**. |
|
|
2418
|
+
| counter | **`boolean`** | Yes | **`false`** | If true, a character counter is include that corresponds to characters typed inside the **`TextArea`** component.|
|
|
2419
|
+
| label | **`string`** | Yes | undefined | The label text for the **`TextArea`** component (optional) |
|
|
2420
|
+
| maxLength | **`number`** | Yes | undefined | The number of characters to limit the **`TextArea`** to. |
|
|
2421
|
+
| onValueChange | (value: string) => void | Yes | undefined | A callback method that is called for every new character typed inside the TextArea element. |
|
|
2422
|
+
| value | string | Yes | undefined | The default value to set the TextArea element content to |
|
|
2423
|
+
| ...props | string | Yes | undefined | takes additional props that are not specifically defined in the component, i.e. **`aria-label`** |
|
|
2424
|
+
|
|
2425
|
+
|
|
2426
|
+
(1) Base CSS Classes (**`className`**)
|
|
2427
|
+
- w-16 h-8 flex items-center p-1 rounded-full cursor-pointer transition-colors duration-300
|
|
2428
|
+
Toggle portion Base CSS Classes
|
|
2429
|
+
- bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-300
|
|
2430
|
+
|
|
2431
|
+
(1) Counter CSS Classes (**`classNameCounter`**)
|
|
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) Label CSS Classes (**`classNameLabel`**)
|
|
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
|
+
|
|
2442
|
+
### Example Usage
|
|
2443
|
+
|
|
2444
|
+
```jsx
|
|
2445
|
+
const [textAreaValue, setTextAreaValue] = useState('');
|
|
2446
|
+
// ...
|
|
2447
|
+
<TextArea className="w-full h-18" counter
|
|
2448
|
+
onValueChange={(v) => setTextAreaValue(v)}
|
|
2449
|
+
placeholder="...the next great American novel"
|
|
2450
|
+
counter
|
|
2451
|
+
/>
|
|
2452
|
+
<p className=""><span className="font-bold">Results of callback: </span> {textAreaValue}</p>
|
|
2453
|
+
|
|
2454
|
+
```
|
|
2455
|
+
|
|
2456
|
+
### Dependencies
|
|
2457
|
+
|
|
2458
|
+
**_none_**
|
|
2459
|
+
|
|
2395
2460
|
<!-- T O G G L E -------------------------------------------------------------------- -->
|
|
2396
2461
|
|
|
2397
2462
|
## Toggle
|