-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathSkipLink.stories.tsx
More file actions
52 lines (48 loc) · 1.08 KB
/
SkipLink.stories.tsx
File metadata and controls
52 lines (48 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react';
import { SkipLink, Hint } from '../../src';
import { Meta, StoryObj } from '@storybook/react';
const CodeText: React.FC = (props) => (
<span
style={{
fontFamily: 'monospace',
marginLeft: 5,
marginRight: 5,
fontSize: 14,
padding: 3,
borderRadius: 5,
}}
{...props}
/>
);
const meta: Meta<typeof SkipLink> = {
title: 'Components/SkipLink',
component: SkipLink,
argTypes: {
focusTargetRef: { table: { disable: true } },
},
render: (args) => (
<main id="maincontent">
<Hint>
Press
<CodeText>tab</CodeText>
to show the SkipLink
</Hint>
<SkipLink disableDefaultBehaviour={args.disableDefaultBehaviour} />
</main>
),
};
export default meta;
type Story = StoryObj<typeof SkipLink>;
export const Standard: Story = {
args: {
disableDefaultBehaviour: false,
},
argTypes: {
disableDefaultBehaviour: { table: { disable: true } },
},
};
export const SkipLinkWithDefaultBehaviourDisabled: Story = {
args: {
disableDefaultBehaviour: true,
},
};