@fuf-stack/pixel-utils 1.3.2 → 1.4.1
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.
- package/dist/{index.d.ts → index.d.mts} +48 -40
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +1 -1
- package/dist/index.mjs.map +1 -0
- package/package.json +7 -12
- package/dist/index.cjs +0 -175
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ArgumentArray } from "classnames";
|
|
2
2
|
import { Options } from "slug";
|
|
3
|
-
|
|
4
3
|
//#region src/cn.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A utility function that combines `classnames` and `tailwind-merge`.
|
|
@@ -17,7 +16,7 @@ import { Options } from "slug";
|
|
|
17
16
|
* // Output: 'text-center bg-red-500 p-4'
|
|
18
17
|
* ```
|
|
19
18
|
*/
|
|
20
|
-
declare const cn: (...classes: ArgumentArray) => string;
|
|
19
|
+
export declare const cn: (...classes: ArgumentArray) => string;
|
|
21
20
|
//#endregion
|
|
22
21
|
//#region src/isTestEnvironment.d.ts
|
|
23
22
|
/**
|
|
@@ -42,9 +41,9 @@ declare const cn: (...classes: ArgumentArray) => string;
|
|
|
42
41
|
* return debouncedValue;
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
|
-
declare const isTestEnvironment: () => boolean;
|
|
44
|
+
export declare const isTestEnvironment: () => boolean;
|
|
46
45
|
//#endregion
|
|
47
|
-
//#region ../../node_modules/.pnpm/tailwind-merge@3.
|
|
46
|
+
//#region ../../node_modules/.pnpm/tailwind-merge@3.7.0/node_modules/tailwind-merge/dist/types.d.ts
|
|
48
47
|
/**
|
|
49
48
|
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
50
49
|
*
|
|
@@ -211,6 +210,10 @@ type ClassValidator = (classPart: string) => boolean;
|
|
|
211
210
|
interface ThemeGetter {
|
|
212
211
|
(theme: ThemeObject<AnyThemeGroupIds>): ClassGroup<AnyClassGroupIds>;
|
|
213
212
|
isThemeGetter: true;
|
|
213
|
+
/**
|
|
214
|
+
* The theme key the getter reads. Set on getters created with `fromTheme` so that tooling (e.g. config generators) can identify the referenced theme scale without invoking the getter. Optional because theme getters can be hand-written.
|
|
215
|
+
*/
|
|
216
|
+
themeKey?: string;
|
|
214
217
|
}
|
|
215
218
|
type ClassObject<ThemeGroupIds extends string> = Record<string, readonly ClassDefinition<ThemeGroupIds>[]>;
|
|
216
219
|
/**
|
|
@@ -224,14 +227,14 @@ type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
|
224
227
|
*
|
|
225
228
|
* The NoInfer helper above doesn't prevent inference from array items in all cases, so this keeps config arrays like `postfixLookupClassGroups` from defining or narrowing class group IDs. Once tailwind-merge only supports TypeScript 5.4 and newer, this can be replaced with TypeScript's built-in NoInfer utility type.
|
|
226
229
|
*/
|
|
227
|
-
type NoInferString<T extends string> = T extends infer S ? S & string : never;
|
|
230
|
+
type NoInferString<T extends string> = T extends (infer S) ? S & string : never;
|
|
228
231
|
/**
|
|
229
232
|
* Theme group IDs included in the default configuration of tailwind-merge.
|
|
230
233
|
*
|
|
231
234
|
* If you want to use a scale that is not supported in the `ThemeObject` type,
|
|
232
235
|
* consider using `classGroups` instead of `theme`.
|
|
233
236
|
*
|
|
234
|
-
* @see https://github.com/dcastil/tailwind-merge/blob/
|
|
237
|
+
* @see https://github.com/dcastil/tailwind-merge/blob/tailwind-merge@3.7.0/packages/tailwind-merge/docs/configuration.md#theme
|
|
235
238
|
* (the list of supported keys may vary between `tailwind-merge` versions)
|
|
236
239
|
*/
|
|
237
240
|
type DefaultThemeGroupIds = 'animate' | 'aspect' | 'blur' | 'breakpoint' | 'color' | 'container' | 'drop-shadow' | 'ease' | 'font-weight' | 'font' | 'inset-shadow' | 'leading' | 'perspective' | 'radius' | 'shadow' | 'spacing' | 'text' | 'text-shadow' | 'tracking';
|
|
@@ -250,22 +253,22 @@ declare const extendTailwindMerge: <AdditionalClassGroupIds extends string = nev
|
|
|
250
253
|
//#endregion
|
|
251
254
|
//#region src/proseTwMerge.d.ts
|
|
252
255
|
type ProseClassGroupIds = 'prose-size' | 'prose-color';
|
|
253
|
-
declare const proseTwMergeClassGroups: NonNullable<NonNullable<ConfigExtension<ProseClassGroupIds, never>['extend']>['classGroups']>;
|
|
256
|
+
export declare const proseTwMergeClassGroups: NonNullable<NonNullable<ConfigExtension<ProseClassGroupIds, never>['extend']>['classGroups']>;
|
|
254
257
|
/**
|
|
255
258
|
* Prose-aware `tailwind-merge` instance that deduplicates `prose-*` classes.
|
|
256
259
|
* Used by `cn(...)` internally. Also exported for direct use in components
|
|
257
260
|
* that need prose-aware class merging outside of `cn`.
|
|
258
261
|
*/
|
|
259
|
-
declare const proseTwMerge: (...classLists: ClassNameValue[]) => string;
|
|
262
|
+
export declare const proseTwMerge: (...classLists: ClassNameValue[]) => string;
|
|
260
263
|
//#endregion
|
|
261
264
|
//#region src/slugify.d.ts
|
|
262
265
|
interface SlugifyOptions extends Options {
|
|
263
266
|
/** When true, dots are also replaced (default is false) */
|
|
264
267
|
replaceDots?: boolean;
|
|
265
268
|
}
|
|
266
|
-
declare const slugify: (string: string, options?: SlugifyOptions) => string;
|
|
269
|
+
export declare const slugify: (string: string, options?: SlugifyOptions) => string;
|
|
267
270
|
//#endregion
|
|
268
|
-
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.
|
|
271
|
+
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.7.0_tailwindcss@4.3.3/node_modules/tailwind-variants/dist/config.d.ts
|
|
269
272
|
type MergeConfig = Parameters<typeof extendTailwindMerge>[0];
|
|
270
273
|
type LegacyMergeConfig = Extract<MergeConfig, {
|
|
271
274
|
extend?: unknown;
|
|
@@ -287,7 +290,7 @@ type TWMConfig = {
|
|
|
287
290
|
};
|
|
288
291
|
type TVConfig = TWMConfig;
|
|
289
292
|
//#endregion
|
|
290
|
-
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.
|
|
293
|
+
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.7.0_tailwindcss@4.3.3/node_modules/tailwind-variants/dist/types.d.ts
|
|
291
294
|
type ClassProp<V extends unknown = ClassNameValue> = {
|
|
292
295
|
class?: V;
|
|
293
296
|
className?: never;
|
|
@@ -310,23 +313,24 @@ type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
|
310
313
|
* ----------------------------------------------------------------------
|
|
311
314
|
*/
|
|
312
315
|
type TVSlotsWithBase<S extends TVSlots, B extends ClassNameValue> = B extends undefined ? keyof S : keyof S | TVBaseName;
|
|
313
|
-
type SlotsClassValue<S extends TVSlots, B extends ClassNameValue> = { [K in TVSlotsWithBase<S, B>]?: ClassNameValue };
|
|
316
|
+
type SlotsClassValue<S extends TVSlots, B extends ClassNameValue> = { [K in TVSlotsWithBase<S, B>]?: ClassNameValue; };
|
|
314
317
|
type TVVariantsDefault<S extends TVSlots, B extends ClassNameValue> = S extends undefined ? {} : {
|
|
315
318
|
[key: string]: {
|
|
316
319
|
[key: string]: S extends TVSlots ? SlotsClassValue<S, B> | ClassNameValue : ClassNameValue;
|
|
317
320
|
};
|
|
318
321
|
};
|
|
319
|
-
type TVVariants<S extends TVSlots | undefined, B extends ClassNameValue | undefined = undefined, EV extends TVVariants<ES> | undefined = undefined, ES extends TVSlots | undefined = undefined> = EV extends undefined ? TVVariantsDefault<S, B> : { [K in keyof EV]: { [K2 in keyof EV[K]]: S extends TVSlots ? SlotsClassValue<S, B> | ClassNameValue : ClassNameValue } } | TVVariantsDefault<S, B>;
|
|
320
|
-
type TVCompoundVariants<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots> = Array<{ [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never) | (K extends keyof V ? StringToBoolean<keyof V[K]>[] : never) } & ClassProp<SlotsClassValue<S, B> | ClassNameValue>>;
|
|
322
|
+
type TVVariants<S extends TVSlots | undefined, B extends ClassNameValue | undefined = undefined, EV extends TVVariants<ES> | undefined = undefined, ES extends TVSlots | undefined = undefined> = EV extends undefined ? TVVariantsDefault<S, B> : { [K in keyof EV]: { [K2 in keyof EV[K]]: S extends TVSlots ? SlotsClassValue<S, B> | ClassNameValue : ClassNameValue; }; } | TVVariantsDefault<S, B>;
|
|
323
|
+
type TVCompoundVariants<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots> = Array<{ [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never) | (K extends keyof V ? StringToBoolean<keyof V[K]>[] : never); } & ClassProp<SlotsClassValue<S, B> | ClassNameValue>>;
|
|
321
324
|
type TVCompoundSlots<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue> = Array<V extends undefined ? {
|
|
322
325
|
slots: Array<TVSlotsWithBase<S, B>>;
|
|
323
326
|
} & ClassProp : {
|
|
324
327
|
slots: Array<TVSlotsWithBase<S, B>>;
|
|
325
|
-
} & { [K in keyof V]?: StringToBoolean<keyof V[K]> | StringToBoolean<keyof V[K]>[] } & ClassProp>;
|
|
326
|
-
type TVDefaultVariants<V extends TVVariants<S>, S extends TVSlots, EV extends TVVariants<ES>, ES extends TVSlots> = { [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never) };
|
|
327
|
-
type TVProps$1<V extends TVVariants<S>, S extends TVSlots, EV extends TVVariants<ES>, ES extends TVSlots> = EV extends undefined ? V extends undefined ? ClassProp<ClassNameValue> : { [K in keyof V]?: StringToBoolean<keyof V[K]> | undefined } & ClassProp<ClassNameValue> : V extends undefined ? { [K in keyof EV]?: StringToBoolean<keyof EV[K]> | undefined } & ClassProp<ClassNameValue> : { [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never) | undefined } & ClassProp<ClassNameValue>;
|
|
328
|
+
} & { [K in keyof V]?: StringToBoolean<keyof V[K]> | StringToBoolean<keyof V[K]>[]; } & ClassProp>;
|
|
329
|
+
type TVDefaultVariants<V extends TVVariants<S>, S extends TVSlots, EV extends TVVariants<ES>, ES extends TVSlots> = { [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never); };
|
|
330
|
+
type TVProps$1<V extends TVVariants<S>, S extends TVSlots, EV extends TVVariants<ES>, ES extends TVSlots> = EV extends undefined ? V extends undefined ? ClassProp<ClassNameValue> : { [K in keyof V]?: StringToBoolean<keyof V[K]> | undefined; } & ClassProp<ClassNameValue> : V extends undefined ? { [K in keyof EV]?: StringToBoolean<keyof EV[K]> | undefined; } & ClassProp<ClassNameValue> : { [K in keyof V | keyof EV]?: (K extends keyof V ? StringToBoolean<keyof V[K]> : never) | (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never) | undefined; } & ClassProp<ClassNameValue>;
|
|
328
331
|
type TVVariantKeys<V extends TVVariants<S>, S extends TVSlots> = V extends Object ? Array<keyof V> : undefined;
|
|
329
|
-
type TVReturnProps<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
332
|
+
type TVReturnProps<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
333
|
+
// @ts-expect-error
|
|
330
334
|
E extends TVReturnType = undefined> = {
|
|
331
335
|
extend: E;
|
|
332
336
|
base: B;
|
|
@@ -338,15 +342,19 @@ E extends TVReturnType = undefined> = {
|
|
|
338
342
|
variantKeys: TVVariantKeys<V, S>;
|
|
339
343
|
};
|
|
340
344
|
type HasSlots<S extends TVSlots, ES extends TVSlots> = S extends undefined ? ES extends undefined ? false : true : true;
|
|
341
|
-
type TVReturnType<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
345
|
+
type TVReturnType<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
346
|
+
// @ts-expect-error
|
|
342
347
|
E extends TVReturnType = undefined> = {
|
|
343
|
-
(props?: TVProps$1<V, S, EV, ES>): HasSlots<S, ES> extends true ? { [K in keyof (ES extends undefined ? {} : ES)]: (slotProps?: TVProps$1<V, S, EV, ES>) => string } & { [K in keyof (S extends undefined ? {} : S)]: (slotProps?: TVProps$1<V, S, EV, ES>) => string } & { [K in TVSlotsWithBase<{}, B>]: (slotProps?: TVProps$1<V, S, EV, ES>) => string } : string;
|
|
348
|
+
(props?: TVProps$1<V, S, EV, ES>): HasSlots<S, ES> extends true ? { [K in keyof (ES extends undefined ? {} : ES)]: (slotProps?: TVProps$1<V, S, EV, ES>) => string; } & { [K in keyof (S extends undefined ? {} : S)]: (slotProps?: TVProps$1<V, S, EV, ES>) => string; } & { [K in TVSlotsWithBase<{}, B>]: (slotProps?: TVProps$1<V, S, EV, ES>) => string; } : string;
|
|
344
349
|
} & TVReturnProps<V, S, B, EV, ES, E>;
|
|
345
350
|
type TV = {
|
|
346
|
-
<V extends TVVariants<S, B, EV>, CV extends TVCompoundVariants<V, S, B, EV, ES>, DV extends TVDefaultVariants<V, S, EV, ES>, B extends ClassNameValue = undefined, S extends TVSlots = undefined,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
351
|
+
<V extends TVVariants<S, B, EV>, CV extends TVCompoundVariants<V, S, B, EV, ES>, DV extends TVDefaultVariants<V, S, EV, ES>, B extends ClassNameValue = undefined, S extends TVSlots = undefined,
|
|
352
|
+
// @ts-expect-error
|
|
353
|
+
E extends TVReturnType = TVReturnType<V, S, B,
|
|
354
|
+
// @ts-expect-error
|
|
355
|
+
EV extends undefined ? {} : EV,
|
|
356
|
+
// @ts-expect-error
|
|
357
|
+
ES extends undefined ? {} : ES>, EV extends TVVariants<ES, B, E["variants"], ES> = E["variants"], ES extends TVSlots = E["slots"] extends TVSlots ? E["slots"] : undefined>(options: {
|
|
350
358
|
/**
|
|
351
359
|
* Extend allows for easy composition of components.
|
|
352
360
|
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
@@ -385,12 +393,11 @@ type TV = {
|
|
|
385
393
|
* The config object allows you to modify the default configuration.
|
|
386
394
|
* @see https://www.tailwind-variants.org/docs/api-reference#config-optional
|
|
387
395
|
*/
|
|
388
|
-
|
|
389
396
|
config?: TVConfig): TVReturnType<V, S, B, EV, ES, E>;
|
|
390
397
|
};
|
|
391
398
|
type VariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "class" | "className">;
|
|
392
399
|
//#endregion
|
|
393
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
400
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/colors/types.d.ts
|
|
394
401
|
type ColorScale = Partial<{
|
|
395
402
|
50: string;
|
|
396
403
|
100: string;
|
|
@@ -425,7 +432,7 @@ type ThemeColors = BaseColors & {
|
|
|
425
432
|
danger: ColorScale;
|
|
426
433
|
};
|
|
427
434
|
//#endregion
|
|
428
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
435
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/types.d.ts
|
|
429
436
|
type DefaultThemeType = "light" | "dark";
|
|
430
437
|
type BaseThemeUnit = {
|
|
431
438
|
small?: string;
|
|
@@ -561,7 +568,7 @@ type HeroUIPluginConfig = {
|
|
|
561
568
|
defaultExtendTheme?: DefaultThemeType;
|
|
562
569
|
};
|
|
563
570
|
//#endregion
|
|
564
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
571
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/colors.d.mts
|
|
565
572
|
declare const _default: {
|
|
566
573
|
inherit: string;
|
|
567
574
|
current: string;
|
|
@@ -908,7 +915,7 @@ declare const _default: {
|
|
|
908
915
|
};
|
|
909
916
|
};
|
|
910
917
|
//#endregion
|
|
911
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
918
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts
|
|
912
919
|
type NamedUtilityValue = {
|
|
913
920
|
kind: 'named';
|
|
914
921
|
/**
|
|
@@ -934,7 +941,7 @@ type PluginUtils = {
|
|
|
934
941
|
colors: typeof _default;
|
|
935
942
|
};
|
|
936
943
|
//#endregion
|
|
937
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
944
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/types-DWdTiksJ.d.mts
|
|
938
945
|
/**
|
|
939
946
|
* The source code for one or more nodes in the AST
|
|
940
947
|
*
|
|
@@ -964,7 +971,8 @@ type Config = UserConfig;
|
|
|
964
971
|
type PluginFn = (api: PluginAPI) => void;
|
|
965
972
|
type PluginWithConfig = {
|
|
966
973
|
handler: PluginFn;
|
|
967
|
-
config?: UserConfig;
|
|
974
|
+
config?: UserConfig;
|
|
975
|
+
/** @internal */
|
|
968
976
|
reference?: boolean;
|
|
969
977
|
src?: SourceLocation | undefined;
|
|
970
978
|
};
|
|
@@ -1057,13 +1065,13 @@ interface UserConfig {
|
|
|
1057
1065
|
experimental?: 'all' | Record<string, boolean>;
|
|
1058
1066
|
}
|
|
1059
1067
|
//#endregion
|
|
1060
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
1068
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/plugin.d.mts
|
|
1061
1069
|
declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
|
|
1062
1070
|
declare namespace createPlugin {
|
|
1063
1071
|
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
|
|
1064
1072
|
}
|
|
1065
1073
|
//#endregion
|
|
1066
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
1074
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/plugin.d.ts
|
|
1067
1075
|
/**
|
|
1068
1076
|
* Based on tw-colors by L-Blondy
|
|
1069
1077
|
* @see https://github.com/L-Blondy/tw-colors
|
|
@@ -1075,7 +1083,7 @@ declare const heroui: (config?: HeroUIPluginConfig) => ReturnType<typeof createP
|
|
|
1075
1083
|
* Represents a class value which can be either a string or an array of strings
|
|
1076
1084
|
* Used for handling both single class names and multiple class names
|
|
1077
1085
|
*/
|
|
1078
|
-
type ClassValue = string | string[];
|
|
1086
|
+
export type ClassValue = string | string[];
|
|
1079
1087
|
/**
|
|
1080
1088
|
* Props accepted by tailwind-variants slot functions
|
|
1081
1089
|
* Combines a dynamic record of string/number values with the ClassProp from tailwind-variants
|
|
@@ -1098,17 +1106,17 @@ type TVRecord = Record<string, TVFunction>;
|
|
|
1098
1106
|
* Re-export of tailwind-variants tv function
|
|
1099
1107
|
* Used to create variant definitions with slots and variants
|
|
1100
1108
|
*/
|
|
1101
|
-
declare const tv: TV;
|
|
1109
|
+
export declare const tv: TV;
|
|
1102
1110
|
/**
|
|
1103
1111
|
* Extracts variant props from a tailwind-variants component
|
|
1104
1112
|
* Used for typing component props that use variants
|
|
1105
1113
|
*/
|
|
1106
|
-
type TVProps<Component extends (...args: any) => any> = VariantProps<Component>;
|
|
1114
|
+
export type TVProps<Component extends (...args: any) => any> = VariantProps<Component>;
|
|
1107
1115
|
/**
|
|
1108
1116
|
* Extracts className type from a tailwind-variants component
|
|
1109
1117
|
* Can be either a partial record of slot names to class values, or a single class value
|
|
1110
1118
|
*/
|
|
1111
|
-
type TVClassName<Component extends (...args: any) => any> = Partial<Record<keyof ReturnType<Component>, ClassValue>> | ClassValue;
|
|
1119
|
+
export type TVClassName<Component extends (...args: any) => any> = Partial<Record<keyof ReturnType<Component>, ClassValue>> | ClassValue;
|
|
1112
1120
|
/**
|
|
1113
1121
|
* Converts tailwind-variants slots instance to actual classnames object
|
|
1114
1122
|
*
|
|
@@ -1134,7 +1142,7 @@ type TVClassName<Component extends (...args: any) => any> = Partial<Record<keyof
|
|
|
1134
1142
|
* // Result: { base: 'bg-white', content: 'p-4 text-gray-700' }
|
|
1135
1143
|
* ```
|
|
1136
1144
|
*/
|
|
1137
|
-
declare const variantsToClassNames: <T extends TVRecord>(variants: T, className?: ClassValue | Record<string, ClassValue>, baseSlot?: keyof T) => Record<keyof T, string>;
|
|
1145
|
+
export declare const variantsToClassNames: <T extends TVRecord>(variants: T, className?: ClassValue | Record<string, ClassValue>, baseSlot?: keyof T) => Record<keyof T, string>;
|
|
1138
1146
|
//#endregion
|
|
1139
|
-
export {
|
|
1140
|
-
//# sourceMappingURL=index.d.
|
|
1147
|
+
export { heroui };
|
|
1148
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/cn.ts","../src/isTestEnvironment.ts","../../../node_modules/.pnpm/tailwind-merge@3.7.0/node_modules/tailwind-merge/dist/types.d.ts","../src/proseTwMerge.ts","../src/slugify.ts","../../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.7.0_tailwindcss@4.3.3/node_modules/tailwind-variants/dist/config.d.ts","../../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.7.0_tailwindcss@4.3.3/node_modules/tailwind-variants/dist/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/colors/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/types.d.ts","../../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/colors.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/types-DWdTiksJ.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.3/node_modules/tailwindcss/dist/plugin.d.mts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.3/node_modules/@heroui/theme/dist/plugin.d.ts","../src/tv.ts"],"x_google_ignoreList":[2,5,6,7,8,9,10,11,12,13],"mappings":";;;;;;;;;;;;;;;;;;qBAsBa,QAAS,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;qBCElB;;;;;;;;;;;;KCfR,iBAAiB;KACjB,0BAA0B;;;;UAMrB,SAAO,8BAA8B,sCAAsC,kBAAkB,iBAAiB,eAAe;;;;UAK7H;;;;;;EAMN;;;;;EAKA;;;;;;;EAOA,4BAA4B,OAAO,kCAAkC;;;;;;;UAO/D;EACN;EACA,eAAe,oBAAoB;;;;;;;UAO7B;;;;;;EAMN;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;;;;;;;;;;;EAWA;;;;;UAKM,iBAAiB,8BAA8B;;;;;;EAMrD,OAAO,QAAQ,YAAY;;;;;;;;;;;;EAY3B,aAAa,QAAQ,OAAO,eAAe,WAAW;;;;;;;;;;EAUtD,wBAAwB,QAAQ,QAAQ,OAAO,wBAAwB;;;;;;;;EAQvE,gCAAgC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A;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEJ;IACI;IACA;IACA;IAC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;;iBCvHV,aAAa,SAAS,UAAU,SAAS,QAAQ,UAAU;kBAC1D;MACV,cAAc,GAAG,iBAAiB,UAAU,MAAM,UAAU,kBAAkB,UAAU,MAAM,QAAQ,YAAY,kBAAkB;;;;;;;;cCE9H,SAAS,SAAS,uBAAuB,kBAAkB;;;;;;;YCA7D;;;;;KAMP;GACF;GACA;IACC,UAAU;;;;;KAMT,cAAc,YAAY;;;;;KAM1B,WAAW,eAAe;;;;;qBAMlB,IAAI;;;;;YAOL,QAAQ,sBAAsB,qBACxC,aAAa;;;;;YAOH,YAAY,sBAAsB,qBAC1C,QAAQ,aAAa,WAAW,YAAY,eAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;qBA2BS,uBAAwB,UAAU,UAC7C,UAAU,GACV,YAAY,aAAa,eAAe,aACxC,iBAAiB,MAChB,aAAa"}
|
|
@@ -135,4 +135,4 @@ const variantsToClassNames = (variants, className, baseSlot) => {
|
|
|
135
135
|
//#endregion
|
|
136
136
|
export { cn, heroui, isTestEnvironment, proseTwMerge, proseTwMergeClassGroups, slugify, tv, variantsToClassNames };
|
|
137
137
|
|
|
138
|
-
//# sourceMappingURL=index.
|
|
138
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["tailwindVariants"],"sources":["../src/proseTwMerge.ts","../src/cn.ts","../src/isTestEnvironment.ts","../src/slugify.ts","../src/tv.ts"],"sourcesContent":["import type { ConfigExtension } from 'tailwind-merge';\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\ntype ProseClassGroupIds = 'prose-size' | 'prose-color';\n\n/**\n * Typography plugin size classes are standalone tokens like `prose-sm`\n * instead of regular utilities, so we register them as a custom merge group.\n */\nconst isProseSize = (value: string): boolean => {\n return value === 'base' || validators.isTshirtSize(value);\n};\n\n/**\n * Typography plugin color themes are also standalone `prose-*` classes.\n * Keep `prose-invert` out of this group so it can coexist with a color class.\n */\nconst isProseColor = (value: string): boolean => {\n return (\n value !== 'invert' &&\n !isProseSize(value) &&\n (validators.isAnyNonArbitrary(value) || validators.isArbitraryValue(value))\n );\n};\n\nexport const proseTwMergeClassGroups: NonNullable<\n NonNullable<\n ConfigExtension<ProseClassGroupIds, never>['extend']\n >['classGroups']\n> = {\n // Typography plugin sizes are mutually exclusive standalone classes.\n 'prose-size': [{ prose: [isProseSize] }],\n // Typography plugin color themes are also mutually exclusive standalone classes.\n 'prose-color': [{ prose: [isProseColor] }],\n};\n\n/**\n * Prose-aware `tailwind-merge` instance that deduplicates `prose-*` classes.\n * Used by `cn(...)` internally. Also exported for direct use in components\n * that need prose-aware class merging outside of `cn`.\n */\nexport const proseTwMerge = extendTailwindMerge<ProseClassGroupIds>({\n extend: {\n classGroups: proseTwMergeClassGroups,\n },\n});\n","/* eslint-disable import-x/prefer-default-export */\nimport type { ArgumentArray } from 'classnames';\n\nimport classNames from 'classnames';\n\nimport { proseTwMerge } from './proseTwMerge';\n\n/**\n * A utility function that combines `classnames` and `tailwind-merge`.\n *\n * It takes multiple class values (strings, arrays, or objects), merges them,\n * and ensures Tailwind CSS classes are handled properly by resolving conflicts.\n *\n * @param classes - A list of class names that can be strings, objects, or arrays.\n * @returns A string of combined class names with Tailwind CSS conflict resolution.\n *\n * Example usage:\n * ```\n * cn('p-4', 'text-center', { 'bg-red-500': true, 'p-2': false });\n * // Output: 'text-center bg-red-500 p-4'\n * ```\n */\nexport const cn = (...classes: ArgumentArray) => {\n // First, `classnames` merges the input class names (conditionally if needed).\n // Then, the shared prose-aware `tailwind-merge` instance resolves conflicts.\n return proseTwMerge(classNames(...classes));\n};\n","/* eslint-disable import-x/prefer-default-export */\n\n/**\n * Checks if the code is running in a test environment.\n *\n * This helper safely detects test environments by checking:\n * - Node.js: `process.env.NODE_ENV === 'test'` or `process.env.VITEST === 'true'`\n * - Browser: Always returns `false` (production code)\n *\n * The check is safe for both Node.js and browser environments by verifying\n * that `process` exists before accessing its properties.\n *\n * @returns `true` if running in a test environment, `false` otherwise\n *\n * @example\n * ```ts\n * if (isTestEnvironment()) {\n * // Skip debouncing in tests for immediate snapshots\n * return value;\n * }\n * // Normal production behavior with debouncing\n * return debouncedValue;\n * ```\n */\nexport const isTestEnvironment = (): boolean => {\n // Safe check: only access process if it exists (Node.js environment)\n // In browsers, process is undefined, so this returns false\n return (\n typeof process !== 'undefined' &&\n (process.env.NODE_ENV === 'test' || process.env.VITEST === 'true')\n );\n};\n","/* eslint-disable import-x/prefer-default-export */\n\nimport type { Options as SlugOptions } from 'slug';\n\nimport slug from 'slug';\n\ninterface SlugifyOptions extends SlugOptions {\n /** When true, dots are also replaced (default is false) */\n replaceDots?: boolean;\n}\n\nexport const slugify = (string: string, options?: SlugifyOptions) => {\n const replacement = options?.replacement ?? '_';\n const replaceDots = options?.replaceDots ?? false;\n\n return slug(string, {\n ...slug.defaults.modes.rfc3986,\n charmap: {\n ...slug.defaults.modes.rfc3986.charmap,\n // do not replace dots when replaceDots is false\n ...(!replaceDots ? { '.': '.' } : { '.': replacement }),\n // convert hyphens to underscores (when replacement is not hyphen)\n ...(replacement !== '-' ? { '-': '_' } : {}),\n },\n replacement,\n ...(options ?? {}),\n });\n};\n","import type { VariantProps } from '@heroui/theme';\nimport type { ClassProp, TV } from 'tailwind-variants';\n\nimport { tv as tailwindVariants } from 'tailwind-variants';\n\n/**\n * Represents a class value which can be either a string or an array of strings\n * Used for handling both single class names and multiple class names\n */\nexport type ClassValue = string | string[];\n\n/**\n * Props accepted by tailwind-variants slot functions\n * Combines a dynamic record of string/number values with the ClassProp from tailwind-variants\n */\ntype TVSlotProps = {\n [x: string]: string | number | undefined;\n [x: number]: string | number | undefined;\n} & ClassProp<ClassValue>;\n\n/**\n * Represents a tailwind-variants slot function\n * Takes optional TVSlotProps and returns a string of class names\n */\ntype TVFunction = (slotProps?: TVSlotProps) => string;\n\n/**\n * A record of slot names to their corresponding tailwind-variants functions\n * Used to type the variants parameter in variantsToClassNames\n */\ntype TVRecord = Record<string, TVFunction>;\n\n/**\n * Re-export of tailwind-variants tv function\n * Used to create variant definitions with slots and variants\n */\nexport const tv: TV = tailwindVariants;\n\n/**\n * Extracts variant props from a tailwind-variants component\n * Used for typing component props that use variants\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVProps<Component extends (...args: any) => any> =\n VariantProps<Component>;\n\n/**\n * Extracts className type from a tailwind-variants component\n * Can be either a partial record of slot names to class values, or a single class value\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVClassName<Component extends (...args: any) => any> =\n | Partial<Record<keyof ReturnType<Component>, ClassValue>>\n | ClassValue;\n\n/**\n * Converts tailwind-variants slots instance to actual classnames object\n *\n * @param variants - Object containing slot variant functions from tailwind-variants\n * @param className - Optional class names to merge with variant classes. Can be string, array, or record\n * @param baseSlot - Optional slot name to apply global className to\n * @returns Record mapping slot names to their final class name strings\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: 'bg-white', content: 'p-4' } });\n * const classes = variantsToClassNames(variants(), 'shadow-lg', 'base');\n * // Result: { base: 'bg-white shadow-lg', content: 'p-4' }\n * ```\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: '', content: '' } });\n * const classes = variantsToClassNames(variants(), {\n * base: 'bg-white',\n * content: ['p-4', 'text-gray-700']\n * });\n * // Result: { base: 'bg-white', content: 'p-4 text-gray-700' }\n * ```\n */\nexport const variantsToClassNames = <T extends TVRecord>(\n variants: T,\n className?: ClassValue | Record<string, ClassValue>,\n baseSlot?: keyof T,\n): Record<keyof T, string> => {\n const classNames =\n typeof className === 'object' && !Array.isArray(className) ? className : {};\n\n return Object.entries(variants).reduce(\n (acc, [slot, variantFn]) => {\n const slotKey = slot as keyof T;\n const slotClassName =\n typeof className === 'string' || Array.isArray(className)\n ? className\n : classNames[slot];\n\n // @ts-expect-error not sure here\n acc[slotKey] = variantFn({\n className:\n baseSlot && slot === baseSlot ? slotClassName : classNames[slot],\n });\n\n return acc;\n },\n {} as Record<keyof T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Y,CAAC;CAE5E,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,QAC7B,KAAK,CAAC,MAAM,eAAe;EAC1B,MAAM,UAAU;EAChB,MAAM,gBACJ,OAAO,cAAc,YAAY,MAAM,QAAQ,SAAS,IACpD,YACA,WAAW;EAGjB,IAAI,WAAW,UAAU,EACvB,WACE,YAAY,SAAS,WAAW,gBAAgB,WAAW,MAC/D,CAAC;EAED,OAAO;CACT,GACA,CAAC,CACH;AACF"}
|
package/package.json
CHANGED
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
"name": "@fuf-stack/pixel-utils",
|
|
3
3
|
"description": "fuf pixels helper utils",
|
|
4
4
|
"author": "Fröhlich ∧ Frei",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.4.1",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
-
"module": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
7
|
+
"types": "./dist/index.d.mts",
|
|
10
8
|
"sideEffects": false,
|
|
11
9
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
},
|
|
10
|
+
".": "./dist/index.mjs",
|
|
16
11
|
"./package.json": "./package.json"
|
|
17
12
|
},
|
|
18
13
|
"files": [
|
|
@@ -44,7 +39,7 @@
|
|
|
44
39
|
"@heroui/theme": "2.4.26",
|
|
45
40
|
"classnames": "2.5.1",
|
|
46
41
|
"slug": "9.1.0",
|
|
47
|
-
"tailwind-merge": "3.
|
|
42
|
+
"tailwind-merge": "3.7.0",
|
|
48
43
|
"tailwind-variants": "3.2.2"
|
|
49
44
|
},
|
|
50
45
|
"devDependencies": {
|
|
@@ -52,9 +47,9 @@
|
|
|
52
47
|
},
|
|
53
48
|
"inlinedDependencies": {
|
|
54
49
|
"@heroui/theme": "2.4.26",
|
|
55
|
-
"tailwind-merge": "3.
|
|
50
|
+
"tailwind-merge": "3.7.0",
|
|
56
51
|
"tailwind-variants": "3.2.2",
|
|
57
|
-
"tailwindcss": "4.3.
|
|
52
|
+
"tailwindcss": "4.3.3"
|
|
58
53
|
},
|
|
59
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "708bd806bdd1b51ac4204899d559586820a09c26"
|
|
60
55
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
|
-
let classnames = require("classnames");
|
|
25
|
-
classnames = __toESM(classnames, 1);
|
|
26
|
-
let tailwind_merge = require("tailwind-merge");
|
|
27
|
-
let slug = require("slug");
|
|
28
|
-
slug = __toESM(slug, 1);
|
|
29
|
-
let tailwind_variants = require("tailwind-variants");
|
|
30
|
-
let _heroui_theme = require("@heroui/theme");
|
|
31
|
-
//#region src/proseTwMerge.ts
|
|
32
|
-
/**
|
|
33
|
-
* Typography plugin size classes are standalone tokens like `prose-sm`
|
|
34
|
-
* instead of regular utilities, so we register them as a custom merge group.
|
|
35
|
-
*/
|
|
36
|
-
const isProseSize = (value) => {
|
|
37
|
-
return value === "base" || tailwind_merge.validators.isTshirtSize(value);
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Typography plugin color themes are also standalone `prose-*` classes.
|
|
41
|
-
* Keep `prose-invert` out of this group so it can coexist with a color class.
|
|
42
|
-
*/
|
|
43
|
-
const isProseColor = (value) => {
|
|
44
|
-
return value !== "invert" && !isProseSize(value) && (tailwind_merge.validators.isAnyNonArbitrary(value) || tailwind_merge.validators.isArbitraryValue(value));
|
|
45
|
-
};
|
|
46
|
-
const proseTwMergeClassGroups = {
|
|
47
|
-
"prose-size": [{ prose: [isProseSize] }],
|
|
48
|
-
"prose-color": [{ prose: [isProseColor] }]
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Prose-aware `tailwind-merge` instance that deduplicates `prose-*` classes.
|
|
52
|
-
* Used by `cn(...)` internally. Also exported for direct use in components
|
|
53
|
-
* that need prose-aware class merging outside of `cn`.
|
|
54
|
-
*/
|
|
55
|
-
const proseTwMerge = (0, tailwind_merge.extendTailwindMerge)({ extend: { classGroups: proseTwMergeClassGroups } });
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/cn.ts
|
|
58
|
-
/**
|
|
59
|
-
* A utility function that combines `classnames` and `tailwind-merge`.
|
|
60
|
-
*
|
|
61
|
-
* It takes multiple class values (strings, arrays, or objects), merges them,
|
|
62
|
-
* and ensures Tailwind CSS classes are handled properly by resolving conflicts.
|
|
63
|
-
*
|
|
64
|
-
* @param classes - A list of class names that can be strings, objects, or arrays.
|
|
65
|
-
* @returns A string of combined class names with Tailwind CSS conflict resolution.
|
|
66
|
-
*
|
|
67
|
-
* Example usage:
|
|
68
|
-
* ```
|
|
69
|
-
* cn('p-4', 'text-center', { 'bg-red-500': true, 'p-2': false });
|
|
70
|
-
* // Output: 'text-center bg-red-500 p-4'
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
const cn = (...classes) => {
|
|
74
|
-
return proseTwMerge((0, classnames.default)(...classes));
|
|
75
|
-
};
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/isTestEnvironment.ts
|
|
78
|
-
/**
|
|
79
|
-
* Checks if the code is running in a test environment.
|
|
80
|
-
*
|
|
81
|
-
* This helper safely detects test environments by checking:
|
|
82
|
-
* - Node.js: `process.env.NODE_ENV === 'test'` or `process.env.VITEST === 'true'`
|
|
83
|
-
* - Browser: Always returns `false` (production code)
|
|
84
|
-
*
|
|
85
|
-
* The check is safe for both Node.js and browser environments by verifying
|
|
86
|
-
* that `process` exists before accessing its properties.
|
|
87
|
-
*
|
|
88
|
-
* @returns `true` if running in a test environment, `false` otherwise
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* if (isTestEnvironment()) {
|
|
93
|
-
* // Skip debouncing in tests for immediate snapshots
|
|
94
|
-
* return value;
|
|
95
|
-
* }
|
|
96
|
-
* // Normal production behavior with debouncing
|
|
97
|
-
* return debouncedValue;
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
const isTestEnvironment = () => {
|
|
101
|
-
return typeof process !== "undefined" && (process.env.NODE_ENV === "test" || process.env.VITEST === "true");
|
|
102
|
-
};
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/slugify.ts
|
|
105
|
-
const slugify = (string, options) => {
|
|
106
|
-
const replacement = options?.replacement ?? "_";
|
|
107
|
-
const replaceDots = options?.replaceDots ?? false;
|
|
108
|
-
return (0, slug.default)(string, {
|
|
109
|
-
...slug.default.defaults.modes.rfc3986,
|
|
110
|
-
charmap: {
|
|
111
|
-
...slug.default.defaults.modes.rfc3986.charmap,
|
|
112
|
-
...!replaceDots ? { ".": "." } : { ".": replacement },
|
|
113
|
-
...replacement !== "-" ? { "-": "_" } : {}
|
|
114
|
-
},
|
|
115
|
-
replacement,
|
|
116
|
-
...options ?? {}
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/tv.ts
|
|
121
|
-
/**
|
|
122
|
-
* Re-export of tailwind-variants tv function
|
|
123
|
-
* Used to create variant definitions with slots and variants
|
|
124
|
-
*/
|
|
125
|
-
const tv = tailwind_variants.tv;
|
|
126
|
-
/**
|
|
127
|
-
* Converts tailwind-variants slots instance to actual classnames object
|
|
128
|
-
*
|
|
129
|
-
* @param variants - Object containing slot variant functions from tailwind-variants
|
|
130
|
-
* @param className - Optional class names to merge with variant classes. Can be string, array, or record
|
|
131
|
-
* @param baseSlot - Optional slot name to apply global className to
|
|
132
|
-
* @returns Record mapping slot names to their final class name strings
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* ```tsx
|
|
136
|
-
* const variants = tv({ slots: { base: 'bg-white', content: 'p-4' } });
|
|
137
|
-
* const classes = variantsToClassNames(variants(), 'shadow-lg', 'base');
|
|
138
|
-
* // Result: { base: 'bg-white shadow-lg', content: 'p-4' }
|
|
139
|
-
* ```
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* ```tsx
|
|
143
|
-
* const variants = tv({ slots: { base: '', content: '' } });
|
|
144
|
-
* const classes = variantsToClassNames(variants(), {
|
|
145
|
-
* base: 'bg-white',
|
|
146
|
-
* content: ['p-4', 'text-gray-700']
|
|
147
|
-
* });
|
|
148
|
-
* // Result: { base: 'bg-white', content: 'p-4 text-gray-700' }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
const variantsToClassNames = (variants, className, baseSlot) => {
|
|
152
|
-
const classNames = typeof className === "object" && !Array.isArray(className) ? className : {};
|
|
153
|
-
return Object.entries(variants).reduce((acc, [slot, variantFn]) => {
|
|
154
|
-
const slotKey = slot;
|
|
155
|
-
const slotClassName = typeof className === "string" || Array.isArray(className) ? className : classNames[slot];
|
|
156
|
-
acc[slotKey] = variantFn({ className: baseSlot && slot === baseSlot ? slotClassName : classNames[slot] });
|
|
157
|
-
return acc;
|
|
158
|
-
}, {});
|
|
159
|
-
};
|
|
160
|
-
//#endregion
|
|
161
|
-
exports.cn = cn;
|
|
162
|
-
Object.defineProperty(exports, "heroui", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function() {
|
|
165
|
-
return _heroui_theme.heroui;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
exports.isTestEnvironment = isTestEnvironment;
|
|
169
|
-
exports.proseTwMerge = proseTwMerge;
|
|
170
|
-
exports.proseTwMergeClassGroups = proseTwMergeClassGroups;
|
|
171
|
-
exports.slugify = slugify;
|
|
172
|
-
exports.tv = tv;
|
|
173
|
-
exports.variantsToClassNames = variantsToClassNames;
|
|
174
|
-
|
|
175
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["validators","tailwindVariants"],"sources":["../src/proseTwMerge.ts","../src/cn.ts","../src/isTestEnvironment.ts","../src/slugify.ts","../src/tv.ts"],"sourcesContent":["import type { ConfigExtension } from 'tailwind-merge';\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\ntype ProseClassGroupIds = 'prose-size' | 'prose-color';\n\n/**\n * Typography plugin size classes are standalone tokens like `prose-sm`\n * instead of regular utilities, so we register them as a custom merge group.\n */\nconst isProseSize = (value: string): boolean => {\n return value === 'base' || validators.isTshirtSize(value);\n};\n\n/**\n * Typography plugin color themes are also standalone `prose-*` classes.\n * Keep `prose-invert` out of this group so it can coexist with a color class.\n */\nconst isProseColor = (value: string): boolean => {\n return (\n value !== 'invert' &&\n !isProseSize(value) &&\n (validators.isAnyNonArbitrary(value) || validators.isArbitraryValue(value))\n );\n};\n\nexport const proseTwMergeClassGroups: NonNullable<\n NonNullable<\n ConfigExtension<ProseClassGroupIds, never>['extend']\n >['classGroups']\n> = {\n // Typography plugin sizes are mutually exclusive standalone classes.\n 'prose-size': [{ prose: [isProseSize] }],\n // Typography plugin color themes are also mutually exclusive standalone classes.\n 'prose-color': [{ prose: [isProseColor] }],\n};\n\n/**\n * Prose-aware `tailwind-merge` instance that deduplicates `prose-*` classes.\n * Used by `cn(...)` internally. Also exported for direct use in components\n * that need prose-aware class merging outside of `cn`.\n */\nexport const proseTwMerge = extendTailwindMerge<ProseClassGroupIds>({\n extend: {\n classGroups: proseTwMergeClassGroups,\n },\n});\n","/* eslint-disable import-x/prefer-default-export */\nimport type { ArgumentArray } from 'classnames';\n\nimport classNames from 'classnames';\n\nimport { proseTwMerge } from './proseTwMerge';\n\n/**\n * A utility function that combines `classnames` and `tailwind-merge`.\n *\n * It takes multiple class values (strings, arrays, or objects), merges them,\n * and ensures Tailwind CSS classes are handled properly by resolving conflicts.\n *\n * @param classes - A list of class names that can be strings, objects, or arrays.\n * @returns A string of combined class names with Tailwind CSS conflict resolution.\n *\n * Example usage:\n * ```\n * cn('p-4', 'text-center', { 'bg-red-500': true, 'p-2': false });\n * // Output: 'text-center bg-red-500 p-4'\n * ```\n */\nexport const cn = (...classes: ArgumentArray) => {\n // First, `classnames` merges the input class names (conditionally if needed).\n // Then, the shared prose-aware `tailwind-merge` instance resolves conflicts.\n return proseTwMerge(classNames(...classes));\n};\n","/* eslint-disable import-x/prefer-default-export */\n\n/**\n * Checks if the code is running in a test environment.\n *\n * This helper safely detects test environments by checking:\n * - Node.js: `process.env.NODE_ENV === 'test'` or `process.env.VITEST === 'true'`\n * - Browser: Always returns `false` (production code)\n *\n * The check is safe for both Node.js and browser environments by verifying\n * that `process` exists before accessing its properties.\n *\n * @returns `true` if running in a test environment, `false` otherwise\n *\n * @example\n * ```ts\n * if (isTestEnvironment()) {\n * // Skip debouncing in tests for immediate snapshots\n * return value;\n * }\n * // Normal production behavior with debouncing\n * return debouncedValue;\n * ```\n */\nexport const isTestEnvironment = (): boolean => {\n // Safe check: only access process if it exists (Node.js environment)\n // In browsers, process is undefined, so this returns false\n return (\n typeof process !== 'undefined' &&\n (process.env.NODE_ENV === 'test' || process.env.VITEST === 'true')\n );\n};\n","/* eslint-disable import-x/prefer-default-export */\n\nimport type { Options as SlugOptions } from 'slug';\n\nimport slug from 'slug';\n\ninterface SlugifyOptions extends SlugOptions {\n /** When true, dots are also replaced (default is false) */\n replaceDots?: boolean;\n}\n\nexport const slugify = (string: string, options?: SlugifyOptions) => {\n const replacement = options?.replacement ?? '_';\n const replaceDots = options?.replaceDots ?? false;\n\n return slug(string, {\n ...slug.defaults.modes.rfc3986,\n charmap: {\n ...slug.defaults.modes.rfc3986.charmap,\n // do not replace dots when replaceDots is false\n ...(!replaceDots ? { '.': '.' } : { '.': replacement }),\n // convert hyphens to underscores (when replacement is not hyphen)\n ...(replacement !== '-' ? { '-': '_' } : {}),\n },\n replacement,\n ...(options ?? {}),\n });\n};\n","import type { VariantProps } from '@heroui/theme';\nimport type { ClassProp, TV } from 'tailwind-variants';\n\nimport { tv as tailwindVariants } from 'tailwind-variants';\n\n/**\n * Represents a class value which can be either a string or an array of strings\n * Used for handling both single class names and multiple class names\n */\nexport type ClassValue = string | string[];\n\n/**\n * Props accepted by tailwind-variants slot functions\n * Combines a dynamic record of string/number values with the ClassProp from tailwind-variants\n */\ntype TVSlotProps = {\n [x: string]: string | number | undefined;\n [x: number]: string | number | undefined;\n} & ClassProp<ClassValue>;\n\n/**\n * Represents a tailwind-variants slot function\n * Takes optional TVSlotProps and returns a string of class names\n */\ntype TVFunction = (slotProps?: TVSlotProps) => string;\n\n/**\n * A record of slot names to their corresponding tailwind-variants functions\n * Used to type the variants parameter in variantsToClassNames\n */\ntype TVRecord = Record<string, TVFunction>;\n\n/**\n * Re-export of tailwind-variants tv function\n * Used to create variant definitions with slots and variants\n */\nexport const tv: TV = tailwindVariants;\n\n/**\n * Extracts variant props from a tailwind-variants component\n * Used for typing component props that use variants\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVProps<Component extends (...args: any) => any> =\n VariantProps<Component>;\n\n/**\n * Extracts className type from a tailwind-variants component\n * Can be either a partial record of slot names to class values, or a single class value\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVClassName<Component extends (...args: any) => any> =\n | Partial<Record<keyof ReturnType<Component>, ClassValue>>\n | ClassValue;\n\n/**\n * Converts tailwind-variants slots instance to actual classnames object\n *\n * @param variants - Object containing slot variant functions from tailwind-variants\n * @param className - Optional class names to merge with variant classes. Can be string, array, or record\n * @param baseSlot - Optional slot name to apply global className to\n * @returns Record mapping slot names to their final class name strings\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: 'bg-white', content: 'p-4' } });\n * const classes = variantsToClassNames(variants(), 'shadow-lg', 'base');\n * // Result: { base: 'bg-white shadow-lg', content: 'p-4' }\n * ```\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: '', content: '' } });\n * const classes = variantsToClassNames(variants(), {\n * base: 'bg-white',\n * content: ['p-4', 'text-gray-700']\n * });\n * // Result: { base: 'bg-white', content: 'p-4 text-gray-700' }\n * ```\n */\nexport const variantsToClassNames = <T extends TVRecord>(\n variants: T,\n className?: ClassValue | Record<string, ClassValue>,\n baseSlot?: keyof T,\n): Record<keyof T, string> => {\n const classNames =\n typeof className === 'object' && !Array.isArray(className) ? className : {};\n\n return Object.entries(variants).reduce(\n (acc, [slot, variantFn]) => {\n const slotKey = slot as keyof T;\n const slotClassName =\n typeof className === 'string' || Array.isArray(className)\n ? className\n : classNames[slot];\n\n // @ts-expect-error not sure here\n acc[slotKey] = variantFn({\n className:\n baseSlot && slot === baseSlot ? slotClassName : classNames[slot],\n });\n\n return acc;\n },\n {} as Record<keyof T, string>,\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO,cAAc,YAAY,CAAC,MAAM,QAAQ,SAAS,IAAI,YAAY,CAAC;CAE5E,OAAO,OAAO,QAAQ,QAAQ,EAAE,QAC7B,KAAK,CAAC,MAAM,eAAe;EAC1B,MAAM,UAAU;EAChB,MAAM,gBACJ,OAAO,cAAc,YAAY,MAAM,QAAQ,SAAS,IACpD,YACA,WAAW;EAGjB,IAAI,WAAW,UAAU,EACvB,WACE,YAAY,SAAS,WAAW,gBAAgB,WAAW,MAC/D,CAAC;EAED,OAAO;CACT,GACA,CAAC,CACH;AACF"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["ClassNameValue","ClassNameArray","twJoin","classLists","Config","ClassGroupIds","ThemeGroupIds","ConfigStaticPart","ConfigGroupsPart","ExperimentalParseClassNameParam","ParsedClassName","cacheSize","prefix","experimentalParseClassName","param","className","parseClassName","isExternal","modifiers","hasImportantModifier","baseClassName","maybePostfixModifierPosition","ThemeObject","NoInfer","ClassGroup","Record","Partial","NoInferString","theme","classGroups","conflictingClassGroups","conflictingClassGroupModifiers","postfixLookupClassGroups","orderSensitiveModifiers","ConfigExtension","PartialConfigGroupsPart","override","extend","ClassDefinition","ClassValidator","ThemeGetter","ClassObject","classPart","AnyThemeGroupIds","AnyClassGroupIds","isThemeGetter","T","S","DefaultThemeGroupIds","DefaultClassGroupIds","AnyConfig","CreateConfigFirst","CreateConfigSubsequent$1","config","TailwindMerge","createTailwindMerge","createConfigFirst","createConfigRest","getDefaultConfig","animate","aspect","blur","value","breakpoint","color","container","ease","font","leading","perspective","radius","shadow","spacing","text","tracking","columns","box","display","sr","float","clear","isolation","object","overflow","overscroll","position","inset","start","end","top","right","bottom","left","visibility","z","basis","flex","grow","shrink","order","col","span","row","gap","justify","content","items","baseline","self","p","px","py","ps","pe","pbs","pbe","pt","pr","pb","pl","m","mx","my","ms","me","mbs","mbe","mt","mr","mb","ml","size","inline","block","w","screen","h","list","placeholder","decoration","indent","tab","align","whitespace","break","wrap","hyphens","bg","repeat","linear","to","radial","conic","from","via","rounded","border","divide","outline","ring","opacity","mask","closest","farthest","filter","brightness","contrast","grayscale","invert","saturate","sepia","table","caption","transition","duration","delay","backface","rotate","scale","skew","transform","origin","translate","zoom","accent","appearance","caret","scheme","cursor","resize","scroll","scrollbar","snap","touch","select","fill","stroke","CreateConfigSubsequent","extendTailwindMerge","AdditionalClassGroupIds","AdditionalThemeGroupIds","configExtension","createConfig","fromTheme","DefaultThemeGroupIdsInner","key","mergeConfigs","baseConfig","twMerge","isFraction","isNumber","isInteger","isPercent","isTshirtSize","isAny","isAnyNonArbitrary","isNamedContainerQuery","isArbitrarySize","isArbitraryValue","isArbitraryLength","isArbitraryNumber","isArbitraryWeight","isArbitraryFamilyName","isArbitraryPosition","isArbitraryImage","isArbitraryShadow","isArbitraryVariable","isArbitraryVariableLength","isArbitraryVariableFamilyName","isArbitraryVariablePosition","isArbitraryVariableSize","isArbitraryVariableImage","isArbitraryVariableShadow","isArbitraryVariableWeight","validators_d_isAny","validators_d_isAnyNonArbitrary","validators_d_isArbitraryFamilyName","validators_d_isArbitraryImage","validators_d_isArbitraryLength","validators_d_isArbitraryNumber","validators_d_isArbitraryPosition","validators_d_isArbitraryShadow","validators_d_isArbitrarySize","validators_d_isArbitraryValue","validators_d_isArbitraryVariable","validators_d_isArbitraryVariableFamilyName","validators_d_isArbitraryVariableImage","validators_d_isArbitraryVariableLength","validators_d_isArbitraryVariablePosition","validators_d_isArbitraryVariableShadow","validators_d_isArbitraryVariableSize","validators_d_isArbitraryVariableWeight","validators_d_isArbitraryWeight","validators_d_isFraction","validators_d_isInteger","validators_d_isNamedContainerQuery","validators_d_isNumber","validators_d_isPercent","validators_d_isTshirtSize","validators_d","validators","ExperimentalParsedClassName","extendTailwindMerge","MergeConfig","Parameters","LegacyMergeConfig","Extract","extend","TWMergeConfig","TWMConfig","twMerge","twMergeConfig","TVConfig","ClassNameValue","ClassValue","TVConfig","ClassProp","V","class","className","TVBaseName","TVScreens","TVSlots","Record","OmitUndefined","T","StringToBoolean","CnClassValue","CnClassDictionary","CnClassArray","key","Array","CnOptions","CnReturn","isTrueOrArray","WithInitialScreen","TVSlotsWithBase","S","B","SlotsClassValue","K","TVVariantsDefault","TVVariants","EV","ES","K2","TVCompoundVariants","TVCompoundSlots","slots","TVDefaultVariants","TVScreenPropsValue","Screen","TVProps","TVVariantKeys","Object","TVReturnProps","E","TVReturnType","extend","base","variants","defaultVariants","compoundVariants","compoundSlots","variantKeys","HasSlots","props","slotProps","TV","CV","DV","options","config","TVLite","VariantProps","Component","Parameters","Omit","args","ColorScale","Partial","foreground","DEFAULT","BaseColors","background","divider","overlay","focus","content1","content2","content3","content4","ThemeColors","default","primary","secondary","success","warning","danger","SemanticBaseColors","light","dark","ThemeColors","DefaultThemeType","BaseThemeUnit","small","medium","large","FontThemeUnit","tiny","LayoutTheme","fontSize","lineHeight","radius","disabledOpacity","hoverOpacity","dividerWeight","borderWidth","boxShadow","ConfigTheme","Partial","extend","layout","colors","ConfigThemes","Record","HeroUIPluginConfig","prefix","addCommonColors","themes","defaultTheme","defaultExtendTheme","_default","inherit","current","transparent","black","white","slate","gray","zinc","neutral","stone","mauve","olive","mist","taupe","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","default","_default","ArbitraryUtilityValue","kind","dataType","value","NamedUtilityValue","fraction","ArbitraryModifier","NamedModifier","ArbitraryVariantValue","NamedVariantValue","Variant","selector","relative","root","modifier","variant","Candidate","property","variants","important","raw","PluginUtils","theme","keypath","defaultValue","colors","C","N","P","V","N","NamedUtilityValue","P","PluginUtils","Source","file","code","SourceLocation","source","start","end","Config","UserConfig","PluginFn","PluginAPI","api","PluginWithConfig","handler","config","reference","src","PluginWithOptions","T","options","__isOptionsFunction","Plugin","CssInJs","Record","Partial","addBase","base","addVariant","name","variant","matchVariant","value","modifier","extra","cb","values","sort","a","b","addUtilities","utilities","matchUtilities","type","supportsNegativeValues","__BARE_VALUE__","modifiers","addComponents","matchComponents","theme","path","defaultValue","prefix","className","key","ResolvableTo","utils","ThemeValue","ThemeConfig","extend","ContentFile","raw","extension","DarkModeStrategy","presets","plugins","content","relative","files","darkMode","blocklist","important","future","experimental","C","S","U","c","d","P","PluginUtils","a","PluginFn","C","Config","b","PluginWithConfig","c","PluginWithOptions","d","PluginAPI","PluginsConfig","T","ThemeConfig","createPlugin","Partial","handler","config","options","pluginFunction","configFunction","withOptions","PluginCreator","default","HeroUIPluginConfig","plugin","heroui","ReturnType","config"],"sources":["../src/cn.ts","../src/isTestEnvironment.ts","../../../node_modules/.pnpm/tailwind-merge@3.6.0/node_modules/tailwind-merge/dist/types.d.ts","../src/proseTwMerge.ts","../src/slugify.ts","../../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.0/node_modules/tailwind-variants/dist/config.d.ts","../../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.0/node_modules/tailwind-variants/dist/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.0/node_modules/@heroui/theme/dist/colors/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.0/node_modules/@heroui/theme/dist/types.d.ts","../../../node_modules/.pnpm/tailwindcss@4.3.0/node_modules/tailwindcss/dist/colors.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.0/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.0/node_modules/tailwindcss/dist/types-CJYAW1ql.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.0/node_modules/tailwindcss/dist/plugin.d.mts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.0/node_modules/@heroui/theme/dist/plugin.d.ts","../src/tv.ts"],"x_google_ignoreList":[2,5,6,7,8,9,10,11,12,13],"mapp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;AAAA,KYgCxC,OAAA,uBAA8B,IAAA,iBACxC,YAAY,CAAC,SAAA;;;;;KAOH,WAAA,uBAAkC,IAAA,iBAC1C,OAAA,CAAQ,MAAA,OAAa,UAAA,CAAW,SAAA,GAAY,UAAA,KAC5C,UAAA;;;;;;;AZrCgJ;AAAA;;;;;;;;;;;AAuB5D;AAAA;;;;;;cYyC3E,oBAAA,aAAkC,QAAA,EAC7C,QAAA,EAAU,CAAA,EACV,SAAA,GAAY,UAAA,GAAa,MAAA,SAAe,UAAA,GACxC,QAAA,SAAiB,CAAA,KAChB,MAAA,OAAa,CAAA"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["tailwindVariants"],"sources":["../src/proseTwMerge.ts","../src/cn.ts","../src/isTestEnvironment.ts","../src/slugify.ts","../src/tv.ts"],"sourcesContent":["import type { ConfigExtension } from 'tailwind-merge';\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\ntype ProseClassGroupIds = 'prose-size' | 'prose-color';\n\n/**\n * Typography plugin size classes are standalone tokens like `prose-sm`\n * instead of regular utilities, so we register them as a custom merge group.\n */\nconst isProseSize = (value: string): boolean => {\n return value === 'base' || validators.isTshirtSize(value);\n};\n\n/**\n * Typography plugin color themes are also standalone `prose-*` classes.\n * Keep `prose-invert` out of this group so it can coexist with a color class.\n */\nconst isProseColor = (value: string): boolean => {\n return (\n value !== 'invert' &&\n !isProseSize(value) &&\n (validators.isAnyNonArbitrary(value) || validators.isArbitraryValue(value))\n );\n};\n\nexport const proseTwMergeClassGroups: NonNullable<\n NonNullable<\n ConfigExtension<ProseClassGroupIds, never>['extend']\n >['classGroups']\n> = {\n // Typography plugin sizes are mutually exclusive standalone classes.\n 'prose-size': [{ prose: [isProseSize] }],\n // Typography plugin color themes are also mutually exclusive standalone classes.\n 'prose-color': [{ prose: [isProseColor] }],\n};\n\n/**\n * Prose-aware `tailwind-merge` instance that deduplicates `prose-*` classes.\n * Used by `cn(...)` internally. Also exported for direct use in components\n * that need prose-aware class merging outside of `cn`.\n */\nexport const proseTwMerge = extendTailwindMerge<ProseClassGroupIds>({\n extend: {\n classGroups: proseTwMergeClassGroups,\n },\n});\n","/* eslint-disable import-x/prefer-default-export */\nimport type { ArgumentArray } from 'classnames';\n\nimport classNames from 'classnames';\n\nimport { proseTwMerge } from './proseTwMerge';\n\n/**\n * A utility function that combines `classnames` and `tailwind-merge`.\n *\n * It takes multiple class values (strings, arrays, or objects), merges them,\n * and ensures Tailwind CSS classes are handled properly by resolving conflicts.\n *\n * @param classes - A list of class names that can be strings, objects, or arrays.\n * @returns A string of combined class names with Tailwind CSS conflict resolution.\n *\n * Example usage:\n * ```\n * cn('p-4', 'text-center', { 'bg-red-500': true, 'p-2': false });\n * // Output: 'text-center bg-red-500 p-4'\n * ```\n */\nexport const cn = (...classes: ArgumentArray) => {\n // First, `classnames` merges the input class names (conditionally if needed).\n // Then, the shared prose-aware `tailwind-merge` instance resolves conflicts.\n return proseTwMerge(classNames(...classes));\n};\n","/* eslint-disable import-x/prefer-default-export */\n\n/**\n * Checks if the code is running in a test environment.\n *\n * This helper safely detects test environments by checking:\n * - Node.js: `process.env.NODE_ENV === 'test'` or `process.env.VITEST === 'true'`\n * - Browser: Always returns `false` (production code)\n *\n * The check is safe for both Node.js and browser environments by verifying\n * that `process` exists before accessing its properties.\n *\n * @returns `true` if running in a test environment, `false` otherwise\n *\n * @example\n * ```ts\n * if (isTestEnvironment()) {\n * // Skip debouncing in tests for immediate snapshots\n * return value;\n * }\n * // Normal production behavior with debouncing\n * return debouncedValue;\n * ```\n */\nexport const isTestEnvironment = (): boolean => {\n // Safe check: only access process if it exists (Node.js environment)\n // In browsers, process is undefined, so this returns false\n return (\n typeof process !== 'undefined' &&\n (process.env.NODE_ENV === 'test' || process.env.VITEST === 'true')\n );\n};\n","/* eslint-disable import-x/prefer-default-export */\n\nimport type { Options as SlugOptions } from 'slug';\n\nimport slug from 'slug';\n\ninterface SlugifyOptions extends SlugOptions {\n /** When true, dots are also replaced (default is false) */\n replaceDots?: boolean;\n}\n\nexport const slugify = (string: string, options?: SlugifyOptions) => {\n const replacement = options?.replacement ?? '_';\n const replaceDots = options?.replaceDots ?? false;\n\n return slug(string, {\n ...slug.defaults.modes.rfc3986,\n charmap: {\n ...slug.defaults.modes.rfc3986.charmap,\n // do not replace dots when replaceDots is false\n ...(!replaceDots ? { '.': '.' } : { '.': replacement }),\n // convert hyphens to underscores (when replacement is not hyphen)\n ...(replacement !== '-' ? { '-': '_' } : {}),\n },\n replacement,\n ...(options ?? {}),\n });\n};\n","import type { VariantProps } from '@heroui/theme';\nimport type { ClassProp, TV } from 'tailwind-variants';\n\nimport { tv as tailwindVariants } from 'tailwind-variants';\n\n/**\n * Represents a class value which can be either a string or an array of strings\n * Used for handling both single class names and multiple class names\n */\nexport type ClassValue = string | string[];\n\n/**\n * Props accepted by tailwind-variants slot functions\n * Combines a dynamic record of string/number values with the ClassProp from tailwind-variants\n */\ntype TVSlotProps = {\n [x: string]: string | number | undefined;\n [x: number]: string | number | undefined;\n} & ClassProp<ClassValue>;\n\n/**\n * Represents a tailwind-variants slot function\n * Takes optional TVSlotProps and returns a string of class names\n */\ntype TVFunction = (slotProps?: TVSlotProps) => string;\n\n/**\n * A record of slot names to their corresponding tailwind-variants functions\n * Used to type the variants parameter in variantsToClassNames\n */\ntype TVRecord = Record<string, TVFunction>;\n\n/**\n * Re-export of tailwind-variants tv function\n * Used to create variant definitions with slots and variants\n */\nexport const tv: TV = tailwindVariants;\n\n/**\n * Extracts variant props from a tailwind-variants component\n * Used for typing component props that use variants\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVProps<Component extends (...args: any) => any> =\n VariantProps<Component>;\n\n/**\n * Extracts className type from a tailwind-variants component\n * Can be either a partial record of slot names to class values, or a single class value\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TVClassName<Component extends (...args: any) => any> =\n | Partial<Record<keyof ReturnType<Component>, ClassValue>>\n | ClassValue;\n\n/**\n * Converts tailwind-variants slots instance to actual classnames object\n *\n * @param variants - Object containing slot variant functions from tailwind-variants\n * @param className - Optional class names to merge with variant classes. Can be string, array, or record\n * @param baseSlot - Optional slot name to apply global className to\n * @returns Record mapping slot names to their final class name strings\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: 'bg-white', content: 'p-4' } });\n * const classes = variantsToClassNames(variants(), 'shadow-lg', 'base');\n * // Result: { base: 'bg-white shadow-lg', content: 'p-4' }\n * ```\n *\n * @example\n * ```tsx\n * const variants = tv({ slots: { base: '', content: '' } });\n * const classes = variantsToClassNames(variants(), {\n * base: 'bg-white',\n * content: ['p-4', 'text-gray-700']\n * });\n * // Result: { base: 'bg-white', content: 'p-4 text-gray-700' }\n * ```\n */\nexport const variantsToClassNames = <T extends TVRecord>(\n variants: T,\n className?: ClassValue | Record<string, ClassValue>,\n baseSlot?: keyof T,\n): Record<keyof T, string> => {\n const classNames =\n typeof className === 'object' && !Array.isArray(className) ? className : {};\n\n return Object.entries(variants).reduce(\n (acc, [slot, variantFn]) => {\n const slotKey = slot as keyof T;\n const slotClassName =\n typeof className === 'string' || Array.isArray(className)\n ? className\n : classNames[slot];\n\n // @ts-expect-error not sure here\n acc[slotKey] = variantFn({\n className:\n baseSlot && slot === baseSlot ? slotClassName : classNames[slot],\n });\n\n return acc;\n },\n {} as Record<keyof T, string>,\n );\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAM,eAAe,UAA2B;CAC9C,OAAO,UAAU,UAAU,WAAW,aAAa,KAAK;AAC1D;;;;;AAMA,MAAM,gBAAgB,UAA2B;CAC/C,OACE,UAAU,YACV,CAAC,YAAY,KAAK,MACjB,WAAW,kBAAkB,KAAK,KAAK,WAAW,iBAAiB,KAAK;AAE7E;AAEA,MAAa,0BAIT;CAEF,cAAc,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;CAEvC,eAAe,CAAC,EAAE,OAAO,CAAC,YAA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