|
| 1 | +import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks'; |
| 2 | +import { Link } from '@ui5/webcomponents-react/lib/Link'; |
| 3 | +import { LinkDesign } from '@ui5/webcomponents-react/lib/LinkDesign'; |
| 4 | +import { CSSProperties, Ref } from 'react'; |
| 5 | + |
| 6 | +import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes'; |
| 7 | +import { DocsHeader } from '@shared/stories/DocsHeader'; |
| 8 | + |
| 9 | +<Meta |
| 10 | + title="UI5 Web Components / Link" |
| 11 | + component={Link} |
| 12 | + argTypes={{ |
| 13 | + ...createSelectArgTypes({ design: LinkDesign }), |
| 14 | + children: { control: 'text' }, |
| 15 | + slot: { control: { disable: true } }, |
| 16 | + ref: { control: { disable: true } }, |
| 17 | + style: { |
| 18 | + type: CSSProperties, |
| 19 | + description: |
| 20 | + 'Element style which will be appended to the most outer element of a component. Use this prop carefully, some css properties might break the component.' |
| 21 | + }, |
| 22 | + className: { |
| 23 | + type: 'string', |
| 24 | + description: |
| 25 | + 'CSS Class Name which will be appended to the most outer element of a component. Use this prop carefully, overwriting CSS rules might break the component.' |
| 26 | + }, |
| 27 | + tooltip: { type: 'string', description: 'A tooltip which will be shown on hover' } |
| 28 | + }} |
| 29 | + args={{ |
| 30 | + design: LinkDesign.Default, |
| 31 | + children: 'Link Text', |
| 32 | + style: {}, |
| 33 | + className: '', |
| 34 | + tooltip: '', |
| 35 | + slot: '', |
| 36 | + ref: null |
| 37 | + }} |
| 38 | +/> |
| 39 | + |
| 40 | +<DocsHeader /> |
| 41 | + |
| 42 | +<Canvas> |
| 43 | + <Story name="Default"> |
| 44 | + {(args) => { |
| 45 | + return <Link {...args} />; |
| 46 | + }} |
| 47 | + </Story> |
| 48 | +</Canvas> |
| 49 | + |
| 50 | +<ArgsTable story="." /> |
| 51 | +<div style={{fontFamily:'var(--sapFontFamily)', fontSize:'var(--sapFontSize)', color:'var(--sapTextColor)'}}> |
| 52 | +<h3>Usage</h3> |
| 53 | + |
| 54 | +You can set the <code>Link</code> to be enabled or disabled. <br /><br /> |
| 55 | +To create a visual hierarchy in large lists of links, you can set the less important links as <code>Subtle</code> or the |
| 56 | +more important ones as <code>Emphasized</code>, by using the <code>design</code> property. <br /><br /> |
| 57 | +If the <code>href</code> property is set, the link behaves as the basic HTML anchor tag and opens the specified URL in |
| 58 | +the given target frame (<code>target</code> property). To specify where the linked content is opened, you can use the |
| 59 | +<code>target</code> property. |
| 60 | +</div> |
0 commit comments