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)); +}