chore: cleanup

This commit is contained in:
Bereket Engida
2025-01-06 14:30:39 +03:00
parent 753f930e88
commit 9f2e45b8c7
525 changed files with 218 additions and 1357 deletions

View File

@@ -21,6 +21,9 @@
"complexity": { "complexity": {
"noUselessSwitchCase": "warn", "noUselessSwitchCase": "warn",
"noUselessTypeConstraint": "warn" "noUselessTypeConstraint": "warn"
},
"correctness": {
"noUnusedImports": "warn"
} }
} }
}, },

View File

@@ -6,7 +6,6 @@ import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card"; } from "@/components/ui/card";

View File

@@ -5,7 +5,6 @@ import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card"; } from "@/components/ui/card";

View File

@@ -2,13 +2,7 @@
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { import {
Dialog, Dialog,
DialogClose, DialogClose,
@@ -35,9 +29,7 @@ import {
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/ui/select";
import { import {
client,
organization, organization,
useActiveOrganization,
useListOrganizations, useListOrganizations,
useSession, useSession,
} from "@/lib/auth-client"; } from "@/lib/auth-client";

View File

@@ -1,5 +1,3 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css"; import "./globals.css";
import { Toaster } from "@/components/ui/sonner"; import { Toaster } from "@/components/ui/sonner";
import { ThemeProvider } from "@/components/theme-provider"; import { ThemeProvider } from "@/components/theme-provider";

View File

@@ -2,12 +2,10 @@ import { Metadata } from "next";
import { auth } from "@/lib/auth"; import { auth } from "@/lib/auth";
import { headers } from "next/headers"; import { headers } from "next/headers";
import { ArrowLeftRight, ArrowUpRight, Mail, Users } from "lucide-react"; import { ArrowLeftRight, ArrowUpRight, Mail, Users } from "lucide-react";
import { Card, CardContent, CardFooter } from "@/components/ui/card"; import { Card, CardContent } from "@/components/ui/card";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
import { Logo } from "@/components/logo"; import { Logo } from "@/components/logo";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link";
import { ConsentBtns } from "./concet-buttons"; import { ConsentBtns } from "./concet-buttons";
export const metadata: Metadata = { export const metadata: Metadata = {

View File

@@ -15,8 +15,7 @@ import {
CommandList, CommandList,
CommandSeparator, CommandSeparator,
} from "@/components/ui/command"; } from "@/components/ui/command";
import { ChevronDown, LogOutIcon, PlusCircle } from "lucide-react"; import { ChevronDown, PlusCircle } from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { Session } from "@/lib/auth-types"; import { Session } from "@/lib/auth-types";
import { client, useSession } from "@/lib/auth-client"; import { client, useSession } from "@/lib/auth-client";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";

View File

@@ -14,12 +14,8 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input"; import { PasswordInput } from "@/components/ui/password-input";
import { signIn } from "@/lib/auth-client"; import { signIn } from "@/lib/auth-client";
import { import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons";
DiscordLogoIcon, import { Key, Loader2 } from "lucide-react";
GitHubLogoIcon,
TwitterLogoIcon,
} from "@radix-ui/react-icons";
import { Key, Loader2, TwitchIcon } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { useState } from "react"; import { useState } from "react";

View File

@@ -14,7 +14,7 @@ import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input"; import { PasswordInput } from "@/components/ui/password-input";
import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons"; import { DiscordLogoIcon, GitHubLogoIcon } from "@radix-ui/react-icons";
import { useState } from "react"; import { useState } from "react";
import { client, signIn, signUp } from "@/lib/auth-client"; import { signIn, signUp } from "@/lib/auth-client";
import Image from "next/image"; import Image from "next/image";
import { Loader2, X } from "lucide-react"; import { Loader2, X } from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";

View File

@@ -1,6 +1,4 @@
"use client"; "use client";
import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes"; import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types"; import { type ThemeProviderProps } from "next-themes/dist/types";

View File

@@ -1,6 +1,4 @@
"use client"; "use client";
import * as React from "react";
import { Moon, Sun } from "lucide-react"; import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";

View File

@@ -2,11 +2,6 @@
import * as React from "react"; import * as React from "react";
import * as RechartsPrimitive from "recharts"; import * as RechartsPrimitive from "recharts";
import {
NameType,
Payload,
ValueType,
} from "recharts/types/component/DefaultTooltipContent";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";

View File

@@ -9,7 +9,6 @@ import {
oAuthProxy, oAuthProxy,
openAPI, openAPI,
oidcProvider, oidcProvider,
createAuthMiddleware,
} from "better-auth/plugins"; } from "better-auth/plugins";
import { reactInvitationEmail } from "./email/invitation"; import { reactInvitationEmail } from "./email/invitation";
import { LibsqlDialect } from "@libsql/kysely-libsql"; import { LibsqlDialect } from "@libsql/kysely-libsql";
@@ -110,7 +109,7 @@ export const auth = betterAuth({
plugins: [ plugins: [
organization({ organization({
async sendInvitationEmail(data) { async sendInvitationEmail(data) {
const res = await resend.emails.send({ await resend.emails.send({
from, from,
to: data.email, to: data.email,
subject: "You've been invited to join an organization", subject: "You've been invited to join an organization",

View File

@@ -15,7 +15,6 @@ import {
Text, Text,
Tailwind, Tailwind,
} from "@react-email/components"; } from "@react-email/components";
import * as React from "react";
interface BetterAuthInviteUserEmailProps { interface BetterAuthInviteUserEmailProps {
username?: string; username?: string;

View File

@@ -12,7 +12,6 @@ import {
Tailwind, Tailwind,
Section, Section,
} from "@react-email/components"; } from "@react-email/components";
import * as React from "react";
interface BetterAuthResetPasswordEmailProps { interface BetterAuthResetPasswordEmailProps {
username?: string; username?: string;

View File

@@ -1,5 +1,3 @@
import { createAuthClient } from "better-auth/client";
await fetch("http://localhost:4000/api/auth/sign-up/email", { await fetch("http://localhost:4000/api/auth/sign-up/email", {
method: "POST", method: "POST",
body: JSON.stringify({ body: JSON.stringify({

View File

@@ -2,7 +2,6 @@ import Link from "next/link";
import { useId } from "react"; import { useId } from "react";
import clsx from "clsx"; import clsx from "clsx";
import { Logo } from "@/components/logo";
import { DiscordLogoIcon } from "@radix-ui/react-icons"; import { DiscordLogoIcon } from "@radix-ui/react-icons";
function BookIcon(props: React.ComponentPropsWithoutRef<"svg">) { function BookIcon(props: React.ComponentPropsWithoutRef<"svg">) {

View File

@@ -1,4 +1,4 @@
import { source, openapi } from "@/app/source"; import { source } from "@/app/source";
import { DocsPage, DocsBody, DocsTitle } from "fumadocs-ui/page"; import { DocsPage, DocsBody, DocsTitle } from "fumadocs-ui/page";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { absoluteUrl } from "@/lib/utils"; import { absoluteUrl } from "@/lib/utils";

View File

@@ -7,7 +7,6 @@ import { GeistMono } from "geist/font/mono";
import { GeistSans } from "geist/font/sans"; import { GeistSans } from "geist/font/sans";
import { baseUrl, createMetadata } from "@/lib/metadata"; import { baseUrl, createMetadata } from "@/lib/metadata";
import Loglib from "@loglib/tracker/react"; import Loglib from "@loglib/tracker/react";
import { BetaNotice } from "@/components/banner";
export const metadata = createMetadata({ export const metadata = createMetadata({
title: { title: {

View File

@@ -1,4 +1,4 @@
import { docs, meta, changelog as _changelog } from "@/.source"; import { docs, meta } from "@/.source";
import { createMDXSource } from "fumadocs-mdx"; import { createMDXSource } from "fumadocs-mdx";
import { loader } from "fumadocs-core/source"; import { loader } from "fumadocs-core/source";
import { createOpenAPI } from "fumadocs-openapi/server"; import { createOpenAPI } from "fumadocs-openapi/server";

View File

@@ -1,5 +1,3 @@
import React from "react";
export const ShipText = () => { export const ShipText = () => {
const voxels = [ const voxels = [
// V // V

View File

@@ -1,4 +1,3 @@
import React from "react";
import { useId } from "react"; import { useId } from "react";
export function Features() { export function Features() {

View File

@@ -1,7 +1,7 @@
"use client"; "use client";
import React, { useState } from "react"; import { useState } from "react";
import { Highlight, themes } from "prism-react-renderer"; import { Highlight } from "prism-react-renderer";
import { Check, Copy } from "lucide-react"; import { Check, Copy } from "lucide-react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import theme from "./theme"; import theme from "./theme";

View File

@@ -1,4 +1,3 @@
import React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { X } from "lucide-react"; import { X } from "lucide-react";

View File

@@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { TabBar } from "./tab-bar"; import { TabBar } from "./tab-bar";
import { CodeEditor } from "./code-editor"; import { CodeEditor } from "./code-editor";
import { useAtom } from "jotai"; import { useAtom } from "jotai";

View File

@@ -1,4 +1,3 @@
import React from "react";
import { CodeTab } from "./code-tabs"; import { CodeTab } from "./code-tabs";
interface File { interface File {

View File

@@ -1,4 +1,4 @@
import { ChevronLeft, Copy, Mail, Moon, PlusIcon, Sun } from "lucide-react"; import { Moon, PlusIcon, Sun } from "lucide-react";
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
@@ -28,8 +28,6 @@ import { useAtom } from "jotai";
import { optionsAtom } from "./store"; import { optionsAtom } from "./store";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import { ScrollArea } from "../ui/scroll-area"; import { ScrollArea } from "../ui/scroll-area";
import { Button } from "../ui/button";
import Link from "next/link";
const frameworks = [ const frameworks = [
{ {
title: "Next.js", title: "Next.js",

View File

@@ -12,10 +12,8 @@ import {
import { Checkbox } from "@/components/ui/checkbox"; import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Key, Loader2 } from "lucide-react"; import { Key } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { optionsAtom } from "./store"; import { optionsAtom } from "./store";
import { socialProviders } from "./social-provider"; import { socialProviders } from "./social-provider";

View File

@@ -14,7 +14,6 @@ import { Label } from "@/components/ui/label";
import { useState } from "react"; import { useState } from "react";
import Image from "next/image"; import Image from "next/image";
import { Loader2, X } from "lucide-react"; import { Loader2, X } from "lucide-react";
import { toast } from "sonner";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
export function SignUp() { export function SignUp() {

View File

@@ -1,5 +1,4 @@
"use client"; "use client";
import React from "react";
import { import {
Globe2Icon, Globe2Icon,

View File

@@ -11,7 +11,6 @@ import { Highlight, themes } from "prism-react-renderer";
import { AnimatePresence, motion, MotionConfig } from "framer-motion"; import { AnimatePresence, motion, MotionConfig } from "framer-motion";
import { Builder } from "../builder"; import { Builder } from "../builder";
import { Spotlight } from "./spotlight"; import { Spotlight } from "./spotlight";
import { DropdownMenu, DropdownMenuTrigger } from "../ui/dropdown-menu";
import { GradientBG } from "./gradient-bg"; import { GradientBG } from "./gradient-bg";
const tabs: { name: "auth.ts" | "client.ts"; code: string }[] = [ const tabs: { name: "auth.ts" | "client.ts"; code: string }[] = [

View File

@@ -1,4 +1,3 @@
import React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
type SpotlightProps = { type SpotlightProps = {

View File

@@ -1,4 +1,3 @@
import { Card, CardContent } from "@/components/ui/card";
import { import {
Table, Table,
TableBody, TableBody,
@@ -8,8 +7,7 @@ import {
TableRow, TableRow,
} from "@/components/ui/table"; } from "@/components/ui/table";
import { Badge } from "@/components/ui/badge"; import { Badge } from "@/components/ui/badge";
import { CircleDot, Key, Link } from "lucide-react"; import { Key, Link } from "lucide-react";
import { Label } from "../ui/label";
import { import {
Tooltip, Tooltip,
TooltipContent, TooltipContent,

View File

@@ -1,4 +1,3 @@
import React from "react";
import Link from "next/link"; import Link from "next/link";
import { ThemeToggle } from "@/components/theme-toggler"; import { ThemeToggle } from "@/components/theme-toggler";
import { NavbarMobile, NavbarMobileBtn } from "./nav-mobile"; import { NavbarMobile, NavbarMobileBtn } from "./nav-mobile";

View File

@@ -1,13 +1,7 @@
"use client"; "use client";
import { Menu, Sun, X } from "lucide-react"; import { Menu } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { import { Fragment, createContext, useContext, useState } from "react";
Fragment,
createContext,
useContext,
useEffect,
useState,
} from "react";
import { import {
Accordion, Accordion,
AccordionContent, AccordionContent,
@@ -16,7 +10,7 @@ import {
} from "@/components/ui/accordion"; } from "@/components/ui/accordion";
import { AnimatePresence, FadeIn } from "@/components/ui/fade-in"; import { AnimatePresence, FadeIn } from "@/components/ui/fade-in";
import { contents, examples } from "./sidebar-content"; import { contents, examples } from "./sidebar-content";
import { MobileThemeToggle, ThemeToggle } from "./theme-toggler"; import { MobileThemeToggle } from "./theme-toggler";
import { usePathname } from "next/navigation"; import { usePathname } from "next/navigation";
interface NavbarMobileContextProps { interface NavbarMobileContextProps {

View File

@@ -17,10 +17,6 @@ import {
} from "./ui/select"; } from "./ui/select";
import { loglib } from "@loglib/tracker"; import { loglib } from "@loglib/tracker";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { GitHubIcon } from "@/app/changelogs/_components/icons";
import Link from "next/link";
import { Button } from "./ui/button";
import { Separator } from "./ui/separator";
export default function ArticleLayout() { export default function ArticleLayout() {
const [currentOpen, setCurrentOpen] = useState<number>(0); const [currentOpen, setCurrentOpen] = useState<number>(0);

View File

@@ -1,13 +1,10 @@
import { import {
Chrome,
CircleHelp, CircleHelp,
Key, Key,
LucideAArrowDown, LucideAArrowDown,
LucideIcon, LucideIcon,
Mail, Mail,
Mailbox, Mailbox,
MailboxIcon,
Mails,
Phone, Phone,
ScanFace, ScanFace,
ShieldCheck, ShieldCheck,

View File

@@ -1,8 +1,7 @@
"use client"; "use client";
import { Moon, MoonIcon, Sun } from "lucide-react"; import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import * as React from "react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import {
DropdownMenu, DropdownMenu,

View File

@@ -2,11 +2,6 @@
import * as React from "react"; import * as React from "react";
import * as RechartsPrimitive from "recharts"; import * as RechartsPrimitive from "recharts";
import {
NameType,
Payload,
ValueType,
} from "recharts/types/component/DefaultTooltipContent";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";

View File

@@ -1,5 +1,5 @@
"use client"; "use client";
import React, { useId, useMemo } from "react"; import { useId } from "react";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Particles, { initParticlesEngine } from "@tsparticles/react"; import Particles, { initParticlesEngine } from "@tsparticles/react";
import type { Container, SingleOrMultiple } from "@tsparticles/engine"; import type { Container, SingleOrMultiple } from "@tsparticles/engine";

View File

@@ -1,8 +1,4 @@
import { import { defineCollections, defineDocs } from "fumadocs-mdx/config";
defineCollections,
defineDocs,
getDefaultMDXOptions,
} from "fumadocs-mdx/config";
import { defineConfig } from "fumadocs-mdx/config"; import { defineConfig } from "fumadocs-mdx/config";
import { remarkInstall } from "fumadocs-docgen"; import { remarkInstall } from "fumadocs-docgen";
import { z } from "zod"; import { z } from "zod";

View File

@@ -9,7 +9,7 @@ import {
import { TextField, TextFieldLabel, TextFieldRoot } from "./ui/textfield"; import { TextField, TextFieldLabel, TextFieldRoot } from "./ui/textfield";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { Checkbox, CheckboxControl, CheckboxLabel } from "./ui/checkbox"; import { Checkbox, CheckboxControl, CheckboxLabel } from "./ui/checkbox";
import { passkeyActions, signIn } from "@/libs/auth-client"; import { signIn } from "@/libs/auth-client";
import { createSignal } from "solid-js"; import { createSignal } from "solid-js";
export function SignInCard() { export function SignInCard() {

View File

@@ -8,8 +8,7 @@ import {
} from "@/components/ui/card"; } from "@/components/ui/card";
import { TextField, TextFieldLabel, TextFieldRoot } from "./ui/textfield"; import { TextField, TextFieldLabel, TextFieldRoot } from "./ui/textfield";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { Checkbox, CheckboxControl, CheckboxLabel } from "./ui/checkbox"; import { signUp } from "@/libs/auth-client";
import { signIn, signUp } from "@/libs/auth-client";
import { createSignal } from "solid-js"; import { createSignal } from "solid-js";
import { convertImageToBase64 } from "@/libs/utils"; import { convertImageToBase64 } from "@/libs/utils";

View File

@@ -4,7 +4,6 @@ import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "./ui/card"; } from "./ui/card";
@@ -12,7 +11,6 @@ import {
OTPField, OTPField,
OTPFieldGroup, OTPFieldGroup,
OTPFieldInput, OTPFieldInput,
OTPFieldSeparator,
OTPFieldSlot, OTPFieldSlot,
} from "./ui/otp-field"; } from "./ui/otp-field";
import { twoFactorActions } from "@/libs/auth-client"; import { twoFactorActions } from "@/libs/auth-client";

View File

@@ -1,6 +1,4 @@
--- ---
import { UserCard } from "@/components/user-card";
import RootLayout from "@/layouts/root-layout.astro";
import { auth } from "@/auth"; import { auth } from "@/auth";
const activeSessions = await auth.api const activeSessions = await auth.api

View File

@@ -1,5 +1,4 @@
--- ---
import RootLayout from "@/layouts/root-layout.astro";
--- ---
<RootLayout> <RootLayout>

View File

@@ -1,6 +1,4 @@
--- ---
import RootLayout from "@/layouts/root-layout.astro";
import { SignInCard } from "../components/sign-in";
--- ---
<RootLayout> <RootLayout>

View File

@@ -1,6 +1,4 @@
--- ---
import RootLayout from "@/layouts/root-layout.astro";
import { SignUpCard } from "../components/sign-up";
--- ---

View File

@@ -1,6 +1,4 @@
--- ---
import RootLayout from "@/layouts/root-layout.astro";
import { TwoFactorComponent } from "@/components/two-factor";
--- ---
<RootLayout> <RootLayout>

View File

@@ -1,6 +1,4 @@
--- ---
import RootLayout from "@/layouts/root-layout.astro";
import { TwoFactorEmail } from "@/components/two-factor";
--- ---

View File

@@ -1,7 +1,5 @@
import { authClient } from "@/auth/auth-client"; import { authClient } from "@/auth/auth-client";
import { Button } from "./ui/button";
export const Home = ({ export const Home = ({
setPage, setPage,
}: { }: {

View File

@@ -6,15 +6,13 @@ import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card"; } from "@/components/ui/card";
import { Checkbox } from "@/components/ui/checkbox"; import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { cn } from "@/lib/utils"; import { Loader2 } from "lucide-react";
import { Key, Loader2 } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import { toast } from "sonner"; import { toast } from "sonner";

View File

@@ -6,7 +6,6 @@ import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "@/components/ui/card"; } from "@/components/ui/card";

View File

@@ -1,4 +1,4 @@
import { Slot, Stack } from "expo-router"; import { Slot } from "expo-router";
import "../global.css"; import "../global.css";
import { SafeAreaProvider } from "react-native-safe-area-context"; import { SafeAreaProvider } from "react-native-safe-area-context";
import { ImageBackground, View } from "react-native"; import { ImageBackground, View } from "react-native";

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { import {
AccordionRoot,
type AccordionRootEmits, type AccordionRootEmits,
type AccordionRootProps, type AccordionRootProps,
useForwardPropsEmits, useForwardPropsEmits,

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { AccordionContent, type AccordionContentProps } from "radix-vue"; import { type AccordionContentProps } from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AccordionContentProps & { class?: HTMLAttributes["class"] } AccordionContentProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,11 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type AccordionItemProps, useForwardProps } from "radix-vue";
AccordionItem,
type AccordionItemProps,
useForwardProps,
} from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AccordionItemProps & { class?: HTMLAttributes["class"] } AccordionItemProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,12 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type AccordionTriggerProps } from "radix-vue";
AccordionHeader,
AccordionTrigger,
type AccordionTriggerProps,
} from "radix-vue";
import { ChevronDownIcon } from "@radix-icons/vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AccordionTriggerProps & { class?: HTMLAttributes["class"] } AccordionTriggerProps & { class?: HTMLAttributes["class"] }

View File

@@ -2,7 +2,6 @@
import { import {
type AlertDialogEmits, type AlertDialogEmits,
type AlertDialogProps, type AlertDialogProps,
AlertDialogRoot,
useForwardPropsEmits, useForwardPropsEmits,
} from "radix-vue"; } from "radix-vue";

View File

@@ -1,8 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { AlertDialogAction, type AlertDialogActionProps } from "radix-vue"; import { type AlertDialogActionProps } from "radix-vue";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = defineProps< const props = defineProps<
AlertDialogActionProps & { class?: HTMLAttributes["class"] } AlertDialogActionProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,8 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { AlertDialogCancel, type AlertDialogCancelProps } from "radix-vue"; import { type AlertDialogCancelProps } from "radix-vue";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = defineProps< const props = defineProps<
AlertDialogCancelProps & { class?: HTMLAttributes["class"] } AlertDialogCancelProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,14 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import {
AlertDialogContent,
type AlertDialogContentEmits, type AlertDialogContentEmits,
type AlertDialogContentProps, type AlertDialogContentProps,
AlertDialogOverlay,
AlertDialogPortal,
useForwardPropsEmits, useForwardPropsEmits,
} from "radix-vue"; } from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AlertDialogContentProps & { class?: HTMLAttributes["class"] } AlertDialogContentProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,10 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type AlertDialogDescriptionProps } from "radix-vue";
AlertDialogDescription,
type AlertDialogDescriptionProps,
} from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AlertDialogDescriptionProps & { class?: HTMLAttributes["class"] } AlertDialogDescriptionProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { AlertDialogTitle, type AlertDialogTitleProps } from "radix-vue"; import { type AlertDialogTitleProps } from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
AlertDialogTitleProps & { class?: HTMLAttributes["class"] } AlertDialogTitleProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { AlertDialogTrigger, type AlertDialogTriggerProps } from "radix-vue"; import { type AlertDialogTriggerProps } from "radix-vue";
const props = defineProps<AlertDialogTriggerProps>(); const props = defineProps<AlertDialogTriggerProps>();
</script> </script>

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { type AlertVariants, alertVariants } from "."; import { type AlertVariants } from ".";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { AspectRatio, type AspectRatioProps } from "radix-vue"; import { type AspectRatioProps } from "radix-vue";
const props = defineProps<AspectRatioProps>(); const props = defineProps<AspectRatioProps>();
</script> </script>

View File

@@ -4,14 +4,12 @@ import type { ZodAny, z } from "zod";
import { toTypedSchema } from "@vee-validate/zod"; import { toTypedSchema } from "@vee-validate/zod";
import type { FormContext, GenericObject } from "vee-validate"; import type { FormContext, GenericObject } from "vee-validate";
import { import {
type ZodObjectOrWrapped,
getBaseSchema, getBaseSchema,
getBaseType, getBaseType,
getDefaultValueInZodStack, getDefaultValueInZodStack,
getObjectFormSchema, getObjectFormSchema,
} from "./utils"; } from "./utils";
import type { Config, ConfigItem, Dependency, Shape } from "./interface"; import type { Config, ConfigItem, Dependency, Shape } from "./interface";
import AutoFormField from "./AutoFormField.vue";
import { provideDependencies } from "./dependencies"; import { provideDependencies } from "./dependencies";
import { Form } from "@/components/ui/form"; import { Form } from "@/components/ui/form";

View File

@@ -1,8 +1,6 @@
<script setup lang="ts" generic="U extends ZodAny"> <script setup lang="ts" generic="U extends ZodAny">
import type { ZodAny } from "zod";
import { computed } from "vue"; import { computed } from "vue";
import type { Config, ConfigItem, Shape } from "./interface"; import type { Config, ConfigItem, Shape } from "./interface";
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from "./constant";
import useDependencies from "./dependencies"; import useDependencies from "./dependencies";
const props = defineProps<{ const props = defineProps<{

View File

@@ -1,21 +1,9 @@
<script setup lang="ts" generic="T extends z.ZodAny"> <script setup lang="ts" generic="T extends z.ZodAny">
import * as z from "zod"; import * as z from "zod";
import { computed, provide } from "vue"; import { computed, provide } from "vue";
import { PlusIcon, TrashIcon } from "lucide-vue-next"; import { FieldContextKey, useField } from "vee-validate";
import { FieldArray, FieldContextKey, useField } from "vee-validate"; import type { Config } from "./interface";
import type { Config, ConfigItem } from "./interface"; import { getBaseType } from "./utils";
import { beautifyObjectName, getBaseType } from "./utils";
import AutoFormField from "./AutoFormField.vue";
import AutoFormLabel from "./AutoFormLabel.vue";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { FormItem, FormMessage } from "@/components/ui/form";
const props = defineProps<{ const props = defineProps<{
fieldName: string; fieldName: string;

View File

@@ -1,15 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue"; import { computed } from "vue";
import { beautifyObjectName } from "./utils";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import AutoFormLabel from "./AutoFormLabel.vue";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Switch } from "@/components/ui/switch"; import { Switch } from "@/components/ui/switch";
import { Checkbox } from "@/components/ui/checkbox"; import { Checkbox } from "@/components/ui/checkbox";

View File

@@ -1,25 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { DateFormatter, getLocalTimeZone } from "@internationalized/date"; import { DateFormatter } from "@internationalized/date";
import { CalendarIcon } from "@radix-icons/vue";
import { beautifyObjectName } from "./utils";
import AutoFormLabel from "./AutoFormLabel.vue";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Calendar } from "@/components/ui/calendar";
import { Button } from "@/components/ui/button";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { cn } from "@/lib/utils";
defineProps<FieldProps>(); defineProps<FieldProps>();

View File

@@ -1,23 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import AutoFormLabel from "./AutoFormLabel.vue";
import { beautifyObjectName } from "./utils";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
defineProps< defineProps<
FieldProps & { FieldProps & {

View File

@@ -1,18 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { TrashIcon } from "@radix-icons/vue";
import { beautifyObjectName } from "./utils";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import AutoFormLabel from "./AutoFormLabel.vue";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
defineProps<FieldProps>(); defineProps<FieldProps>();

View File

@@ -1,15 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue"; import { computed } from "vue";
import AutoFormLabel from "./AutoFormLabel.vue";
import { beautifyObjectName } from "./utils";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea"; import { Textarea } from "@/components/ui/textarea";

View File

@@ -1,15 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import AutoFormLabel from "./AutoFormLabel.vue";
import { beautifyObjectName } from "./utils";
import type { FieldProps } from "./interface"; import type { FieldProps } from "./interface";
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
defineOptions({ defineOptions({
inheritAttrs: false, inheritAttrs: false,

View File

@@ -1,23 +1,9 @@
<script setup lang="ts" generic="T extends ZodRawShape"> <script setup lang="ts" generic="T extends ZodRawShape">
import type { ZodAny, ZodObject, ZodRawShape } from "zod"; import type { ZodAny, ZodObject } from "zod";
import { computed, provide } from "vue"; import { computed, provide } from "vue";
import { FieldContextKey, useField } from "vee-validate"; import { FieldContextKey, useField } from "vee-validate";
import AutoFormField from "./AutoFormField.vue"; import type { Config, Shape } from "./interface";
import type { Config, ConfigItem, Shape } from "./interface"; import { getBaseSchema, getBaseType, getDefaultValueInZodStack } from "./utils";
import {
beautifyObjectName,
getBaseSchema,
getBaseType,
getDefaultValueInZodStack,
} from "./utils";
import AutoFormLabel from "./AutoFormLabel.vue";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { FormItem } from "@/components/ui/form";
const props = defineProps<{ const props = defineProps<{
fieldName: string; fieldName: string;

View File

@@ -1,6 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { FormLabel } from "@/components/ui/form";
defineProps<{ defineProps<{
required?: boolean; required?: boolean;
}>(); }>();

View File

@@ -1,8 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { AvatarRoot } from "radix-vue"; import { type AvatarVariants } from ".";
import { type AvatarVariants, avatarVariant } from ".";
import { cn } from "@/lib/utils";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { AvatarFallback, type AvatarFallbackProps } from "radix-vue"; import { type AvatarFallbackProps } from "radix-vue";
const props = defineProps<AvatarFallbackProps>(); const props = defineProps<AvatarFallbackProps>();
</script> </script>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { AvatarImage, type AvatarImageProps } from "radix-vue"; import { type AvatarImageProps } from "radix-vue";
const props = defineProps<AvatarImageProps>(); const props = defineProps<AvatarImageProps>();
</script> </script>

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { type BadgeVariants, badgeVariants } from "."; import { type BadgeVariants } from ".";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
variant?: BadgeVariants["variant"]; variant?: BadgeVariants["variant"];

View File

@@ -1,7 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { DotsHorizontalIcon } from "@radix-icons/vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,7 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { Primitive, type PrimitiveProps } from "radix-vue"; import { type PrimitiveProps } from "radix-vue";
import { cn } from "@/lib/utils";
const props = withDefaults( const props = withDefaults(
defineProps<PrimitiveProps & { class?: HTMLAttributes["class"] }>(), defineProps<PrimitiveProps & { class?: HTMLAttributes["class"] }>(),

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,7 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { ChevronRightIcon } from "@radix-icons/vue";
import { cn } from "@/lib/utils";
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes["class"]; class?: HTMLAttributes["class"];

View File

@@ -1,8 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { Primitive, type PrimitiveProps } from "radix-vue"; import { type PrimitiveProps } from "radix-vue";
import { type ButtonVariants, buttonVariants } from "."; import { type ButtonVariants } from ".";
import { cn } from "@/lib/utils";
interface Props extends PrimitiveProps { interface Props extends PrimitiveProps {
variant?: ButtonVariants["variant"]; variant?: ButtonVariants["variant"];

View File

@@ -1,25 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import {
CalendarRoot,
type CalendarRootEmits, type CalendarRootEmits,
type CalendarRootProps, type CalendarRootProps,
useForwardPropsEmits, useForwardPropsEmits,
} from "radix-vue"; } from "radix-vue";
import {
CalendarCell,
CalendarCellTrigger,
CalendarGrid,
CalendarGridBody,
CalendarGridHead,
CalendarGridRow,
CalendarHeadCell,
CalendarHeader,
CalendarHeading,
CalendarNextButton,
CalendarPrevButton,
} from ".";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
CalendarRootProps & { class?: HTMLAttributes["class"] } CalendarRootProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,11 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type CalendarCellProps, useForwardProps } from "radix-vue";
CalendarCell,
type CalendarCellProps,
useForwardProps,
} from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
CalendarCellProps & { class?: HTMLAttributes["class"] } CalendarCellProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,12 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type CalendarCellTriggerProps, useForwardProps } from "radix-vue";
CalendarCellTrigger,
type CalendarCellTriggerProps,
useForwardProps,
} from "radix-vue";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
CalendarCellTriggerProps & { class?: HTMLAttributes["class"] } CalendarCellTriggerProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,11 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type CalendarGridProps, useForwardProps } from "radix-vue";
CalendarGrid,
type CalendarGridProps,
useForwardProps,
} from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
CalendarGridProps & { class?: HTMLAttributes["class"] } CalendarGridProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { CalendarGridBody, type CalendarGridBodyProps } from "radix-vue"; import { type CalendarGridBodyProps } from "radix-vue";
const props = defineProps<CalendarGridBodyProps>(); const props = defineProps<CalendarGridBodyProps>();
</script> </script>

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { HTMLAttributes } from "vue"; import type { HTMLAttributes } from "vue";
import { CalendarGridHead, type CalendarGridHeadProps } from "radix-vue"; import { type CalendarGridHeadProps } from "radix-vue";
const props = defineProps< const props = defineProps<
CalendarGridHeadProps & { class?: HTMLAttributes["class"] } CalendarGridHeadProps & { class?: HTMLAttributes["class"] }

View File

@@ -1,11 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { type HTMLAttributes, computed } from "vue"; import { type HTMLAttributes, computed } from "vue";
import { import { type CalendarGridRowProps, useForwardProps } from "radix-vue";
CalendarGridRow,
type CalendarGridRowProps,
useForwardProps,
} from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps< const props = defineProps<
CalendarGridRowProps & { class?: HTMLAttributes["class"] } CalendarGridRowProps & { class?: HTMLAttributes["class"] }

Some files were not shown because too many files have changed in this diff Show More