From ee32859ba29d6e6d4c3bd6b5bac74b6587f97364 Mon Sep 17 00:00:00 2001 From: Gregor Wassmann Date: Mon, 27 Mar 2023 14:40:54 +0200 Subject: [PATCH] chore: v11 ContentSwitcher For better compatibility with existing code bases size `xl` is still supported. --- COMPONENT_INDEX.md | 8 ++++---- docs/src/COMPONENT_API.json | 2 +- docs/src/pages/components/ContentSwitcher.svx | 4 ++-- src/ContentSwitcher/ContentSwitcher.svelte | 4 ++-- tests/ContentSwitcher.test.svelte | 2 +- types/ContentSwitcher/ContentSwitcher.svelte.d.ts | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index efb15a50..d7ec320e 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -756,10 +756,10 @@ None. ### Props -| Prop name | Required | Kind | Reactive | Type | Default value | Description | -| :------------ | :------- | :--------------- | :------- | ----------------------------- | ---------------------- | ----------------------------------------- | -| selectedIndex | No | let | Yes | number | 0 | Set the selected index of the switch item | -| size | No | let | No | "sm" | "xl" | undefined | Specify the size of the content switcher | +| Prop name | Required | Kind | Reactive | Type | Default value | Description | +| :------------ | :------- | :--------------- | :------- | ------------------------------ | ---------------------- | ----------------------------------------- | +| selectedIndex | No | let | Yes | number | 0 | Set the selected index of the switch item | +| size | No | let | No | "sm" | "lg" | undefined | Specify the size of the content switcher | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 5c3cd258..160934f0 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1935,7 +1935,7 @@ "name": "size", "kind": "let", "description": "Specify the size of the content switcher", - "type": "\"sm\" | \"xl\"", + "type": "\"sm\" | \"lg\" ", "isFunction": false, "isFunctionDeclaration": false, "isRequired": false, diff --git a/docs/src/pages/components/ContentSwitcher.svx b/docs/src/pages/components/ContentSwitcher.svx index 5c98d9ba..83c3b592 100644 --- a/docs/src/pages/components/ContentSwitcher.svx +++ b/docs/src/pages/components/ContentSwitcher.svx @@ -43,9 +43,9 @@ components: ["ContentSwitcher", "Switch"] -## Extra-large size +## Large size - + diff --git a/src/ContentSwitcher/ContentSwitcher.svelte b/src/ContentSwitcher/ContentSwitcher.svelte index 3cd822e9..8050b753 100644 --- a/src/ContentSwitcher/ContentSwitcher.svelte +++ b/src/ContentSwitcher/ContentSwitcher.svelte @@ -8,7 +8,7 @@ /** * Specify the size of the content switcher - * @type {"sm" | "xl"} + * @type {"sm" | "lg" } */ export let size = undefined; @@ -63,7 +63,7 @@ role="tablist" class:bx--content-switcher="{true}" class:bx--content-switcher--sm="{size === 'sm'}" - class:bx--content-switcher--xl="{size === 'xl'}" + class:bx--content-switcher--lg="{size === 'lg' || size === 'xl'}" {...$$restProps} on:click on:mouseover diff --git a/tests/ContentSwitcher.test.svelte b/tests/ContentSwitcher.test.svelte index 69c00a06..dc0451ed 100644 --- a/tests/ContentSwitcher.test.svelte +++ b/tests/ContentSwitcher.test.svelte @@ -3,7 +3,7 @@ import Analytics from "carbon-icons-svelte/lib/Analytics.svelte"; - + diff --git a/types/ContentSwitcher/ContentSwitcher.svelte.d.ts b/types/ContentSwitcher/ContentSwitcher.svelte.d.ts index 9e7920d2..b6b3ac96 100644 --- a/types/ContentSwitcher/ContentSwitcher.svelte.d.ts +++ b/types/ContentSwitcher/ContentSwitcher.svelte.d.ts @@ -14,7 +14,7 @@ export interface ContentSwitcherProps extends RestProps { * Specify the size of the content switcher * @default undefined */ - size?: "sm" | "xl"; + size?: "sm" | "lg"; [key: `data-${string}`]: any; }