feat(structured-list)!: integration StructuredList with v11 (#1965)

This commit is contained in:
Eric Liu 2024-04-22 22:33:05 -07:00 committed by GitHub
commit 52adc778ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 245 additions and 410 deletions

View file

@ -33,12 +33,6 @@ export interface StructuredListProps extends RestProps {
export default class StructuredList extends SvelteComponentTyped<
StructuredListProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
change: CustomEvent<any>;
},
{ change: CustomEvent<any> },
{ default: {} }
> {}

View file

@ -9,11 +9,6 @@ export interface StructuredListBodyProps extends RestProps {
export default class StructuredListBody extends SvelteComponentTyped<
StructuredListBodyProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
},
Record<string, any>,
{ default: {} }
> {}

View file

@ -4,12 +4,6 @@ import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["div"];
export interface StructuredListCellProps extends RestProps {
/**
* Set to `true` to use as a header
* @default false
*/
head?: boolean;
/**
* Set to `true` to prevent wrapping
* @default false
@ -21,11 +15,6 @@ export interface StructuredListCellProps extends RestProps {
export default class StructuredListCell extends SvelteComponentTyped<
StructuredListCellProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
},
Record<string, any>,
{ default: {} }
> {}

View file

@ -9,11 +9,6 @@ export interface StructuredListHeadProps extends RestProps {
export default class StructuredListHead extends SvelteComponentTyped<
StructuredListHeadProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
},
Record<string, any>,
{ default: {} }
> {}

View file

@ -40,11 +40,23 @@ export interface StructuredListInputProps extends RestProps {
*/
ref?: null | HTMLInputElement;
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent<any>;
/**
* Specify the ARIA label for the accordion item chevron icon.
* @default "Select an option"
*/
iconDescription?: string;
[key: `data-${string}`]: any;
}
export default class StructuredListInput extends SvelteComponentTyped<
StructuredListInputProps,
Record<string, any>,
{ change: WindowEventMap["change"] },
{}
> {}

View file

@ -1,38 +1,26 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["label"];
type RestProps = SvelteHTMLElements["svelte:element"];
export interface StructuredListRowProps extends RestProps {
/**
* Set to `true` to use as a header
* @default false
* Specify the tag name
* @default "div"
*/
head?: boolean;
tag?: keyof HTMLElementTagNameMap;
/**
* Set to `true` to render a label slot
* Set to `true` to use the selected state
* @default false
*/
label?: boolean;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
selected?: boolean;
[key: `data-${string}`]: any;
}
export default class StructuredListRow extends SvelteComponentTyped<
StructuredListRowProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
keydown: WindowEventMap["keydown"];
},
Record<string, any>,
{ default: {} }
> {}

View file

@ -1,25 +1,15 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["div"];
export interface StructuredListSkeletonProps extends RestProps {
export interface StructuredListSkeletonProps {
/**
* Specify the number of rows
* @default 5
*/
rows?: number;
[key: `data-${string}`]: any;
count?: number;
}
export default class StructuredListSkeleton extends SvelteComponentTyped<
StructuredListSkeletonProps,
{
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
},
Record<string, any>,
{}
> {}