@dhasdk/simple-ui 1.0.10 → 1.0.12
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 +19 -2
- package/index.css +1 -1
- package/index.js +17 -17
- package/index.mjs +490 -483
- package/lib/Button.d.ts +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -360,10 +360,15 @@ A reference can also be created and passed to the button component, and the comp
|
|
|
360
360
|
| ----------- | -------- | -------- | -------- | ----------- |
|
|
361
361
|
| children | ReactNode | Yes | | Content to display in the Button, overrides 'label' if both are present. |
|
|
362
362
|
| className | string | Yes | **(1) below** | Class names to style component |
|
|
363
|
+
| classNameIconLeft | string | Yes | **`mr-3`** | Class names to style the span element that contains the left icon |
|
|
364
|
+
| classNameIconRight | string | Yes | **`ml-3`** | Class names to style the span element that contains the right icon |
|
|
365
|
+
| classNameContent | string | Yes | **`grow-1 text-start`** | Class names to style the content block / body, i.e. the label |
|
|
363
366
|
| classNameSelected | string | Yes | undefined | Class names to apply to the components if they are in the optional selected state, see **selected** below |
|
|
364
367
|
| icon | ReactNode | Yes | undefined | image, icon, etc. to use for left or right icon as defined by **`iconPosition`** |
|
|
365
|
-
|
|
|
366
|
-
|
|
|
368
|
+
| iconLeft | ReactNode | Yes | undefined | This contains the optional icon to display on the left side of the button. This prop does not require the use of the iconPosition prop below. |
|
|
369
|
+
| iconRight | ReactNode | Yes | undefined | This contains the optional icon to display on the right side of the button. This prop does not require the use of the iconPosition prop below. |
|
|
370
|
+
| iconPosition | 'left', 'right', 'both', 'iconOnly', undefined | Yes | undefined | Controls where the icon is positioned on the Button. Alternatively, iconLeft and iconRightcan be used above. |
|
|
371
|
+
| label | string | Yes | | Display text for button. If **'children'** is present, that is used instead |
|
|
367
372
|
| onClick | () => void | Yes | | A click handler for the Button |
|
|
368
373
|
| ...props | string | Yes | undefined | additional props that are not specifically defined in the component, i.e. aria-label |
|
|
369
374
|
| type | string | Yes | 'button' | specifies the button type, and is one of 'button', 'submit', or 'reset' |
|
|
@@ -434,6 +439,18 @@ using selected option w/ filled variant
|
|
|
434
439
|
/>
|
|
435
440
|
```
|
|
436
441
|
|
|
442
|
+
two icons w/ custom css
|
|
443
|
+
```jsx
|
|
444
|
+
<Button
|
|
445
|
+
className='justify-between w-[400px] px-3'
|
|
446
|
+
onClick={handleClick}
|
|
447
|
+
label='Two Icons w/ CSS'
|
|
448
|
+
disabled={disabled}
|
|
449
|
+
iconLeft={<img src={calendar} alt='calendar' className='size-[36px]' />}
|
|
450
|
+
iconRight={<img src={chevronRight} alt='chevron' />}
|
|
451
|
+
/>
|
|
452
|
+
```
|
|
453
|
+
|
|
437
454
|
|
|
438
455
|
### Dependencies
|
|
439
456
|
|