skeleton
skeleton copied to clipboard
Relax type definitions for less cumbersome markup replacement
Describe the feature in detail (code, mocks, or screenshots encouraged)
Extensible markup attributes are strongly typed, causing type errors when you use a different element. For example, if you want a Menu.Item that using an anchor element instead of a div:
<Menu.Item value="discord">
{#snippet element(attributes)}
<!-- event handler type errors on the next line -->
<a href="#" {...attributes}>
<Menu.ItemText>Discord</Menu.ItemText>
</a>
{/snippet}
</Menu.Item>
has the following type error:
Argument of type '{ style?: string | undefined | null | undefined; title?: string | undefined | null | undefined; slot?: string | undefined | null | undefined; id?: string | undefined | null | undefined; dir?: "ltr" | "rtl" | "auto" | undefined | null | undefined; ... 426 more ...; href: string; }' is not assignable to parameter of type 'HTMLProps<"a", HTMLAttributes<any>>'.
Type '{ style?: string | undefined | null | undefined; title?: string | undefined | null | undefined; slot?: string | undefined | null | undefined; id?: string | undefined | null | undefined; dir?: "ltr" | "rtl" | "auto" | undefined | null | undefined; ... 426 more ...; href: string; }' is not assignable to type 'Omit<HTMLAnchorAttributes, never>'.
Types of property ''on:copy'' are incompatible.
Type 'ClipboardEventHandler<HTMLDivElement> | null | undefined' is not assignable to type 'ClipboardEventHandler<HTMLAnchorElement> | null | undefined'.
Type 'ClipboardEventHandler<HTMLDivElement>' is not assignable to type 'ClipboardEventHandler<HTMLAnchorElement>'.
Property 'align' is missing in type 'HTMLAnchorElement' but required in type 'HTMLDivElement'.
Provide relevant links, wireframes, prototypes, or additional information.
Discussion in Discord: https://discord.com/channels/1003691521280856084/1007673252992262215/1449532422566969396