From 402a59ea5c5c793d14fa0be82747b2f7b2c9b279 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 27 Jun 2026 19:29:17 -0400 Subject: [PATCH] fix: #277 fixup svg types --- src/jsx.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 {} }