mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: lift components folder
This commit is contained in:
parent
76df51674d
commit
2200b29b92
301 changed files with 57 additions and 76 deletions
14
src/FormLabel/FormLabel.Story.svelte
Normal file
14
src/FormLabel/FormLabel.Story.svelte
Normal 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}
|
8
src/FormLabel/FormLabel.stories.js
Normal file
8
src/FormLabel/FormLabel.stories.js
Normal 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" } });
|
14
src/FormLabel/FormLabel.svelte
Normal file
14
src/FormLabel/FormLabel.svelte
Normal 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
1
src/FormLabel/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
export { default as FormLabel } from "./FormLabel.svelte";
|
Loading…
Add table
Add a link
Reference in a new issue