-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,713 additions
and
63 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,2 @@ | ||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-knobs/register'; |
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,7 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
function loadStories() { | ||
require('../stories'); | ||
} | ||
|
||
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,39 @@ | ||
const path = require('path') | ||
const genDefaultConfig = require('@storybook/react/dist/server/config/defaults/webpack.config.js'); | ||
|
||
module.exports = (baseConfig, env) => { | ||
const config = genDefaultConfig(baseConfig, env); | ||
|
||
config.module.rules = [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
include: [ | ||
path.resolve(__dirname, '../stories'), | ||
path.resolve(__dirname, '../src'), | ||
path.resolve(__dirname, '../node_modules/measure-scrollbar'), | ||
path.resolve(__dirname, '../data'), | ||
], | ||
}, | ||
{ | ||
test: /\.svg$/, | ||
loaders: ['babel-loader?presets[]=react', 'svg-jsx-loader?es6=true'], | ||
include: [ | ||
path.resolve(__dirname, '../src/svgs'), | ||
], | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ 'style-loader', 'css-loader' ], | ||
include: [ | ||
path.resolve(__dirname, '../css'), | ||
], | ||
}, | ||
]; | ||
|
||
config.devtool.sourcemaps = { | ||
enabled: false, | ||
}; | ||
|
||
return config; | ||
}; |
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,36 @@ | ||
import React from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { withKnobs, text, boolean, number } from '@storybook/addon-knobs'; | ||
|
||
import { Picker, Emoji } from '../src'; | ||
import '../css/emoji-mart.css'; | ||
|
||
storiesOf('Picker', module) | ||
.addDecorator(withKnobs) | ||
.add('default', () => ( | ||
<Picker | ||
onClick={action('clicked')} | ||
set={text('Emoji pack', 'twitter')} | ||
emojiSize={number('Emoji size', 24)} | ||
perLine={number('Per line', 9)} | ||
native={boolean('Unicode', false)} | ||
title={text('Idle text', 'Your Title Here')} | ||
emoji={text('Idle emoji', 'department_store')} | ||
skin={number('Skin tone', 1)} | ||
color={text('Highlight color', '#ae65c5')} | ||
/> | ||
)); | ||
|
||
storiesOf('Emoji', module) | ||
.addDecorator(withKnobs) | ||
.add('default', () => ( | ||
<Emoji | ||
set={text('Emoji pack', 'twitter')} | ||
emoji={text('Emoji', '+1')} | ||
size={number('Emoji size', 64)} | ||
skin={number('Skin tone', 1)} | ||
native={boolean('Unicode', false)} | ||
/> | ||
)); |
Oops, something went wrong.