feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
This commit is contained in:
23
frontend/src/shared/lib/cn.test.ts
Normal file
23
frontend/src/shared/lib/cn.test.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
import { cn } from "./cn";
|
||||
|
||||
describe("cn", () => {
|
||||
it("joins truthy fragments with single spaces", () => {
|
||||
expect(cn("a", "b", "c")).toBe("a b c");
|
||||
});
|
||||
|
||||
it("drops falsy fragments", () => {
|
||||
expect(cn("a", false, null, undefined, "", "b")).toBe("a b");
|
||||
});
|
||||
|
||||
it("supports conditional fragments", () => {
|
||||
const active = true;
|
||||
const disabled = false;
|
||||
expect(cn("base", active && "on", disabled && "off")).toBe("base on");
|
||||
});
|
||||
|
||||
it("returns an empty string when everything is falsy", () => {
|
||||
expect(cn(false, null, undefined)).toBe("");
|
||||
});
|
||||
});
|
||||
16
frontend/src/shared/lib/cn.ts
Normal file
16
frontend/src/shared/lib/cn.ts
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* `cn` — minimal className combiner for the design system.
|
||||
*
|
||||
* Joins truthy class fragments with a single space, dropping `false`,
|
||||
* `null`, `undefined` and empty strings. Deliberately dependency-free (no
|
||||
* `clsx`/`tailwind-merge`): the kit composes a small, controlled set of
|
||||
* classes, and conditional fragments cover every call site.
|
||||
*
|
||||
* @example
|
||||
* cn("px-2", isActive && "bg-primary", disabled && "opacity-50")
|
||||
*/
|
||||
export type ClassValue = string | false | null | undefined;
|
||||
|
||||
export function cn(...parts: ClassValue[]): string {
|
||||
return parts.filter(Boolean).join(" ");
|
||||
}
|
||||
Reference in New Issue
Block a user