forked from baron/baron-sso
common utils 경로로 cn helper 공용화
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
import { mergeClassNames } from "../../../common/core/utils";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return mergeClassNames(twMerge, [clsx(inputs)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateSecurePassword(length = 16): string {
|
export function generateSecurePassword(length = 16): string {
|
||||||
|
|||||||
6
common/core/utils/index.ts
Normal file
6
common/core/utils/index.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export function mergeClassNames(
|
||||||
|
mergeFn: (...classNames: string[]) => string,
|
||||||
|
classNames: string[],
|
||||||
|
) {
|
||||||
|
return mergeFn(...classNames);
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
import { mergeClassNames } from "../../../common/core/utils";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return mergeClassNames(twMerge, [clsx(inputs)]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
import { mergeClassNames } from "../../../common/core/utils";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return mergeClassNames(twMerge, [clsx(inputs)]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user