feat: initial commit

This commit is contained in:
Eric Liu 2019-12-15 11:20:52 -08:00
commit 72dc38ea56
119 changed files with 14925 additions and 1 deletions

View file

@ -0,0 +1,14 @@
<script>
export let href = undefined;
export let inline = undefined;
export let disabled = undefined;
import Layout from '../../internal/ui/Layout.svelte';
import Link from './Link.svelte';
</script>
<Layout>
<div>
<Link {href} {inline} {disabled}>Link</Link>
</div>
</Layout>

View file

@ -0,0 +1,13 @@
import { withKnobs, boolean, text } from '@storybook/addon-knobs';
import Component from './Link.Story.svelte';
export default { title: 'Link', decorators: [withKnobs] };
export const Default = () => ({
Component,
props: {
href: text('The link href (href)', '#'),
inline: boolean('Use the in-line variant (inline)', false),
disabled: boolean('Disabled (disabled)', false)
}
});

View file

@ -0,0 +1,27 @@
<script>
let className = undefined;
export { className as class };
export let href = undefined;
export let disabled = false;
export let inline = false;
export let props = {};
import { cx } from '../../lib';
const _class = cx(
'--link',
disabled && '--link--disabled',
inline && '--link--inline',
className
);
</script>
{#if disabled}
<p {...props} class={_class}>
<slot />
</p>
{:else}
<a {...props} class={_class} {href}>
<slot />
</a>
{/if}

View file

@ -0,0 +1,3 @@
import Link from './Link.svelte';
export default Link;