mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
feat(recursive-list): add RecursiveList
This commit is contained in:
parent
0d3090b123
commit
92301b1d46
10 changed files with 254 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"total": 168,
|
||||
"total": 169,
|
||||
"components": [
|
||||
{
|
||||
"moduleName": "Accordion",
|
||||
|
@ -7864,6 +7864,52 @@
|
|||
"typedefs": [],
|
||||
"rest_props": { "type": "Element", "name": "label" }
|
||||
},
|
||||
{
|
||||
"moduleName": "RecursiveList",
|
||||
"filePath": "src/RecursiveList/RecursiveList.svelte",
|
||||
"props": [
|
||||
{
|
||||
"name": "items",
|
||||
"kind": "let",
|
||||
"description": "Specify the items to render",
|
||||
"type": "Array<Item & { items?: Item[]; }>",
|
||||
"value": "[]",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"kind": "let",
|
||||
"description": "Specify the type of list to render",
|
||||
"type": "\"unordered\" | \"ordered\" | \"ordered-native\"",
|
||||
"value": "\"unordered\"",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "nested",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to use the nested variant",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
}
|
||||
],
|
||||
"slots": [],
|
||||
"events": [],
|
||||
"typedefs": [
|
||||
{
|
||||
"type": "{ text?: string; href?: string; html?: string; }",
|
||||
"name": "Item",
|
||||
"ts": "interface Item { text?: string; href?: string; html?: string; }"
|
||||
}
|
||||
],
|
||||
"rest_props": { "type": "InlineComponent", "name": "svelte:component" }
|
||||
},
|
||||
{
|
||||
"moduleName": "Row",
|
||||
"filePath": "src/Grid/Row.svelte",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import Footer from "../components/Footer.svelte";
|
||||
|
||||
const deprecated = ["ToggleSmall", "Icon"];
|
||||
const new_components = ["ProgressBar"];
|
||||
const new_components = ["ProgressBar", "RecursiveList"];
|
||||
|
||||
let isOpen = false;
|
||||
let isSideNavOpen = true;
|
||||
|
|
78
docs/src/pages/components/RecursiveList.svx
Normal file
78
docs/src/pages/components/RecursiveList.svx
Normal file
|
@ -0,0 +1,78 @@
|
|||
<script>
|
||||
import { RecursiveList } from "carbon-components-svelte";
|
||||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
### Unordered
|
||||
|
||||
<RecursiveList
|
||||
items={[
|
||||
{
|
||||
text: "Item 1",
|
||||
items: [
|
||||
{
|
||||
text: "Link",
|
||||
href: "/",
|
||||
items: [
|
||||
{
|
||||
html: "<h5>Hello world</h5>",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Item 1",
|
||||
}
|
||||
]}
|
||||
/>
|
||||
|
||||
### Ordered
|
||||
|
||||
<RecursiveList
|
||||
type="ordered"
|
||||
items={[
|
||||
{
|
||||
text: "Item 1",
|
||||
items: [
|
||||
{
|
||||
text: "Link",
|
||||
href: "/",
|
||||
items: [
|
||||
{
|
||||
html: "<h5>Hello world</h5>",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Item 1",
|
||||
}
|
||||
]}
|
||||
/>
|
||||
|
||||
### Ordered (native styles)
|
||||
|
||||
<RecursiveList
|
||||
type="ordered-native"
|
||||
items={[
|
||||
{
|
||||
text: "Item 1",
|
||||
items: [
|
||||
{
|
||||
text: "Link",
|
||||
href: "/",
|
||||
items: [
|
||||
{
|
||||
html: "<h5>Hello world</h5>",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Item 1",
|
||||
}
|
||||
]}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue