feat: adopt kumo green ui system

This commit is contained in:
2026-07-02 07:12:31 -07:00
parent 4bb4312b08
commit 0f0bd8813d
32 changed files with 1453 additions and 796 deletions

View File

@@ -7,7 +7,9 @@ import { useRouter } from "next/navigation";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input";
import { Table } from "@/components/ui/table";
import type { ApiResult } from "@/modules/core/server/api";
import type { Organization, OrganizationInvitation, RoleDefinition } from "@/modules/core/types";
import { getInviteHref, OrganizationInviteDialog } from "@/modules/settings/components/OrganizationInviteDialog";
@@ -74,7 +76,11 @@ export function OrganizationDetailClient({
<span className="block font-medium"></span>
<span className="block text-xs text-muted-foreground">使</span>
</span>
<input defaultChecked={organization.registrationEnabled} name="registrationEnabled" type="checkbox" />
<Checkbox
aria-label="开放公开注册"
defaultChecked={organization.registrationEnabled}
name="registrationEnabled"
/>
</label>
<label className="flex items-center justify-between gap-4 rounded-md border p-3 text-sm">
@@ -82,7 +88,7 @@ export function OrganizationDetailClient({
<span className="block font-medium"> OIDC </span>
<span className="block text-xs text-muted-foreground"> OIDC </span>
</span>
<input defaultChecked={organization.oidcEnabled} name="oidcEnabled" type="checkbox" />
<Checkbox aria-label="启用 OIDC 登录" defaultChecked={organization.oidcEnabled} name="oidcEnabled" />
</label>
<div className="grid gap-3 md:grid-cols-2">
@@ -126,7 +132,11 @@ export function OrganizationDetailClient({
<span className="block font-medium">OIDC </span>
<span className="block text-xs text-muted-foreground"> OIDC </span>
</span>
<input defaultChecked={organization.oidcAutoProvision} name="oidcAutoProvision" type="checkbox" />
<Checkbox
aria-label="OIDC 自动开户"
defaultChecked={organization.oidcAutoProvision}
name="oidcAutoProvision"
/>
</label>
{settingsMessage ? (
@@ -156,28 +166,28 @@ export function OrganizationDetailClient({
</CardHeader>
<CardContent className="grid gap-4">
<div className="overflow-x-auto rounded-md border">
<table className="w-full min-w-[720px] text-sm">
<thead className="bg-secondary text-left text-xs text-muted-foreground">
<tr>
<th className="px-4 py-3 font-medium"></th>
<th className="px-4 py-3 font-medium"></th>
<th className="px-4 py-3 font-medium"></th>
<th className="px-4 py-3 font-medium"></th>
<th className="px-4 py-3 text-right font-medium"></th>
</tr>
</thead>
<tbody className="divide-y bg-card">
<Table className="w-full min-w-[720px] text-sm">
<Table.Header className="bg-secondary text-left text-xs text-muted-foreground">
<Table.Row>
<Table.Head className="px-4 py-3 font-medium"></Table.Head>
<Table.Head className="px-4 py-3 font-medium"></Table.Head>
<Table.Head className="px-4 py-3 font-medium"></Table.Head>
<Table.Head className="px-4 py-3 font-medium"></Table.Head>
<Table.Head className="px-4 py-3 text-right font-medium"></Table.Head>
</Table.Row>
</Table.Header>
<Table.Body className="divide-y bg-card">
{invitations.map((invitation) => (
<tr className="hover:bg-secondary/45" key={invitation.id}>
<td className="px-4 py-3">{invitation.email || "通用邀请"}</td>
<td className="px-4 py-3">{invitation.roleLabel}</td>
<td className="px-4 py-3">
<Table.Row className="hover:bg-secondary/45" key={invitation.id}>
<Table.Cell className="px-4 py-3">{invitation.email || "通用邀请"}</Table.Cell>
<Table.Cell className="px-4 py-3">{invitation.roleLabel}</Table.Cell>
<Table.Cell className="px-4 py-3">
<Badge variant={invitation.status === "active" ? "success" : "secondary"}>{invitation.status}</Badge>
</td>
<td className="px-4 py-3 text-muted-foreground">
</Table.Cell>
<Table.Cell className="px-4 py-3 text-muted-foreground">
{new Date(invitation.expiresAt).toLocaleString("zh-CN")}
</td>
<td className="px-4 py-3 text-right">
</Table.Cell>
<Table.Cell className="px-4 py-3 text-right">
<Button
onClick={() => void navigator.clipboard.writeText(getInviteHref(invitation.token))}
size="sm"
@@ -187,18 +197,18 @@ export function OrganizationDetailClient({
<Copy className="size-4" aria-hidden="true" />
</Button>
</td>
</tr>
</Table.Cell>
</Table.Row>
))}
{invitations.length === 0 ? (
<tr>
<td className="px-4 py-8 text-center text-muted-foreground" colSpan={5}>
<Table.Row>
<Table.Cell className="px-4 py-8 text-center text-muted-foreground" colSpan={5}>
</td>
</tr>
</Table.Cell>
</Table.Row>
) : null}
</tbody>
</table>
</Table.Body>
</Table>
</div>
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<LinkIcon className="size-4" aria-hidden="true" />