@dhasdk/simple-ui 1.0.20 → 1.0.22

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
@@ -1669,10 +1669,13 @@ Full list of props below
1669
1669
  | appName | string | No | undefined | The application name to dispilay |
1670
1670
  | children | ReactNode | Yes | undefined | This prop takes in any children and displays them between the horizontal rule and the list of menu items. It is intended for to allow developers to add a Search component. See usage example above. |
1671
1671
  | className | string | Yes | (1) below | a group of alternate css classes that can be specified by the developer and applied to the outer **`div`** element. |
1672
+ | classNameBackButton | string | Yes | **`-mt-8 w-full relative hover:cursor-pointer`** | alternative CSS classes that are
1673
+ applied to the **`button`** (container) that contains the back arrow image and 'Back' text.|
1672
1674
  | clickOutsideCloses | boolean | Yes | **`false`** | clicking or tapping elsewhere on the application will close the SideBarNav |
1673
1675
  | image | string | No | undefined | string path to the application logo to display |
1674
1676
  | classNameImage | string | Yes | (2) below | a group of alternate classes that can be specified for the logo image, and applied to the **`img`** element |
1675
1677
  | classNameImageContainer | string | Yes | (2) below | a group of alternate classes that can be specified for the logo image's container, and applied to the **`img`** element |
1678
+ | customButton | boolean | Yes | false | When present (or true) this sets the SideBarNav to respond to the custom event handler **`toggleSideBarNav`**. This allows the developer to utilize their own button that simply executes the above custom event handler to toggle the SideBarNav open & closed state. |
1676
1679
  | menu | boolean | Yes | false | when **`true`**, the default in-component hamburger menu is displayed and used to display or hide the SideBarNav |
1677
1680
  | classNameMenu | string | Yes | empty string | alternate css classes to apply to the element that makes up the hamburger menu |
1678
1681
  | classNameMenuContainer | string | Yes | (3) below | alternate css classes to apply to the **`button`** element that wraps up the hamburger menu |
@@ -1739,6 +1742,27 @@ const menuItems = [
1739
1742
  </SideBarNav>
1740
1743
  ```
1741
1744
 
1745
+ If using the **`customButton`** prop, you're JSX might be:
1746
+
1747
+ ```jsx
1748
+ // in the return JSX
1749
+ <Button
1750
+ className="my-4 mx-4"
1751
+ onClick={() => window.dispatchEvent(new Event('toggleSideBarNav'))}
1752
+
1753
+ >Toggle SideBar</Button>
1754
+ <SideBarNav
1755
+ appName='A.C.M.E. Tools'
1756
+ version="0.0.0"
1757
+ menuItems={menuItems}
1758
+ classNameMenuItem='pe-4'
1759
+ clickOutsideCloses
1760
+ customButton
1761
+ image={doctor}
1762
+ className='bg-slate-200 border border-slate-400 rounded-l-md h-full'
1763
+ />
1764
+ ```
1765
+
1742
1766
  ### Dependencies
1743
1767
 
1744
1768
  **_none_**