remove hono dependency
This commit is contained in:
parent
50aa4c5d07
commit
e772e0e711
|
|
@ -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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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> = {}
|
||||||
|
|
|
||||||
28
src/types.ts
28
src/types.ts
|
|
@ -302,4 +302,30 @@ export const UnitlessProps = new Set([
|
||||||
'orphans',
|
'orphans',
|
||||||
'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'
|
||||||
Loading…
Reference in New Issue
Block a user