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:
Gregor Wassmann 2022-11-04 21:00:36 +01:00
commit c0aaeb2bb1
9 changed files with 48 additions and 147 deletions

View file

@ -1,7 +1,7 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["li"];
type RestProps = SvelteHTMLElements["a"];
export interface TabProps extends RestProps {
/**

View file

@ -11,10 +11,10 @@ export interface TabsProps extends RestProps {
selected?: number;
/**
* Specify the type of tabs
* @default "default"
* Set to `true` for tabs to be contained
* @default false
*/
type?: "default" | "container";
contained?: boolean;
/**
* Set to `true` for tabs to have an auto-width
@ -22,27 +22,11 @@ export interface TabsProps extends RestProps {
*/
autoWidth?: boolean;
/**
* Specify the ARIA label for the chevron icon
* @default "Show menu options"
*/
iconDescription?: string;
/**
* Specify the tab trigger href attribute
* @default "#"
*/
triggerHref?: string;
[key: `data-${string}`]: any;
}
export default class Tabs extends SvelteComponentTyped<
TabsProps,
{
keypress: WindowEventMap["keypress"];
click: WindowEventMap["click"];
change: CustomEvent<any>;
},
{ change: CustomEvent<any> },
{ default: {}; content: {} }
> {}