feat: add LocalStorage component

This commit is contained in:
Eric Y Liu 2021-03-13 14:38:08 -08:00
commit 1f7fe60695
11 changed files with 199 additions and 3 deletions

25
types/LocalStorage/LocalStorage.d.ts vendored Normal file
View file

@ -0,0 +1,25 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface LocalStorageProps {
/**
* Specify the local storage key
* @default "local-storage-key"
*/
key?: string;
/**
* Provide a value to persist
* @default ""
*/
value?: any;
}
export default class LocalStorage extends SvelteComponentTyped<
LocalStorageProps,
{
save: CustomEvent<any>;
update: CustomEvent<{ prevValue: any; value: any }>;
},
{}
> {}

1
types/index.d.ts vendored
View file

@ -69,6 +69,7 @@ export { default as ListBoxMenuItem } from "./ListBox/ListBoxMenuItem";
export { default as ListBoxSelection } from "./ListBox/ListBoxSelection";
export { default as ListItem } from "./ListItem/ListItem";
export { default as Loading } from "./Loading/Loading";
export { default as LocalStorage } from "./LocalStorage/LocalStorage";
export { default as MultiSelect } from "./MultiSelect/MultiSelect";
export { default as Modal } from "./Modal/Modal";
export { default as ToastNotification } from "./Notification/ToastNotification";