generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DownLoadLabeledIcon) : add new component
- Loading branch information
Odisseas Simou
committed
Mar 28, 2022
1 parent
c5a383c
commit 6ea2fa1
Showing
2 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
|
||
function DownloadLabeledIcon({ children, ...rest }) { | ||
return <div className='eea download labeled icon'> | ||
{children} | ||
</div> | ||
} | ||
|
||
DownloadLabeledIcon.Label = ({ children, ...rest }) => ( | ||
<div className='label'>{children}</div> | ||
); | ||
|
||
DownloadLabeledIcon.Icon = ({ children, ...rest }) => ( | ||
<div className='icon wrapper'>{children}</div> | ||
); | ||
|
||
DownloadLabeledIcon.Dropdown = ({ children, ...rest }) => ( | ||
<div className='dropdown'>{children}</div> | ||
); | ||
|
||
export default DownloadLabeledIcon; |
51 changes: 51 additions & 0 deletions
51
src/ui/DownloadLabeledIcon/DownloadLabeledIcon.stories.jsx
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,51 @@ | ||
import React from 'react'; | ||
import DownloadLabeledIcon from './DownloadLabeledIcon'; | ||
// eslint-disable-next-line import/no-unresolved | ||
|
||
export default { | ||
title: 'Components/Labeled Icons/Download', | ||
component: DownloadLabeledIcon, | ||
argTypes: { | ||
label: { | ||
description: 'Download Label', | ||
table: { | ||
defaultValue: { summary: '""' }, | ||
type: { summary: 'string' }, | ||
}, | ||
}, | ||
icon: { | ||
description: 'Download Icon', | ||
table: { | ||
defaultValue: { summary: '""' }, | ||
type: { summary: 'string' }, | ||
} | ||
}, | ||
items: { | ||
description: 'array of list content', | ||
table: { | ||
type: { summary: 'object' }, | ||
defaultValue: { summary: ' "" ' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const DefaultTemplate = (args) => ( | ||
<DownloadLabeledIcon {...args}> | ||
<DownloadLabeledIcon.Label>{args.label}</DownloadLabeledIcon.Label> | ||
<DownloadLabeledIcon.Icon>{args.icon}</DownloadLabeledIcon.Icon> | ||
<DownloadLabeledIcon.Dropdown {...args}></DownloadLabeledIcon.Dropdown> | ||
</DownloadLabeledIcon> | ||
); | ||
|
||
export const Default = DefaultTemplate.bind({}); | ||
Default.args = { | ||
title: 'Download', | ||
icon: <i class="ri-download-line"></i>, | ||
|
||
items: [ | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Massa volutpat, feugiat lacus libero morbi dui. Ipsum vestibulum, faucibus aliquam pharetra ullamcorper accumsan. Mauris et blandit magna velit aliquam mattis tristique cursus. Gravida quis porta dictum sed nisl gravida. Dictum sapien purus ultrices leo felis quis.', | ||
'Turpis feugiat felis id imperdiet imperdiet suspendisse. Sed pulvinar nisi, convallis sed non non eu, erat. ', | ||
'Felis malesuada in elementum turpis. Enim, eu adipiscing sit fames ornare amet, suscipit. Neque, faucibus facilisi egestas vitae viverra tristique cum viverra elit. Nunc fermentum bibendum fames ultricies turpis habitant. ', | ||
], | ||
}; |