@polymorphic-factory/solid
Advanced tools
Comparing version 0.0.0-rc-20221115143432 to 0.0.0-rc-20221204123243
import { ComponentProps, ValidComponent, Component, JSX } from 'solid-js'; | ||
declare type DOMElements = keyof JSX.IntrinsicElements; | ||
declare type ElementType = DOMElements | Component<any>; | ||
type DOMElements = keyof JSX.IntrinsicElements; | ||
type ElementType = DOMElements | Component<any>; | ||
/** | ||
@@ -11,19 +11,19 @@ * Assign property types from right to left. | ||
*/ | ||
declare type Assign<Target, Source> = Omit<Target, keyof Source> & Source; | ||
type Assign<Target, Source> = Omit<Target, keyof Source> & Source; | ||
/** | ||
* Extract the props of a solid element or component | ||
*/ | ||
declare type PropsOf<T extends ElementType> = ComponentProps<T> & { | ||
type PropsOf<T extends ElementType> = ComponentProps<T> & { | ||
as?: ElementType; | ||
}; | ||
declare type ComponentWithAs<T extends ValidComponent, Props = Record<never, never>> = Component<Assign<Assign<ComponentProps<T>, Props>, { | ||
type ComponentWithAs<T extends ValidComponent, Props = Record<never, never>> = Component<Assign<Assign<ComponentProps<T>, Props>, { | ||
as?: ElementType; | ||
}>>; | ||
declare type HTMLPolymorphicComponents = { | ||
type HTMLPolymorphicComponents = { | ||
[Tag in DOMElements]: ComponentWithAs<Tag>; | ||
}; | ||
declare type HTMLPolymorphicProps<T extends ElementType> = Omit<ComponentProps<T>, 'ref'> & { | ||
type HTMLPolymorphicProps<T extends ElementType> = Omit<ComponentProps<T>, 'ref'> & { | ||
as?: ElementType; | ||
}; | ||
declare type PolymorphFactory = { | ||
type PolymorphFactory = { | ||
<T extends ElementType, P extends Record<string, unknown> = Record<never, never>, Options = never>(component: T, option?: Options): ComponentWithAs<T, P>; | ||
@@ -30,0 +30,0 @@ }; |
{ | ||
"name": "@polymorphic-factory/solid", | ||
"version": "0.0.0-rc-20221115143432", | ||
"version": "0.0.0-rc-20221204123243", | ||
"description": "", | ||
"keywords": [], | ||
"keywords": [ | ||
"solid-js", | ||
"typescript", | ||
"jsx", | ||
"headless", | ||
"polymorphic", | ||
"emotion", | ||
"css-in-js", | ||
"polymorphic-types" | ||
], | ||
"homepage": "https://github.com/chakra-ui/polymorphic", | ||
@@ -30,14 +39,14 @@ "author": "Tim Kolberger <tim@kolberger.eu>", | ||
"@types/testing-library__jest-dom": "5.14.5", | ||
"@vitest/coverage-c8": "0.25.1", | ||
"clean-package": "2.1.2", | ||
"esbuild": "0.15.14", | ||
"@vitest/coverage-c8": "0.25.3", | ||
"clean-package": "2.2.0", | ||
"esbuild": "0.15.17", | ||
"esbuild-plugin-solid": "0.4.2", | ||
"jsdom": "20.0.2", | ||
"jsdom": "20.0.3", | ||
"solid-js": "1.6.2", | ||
"solid-testing-library": "0.5.0", | ||
"tsup": "6.5.0", | ||
"typescript": "4.8.4", | ||
"typescript": "4.9.3", | ||
"vite": "3.2.4", | ||
"vite-plugin-solid": "2.4.0", | ||
"vitest": "0.25.1" | ||
"vitest": "0.25.3" | ||
}, | ||
@@ -44,0 +53,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10923