remove hono dependency

This commit is contained in:
Chris Wanstrath 2026-01-20 16:42:19 -08:00
parent 50aa4c5d07
commit e772e0e711
3 changed files with 30 additions and 7 deletions

View File

@ -19,13 +19,11 @@
"devDependencies": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "latest",
"@types/prismjs": "^1.26.5", "@types/prismjs": "^1.26.5",
"hono": "^4.11.3",
"prismjs": "^1.30.0", "prismjs": "^1.30.0",
"snarkdown": "^2.0.0" "snarkdown": "^2.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "^5" "typescript": "^5"
},
"dependencies": {
"hono": "^4.11.3"
} }
} }

View File

@ -1,5 +1,4 @@
import type { JSX } from 'hono/jsx' import { type TagDef, type HTMLTag, UnitlessProps, NonStyleKeys } from './types'
import { type TagDef, UnitlessProps, NonStyleKeys } from './types'
export const styles: Record<string, Record<string, string>> = {} export const styles: Record<string, Record<string, string>> = {}
const themes: Record<string, Record<string, any>> = {} const themes: Record<string, Record<string, any>> = {}
@ -155,7 +154,7 @@ function makeComponent(baseName: string, rootDef: TagDef, rootProps: Record<stri
// Extract element name from base (e.g., 'input[type=radio]' -> 'input') // Extract element name from base (e.g., 'input[type=radio]' -> 'input')
const tagName = base.split('[')[0] 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' }) // Extract attributes from base (e.g., 'input[type=radio]' -> { type: 'radio' })
const baseAttrs: Record<string, string> = {} const baseAttrs: Record<string, string> = {}

View File

@ -303,3 +303,29 @@ export const UnitlessProps = new Set([
'widows', 'widows',
'zIndex' 'zIndex'
]) ])
// 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'