Merge branch 'master' into recursive-list

This commit is contained in:
Eric Liu 2021-07-05 08:43:23 -07:00 committed by GitHub
commit 5c4f9a50f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 93 additions and 14 deletions

View file

@ -1514,6 +1514,7 @@
"name": "transitionend",
"detail": "{ open: boolean; }"
},
{ "type": "forwarded", "name": "keydown", "element": "div" },
{ "type": "forwarded", "name": "click", "element": "div" },
{ "type": "forwarded", "name": "mouseover", "element": "div" },
{ "type": "forwarded", "name": "mouseenter", "element": "div" },

View file

@ -4,6 +4,7 @@
slots: [],
events: [],
rest_props: undefined,
typedefs: [],
};
import {
@ -17,6 +18,7 @@
UnorderedList,
ListItem,
Tag,
CodeSnippet,
} from "carbon-components-svelte";
import InlineSnippet from "./InlineSnippet.svelte";
import Launch16 from "carbon-icons-svelte/lib/Launch16";
@ -40,7 +42,7 @@
</script>
<p style="margin-bottom: var(--cds-layout-02)">
Component source code:
Source code:
<Link inline size="lg" href="{source}" target="_blank">
{component.filePath}
<Launch16 />
@ -51,9 +53,7 @@
{#if component.props.length > 0}
<div class="overflow">
<StructuredList
style="margin-left: calc(-1 * var(--cds-spacing-05)); margin-right: calc(-1 * var(--cds-spacing-05))"
>
<StructuredList flush condensed>
<StructuredListHead>
<StructuredListRow head>
<StructuredListCell head>Prop name</StructuredListCell>
@ -71,9 +71,11 @@
<InlineSnippet code="{prop.name}" />
{#if prop.reactive}
<div
style="white-space: nowrap; margin-top: var(--cds-spacing-03)"
style="white-space: nowrap; margin-top: var(--cds-spacing-03); margin-bottom: var(--cds-spacing-03)"
>
<Tag type="cyan">Reactive</Tag>
<Tag style="margin-left: 0" size="sm" type="cyan">
Reactive
</Tag>
</div>
{/if}
</StructuredListCell>
@ -133,6 +135,20 @@
{:else}
<p class="my-layout-01-03">No props.</p>
{/if}
<h3 id="typedefs">Typedefs</h3>
{#if component.typedefs.length > 0}
<CodeSnippet
style="margin-top: var(--cds-spacing-08)"
class="my-layout-01-03"
type="multi"
code="{component.typedefs.map((t) => t.ts).join(';\n\n')}"
/>
{:else}
<p class="my-layout-01-03">No typedefs.</p>
{/if}
<h3 id="slots">Slots</h3>
{#if component.slots.length > 0}
<UnorderedList class="my-layout-01-03">

View file

@ -37,7 +37,7 @@
onMount(() => {
const currentTheme = window.location.search.split("?theme=")[1];
if (["white", "g10", "g90", "g100"].includes(currentTheme)) {
if (["white", "g10", "g80", "g90", "g100"].includes(currentTheme)) {
theme.set(currentTheme);
}
});

View file

@ -238,6 +238,9 @@ module.exports = {
<li class="bx--list__item">
<a class="bx--link" href="#props">Props</a>
</li>
<li class="bx--list__item">
<a class="bx--link" href="#typedefs">Typedefs</a>
</li>
<li class="bx--list__item">
<a class="bx--link" href="#slots">Slots</a>
</li>