feat(popover): add Popover component

This commit is contained in:
Eric Y Liu 2021-03-19 06:34:42 -07:00
commit a3a4a02d94
10 changed files with 280 additions and 4 deletions

59
types/Popover/Popover.d.ts vendored Normal file
View file

@ -0,0 +1,59 @@
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
export interface PopoverProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set to `true` to display the popover
* @default false
*/
open?: boolean;
/**
* Set to `true` render a caret
* @default false
*/
caret?: boolean;
/**
* Specify the alignment of the caret
* @default "top"
*/
align?:
| "top"
| "top-left"
| "top-right"
| "bottom"
| "bottom-left"
| "bottom-right"
| "left"
| "left-bottom"
| "left-top"
| "right"
| "right-bottom"
| "right-top";
/**
* Set to `true` to enable the light variant
* @default false
*/
light?: boolean;
/**
* Set to `true` to enable the high contrast variant
* @default false
*/
highContrast?: boolean;
/**
* Set to `true` to use a relative position
* @default false
*/
relative?: boolean;
}
export default class Popover extends SvelteComponentTyped<
PopoverProps,
{},
{ default: {} }
> {}

1
types/index.d.ts vendored
View file

@ -86,6 +86,7 @@ export { default as OverflowMenuItem } from "./OverflowMenu/OverflowMenuItem";
export { default as Pagination } from "./Pagination/Pagination";
export { default as PaginationSkeleton } from "./Pagination/PaginationSkeleton";
export { default as PaginationNav } from "./PaginationNav/PaginationNav";
export { default as Popover } from "./Popover/Popover";
export { default as ProgressIndicator } from "./ProgressIndicator/ProgressIndicator";
export { default as ProgressIndicatorSkeleton } from "./ProgressIndicator/ProgressIndicatorSkeleton";
export { default as ProgressStep } from "./ProgressIndicator/ProgressStep";