mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 03:01:25 +00:00
Remove clipboard-copy dependency from CodeSnippet, CopyButton (#726)
* chore(deps): remove clipboard-copy * feat: add copy prop, use navigator.clipboard API * docs: add clipboard-copy back to docsite for more browser support * docs(component-api): use outbound link * docs: add override/prevent copy examples
This commit is contained in:
parent
6ed4aaa86e
commit
921c3e121a
19 changed files with 163 additions and 68 deletions
|
@ -35,7 +35,9 @@ export function subtract(a: number, b: number) {
|
|||
hideCloseButton
|
||||
/>
|
||||
|
||||
<CodeSnippet>yarn add -D carbon-components-svelte</CodeSnippet>
|
||||
<CodeSnippet copy="{(text) => {}}"
|
||||
>yarn add -D carbon-components-svelte</CodeSnippet
|
||||
>
|
||||
|
||||
<CodeSnippet type="inline">rm -rf node_modules/</CodeSnippet>
|
||||
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
<script lang="ts">
|
||||
import { CopyButton, InlineNotification } from "../types";
|
||||
import { CopyButton } from "../types";
|
||||
</script>
|
||||
|
||||
<InlineNotification
|
||||
svx-ignore
|
||||
lowContrast
|
||||
title="Note:"
|
||||
subtitle="By design, the copy button does not copy text to the clipboard. You will need to write your own logic."
|
||||
kind="info"
|
||||
hideCloseButton
|
||||
<CopyButton
|
||||
text="text"
|
||||
on:click
|
||||
on:copy
|
||||
copy="{(text) => {}}"
|
||||
feedback="Copied to clipboard"
|
||||
/>
|
||||
|
||||
<CopyButton on:click />
|
||||
|
||||
<CopyButton on:click feedback="Copied to clipboard" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue