Skip to content

Commit 04ed480

Browse files
abbeyhrtjoshblack
authored andcommitted
fix(UIshell): adds story for SkipToContent and removes the tabIndex prop requirement (#4875)
1 parent ed2da5c commit 04ed480

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

packages/react/src/components/UIShell/SkipToContent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const SkipToContent = ({
2929

3030
SkipToContent.propTypes = {
3131
/**
32-
* Provide an optional class to be applied to the containing node
32+
* Provide text to display in the SkipToContent `a` tag
3333
*/
3434
children: PropTypes.string.isRequired,
3535

@@ -42,7 +42,7 @@ SkipToContent.propTypes = {
4242
/**
4343
* Optionally override the default tabindex of 0
4444
*/
45-
tabIndex: PropTypes.string.isRequired,
45+
tabIndex: PropTypes.string,
4646
};
4747

4848
SkipToContent.defaultProps = {

packages/react/src/components/UIShell/UIShell-story.js

+37-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ const StoryContent = () => {
6666
</h2>
6767
<p style={{ lineHeight: '20px' }}>
6868
The shell is perhaps the most crucial piece of any UI built with
69-
Carbon. It contains the shared navigation framework for the entire
70-
design system and ties the products in IBM’s portfolio together in a
71-
cohesive and elegant way. The shell is the home of the topmost
72-
navigation, where users can quickly and dependably gain their
73-
bearings and move between pages.
69+
<a href="www.carbondesignsystem.com"> Carbon</a>. It contains the
70+
shared navigation framework for the entire design system and ties
71+
the products in IBM’s portfolio together in a cohesive and elegant
72+
way. The shell is the home of the topmost navigation, where users
73+
can quickly and dependably gain their bearings and move between
74+
pages.
7475
<br />
7576
<br />
7677
The shell was designed with maximum flexibility built in, to serve
@@ -218,6 +219,37 @@ storiesOf('UI Shell', module)
218219
</Header>
219220
))
220221
)
222+
.add(
223+
'Header Base w/ SkipToContent',
224+
withReadme(readme, () => (
225+
<>
226+
<Header aria-label="IBM Platform Name">
227+
<SkipToContent />
228+
<HeaderName href="#" prefix="IBM">
229+
[Platform]
230+
</HeaderName>
231+
<HeaderGlobalBar>
232+
<HeaderGlobalAction
233+
aria-label="Search"
234+
onClick={action('search click')}>
235+
<Search20 />
236+
</HeaderGlobalAction>
237+
<HeaderGlobalAction
238+
aria-label="Notifications"
239+
onClick={action('notification click')}>
240+
<Notification20 />
241+
</HeaderGlobalAction>
242+
<HeaderGlobalAction
243+
aria-label="App Switcher"
244+
onClick={action('app-switcher click')}>
245+
<AppSwitcher20 />
246+
</HeaderGlobalAction>
247+
</HeaderGlobalBar>
248+
</Header>
249+
<StoryContent />
250+
</>
251+
))
252+
)
221253
.add(
222254
'Header Base w/ Navigation and Actions',
223255
withReadme(readme, () => (

0 commit comments

Comments
 (0)