-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add storybook
- Loading branch information
Showing
32 changed files
with
20,720 additions
and
21,003 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 |
---|---|---|
@@ -1,23 +1,30 @@ | ||
{ | ||
"plugins": [ | ||
"plugins": [ | ||
"@emotion", | ||
"@babel/plugin-proposal-class-properties", | ||
[ | ||
"transform-react-remove-prop-types", | ||
{ | ||
"mode": "remove", | ||
"ignoreFilenames": ["node_modules"] | ||
} | ||
] | ||
], | ||
"presets": [ | ||
"minify", | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"loose": true | ||
} | ||
], | ||
"@babel/preset-react" | ||
] | ||
[ | ||
"@babel/plugin-proposal-class-properties", | ||
{ | ||
"loose": true | ||
} | ||
], | ||
[ | ||
"transform-react-remove-prop-types", | ||
{ | ||
"mode": "remove", | ||
"ignoreFilenames": [ | ||
"node_modules" | ||
] | ||
} | ||
] | ||
], | ||
"presets": [ | ||
"minify", | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"loose": true | ||
} | ||
], | ||
"@babel/preset-react" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"node": "16", | ||
"buildCommand": "build", | ||
"sandboxes": ["react-dropdown-select-nzto7"] | ||
} |
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 @@ | ||
/** @type { import('@storybook/react-webpack5').StorybookConfig } */ | ||
const config = { | ||
stories: ['./stories/*.mdx', './stories/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions' | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {} | ||
}, | ||
docs: { | ||
toc: true, | ||
autodocs: true, | ||
defaultName: 'Documentation', | ||
story: { inline: true } // render the story in an iframe | ||
// source: { type: 'code' } // forces the raw source code (rather than the rendered JSX). | ||
} | ||
}; | ||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- .storybook/preview-body.html --> | ||
|
||
<style> | ||
html, body { | ||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; | ||
} | ||
</style> |
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,29 @@ | ||
import { DocsPage, Canvas } from '@storybook/addon-docs'; | ||
import React from 'react'; | ||
|
||
const preview = { | ||
parameters: { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
controls: { expanded: true }, | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/ | ||
} | ||
} | ||
}, | ||
decorators: [ | ||
(storyFn) => ( | ||
<div | ||
style={{ | ||
height: 200, | ||
width: 400, | ||
margin: '0 auto' | ||
}}> | ||
{storyFn()} | ||
</div> | ||
) | ||
] | ||
}; | ||
|
||
export default preview; |
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,6 @@ | ||
import { Meta } from '@storybook/addon-docs'; | ||
import Changelog from '../CHANGELOG.md'; | ||
|
||
<Meta title="Changelog" /> | ||
|
||
<Changelog /> |
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,24 @@ | ||
import { Canvas, Meta, Controls } from '@storybook/blocks'; | ||
|
||
import * as SelectStories from './Select.stories'; | ||
|
||
<Meta of={SelectStories} /> | ||
|
||
|
||
# Select | ||
|
||
Customisable dropdown select for react | ||
|
||
## Basic | ||
<Canvas of={SelectStories.Basic} /> | ||
|
||
## Multi | ||
|
||
<Canvas of={SelectStories.Multi} /> | ||
|
||
## Props | ||
|
||
_Select_ has the following properties: | ||
|
||
<Controls/> | ||
|
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,26 @@ | ||
import React from 'react'; | ||
import { Select } from '../../src'; | ||
import { optionsBase } from '../../docs/src/options'; | ||
|
||
const options = optionsBase(4); | ||
const baseArgs = { | ||
...Select.defaultProps, | ||
options, | ||
multi: false, | ||
onChange: (values) => console.log(values) | ||
}; | ||
|
||
export default { | ||
title: 'react-dropdown-select', | ||
component: Select, | ||
parameters: { | ||
docs: { | ||
description: { | ||
component: 'Basic select examples' | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export const Basic = { args: baseArgs }; | ||
export const Multi = { args: { ...baseArgs, multi: true } }; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.