Skip to content

Commit

Permalink
docs(link): provide playground with working controls (#11614)
Browse files Browse the repository at this point in the history
* docs(link): provide playground with working controls

* docs(link): clean up unused pieces

Co-authored-by: Josh Black <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 17, 2022
1 parent 1134fde commit 76faa44
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 71 deletions.
68 changes: 0 additions & 68 deletions packages/react/src/components/Link/Link-story.js

This file was deleted.

6 changes: 3 additions & 3 deletions packages/react/src/components/Link/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const Link = React.forwardRef(function Link(
children,
className: customClassName,
href,
disabled,
inline,
visited,
disabled = false,
inline = false,
visited = false,
renderIcon: Icon,
size,
...rest
Expand Down
52 changes: 52 additions & 0 deletions packages/react/src/components/Link/Link.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import { Download } from '@carbon/icons-react';
import Link from './Link';
import mdx from './Link.mdx';

export default {
title: 'Components/Link',
component: Link,
parameters: {
docs: {
page: mdx,
},
},
args: {
disabled: false,
inline: false,
visited: false,
},
argTypes: {
children: {
table: {
disable: true,
},
},
renderIcon: {
table: {
disable: true,
},
},
},
};

export const Default = () => <Link href="#">Link</Link>;

export const PairedWithIcon = () => (
<Link href="#" renderIcon={Download}>
Download
</Link>
);

export const Playground = (args) => (
<Link href="#" {...args}>
Link
</Link>
);

0 comments on commit 76faa44

Please sign in to comment.