@dhasdk/simple-ui 1.0.64 → 1.0.66
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 +23 -4
- package/index.css +1 -1
- package/index.js +15 -15
- package/index.mjs +1437 -1431
- package/lib/Input.d.ts +3 -4
- package/lib/RadioGroup.d.ts +1 -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.66 - added **`inline`** prop to **`RadioGroup`**, allows for a flex-row layout of RadioGroup items as opposed to the default flex-column layout
|
|
57
|
+
|
|
58
|
+
1.0.65 - changed **label** on **`Input`** component to a **`ReactNode`** type. Also updated **aria-label**
|
|
59
|
+
handling logic to compensate (dev can enter **aria-label** manually, if not present and label is of
|
|
60
|
+
type string, will use **label** as the **aria-label**).
|
|
61
|
+
|
|
56
62
|
1.0.64 - changed **optionsLabel** prop in **`Select`** to a ReactNode from string value
|
|
57
63
|
|
|
58
64
|
1.0.63 - added **selected** prop to the **`Select`** component
|
|
@@ -1032,12 +1038,14 @@ A reference can also be created and passed to the input component, and the compo
|
|
|
1032
1038
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the input element for testing purposes |
|
|
1033
1039
|
| dataTestIdLabel | string | Yes | undefined | A **'data-testid'** value that is applied to the div element that contains the Label value for testing purposes |
|
|
1034
1040
|
| insetLabel | boolean | Yes | false | indicates whether the label is inset into the border or resides above the input component |
|
|
1035
|
-
| label |
|
|
1041
|
+
| label | ReactNode | Yes | '' | Can be a String or ReactNode, allows formatting inside the label. The
|
|
1042
|
+
**`aria-label`** value can be specified separately, or taken from **label** if of type string. aria-label is
|
|
1043
|
+
undefined otherwise. |
|
|
1036
1044
|
| labelBaseColor | string | Yes | | Use if the page or input color is not white, this will help to blend the label background to the surrounding area, color is a string hex value, i.e. **#fefefe** |
|
|
1037
1045
|
| error | boolean | Yes | false | boolean prop indicating if the current input is in an error state. if true, applies visual error formatting to the input component. |
|
|
1038
1046
|
| mask | string | Yes | undefined | a text string used to define an input mask. using the provided mask, input will format the users input into the formatted mask. In the case that the user adds invalid input, it is ignored. Non letter/number characters are also automatically entered if a valid following character type is added instead. # represents an individual number character, and @ represents a letter. All other values are themselves. |
|
|
1039
1047
|
| placeHolder | string | Yes | Yes | | sets the placeholder text inside the input element |
|
|
1040
|
-
| ...props | string | Yes | | takes additional props that are not specifically defined in the component, i.e. aria-label |
|
|
1048
|
+
| ...props | string | Yes | | takes additional props that are not specifically defined in the component, i.e. aria-label. Note, if **aria-label** is not specically set, will be derived from **label** if of type string |
|
|
1041
1049
|
| required | boolean | Yes | | if specified, a red asterisk is prepended to the label, and the required attribute is set to true |
|
|
1042
1050
|
| textShadow | boolean | Yes | false | indicates whether a drop shadow should be applied or not to the label text, and if used, utilizes the **labelBaseColor** above. |
|
|
1043
1051
|
| variant | string | Yes | | The predefined variant of Badge to display. Current options are 'default', 'MedCard', 'Outline', and 'nonHover' |
|
|
@@ -1431,6 +1439,7 @@ Full list of props below
|
|
|
1431
1439
|
| 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. |
|
|
1432
1440
|
| 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. |
|
|
1433
1441
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1442
|
+
| inline | boolean | Yes | false | If **`true`**, the radio group is layed out in a flex-row instead of a flex-column. |
|
|
1434
1443
|
| 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** |
|
|
1435
1444
|
| options | **`string`** | No | | Array of RadioOption objects that define the options available for selection. |
|
|
1436
1445
|
| selectedId | **`string`** | Yes | | A string value matching one of the passed in **`id`** values in the options array. This **`selectedId`** will be pre-selected. |
|
|
@@ -1439,11 +1448,21 @@ Full list of props below
|
|
|
1439
1448
|
|
|
1440
1449
|
- label:
|
|
1441
1450
|
|
|
1442
|
-
|
|
1451
|
+
```tsx
|
|
1452
|
+
twMerge(
|
|
1453
|
+
"flex items-center gap-1 cursor-pointer",
|
|
1454
|
+
inline ? "mr-4 mb-1" : "mb-2",
|
|
1455
|
+
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1456
|
+
classNameLabel
|
|
1457
|
+
)
|
|
1458
|
+
```
|
|
1443
1459
|
|
|
1444
1460
|
- input:
|
|
1445
1461
|
|
|
1446
|
-
|
|
1462
|
+
```tsx
|
|
1463
|
+
appearance-none w-4 h-4 rounded-[50%] border border-black bg-clip-content
|
|
1464
|
+
checked:bg-black checked:p-[2.5px] checked:border-black
|
|
1465
|
+
```
|
|
1447
1466
|
|
|
1448
1467
|
|
|
1449
1468
|
2. Options interface
|