diff --git a/code/addons/links/template/stories/decorator.stories.ts b/code/addons/links/template/stories/decorator.stories.ts
index 218833a75800..53a05f380e74 100644
--- a/code/addons/links/template/stories/decorator.stories.ts
+++ b/code/addons/links/template/stories/decorator.stories.ts
@@ -9,29 +9,44 @@ export default {
decorators: [withLinks],
};
-export const Basic = {
+export const Target = {
args: {
content: `
-
go to other
+ This is just a story to target with the links
`,
},
+ parameters: {
+ chromatic: { disable: true },
+ },
};
-export const Other = {
+
+export const KindAndStory = {
args: {
content: `
`,
},
};
-export const Third = {
+
+export const StoryOnly = {
+ args: {
+ content: `
+
+ `,
+ },
+};
+
+export const KindOnly = {
args: {
content: `
`,
},
diff --git a/code/addons/links/template/stories/hrefto.stories.ts b/code/addons/links/template/stories/hrefto.stories.ts
new file mode 100644
index 000000000000..d58844b305bd
--- /dev/null
+++ b/code/addons/links/template/stories/hrefto.stories.ts
@@ -0,0 +1,22 @@
+import { hrefTo } from '@storybook/addon-links';
+
+export default {
+ component: globalThis.Components.Html,
+ title: 'hrefTo',
+ parameters: {
+ chromatic: { disable: true },
+ },
+ args: {
+ content: 'Waiting for hrefTo to resolve...
',
+ },
+};
+
+export const Default = {
+ play: async () => {
+ const href = await hrefTo('addons-links-hrefto', 'target');
+ const content = document.querySelector('#content');
+ if (content) {
+ content.textContent = href;
+ }
+ },
+};
diff --git a/code/addons/links/template/stories/linkto.stories.ts b/code/addons/links/template/stories/linkto.stories.ts
index bdc752c2ae17..502509a8d5aa 100644
--- a/code/addons/links/template/stories/linkto.stories.ts
+++ b/code/addons/links/template/stories/linkto.stories.ts
@@ -3,6 +3,7 @@ import { linkTo } from '@storybook/addon-links';
export default {
component: globalThis.Components.Button,
+ title: 'linkTo',
args: {
label: 'Click Me!',
},
@@ -11,34 +12,69 @@ export default {
},
};
-export const ID = {
+export const Target = {
args: {
- onClick: linkTo('addons-links-parameters--basic'),
+ label: 'This is just a story to target with the links',
+ },
+ parameters: {
+ chromatic: { disable: true },
},
};
-export const Title = {
+
+export const Id = {
args: {
- onClick: linkTo('addons-links-parameters'),
+ onClick: linkTo('addons-links-linkto--target'),
+ label: 'addons-links-linkto--target',
},
};
-export const Basic = {
+
+export const TitleOnly = {
args: {
- onClick: linkTo('addons-links-parameters', 'basic'),
+ onClick: linkTo('addons/links/linkTo'),
+ label: 'addons/links/linkTo',
},
};
-export const Other = {
+
+export const NormalizedTitleOnly = {
args: {
- onClick: linkTo('addons-links-parameters', 'basic'),
+ onClick: linkTo('addons-links-linkto'),
+ label: 'addons-links-linkto',
},
};
-export const Third = {
+
+export const TitleAndName = {
args: {
- onClick: linkTo('addons-links-parameters', 'other'),
+ onClick: linkTo('addons/links/linkTo', 'Target'),
+ label: 'addons/links/linkTo, Target',
+ },
+};
+
+export const NormalizedTitleAndName = {
+ args: {
+ onClick: linkTo('addons-links-linkto', 'target'),
+ label: 'addons-links-linkto, target',
},
};
export const Callback = {
args: {
- onClick: linkTo('addons-links-parameters', (event: Event) => 'basic'),
+ onClick: linkTo(
+ (event: Event) => 'addons-links-linkto',
+ (event: Event) => 'target'
+ ),
+ },
+};
+
+export const ToMDXDocs = {
+ args: {
+ onClick: linkTo('Configure Your Project'),
+ label: 'Configure Your Project',
+ },
+};
+
+export const ToAutodocs = {
+ args: {
+ onClick: linkTo('Example Button', 'Docs'),
+ label: 'Example Button, Docs',
},
};
diff --git a/code/addons/links/template/stories/scroll.stories.ts b/code/addons/links/template/stories/scroll.stories.ts
deleted file mode 100644
index a7d6a3937763..000000000000
--- a/code/addons/links/template/stories/scroll.stories.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { global as globalThis } from '@storybook/global';
-import { withLinks } from '@storybook/addon-links';
-
-export default {
- component: globalThis.Components.Html,
- parameters: {
- chromatic: { disable: true },
- },
- decorators: [withLinks],
-};
-
-export const Basic = {
- args: {
- content: `
-
- `,
- },
-};
-export const Other = {
- args: {
- content: `
-
- `,
- },
-};
-export const Third = {
- args: {
- content: `
-
- `,
- },
-};