mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
chore: v11 Tabs
In v11 [Tabs](https://carbondesignsystem.com/migrating/guide/design/#tabs-breaking) received some additional modifiers. In this commit we only want to make sure that the Svelte v10 tabs still work using v11 styles. This probably needs additional testing.
This commit is contained in:
parent
8c7e8882b2
commit
c0aaeb2bb1
9 changed files with 48 additions and 147 deletions
|
@ -30,12 +30,19 @@
|
|||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
||||
<li
|
||||
tabindex="-1"
|
||||
role="presentation"
|
||||
<a
|
||||
bind:this="{ref}"
|
||||
tabindex="{disabled ? '-1' : tabindex}"
|
||||
role="tab"
|
||||
class:bx--tabs__nav-item="{true}"
|
||||
class:bx--tabs__nav-link="{true}"
|
||||
class:bx--tabs__nav-item--disabled="{disabled}"
|
||||
class:bx--tabs__nav-item--selected="{selected}"
|
||||
aria-selected="{selected}"
|
||||
aria-disabled="{disabled}"
|
||||
id="{id}"
|
||||
href="{href}"
|
||||
style="{$useAutoWidth ? 'width: auto' : undefined}"
|
||||
{...$$restProps}
|
||||
on:click|preventDefault
|
||||
on:click|preventDefault="{() => {
|
||||
|
@ -58,17 +65,5 @@
|
|||
}
|
||||
}}"
|
||||
>
|
||||
<a
|
||||
bind:this="{ref}"
|
||||
role="tab"
|
||||
tabindex="{disabled ? '-1' : tabindex}"
|
||||
aria-selected="{selected}"
|
||||
aria-disabled="{disabled}"
|
||||
id="{id}"
|
||||
href="{href}"
|
||||
class:bx--tabs__nav-link="{true}"
|
||||
style:width="{$useAutoWidth ? "auto" : undefined}"
|
||||
>
|
||||
<slot>{label}</slot>
|
||||
</a>
|
||||
</li>
|
||||
<slot>{label}</slot>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue