This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Add storybook #99
Merged
Merged
Add storybook #99
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f6989bc
Add storybook
d56d212
Move stories to component src
921c1cd
update package json
388410a
update storybook config and examples
0d49ad3
update package.json
c40aea5
update contributors
9dfc9b2
update addon version
466e929
update webpack config
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 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,15 @@ | ||
import React from 'react'; | ||
import Base from 'terra-base'; | ||
import { configure, addDecorator } from '@storybook/react'; | ||
|
||
/* eslint-disable react/jsx-filename-extension */ | ||
addDecorator(story => <Base locale="en-US">{story()}</Base>); | ||
|
||
/* eslint-disable global-require */ | ||
function loadStories() { | ||
require('../packages/terra-consumer-nav/stories/Index.jsx'); | ||
require('../packages/terra-consumer-icon/stories/Index.jsx'); | ||
require('../packages/terra-consumer-layout/stories/Index.jsx'); | ||
} | ||
|
||
configure(loadStories, module); |
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,3 @@ | ||
<script> | ||
document.documentElement.setAttribute("dir", "ltr"); | ||
</script> |
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,45 @@ | ||
const path = require('path'); | ||
const I18nAggregatorPlugin = require('terra-i18n-plugin'); | ||
const i18nSupportedLocales = require('terra-i18n/lib/i18nSupportedLocales'); | ||
const CustomProperties = require('postcss-custom-properties'); | ||
const rtl = require('postcss-rtl'); | ||
|
||
const customProperties = CustomProperties({ preserve: true, warnings: false }); | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.scss$/, | ||
use: [ | ||
'style-loader', | ||
{ | ||
loader: 'css-loader', | ||
options: { importLoaders: 1 }, | ||
}, | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
ident: 'postcss', | ||
plugins: () => [ | ||
customProperties, | ||
rtl(), | ||
], | ||
}, | ||
}, | ||
'sass-loader', | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new I18nAggregatorPlugin({ | ||
baseDirectory: path.resolve(__dirname, '../'), | ||
translationsDirectoryRouters: ['packages'], | ||
supportedLocales: i18nSupportedLocales, | ||
}), | ||
], | ||
resolve: { | ||
modules: [path.resolve(__dirname, '../aggregated-translations'), 'node_modules'], | ||
}, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// This file is autogenerated from scripts/src/generate-example | ||
/* eslint-disable */ | ||
import React from 'react'; | ||
import Table from 'terra-table'; | ||
import IconColorIncentives from '../src/icon/IconColorIncentives'; | ||
import IconColorFootsteps from '../src/icon/IconColorFootsteps'; | ||
import IconColorRunning from '../src/icon/IconColorRunning'; | ||
import IconColorAward49 from '../src/icon/IconColorAward49'; | ||
import IconUiColor1CalendarGrid61 from '../src/icon/IconUiColor1CalendarGrid61'; | ||
import IconColorWeightScale from '../src/icon/IconColorWeightScale'; | ||
import IconColorPeakFlow from '../src/icon/IconColorPeakFlow'; | ||
import IconColorHeartRate from '../src/icon/IconColorHeartRate'; | ||
import IconColorBloodGlucose from '../src/icon/IconColorBloodGlucose'; | ||
import IconColorBloodPressure from '../src/icon/IconColorBloodPressure'; | ||
import IconColorPulseOximetry from '../src/icon/IconColorPulseOximetry'; | ||
const IconAll = () => ( | ||
<div> <Table isStriped={false} > | ||
<Table.Header> | ||
<Table.HeaderCell content={'SVG'} key={'svg'} /> | ||
<Table.HeaderCell content={'Concept'} key={'concept'} /> | ||
<Table.HeaderCell content={'Code'} key={'code'} /> | ||
</Table.Header> | ||
<Table.Rows> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorIncentives height='2em' width='2em' /></td> | ||
<td>color-incentives</td> | ||
<td> | ||
import IconColorIncentives from 'terra-consumer-icon/lib/icon/IconColorIncentives'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorFootsteps height='2em' width='2em' /></td> | ||
<td>color-footsteps</td> | ||
<td> | ||
import IconColorFootsteps from 'terra-consumer-icon/lib/icon/IconColorFootsteps'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorRunning height='2em' width='2em' /></td> | ||
<td>color-running</td> | ||
<td> | ||
import IconColorRunning from 'terra-consumer-icon/lib/icon/IconColorRunning'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorAward49 height='2em' width='2em' /></td> | ||
<td>color_award-49</td> | ||
<td> | ||
import IconColorAward49 from 'terra-consumer-icon/lib/icon/IconColorAward49'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconUiColor1CalendarGrid61 height='2em' width='2em' /></td> | ||
<td>ui-color-1_calendar-grid-61</td> | ||
<td> | ||
import IconUiColor1CalendarGrid61 from 'terra-consumer-icon/lib/icon/IconUiColor1CalendarGrid61'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorWeightScale height='2em' width='2em' /></td> | ||
<td>color-weight-scale</td> | ||
<td> | ||
import IconColorWeightScale from 'terra-consumer-icon/lib/icon/IconColorWeightScale'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorPeakFlow height='2em' width='2em' /></td> | ||
<td>color-peak-flow</td> | ||
<td> | ||
import IconColorPeakFlow from 'terra-consumer-icon/lib/icon/IconColorPeakFlow'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorHeartRate height='2em' width='2em' /></td> | ||
<td>color-heart-rate</td> | ||
<td> | ||
import IconColorHeartRate from 'terra-consumer-icon/lib/icon/IconColorHeartRate'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorBloodGlucose height='2em' width='2em' /></td> | ||
<td>color-blood-glucose</td> | ||
<td> | ||
import IconColorBloodGlucose from 'terra-consumer-icon/lib/icon/IconColorBloodGlucose'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorBloodPressure height='2em' width='2em' /></td> | ||
<td>color-blood-pressure</td> | ||
<td> | ||
import IconColorBloodPressure from 'terra-consumer-icon/lib/icon/IconColorBloodPressure'; | ||
</td> | ||
</tr> | ||
<tr style={{ backgroundColor: '#EEEEEE' }}> | ||
<td><IconColorPulseOximetry height='2em' width='2em' /></td> | ||
<td>color-pulse-oximetry</td> | ||
<td> | ||
import IconColorPulseOximetry from 'terra-consumer-icon/lib/icon/IconColorPulseOximetry'; | ||
</td> | ||
</tr> | ||
</Table.Rows> | ||
</Table> | ||
</div>); | ||
|
||
export default IconAll; |
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.
you can probably just do this in your main decorator
Terra might log a warning, but the attribute will still work even if its not on HTML tag
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.
neat! will update
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.
just found that it doesn't work for popup/modal rendered outside the
Base
tree.NavHelp
looks like this after the change:So we still need to put it in html tag