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:
Eric Liu 2021-07-05 12:12:28 -07:00 committed by GitHub
commit 921c3e121a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 163 additions and 68 deletions

View file

@ -9,6 +9,7 @@
import {
Link,
OutboundLink,
StructuredList,
StructuredListHead,
StructuredListRow,
@ -43,10 +44,9 @@
<p style="margin-bottom: var(--cds-layout-02)">
Source code:
<Link inline size="lg" href="{source}" target="_blank">
<OutboundLink inline href="{source}">
{component.filePath}
<Launch16 />
</Link>
</OutboundLink>
</p>
<h3 id="props">Props</h3>
@ -94,14 +94,12 @@
Carbon Svelte icon
</TooltipDefinition>
{:else if type.startsWith("HTML")}
<Link
<OutboundLink
href="{mdn_api}{type}"
target="_blank"
style="white-space: nowrap"
>
{type}
<Launch16 />
</Link>
</OutboundLink>
{:else if type in typeMap}
<code>{typeMap[type]}</code>
{:else if type.startsWith("(")}