Comparing version 0.0.2 to 0.0.3
@@ -1,14 +0,7 @@ | ||
import type { ClassProp, ClassValue, OmitUndefined, StringToBoolean } from "./types"; | ||
import type { ClassProp, ClassValue, CxOptions, CxReturn, OmitUndefined, StringToBoolean } from "./types"; | ||
export type VariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "className">; | ||
export type CxOptions = ClassValue[]; | ||
export type CxReturn = string; | ||
export declare function cx<T extends CxOptions>(...classes: T): CxReturn; | ||
export declare function cn(...inputs: ClassValue[]): string; | ||
export type RequiredConfig<T> = T extends ConfigSchema ? { | ||
variants: T; | ||
defaultVariants: ConfigVariants<T>; | ||
compoundVariants: readonly (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[]; | ||
} : never; | ||
export type ConfigSchema = Record<string, Record<string, ClassValue>>; | ||
export type ConfigVariants<T extends ConfigSchema> = { | ||
type ConfigSchema = Record<string, Record<string, ClassValue>>; | ||
type ConfigVariants<T extends ConfigSchema> = { | ||
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null; | ||
@@ -19,3 +12,3 @@ }; | ||
}; | ||
export type Config<T> = T extends ConfigSchema ? { | ||
type Config<T> = T extends ConfigSchema ? { | ||
variants?: T; | ||
@@ -22,0 +15,0 @@ defaultVariants?: ConfigVariants<T>; |
@@ -6,3 +6,4 @@ import { twMerge } from "tailwind-merge"; | ||
} | ||
export function cx() { | ||
/* cx | ||
============================================ */ export function cx() { | ||
for(var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++){ | ||
@@ -9,0 +10,0 @@ classes[_key] = arguments[_key]; |
@@ -10,1 +10,3 @@ export type ClassPropKey = "className"; | ||
export type StringToBoolean<T> = T extends "true" | "false" ? boolean : T; | ||
export type CxOptions = ClassValue[]; | ||
export type CxReturn = string; |
{ | ||
"name": "cvax", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Customized CVA. fork 'class-variance-authority'", | ||
"keywords": [ | ||
"Class Variance Authority", | ||
"class-variance-authority", | ||
"classes", | ||
"classname", | ||
"classnames", | ||
"css", | ||
"cva", | ||
"stitches", | ||
"vanilla-extract", | ||
"variants" | ||
], | ||
"repository": "https://github.com/alexvyber/cvax.git", | ||
"funding": "https://joebell.co.uk", | ||
"author": "Joe Bell (https://joebell.co.uk)", | ||
"exports": { | ||
@@ -33,8 +19,10 @@ "import": "./dist/index.esm.js", | ||
"build:cjs": "swc ./src/index.ts --config-file ./.config/.swcrc -o dist/index.cjs.js -C module.type=commonjs", | ||
"build:esm": "swc ./src/index.ts --config-file ./.config/.swcrc -o dist/index.esm.js -C module.type=es6 ", | ||
"build:esm": "swc ./src/index.ts --config-file ./.config/.swcrc -o dist/index.esm.js -C module.type=es6", | ||
"build:tsc": "tsc --project .config/tsconfig.build.json", | ||
"dev": "jest --config .config/jest.config.ts --watch", | ||
"dev-OLD": "jest --config .config/jest.config.ts --watch", | ||
"dev": "vitest", | ||
"prepublishOnly": "pnpm build", | ||
"test": "run-p test:*", | ||
"test:jest": "jest --config .config/jest.config.ts --coverage", | ||
"NO-test:jest": "jest --config .config/jest.config.ts --coverage", | ||
"test:vitest": "vitest", | ||
"test:size": "pnpm build && bundlesize -f 'dist/*.js' -s 1.6KB", | ||
@@ -49,7 +37,4 @@ "tsc": "tsc --project tsconfig.json --noEmit" | ||
"devDependencies": { | ||
"@jest/types": "29.4.3", | ||
"@swc/cli": "0.1.62", | ||
"@swc/core": "1.3.36", | ||
"@swc/jest": "0.2.24", | ||
"@types/jest": "29.4.0", | ||
"@types/lodash.isequal": "^4.5.6", | ||
@@ -60,3 +45,2 @@ "@types/node": "18.14.1", | ||
"bundlesize": "0.18.1", | ||
"jest": "29.4.3", | ||
"npm-run-all": "4.1.5", | ||
@@ -66,6 +50,7 @@ "react": "18.2.0", | ||
"ts-node": "10.9.1", | ||
"typescript": "5.0.0-beta" | ||
"typescript": "5.0.0-beta", | ||
"vitest": "^0.29.1" | ||
}, | ||
"peerDependencies": { | ||
"typescript": ">= 4.5.5" | ||
"typescript": ">= 4.5.5 || >= 5.0.0 || >= 5.0.0-beta" | ||
}, | ||
@@ -72,0 +57,0 @@ "peerDependenciesMeta": { |
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
13
16629
311
1