mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
RecursiveList (#717)
* feat(recursive-list): add RecursiveList * feat(recursive-list): rename items prop to children * docs(recursive-list): add full examples * test(recursive-list): add types test * refactor(recursive-list): remove superfluous nested prop * docs(recursive-list): update docs * fix(recursive-list): remove nested prop from type test * fix(recursive-list): explicitly type restProps
This commit is contained in:
parent
870c2c2ae8
commit
ae27bedf4c
17 changed files with 334 additions and 6 deletions
30
types/RecursiveList/RecursiveList.d.ts
vendored
Normal file
30
types/RecursiveList/RecursiveList.d.ts
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface RecursiveListNode {
|
||||
text?: string;
|
||||
href?: string;
|
||||
html?: string;
|
||||
}
|
||||
|
||||
export interface RecursiveListProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ul"]>,
|
||||
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ol"]> {
|
||||
/**
|
||||
* Specify the children to render
|
||||
* @default []
|
||||
*/
|
||||
children?: Array<RecursiveListNode & { children?: RecursiveListNode[] }>;
|
||||
|
||||
/**
|
||||
* Specify the type of list to render
|
||||
* @default "unordered"
|
||||
*/
|
||||
type?: "unordered" | "ordered" | "ordered-native";
|
||||
}
|
||||
|
||||
export default class RecursiveList extends SvelteComponentTyped<
|
||||
RecursiveListProps,
|
||||
{},
|
||||
{}
|
||||
> {}
|
1
types/index.d.ts
vendored
1
types/index.d.ts
vendored
|
@ -99,6 +99,7 @@ export { default as ProgressStep } from "./ProgressIndicator/ProgressStep";
|
|||
export { default as RadioButton } from "./RadioButton/RadioButton";
|
||||
export { default as RadioButtonSkeleton } from "./RadioButton/RadioButtonSkeleton";
|
||||
export { default as RadioButtonGroup } from "./RadioButtonGroup/RadioButtonGroup";
|
||||
export { default as RecursiveList } from "./RecursiveList/RecursiveList";
|
||||
export { default as Search } from "./Search/Search";
|
||||
export { default as SearchSkeleton } from "./Search/SearchSkeleton";
|
||||
export { default as Select } from "./Select/Select";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue