diff --git a/apps/recorder/.env b/apps/recorder/.env
index 455bbef..b28612b 100644
--- a/apps/recorder/.env
+++ b/apps/recorder/.env
@@ -1,8 +1,13 @@
-AUTH_TYPE = "oidc" # or oidc
+HOST="konobangu.com"
+DATABASE_URL = "postgres://konobangu:konobangu@localhost:5432/konobangu"
+STORAGE_DATA_DIR = "./data"
+AUTH_TYPE = "basic" # or oidc
BASIC_USER = "konobangu"
BASIC_PASSWORD = "konobangu"
-OIDC_ISSUER="https://auth.logto.io/oidc"
-OIDC_AUDIENCE = "https://konobangu.com/api"
-OIDC_CLIENT_ID = "client_id"
-OIDC_CLIENT_SECRET = "client_secret" # optional
-OIDC_EXTRA_SCOPES = "read:konobangu write:konobangu"
+# OIDC_ISSUER="https://auth.logto.io/oidc"
+# OIDC_AUDIENCE = "https://konobangu.com/api"
+# OIDC_CLIENT_ID = "client_id"
+# OIDC_CLIENT_SECRET = "client_secret" # optional
+# OIDC_EXTRA_SCOPES = "read:konobangu write:konobangu"
+# OIDC_EXTRA_CLAIM_KEY = ""
+# OIDC_EXTRA_CLAIM_VALUE = ""
diff --git a/apps/recorder/src/graphql/guard.rs b/apps/recorder/src/graphql/guard.rs
index 2263a0d..5452da4 100644
--- a/apps/recorder/src/graphql/guard.rs
+++ b/apps/recorder/src/graphql/guard.rs
@@ -157,12 +157,7 @@ where
None => Ok(()),
}
}
- field => Err(AuthError::from_graphql_subscribe_id_guard(
- async_graphql::Error::new("unsupport graphql field"),
- context,
- field,
- "",
- )),
+ _ => Ok(()),
};
match validation_result {
Ok(_) => GuardAction::Allow,
diff --git a/apps/webui/.env b/apps/webui/.env
index b28612b..25d335c 100644
--- a/apps/webui/.env
+++ b/apps/webui/.env
@@ -1,6 +1,3 @@
-HOST="konobangu.com"
-DATABASE_URL = "postgres://konobangu:konobangu@localhost:5432/konobangu"
-STORAGE_DATA_DIR = "./data"
AUTH_TYPE = "basic" # or oidc
BASIC_USER = "konobangu"
BASIC_PASSWORD = "konobangu"
@@ -9,5 +6,3 @@ BASIC_PASSWORD = "konobangu"
# OIDC_CLIENT_ID = "client_id"
# OIDC_CLIENT_SECRET = "client_secret" # optional
# OIDC_EXTRA_SCOPES = "read:konobangu write:konobangu"
-# OIDC_EXTRA_CLAIM_KEY = ""
-# OIDC_EXTRA_CLAIM_VALUE = ""
diff --git a/apps/webui/components.json b/apps/webui/components.json
index db30f5b..6a6ec45 100644
--- a/apps/webui/components.json
+++ b/apps/webui/components.json
@@ -11,10 +11,10 @@
},
"aliases": {
"components": "@/components",
- "utils": "@/styles/utils",
+ "utils": "@/infra/styles/utils",
"ui": "@/components/ui",
"lib": "@/lib",
- "hooks": "@/hooks"
+ "hooks": "@/infra/hooks"
},
"iconLibrary": "lucide"
}
diff --git a/apps/webui/src/auth/config.ts b/apps/webui/src/app/auth/config.ts
similarity index 97%
rename from apps/webui/src/auth/config.ts
rename to apps/webui/src/app/auth/config.ts
index df98564..216835a 100644
--- a/apps/webui/src/auth/config.ts
+++ b/apps/webui/src/app/auth/config.ts
@@ -28,7 +28,7 @@ export function buildOidcConfig(): OpenIdConfiguration {
responseType: 'code',
silentRenew: true,
useRefreshToken: true,
- logLevel: LogLevel.Debug,
+ logLevel: LogLevel.None,
autoUserInfo: !resource,
renewUserInfoAfterTokenRenew: !resource,
customParamsAuthRequest: {
diff --git a/apps/webui/src/auth/context.ts b/apps/webui/src/app/auth/context.ts
similarity index 95%
rename from apps/webui/src/auth/context.ts
rename to apps/webui/src/app/auth/context.ts
index 8706b2e..e018f4f 100644
--- a/apps/webui/src/auth/context.ts
+++ b/apps/webui/src/app/auth/context.ts
@@ -1,8 +1,6 @@
-import { UnreachableError } from '@/errors/common';
+import { UnreachableError } from '@/infra/errors/common';
import type { Injector, Provider } from '@outposts/injection-js';
import type { AnyRouter } from '@tanstack/react-router';
-import { atomSignal } from 'jotai-signal';
-import type { Atom } from 'jotai/vanilla';
import {
CHECK_AUTH_RESULT_EVENT,
type CheckAuthResultEventType,
diff --git a/apps/webui/src/auth/guard.ts b/apps/webui/src/app/auth/guard.ts
similarity index 91%
rename from apps/webui/src/auth/guard.ts
rename to apps/webui/src/app/auth/guard.ts
index efafafd..56da264 100644
--- a/apps/webui/src/auth/guard.ts
+++ b/apps/webui/src/app/auth/guard.ts
@@ -1,4 +1,4 @@
-import type { RouterContext } from '@/traits/router';
+import type { RouterContext } from '@/infra/routes/traits';
import { runInInjectionContext } from '@outposts/injection-js';
import { autoLoginPartialRoutesGuard } from 'oidc-client-rx';
import { firstValueFrom } from 'rxjs';
diff --git a/apps/webui/src/auth/hooks.ts b/apps/webui/src/app/auth/hooks.ts
similarity index 100%
rename from apps/webui/src/auth/hooks.ts
rename to apps/webui/src/app/auth/hooks.ts
diff --git a/apps/webui/src/components/layout/app-layout.tsx b/apps/webui/src/components/layout/app-layout.tsx
index 2ba4f02..a67db47 100644
--- a/apps/webui/src/components/layout/app-layout.tsx
+++ b/apps/webui/src/components/layout/app-layout.tsx
@@ -13,9 +13,9 @@ import {
SidebarProvider,
SidebarTrigger,
} from '@/components/ui/sidebar';
-import { cn } from '@/styles/utils';
-import type { RouteStateDataOption } from '@/traits/router';
-import type { RouteBreadcrumbItem } from '@/traits/router';
+import type { RouteStateDataOption } from '@/infra/routes/traits';
+import type { RouteBreadcrumbItem } from '@/infra/routes/traits';
+import { cn } from '@/infra/styles/utils';
import { useMatches } from '@tanstack/react-router';
import {
type DetailedHTMLProps,
diff --git a/apps/webui/src/components/layout/app-sidebar.tsx b/apps/webui/src/components/layout/app-sidebar.tsx
index a80eb7c..4d23a44 100644
--- a/apps/webui/src/components/layout/app-sidebar.tsx
+++ b/apps/webui/src/components/layout/app-sidebar.tsx
@@ -5,7 +5,7 @@ import {
SidebarHeader,
SidebarRail,
} from '@/components/ui/sidebar';
-import { AppNavMainData } from '@/config/app-layout';
+import { AppNavMainData } from '@/infra/routes/nav';
import type { ComponentPropsWithoutRef } from 'react';
import { AppIcon } from './app-icon';
import { NavMain } from './nav-main';
diff --git a/apps/webui/src/components/ui/accordion.tsx b/apps/webui/src/components/ui/accordion.tsx
index 90ad605..b262424 100644
--- a/apps/webui/src/components/ui/accordion.tsx
+++ b/apps/webui/src/components/ui/accordion.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as AccordionPrimitive from "@radix-ui/react-accordion"
import { ChevronDownIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Accordion({
...props
diff --git a/apps/webui/src/components/ui/alert-dialog.tsx b/apps/webui/src/components/ui/alert-dialog.tsx
index dc90446..f387492 100644
--- a/apps/webui/src/components/ui/alert-dialog.tsx
+++ b/apps/webui/src/components/ui/alert-dialog.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import { buttonVariants } from "@/components/ui/button"
function AlertDialog({
diff --git a/apps/webui/src/components/ui/alert.tsx b/apps/webui/src/components/ui/alert.tsx
index c7715ae..a65136c 100644
--- a/apps/webui/src/components/ui/alert.tsx
+++ b/apps/webui/src/components/ui/alert.tsx
@@ -1,7 +1,7 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
diff --git a/apps/webui/src/components/ui/avatar.tsx b/apps/webui/src/components/ui/avatar.tsx
index 0bde4b8..795e165 100644
--- a/apps/webui/src/components/ui/avatar.tsx
+++ b/apps/webui/src/components/ui/avatar.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Avatar({
className,
diff --git a/apps/webui/src/components/ui/badge.tsx b/apps/webui/src/components/ui/badge.tsx
index cc8324d..2a6d599 100644
--- a/apps/webui/src/components/ui/badge.tsx
+++ b/apps/webui/src/components/ui/badge.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
const badgeVariants = cva(
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
diff --git a/apps/webui/src/components/ui/breadcrumb.tsx b/apps/webui/src/components/ui/breadcrumb.tsx
index aebbf90..4ded77b 100644
--- a/apps/webui/src/components/ui/breadcrumb.tsx
+++ b/apps/webui/src/components/ui/breadcrumb.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { ChevronRight, MoreHorizontal } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
return
diff --git a/apps/webui/src/components/ui/button.tsx b/apps/webui/src/components/ui/button.tsx
index 38ba2bf..e5933d3 100644
--- a/apps/webui/src/components/ui/button.tsx
+++ b/apps/webui/src/components/ui/button.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
diff --git a/apps/webui/src/components/ui/calendar.tsx b/apps/webui/src/components/ui/calendar.tsx
index fbbe43a..19905bb 100644
--- a/apps/webui/src/components/ui/calendar.tsx
+++ b/apps/webui/src/components/ui/calendar.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker } from "react-day-picker"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import { buttonVariants } from "@/components/ui/button"
function Calendar({
diff --git a/apps/webui/src/components/ui/card.tsx b/apps/webui/src/components/ui/card.tsx
index e04c9a3..dabbe6f 100644
--- a/apps/webui/src/components/ui/card.tsx
+++ b/apps/webui/src/components/ui/card.tsx
@@ -1,84 +1,84 @@
-import type * as React from 'react';
+import * as React from "react"
-import { cn } from '@/styles/utils';
+import { cn } from "@/infra/styles/utils"
-function Card({ className, ...props }: React.ComponentProps<'div'>) {
+function Card({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
+function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
+function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
+function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
+function CardAction({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
+function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
-function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
+function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
- );
+ )
}
export {
@@ -89,4 +89,4 @@ export {
CardAction,
CardDescription,
CardContent,
-};
+}
diff --git a/apps/webui/src/components/ui/carousel.tsx b/apps/webui/src/components/ui/carousel.tsx
index 7ac3b92..2c94f52 100644
--- a/apps/webui/src/components/ui/carousel.tsx
+++ b/apps/webui/src/components/ui/carousel.tsx
@@ -6,7 +6,7 @@ import useEmblaCarousel, {
} from "embla-carousel-react"
import { ArrowLeft, ArrowRight } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import { Button } from "@/components/ui/button"
type CarouselApi = UseEmblaCarouselType[1]
diff --git a/apps/webui/src/components/ui/chart.tsx b/apps/webui/src/components/ui/chart.tsx
index dc29686..096f6db 100644
--- a/apps/webui/src/components/ui/chart.tsx
+++ b/apps/webui/src/components/ui/chart.tsx
@@ -1,35 +1,35 @@
-import * as React from "react"
-import * as RechartsPrimitive from "recharts"
+import * as React from "react";
+import * as RechartsPrimitive from "recharts";
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils";
// Format: { THEME_NAME: CSS_SELECTOR }
-const THEMES = { light: "", dark: ".dark" } as const
+const THEMES = { light: "", dark: ".dark" } as const;
export type ChartConfig = {
[k in string]: {
- label?: React.ReactNode
- icon?: React.ComponentType
+ label?: React.ReactNode;
+ icon?: React.ComponentType;
} & (
| { color?: string; theme?: never }
| { color?: never; theme: Record }
- )
-}
+ );
+};
type ChartContextProps = {
- config: ChartConfig
-}
+ config: ChartConfig;
+};
-const ChartContext = React.createContext(null)
+const ChartContext = React.createContext(null);
function useChart() {
- const context = React.useContext(ChartContext)
+ const context = React.useContext(ChartContext);
if (!context) {
- throw new Error("useChart must be used within a ")
+ throw new Error("useChart must be used within a ");
}
- return context
+ return context;
}
function ChartContainer({
@@ -39,13 +39,13 @@ function ChartContainer({
config,
...props
}: React.ComponentProps<"div"> & {
- config: ChartConfig
+ config: ChartConfig;
children: React.ComponentProps<
typeof RechartsPrimitive.ResponsiveContainer
- >["children"]
+ >["children"];
}) {
- const uniqueId = React.useId()
- const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
+ const uniqueId = React.useId();
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
return (
@@ -64,16 +64,16 @@ function ChartContainer({
- )
+ );
}
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
const colorConfig = Object.entries(config).filter(
([, config]) => config.theme || config.color
- )
+ );
if (!colorConfig.length) {
- return null
+ return null;
}
return (
@@ -87,8 +87,8 @@ ${colorConfig
.map(([key, itemConfig]) => {
const color =
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
- itemConfig.color
- return color ? ` --color-${key}: ${color};` : null
+ itemConfig.color;
+ return color ? ` --color-${key}: ${color};` : null;
})
.join("\n")}
}
@@ -97,10 +97,10 @@ ${colorConfig
.join("\n"),
}}
/>
- )
-}
+ );
+};
-const ChartTooltip = RechartsPrimitive.Tooltip
+const ChartTooltip = RechartsPrimitive.Tooltip;
function ChartTooltipContent({
active,
@@ -118,40 +118,40 @@ function ChartTooltipContent({
labelKey,
}: React.ComponentProps &
React.ComponentProps<"div"> & {
- hideLabel?: boolean
- hideIndicator?: boolean
- indicator?: "line" | "dot" | "dashed"
- nameKey?: string
- labelKey?: string
+ hideLabel?: boolean;
+ hideIndicator?: boolean;
+ indicator?: "line" | "dot" | "dashed";
+ nameKey?: string;
+ labelKey?: string;
}) {
- const { config } = useChart()
+ const { config } = useChart();
const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
- return null
+ return null;
}
- const [item] = payload
- const key = `${labelKey || item?.dataKey || item?.name || "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
+ const [item] = payload;
+ const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
const value =
!labelKey && typeof label === "string"
? config[label as keyof typeof config]?.label || label
- : itemConfig?.label
+ : itemConfig?.label;
if (labelFormatter) {
return (
{labelFormatter(value, payload)}
- )
+ );
}
if (!value) {
- return null
+ return null;
}
- return {value}
+ return {value}
;
}, [
label,
labelFormatter,
@@ -160,13 +160,13 @@ function ChartTooltipContent({
labelClassName,
config,
labelKey,
- ])
+ ]);
if (!active || !payload?.length) {
- return null
+ return null;
}
- const nestLabel = payload.length === 1 && indicator !== "dot"
+ const nestLabel = payload.length === 1 && indicator !== "dot";
return (
- {!nestLabel ? tooltipLabel : null}
+ {nestLabel ? null : tooltipLabel}
{payload.map((item, index) => {
- const key = `${nameKey || item.name || item.dataKey || "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
- const indicatorColor = color || item.payload.fill || item.color
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
+ const indicatorColor = color || item.payload.fill || item.color;
return (
)}
- )
+ );
})}
- )
+ );
}
-const ChartLegend = RechartsPrimitive.Legend
+const ChartLegend = RechartsPrimitive.Legend;
function ChartLegendContent({
className,
@@ -256,13 +256,13 @@ function ChartLegendContent({
nameKey,
}: React.ComponentProps<"div"> &
Pick & {
- hideIcon?: boolean
- nameKey?: string
+ hideIcon?: boolean;
+ nameKey?: string;
}) {
- const { config } = useChart()
+ const { config } = useChart();
if (!payload?.length) {
- return null
+ return null;
}
return (
@@ -274,8 +274,8 @@ function ChartLegendContent({
)}
>
{payload.map((item) => {
- const key = `${nameKey || item.dataKey || "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
+ const key = `${nameKey || item.dataKey || "value"}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
return (
- )
+ );
})}
- )
+ );
}
// Helper to extract item config from a payload.
@@ -309,7 +309,7 @@ function getPayloadConfigFromPayload(
key: string
) {
if (typeof payload !== "object" || payload === null) {
- return undefined
+ return undefined;
}
const payloadPayload =
@@ -317,15 +317,15 @@ function getPayloadConfigFromPayload(
typeof payload.payload === "object" &&
payload.payload !== null
? payload.payload
- : undefined
+ : undefined;
- let configLabelKey: string = key
+ let configLabelKey: string = key;
if (
key in payload &&
typeof payload[key as keyof typeof payload] === "string"
) {
- configLabelKey = payload[key as keyof typeof payload] as string
+ configLabelKey = payload[key as keyof typeof payload] as string;
} else if (
payloadPayload &&
key in payloadPayload &&
@@ -333,12 +333,12 @@ function getPayloadConfigFromPayload(
) {
configLabelKey = payloadPayload[
key as keyof typeof payloadPayload
- ] as string
+ ] as string;
}
return configLabelKey in config
? config[configLabelKey]
- : config[key as keyof typeof config]
+ : config[key as keyof typeof config];
}
export {
@@ -348,4 +348,4 @@ export {
ChartLegend,
ChartLegendContent,
ChartStyle,
-}
+};
diff --git a/apps/webui/src/components/ui/checkbox.tsx b/apps/webui/src/components/ui/checkbox.tsx
index d11762b..4666eb3 100644
--- a/apps/webui/src/components/ui/checkbox.tsx
+++ b/apps/webui/src/components/ui/checkbox.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
import { CheckIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Checkbox({
className,
diff --git a/apps/webui/src/components/ui/command.tsx b/apps/webui/src/components/ui/command.tsx
index 52479de..aca1afe 100644
--- a/apps/webui/src/components/ui/command.tsx
+++ b/apps/webui/src/components/ui/command.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import { Command as CommandPrimitive } from "cmdk"
import { SearchIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import {
Dialog,
DialogContent,
diff --git a/apps/webui/src/components/ui/context-menu.tsx b/apps/webui/src/components/ui/context-menu.tsx
index f494332..3226c21 100644
--- a/apps/webui/src/components/ui/context-menu.tsx
+++ b/apps/webui/src/components/ui/context-menu.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function ContextMenu({
...props
diff --git a/apps/webui/src/components/ui/dialog.tsx b/apps/webui/src/components/ui/dialog.tsx
index d75265b..dee406c 100644
--- a/apps/webui/src/components/ui/dialog.tsx
+++ b/apps/webui/src/components/ui/dialog.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as DialogPrimitive from "@radix-ui/react-dialog"
import { XIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Dialog({
...props
diff --git a/apps/webui/src/components/ui/drawer.tsx b/apps/webui/src/components/ui/drawer.tsx
index 138b8e8..ec8100d 100644
--- a/apps/webui/src/components/ui/drawer.tsx
+++ b/apps/webui/src/components/ui/drawer.tsx
@@ -1,7 +1,7 @@
import * as React from "react"
import { Drawer as DrawerPrimitive } from "vaul"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Drawer({
...props
diff --git a/apps/webui/src/components/ui/dropdown-menu.tsx b/apps/webui/src/components/ui/dropdown-menu.tsx
index 055791c..58d3d1a 100644
--- a/apps/webui/src/components/ui/dropdown-menu.tsx
+++ b/apps/webui/src/components/ui/dropdown-menu.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function DropdownMenu({
...props
diff --git a/apps/webui/src/components/ui/form.tsx b/apps/webui/src/components/ui/form.tsx
index 82d546d..eed683a 100644
--- a/apps/webui/src/components/ui/form.tsx
+++ b/apps/webui/src/components/ui/form.tsx
@@ -1,31 +1,31 @@
-import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-import { Slot } from "@radix-ui/react-slot"
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { Slot } from "@radix-ui/react-slot";
+import * as React from "react";
import {
Controller,
- FormProvider,
- useFormContext,
- useFormState,
type ControllerProps,
type FieldPath,
type FieldValues,
-} from "react-hook-form"
+ FormProvider,
+ useFormContext,
+ useFormState,
+} from "react-hook-form";
-import { cn } from "@/styles/utils"
-import { Label } from "@/components/ui/label"
+import { Label } from "@/components/ui/label";
+import { cn } from "@/infra/styles/utils";
-const Form = FormProvider
+const Form = FormProvider;
type FormFieldContextValue<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath = FieldPath,
> = {
- name: TName
-}
+ name: TName;
+};
const FormFieldContext = React.createContext(
{} as FormFieldContextValue
-)
+);
const FormField = <
TFieldValues extends FieldValues = FieldValues,
@@ -37,21 +37,21 @@ const FormField = <
- )
-}
+ );
+};
const useFormField = () => {
- const fieldContext = React.useContext(FormFieldContext)
- const itemContext = React.useContext(FormItemContext)
- const { getFieldState } = useFormContext()
- const formState = useFormState({ name: fieldContext.name })
- const fieldState = getFieldState(fieldContext.name, formState)
+ const fieldContext = React.useContext(FormFieldContext);
+ const itemContext = React.useContext(FormItemContext);
+ const { getFieldState } = useFormContext();
+ const formState = useFormState({ name: fieldContext.name });
+ const fieldState = getFieldState(fieldContext.name, formState);
if (!fieldContext) {
- throw new Error("useFormField should be used within ")
+ throw new Error("useFormField should be used within ");
}
- const { id } = itemContext
+ const { id } = itemContext;
return {
id,
@@ -60,19 +60,19 @@ const useFormField = () => {
formDescriptionId: `${id}-form-item-description`,
formMessageId: `${id}-form-item-message`,
...fieldState,
- }
-}
+ };
+};
type FormItemContextValue = {
- id: string
-}
+ id: string;
+};
const FormItemContext = React.createContext(
{} as FormItemContextValue
-)
+);
function FormItem({ className, ...props }: React.ComponentProps<"div">) {
- const id = React.useId()
+ const id = React.useId();
return (
@@ -82,14 +82,14 @@ function FormItem({ className, ...props }: React.ComponentProps<"div">) {
{...props}
/>
- )
+ );
}
function FormLabel({
className,
...props
}: React.ComponentProps) {
- const { error, formItemId } = useFormField()
+ const { error, formItemId } = useFormField();
return (
- )
+ );
}
function FormControl({ ...props }: React.ComponentProps) {
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
+ const { error, formItemId, formDescriptionId, formMessageId } =
+ useFormField();
return (
- )
+ );
}
function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
- const { formDescriptionId } = useFormField()
+ const { formDescriptionId } = useFormField();
return (
) {
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
- )
+ );
}
function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
- const { error, formMessageId } = useFormField()
- const body = error ? String(error?.message ?? "") : props.children
+ const { error, formMessageId } = useFormField();
+ const body = error ? String(error?.message ?? "") : props.children;
if (!body) {
- return null
+ return null;
}
return (
@@ -150,7 +149,7 @@ function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
>
{body}
- )
+ );
}
export {
@@ -162,4 +161,4 @@ export {
FormDescription,
FormMessage,
FormField,
-}
+};
diff --git a/apps/webui/src/components/ui/hover-card.tsx b/apps/webui/src/components/ui/hover-card.tsx
index 1e744d8..b2cbc00 100644
--- a/apps/webui/src/components/ui/hover-card.tsx
+++ b/apps/webui/src/components/ui/hover-card.tsx
@@ -1,7 +1,7 @@
import * as React from "react"
import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function HoverCard({
...props
diff --git a/apps/webui/src/components/ui/input-otp.tsx b/apps/webui/src/components/ui/input-otp.tsx
index 86676c1..e35abd4 100644
--- a/apps/webui/src/components/ui/input-otp.tsx
+++ b/apps/webui/src/components/ui/input-otp.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import { OTPInput, OTPInputContext } from "input-otp"
import { MinusIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function InputOTP({
className,
diff --git a/apps/webui/src/components/ui/input.tsx b/apps/webui/src/components/ui/input.tsx
index a565643..309c79b 100644
--- a/apps/webui/src/components/ui/input.tsx
+++ b/apps/webui/src/components/ui/input.tsx
@@ -1,6 +1,6 @@
import * as React from "react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
diff --git a/apps/webui/src/components/ui/label.tsx b/apps/webui/src/components/ui/label.tsx
index 5b90ad4..b739812 100644
--- a/apps/webui/src/components/ui/label.tsx
+++ b/apps/webui/src/components/ui/label.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Label({
className,
diff --git a/apps/webui/src/components/ui/menubar.tsx b/apps/webui/src/components/ui/menubar.tsx
index 63afb40..faeaba2 100644
--- a/apps/webui/src/components/ui/menubar.tsx
+++ b/apps/webui/src/components/ui/menubar.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as MenubarPrimitive from "@radix-ui/react-menubar"
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Menubar({
className,
diff --git a/apps/webui/src/components/ui/navigation-menu.tsx b/apps/webui/src/components/ui/navigation-menu.tsx
index f37d5ca..ea9758b 100644
--- a/apps/webui/src/components/ui/navigation-menu.tsx
+++ b/apps/webui/src/components/ui/navigation-menu.tsx
@@ -3,7 +3,7 @@ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
import { cva } from "class-variance-authority"
import { ChevronDownIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function NavigationMenu({
className,
diff --git a/apps/webui/src/components/ui/pagination.tsx b/apps/webui/src/components/ui/pagination.tsx
index 87e9976..9066f1d 100644
--- a/apps/webui/src/components/ui/pagination.tsx
+++ b/apps/webui/src/components/ui/pagination.tsx
@@ -5,7 +5,7 @@ import {
MoreHorizontalIcon,
} from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import { Button, buttonVariants } from "@/components/ui/button"
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
diff --git a/apps/webui/src/components/ui/popover.tsx b/apps/webui/src/components/ui/popover.tsx
index 41c73c8..02d71ab 100644
--- a/apps/webui/src/components/ui/popover.tsx
+++ b/apps/webui/src/components/ui/popover.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as PopoverPrimitive from "@radix-ui/react-popover"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Popover({
...props
diff --git a/apps/webui/src/components/ui/pro-link.tsx b/apps/webui/src/components/ui/pro-link.tsx
index 498eb84..62bc6c4 100644
--- a/apps/webui/src/components/ui/pro-link.tsx
+++ b/apps/webui/src/components/ui/pro-link.tsx
@@ -1,17 +1,11 @@
-import { cn } from '@/styles/utils';
-import { type LinkComponent, createLink } from '@tanstack/react-router';
-import type { AnchorHTMLAttributes, ComponentProps } from 'react';
+import { type LinkComponent, createLink } from "@tanstack/react-router";
+import type { AnchorHTMLAttributes, ComponentProps } from "react";
export interface BasicLinkProps
extends AnchorHTMLAttributes {}
-const BasicLinkComponent = (props: ComponentProps<'a'>) => {
- return (
-
- );
+const BasicLinkComponent = (props: ComponentProps<"a">) => {
+ return ;
};
const CreatedLinkComponent = createLink(BasicLinkComponent);
@@ -20,7 +14,7 @@ export const ProLink: LinkComponent = (props) => {
if (props.href) {
return ;
}
- return ;
+ return ;
};
export type ProLinkProps = ComponentProps;
diff --git a/apps/webui/src/components/ui/progress-circle.tsx b/apps/webui/src/components/ui/progress-circle.tsx
index b3c1d44..c41abcd 100644
--- a/apps/webui/src/components/ui/progress-circle.tsx
+++ b/apps/webui/src/components/ui/progress-circle.tsx
@@ -1,4 +1,4 @@
-import { cn } from '@/styles/utils';
+import { cn } from '@/infra/styles/utils';
import type { FC, HTMLAttributes } from 'react';
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
diff --git a/apps/webui/src/components/ui/progress.tsx b/apps/webui/src/components/ui/progress.tsx
index 4f87dba..50b5b48 100644
--- a/apps/webui/src/components/ui/progress.tsx
+++ b/apps/webui/src/components/ui/progress.tsx
@@ -1,7 +1,7 @@
import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Progress({
className,
diff --git a/apps/webui/src/components/ui/radio-group.tsx b/apps/webui/src/components/ui/radio-group.tsx
index 69698d8..57f0516 100644
--- a/apps/webui/src/components/ui/radio-group.tsx
+++ b/apps/webui/src/components/ui/radio-group.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
import { CircleIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function RadioGroup({
className,
diff --git a/apps/webui/src/components/ui/resizable.tsx b/apps/webui/src/components/ui/resizable.tsx
index 50da696..4416bd8 100644
--- a/apps/webui/src/components/ui/resizable.tsx
+++ b/apps/webui/src/components/ui/resizable.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import { GripVerticalIcon } from "lucide-react"
import * as ResizablePrimitive from "react-resizable-panels"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function ResizablePanelGroup({
className,
diff --git a/apps/webui/src/components/ui/scroll-area.tsx b/apps/webui/src/components/ui/scroll-area.tsx
index 433a3d1..c2c94a0 100644
--- a/apps/webui/src/components/ui/scroll-area.tsx
+++ b/apps/webui/src/components/ui/scroll-area.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function ScrollArea({
className,
diff --git a/apps/webui/src/components/ui/select.tsx b/apps/webui/src/components/ui/select.tsx
index 332bd66..951dbf1 100644
--- a/apps/webui/src/components/ui/select.tsx
+++ b/apps/webui/src/components/ui/select.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Select({
...props
diff --git a/apps/webui/src/components/ui/separator.tsx b/apps/webui/src/components/ui/separator.tsx
index 38ba680..b9df263 100644
--- a/apps/webui/src/components/ui/separator.tsx
+++ b/apps/webui/src/components/ui/separator.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Separator({
className,
diff --git a/apps/webui/src/components/ui/sheet.tsx b/apps/webui/src/components/ui/sheet.tsx
index eea3ec0..9bb9f20 100644
--- a/apps/webui/src/components/ui/sheet.tsx
+++ b/apps/webui/src/components/ui/sheet.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as SheetPrimitive from "@radix-ui/react-dialog"
import { XIcon } from "lucide-react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Sheet({ ...props }: React.ComponentProps) {
return
diff --git a/apps/webui/src/components/ui/sidebar.tsx b/apps/webui/src/components/ui/sidebar.tsx
index d42521e..b137bca 100644
--- a/apps/webui/src/components/ui/sidebar.tsx
+++ b/apps/webui/src/components/ui/sidebar.tsx
@@ -1,39 +1,39 @@
-'use client';
+"use client";
-import { Slot } from '@radix-ui/react-slot';
-import { type VariantProps, cva } from 'class-variance-authority';
-import { PanelLeftIcon } from 'lucide-react';
-import * as React from 'react';
+import { Slot } from "@radix-ui/react-slot";
+import { VariantProps, cva } from "class-variance-authority";
+import { PanelLeftIcon } from "lucide-react";
+import * as React from "react";
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Separator } from '@/components/ui/separator';
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Separator } from "@/components/ui/separator";
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
-} from '@/components/ui/sheet';
-import { Skeleton } from '@/components/ui/skeleton';
+} from "@/components/ui/sheet";
+import { Skeleton } from "@/components/ui/skeleton";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
-} from '@/components/ui/tooltip';
-import { useIsMobile } from '@/hooks/use-mobile';
-import { cn } from '@/styles/utils';
+} from "@/components/ui/tooltip";
+import { useIsMobile } from "@/infra/hooks/use-mobile";
+import { cn } from "@/infra/styles/utils";
-const SIDEBAR_COOKIE_NAME = 'sidebar_state';
+const SIDEBAR_COOKIE_NAME = "sidebar_state";
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
-const SIDEBAR_WIDTH = '16rem';
-const SIDEBAR_WIDTH_MOBILE = '18rem';
-const SIDEBAR_WIDTH_ICON = '3rem';
-const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
+const SIDEBAR_WIDTH = "16rem";
+const SIDEBAR_WIDTH_MOBILE = "18rem";
+const SIDEBAR_WIDTH_ICON = "3rem";
+const SIDEBAR_KEYBOARD_SHORTCUT = "b";
type SidebarContextProps = {
- state: 'expanded' | 'collapsed';
+ state: "expanded" | "collapsed";
open: boolean;
setOpen: (open: boolean) => void;
openMobile: boolean;
@@ -47,7 +47,7 @@ const SidebarContext = React.createContext(null);
function useSidebar() {
const context = React.useContext(SidebarContext);
if (!context) {
- throw new Error('useSidebar must be used within a SidebarProvider.');
+ throw new Error("useSidebar must be used within a SidebarProvider.");
}
return context;
@@ -61,7 +61,7 @@ function SidebarProvider({
style,
children,
...props
-}: React.ComponentProps<'div'> & {
+}: React.ComponentProps<"div"> & {
defaultOpen?: boolean;
open?: boolean;
onOpenChange?: (open: boolean) => void;
@@ -75,7 +75,7 @@ function SidebarProvider({
const open = openProp ?? _open;
const setOpen = React.useCallback(
(value: boolean | ((value: boolean) => boolean)) => {
- const openState = typeof value === 'function' ? value(open) : value;
+ const openState = typeof value === "function" ? value(open) : value;
if (setOpenProp) {
setOpenProp(openState);
} else {
@@ -83,8 +83,7 @@ function SidebarProvider({
}
// This sets the cookie to keep the sidebar state.
- // TODO
- // biome-ignore lint/nursery/noDocumentCookie:
+ // TODO: FIXME
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
},
[setOpenProp, open]
@@ -107,13 +106,13 @@ function SidebarProvider({
}
};
- window.addEventListener('keydown', handleKeyDown);
- return () => window.removeEventListener('keydown', handleKeyDown);
+ window.addEventListener("keydown", handleKeyDown);
+ return () => window.removeEventListener("keydown", handleKeyDown);
}, [toggleSidebar]);
// We add a state so that we can do data-state="expanded" or "collapsed".
// This makes it easier to style the sidebar with Tailwind classes.
- const state = open ? 'expanded' : 'collapsed';
+ const state = open ? "expanded" : "collapsed";
const contextValue = React.useMemo(
() => ({
@@ -135,13 +134,13 @@ function SidebarProvider({
data-slot="sidebar-wrapper"
style={
{
- '--sidebar-width': SIDEBAR_WIDTH,
- '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
+ "--sidebar-width": SIDEBAR_WIDTH,
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
...style,
} as React.CSSProperties
}
className={cn(
- 'group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
className
)}
{...props}
@@ -154,25 +153,25 @@ function SidebarProvider({
}
function Sidebar({
- side = 'left',
- variant = 'sidebar',
- collapsible = 'offcanvas',
+ side = "left",
+ variant = "sidebar",
+ collapsible = "offcanvas",
className,
children,
...props
-}: React.ComponentProps<'div'> & {
- side?: 'left' | 'right';
- variant?: 'sidebar' | 'floating' | 'inset';
- collapsible?: 'offcanvas' | 'icon' | 'none';
+}: React.ComponentProps<"div"> & {
+ side?: "left" | "right";
+ variant?: "sidebar" | "floating" | "inset";
+ collapsible?: "offcanvas" | "icon" | "none";
}) {
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
- if (collapsible === 'none') {
+ if (collapsible === "none") {
return (
{children}
@@ -268,7 +267,7 @@ function SidebarTrigger({
data-slot="sidebar-trigger"
variant="ghost"
size="icon"
- className={cn('size-7', className)}
+ className={cn("size-7", className)}
onClick={(event) => {
onClick?.(event);
toggleSidebar();
@@ -281,7 +280,7 @@ function SidebarTrigger({
);
}
-function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
+function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
const { toggleSidebar } = useSidebar();
return (
@@ -293,12 +292,12 @@ function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
onClick={toggleSidebar}
title="Toggle Sidebar"
className={cn(
- '-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex',
- 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
- '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
- 'group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full',
- '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
- '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
className
)}
{...props}
@@ -306,13 +305,13 @@ function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
);
}
-function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {
+function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
return (
);
}
-function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {
+function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
);
}
-function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {
+function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
);
@@ -364,19 +363,19 @@ function SidebarSeparator({
);
}
-function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {
+function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
return (
) {
);
}
-function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {
+function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
);
@@ -399,16 +398,16 @@ function SidebarGroupLabel({
className,
asChild = false,
...props
-}: React.ComponentProps<'div'> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : 'div';
+}: React.ComponentProps<"div"> & { asChild?: boolean }) {
+ const Comp = asChild ? Slot : "div";
return (
svg]:size-4 [&>svg]:shrink-0',
- 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
className
)}
{...props}
@@ -420,18 +419,18 @@ function SidebarGroupAction({
className,
asChild = false,
...props
-}: React.ComponentProps<'button'> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : 'button';
+}: React.ComponentProps<"button"> & { asChild?: boolean }) {
+ const Comp = asChild ? Slot : "button";
return (
svg]:size-4 [&>svg]:shrink-0',
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
// Increases the hit area of the button on mobile.
- 'after:-inset-2 after:absolute md:after:hidden',
- 'group-data-[collapsible=icon]:hidden',
+ "after:absolute after:-inset-2 md:after:hidden",
+ "group-data-[collapsible=icon]:hidden",
className
)}
{...props}
@@ -442,57 +441,57 @@ function SidebarGroupAction({
function SidebarGroupContent({
className,
...props
-}: React.ComponentProps<'div'>) {
+}: React.ComponentProps<"div">) {
return (
);
}
-function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {
+function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
return (
);
}
-function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {
+function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
return (
);
}
const sidebarMenuButtonVariants = cva(
- 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
{
variants: {
variant: {
- default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
outline:
- 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',
+ "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
},
size: {
- default: 'h-8 text-sm',
- sm: 'h-7 text-xs',
- lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
+ default: "h-8 text-sm",
+ sm: "h-7 text-xs",
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
},
},
defaultVariants: {
- variant: 'default',
- size: 'default',
+ variant: "default",
+ size: "default",
},
}
);
@@ -500,17 +499,17 @@ const sidebarMenuButtonVariants = cva(
function SidebarMenuButton({
asChild = false,
isActive = false,
- variant = 'default',
- size = 'default',
+ variant = "default",
+ size = "default",
tooltip,
className,
...props
-}: React.ComponentProps<'button'> & {
+}: React.ComponentProps<"button"> & {
asChild?: boolean;
isActive?: boolean;
tooltip?: string | React.ComponentProps;
} & VariantProps) {
- const Comp = asChild ? Slot : 'button';
+ const Comp = asChild ? Slot : "button";
const { isMobile, state } = useSidebar();
const button = (
@@ -528,7 +527,7 @@ function SidebarMenuButton({
return button;
}
- if (typeof tooltip === 'string') {
+ if (typeof tooltip === "string") {
tooltip = {
children: tooltip,
};
@@ -540,7 +539,7 @@ function SidebarMenuButton({
@@ -552,26 +551,26 @@ function SidebarMenuAction({
asChild = false,
showOnHover = false,
...props
-}: React.ComponentProps<'button'> & {
+}: React.ComponentProps<"button"> & {
asChild?: boolean;
showOnHover?: boolean;
}) {
- const Comp = asChild ? Slot : 'button';
+ const Comp = asChild ? Slot : "button";
return (
svg]:size-4 [&>svg]:shrink-0',
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
// Increases the hit area of the button on mobile.
- 'after:-inset-2 after:absolute md:after:hidden',
- 'peer-data-[size=sm]/menu-button:top-1',
- 'peer-data-[size=default]/menu-button:top-1.5',
- 'peer-data-[size=lg]/menu-button:top-2.5',
- 'group-data-[collapsible=icon]:hidden',
+ "after:absolute after:-inset-2 md:after:hidden",
+ "peer-data-[size=sm]/menu-button:top-1",
+ "peer-data-[size=default]/menu-button:top-1.5",
+ "peer-data-[size=lg]/menu-button:top-2.5",
+ "group-data-[collapsible=icon]:hidden",
showOnHover &&
- 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0',
+ "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
className
)}
{...props}
@@ -582,18 +581,18 @@ function SidebarMenuAction({
function SidebarMenuBadge({
className,
...props
-}: React.ComponentProps<'div'>) {
+}: React.ComponentProps<"div">) {
return (
& {
+}: React.ComponentProps<"div"> & {
showIcon?: boolean;
}) {
// Random width between 50 to 90%.
@@ -617,7 +616,7 @@ function SidebarMenuSkeleton({
{showIcon && (
@@ -631,7 +630,7 @@ function SidebarMenuSkeleton({
data-sidebar="menu-skeleton-text"
style={
{
- '--skeleton-width': width,
+ "--skeleton-width": width,
} as React.CSSProperties
}
/>
@@ -639,14 +638,14 @@ function SidebarMenuSkeleton({
);
}
-function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {
+function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
return (
) {
function SidebarMenuSubItem({
className,
...props
-}: React.ComponentProps<'li'>) {
+}: React.ComponentProps<"li">) {
return (
);
@@ -670,16 +669,16 @@ function SidebarMenuSubItem({
function SidebarMenuSubButton({
asChild = false,
- size = 'md',
+ size = "md",
isActive = false,
className,
...props
-}: React.ComponentProps<'a'> & {
+}: React.ComponentProps<"a"> & {
asChild?: boolean;
- size?: 'sm' | 'md';
+ size?: "sm" | "md";
isActive?: boolean;
}) {
- const Comp = asChild ? Slot : 'a';
+ const Comp = asChild ? Slot : "a";
return (
span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
- 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
- size === 'sm' && 'text-xs',
- size === 'md' && 'text-sm',
- 'group-data-[collapsible=icon]:hidden',
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
+ size === "sm" && "text-xs",
+ size === "md" && "text-sm",
+ "group-data-[collapsible=icon]:hidden",
className
)}
{...props}
diff --git a/apps/webui/src/components/ui/skeleton.tsx b/apps/webui/src/components/ui/skeleton.tsx
index f377c16..e3e900d 100644
--- a/apps/webui/src/components/ui/skeleton.tsx
+++ b/apps/webui/src/components/ui/skeleton.tsx
@@ -1,4 +1,5 @@
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils";
+import type React from "react";
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
@@ -7,7 +8,7 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
className={cn("bg-accent animate-pulse rounded-md", className)}
{...props}
/>
- )
+ );
}
-export { Skeleton }
+export { Skeleton };
diff --git a/apps/webui/src/components/ui/slider.tsx b/apps/webui/src/components/ui/slider.tsx
index e2ffafa..da91739 100644
--- a/apps/webui/src/components/ui/slider.tsx
+++ b/apps/webui/src/components/ui/slider.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Slider({
className,
diff --git a/apps/webui/src/components/ui/spinner.tsx b/apps/webui/src/components/ui/spinner.tsx
index 27924e3..fbc1891 100644
--- a/apps/webui/src/components/ui/spinner.tsx
+++ b/apps/webui/src/components/ui/spinner.tsx
@@ -1,4 +1,4 @@
-import { cn } from '@/styles/utils';
+import { cn } from '@/infra/styles/utils';
import {
Loader,
LoaderCircle,
diff --git a/apps/webui/src/components/ui/switch.tsx b/apps/webui/src/components/ui/switch.tsx
index 0d3423c..bba4a99 100644
--- a/apps/webui/src/components/ui/switch.tsx
+++ b/apps/webui/src/components/ui/switch.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as SwitchPrimitive from "@radix-ui/react-switch"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Switch({
className,
diff --git a/apps/webui/src/components/ui/table.tsx b/apps/webui/src/components/ui/table.tsx
index 0dba568..0e368d1 100644
--- a/apps/webui/src/components/ui/table.tsx
+++ b/apps/webui/src/components/ui/table.tsx
@@ -1,6 +1,6 @@
import * as React from "react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Table({ className, ...props }: React.ComponentProps<"table">) {
return (
diff --git a/apps/webui/src/components/ui/tabs.tsx b/apps/webui/src/components/ui/tabs.tsx
index 9b05c49..2f53040 100644
--- a/apps/webui/src/components/ui/tabs.tsx
+++ b/apps/webui/src/components/ui/tabs.tsx
@@ -3,7 +3,7 @@
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Tabs({
className,
diff --git a/apps/webui/src/components/ui/textarea.tsx b/apps/webui/src/components/ui/textarea.tsx
index cc79ddd..efbf4f7 100644
--- a/apps/webui/src/components/ui/textarea.tsx
+++ b/apps/webui/src/components/ui/textarea.tsx
@@ -1,6 +1,6 @@
import * as React from "react"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
return (
diff --git a/apps/webui/src/components/ui/toggle-group.tsx b/apps/webui/src/components/ui/toggle-group.tsx
index f6dedc8..a28565b 100644
--- a/apps/webui/src/components/ui/toggle-group.tsx
+++ b/apps/webui/src/components/ui/toggle-group.tsx
@@ -4,7 +4,7 @@ import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
import { type VariantProps } from "class-variance-authority"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
import { toggleVariants } from "@/components/ui/toggle"
const ToggleGroupContext = React.createContext<
diff --git a/apps/webui/src/components/ui/toggle.tsx b/apps/webui/src/components/ui/toggle.tsx
index ec02e6c..de55b2b 100644
--- a/apps/webui/src/components/ui/toggle.tsx
+++ b/apps/webui/src/components/ui/toggle.tsx
@@ -2,7 +2,7 @@ import * as React from "react"
import * as TogglePrimitive from "@radix-ui/react-toggle"
import { cva, type VariantProps } from "class-variance-authority"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
const toggleVariants = cva(
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
diff --git a/apps/webui/src/components/ui/tooltip.tsx b/apps/webui/src/components/ui/tooltip.tsx
index ff30bec..5e1ee28 100644
--- a/apps/webui/src/components/ui/tooltip.tsx
+++ b/apps/webui/src/components/ui/tooltip.tsx
@@ -1,7 +1,7 @@
import * as React from "react"
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
-import { cn } from "@/styles/utils"
+import { cn } from "@/infra/styles/utils"
function TooltipProvider({
delayDuration = 0,
diff --git a/apps/webui/src/errors/common.ts b/apps/webui/src/infra/errors/common.ts
similarity index 100%
rename from apps/webui/src/errors/common.ts
rename to apps/webui/src/infra/errors/common.ts
diff --git a/apps/webui/src/hooks/use-mobile.ts b/apps/webui/src/infra/hooks/use-mobile.ts
similarity index 100%
rename from apps/webui/src/hooks/use-mobile.ts
rename to apps/webui/src/infra/hooks/use-mobile.ts
diff --git a/apps/webui/src/platform/context.ts b/apps/webui/src/infra/platform/context.ts
similarity index 100%
rename from apps/webui/src/platform/context.ts
rename to apps/webui/src/infra/platform/context.ts
diff --git a/apps/webui/src/platform/errors.ts b/apps/webui/src/infra/platform/errors.ts
similarity index 100%
rename from apps/webui/src/platform/errors.ts
rename to apps/webui/src/infra/platform/errors.ts
diff --git a/apps/webui/src/platform/injection.ts b/apps/webui/src/infra/platform/injection.ts
similarity index 100%
rename from apps/webui/src/platform/injection.ts
rename to apps/webui/src/infra/platform/injection.ts
diff --git a/apps/webui/src/config/app-layout.ts b/apps/webui/src/infra/routes/nav.ts
similarity index 100%
rename from apps/webui/src/config/app-layout.ts
rename to apps/webui/src/infra/routes/nav.ts
diff --git a/apps/webui/src/traits/router.ts b/apps/webui/src/infra/routes/traits.ts
similarity index 100%
rename from apps/webui/src/traits/router.ts
rename to apps/webui/src/infra/routes/traits.ts
diff --git a/apps/webui/src/utils/route/index.ts b/apps/webui/src/infra/routes/utils.ts
similarity index 92%
rename from apps/webui/src/utils/route/index.ts
rename to apps/webui/src/infra/routes/utils.ts
index 7464356..af6a758 100644
--- a/apps/webui/src/utils/route/index.ts
+++ b/apps/webui/src/infra/routes/utils.ts
@@ -1,5 +1,5 @@
import { guardRouteIndexAsNotFound } from '@/components/layout/app-not-found';
-import type { RouteStateDataOption } from '@/traits/router';
+import type { RouteStateDataOption } from '@/infra/routes/traits';
import { Outlet } from '@tanstack/react-router';
export interface BuildVirtualBranchRouteOptions {
diff --git a/apps/webui/src/storage/context.ts b/apps/webui/src/infra/storage/context.ts
similarity index 100%
rename from apps/webui/src/storage/context.ts
rename to apps/webui/src/infra/storage/context.ts
diff --git a/apps/webui/src/storage/web-storage.service.ts b/apps/webui/src/infra/storage/web-storage.service.ts
similarity index 88%
rename from apps/webui/src/storage/web-storage.service.ts
rename to apps/webui/src/infra/storage/web-storage.service.ts
index e9d1880..02e3819 100644
--- a/apps/webui/src/storage/web-storage.service.ts
+++ b/apps/webui/src/infra/storage/web-storage.service.ts
@@ -1,5 +1,5 @@
-import { FeatureNotAvailablePlatformError } from '@/platform/errors';
-import { DOCUMENT } from '@/platform/injection';
+import { FeatureNotAvailablePlatformError } from '@/infra/platform/errors';
+import { DOCUMENT } from '@/infra/platform/injection';
import { Injectable, inject } from '@outposts/injection-js';
@Injectable()
diff --git a/apps/webui/src/styles/context.ts b/apps/webui/src/infra/styles/context.ts
similarity index 100%
rename from apps/webui/src/styles/context.ts
rename to apps/webui/src/infra/styles/context.ts
diff --git a/apps/webui/src/styles/theme.service.ts b/apps/webui/src/infra/styles/theme.service.ts
similarity index 90%
rename from apps/webui/src/styles/theme.service.ts
rename to apps/webui/src/infra/styles/theme.service.ts
index 42ffcff..713eb61 100644
--- a/apps/webui/src/styles/theme.service.ts
+++ b/apps/webui/src/infra/styles/theme.service.ts
@@ -1,5 +1,5 @@
-import { DOCUMENT } from '@/platform/injection';
-import { LocalStorageService } from '@/storage/web-storage.service';
+import { DOCUMENT } from '@/infra/platform/injection';
+import { LocalStorageService } from '@/infra/storage/web-storage.service';
import { Injectable, inject } from '@outposts/injection-js';
export type PreferColorSchemaType = 'dark' | 'light' | 'system';
diff --git a/apps/webui/src/styles/utils.ts b/apps/webui/src/infra/styles/utils.ts
similarity index 100%
rename from apps/webui/src/styles/utils.ts
rename to apps/webui/src/infra/styles/utils.ts
diff --git a/apps/webui/src/main.tsx b/apps/webui/src/main.tsx
index 984084e..50b6694 100644
--- a/apps/webui/src/main.tsx
+++ b/apps/webui/src/main.tsx
@@ -1,4 +1,8 @@
import '@abraham/reflection';
+import { provideAuth, setupAuthContext } from '@/app/auth/context';
+import { providePlatform } from '@/infra/platform/context';
+import { provideStorages } from '@/infra/storage/context';
+import { provideStyles } from '@/infra/styles/context';
import { type Injector, ReflectiveInjector } from '@outposts/injection-js';
import { RouterProvider, createRouter } from '@tanstack/react-router';
import {
@@ -7,12 +11,8 @@ import {
} from 'oidc-client-rx/adapters/react';
import { Suspense } from 'react';
import { createRoot } from 'react-dom/client';
-import { provideAuth, setupAuthContext } from './auth/context';
import { AppNotFoundComponent } from './components/layout/app-not-found';
-import { providePlatform } from './platform/context';
import { routeTree } from './routeTree.gen';
-import { provideStorages } from './storage/context';
-import { provideStyles } from './styles/context';
import './app.css';
// Create a new router instance
diff --git a/apps/webui/src/routes/__root.tsx b/apps/webui/src/routes/__root.tsx
index 557f9de..dd2b55d 100644
--- a/apps/webui/src/routes/__root.tsx
+++ b/apps/webui/src/routes/__root.tsx
@@ -1,4 +1,7 @@
-import type { RouteStateDataOption, RouterContext } from '@/traits/router';
+import type {
+ RouteStateDataOption,
+ RouterContext,
+} from '@/infra/routes/traits';
import { Outlet, createRootRouteWithContext } from '@tanstack/react-router';
import { Home } from 'lucide-react';
diff --git a/apps/webui/src/routes/_app/_explore/explore.tsx b/apps/webui/src/routes/_app/_explore/explore.tsx
index feb8b6f..d868dc7 100644
--- a/apps/webui/src/routes/_app/_explore/explore.tsx
+++ b/apps/webui/src/routes/_app/_explore/explore.tsx
@@ -1,4 +1,4 @@
-import type { RouteStateDataOption } from '@/traits/router';
+import type { RouteStateDataOption } from '@/infra/routes/traits';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/_explore/explore')({
diff --git a/apps/webui/src/routes/_app/_explore/feed.tsx b/apps/webui/src/routes/_app/_explore/feed.tsx
index 296016b..bef8d8d 100644
--- a/apps/webui/src/routes/_app/_explore/feed.tsx
+++ b/apps/webui/src/routes/_app/_explore/feed.tsx
@@ -1,4 +1,4 @@
-import type { RouteStateDataOption } from '@/traits/router';
+import type { RouteStateDataOption } from '@/infra/routes/traits';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/_explore/feed')({
diff --git a/apps/webui/src/routes/_app/playground/graphql-api.lazy.tsx b/apps/webui/src/routes/_app/playground/graphql-api.lazy.tsx
index 9f8a9af..f4ff939 100644
--- a/apps/webui/src/routes/_app/playground/graphql-api.lazy.tsx
+++ b/apps/webui/src/routes/_app/playground/graphql-api.lazy.tsx
@@ -1,10 +1,10 @@
-import { useAuth } from '@/auth/hooks';
+import { useAuth } from '@/app/auth/hooks';
import { type Fetcher, createGraphiQLFetcher } from '@graphiql/toolkit';
import { createLazyFileRoute } from '@tanstack/react-router';
import GraphiQL from 'graphiql';
import { useCallback } from 'react';
import 'graphiql/graphiql.css';
-import { AuthMethodEnum } from '@/auth/config';
+import { AuthMethodEnum } from '@/app/auth/config';
import { firstValueFrom } from 'rxjs';
export const Route = createLazyFileRoute('/_app/playground/graphql-api')({
diff --git a/apps/webui/src/routes/_app/playground/graphql-api.tsx b/apps/webui/src/routes/_app/playground/graphql-api.tsx
index 1c68374..7c86d46 100644
--- a/apps/webui/src/routes/_app/playground/graphql-api.tsx
+++ b/apps/webui/src/routes/_app/playground/graphql-api.tsx
@@ -1,5 +1,5 @@
import { AppSkeleton } from '@/components/layout/app-skeleton';
-import { buildLeafRouteStaticData } from '@/utils/route';
+import { buildLeafRouteStaticData } from '@/infra/routes/utils';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/playground/graphql-api')({
diff --git a/apps/webui/src/routes/_app/playground/route.tsx b/apps/webui/src/routes/_app/playground/route.tsx
index d396fed..c314f80 100644
--- a/apps/webui/src/routes/_app/playground/route.tsx
+++ b/apps/webui/src/routes/_app/playground/route.tsx
@@ -1,4 +1,4 @@
-import { buildVirtualBranchRouteOptions } from '@/utils/route';
+import { buildVirtualBranchRouteOptions } from '@/infra/routes/utils';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/playground')(
diff --git a/apps/webui/src/routes/_app/route.tsx b/apps/webui/src/routes/_app/route.tsx
index 9899907..b2fca2f 100644
--- a/apps/webui/src/routes/_app/route.tsx
+++ b/apps/webui/src/routes/_app/route.tsx
@@ -1,4 +1,4 @@
-import { beforeLoadGuard } from '@/auth/guard';
+import { beforeLoadGuard } from '@/app/auth/guard';
import { AppAside } from '@/components/layout/app-layout';
import { Outlet, createFileRoute } from '@tanstack/react-router';
diff --git a/apps/webui/src/routes/_app/settings/downloader.tsx b/apps/webui/src/routes/_app/settings/downloader.tsx
index e0628e8..767ad9d 100644
--- a/apps/webui/src/routes/_app/settings/downloader.tsx
+++ b/apps/webui/src/routes/_app/settings/downloader.tsx
@@ -1,4 +1,4 @@
-import { buildLeafRouteStaticData } from '@/utils/route';
+import { buildLeafRouteStaticData } from '@/infra/routes/utils';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/settings/downloader')({
diff --git a/apps/webui/src/routes/_app/settings/route.tsx b/apps/webui/src/routes/_app/settings/route.tsx
index 9315431..f6c8ae9 100644
--- a/apps/webui/src/routes/_app/settings/route.tsx
+++ b/apps/webui/src/routes/_app/settings/route.tsx
@@ -1,4 +1,4 @@
-import { buildVirtualBranchRouteOptions } from '@/utils/route';
+import { buildVirtualBranchRouteOptions } from '@/infra/routes/utils';
import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/_app/settings')(
diff --git a/apps/webui/src/routes/_app/subscriptions/create.tsx b/apps/webui/src/routes/_app/subscriptions/create.tsx
index 35d62b9..3fdd919 100644
--- a/apps/webui/src/routes/_app/subscriptions/create.tsx
+++ b/apps/webui/src/routes/_app/subscriptions/create.tsx
@@ -1,4 +1,4 @@
-import { useAuth } from '@/auth/hooks';
+import { useAuth } from '@/app/auth/hooks';
import { Button } from '@/components/ui/button';
import {
Card,
@@ -26,7 +26,7 @@ import {
SelectValue,
} from '@/components/ui/select';
import { Switch } from '@/components/ui/switch';
-import type { RouteStateDataOption } from '@/traits/router';
+import type { RouteStateDataOption } from '@/infra/routes/traits';
import { createFileRoute } from '@tanstack/react-router';
import { useNavigate } from '@tanstack/react-router';
import { useState } from 'react';
@@ -116,8 +116,8 @@ function SubscriptionCreateRouteComponent() {
return (
- Create Anime Subscription
- Add a new anime subscription source
+ Create Bangumi Subscription
+ Add a new bangumi subscription source