@dhasdk/simple-ui 1.0.58 → 1.0.60
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 +34 -3
- package/index.js +17 -17
- package/index.mjs +1023 -1012
- package/lib/CheckBox.d.ts +5 -1
- package/lib/RadioGroup.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,10 @@ Tooltip
|
|
|
53
53
|
|
|
54
54
|
## Changelog
|
|
55
55
|
|
|
56
|
+
1.0.60 - added **classNameSvgLine** and **classNameIcon** props to **`CheckBox`** the former to share duties with and more focus **classNameSvg**. The latter allows for positioning of the checkbox icon if needed.
|
|
57
|
+
|
|
58
|
+
1.0.59 - added **method** property to the **RadioOption** type for RadioGroup, allowing user to pass in a callback method for checked/unchecked state changes
|
|
59
|
+
|
|
56
60
|
1.0.58 - removed console.log statement from **`RadioGroup`** component
|
|
57
61
|
|
|
58
62
|
1.0.57 - added **`className`** prop to **`ProgressBar`** to style the outer div that is the container
|
|
@@ -791,11 +795,13 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
|
|
|
791
795
|
|
|
792
796
|
| Prop | Type | Optional | Default | Description |
|
|
793
797
|
| ----------- | -------- | -------- | -------- | ----------- |
|
|
794
|
-
|
|
|
798
|
+
| bridgeParent | boolean | Yes | {false} | When true, the lines that denote the relationships between parent CheckBoxes and their children are extended at the root level to match root level CheckBoxes to one another. In the above examples, compare 'Multi-Level' and 'bridgeParent' to see the differences. |
|
|
795
799
|
| className | string | Yes | **`'flex items-center'`** | alternate css classes to add/change styling of the **div** that wraps the **input** element. Passed to all child CheckBox components.|
|
|
800
|
+
| classNameIcon | string | Yes | **`''`** | CSS classes that will be applied to the custom icon (non html default) that is the checkbox, indeterminate checkbox, or blank checkbox. Can be useful for positioning, etc. |
|
|
796
801
|
| classNameInput | string | Yes | **`''`** | alternate css classes to add/change styling of the **input** html element. Passed to all child CheckBox components.|
|
|
797
802
|
| classNameLabel | string | Yes | **`'inline-flex items-center gap-1 text-base md:text-lg'`** | alternate css classes to add/change styling of the **label** html element used by this **CheckBox**. Passed to all child CheckBox components.|
|
|
798
|
-
| classNameSvg | string | Yes | **`'
|
|
803
|
+
| classNameSvg | string | Yes | **`'w-4 h-7'`**, if icon is true add **`ms-1`** | This prop is applied to the global SVG itself, and is more appropriate for size and positioning |
|
|
804
|
+
| classNameSvgLine | string | Yes | **`'stroke-[#a1a6a8] h-full border'`** | This prop is applied to the lines that are drawn inside the SVGs that denote the relationships between separate **CheckBox** components. The easiest change to effect is the color of the lines by applying a different custom stroke value. Passed to all child CheckBox components. |
|
|
799
805
|
| customIcons | map | Yes | default icons | A list of custom icons to use for checked, unchecked, and indeterminate states. See Custom Icons usage code example below. |
|
|
800
806
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that wraps the CheckBoxGroup component for testing purposes |
|
|
801
807
|
| fill | boolean | Yes | {false} | specifies using the **`fill`** variant or not. If used, the checkbox itself will have a darker solid background. |
|
|
@@ -810,9 +816,11 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
|
|
|
810
816
|
| ----------- | -------- | -------- | -------- | ----------- |
|
|
811
817
|
| ariaLabel | string | Yes | 'CheckBox Component' | The **aria-label** to assign to this CheckBox |
|
|
812
818
|
| className | string | Yes | **`'flex items-center'`** | alternate css classes to add/change styling of the **div** that wraps the **input** element. |
|
|
819
|
+
| classNameIcon | string | Yes | **`''`** | CSS classes that will be applied to the custom icon (non html default) that is the checkbox, indeterminate checkbox, or blank checkbox. Can be useful for positioning, etc. |
|
|
813
820
|
| classNameInput | string | Yes | **`''`** | alternate css classes to add/change styling of the **input** html element. |
|
|
814
821
|
| classNameLabel | string | Yes | **`'inline-flex items-center gap-1 text-base md:text-lg'`** | alternate css classes to add/change styling of the **label** html element used by this **CheckBox**. |
|
|
815
|
-
| classNameSvg | string | Yes | **`'
|
|
822
|
+
| classNameSvg | string | Yes | **`'w-4 h-7'`**, if icon is true add **`ms-1`** | This prop is applied to the global SVG itself, and is more appropriate for size and positioning |
|
|
823
|
+
| classNameSvgLine | string | Yes | **`'stroke-[#a1a6a8] h-full border'`** | This prop is applied to the lines that are drawn inside the SVGs that denote the relationships between separate **CheckBox** components. The easiest change to effect is the color of the lines by applying a different custom stroke value.
|
|
816
824
|
| customIcons | map | Yes | default icons | A list of custom icons to use for checked, unchecked, and indeterminate states. See Custom Icons usage code example below. |
|
|
817
825
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that wraps the CheckBox component for testing purposes |
|
|
818
826
|
| fill | boolean | Yes | {false} | specifies using the **fill** variant or not. If used, the checkbox itself will have a darker solid background. |
|
|
@@ -1398,6 +1406,7 @@ This component takes multiple optional props in addition to any other html attri
|
|
|
1398
1406
|
|
|
1399
1407
|
See **example usage** below for an example of retrieving the selected radio item.
|
|
1400
1408
|
|
|
1409
|
+
The **method** prop allows for a callback method that is called for every change on a radio item in the group. Example below.
|
|
1401
1410
|
|
|
1402
1411
|
Full list of props below
|
|
1403
1412
|
|
|
@@ -1410,6 +1419,7 @@ Full list of props below
|
|
|
1410
1419
|
| 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. |
|
|
1411
1420
|
| 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. |
|
|
1412
1421
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1422
|
+
| 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** |
|
|
1413
1423
|
| options | **`string`** | No | | Array of RadioOption objects that define the options available for selection. |
|
|
1414
1424
|
|
|
1415
1425
|
1. Base CSS Classes
|
|
@@ -1490,6 +1500,27 @@ Example checking radio items for checked state
|
|
|
1490
1500
|
console.log(radio?.checked);
|
|
1491
1501
|
```
|
|
1492
1502
|
|
|
1503
|
+
Using a callback method
|
|
1504
|
+
|
|
1505
|
+
```jsx
|
|
1506
|
+
const radioOptions: RadioOption[] = [
|
|
1507
|
+
{
|
|
1508
|
+
label: 'Option One',
|
|
1509
|
+
value:'item-1',
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
label: 'Option Two',
|
|
1513
|
+
value: 'item-2',
|
|
1514
|
+
}
|
|
1515
|
+
]
|
|
1516
|
+
|
|
1517
|
+
<RadioGroup title="Radio Title"
|
|
1518
|
+
options={radioOptions}
|
|
1519
|
+
method={(id, value) => console.log("id/value: " + id + "/" + value)}
|
|
1520
|
+
// would print "id/value 1/item-1" or "id/value 2/item-2"
|
|
1521
|
+
/>
|
|
1522
|
+
```
|
|
1523
|
+
|
|
1493
1524
|
### Dependencies
|
|
1494
1525
|
|
|
1495
1526
|
**_none_**
|