Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(UIshell): adds story for SkipToContent and removes the tabIndex prop requirement #4875

Merged
merged 5 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/react/src/components/UIShell/SkipToContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SkipToContent = ({

SkipToContent.propTypes = {
/**
* Provide an optional class to be applied to the containing node
* Provide text to display in the SkipToContent `a` tag
*/
children: PropTypes.string.isRequired,

Expand All @@ -42,7 +42,7 @@ SkipToContent.propTypes = {
/**
* Optionally override the default tabindex of 0
*/
tabIndex: PropTypes.string.isRequired,
tabIndex: PropTypes.string,
};

SkipToContent.defaultProps = {
Expand Down
42 changes: 37 additions & 5 deletions packages/react/src/components/UIShell/UIShell-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ const StoryContent = () => {
</h2>
<p style={{ lineHeight: '20px' }}>
The shell is perhaps the most crucial piece of any UI built with
Carbon. It contains the shared navigation framework for the entire
design system and ties the products in IBM’s portfolio together in a
cohesive and elegant way. The shell is the home of the topmost
navigation, where users can quickly and dependably gain their
bearings and move between pages.
<a href="www.carbondesignsystem.com"> Carbon</a>. It contains the
shared navigation framework for the entire design system and ties
the products in IBM’s portfolio together in a cohesive and elegant
way. The shell is the home of the topmost navigation, where users
can quickly and dependably gain their bearings and move between
pages.
<br />
<br />
The shell was designed with maximum flexibility built in, to serve
Expand Down Expand Up @@ -218,6 +219,37 @@ storiesOf('UI Shell', module)
</Header>
))
)
.add(
'Header Base w/ SkipToContent',
withReadme(readme, () => (
<>
<Header aria-label="IBM Platform Name">
<SkipToContent />
<HeaderName href="#" prefix="IBM">
[Platform]
</HeaderName>
<HeaderGlobalBar>
<HeaderGlobalAction
aria-label="Search"
onClick={action('search click')}>
<Search20 />
</HeaderGlobalAction>
<HeaderGlobalAction
aria-label="Notifications"
onClick={action('notification click')}>
<Notification20 />
</HeaderGlobalAction>
<HeaderGlobalAction
aria-label="App Switcher"
onClick={action('app-switcher click')}>
<AppSwitcher20 />
</HeaderGlobalAction>
</HeaderGlobalBar>
</Header>
<StoryContent />
</>
))
)
.add(
'Header Base w/ Navigation and Actions',
withReadme(readme, () => (
Expand Down