-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from Dias999/feature/Storybook-HeaderAccount
Feature/storybook header account
- Loading branch information
Showing
6 changed files
with
146 additions
and
11 deletions.
There are no files selected for viewing
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
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
5 changes: 1 addition & 4 deletions
5
packages/react-material-ui/src/components/HeaderAccount/index.ts
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 |
---|---|---|
@@ -1,4 +1 @@ | ||
import HeaderAccount, { HeaderAccountProps } from './HeaderAccount'; | ||
|
||
export type { HeaderAccountProps }; | ||
export default HeaderAccount; | ||
export { HeaderAccount, HeaderAccountProps } from './HeaderAccount'; |
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
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
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,102 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { fn } from '@storybook/test'; | ||
|
||
import { HeaderAccount } from '@concepta/react-material-ui'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
|
||
const meta = { | ||
component: HeaderAccount, | ||
tags: ['autodocs'], | ||
args: {}, | ||
argTypes: {}, | ||
} satisfies Meta<typeof HeaderAccount>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
}, | ||
}; | ||
|
||
export const WithAvatar: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
}, | ||
}; | ||
|
||
export const WithLargeAvatar: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
avatarSize: 80, | ||
}, | ||
}; | ||
|
||
export const WithoutAvatar: Story = { | ||
args: { | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
}, | ||
}; | ||
|
||
export const WithTextAndSubtext: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
}, | ||
}; | ||
|
||
export const WithCustomTextStyling: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
textProps: { | ||
fontSize: 16, | ||
fontWeight: 'bold', | ||
color: 'primary.main', | ||
}, | ||
subTextProps: { | ||
fontSize: 14, | ||
color: 'secondary.main', | ||
}, | ||
}, | ||
}; | ||
|
||
export const WithCustomIconColor: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
iconColor: 'error.main', | ||
}, | ||
}; | ||
|
||
export const WithOnClickEvent: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
onClick: fn(), | ||
}, | ||
}; | ||
|
||
export const WithMenuOptions: Story = { | ||
args: { | ||
avatar: 'https://picsum.photos/200/200', | ||
text: 'John Doe', | ||
subText: 'Admin', | ||
menuOptions: (handleClose) => ( | ||
<> | ||
<MenuItem onClick={handleClose}>Profile</MenuItem> | ||
<MenuItem onClick={handleClose}>Logout</MenuItem> | ||
</> | ||
), | ||
}, | ||
}; |