@dhasdk/simple-ui 1.0.59 → 1.0.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 +25 -4
- package/index.js +19 -19
- package/index.mjs +1362 -1349
- 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.61 - added **selectedId** prop to **`RadioGroup`** as well as updated documentation with the **RadioOptions** interface
|
|
57
|
+
|
|
58
|
+
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.
|
|
59
|
+
|
|
56
60
|
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
|
|
57
61
|
|
|
58
62
|
1.0.58 - removed console.log statement from **`RadioGroup`** component
|
|
@@ -793,11 +797,13 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
|
|
|
793
797
|
|
|
794
798
|
| Prop | Type | Optional | Default | Description |
|
|
795
799
|
| ----------- | -------- | -------- | -------- | ----------- |
|
|
796
|
-
|
|
|
800
|
+
| 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. |
|
|
797
801
|
| 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.|
|
|
802
|
+
| 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. |
|
|
798
803
|
| classNameInput | string | Yes | **`''`** | alternate css classes to add/change styling of the **input** html element. Passed to all child CheckBox components.|
|
|
799
804
|
| 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.|
|
|
800
|
-
| classNameSvg | string | Yes | **`'
|
|
805
|
+
| 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 |
|
|
806
|
+
| 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. |
|
|
801
807
|
| 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. |
|
|
802
808
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that wraps the CheckBoxGroup component for testing purposes |
|
|
803
809
|
| fill | boolean | Yes | {false} | specifies using the **`fill`** variant or not. If used, the checkbox itself will have a darker solid background. |
|
|
@@ -812,9 +818,11 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
|
|
|
812
818
|
| ----------- | -------- | -------- | -------- | ----------- |
|
|
813
819
|
| ariaLabel | string | Yes | 'CheckBox Component' | The **aria-label** to assign to this CheckBox |
|
|
814
820
|
| className | string | Yes | **`'flex items-center'`** | alternate css classes to add/change styling of the **div** that wraps the **input** element. |
|
|
821
|
+
| 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. |
|
|
815
822
|
| classNameInput | string | Yes | **`''`** | alternate css classes to add/change styling of the **input** html element. |
|
|
816
823
|
| 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**. |
|
|
817
|
-
| classNameSvg | string | Yes | **`'
|
|
824
|
+
| 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 |
|
|
825
|
+
| 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.
|
|
818
826
|
| 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. |
|
|
819
827
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that wraps the CheckBox component for testing purposes |
|
|
820
828
|
| fill | boolean | Yes | {false} | specifies using the **fill** variant or not. If used, the checkbox itself will have a darker solid background. |
|
|
@@ -1046,7 +1054,7 @@ A reference can also be created and passed to the input component, and the compo
|
|
|
1046
1054
|
|
|
1047
1055
|
### Additional Properties & Attributes
|
|
1048
1056
|
|
|
1049
|
-
This component as mentioned also takes any other property or attribute that a
|
|
1057
|
+
This component as mentioned also takes any other property or attribute that a normal input form field would take, including the **required** property. Setting this property to true will not only requires this input field to have a value for form completion, but also adds an asterisk to the beginning of the label.
|
|
1050
1058
|
|
|
1051
1059
|
### Example Usage
|
|
1052
1060
|
|
|
@@ -1415,6 +1423,7 @@ Full list of props below
|
|
|
1415
1423
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1416
1424
|
| 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** |
|
|
1417
1425
|
| options | **`string`** | No | | Array of RadioOption objects that define the options available for selection. |
|
|
1426
|
+
| selectedId | **`string`** | Yes | | A string value matching one of the passed in **`id`** values in the options array. This **`selectedId`** will be pre-selected. |
|
|
1418
1427
|
|
|
1419
1428
|
1. Base CSS Classes
|
|
1420
1429
|
|
|
@@ -1427,6 +1436,18 @@ Full list of props below
|
|
|
1427
1436
|
**`appearance-none w-4 h-4 rounded-[50%] border border-black bg-clip-content checked:bg-black checked:p-[2.5px] checked:border-black`**
|
|
1428
1437
|
|
|
1429
1438
|
|
|
1439
|
+
2. Options interface
|
|
1440
|
+
|
|
1441
|
+
```ts
|
|
1442
|
+
export type RadioOption = {
|
|
1443
|
+
label: string;
|
|
1444
|
+
value: string;
|
|
1445
|
+
id: string;
|
|
1446
|
+
disabled?: boolean;
|
|
1447
|
+
};
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
|
|
1430
1451
|
### Example Usage
|
|
1431
1452
|
|
|
1432
1453
|
Basic RadioGroup
|