-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5394260
commit ca906c5
Showing
10 changed files
with
605 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
.../navigations/Header/AccountMenu/AccountPopover/__storybook__/AccountPopover.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | components/Navigation/AccountPopover" /> | ||
|
||
# Component Documentation | ||
|
||
## AccountPopover | ||
|
||
- **Purpose**: A popover menu component that displays user account-related options and actions. | ||
- **Expected Behavior**: Opens on click of the account trigger button, displaying a menu with user profile information and navigation options. Closes when clicking outside or selecting a menu item. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: Used in the main application header for user account management and navigation. | ||
- **Potential Usage**: Could be used in: | ||
- User profile sections | ||
- Settings panels | ||
- Account management interfaces | ||
- Navigation drawers | ||
- Dashboard headers | ||
|
||
## Props | ||
|
||
- **MenuItems** (MenuItem[]): Array of menu items containing label and onClick handlers for each action | ||
- **PopoverStyles** (object): Styles for the popover component | ||
- **CurrentUser** (object): The current user object containing profile information | ||
- **SwitchProfileMenu** (object): The switch profile menu object containing label and onClick handlers for each action | ||
- **SwitchProfileMenuProps** (object): The switch profile menu props object containing label and onClick handlers for each action | ||
- **ProfilesList** (object): The profiles list object containing label and onClick handlers for each action | ||
- **ProfilesListProps** (object): The profiles list props object containing label and onClick handlers for each action | ||
- **AddProfileMenuItem** (object): The add profile menu item object containing label and onClick handlers for each action | ||
- **AddProfileMenuItemProps** (object): The add profile menu item props object containing label and onClick handlers for each action | ||
- **LogoutItemProps** (object): The logout menu item props object containing label and onClick handlers for each action | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Header: Parent component that contains the AccountPopover | ||
- Popover: Base component used for the popup interface | ||
- MenuItem: Used for individual menu options | ||
- AccountMenu: Wrapper component that manages the popover state | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { AccountPopover } from '@baseapp-frontend/design-system' | ||
|
||
const MyComponent = () => { | ||
return ( | ||
<AccountPopover | ||
MenuItemsProps={{ | ||
menuItems: [ | ||
{ label: 'Profile', onClick: () => console.log('Profile clicked') }, | ||
{ label: 'Settings', onClick: () => console.log('Settings clicked') }, | ||
], | ||
}} | ||
SwitchProfileMenuProps={{ | ||
label: 'Switch Profile', | ||
onClick: () => console.log('Switch Profile clicked'), | ||
}} | ||
ProfilesListProps={{ | ||
label: 'Profiles List', | ||
onClick: () => console.log('Profiles List clicked'), | ||
}} | ||
AddProfileMenuItemProps={{ | ||
label: 'Add Profile', | ||
onClick: () => console.log('Add Profile clicked'), | ||
}} | ||
LogoutItemProps={{ | ||
label: 'Logout', | ||
onClick: () => console.log('Logout clicked'), | ||
}} | ||
/> | ||
) | ||
} | ||
export default MyComponent | ||
``` |
57 changes: 57 additions & 0 deletions
57
packages/components/modules/navigations/Header/__storybook__/Header.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | components/Navigation/Header" /> | ||
|
||
# Component Documentation | ||
|
||
## Header | ||
|
||
- **Purpose**: A versatile header component that provides navigation controls and branding elements for the application layout. | ||
- **Expected Behavior**: Renders a customizable app bar with optional logo, navigation toggle, and account menu. Adapts its layout based on theme settings and screen size. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: Used as the main navigation header across the application, providing consistent branding and navigation controls. | ||
- **Potential Usage**: Could be used in: | ||
- Admin dashboards | ||
- Web applications requiring consistent navigation | ||
- Portals with user account management | ||
- Applications with multiple layout options | ||
|
||
## Props | ||
|
||
- **settings** (object): Configuration object for theme and layout settings | ||
- **themeLayout**: Determines the header layout ('horizontal' | 'centered' | 'vertical') | ||
- **children** (ReactNode): Optional content to render within the header | ||
- **onOpenNav** (function): Callback function for handling navigation menu toggle | ||
- **LogoIcon** (component): Custom logo component to display in the header | ||
- **AccountMenu** (component): Custom account menu component, defaults to DefaultAccountMenu | ||
- **AccountMenuProps** (object): Props passed to the AccountMenu component | ||
- **ToolbarProps** (object): Props passed to the underlying MUI Toolbar component | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Logo: For branding display | ||
- AccountMenu: For user account actions | ||
- MenuIcon: For navigation toggle | ||
- Toolbar: For layout structure | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { Header } from '@baseapp-frontend/design-system' | ||
import { LogoIcon } from '@baseapp-frontend/design-system' | ||
import { AccountMenu } from '@baseapp-frontend/design-system' | ||
|
||
const MyComponent = () => { | ||
return ( | ||
<Header settings={{ themeLayout: 'horizontal' }}> | ||
<LogoIcon /> | ||
<AccountMenu /> | ||
</Header> | ||
) | ||
} | ||
|
||
export default MyComponent | ||
``` |
57 changes: 57 additions & 0 deletions
57
packages/components/modules/navigations/NavCentered/__storybook__/NavCentered.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | components/Navigation/NavCentered" /> | ||
|
||
# Component Documentation | ||
|
||
## NavCentered | ||
|
||
- **Purpose**: A navigation component that provides a centered horizontal menu layout for desktop views and transforms into a drawer for mobile views. | ||
- **Expected Behavior**: On desktop screens (lg and up), displays as a horizontal scrollable navigation bar with centered menu items. On mobile screens (lgDown), transforms into a vertical drawer component. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: Used as a centered horizontal navigation component with responsive mobile drawer. | ||
- **Potential Usage**: Could be used in: | ||
- Applications requiring centered horizontal navigation | ||
- Interfaces needing scrollable menu content | ||
- Responsive web applications | ||
- Systems with desktop and mobile navigation patterns | ||
- Content-focused layouts where centered navigation is preferred | ||
|
||
## Props | ||
|
||
- **navData** (array): Navigation items data containing routes and content | ||
- **openNav** (boolean): Controls visibility of mobile navigation drawer | ||
- **onCloseNav** (function): Callback when mobile navigation drawer closes | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Scrollbar: Handles horizontal scrolling of navigation items | ||
- NavSectionHorizontal: Renders horizontal navigation items with tab layout | ||
- VerticalDrawer: Mobile view navigation component | ||
- useResponsive: Hook for responsive breakpoint detection | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { NavCentered } from '@baseapp-frontend/design-system' | ||
|
||
const MyComponent = () => { | ||
const [openNav, setOpenNav] = useState(false) | ||
return ( | ||
<NavCentered | ||
navData={[ | ||
{ title: 'Home', icon: <MenuIcon /> }, | ||
{ title: 'About', icon: <InfoIcon /> }, | ||
{ title: 'Contact', icon: <ContactIcon /> }, | ||
]} | ||
openNav={openNav} | ||
onCloseNav={() => setOpenNav(false)} | ||
/> | ||
) | ||
} | ||
|
||
export default MyComponent | ||
``` |
58 changes: 58 additions & 0 deletions
58
...es/components/modules/navigations/NavHorizontal/__storybook__/NavHorizontal.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | components/Navigation/NavHorizontal" /> | ||
|
||
# Component Documentation | ||
|
||
## NavHorizontal | ||
|
||
- **Purpose**: A horizontal navigation component that provides a secondary navigation bar below the main header. | ||
- **Expected Behavior**: On desktop screens (lg and up), displays as a horizontal navigation bar fixed below the header with centered menu items and horizontal scrolling if needed. On mobile screens (lgDown), transforms into a vertical drawer component. Uses blur effect on the background. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: Secondary horizontal navigation bar below main header. | ||
- **Potential Usage**: Could be used in: | ||
- Multi-level navigation systems | ||
- Complex web applications requiring secondary navigation | ||
- Interfaces needing horizontally scrollable navigation items | ||
- Applications with responsive navigation requirements | ||
- Systems with desktop and mobile navigation patterns | ||
|
||
## Props | ||
|
||
- **navData** (array): Navigation items data containing routes and content | ||
- **openNav** (boolean): Controls visibility of mobile navigation drawer | ||
- **onCloseNav** (function): Callback when mobile navigation drawer closes | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Scrollbar: Handles horizontal scrolling of navigation items | ||
- NavSectionHorizontal: Renders horizontal navigation items | ||
- VerticalDrawer: Mobile view navigation component | ||
- HeaderShadow: Adds shadow effect below navigation | ||
- AppBar: Material-UI container component | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { NavHorizontal } from '@baseapp-frontend/design-system' | ||
|
||
const MyComponent = () => { | ||
const [openNav, setOpenNav] = useState(false) | ||
return ( | ||
<NavHorizontal | ||
navData={[ | ||
{ title: 'Home', icon: <MenuIcon /> }, | ||
{ title: 'About', icon: <InfoIcon /> }, | ||
{ title: 'Contact', icon: <ContactIcon /> }, | ||
]} | ||
openNav={openNav} | ||
onCloseNav={() => setOpenNav(false)} | ||
/> | ||
) | ||
} | ||
|
||
export default MyComponent | ||
``` |
76 changes: 76 additions & 0 deletions
76
packages/components/modules/navigations/NavMini/__storybook__/NavMini.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { Meta } from '@storybook/addon-docs' | ||
|
||
<Meta title="@baseapp-frontend | components/Navigation/NavMini" /> | ||
|
||
# Component Documentation | ||
|
||
## NavMini | ||
|
||
- **Purpose**: A compact navigation component that provides a fixed-width mini sidebar menu with icon-only display for desktop views and transforms into a drawer for mobile views. | ||
- **Expected Behavior**: On desktop screens (lg and up), displays as a narrow vertical sidebar with width NAV_WIDTH.MINI containing only icons. On mobile screens (lgDown), transforms into a full drawer component. Includes optional logo placement and navigation toggle button. | ||
|
||
## Use Cases | ||
|
||
- **Current Usage**: Used as a space-efficient navigation sidebar when minimal screen space usage is desired. | ||
- **Potential Usage**: Could be used in: | ||
- Applications requiring minimal-width navigation | ||
- Interfaces prioritizing content space | ||
- Responsive web applications | ||
- Systems needing collapsible navigation options | ||
- Dashboards with space constraints | ||
|
||
## Props | ||
|
||
- **navData** (array): Navigation items data containing routes and content | ||
- **settings** (object): Configuration settings for the navigation component | ||
- **setSettings** (function): Callback to update navigation settings | ||
- **LogoIcon** (component): Optional custom logo component to display at top | ||
- **openNav** (boolean): Controls visibility of mobile navigation drawer | ||
- **onCloseNav** (function): Callback when mobile navigation drawer closes | ||
- **hideToggleButton** (boolean): Optional flag to hide the navigation toggle button, defaults to false | ||
|
||
## Notes | ||
|
||
- **Related Components**: | ||
- Logo: Optional branding component at top | ||
- NavSectionMini: Renders mini navigation items | ||
- NavToggleButton: Button to expand/collapse navigation | ||
- VerticalDrawer: Mobile view navigation component | ||
- Box: Container component with responsive styles | ||
- Stack: Vertical layout container | ||
|
||
## Example Usage | ||
|
||
```javascript | ||
import { NavMini } from '@baseapp-frontend/design-system' | ||
import { FavoriteIcon, MentionIcon, MenuIcon, PenEditIcon } from '@baseapp-frontend/design-system' | ||
import { BaseAppLogoCondensed } from '@baseapp-frontend/design-system' | ||
|
||
const MyComponent = () => { | ||
return ( | ||
<NavMini | ||
navData={[ | ||
{ | ||
subheader: 'BASEAPP', | ||
items: [{ title: 'Home', icon: <MenuIcon /> }], | ||
}, | ||
{ | ||
subheader: 'BASIC', | ||
items: [ | ||
{ title: 'Feature Requests', icon: <MentionIcon /> }, | ||
{ title: 'Flat Pages', icon: <PenEditIcon /> }, | ||
{ title: 'Feedback', icon: <FavoriteIcon /> }, | ||
], | ||
}, | ||
]} | ||
settings={defaultTheme.settings} | ||
LogoIcon={BaseAppLogoCondensed} | ||
openNav={false} | ||
hideToggleButton={true} | ||
onCloseNav={() => console.log('NavMini closed')} | ||
/> | ||
) | ||
} | ||
|
||
export default MyComponent | ||
``` |
Oops, something went wrong.