-
Notifications
You must be signed in to change notification settings - Fork 6
Description list design system #597
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
This file contains hidden or 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,27 @@ | ||
| .dcx-description-list { | ||
| flex-wrap: wrap; | ||
| color: token('color-text-body'); | ||
| font-family: token('font-family-body'); | ||
| font-size: token('font-size-body'); | ||
| font-weight: token('font-weight-body'); | ||
| margin: 0; | ||
| padding: token('spacing-y-desc_list_box') token('spacing-x-desc_list_box'); | ||
| } | ||
|
|
||
| .dcx-description-term { | ||
| color: token('color-text-paragraph'); | ||
| font-family: token('font-family-paragraph'); | ||
| font-size: token('font-size-paragraph'); | ||
| font-weight: token('font-weight-paragraph'); | ||
| margin: 0; | ||
| padding: token('spacing-y-desc_term_box') token('spacing-x-desc_term_box'); | ||
| } | ||
|
|
||
| .dcx-description-detail { | ||
| color: token('color-text-body'); | ||
| font-family: token('font-family-body'); | ||
| font-size: token('font-size-body'); | ||
| font-weight: token('font-weight-body'); | ||
| margin: 0; | ||
| padding: token('spacing-y-desc_detail_box') token('spacing-x-desc_detail_box'); | ||
| } | ||
This file contains hidden or 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 hidden or 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
67 changes: 67 additions & 0 deletions
67
stories/DescriptionList/design-system/AccessibleTheme.stories.js
This file contains hidden or 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,67 @@ | ||
| /* eslint-disable import/no-webpack-loader-syntax */ | ||
| import { DescriptionList, Term, Detail } from '../../../src/descriptionList'; | ||
| import style from '!raw-loader!../../themes/accessible.theme.css'; | ||
| import { LiveProvider, LiveEditor } from 'react-live'; | ||
| import { StorybookUtils } from '../../../core/storybook/StorybookUtils'; | ||
|
|
||
| /** | ||
| * This a theme aimed at easing the vizualization of the different elements of the component in order to improve the experience for people that have visual impairments. | ||
| */ | ||
| export default { | ||
| title: 'DCXLibrary/Typography/DescriptionList/Design system/Accessible', | ||
| component: DescriptionList, | ||
| decorators: [ | ||
| (getStory) => { | ||
| require('../../../dist/design-system/index.css'); | ||
| require('../../themes/accessible.theme.css'); | ||
| return getStory(); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export const ShowCase = { | ||
| parameters: { | ||
| backgrounds: { | ||
| default: 'light', | ||
| values: [ | ||
| { name: 'dark', value: '#333131' }, | ||
| { name: 'light', value: '#fff' }, | ||
| ], | ||
| }, | ||
| }, | ||
| render: () => ( | ||
| <LiveProvider | ||
| code={StorybookUtils.getThemeCode('dcx-description-list', style)} | ||
| disabled={true} | ||
| language="css" | ||
| > | ||
| <LiveEditor className="liveEditor" aria-label="editor" /> | ||
| </LiveProvider> | ||
| ), | ||
| }; | ||
|
|
||
| export const Default = { | ||
| name: 'Default', | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| args: { | ||
| label: 'Description', | ||
| variant: 'primary', | ||
| children: ( | ||
| <> | ||
| <Term className="myStyle">Coffee</Term> | ||
| <Detail className="myStyle">black hot drink</Detail> | ||
| <Term className="myStyle">Milk</Term> | ||
| <Detail className="myStyle">white cold drink</Detail> | ||
| </> | ||
| ), | ||
| }, | ||
| }; | ||
|
|
69 changes: 69 additions & 0 deletions
69
stories/DescriptionList/design-system/DarkTheme.stories.js
This file contains hidden or 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,69 @@ | ||
| import { List } from '../../../src/list/List'; | ||
| import { DescriptionList, Term, Detail } from '../../../src/descriptionList'; | ||
| import style from '!raw-loader!../../themes/dark.theme.css'; | ||
| import { LiveProvider, LiveEditor } from 'react-live'; | ||
| import { StorybookUtils } from '../../../core/storybook/StorybookUtils'; | ||
|
|
||
| /** | ||
| * This a theme showcases how to customize the component so it can be used on dark backgrounds. | ||
| */ | ||
| export default { | ||
| title: 'DCXLibrary/Typography/DescriptionList/Design system/Dark', | ||
| component: List, | ||
| decorators: [ | ||
| (getStory) => { | ||
| require('../../../dist/design-system/index.css'); | ||
| require('../../themes/dark.theme.css'); | ||
| return getStory(); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export const ShowCase = { | ||
| parameters: { | ||
| backgrounds: { | ||
| default: 'dark', | ||
| values: [ | ||
| { name: 'dark', value: '#282c34' }, | ||
| { name: 'light', value: '#fff' }, | ||
| ], | ||
| }, | ||
| }, | ||
| render: () => ( | ||
| <LiveProvider | ||
| code={StorybookUtils.getThemeCode('dcx-description-list', style)} | ||
| disabled={true} | ||
| language="css" | ||
| > | ||
| <LiveEditor className="liveEditor" aria-label="editor" /> | ||
| </LiveProvider> | ||
| ), | ||
| }; | ||
|
|
||
| export const Default = { | ||
| name: 'Default', | ||
| parameters: { | ||
| backgrounds: { | ||
| default: 'dark', | ||
| values: [ | ||
| { name: 'dark', value: '#282c34' }, | ||
| { name: 'light', value: '#fff' }, | ||
| ], | ||
| }, | ||
| }, | ||
| render: function () { | ||
| return ( | ||
| <DescriptionList> | ||
| <Term className="myStyle">Coffee</Term> | ||
| <Detail className="myStyle">black hot drink</Detail> | ||
| <Term className="myStyle">Milk</Term> | ||
| <Detail className="myStyle">white cold drink</Detail> | ||
| </DescriptionList> | ||
| ); | ||
| }, | ||
| }; |
This file contains hidden or 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,35 @@ | ||
|
|
||
| import { DescriptionList, Term, Detail } from '../../../src/descriptionList'; | ||
|
|
||
| /** | ||
| * Here we display the component in its natural abbreviate, importing only the base Design System styles. | ||
| */ | ||
| export default { | ||
| title: 'DCXLibrary/Typography/DescriptionList/Design system/Default', | ||
| component: DescriptionList, | ||
| decorators: [ | ||
| getStory => { | ||
| require('../../../dist/design-system/index.css'); | ||
| return getStory(); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export const Default = { | ||
| name: 'Default', | ||
| render: function () { | ||
| return ( | ||
| <DescriptionList> | ||
| <Term className="myStyle">Coffee</Term> | ||
| <Detail className="myStyle">black hot drink</Detail> | ||
| <Term className="myStyle">Milk</Term> | ||
| <Detail className="myStyle">white cold drink</Detail> | ||
| </DescriptionList> | ||
| ); | ||
| }, | ||
| }; |
70 changes: 70 additions & 0 deletions
70
stories/DescriptionList/design-system/MaterialTheme.stories.js
This file contains hidden or 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,70 @@ | ||
| import { List } from '../../../src/list/List'; | ||
| import { DescriptionList, Term, Detail } from '../../../src/descriptionList'; | ||
| import style from '!raw-loader!../../themes/dark.theme.css'; | ||
| import { LiveProvider, LiveEditor } from 'react-live'; | ||
| import { StorybookUtils } from '../../../core/storybook/StorybookUtils'; | ||
| // import { ListItem } from '../../../src/list/ListItem'; | ||
|
|
||
| /** | ||
| * This a theme showcases how to customize the component so it can be used on dark backgrounds. | ||
| */ | ||
| export default { | ||
| title: 'DCXLibrary/Typography/DescriptionList/Design system/Material', | ||
| component: List, | ||
| decorators: [ | ||
| (getStory) => { | ||
| require('../../../dist/design-system/index.css'); | ||
| require('../../themes/material.theme.css'); | ||
| return getStory(); | ||
| }, | ||
| ], | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export const ShowCase = { | ||
| parameters: { | ||
| backgrounds: { | ||
| default: 'dark', | ||
| values: [ | ||
| { name: 'dark', value: '#282c34' }, | ||
| { name: 'light', value: '#fff' }, | ||
| ], | ||
| }, | ||
| }, | ||
| render: () => ( | ||
| <LiveProvider | ||
| code={StorybookUtils.getThemeCode('dcx-description-list', style)} | ||
| disabled={true} | ||
| language="css" | ||
| > | ||
| <LiveEditor className="liveEditor" aria-label="editor" /> | ||
| </LiveProvider> | ||
| ), | ||
| }; | ||
|
|
||
| export const Default = { | ||
| name: 'Default', | ||
| parameters: { | ||
| backgrounds: { | ||
| default: 'light', | ||
| values: [ | ||
| { name: 'dark', value: '#282c34' }, | ||
| { name: 'light', value: '#fff' }, | ||
| ], | ||
| }, | ||
| }, | ||
| render: function () { | ||
| return ( | ||
| <DescriptionList> | ||
| <Term className="myStyle">Coffee</Term> | ||
| <Detail className="myStyle">black hot drink</Detail> | ||
| <Term className="myStyle">Milk</Term> | ||
| <Detail className="myStyle">white cold drink</Detail> | ||
| </DescriptionList> | ||
| ); | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
stories/DescriptionList/design-system/Playground.stories.js
This file contains hidden or 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,33 @@ | ||
| /* eslint-disable import/no-webpack-loader-syntax */ | ||
| import style from '!raw-loader!../../../dist/design-system/list.css'; | ||
| import TokensDecorator from '../../../core/storybook/TokensDecorator'; | ||
| import { DescriptionList, Term, Detail } from '../../../src/descriptionList'; | ||
|
|
||
| export default { | ||
| title: 'DCXLibrary/Typography/DescriptionList/Design system', | ||
| component: DescriptionList, | ||
| decorators: [getStory => <TokensDecorator style={style}>{getStory()}</TokensDecorator>,], | ||
|
|
||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| }; | ||
|
|
||
| export const Playground = { | ||
| name: 'Playground', | ||
| parameters: { | ||
| options: { showPanel: true }, | ||
| actions: { disable: true }, | ||
| }, | ||
| render:function () { | ||
| return ( | ||
| <DescriptionList> | ||
| <Term className="myStyle">Coffee</Term> | ||
| <Detail className="myStyle">black hot drink</Detail> | ||
| <Term className="myStyle">Milk</Term> | ||
| <Detail className="myStyle">white cold drink</Detail> | ||
| </DescriptionList> | ||
| ); | ||
| }, | ||
| }; |
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.