-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Sidebar Item #284
Merged
feat: Sidebar Item #284
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b5aec82
Success Button
ggazzo 739fcd2
Update Loki
ggazzo 080e7a0
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat.Fuselage …
ggazzo a529c33
feat: Sidebar Item
ggazzo fa9d77b
SideBar TopBar
ggazzo 5551213
New Icons
ggazzo f96795d
Update Icons
ggazzo 954c2f8
Update Files
ggazzo df116be
update contact
ggazzo 41e7b72
Lint
ggazzo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+5.29 KB
(100%)
packages/fuselage/.loki/reference/chrome_iphone7_Misc_Icon_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+78.5 KB
.../fuselage/.loki/reference/chrome_iphone7_Sidebar_Containers_Sidebar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.4 KB
...lage/.loki/reference/chrome_iphone7_Sidebar_Containers_Sidebar_Item_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.4 KB
...oki/reference/chrome_iphone7_Sidebar_Containers_Sidebar_SidebarItem_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.9 KB
...ge/.loki/reference/chrome_iphone7_Sidebar_Containers_Sidebar_TopBar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.4 KB
packages/fuselage/.loki/reference/chrome_iphone7_Sidebar_Item_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.3 KB
packages/fuselage/.loki/reference/chrome_iphone7_Sidebar_TopBar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.71 KB
(100%)
packages/fuselage/.loki/reference/chrome_laptop_Misc_Icon_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.9 KB
...s/fuselage/.loki/reference/chrome_laptop_Sidebar_Containers_Sidebar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.5 KB
...elage/.loki/reference/chrome_laptop_Sidebar_Containers_Sidebar_Item_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.5 KB
...loki/reference/chrome_laptop_Sidebar_Containers_Sidebar_SidebarItem_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...age/.loki/reference/chrome_laptop_Sidebar_Containers_Sidebar_TopBar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.5 KB
packages/fuselage/.loki/reference/chrome_laptop_Sidebar_Item_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
packages/fuselage/.loki/reference/chrome_laptop_Sidebar_TopBar_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -53,6 +53,10 @@ | |
margin-inline: lengths.margin(2); | ||
} | ||
|
||
.rcx-button-group.rcx-button-group--medium > & { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space expected between blocks |
||
margin-inline: lengths.margin(4); | ||
} | ||
|
||
.rcx-button-group--wrap > & { | ||
margin-block-end: lengths.margin(16); | ||
margin-inline-start: lengths.margin(none); | ||
|
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,5 @@ | ||
import React from 'react'; | ||
|
||
import { ButtonGroup } from '../..'; | ||
|
||
export const Actions = (props) => <ButtonGroup mb='neg-x2' medium {...props}/>; |
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,39 @@ | ||
import React from 'react'; | ||
|
||
import { Icon as FuselageIcon, ButtonGroup } from '../..'; | ||
|
||
const Item = ({ selected, highlighted, clickable, ...props }) => <div className={[ | ||
'rc-box rcx-box--full rcx-sidebar-item', | ||
highlighted && 'rcx-sidebar-item--highlighted', | ||
clickable && 'rcx-sidebar-item--clickable', | ||
selected && 'rcx-sidebar-item--selected', | ||
].filter(Boolean).join(' ')} {...props} />; | ||
|
||
const Container = (props) => <div className='rc-box rcx-box--full rcx-sidebar-item__container' {...props}/>; | ||
|
||
const Content = (props) => <div className='rc-box rcx-box--full rcx-sidebar-item__container rcx-sidebar-item__content' {...props}/>; | ||
|
||
const Title = (props) => <div className='rc-box rcx-box--full rcx-sidebar-item__title' {...props}/>; | ||
|
||
const Subtitle = (props) => <div className='rc-box rcx-box--full rcx-sidebar-item__subtitle' {...props}/>; | ||
|
||
const Wrapper = (props) => <div className='rc-box rcx-box--full rcx-sidebar-item__wrapper' {...props}/>; | ||
|
||
const Icon = (props) => <FuselageIcon w='x12' mi='x4' size='x16' {...props} />; | ||
|
||
const Avatar = (props) => <Container><div className='rc-box rcx-box--full rcx-sidebar-item__avatar' {...props}/></Container>; | ||
|
||
const Actions = (props) => <ButtonGroup small {...props}/>; | ||
|
||
Object.assign(Item, { | ||
Container, | ||
Content, | ||
Title, | ||
Subtitle, | ||
Wrapper, | ||
Icon, | ||
Avatar, | ||
Actions, | ||
}); | ||
|
||
export default Item; |
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,65 @@ | ||
import { Meta, Canvas, Story } from '@storybook/addon-docs/blocks'; | ||
|
||
import { ActionButton, Avatar } from '../..'; | ||
import Item from './Item'; | ||
|
||
<Meta title='Sidebar/Item' parameters={{ jest: ['Sidebar/spec'] }} /> | ||
|
||
# Sidebar.Item | ||
|
||
Item component to be used inside Sidebar. | ||
|
||
<Canvas> | ||
<Story name='Default'> | ||
<Item> | ||
<Item.Avatar><Avatar size='x16' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0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
<Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Item.Title> | ||
</Item.Content> | ||
<Item.Container> | ||
<Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Item.Actions> | ||
</Item.Container> | ||
</Item> | ||
<Item selected clickable> | ||
<Item.Avatar><Avatar size='x28' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'}/></Item.Avatar> | ||
<Item.Content> | ||
<Item.Icon name='lock'/> | ||
<Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Item.Title> | ||
</Item.Content> | ||
<Item.Container> | ||
<Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Item.Actions> | ||
</Item.Container> | ||
</Item> | ||
<Item clickable> | ||
<Item.Avatar><Avatar size='x36' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'}/></Item.Avatar> | ||
<Item.Content> | ||
<Item.Wrapper> | ||
<Item.Icon name='lock'/> | ||
<Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Item.Title> | ||
</Item.Wrapper> | ||
<Item.Wrapper> | ||
<Item.Subtitle>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Item.Subtitle> | ||
</Item.Wrapper> | ||
</Item.Content> | ||
<Item.Container> | ||
<Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Item.Actions> | ||
</Item.Container> | ||
</Item> | ||
</Story> | ||
</Canvas> |
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,8 @@ | ||
import React from 'react'; | ||
|
||
export const Title = (props) => <div className='rcx-box rcx-box--full rcx-sidebar-title' {...props}/>; | ||
|
||
|
||
export default { | ||
Title, | ||
}; |
81 changes: 81 additions & 0 deletions
81
packages/fuselage/src/components/Sidebar/Sidebar.stories.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,81 @@ | ||
import { Meta, Canvas, Story } from '@storybook/addon-docs/blocks'; | ||
|
||
import Sidebar from '.'; | ||
import { ActionButton, Avatar } from '../..'; | ||
|
||
<Meta title='Sidebar' parameters={{ jest: ['Sidebar/spec'] }} /> | ||
|
||
# Sidebar | ||
|
||
<Canvas> | ||
<Story name='Default'> | ||
<Sidebar.TopBar.Section> | ||
<Avatar size={Sidebar.TopBar.Avatar.size} url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'} {...Avatar } /> | ||
<Sidebar.TopBar.Actions> | ||
<Sidebar.TopBar.Action icon='home'/> | ||
<Sidebar.TopBar.Action icon='magnifier'/> | ||
<Sidebar.TopBar.Action icon='globe'/> | ||
<Sidebar.TopBar.Action icon='sort'/> | ||
<Sidebar.TopBar.Action icon='edit-rounded'/> | ||
</Sidebar.TopBar.Actions> | ||
</Sidebar.TopBar.Section> | ||
<Sidebar.TopBar.ToolBox> | ||
<Sidebar.TopBar.Title>Title</Sidebar.TopBar.Title> | ||
<Sidebar.TopBar.Actions> | ||
<Sidebar.TopBar.Action success icon='phone'/> | ||
<Sidebar.TopBar.Action icon='message-disabled'/> | ||
</Sidebar.TopBar.Actions> | ||
</Sidebar.TopBar.ToolBox> | ||
<Sidebar.Section.Title>Calls</Sidebar.Section.Title> | ||
<Sidebar.Item> | ||
<Sidebar.Item.Avatar><Avatar size='x16' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'}/></Sidebar.Item.Avatar> | ||
<Sidebar.Item.Content> | ||
<Sidebar.Item.Icon name='lock'/> | ||
<Sidebar.Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Sidebar.Item.Title> | ||
</Sidebar.Item.Content> | ||
<Sidebar.Item.Container> | ||
<Sidebar.Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Sidebar.Item.Actions> | ||
</Sidebar.Item.Container> | ||
</Sidebar.Item> | ||
<Sidebar.Item selected clickable> | ||
<Sidebar.Item.Avatar><Avatar size='x28' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'}/></Sidebar.Item.Avatar> | ||
<Sidebar.Item.Content> | ||
<Sidebar.Item.Icon name='lock'/> | ||
<Sidebar.Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Sidebar.Item.Title> | ||
</Sidebar.Item.Content> | ||
<Sidebar.Item.Container> | ||
<Sidebar.Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Sidebar.Item.Actions> | ||
</Sidebar.Item.Container> | ||
</Sidebar.Item> | ||
<Sidebar.Item clickable> | ||
<Sidebar.Item.Avatar><Avatar size='x36' url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQ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||
<Sidebar.Item.Content> | ||
<Sidebar.Item.Wrapper> | ||
<Sidebar.Item.Icon name='lock'/> | ||
<Sidebar.Item.Title>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Sidebar.Item.Title> | ||
</Sidebar.Item.Wrapper> | ||
<Sidebar.Item.Wrapper> | ||
<Sidebar.Item.Subtitle>ddsfoasdhfiuashd ousadhfiuasdhfiuashd soduhfiuasdhfia ishdfiuashdfiuas iuashdfiausdh</Sidebar.Item.Subtitle> | ||
</Sidebar.Item.Wrapper> | ||
</Sidebar.Item.Content> | ||
<Sidebar.Item.Container> | ||
<Sidebar.Item.Actions> | ||
<ActionButton primary success icon='phone'/> | ||
<ActionButton primary danger icon='circle-cross'/> | ||
<ActionButton primary icon='trash'/> | ||
<ActionButton icon='phone'/> | ||
</Sidebar.Item.Actions> | ||
</Sidebar.Item.Container> | ||
</Sidebar.Item> | ||
</Story> | ||
</Canvas> |
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,31 @@ | ||
import React from 'react'; | ||
|
||
import { ActionButton, Divider, Box } from '../..'; | ||
import { Actions } from './Actions'; | ||
|
||
const Avatar = { size: 'x24' }; | ||
|
||
const TopBar = ({ modifier, className, ...props }) => <div className={ `rc-box rc-box--full rcx-sidebar-topbar ${ className }` } {...props} />; | ||
|
||
const Wrapper = ({ children }) => <div className='rc-box rc-box--full rcx-sidebar-topbar__wrapper' children={children} />; | ||
|
||
TopBar.ToolBox = ({ children, ...props }) => | ||
<TopBar className='rcx-sidebar-topbar--toolbox'{...props}> | ||
<TopBar.Wrapper children={children} /> | ||
<TopBar.Divider /> | ||
</TopBar>; | ||
|
||
TopBar.Section = ({ children, ...props }) => | ||
<TopBar className='rcx-sidebar-topbar--section' {...props}> | ||
<TopBar.Wrapper children={children} /> | ||
<TopBar.Divider /> | ||
</TopBar>; | ||
|
||
TopBar.Wrapper = Wrapper; | ||
TopBar.Avatar = Avatar; | ||
TopBar.Actions = Actions; | ||
TopBar.Action = (props) => <ActionButton ghost {...props}/>; | ||
TopBar.Divider = () => <Divider mbs='neg-x2' mbe={0} />; | ||
TopBar.Title = (props) => <Box fontScale='p2' color='default' withTruncatedText {...props} />; | ||
|
||
export default TopBar; |
42 changes: 42 additions & 0 deletions
42
packages/fuselage/src/components/Sidebar/TopBar.stories.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,42 @@ | ||
import { Meta, Canvas, Story } from '@storybook/addon-docs/blocks'; | ||
|
||
import { Avatar } from '../..'; | ||
import TopBar from './TopBar'; | ||
|
||
<Meta title='Sidebar/TopBar' parameters={{ jest: ['Sidebar/spec'] }} /> | ||
|
||
# Sidebar.Topbar | ||
|
||
Sidebar TopBar and ToolBox. | ||
|
||
<Canvas> | ||
<Story name='Default'> | ||
<TopBar.Section> | ||
<Avatar size={TopBar.Avatar.size} url={'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoACgDASIAAhEBAxEB/8QAGwAAAgIDAQAAAAAAAAAAAAAAAAcEBgIDBQj/xAAuEAACAQQAAwcEAQUAAAAAAAABAgMABAUREiExBhMUIkFRYQcWcYGhFTJSgpH/xAAYAQADAQEAAAAAAAAAAAAAAAACAwQBAP/EAB4RAAIBBQEBAQAAAAAAAAAAAAABAgMREiExE0HR/9oADAMBAAIRAxEAPwBuXuIkhBuMe5ib/AHQP49q4L3mLitryTLTSpOiHQI5k/HzXa/qbFOEudVTu1dumWvcTaNCZYZ7vU6g6LxqjOU/24dfs1Ouh9FnkMpd3Reeyx83hAxZZEhkdV9/MBrX71WGPvJcqrJBGveKATtuXXqNU0pu02bTHXD/AGvJAluyxxRd6F4x00o+NdKoVrjbzJdvVe1t5cVLc2ck8qjnohgpPtz2v7G6JtPQ2VJwjlcw+37mchpnK6GtIuv5NFWeTsLNPvxWTvpfjvOEfwKKzEVkSct2vscS/BIzSN0YRkeX81UpPqO8masJETu7OOccY4dswYFQeftv096XV5knuJGdm2T1+agvMXj8jEaHX905QihabvcbuS7X566mLWLwSY8PuRnk/u4eZ0deTl71Ef6hY+0yM88TzeNZY4luYwpVYyduOfrvhPTnr0pXSX9y5mCsyJMdyxxvwq599em+taItqCSNc90ChvZRUruUcT0JiO18Elpk7t8v41LWzacxkBSuvjQ/FFJayjDWrCTepAQ2vUH0oo/Jk3ovpwJJeVCP5CN+lFFaaMqy+nAyuChvrTI2kN9JAsi2ZOy4IBHMnkSCP+iqBexSWdxLazoUljJVlPUH2oorkV10pRc7b1zXb/hZOzuJvM86QWEXeELxOzHSIPcmiiiunVlF2RNTpRkrs//Z'} {...Avatar } /> | ||
<TopBar.Actions> | ||
<TopBar.Action icon='home'/> | ||
<TopBar.Action icon='magnifier'/> | ||
<TopBar.Action icon='globe'/> | ||
<TopBar.Action icon='sort'/> | ||
<TopBar.Action icon='edit-rounded'/> | ||
</TopBar.Actions> | ||
</TopBar.Section> | ||
<TopBar.ToolBox> | ||
<TopBar.Title>Title</TopBar.Title> | ||
<TopBar.Actions> | ||
<TopBar.Action success icon='phone'/> | ||
<TopBar.Action icon='message-disabled'/> | ||
</TopBar.Actions> | ||
</TopBar.ToolBox> | ||
<TopBar.ToolBox> | ||
<TopBar.Title>Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title Long Title</TopBar.Title> | ||
<TopBar.Actions> | ||
<TopBar.Action icon='dialpad'/> | ||
<TopBar.Action success icon='phone'/> | ||
<TopBar.Action danger icon='phone-off'/> | ||
<TopBar.Action icon='message'/> | ||
<TopBar.Action icon='contact'/> | ||
</TopBar.Actions> | ||
</TopBar.ToolBox> | ||
</Story> | ||
</Canvas> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class should be nested within its parent Class