feat(heading): add Heading and Section components (#1961)

This commit is contained in:
Eric Liu 2024-04-21 14:27:26 -07:00 committed by GitHub
commit 76210d68d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 287 additions and 2 deletions

11
types/Heading/Heading.svelte.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
import type { SvelteComponentTyped } from "svelte";
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
export interface HeadingProps {}
export default class Heading extends SvelteComponentTyped<
HeadingProps,
Record<string, any>,
{ default: {} }
> {}

23
types/Heading/Section.svelte.d.ts vendored Normal file
View file

@ -0,0 +1,23 @@
import type { SvelteComponentTyped } from "svelte";
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
export interface SectionProps {
/**
* Specify the level the section should start at.
* @default 1
*/
level?: SectionLevel;
/**
* Specify the tag name
* @default "section"
*/
tag?: keyof HTMLElementTagNameMap;
}
export default class Section extends SvelteComponentTyped<
SectionProps,
Record<string, any>,
{ default: {} }
> {}

2
types/index.d.ts vendored
View file

@ -62,6 +62,8 @@ export { default as FormLabel } from "./FormLabel/FormLabel.svelte";
export { default as Grid } from "./Grid/Grid.svelte";
export { default as Row } from "./Grid/Row.svelte";
export { default as Column } from "./Grid/Column.svelte";
export { default as Heading } from "./Heading/Heading.svelte";
export { default as Section } from "./Heading/Section.svelte";
export { default as ImageLoader } from "./ImageLoader/ImageLoader.svelte";
export { default as InlineLoading } from "./InlineLoading/InlineLoading.svelte";
export { default as Layer } from "./Layer/Layer.svelte";