-
Notifications
You must be signed in to change notification settings - Fork 90
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 #2240 from samyak3009/feat-selection-card-states
feat(selectionCard): update states and spacing in selection card
- Loading branch information
Showing
9 changed files
with
183 additions
and
42 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
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
76 changes: 76 additions & 0 deletions
76
core/components/atoms/selectionCard/__stories__/state.story.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,76 @@ | ||
import * as React from 'react'; | ||
import { SelectionCard, Row, Column, Icon, Text } from '@/index'; | ||
|
||
// CSF format story | ||
|
||
export const state = () => { | ||
const cardConfigs = [ | ||
{ label: 'Default:', props: {} }, | ||
{ label: 'Disabled:', props: { disabled: true } }, | ||
{ label: 'Selected:', props: { selected: true } }, | ||
{ label: 'Selected and disabled:', props: { disabled: true, selected: true } }, | ||
]; | ||
|
||
return ( | ||
<Row> | ||
{cardConfigs.map((config, index) => ( | ||
<Column key={index} size={6}> | ||
<Text weight="strong">{config.label}</Text> | ||
<SelectionCard className="p-6 d-flex mt-6 mb-8 mr-6" {...config.props}> | ||
<Icon size={20} name="adjust" /> | ||
<div className="ml-5"> | ||
<Text weight="strong">Manual drop on SFTP disk</Text> | ||
<br /> | ||
<Text className="pt-2" appearance="subtle"> | ||
Give access to a separate SFTP disk image | ||
</Text> | ||
</div> | ||
</SelectionCard> | ||
</Column> | ||
))} | ||
</Row> | ||
); | ||
}; | ||
|
||
const customCode = `() => { | ||
const cardConfigs = [ | ||
{ label: 'Default:', props: {} }, | ||
{ label: 'Disabled:', props: { disabled: true } }, | ||
{ label: 'Selected:', props: { selected: true } }, | ||
{ label: 'Selected and disabled:', props: { disabled: true, selected: true } }, | ||
]; | ||
return ( | ||
<Row> | ||
{cardConfigs.map((config, index) => ( | ||
<Column key={index} size={6}> | ||
<Text weight="strong">{config.label}</Text> | ||
<SelectionCard className="p-6 d-flex mt-6 mb-8 mr-6" {...config.props}> | ||
<Icon size={20} name="adjust" /> | ||
<div className="ml-5"> | ||
<Text weight="strong">Manual drop on SFTP disk</Text> | ||
<br /> | ||
<Text className="pt-2" appearance="subtle"> | ||
Give access to a separate SFTP disk image | ||
</Text> | ||
</div> | ||
</SelectionCard> | ||
</Column> | ||
))} | ||
</Row> | ||
); | ||
}`; | ||
|
||
export default { | ||
title: 'Components/Interactive Card/Selection Card/State', | ||
component: SelectionCard, | ||
parameters: { | ||
docs: { | ||
docPage: { | ||
title: 'SelectionCard', | ||
propDescription: `Note: All the valid properties of HTML DIV elements are acceptable as a prop`, | ||
customCode, | ||
}, | ||
}, | ||
}, | ||
}; |
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
Oops, something went wrong.