@yaredfall/class-variants 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,19 @@
1
1
  import { ClassValue } from 'clsx';
2
- import { Opaque, Prettify, ArrayOrSingle } from 'ts-essentials';
3
2
  import { CN } from './cn.js';
4
3
 
4
+ type StringLiteral<Type> = Type extends string ? (string extends Type ? never : Type) : never;
5
+ declare const __OPAQUE_TYPE__: unique symbol;
6
+ type WithOpaque<Token extends string> = {
7
+ readonly [__OPAQUE_TYPE__]: Token;
8
+ };
9
+ type Opaque<Type, Token extends string> = Token extends StringLiteral<Token> ? Type & WithOpaque<Token> : never;
10
+
11
+ type Prettify<Type> = Type extends Function ? Type : Extract<{
12
+ [Key in keyof Type]: Type[Key];
13
+ }, Type>;
14
+
15
+ type ArrayOrSingle<Type> = Type | Type[];
16
+
5
17
  type OnlyWhenDefined = Opaque<{
6
18
  __token: string;
7
19
  }, "OnlyWhenDefined">;
@@ -76,4 +88,4 @@ type CVPropsValue = VariantKey | boolean | undefined;
76
88
  declare function resolveConfig<V extends VariantsSchema = EmptySchema>(config: Partial<CVConfig<V>>): [ResolvedCVConfig<V>, CVUtils<V>];
77
89
  declare function resolveCompoundVariants<V extends VariantsSchema = EmptySchema>(compoundVariants: CVConfig<V>["compoundVariants"], utils: CVUtils<V>): CompoundVariantsSchema<V>;
78
90
 
79
- export { type BooleanStringToBoolean as B, type CV as C, type EntriesOf as E, type ResolvedCVConfig as R, type VariantsSchema as V, _cv as _, onlyWhenUndefined as a, type CVCompoundVariant as b, type CompoundVariantsSchema as c, type CVReturn as d, type CVToken as e, type CVUtils as f, type CVVariant as g, type VariantProps as h, type Variant as i, type CompoundVariantsSchemaFunction as j, isCVToken as k, getKeys as l, getEntries as m, type VariantMap as n, onlyWhenDefined as o, getVariantMap as p, splitProps as q, cvUtils as r, shouldApplySelectorByToken as s, type VariantKey as t, type CVProps as u, type CVConfig as v, type CVReturnProps as w, type CVPropsValue as x, resolveConfig as y, resolveCompoundVariants as z };
91
+ export { type BooleanStringToBoolean as B, type CV as C, type EntriesOf as E, type Prettify as P, type ResolvedCVConfig as R, type VariantsSchema as V, _cv as _, onlyWhenUndefined as a, type CVCompoundVariant as b, type CompoundVariantsSchema as c, type CVReturn as d, type CVToken as e, type CVUtils as f, type CVVariant as g, type VariantProps as h, type Variant as i, type CompoundVariantsSchemaFunction as j, isCVToken as k, getKeys as l, getEntries as m, type VariantMap as n, onlyWhenDefined as o, getVariantMap as p, splitProps as q, cvUtils as r, shouldApplySelectorByToken as s, type VariantKey as t, type CVProps as u, type CVConfig as v, type CVReturnProps as w, type CVPropsValue as x, resolveConfig as y, resolveCompoundVariants as z };
package/build/cv.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import 'clsx';
2
- import 'ts-essentials';
2
+ export { B as BooleanStringToBoolean, C as CV, b as CVCompoundVariant, v as CVConfig, u as CVProps, x as CVPropsValue, d as CVReturn, w as CVReturnProps, g as CVVariant, c as CompoundVariantsSchema, j as CompoundVariantsSchemaFunction, R as ResolvedCVConfig, i as Variant, t as VariantKey, h as VariantProps, V as VariantsSchema, _ as _cv, z as resolveCompoundVariants, y as resolveConfig } from './cv-96SI2TYA.js';
3
3
  import './cn.js';
4
- export { B as BooleanStringToBoolean, C as CV, b as CVCompoundVariant, v as CVConfig, u as CVProps, x as CVPropsValue, d as CVReturn, w as CVReturnProps, g as CVVariant, c as CompoundVariantsSchema, j as CompoundVariantsSchemaFunction, R as ResolvedCVConfig, i as Variant, t as VariantKey, h as VariantProps, V as VariantsSchema, _ as _cv, z as resolveCompoundVariants, y as resolveConfig } from './cv-CxGrT76R.js';
package/build/define.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { CVExtend } from './extend.js';
2
- import { C as CV } from './cv-CxGrT76R.js';
2
+ import { C as CV } from './cv-96SI2TYA.js';
3
3
  import { CNOptions, CN } from './cn.js';
4
4
  import 'clsx';
5
- import 'ts-essentials';
5
+ import '../prettify';
6
6
 
