Compare commits
No commits in common. "9301aed3e37d86e7d2119255c3e8a7ea2dde747a" and "65904850ac41204f0d6e052922adec0cb10516f9" have entirely different histories.
9301aed3e3
...
65904850ac
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@because/forge",
|
"name": "@because/forge",
|
||||||
"version": "0.0.9",
|
"version": "0.0.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.tsx",
|
"main": "src/index.tsx",
|
||||||
"module": "src/index.tsx",
|
"module": "src/index.tsx",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import { type TagDef, type HTMLTag, UnitlessProps, NonStyleKeys } from './types'
|
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>> = {}
|
export const styles: Record<string, Record<string, string>> = {}
|
||||||
const themes: Record<string, Record<string, any>> = {}
|
const themes: Record<string, Record<string, any>> = {}
|
||||||
|
|
||||||
|
|
@ -292,8 +288,6 @@ export function createScope(scope: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// the main event
|
// 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) {
|
export function define(nameOrDef: string | TagDef, defIfNamed?: TagDef) {
|
||||||
const def = defIfNamed ?? nameOrDef as TagDef
|
const def = defIfNamed ?? nameOrDef as TagDef
|
||||||
const name = defIfNamed ? (nameOrDef as string) : anonName(def)
|
const name = defIfNamed ? (nameOrDef as string) : anonName(def)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user