chore: v11 Toggle

This removes legacy `ToggleSkeleton`.
This commit is contained in:
Gregor Wassmann 2023-03-27 23:59:15 +02:00 committed by Enrico Sacchetti
commit 9a0a790e19
No known key found for this signature in database
GPG key ID: 3374B89ECA60D796
10 changed files with 60 additions and 199 deletions

View file

@ -1,5 +1,5 @@
{
"total": 165,
"total": 164,
"components": [
{
"moduleName": "Accordion",
@ -13619,8 +13619,8 @@
"name": "size",
"kind": "let",
"description": "Specify the toggle size",
"type": "\"default\" | \"sm\"",
"value": "\"default\"",
"type": "\"md\" | \"sm\"",
"value": "\"md\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -13725,18 +13725,6 @@
],
"moduleExports": [],
"slots": [
{
"name": "labelA",
"default": false,
"fallback": "{labelA}",
"slot_props": "{}"
},
{
"name": "labelB",
"default": false,
"fallback": "{labelB}",
"slot_props": "{}"
},
{
"name": "labelText",
"default": false,
@ -13762,65 +13750,6 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
{
"moduleName": "ToggleSkeleton",
"filePath": "src/Toggle/ToggleSkeleton.svelte",
"props": [
{
"name": "size",
"kind": "let",
"description": "Specify the toggle size",
"type": "\"default\" | \"sm\"",
"value": "\"default\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "labelText",
"kind": "let",
"description": "Specify the label text",
"type": "string",
"value": "\"\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "id",
"kind": "let",
"description": "Set an id for the input element",
"type": "string",
"value": "\"ccs-\" + Math.random().toString(36)",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
}
],
"moduleExports": [],
"slots": [
{
"name": "labelText",
"default": false,
"fallback": "{labelText}",
"slot_props": "{}"
}
],
"events": [
{ "type": "forwarded", "name": "click", "element": "div" },
{ "type": "forwarded", "name": "mouseover", "element": "div" },
{ "type": "forwarded", "name": "mouseenter", "element": "div" },
{ "type": "forwarded", "name": "mouseleave", "element": "div" }
],
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
{
"moduleName": "Toolbar",
"filePath": "src/DataTable/Toolbar.svelte",

View file

@ -1,9 +1,9 @@
---
components: ["Toggle", "ToggleSkeleton"]
components: ["Toggle"]
---
<script>
import { Toggle, ToggleSkeleton } from "carbon-components-svelte";
import { Toggle } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>
@ -33,15 +33,6 @@ Set `hideLabel` to `true` to visually hide the label text. It's recommended to s
<Toggle labelText="Push notifications" labelA="No" labelB="Yes" />
## Slottable labels
An alternative to the "labelA" and "labelB" props is to use the corresponding named slots.
<Toggle labelText="Push notifications">
<span slot="labelA" style="color: red">No</span>
<span slot="labelB" style="color: green">Yes</span>
</Toggle>
## Disabled
<Toggle labelText="Push notifications" disabled />
@ -49,11 +40,3 @@ An alternative to the "labelA" and "labelB" props is to use the corresponding na
## Small size
<Toggle size="sm" labelText="Push notifications" />
## Skeleton
<ToggleSkeleton />
## Skeleton (small)
<ToggleSkeleton size="sm" />