7
7
  interface DefineCVOptions extends CNOptions {
8
8
  }
package/build/extend.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { ClassValue } from 'clsx';
2
- import { Merge, Prettify } from 'ts-essentials';
2
+ import { Prettify } from '../prettify';
3
+ import { V as VariantsSchema, d as CVReturn, c as CompoundVariantsSchema, i as Variant, P as Prettify$1, j as CompoundVariantsSchemaFunction, g as CVVariant, C as CV } from './cv-96SI2TYA.js';
3
4
  import { CN } from './cn.js';
4
- import { V as VariantsSchema, d as CVReturn, c as CompoundVariantsSchema, i as Variant, j as CompoundVariantsSchemaFunction, g as CVVariant, C as CV } from './cv-CxGrT76R.js';
5
5
 
6
- type MergeVariant<V1 extends Variant, V2 extends Variant> = Prettify<Record<keyof V1 | keyof V2, ClassValue>>;
6
+ type Merge<Object1, Object2> = Prettify<Omit<Object1, keyof Object2> & Object2>;
7
+
8
+ type MergeVariant<V1 extends Variant, V2 extends Variant> = Prettify$1<Record<keyof V1 | keyof V2, ClassValue>>;
7
9
  type MergeVariantsSchemas<V1 extends VariantsSchema, V2 extends VariantsSchema> = Merge<V1 & V2, {
8
10
  [K in keyof V1 & keyof V2]: MergeVariant<V1[K], V2[K]>;
9
11
  }>;
package/build/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { CN } from './cn.js';
2
- import { C as CV } from './cv-CxGrT76R.js';
3
- export { b as CVCompoundVariant, d as CVReturn, e as CVToken, f as CVUtils, g as CVVariant, c as CompoundVariantsSchema, h as VariantProps, V as VariantsSchema, o as onlyWhenDefined, a as onlyWhenUndefined } from './cv-CxGrT76R.js';
2
+ import { C as CV } from './cv-96SI2TYA.js';
3
+ export { b as CVCompoundVariant, d as CVReturn, e as CVToken, f as CVUtils, g as CVVariant, c as CompoundVariantsSchema, h as VariantProps, V as VariantsSchema, o as onlyWhenDefined, a as onlyWhenUndefined } from './cv-96SI2TYA.js';
4
4
  export { defineCV } from './define.js';
5
5
  import { CVExtend } from './extend.js';
6
6
  import 'clsx';
7
- import 'ts-essentials';
7
+ import '../prettify';
8
8
 
9
9
  declare const cn: CN;
10
10
  declare const cv: CV;
package/build/tokens.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import 'ts-essentials';
2
- export { e as CVToken, k as isCVToken, o as onlyWhenDefined, a as onlyWhenUndefined, s as shouldApplySelectorByToken } from './cv-CxGrT76R.js';
1
+ export { e as CVToken, k as isCVToken, o as onlyWhenDefined, a as onlyWhenUndefined, s as shouldApplySelectorByToken } from './cv-96SI2TYA.js';
3
2
  import 'clsx';
4
3
  import './cn.js';
package/build/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import 'ts-essentials';
2
- export { f as CVUtils, E as EntriesOf, n as VariantMap, r as cvUtils, m as getEntries, l as getKeys, p as getVariantMap, q as splitProps } from './cv-CxGrT76R.js';
1
+ export { f as CVUtils, E as EntriesOf, n as VariantMap, r as cvUtils, m as getEntries, l as getKeys, p as getVariantMap, q as splitProps } from './cv-96SI2TYA.js';
3
2
  import 'clsx';
4
3
  import './cn.js';
package/build/vue.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { PropType } from 'vue';
2
- import { V as VariantsSchema, d as CVReturn } from './cv-CxGrT76R.js';
2
+ import { V as VariantsSchema, d as CVReturn } from './cv-96SI2TYA.js';
3
3
  import 'clsx';
4
- import 'ts-essentials';
5
4
  import './cn.js';
6
5
 
7
6
  declare function getPropsDeclaration<V extends VariantsSchema>(cv: CVReturn<V>): { [K in keyof V]: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaredfall/class-variants",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "private": false,
5
5
  "author": "yaredfall",
6
6
  "type": "module",
@@ -44,13 +44,13 @@
44
44
  "build"
45
45
  ],
46
46
  "dependencies": {
47
- "clsx": "^2.1.1",
48
- "ts-essentials": "^10.0.0"
47
+ "clsx": "^2.1.1"
49
48
  },
50
49
  "devDependencies": {
51
50
  "tsup": "^8.5.0",
52
51
  "typescript": "^5.8.3",
53
- "vue": "^3.5.16"
52
+ "vue": "^3.5.16",
53
+ "ts-essentials": "^10.0.0"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"