@dhasdk/simple-ui 0.0.23 → 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 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)
@@ -71,8 +73,8 @@ Finally, if Accordion props are specified inside the parent component, those val
71
73
  | children | ReactNode | No | undefined | This is intended to contain the child **Accordion** components |
72
74
  | chevron | boolean | Yes | undefined | If true, displays chevron icons for open/closed status, otherwise displays plus and minus icons. |
73
75
  | iconAccordionOpened & iconAccordionClosed | ReactNode | Yes | N/A | custom icons to display for opened and closed state. See usage example above for a demonstration. |
74
- | childHeadingClassName | string | Yes | CSS classes to apply to the child Accordion component headings. These can be overridden on an individual basis using the same prop on the Accordion component. |
75
- | childContentClassName | string | No | N/A | CSS classes to apply to the child Accordion component content body. These can be overridden on an individual basis using the same prop on the Accordion component. |
76
+ | classNameChildHeading | string | Yes | CSS classes to apply to the child Accordion component headings. These can be overridden on an individual basis using the same prop on the Accordion component. |
77
+ | classNameChildContent | string | No | N/A | CSS classes to apply to the child Accordion component content body. These can be overridden on an individual basis using the same prop on the Accordion component. |
76
78
  | className | string | Yes | undefined | CSS classes applied to the container div for the **AccordionParent** component. |
77
79
  | ...props | string | No | | takes additional props that are not specifically defined in the component, i.e. aria-label |
78
80
  | rounded | boolean | Yes | false | This boolean value indicates whether to display rounded corners or not. By using this prop vs custom classes, only the top of the heading is rounded in an opened state, and only the bottom of the content block is rounded also. |
@@ -86,8 +88,8 @@ Finally, if Accordion props are specified inside the parent component, those val
86
88
  | children | ReactNode | No | undefined | This contains the body of the **Accordion** content. |
87
89
  | chevron | boolean | Yes | undefined | If true, displays chevron icons for open/closed status, otherwise displays plus and minus icons. |
88
90
  | iconAccordionOpened & iconAccordionClosed | ReactNode | Yes | N/A | custom icons to display for opened and closed state. See usage example above for a demonstration. |
89
- | childHeadingClassName | string | Yes | CSS classes to apply to the child Accordion component headings. These can be overridden on an individual basis using the same prop on the Accordion component. |
90
- | childContentClassName | string | No | N/A | CSS classes to apply to the child Accordion component content body. These can be overridden on an individual basis using the same prop on the Accordion component. |
91
+ | classNameChildHeading | string | Yes | CSS classes to apply to the child Accordion component headings. These can be overridden on an individual basis using the same prop on the Accordion component. |
92
+ | classNameChildContent | string | No | N/A | CSS classes to apply to the child Accordion component content body. These can be overridden on an individual basis using the same prop on the Accordion component. |
91
93
  | className | string | Yes | undefined | CSS classes applied to the container div for the **Accordion** component. |
92
94
  | ...props | string | No | | takes additional props that are not specifically defined in the component, i.e. aria-label |
93
95
  | rounded | boolean | Yes | false | This boolean value indicates whether to display rounded corners or not. By using this prop vs custom classes, only the top of the heading is rounded in an opened state, and only the bottom of the content block is rounded also. |
@@ -100,8 +102,8 @@ Finally, if Accordion props are specified inside the parent component, those val
100
102
 
101
103
  ```jsx
102
104
  <AccordionParent
103
- childHeadingClassName='bg-white'
104
- childContentClassName='bg-white'>
105
+ classNameChildHeading='bg-white'
106
+ classNameChildContent='bg-white'>
105
107
  <Accordion label='First Example'>
106
108
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed ...
107
109
  </Accordion>
@@ -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,13 +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';