Moved @tensamin/ui out of monorepo

This commit is contained in:
Alois 2026-04-12 00:08:15 +02:00
commit 39aa70a9a6
62 changed files with 309 additions and 3320 deletions

View file

@ -1,8 +1,8 @@
import type { User } from "@tensamin/user/context";
import { Avatar, AvatarImage, AvatarFallback } from "@tensamin/ui/cmp/avatar";
import { Avatar, AvatarImage, AvatarFallback } from "@tensamin/ui";
import { reduceDisplay } from "./utils";
import { Card, CardHeader } from "@tensamin/ui/cmp/card";
import { Skeleton } from "@tensamin/ui/cmp/skeleton";
import { Card, CardHeader } from "@tensamin/ui";
import { Skeleton } from "@tensamin/ui";
export function Basic(props: { user: User }) {
return (

View file

@ -1,20 +1,20 @@
import { Button } from "@tensamin/ui/cmp/button";
import { Button } from "@tensamin/ui";
import { ArrowLeft, House, Phone, Settings, User } from "lucide-react";
import { useLocation, useNavigate, useSearch } from "@tanstack/react-router";
import { useCall } from "@tensamin/call/context";
import Wrapper from "@tensamin/user/wrapper";
import { Skeleton } from "@tensamin/ui/cmp/skeleton";
import { Skeleton } from "@tensamin/ui";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
} from "@tensamin/ui/cmp/select";
} from "@tensamin/ui";
import { displayCallId } from "@tensamin/call/utils";
import { useState } from "react";
import { SidebarTrigger, useSidebar } from "@tensamin/ui/cmp/sidebar";
import { SidebarTrigger, useSidebar } from "@tensamin/ui";
import { useTTP } from "@tensamin/ttp/context";
import Controls from "@tensamin/tauri/controls";
import { WindowControls as Controls } from "@tensamin/ui";
export default function Navbar({ forMobile }: { forMobile: boolean }) {
const navigate = useNavigate();

View file

@ -1,6 +1,6 @@
import { Button } from "@tensamin/ui/cmp/button";
import { Input } from "@tensamin/ui/cmp/input";
import { Label } from "@tensamin/ui/cmp/label";
import { Button } from "@tensamin/ui";
import { Input } from "@tensamin/ui";
import { Label } from "@tensamin/ui";
import { useStorage } from "@tensamin/storage/context";
import { log, toast } from "@tensamin/shared/log";
import { File } from "lucide-react";

View file

@ -6,9 +6,9 @@ import {
Sidebar as SidebarRoot,
SidebarContent,
SidebarFooter,
} from "@tensamin/ui/cmp/sidebar";
} from "@tensamin/ui";
import { isTauri } from "@tauri-apps/api/core";
import { useIsMobile } from "@tensamin/ui/utils";
import { useIsMobile } from "@tensamin/ui";
import { MobileNavbar } from "./navbar";
import SidebarBox from "@tensamin/call/sidebarBox";

View file

@ -6,9 +6,9 @@ import {
ContextMenuGroup,
ContextMenuItem,
ContextMenuTrigger,
} from "@tensamin/ui/cmp/context-menu";
} from "@tensamin/ui";
import { useNavigate } from "@tanstack/react-router";
import { useSidebar } from "@tensamin/ui/cmp/sidebar";
import { useSidebar } from "@tensamin/ui";
export default function ConversationModal({ userId }: { userId: number }) {
const navigate = useNavigate();

View file

@ -1,16 +1,16 @@
import { useState, useCallback, useEffect } from "react";
import { useStorage } from "@tensamin/storage/context";
import { Button } from "@tensamin/ui/cmp/button";
import { Checkbox } from "@tensamin/ui/cmp/checkbox";
import { Button } from "@tensamin/ui";
import { Checkbox } from "@tensamin/ui";
import { z } from "zod";
import ErrorScreen from "@tensamin/ui/screens/error";
import { ErrorScreen } from "@tensamin/ui";
import { legalDocsSchema } from "@tensamin/shared/features/legal/schema";
import { log } from "@tensamin/shared/log";
import Link from "@tensamin/ui/link";
import { Label } from "@tensamin/ui/cmp/label";
import CreateScreen from "@tensamin/ui/screens/util";
import { Link } from "@tensamin/ui";
import { Label } from "@tensamin/ui";
import { CreateScreen } from "@tensamin/ui";
// Prevents the user from using Tensamin without accepting the privacy policy and terms of service.
export default function Screen(props: { children: React.ReactNode }) {

View file

@ -1,5 +1,5 @@
import { Label } from "@tensamin/ui/cmp/label";
import { Switch as UISwitch } from "@tensamin/ui/cmp/switch";
import { Label } from "@tensamin/ui";
import { Switch as UISwitch } from "@tensamin/ui";
import { useEffect, useState } from "react";
import { settingsStorageDefaults } from "@tensamin/shared/settings";

View file

@ -1,7 +1,7 @@
import { Button } from "@tensamin/ui/cmp/button";
import { Button } from "@tensamin/ui";
import options from "@tensamin/shared/settings";
import { cn, useIsMobile } from "@tensamin/ui/utils";
import { cn, useIsMobile } from "@tensamin/ui";
import { Outlet, useLocation, useNavigate } from "@tanstack/react-router";
export default function Screen() {

View file

@ -1,149 +1,7 @@
@import "tailwindcss";
@import "tailwind-scrollbar-hide/v4";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@fontsource-variable/inter";
@source "./**/*.{ts,tsx}";
@source "../../../packages/**/src/**/*.{ts,tsx}";
@theme inline {
--font-heading: var(--font-sans);
--font-sans: "Inter Variable", sans-serif;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--color-foreground: var(--foreground);
--color-background: var(--background);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.511 0.096 186.391);
--primary-foreground: oklch(0.984 0.014 180.72);
--secondary: oklch(0.967 0.001 286.375);
--secondary-foreground: oklch(0.21 0.006 285.885);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.855 0.138 181.071);
--chart-2: oklch(0.704 0.14 182.503);
--chart-3: oklch(0.6 0.118 184.704);
--chart-4: oklch(0.511 0.096 186.391);
--chart-5: oklch(0.437 0.078 188.216);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.6 0.118 184.704);
--sidebar-primary-foreground: oklch(0.984 0.014 180.72);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.225 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.437 0.078 188.216);
--primary-foreground: oklch(0.984 0.014 180.72);
--secondary: oklch(0.274 0.006 286.033);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.855 0.138 181.071);
--chart-2: oklch(0.704 0.14 182.503);
--chart-3: oklch(0.6 0.118 184.704);
--chart-4: oklch(0.511 0.096 186.391);
--chart-5: oklch(0.437 0.078 188.216);
--sidebar: oklch(0.19 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.704 0.14 182.503);
--sidebar-primary-foreground: oklch(0.277 0.046 192.524);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-black text-foreground;
}
html {
@apply font-sans;
}
::selection {
background: var(--color-primary, var(--primary));
color: var(--color-primary-foreground, var(--primary-foreground));
}
::-moz-selection {
background: var(--color-primary, var(--primary));
color: var(--color-primary-foreground, var(--primary-foreground));
}
.selection-foreground {
::selection {
@apply bg-foreground/65 text-background;
}
::-moz-selection {
@apply bg-foreground/65 text-background;
}
}
}

