Comparing version 2.0.0 to 2.1.0
@@ -6,2 +6,5 @@ import { ClassValue } from 'clsx'; | ||
type ClassProps = Partial<Record<ClassKey, ClassValue>>; | ||
type Flatten<T> = T extends object ? {} & { | ||
[P in keyof T]: T[P]; | ||
} : T; | ||
type OnnoClassValue = string | string[]; | ||
@@ -19,14 +22,14 @@ type OnnoClassProps = Record<ClassKey, OnnoClassValue>; | ||
baseline?: OnnoClassValue; | ||
compound?: OnnoCompound<T>[]; | ||
defaults?: OnnoDefaults<T>; | ||
compound?: Flatten<OnnoCompound<T>>[]; | ||
defaults?: Flatten<OnnoDefaults<T>>; | ||
variants: T; | ||
} | ||
type OnnoOptions<T extends OnnoVariants> = OnnoDefaults<T> & ClassProps; | ||
type OnnoFunction<T extends OnnoVariants> = (options?: OnnoOptions<T>) => string; | ||
type OnnoFunction<T extends OnnoVariants> = (options?: Flatten<OnnoOptions<T>>) => string; | ||
type OnnoFactory = <T extends OnnoVariants>(config: OnnoConfig<T>) => OnnoFunction<T>; | ||
type OnnoVariantProps<F extends OnnoFunction<any>> = Omit<Exclude<Parameters<F>[0], undefined>, ClassKey>; | ||
type OnnoProps<F extends OnnoFunction<any>, K extends keyof OnnoVariantProps<F> = never> = OnnoVariantProps<F> & Required<Pick<OnnoVariantProps<F>, K>> & ClassProps; | ||
type OnnoProps<F extends OnnoFunction<any>, K extends keyof OnnoVariantProps<F> = never> = Flatten<OnnoVariantProps<F> & Required<Pick<OnnoVariantProps<F>, K>> & ClassProps>; | ||
declare const onno: OnnoFactory; | ||
export { ClassKey, ClassProps, OnnoClassMap, OnnoClassProps, OnnoClassValue, OnnoCompound, OnnoConfig, OnnoDefaults, OnnoFactory, OnnoFunction, OnnoOptions, OnnoProps, OnnoVariants, onno }; | ||
export { ClassKey, ClassProps, Flatten, OnnoClassMap, OnnoClassProps, OnnoClassValue, OnnoCompound, OnnoConfig, OnnoDefaults, OnnoFactory, OnnoFunction, OnnoOptions, OnnoProps, OnnoVariantProps, OnnoVariants, onno }; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"homepage": "https://onnojs.com", | ||
@@ -11,2 +11,7 @@ "main": "dist/index.cjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"license", | ||
"readme.md" | ||
], | ||
"author": { | ||
@@ -13,0 +18,0 @@ "name": "Matthew Wagerfield", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
14617
6
99
1