@fuf-stack/pixel-utils 1.3.1 → 1.4.0
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} +31 -27
- 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 +5 -10
- 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`.
|
|
@@ -224,7 +223,7 @@ type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
|
224
223
|
*
|
|
225
224
|
* 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
225
|
*/
|
|
227
|
-
type NoInferString<T extends string> = T extends infer S ? S & string : never;
|
|
226
|
+
type NoInferString<T extends string> = T extends (infer S) ? S & string : never;
|
|
228
227
|
/**
|
|
229
228
|
* Theme group IDs included in the default configuration of tailwind-merge.
|
|
230
229
|
*
|
|
@@ -265,7 +264,7 @@ interface SlugifyOptions extends Options {
|
|
|
265
264
|
}
|
|
266
265
|
declare const slugify: (string: string, options?: SlugifyOptions) => string;
|
|
267
266
|
//#endregion
|
|
268
|
-
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.
|
|
267
|
+
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.2/node_modules/tailwind-variants/dist/config.d.ts
|
|
269
268
|
type MergeConfig = Parameters<typeof extendTailwindMerge>[0];
|
|
270
269
|
type LegacyMergeConfig = Extract<MergeConfig, {
|
|
271
270
|
extend?: unknown;
|
|
@@ -287,7 +286,7 @@ type TWMConfig = {
|
|
|
287
286
|
};
|
|
288
287
|
type TVConfig = TWMConfig;
|
|
289
288
|
//#endregion
|
|
290
|
-
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.
|
|
289
|
+
//#region ../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.2/node_modules/tailwind-variants/dist/types.d.ts
|
|
291
290
|
type ClassProp<V extends unknown = ClassNameValue> = {
|
|
292
291
|
class?: V;
|
|
293
292
|
className?: never;
|
|
@@ -310,23 +309,24 @@ type StringToBoolean<T> = T extends "true" | "false" ? boolean : T;
|
|
|
310
309
|
* ----------------------------------------------------------------------
|
|
311
310
|
*/
|
|
312
311
|
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 };
|
|
312
|
+
type SlotsClassValue<S extends TVSlots, B extends ClassNameValue> = { [K in TVSlotsWithBase<S, B>]?: ClassNameValue; };
|
|
314
313
|
type TVVariantsDefault<S extends TVSlots, B extends ClassNameValue> = S extends undefined ? {} : {
|
|
315
314
|
[key: string]: {
|
|
316
315
|
[key: string]: S extends TVSlots ? SlotsClassValue<S, B> | ClassNameValue : ClassNameValue;
|
|
317
316
|
};
|
|
318
317
|
};
|
|
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>>;
|
|
318
|
+
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>;
|
|
319
|
+
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
320
|
type TVCompoundSlots<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue> = Array<V extends undefined ? {
|
|
322
321
|
slots: Array<TVSlotsWithBase<S, B>>;
|
|
323
322
|
} & ClassProp : {
|
|
324
323
|
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>;
|
|
324
|
+
} & { [K in keyof V]?: StringToBoolean<keyof V[K]> | StringToBoolean<keyof V[K]>[]; } & ClassProp>;
|
|
325
|
+
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); };
|
|
326
|
+
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
327
|
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,
|
|
328
|
+
type TVReturnProps<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
329
|
+
// @ts-expect-error
|
|
330
330
|
E extends TVReturnType = undefined> = {
|
|
331
331
|
extend: E;
|
|
332
332
|
base: B;
|
|
@@ -338,15 +338,19 @@ E extends TVReturnType = undefined> = {
|
|
|
338
338
|
variantKeys: TVVariantKeys<V, S>;
|
|
339
339
|
};
|
|
340
340
|
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,
|
|
341
|
+
type TVReturnType<V extends TVVariants<S>, S extends TVSlots, B extends ClassNameValue, EV extends TVVariants<ES>, ES extends TVSlots,
|
|
342
|
+
// @ts-expect-error
|
|
342
343
|
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;
|
|
344
|
+
(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
345
|
} & TVReturnProps<V, S, B, EV, ES, E>;
|
|
345
346
|
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
|
-
|
|
347
|
+
<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,
|
|
348
|
+
// @ts-expect-error
|
|
349
|
+
E extends TVReturnType = TVReturnType<V, S, B,
|
|
350
|
+
// @ts-expect-error
|
|
351
|
+
EV extends undefined ? {} : EV,
|
|
352
|
+
// @ts-expect-error
|
|
353
|
+
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
354
|
/**
|
|
351
355
|
* Extend allows for easy composition of components.
|
|
352
356
|
* @see https://www.tailwind-variants.org/docs/composing-components
|
|
@@ -385,12 +389,11 @@ type TV = {
|
|
|
385
389
|
* The config object allows you to modify the default configuration.
|
|
386
390
|
* @see https://www.tailwind-variants.org/docs/api-reference#config-optional
|
|
387
391
|
*/
|
|
388
|
-
|
|
389
392
|
config?: TVConfig): TVReturnType<V, S, B, EV, ES, E>;
|
|
390
393
|
};
|
|
391
394
|
type VariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "class" | "className">;
|
|
392
395
|
//#endregion
|
|
393
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
396
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/node_modules/@heroui/theme/dist/colors/types.d.ts
|
|
394
397
|
type ColorScale = Partial<{
|
|
395
398
|
50: string;
|
|
396
399
|
100: string;
|
|
@@ -425,7 +428,7 @@ type ThemeColors = BaseColors & {
|
|
|
425
428
|
danger: ColorScale;
|
|
426
429
|
};
|
|
427
430
|
//#endregion
|
|
428
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
431
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/node_modules/@heroui/theme/dist/types.d.ts
|
|
429
432
|
type DefaultThemeType = "light" | "dark";
|
|
430
433
|
type BaseThemeUnit = {
|
|
431
434
|
small?: string;
|
|
@@ -561,7 +564,7 @@ type HeroUIPluginConfig = {
|
|
|
561
564
|
defaultExtendTheme?: DefaultThemeType;
|
|
562
565
|
};
|
|
563
566
|
//#endregion
|
|
564
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
567
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/colors.d.mts
|
|
565
568
|
declare const _default: {
|
|
566
569
|
inherit: string;
|
|
567
570
|
current: string;
|
|
@@ -908,7 +911,7 @@ declare const _default: {
|
|
|
908
911
|
};
|
|
909
912
|
};
|
|
910
913
|
//#endregion
|
|
911
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
914
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts
|
|
912
915
|
type NamedUtilityValue = {
|
|
913
916
|
kind: 'named';
|
|
914
917
|
/**
|
|
@@ -934,7 +937,7 @@ type PluginUtils = {
|
|
|
934
937
|
colors: typeof _default;
|
|
935
938
|
};
|
|
936
939
|
//#endregion
|
|
937
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
940
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/types-DWdTiksJ.d.mts
|
|
938
941
|
/**
|
|
939
942
|
* The source code for one or more nodes in the AST
|
|
940
943
|
*
|
|
@@ -964,7 +967,8 @@ type Config = UserConfig;
|
|
|
964
967
|
type PluginFn = (api: PluginAPI) => void;
|
|
965
968
|
type PluginWithConfig = {
|
|
966
969
|
handler: PluginFn;
|
|
967
|
-
config?: UserConfig;
|
|
970
|
+
config?: UserConfig;
|
|
971
|
+
/** @internal */
|
|
968
972
|
reference?: boolean;
|
|
969
973
|
src?: SourceLocation | undefined;
|
|
970
974
|
};
|
|
@@ -1057,13 +1061,13 @@ interface UserConfig {
|
|
|
1057
1061
|
experimental?: 'all' | Record<string, boolean>;
|
|
1058
1062
|
}
|
|
1059
1063
|
//#endregion
|
|
1060
|
-
//#region ../../node_modules/.pnpm/tailwindcss@4.3.
|
|
1064
|
+
//#region ../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/plugin.d.mts
|
|
1061
1065
|
declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
|
|
1062
1066
|
declare namespace createPlugin {
|
|
1063
1067
|
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
|
|
1064
1068
|
}
|
|
1065
1069
|
//#endregion
|
|
1066
|
-
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.
|
|
1070
|
+
//#region ../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/node_modules/@heroui/theme/dist/plugin.d.ts
|
|
1067
1071
|
/**
|
|
1068
1072
|
* Based on tw-colors by L-Blondy
|
|
1069
1073
|
* @see https://github.com/L-Blondy/tw-colors
|
|
@@ -1137,4 +1141,4 @@ type TVClassName<Component extends (...args: any) => any> = Partial<Record<keyof
|
|
|
1137
1141
|
declare const variantsToClassNames: <T extends TVRecord>(variants: T, className?: ClassValue | Record<string, ClassValue>, baseSlot?: keyof T) => Record<keyof T, string>;
|
|
1138
1142
|
//#endregion
|
|
1139
1143
|
export { ClassValue, TVClassName, TVProps, cn, heroui, isTestEnvironment, proseTwMerge, proseTwMergeClassGroups, slugify, tv, variantsToClassNames };
|
|
1140
|
-
//# sourceMappingURL=index.d.
|
|
1144
|
+
//# 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.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.2/node_modules/tailwind-variants/dist/config.d.ts","../../../node_modules/.pnpm/tailwind-variants@3.2.2_tailwind-merge@3.6.0_tailwindcss@4.3.2/node_modules/tailwind-variants/dist/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/node_modules/@heroui/theme/dist/colors/types.d.ts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/node_modules/@heroui/theme/dist/types.d.ts","../../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/colors.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/resolve-config-QUZ9b-Gn.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/types-DWdTiksJ.d.mts","../../../node_modules/.pnpm/tailwindcss@4.3.2/node_modules/tailwindcss/dist/plugin.d.mts","../../../node_modules/.pnpm/@heroui+theme@2.4.26_tailwindcss@4.3.2/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":";;;;;;;;;;;;;;;;;;cAsBa,QAAS,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;cCElB;;;;;;;;;;;;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;;;;;;;;;;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;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;IACA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EACA;;KAEC;UACK;EACN,UAAU;EACV,QAAQ;EACR,UAAU;;UAEJ;EACN,UAAU;IACN;IACA,OAAO;;;UAGL;EACN,WAAW;;UAEL;EACN;;UAEM;EACN;;UAEM;EACN;;UAEM;EACN,iBAAiB;;UAEX;EACN,uBAAuB;;;;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;;;;;;;KCA7D;;;;;KAMP;GACF;GACA;IACC,UAAU;;;;;KAMT,cAAc,YAAY;;;;;KAM1B,WAAW,eAAe;;;;;cAMlB,IAAI;;;;;KAOL,QAAQ,sBAAsB,qBACxC,aAAa;;;;;KAOH,YAAY,sBAAsB,qBAC1C,QAAQ,aAAa,WAAW,YAAY,eAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;cA2BS,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, 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,YAAY,EAAE,CAAC;AAC3C;;;;;;AAOA,MAAa,eAAe,oBAAwC,EAClE,QAAQ,EACN,aAAa,wBACf,EACF,CAAC;;;;;;;;;;;;;;;;;;ACxBD,MAAa,MAAM,GAAG,YAA2B;CAG/C,OAAO,aAAa,WAAW,GAAG,OAAO,CAAC;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;ACFA,MAAa,0BAAmC;CAG9C,OACE,OAAO,YAAY,gBAClB,QAAQ,IAAI,aAAa,UAAU,QAAQ,IAAI,WAAW;AAE/D;;;ACpBA,MAAa,WAAW,QAAgB,YAA6B;CACnE,MAAM,cAAc,SAAS,eAAe;CAC5C,MAAM,cAAc,SAAS,eAAe;CAE5C,OAAO,KAAK,QAAQ;EAClB,GAAG,KAAK,SAAS,MAAM;EACvB,SAAS;GACP,GAAG,KAAK,SAAS,MAAM,QAAQ;GAE/B,GAAI,CAAC,cAAc,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,YAAY;GAErD,GAAI,gBAAgB,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC;EAC5C;EACA;EACA,GAAI,WAAW,CAAC;CAClB,CAAC;AACH;;;;;;;ACSA,MAAa,KAASA;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CtB,MAAa,wBACX,UACA,WACA,aAC4B;CAC5B,MAAM,aACJ,OAAO,cAAc,YAAY,CAAC,MAAM,QAAQ,SAAS,IAAI,YAAY,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.0",
|
|
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": [
|
|
@@ -54,7 +49,7 @@
|
|
|
54
49
|
"@heroui/theme": "2.4.26",
|
|
55
50
|
"tailwind-merge": "3.6.0",
|
|
56
51
|
"tailwind-variants": "3.2.2",
|
|
57
|
-
"tailwindcss": "4.3.
|
|
52
|
+
"tailwindcss": "4.3.2"
|
|
58
53
|
},
|
|
59
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "349fecd188b6e688614c324c9bfbf7baac901379"
|
|
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)) as unknown as string;\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\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,UAAUA,eAAAA,WAAW,aAAa,KAAK;AAC1D;;;;;AAMA,MAAM,gBAAgB,UAA2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C,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],"mappings":";;;;;;;AAsBA;;;;AAA4C;;;;ACE5C;;;;cDFa,EAAA,MAAS,OAAA,EAAS,aAAa;;;;;;;AAA5C;;;;AAA4C;;;;ACE5C;;;;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,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)) as unknown as string;\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\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,YAAY,EAAE,CAAC;AAC3C;;;;;;AAOA,MAAa,eAAe,oBAAwC,EAClE,QAAQ,EACN,aAAa,wBACf,EACF,CAAC;;;;;;;;;;;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