fix(link): $$restProps should extend p, a HTML attributes (#1233)

* fix(link): restProps should extend `p` or `a` tag attributes

* Run "yarn build:docs"

* test(link): assert anchor link rest attributes
This commit is contained in:
metonym 2022-04-09 11:24:25 -07:00 committed by GitHub
commit 45c272642f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 25 deletions

View file

@ -5347,7 +5347,7 @@
{ "type": "forwarded", "name": "mouseleave", "element": "p" }
],
"typedefs": [],
"rest_props": { "type": "Element", "name": "p" }
"rest_props": { "type": "Element", "name": "p | a" }
},
{
"moduleName": "ListBox",

View file

@ -1,4 +1,6 @@
<script>
/** @restProps {p | a} */
/**
* Specify the size of the link
* @type {"sm" | "lg"}

View file

@ -1,29 +1,9 @@
<script lang="ts">
import { Link } from "../types";
import { Link, OutboundLink } from "../types";
</script>
<Link href="https://www.carbondesignsystem.com/">Carbon Design System</Link>
<Link href="https://www.carbondesignsystem.com/" target="_blank">
<Link size="sm" inline disabled download visited href="/" target="_blank">
Carbon Design System
</Link>
<Link inline href="https://www.carbondesignsystem.com/">
Carbon Design System
</Link>
<Link size="lg" href="https://www.carbondesignsystem.com/">
Carbon Design System
</Link>
<Link size="sm" href="https://www.carbondesignsystem.com/">
Carbon Design System
</Link>
<Link disabled href="https://www.carbondesignsystem.com/">
Carbon Design System
</Link>
<Link visited href="https://www.carbondesignsystem.com/">
Carbon Design System
</Link>
<OutboundLink inline href="https://www.carbondesignsystem.com/" />

View file

@ -2,7 +2,8 @@
import { SvelteComponentTyped } from "svelte";
export interface LinkProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["p"]> {
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["p"]>,
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the size of the link
* @default undefined