chore: lift components folder

This commit is contained in:
Eric Liu 2020-07-19 09:06:08 -07:00
commit 2200b29b92
301 changed files with 57 additions and 76 deletions

View file

@ -0,0 +1,14 @@
<script>
export let story = undefined;
import { Tooltip } from "../Tooltip";
import FormLabel from "./FormLabel.svelte";
</script>
{#if story === 'tooltip'}
<FormLabel>
<Tooltip triggerText="Label">This is the content of the tooltip.</Tooltip>
</FormLabel>
{:else}
<FormLabel>Label</FormLabel>
{/if}

View file

@ -0,0 +1,8 @@
import { withKnobs } from "@storybook/addon-knobs";
import Component from "./FormLabel.Story.svelte";
export default { title: "FormLabel", decorators: [withKnobs] };
export const Default = () => ({ Component });
export const WithTooltip = () => ({ Component, props: { story: "tooltip" } });

View file

@ -0,0 +1,14 @@
<script>
export let id = "ccs-" + Math.random().toString(36);
</script>
<label
class:bx--label={true}
for={id}
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave>
<slot />
</label>

1
src/FormLabel/index.js Normal file
View file

@ -0,0 +1 @@
export { default as FormLabel } from "./FormLabel.svelte";