import React from "react"; import Link from "./"; export default { title: "Components/Link", component: Link, parameters: { docs: { description: { component: `It is a link with 2 types: 1. page - simple link which refer to other pages and parts of current page; 2. action - link, which usually hasn't hyperlink and do anything on click - open dropdown, filter data, etc`, }, }, }, argType: { color: { control: "color" }, onClick: { action: "clickActionLink" }, }, }; const Template = ({ label, onClick, href, ...args }) => { const actionProps = href && href.length > 0 ? { href } : { onClick }; return ( {label} ); }; export const Default = Template.bind({}); Default.args = { href: "http://github.com", label: "Simple label", type: "page", fontSize: "13px", fontWeight: "400", isBold: false, target: "_blank", isHovered: false, noHover: false, isSemitransparent: false, isTextOverflow: false, }; const AllTemplate = (args) => { const rowStyle = { marginTop: 8, fontSize: 12 }; const headerStyle = { padding: "8px 0 0 40px", fontSize: 16, }; return (
Page links:
Bold black page link
Black page link
Black hovered page link
Semitransparent black page link
Action links:
Bold black action link
Black action link
Black hovered action link
Semitransparent black action link
); }; export const AllLinks = AllTemplate.bind({});