From 0ef7c50322809d61ae0ce19dc9c5928cc9be5d6e Mon Sep 17 00:00:00 2001 From: pheralb Date: Thu, 21 Aug 2025 10:53:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20initial=20shadcn=20configurat?= =?UTF-8?q?ion=20files=20and=20utilities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.json | 16 ++++++++++++++++ src/styles/globals.css | 6 ++++++ src/utils/bits.ts | 11 +++++++++++ src/utils/cn.ts | 6 ++++++ 4 files changed, 39 insertions(+) create mode 100644 components.json create mode 100644 src/utils/bits.ts create mode 100644 src/utils/cn.ts diff --git a/components.json b/components.json new file mode 100644 index 0000000..1a5a787 --- /dev/null +++ b/components.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://shadcn-svelte.com/schema.json", + "tailwind": { + "css": "src\\styles\\globals.css", + "baseColor": "neutral" + }, + "aliases": { + "components": "@/components", + "utils": "@/utils", + "ui": "@/components/ui", + "hooks": "@/hooks", + "lib": "@/lib" + }, + "typescript": true, + "registry": "https://shadcn-svelte.com/registry" +} diff --git a/src/styles/globals.css b/src/styles/globals.css index f1d8c73..846b1f6 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1 +1,7 @@ @import "tailwindcss"; + +/* Plugins */ +@import "tw-animate-css"; + +/* Dark Mode */ +@custom-variant dark (&:is(.dark *)); diff --git a/src/utils/bits.ts b/src/utils/bits.ts new file mode 100644 index 0000000..bf0a087 --- /dev/null +++ b/src/utils/bits.ts @@ -0,0 +1,11 @@ +export type WithoutChild = T extends { child?: unknown } + ? Omit + : T; + +export type WithoutChildren = T extends { children?: unknown } + ? Omit + : T; +export type WithoutChildrenOrChild = WithoutChildren>; +export type WithElementRef = T & { + ref?: U | null; +}; diff --git a/src/utils/cn.ts b/src/utils/cn.ts new file mode 100644 index 0000000..a5ef193 --- /dev/null +++ b/src/utils/cn.ts @@ -0,0 +1,6 @@ +import { clsx, type ClassValue } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +}