Skip to content

Commit 8f1a406

Browse files
committed
remove config options for skip nav, update package so SB can read the TSdocs
1 parent 978ac1b commit 8f1a406

4 files changed

Lines changed: 12 additions & 17 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
"npm-run-all": "4.1.5",
102102
"postcss": "8.5.6",
103103
"prettier": "3.8.1",
104+
"react-docgen-typescript": "^2.4.0",
104105
"rollup-plugin-jsx-remove-attributes": "^3.1.2",
105106
"sass": "^1.97.3",
106107
"start-server-and-test": "2.1.3",

src/components/SkipNav/SkipNav.stories.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
22
import { SkipNav } from '~/src/index';
33

44
const meta: Meta<typeof SkipNav> = {
5-
title: 'Components (Draft)/SkipNav',
5+
title: 'Components (Draft)/Skip Navigation',
66
tags: ['autodocs'],
77
component: SkipNav,
88
argTypes: {}
@@ -13,18 +13,8 @@ export default meta;
1313
type Story = StoryObj<typeof meta>;
1414

1515
export const Default: Story = {
16-
name: 'SkipNav',
1716
render: properties => <SkipNav {...properties} />,
1817
args: {
19-
href: '#main',
20-
text: 'Skip to main content'
21-
}
22-
};
23-
24-
export const CustomText: Story = {
25-
render: properties => <SkipNav {...properties} />,
26-
args: {
27-
href: '#content',
28-
text: 'Skip to content'
18+
href: '#main'
2919
}
3020
};

src/components/SkipNav/SkipNav.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Link } from '~/src';
44

55
export interface SkipNavProperties {
66
href?: string;
7-
text?: string;
87
}
98

109
/**
@@ -15,12 +14,16 @@ export interface SkipNavProperties {
1514
* efficiency.
1615
*/
1716
export default function SkipNav({
18-
href = '#main',
19-
text = 'Skip to main content'
17+
href = '#main'
2018
}: SkipNavProperties): JSXElement {
2119
return (
2220
<div className='skip-nav'>
23-
<Link href={href} label={text} className={'skip-nav__link'} asButton />
21+
<Link
22+
href={href}
23+
label={'Skip to main content'}
24+
className={'skip-nav__link'}
25+
asButton
26+
/>
2427
</div>
2528
);
2629
}

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ __metadata:
12831283
postcss: "npm:8.5.6"
12841284
prettier: "npm:3.8.1"
12851285
react: "npm:19.2.4"
1286+
react-docgen-typescript: "npm:^2.4.0"
12861287
react-dom: "npm:19.2.4"
12871288
react-router-dom: "npm:^7.13.0"
12881289
react-select: "npm:^5.10.2"
@@ -9062,7 +9063,7 @@ __metadata:
90629063
languageName: node
90639064
linkType: hard
90649065

9065-
"react-docgen-typescript@npm:^2.2.2":
9066+
"react-docgen-typescript@npm:^2.2.2, react-docgen-typescript@npm:^2.4.0":
90669067
version: 2.4.0
90679068
resolution: "react-docgen-typescript@npm:2.4.0"
90689069
peerDependencies:

0 commit comments

Comments
 (0)