feat(recursive-list): add RecursiveList

This commit is contained in:
Eric Y Liu 2021-06-30 05:41:37 -07:00
commit 92301b1d46
10 changed files with 254 additions and 3 deletions

34
types/RecursiveList/RecursiveList.d.ts vendored Normal file
View file

@ -0,0 +1,34 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface Item {
text?: string;
href?: string;
html?: string;
}
export interface RecursiveListProps {
/**
* Specify the items to render
* @default []
*/
items?: Array<Item & { items?: Item[] }>;
/**
* Specify the type of list to render
* @default "unordered"
*/
type?: "unordered" | "ordered" | "ordered-native";
/**
* Set to `true` to use the nested variant
* @default false
*/
nested?: boolean;
}
export default class RecursiveList extends SvelteComponentTyped<
RecursiveListProps,
{},
{}
> {}

1
types/index.d.ts vendored
View file

@ -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";