From e772e0e7115750bcd11a6a1daae171ebd89a17bb Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 20 Jan 2026 16:42:19 -0800 Subject: [PATCH] remove hono dependency --- package.json | 4 +--- src/index.tsx | 5 ++--- src/types.ts | 28 +++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0014bee..2d8281a 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,11 @@ "devDependencies": { "@types/bun": "latest", "@types/prismjs": "^1.26.5", + "hono": "^4.11.3", "prismjs": "^1.30.0", "snarkdown": "^2.0.0" }, "peerDependencies": { "typescript": "^5" - }, - "dependencies": { - "hono": "^4.11.3" } } diff --git a/src/index.tsx b/src/index.tsx index d5751ce..a14ef6b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,4 @@ -import type { JSX } from 'hono/jsx' -import { type TagDef, UnitlessProps, NonStyleKeys } from './types' +import { type TagDef, type HTMLTag, UnitlessProps, NonStyleKeys } from './types' export const styles: Record> = {} const themes: Record> = {} @@ -155,7 +154,7 @@ function makeComponent(baseName: string, rootDef: TagDef, rootProps: Record 'input') const tagName = base.split('[')[0] - const Tag = (tagName) as keyof JSX.IntrinsicElements + const Tag = tagName as HTMLTag // Extract attributes from base (e.g., 'input[type=radio]' -> { type: 'radio' }) const baseAttrs: Record = {} diff --git a/src/types.ts b/src/types.ts index 6f8b817..2d0d922 100644 --- a/src/types.ts +++ b/src/types.ts @@ -302,4 +302,30 @@ export const UnitlessProps = new Set([ 'orphans', 'widows', 'zIndex' -]) \ No newline at end of file +]) + +// All standard HTML element tag names +export type HTMLTag = + | 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' + | 'b' | 'base' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'br' | 'button' + | 'canvas' | 'caption' | 'cite' | 'code' | 'col' | 'colgroup' + | 'data' | 'datalist' | 'dd' | 'del' | 'details' | 'dfn' | 'dialog' | 'div' | 'dl' | 'dt' + | 'em' | 'embed' + | 'fieldset' | 'figcaption' | 'figure' | 'footer' | 'form' + | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'head' | 'header' | 'hgroup' | 'hr' | 'html' + | 'i' | 'iframe' | 'img' | 'input' | 'ins' + | 'kbd' + | 'label' | 'legend' | 'li' | 'link' + | 'main' | 'map' | 'mark' | 'menu' | 'meta' | 'meter' + | 'nav' | 'noscript' + | 'object' | 'ol' | 'optgroup' | 'option' | 'output' + | 'p' | 'picture' | 'pre' | 'progress' + | 'q' + | 'rp' | 'rt' | 'ruby' + | 's' | 'samp' | 'script' | 'search' | 'section' | 'select' | 'slot' | 'small' | 'source' | 'span' | 'strong' | 'style' | 'sub' | 'summary' | 'sup' + | 'table' | 'tbody' | 'td' | 'template' | 'textarea' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | 'tr' | 'track' + | 'u' | 'ul' + | 'var' | 'video' + | 'wbr' + // SVG elements + | 'svg' | 'path' | 'circle' | 'ellipse' | 'line' | 'polygon' | 'polyline' | 'rect' | 'g' | 'defs' | 'use' | 'text' | 'tspan' | 'image' | 'clipPath' | 'mask' | 'pattern' | 'linearGradient' | 'radialGradient' | 'stop' | 'filter' | 'feBlend' | 'feColorMatrix' | 'feGaussianBlur' | 'symbol' \ No newline at end of file