feat(layer): first pass at Layer component (#1932)

Closes #1892
This commit is contained in:
Sam 2024-03-24 09:30:32 +11:00 committed by Eric Liu
commit 5031d0b40e
9 changed files with 164 additions and 2 deletions

View file

@ -1,5 +1,5 @@
{
"total": 165,
"total": 166,
"components": [
{
"moduleName": "Accordion",
@ -5754,6 +5754,51 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
{
"moduleName": "Layer",
"filePath": "src/Layer/Layer.svelte",
"props": [
{
"name": "level",
"kind": "let",
"description": "Specify the layer level to override any existing levels based on hierarchy.",
"type": "0 | 1 | 2 ",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": true
},
{
"name": "as",
"kind": "let",
"description": "Specify the HTML element to render.",
"type": "string",
"value": "\"div\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "layerProps",
"kind": "let",
"description": "Specify the Layer HTML element props",
"type": "import('svelte/elements').HTMLElementAttributes",
"value": "{}",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
}
],
"moduleExports": [],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [],
"typedefs": []
},
{
"moduleName": "Link",
"filePath": "src/Link/Link.svelte",

View file

@ -0,0 +1,16 @@
<script>
import { Layer } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>
## Default
<Layer>
<p>First layer</p>
<Layer>
<p>Second layer</p>
<Layer>
<p>Third layer</p>
</Layer>
</Layer>
</Layer>