View file

@ -6,7 +6,9 @@ import {
createRoute,
createRouter,
} from "@tanstack/react-router";
import "./index.css";
import "@tensamin/ui/index.css";
import NotFound from "@/routes/404";
@ -25,7 +27,7 @@ import SocketContext from "@tensamin/ttp/context";
import UserContext from "@tensamin/user/context";
import DeeplinkContext from "@tensamin/tauri/deeplinkHandler";
import { ThemeProvider } from "@tensamin/ui/theme";
import { ThemeProvider } from "@tensamin/ui";
import z from "zod";
const wrapper = document.getElementById("root");

View file

@ -1,5 +1,3 @@
import { Input } from "@tensamin/ui/cmp/input";
import { Button } from "@tensamin/ui/cmp/button";
import {
Dialog,
DialogClose,
@ -8,7 +6,9 @@ import {
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@tensamin/ui/cmp/dialog";
Input, Button,
useIsMobile
} from "@tensamin/ui";
import z from "zod";
import { toast } from "@tensamin/shared/log";
import { useTTP } from "@tensamin/ttp/context";
@ -16,7 +16,6 @@ import { useState } from "react";
import { Loader2 } from "lucide-react";
import { isTauri } from "@tauri-apps/api/core";
import { useStorage } from "@tensamin/storage/context";
import { useIsMobile } from "@tensamin/ui/utils";
// The page
export default function Page() {

View file

@ -3,8 +3,7 @@ import { type ReactNode } from "react";
import Sidebar from "@/components/sidebar";
import Navbar, { MobileNavbar } from "@/components/navbar";
import { SidebarProvider } from "@tensamin/ui/cmp/sidebar";
import { useIsMobile, cn } from "@tensamin/ui/utils";
import { useIsMobile, cn, SidebarProvider } from "@tensamin/ui";
import { isTauri } from "@tauri-apps/api/core";
import { useLocation, useMatches } from "@tanstack/react-router";

View file

@ -6,12 +6,9 @@ import Mobile from "@tensamin/tauri/context";
import LegalWrapper from "@/features/legal/screen";
import { Toaster } from "@tensamin/ui/cmp/sonner";
import { TooltipProvider } from "@tensamin/ui/cmp/tooltip";
import { useStorage } from "@tensamin/storage/context";
import { useLocation, useNavigate } from "@tanstack/react-router";
import { useIsMobile } from "@tensamin/ui/utils";
import { useIsMobile, Toaster, TooltipProvider } from "@tensamin/ui";
import { isTauri } from "@tauri-apps/api/core";
/**

View file

@ -1,5 +1,5 @@
import Form from "@/components/screens/login/form";
import CreateScreen from "@tensamin/ui/screens/util";
import {CreateScreen} from "@tensamin/ui";
/**
* Executes Page.

View file

@ -1,5 +1,5 @@
import { SettingsSidebar } from "@/features/settings/layout";
import { useIsMobile } from "@tensamin/ui/utils";
import { useIsMobile } from "@tensamin/ui";
export default function Page() {
const isMobile = useIsMobile();

View file

@ -11,8 +11,8 @@ import {
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@tensamin/ui/cmp/alert-dialog";
import { Button } from "@tensamin/ui/cmp/button";
Button
} from "@tensamin/ui";
export default function Page() {
return (