@dhasdk/simple-ui 0.0.24 → 0.0.25
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 +123 -0
- package/index.d.ts +3 -3
- package/index.js +6 -6
- package/index.mjs +928 -921
- package/lib/Modal.d.ts +2 -1
- package/lib/SideBarNav.d.ts +1 -0
- package/lib/Skeleton.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ This library was generated with [Nx](https://nx.dev) on React 18.x.
|
|
|
17
17
|
- [Input](#input)
|
|
18
18
|
- [List](#list)
|
|
19
19
|
- [Modal](#modal)
|
|
20
|
+
- [Pill](#pill)
|
|
21
|
+
- [Section Header](#sectionheader)
|
|
20
22
|
- [Select](#select)
|
|
21
23
|
- [Skeleton](#skeleton)
|
|
22
24
|
- [Status](#status)
|
|
@@ -693,6 +695,124 @@ Basic Modal
|
|
|
693
695
|
[Top of Page](#table-of-contents)
|
|
694
696
|
|
|
695
697
|
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
<!-- P I L L --------------------------------------------------------------------------- -->
|
|
701
|
+
|
|
702
|
+
## Pill
|
|
703
|
+
|
|
704
|
+
The **`Pill`** component displays a **`children`** prop as its primary content, with optional left and/or right icons. It also has the ability to display selected state via a **selected** prop, and can also take an **onClick** handler.
|
|
705
|
+
|
|
706
|
+
Optional props are **className**, **iconLeft**, **iconLeftSelected**, **iconRight**, **iconRightSelected**, **onClick**, and **selected**.
|
|
707
|
+
|
|
708
|
+
Full list of props below
|
|
709
|
+
|
|
710
|
+
### Props
|
|
711
|
+
|
|
712
|
+
| Prop | Type | Optional | Default | Description |
|
|
713
|
+
| ----------- | -------- | -------- | -------- | ----------- |
|
|
714
|
+
| children | ReactNode | No | | The primary content to display in this Pill, i.e. the word 'Pill' above.|
|
|
715
|
+
| className | string | Yes | | Alternate CSS classnames to apply to the Pill component, which is itself built inside a Button. **`twMerge`** is used to apply these styles, so they reliably overwrite existing classes. |
|
|
716
|
+
| iconLeft | ReactNode | Yes | | This prop takes an image to display as its left icon. It takes this value as a ReactNode.|
|
|
717
|
+
| iconLeftSelected | ReactNode | Yes | | This prop takes an image to display as its left icon when the component is in its selected state. It takes this value as a ReactNode.|
|
|
718
|
+
| iconRight | ReactNode | Yes | | This prop takes an image to display as its right icon. It takes this value as a ReactNode.|
|
|
719
|
+
| iconRightSelected | ReactNode | Yes | | This prop takes an image to display as its right icon when the component is in its selected state. It takes this value as a ReactNode|
|
|
720
|
+
| onClick | () => void() | Yes | | When included this serves as the **`onClick`** handler for the **`Pill`** component. |
|
|
721
|
+
| selected | boolean | Yes | false | This prop is a boolean that can be used to indicate if thisPill component should be in a selected state or not. This value is controled in by the developer, and assigned via this prop. See the selected state example above for example usage. |
|
|
722
|
+
|
|
723
|
+
1. Default classNames
|
|
724
|
+
|
|
725
|
+
- **`relative inline-flex items-center justify-center whitespace-nowrap rounded-3xl transition-colors focus-visible:outline-none font-[`Arial`] disabled:pointer-events-none disabled:opacity-50 py-[10px] md:py-[14px] lg:py-[16px] border-2 border-[#092068] text-[#092068] text-lg bg-white hover:bg-[#D1DBFB] active:bg-[#9fc5f0] focus:bg-white disabled:bg-[#939194] disabled:bg-dha-mc-bottom-nav-background disabled:text-dha-mc-checkbox-inactive focus:border-black disabled:border-dha-mc-secondary-border disabled:border-2 py-0 md:py-0 lg:py-0 h-[48px] mt-1`**
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
### Example Usage
|
|
729
|
+
|
|
730
|
+
Basic Pill
|
|
731
|
+
|
|
732
|
+
```jsx
|
|
733
|
+
<Pill
|
|
734
|
+
iconLeft={<img src={frame} alt='left header icon' />}
|
|
735
|
+
iconRight={<img src={frame} alt='right header icon' />}
|
|
736
|
+
>
|
|
737
|
+
Pill
|
|
738
|
+
</Pill>
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### Dependencies
|
|
742
|
+
|
|
743
|
+
**_none_**
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
[Top of Page](#table-of-contents)
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
<!-- S E C T I O N H E A D E R --------------------------------------------------------------------------- -->
|
|
750
|
+
|
|
751
|
+
## SectionHeader
|
|
752
|
+
|
|
753
|
+
The **`SectionHeader`** component displays a **`children`** prop as a heading, and uses various additional props to customize the remaining portion of the Header.
|
|
754
|
+
|
|
755
|
+
Optional props are **`className`**, **`classNameChildren`**, **`classNameSubHeader`**, **`iconLeft`**, **`iconRight`**, **`subHeader`**, and **`underline`**. Various examples and
|
|
756
|
+
combinations of these props in use can be seen via the above drop down with
|
|
757
|
+
the **Usage** button
|
|
758
|
+
|
|
759
|
+
Full list of props below
|
|
760
|
+
|
|
761
|
+
### Props
|
|
762
|
+
|
|
763
|
+
| Prop | Type | Optional | Default | Description |
|
|
764
|
+
| ----------- | -------- | -------- | -------- | ----------- |
|
|
765
|
+
| children | ReactNode | No | | The primary content to display in this SectionHeader, i.e.the word 'Prologue' above. |
|
|
766
|
+
| className | string | Yes | (1) below | Alternate CSS classnames to apply to the SectionHeader component. **`twMerge`** is used to apply these styles, so they reliably overwrite existing classes. |
|
|
767
|
+
| classNameChildren | string | Yes | (2) below | Alternate CSS classnames to apply to the **`children`** component which contains the Header content. **`twMerge`** is used to apply these styles, so they reliably overwrite existing classes. |
|
|
768
|
+
| classNameSubHeader | string | Yes | (3) below | Alternate CSS classnames to apply to the subHeader portion when present. **`twMerge`** is used to apply these styles, so they reliably overwrite existing classes. |
|
|
769
|
+
| iconLeft | ReactNode | Yes | | This prop takes an image to display as its left icon. It takes this value as a ReactNode, see examples above. |
|
|
770
|
+
| iconRight | ReactNode | Yes | | This prop takes an image to display as its right icon. It takes this value as a ReactNode, see examples above. |
|
|
771
|
+
| underline | boolean | Yes | false | When true, an underline is displayed underneath the entire SubHeader. |
|
|
772
|
+
| subHeader | string | Yes | undefined | This prop takes a string value that is displayed as a SubHeader when present. If no subHeader is passed in, nothing is displayed in this location. |
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
1. Default classNames
|
|
776
|
+
|
|
777
|
+
- **`px-2 justify-start items-start gap-4 inline-flex w-full`**
|
|
778
|
+
|
|
779
|
+
2. children classNames
|
|
780
|
+
|
|
781
|
+
- **`self-stretch text-[#07192d] text-[40px] font-normal font-['Arial'] leading-[48px] pb-1`**
|
|
782
|
+
|
|
783
|
+
3. subHeader classNames
|
|
784
|
+
|
|
785
|
+
- **`text-[#07192d] text-xl font-normal font-['Arial'] leading-[30px]`**
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
### Example Usage
|
|
789
|
+
|
|
790
|
+
```jsx
|
|
791
|
+
<SectionHeader
|
|
792
|
+
iconLeft={
|
|
793
|
+
<img src={frame}
|
|
794
|
+
alt='left header icon' />}
|
|
795
|
+
iconRight={
|
|
796
|
+
<img src={important}
|
|
797
|
+
alt='left header icon'
|
|
798
|
+
className='size-8 mt-2' />}
|
|
799
|
+
subHeader="1st things first though"
|
|
800
|
+
underline
|
|
801
|
+
>
|
|
802
|
+
Prologue
|
|
803
|
+
</SectionHeader>
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
### Dependencies
|
|
809
|
+
|
|
810
|
+
**_none_**
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
[Top of Page](#table-of-contents)
|
|
814
|
+
|
|
815
|
+
|
|
696
816
|
<!-- S E L E C T ---------------------------------------------------------------------------- -->
|
|
697
817
|
|
|
698
818
|
## Select
|
|
@@ -860,6 +980,9 @@ The nested components inside of Skeleton are `SkelCircle`, `SkelLine`, `SkelSect
|
|
|
860
980
|
|
|
861
981
|
When using the `className` prop on one of the internal props inside the `Skeleton` component to alter style or size, as the container uses flexbox, note the usage examples above. For instance, to make a bar partially expand across the line, you can for example use `className="grow-0 basis-2/12"`.
|
|
862
982
|
|
|
983
|
+
In addition, you can apply a different color and opacity by using simple tailwindcss classes, i.e. to change the background color and opacity as above in the last example, applying **`bg-blue-500/50`** changes the color of the individual Skeleton sub-components to a shade of blue with 50%
|
|
984
|
+
opacity.
|
|
985
|
+
|
|
863
986
|
- `SkelCircle` - a small circle (i.e. a badge or icon)
|
|
864
987
|
- `SkelLine` - a line (i.e. text or content)
|
|
865
988
|
- `SkelSection` - a larger section on a page, or paragraph
|
package/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { CharacterCounter } from './lib/CharacterCounter';
|
|
|
9
9
|
export type { CharacterCounterProps } from './lib/CharacterCounter';
|
|
10
10
|
export { DatePicker } from './lib/DatePicker';
|
|
11
11
|
export type { DatePickerProps } from './lib/DatePicker';
|
|
12
|
+
export { IconPosition } from './lib/Tabs';
|
|
12
13
|
export { Input } from './lib/Input';
|
|
13
14
|
export { List, ListItem } from './lib/List';
|
|
14
15
|
export { Modal } from './lib/Modal';
|
|
@@ -18,14 +19,13 @@ export { SectionHeader } from './lib/SectionHeader';
|
|
|
18
19
|
export type { SectionHeaderProps } from './lib/SectionHeader';
|
|
19
20
|
export { Select } from './lib/Select';
|
|
20
21
|
export type { SelectProps } from './lib/Select';
|
|
22
|
+
export { SideBarNav } from './lib/SideBarNav';
|
|
21
23
|
export { Skeleton, SkelCircle, SkelLine, SkelRow, SkelSection } from './lib/Skeleton';
|
|
22
24
|
export type { SkeletonProps, SkelProps } from './lib/Skeleton';
|
|
25
|
+
export { SkipLink } from './lib/SkipLink';
|
|
23
26
|
export { Status } from './lib/Status';
|
|
24
27
|
export type { StatusProps } from './lib/Status';
|
|
25
28
|
export { Tabs } from './lib/Tabs';
|
|
26
29
|
export type { TabsProps } from './lib/Tabs';
|
|
27
|
-
export { IconPosition } from './lib/Tabs';
|
|
28
30
|
export { Toggle } from './lib/Toggle';
|
|
29
31
|
export type { ToggleProps } from './lib/Toggle';
|
|
30
|
-
export { SideBarNav } from './lib/SideBarNav';
|
|
31
|
-
export { SkipLink } from './lib/SkipLink';
|