-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12707 from storybookjs/12702-instant-on-manager
UI: Instant-on manager
- Loading branch information
Showing
34 changed files
with
769 additions
and
391 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
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
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 |
---|---|---|
@@ -1,33 +1,44 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { Loader } from './Loader'; | ||
import { PureLoader as Loader } from './Loader'; | ||
|
||
storiesOf('Basics/Loader', module) | ||
.addDecorator((storyFn) => ( | ||
<div | ||
const withBackground = (storyFn) => ( | ||
<div | ||
style={{ | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
width: '100vw', | ||
height: '100vh', | ||
background: | ||
'linear-gradient(to right, rgba(56,56,56,1) 0%, rgba(0,0,0,1) 50%, rgba(255,255,255,1) 50%, rgba(224,224,224,1) 100%)', | ||
}} | ||
> | ||
<span | ||
style={{ | ||
position: 'fixed', | ||
top: 0, | ||
position: 'absolute', | ||
top: '50%', | ||
left: 0, | ||
height: '50vh', | ||
width: '100vw', | ||
height: '100vh', | ||
background: | ||
'linear-gradient(to right, rgba(56,56,56,1) 0%, rgba(0,0,0,1) 50%, rgba(255,255,255,1) 50%, rgba(224,224,224,1) 100%)', | ||
background: 'linear-gradient(to right, red 0%, orangered 50%, blue 50%, deepskyblue 100%)', | ||
}} | ||
> | ||
<span | ||
style={{ | ||
position: 'absolute', | ||
top: '50%', | ||
left: 0, | ||
height: '50vh', | ||
width: '100vw', | ||
background: | ||
'linear-gradient(to right, red 0%, orangered 50%, blue 50%, deepskyblue 100%)', | ||
}} | ||
/> | ||
{storyFn()} | ||
</div> | ||
)) | ||
.add('infinite state', () => <Loader role="progressbar" />) | ||
.add('size adjusted', () => <Loader size={64} role="progressbar" />); | ||
/> | ||
{storyFn()} | ||
</div> | ||
); | ||
|
||
export default { | ||
title: 'Basics/Loader', | ||
}; | ||
|
||
export const InfiniteState = () => <Loader role="progressbar" />; | ||
InfiniteState.decorators = [withBackground]; | ||
|
||
export const SizeAdjusted = () => <Loader size={64} role="progressbar" />; | ||
SizeAdjusted.decorators = [withBackground]; | ||
|
||
export const ProgressBar = () => ( | ||
<Loader progress={{ value: 0.3, message: 'Building', modules: { complete: 500, total: 1337 } }} /> | ||
); | ||
|
||
export const ProgressError = () => <Loader error={new Error('Connection closed')} />; |
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
Oops, something went wrong.