diff --git a/src/jsx.d.ts b/src/jsx.d.ts index 160e5dc..4d6ee0b 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -49,6 +49,17 @@ type IntrinsicElementsFromSVG = { [E in keyof SVGElementTagNameMap]: SVGElementAttributes; }; +type IntrinsicElementAttributes = (E extends keyof HTMLElementTagNameMap + ? ElementAttributes & + (E extends 'button' | 'input' ? PopoverAttributes : {}) & + (E extends 'button' ? { tabindex?: number | string } : {}) + : {}) & + (E extends keyof SVGElementTagNameMap ? SVGElementAttributes : {}); + +type IntrinsicElementsMap = { + [E in keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap]: IntrinsicElementAttributes; +}; + declare namespace JSX { - interface IntrinsicElements extends IntrinsicElementsFromDom, IntrinsicElementsFromSVG {} + interface IntrinsicElements extends IntrinsicElementsMap {} }