mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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
12
src/CopyButton/CopyButton.Story.svelte
Normal file
12
src/CopyButton/CopyButton.Story.svelte
Normal file
|
@ -0,0 +1,12 @@
|
|||
<script>
|
||||
import CopyButton from "./CopyButton.svelte";
|
||||
</script>
|
||||
|
||||
<CopyButton
|
||||
{...$$props}
|
||||
on:click={() => {
|
||||
console.log('click');
|
||||
}}
|
||||
on:animationend={e => {
|
||||
console.log('animation end', e.animationName);
|
||||
}} />
|
19
src/CopyButton/CopyButton.stories.js
Normal file
19
src/CopyButton/CopyButton.stories.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { withKnobs, text, number } from "@storybook/addon-knobs";
|
||||
import Component from "./CopyButton.Story.svelte";
|
||||
|
||||
export default { title: "CopyButton", decorators: [withKnobs] };
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: {
|
||||
feedback: text("The text shown upon clicking (feedback)", "Copied!"),
|
||||
feedbackTimeout: number(
|
||||
"How long the text is shown upon clicking (feedbackTimeout)",
|
||||
2000
|
||||
),
|
||||
iconDescription: text(
|
||||
"Feedback icon description (iconDescription)",
|
||||
"Copy to clipboard"
|
||||
),
|
||||
},
|
||||
});
|
16
src/CopyButton/CopyButton.svelte
Normal file
16
src/CopyButton/CopyButton.svelte
Normal file
|
@ -0,0 +1,16 @@
|
|||
<script>
|
||||
export let iconDescription = "Copy to clipboard";
|
||||
|
||||
import { Copy } from "../Copy";
|
||||
import Copy16 from "carbon-icons-svelte/lib/Copy16";
|
||||
</script>
|
||||
|
||||
<Copy
|
||||
class="bx--copy-btn"
|
||||
aria-label={iconDescription}
|
||||
title={iconDescription}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:animationend>
|
||||
<Copy16 class="bx--snippet__icon" />
|
||||
</Copy>
|
1
src/CopyButton/index.js
Normal file
1
src/CopyButton/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
export { default as CopyButton } from "./CopyButton.svelte";
|
Loading…
Add table
Add a link
Reference in a new issue