Alignment with Carbon version 10.31 (#571)

* chore(deps-dev): upgrade carbon-components to v10.31.0

* fix(slider): use CSS to hide input if hideTextInput is true

* docs(slider): add hidden text input, invalid, disabled examples

* feat(tabs): support "container" type for TabsSkeleton

* chore(list-box): remove hotfix inline style to center dropdown chevron

* fix(number-input): use add, subtract icons and update markup

* feat(select): add warning state

* docs(select): add invalid state example

* docs(select): add helper text example

* fix(structured-list): add "rowgroup" role to StructuredListBody

* docs: release code snippet max-width

* docs(select): add skeleton hidden label example

* feat(popover): add Popover component

* feat(pagination): dispatch button click events to be consistent with PaginationNav

* fix(multi-select): type clear as a custom event

* docs(radio-button): add disabled buttons example

* chore(tabs): use absolute icon import

* fix(link): remove line breaks within anchor link

* docs(radio-button): adjust section copy verbiage

* chore(deps-dev): upgrade carbon-icons-svelte to v10.27

v10.27 uses the SvelteComponentTyped interface

* docs(accordion): adjust section title verbiage

* test(types): fix warnings from svelte-check

* fix(search): only set autofocus attribute if equals true

* feat(popover): add closeOnOutsideClick prop

* docs: style [data-outline] as relative positioned

* feat(context-menu): add initial ContextMenu

* feat(context-menu): annotate props, generate types

* feat(context-menu): add initial focus logic

* fix(context-menu): correctly tab in/out of nested menus

* chore(context-menu): update types

* fix(context-menu): obtain radio id from node directly

* docs(context-menu): add examples and test

* fix(context-menu): prevent default keydown behavior
This commit is contained in:
Eric Liu 2021-03-20 10:39:14 -07:00 committed by GitHub
commit 5fad0cb3c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1758 additions and 103 deletions

View file

@ -19,7 +19,7 @@
import { createEventDispatcher, afterUpdate, setContext } from "svelte";
import { writable, derived } from "svelte/store";
import ChevronDownGlyph from "carbon-icons-svelte/lib/ChevronDownGlyph";
import ChevronDownGlyph from "carbon-icons-svelte/lib/ChevronDownGlyph/ChevronDownGlyph.svelte";
const dispatch = createEventDispatcher();

View file

@ -1,27 +1,31 @@
<script>
/** Specify the number of tabs to render */
export let count = 4;
/**
* Specify the type of tabs
* @type {"default" | "container"}
*/
export let type = "default";
</script>
<div
class:bx--tabs="{true}"
class:bx--skeleton="{true}"
class:bx--tabs--scrollable="{true}"
class:bx--tabs--scrollable--container="{type === 'container'}"
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave
>
<div class:bx--tabs-trigger="{true}">
<div class:bx--tabs-trigger-text="{true}">&nbsp;</div>
<svg width="10" height="5" viewBox="0 0 10 5" fill-rule="evenodd">
<path d="M10 0L5 5 0 0z"></path>
</svg>
</div>
<ul class:bx--tabs__nav="{true}" class:bx--tabs__nav--hidden="{true}">
{#each Array.from({ length: count }, (_, i) => i) as item, i (item)}
<li class:bx--tabs__nav-item="{true}">
<div class:bx--tabs__nav-link="{true}">&nbsp;</div>
<ul class:bx--tabs--scrollable__nav="{true}">
{#each Array.from({ length: count }, (_, i) => i) as item}
<li class:bx--tabs--scrollable__nav-item="{true}">
<div class:bx--tabs__nav-link="{true}">
<span></span>
</div>
</li>
{/each}
</ul>