-
Notifications
You must be signed in to change notification settings - Fork 41
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
Rogin Farrer
authored and
Rogin Farrer
committed
Mar 16, 2020
1 parent
033f8cf
commit 9323891
Showing
11 changed files
with
1,747 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
module.exports = { | ||
stories: ['../stories/**/*.stories.(ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-a11y', | ||
'@storybook/addon-storysource', | ||
], | ||
webpackFinal: async config => { | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: require.resolve('ts-loader'), | ||
options: { | ||
transpileOnly: true, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('react-docgen-typescript-loader'), | ||
}, | ||
], | ||
}); | ||
|
||
config.resolve.extensions.push('.ts', '.tsx'); | ||
|
||
return config; | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
import React from 'react'; | ||
import useCollapse from '../src'; | ||
import { Toggle, Collapse } from './components'; | ||
|
||
export const Div = () => { | ||
const { getCollapseProps, getToggleProps, isOpen } = useCollapse({ | ||
defaultOpen: true, | ||
}); | ||
|
||
return ( | ||
<div> | ||
<Toggle as="div" {...getToggleProps()}> | ||
{isOpen ? 'Close' : 'Open'} | ||
</Toggle> | ||
<Collapse {...getCollapseProps()}> | ||
In the morning I walked down the Boulevard to the rue Soufflot for | ||
coffee and brioche. It was a fine morning. The horse-chestnut trees in | ||
the Luxembourg gardens were in bloom. There was the pleasant | ||
early-morning feeling of a hot day. I read the papers with the coffee | ||
and then smoked a cigarette. The flower-women were coming up from the | ||
market and arranging their daily stock. Students went by going up to the | ||
law school, or down to the Sorbonne. The Boulevard was busy with trams | ||
and people going to work. | ||
</Collapse> | ||
</div> | ||
); | ||
}; |
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,9 +1,13 @@ | ||
import { withA11y } from '@storybook/addon-a11y'; | ||
|
||
export default { | ||
title: 'React-Collapsed', | ||
decorators: [withA11y], | ||
}; | ||
|
||
export { Uncontrolled } from './uncontrolled'; | ||
export { Controlled } from './controlled'; | ||
export { Nested } from './nested'; | ||
export { CustomTransition } from './custom-transition-styles'; | ||
export { Unmount } from './unmount'; | ||
export { Div } from './div'; |
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.