@dhasdk/simple-ui 1.0.61 → 1.0.63

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
@@ -53,6 +53,10 @@ Tooltip
53
53
 
54
54
  ## Changelog
55
55
 
56
+ 1.0.63 - added **selected** prop to the **`Select`** component
57
+
58
+ 1.0.62 - fixed 'checked' and 'indeterminate' prop usage for CheckBox, updated documentation for CheckBox re their usage w/ CheckBox and CheckBoxGroup
59
+
56
60
  1.0.61 - added **selectedId** prop to **`RadioGroup`** as well as updated documentation with the **RadioOptions** interface
57
61
 
58
62
  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.
@@ -791,6 +795,8 @@ The **CheckBoxGroup** component can be optionally used with any number of **Chec
791
795
 
792
796
  **CheckBoxGroup** also takes three props that are directly passed down to **CheckBox**, allowing you to specify any of these values in one place instead of in each instance of **CheckBox**. These three props are all boolean values, described below. They are **`fill`**, **`icon`**, and **`marker`**.
793
797
 
798
+ **Note:** Using **checked** or **indeterminate** on a **`CheckBox`** inside a **`CheckBoxGroup`** will only effect that CheckBox and will not have an effect on the child or parent CheckBoxes as is done when an individual CheckBox is manually clicked inside a CheckBoxGroup. This can for example place a CheckBox in a checked state leaving its children unchecked. If you wish to use **checked** or **indeterminate** on a CheckBox inside a CheckBoxGroup, it is up to the developer to manage the values for all CheckBoxes in that group on initial state.
799
+
794
800
  Used by itself, **CheckBox** behaves as a normal checkbox component and can be used individually or in groups. It also takes the same attributes that a normal **`html input type="checkbox"`** would.
795
801
 
796
802
  ### Props for CheckBoxGroup
@@ -817,6 +823,7 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
817
823
  | Prop | Type | Optional | Default | Description |
818
824
  | ----------- | -------- | -------- | -------- | ----------- |
819
825
  | ariaLabel | string | Yes | 'CheckBox Component' | The **aria-label** to assign to this CheckBox |
826
+ | checked | boolean | Yes | **`false`** | if present, checkbox is initially displayed in a 'checked' state. See above note for more information |
820
827
  | className | string | Yes | **`'flex items-center'`** | alternate css classes to add/change styling of the **div** that wraps the **input** element. |
821
828
  | 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. |
822
829
  | classNameInput | string | Yes | **`''`** | alternate css classes to add/change styling of the **input** html element. |
@@ -827,6 +834,7 @@ Used by itself, **CheckBox** behaves as a normal checkbox component and can be u
827
834
  | dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that wraps the CheckBox component for testing purposes |
828
835
  | fill | boolean | Yes | {false} | specifies using the **fill** variant or not. If used, the checkbox itself will have a darker solid background. |
829
836
  | icon | boolean | Yes | {true} | When true (default value) this prop will utilize one of two UX created icons to represent a checked, indeterminate, and blank checkbox. When **marker** is true as well, a marker icon is used in place of the checked. |
837
+ | indeterminate | boolean | Yes | **`false`** | if present, checkbox is initially displayed in an 'indeterminate' state. See above note for more information |
830
838
  | marker | boolean | Yes | {false} | When true this boolean will cause the normal checked checkbox to instead display an 'x' marker icon. |
831
839
  | ...props | string | Yes | undefined | takes additional props that are not specifically defined in the component, i.e. aria-label |
832
840
  | ref | string | Yes | undefined | ref is exposed as a prop, and can be assigned and used on this component as normal |
@@ -1763,6 +1771,7 @@ Full list of props below
1763
1771
  | label | string | Yes | undefined | text used as the label for the input, i.e. 'Border Color' above |
1764
1772
  | options | {{name: ..., value:...}, ...} | Yes | undefined | options is an array of objects, each with a **name** and an optional **value** property. If value is not present, name is used in the handler function. |
1765
1773
  | optionsLabel | string | Yes | undefined | appears as the label in the Select component, i.e. 'Choose a Color' above. Note, this is not the label above the component. |
1774
+ | selected | string | Yes | undefined | The **value** or **name** inside the options array to pre-select or display. Is case sensitive. |
1766
1775
  | setSelectedOption | (string) => void | Yes | undefined | calls the function passed in as **`setSelectedOption`** with the selected **value** if present, otherwise with **name** |
1767
1776
  | variant | string | Yes | undefined | The predefined variant of Select to display. Current options are 'default', 'MedCard', 'Outline', and 'nonHover' |
1768
1777
  | width | string | Yes | | This prop is intended to like **`className`** take in css class name values. These are intended though to only take class names relevant to the component width, as they will be applied to both the **button** and the **drop down** elements of the **`Select`** component. For instance, the **`width`** prop is a good way to ensure that the button and drop down are of the same width. Note the default classes below, i.e. widths specified on various break points. |