-
-
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 #25636 from storybookjs/version-non-patch-from-8.0…
….0-alpha.11 Release: Prerelease 8.0.0-alpha.12
- Loading branch information
Showing
202 changed files
with
1,540 additions
and
1,093 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
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,99 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Link } from '@storybook/components'; | ||
import { DocumentIcon, VideoIcon } from '@storybook/icons'; | ||
import { Consumer, useStorybookApi } from '@storybook/manager-api'; | ||
import { styled } from '@storybook/theming'; | ||
|
||
import { DOCUMENTATION_LINK, TUTORIAL_VIDEO_LINK } from '../constants'; | ||
|
||
const Wrapper = styled.div(({ theme }) => ({ | ||
height: '100%', | ||
display: 'flex', | ||
padding: 0, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
flexDirection: 'column', | ||
gap: 15, | ||
background: theme.background.content, | ||
})); | ||
|
||
const Content = styled.div({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: 4, | ||
maxWidth: 415, | ||
}); | ||
|
||
const Title = styled.div(({ theme }) => ({ | ||
fontWeight: theme.typography.weight.bold, | ||
fontSize: theme.typography.size.s2 - 1, | ||
textAlign: 'center', | ||
color: theme.textColor, | ||
})); | ||
|
||
const Description = styled.div(({ theme }) => ({ | ||
fontWeight: theme.typography.weight.regular, | ||
fontSize: theme.typography.size.s2 - 1, | ||
textAlign: 'center', | ||
color: theme.textMutedColor, | ||
})); | ||
|
||
const Links = styled.div(({ theme }) => ({ | ||
display: 'flex', | ||
fontSize: theme.typography.size.s2 - 1, | ||
gap: 25, | ||
})); | ||
|
||
const Divider = styled.div(({ theme }) => ({ | ||
width: 1, | ||
height: 16, | ||
backgroundColor: theme.appBorderColor, | ||
})); | ||
|
||
export const Empty = () => { | ||
const [isLoading, setIsLoading] = useState(true); | ||
const api = useStorybookApi(); | ||
const docsUrl = api.getDocsUrl({ | ||
subpath: DOCUMENTATION_LINK, | ||
versioned: true, | ||
renderer: true, | ||
}); | ||
|
||
// We are adding a small delay to avoid flickering when the story is loading. | ||
// It takes a bit of time for the controls to appear, so we don't want | ||
// to show the empty state for a split second. | ||
useEffect(() => { | ||
const load = setTimeout(() => { | ||
setIsLoading(false); | ||
}, 100); | ||
|
||
return () => clearTimeout(load); | ||
}, []); | ||
|
||
if (isLoading) return null; | ||
|
||
return ( | ||
<Wrapper> | ||
<Content> | ||
<Title>Interaction testing</Title> | ||
<Description> | ||
Interaction tests allow you to verify the functional aspects of UIs. Write a play function | ||
for your story and you'll see it run here. | ||
</Description> | ||
</Content> | ||
<Links> | ||
<Link href={TUTORIAL_VIDEO_LINK} target="_blank" withArrow> | ||
<VideoIcon /> Watch 8m video | ||
</Link> | ||
<Divider /> | ||
<Consumer> | ||
{({ state }) => ( | ||
<Link href={docsUrl} target="_blank" withArrow> | ||
<DocumentIcon /> Read docs | ||
</Link> | ||
)} | ||
</Consumer> | ||
</Links> | ||
</Wrapper> | ||
); | ||
}; |
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,2 +1,5 @@ | ||
export const ADDON_ID = 'storybook/interactions'; | ||
export const PANEL_ID = `${ADDON_ID}/panel`; | ||
|
||
export const TUTORIAL_VIDEO_LINK = 'https://youtu.be/Waht9qq7AoA'; | ||
export const DOCUMENTATION_LINK = 'writing-tests/interaction-testing'; |
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.