Compare commits

..

No commits in common. "9301aed3e37d86e7d2119255c3e8a7ea2dde747a" and "65904850ac41204f0d6e052922adec0cb10516f9" have entirely different histories.

2 changed files with 1 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/forge",
"version": "0.0.9",
"version": "0.0.8",
"type": "module",
"main": "src/index.tsx",
"module": "src/index.tsx",

View File

@ -1,9 +1,5 @@
import { type TagDef, type HTMLTag, UnitlessProps, NonStyleKeys } from './types'
type ForgeComponent<Parts = {}> =
((props: Record<string, any>) => any) &
{ [K in keyof Parts]: (props: Record<string, any>) => any }
export const styles: Record<string, Record<string, string>> = {}
const themes: Record<string, Record<string, any>> = {}
@ -292,8 +288,6 @@ export function createScope(scope: string) {
}
// the main event
export function define<const T extends TagDef>(name: string, def: T): ForgeComponent<T['parts']>
export function define<const T extends TagDef>(def: T): ForgeComponent<T['parts']>
export function define(nameOrDef: string | TagDef, defIfNamed?: TagDef) {
const def = defIfNamed ?? nameOrDef as TagDef
const name = defIfNamed ? (nameOrDef as string) : anonName(def)