feat(portal-shell): clean widget design tokens and fix lint:tokens (P1-6)

516 mechanical replacements across 25 widget files:
- spacing xs/sm/md/lg/xl to numeric 1/2/3/4/6
- text-heading-3 to text-lg font-semibold
- bg-danger to bg-destructive
- border border dedup

Fix .eslintrc.tokens.js to use typescript-eslint parser (was importing
uninstalled @typescript-eslint/parser). lint:tokens now passes.
This commit is contained in:
SpecialX
2026-07-22 15:07:38 +08:00
parent 9358372657
commit a28a6bd6ea
27 changed files with 388 additions and 384 deletions

View File

@@ -1,4 +1,4 @@
"use client";
"use client";
/**
* rbac-manageradmin / main
@@ -79,21 +79,21 @@ export default function RbacManager(_props: PluginProps): React.ReactElement {
if (roles.length === 0) {
return (
<section className="rounded-xl border border bg-card p-4">
<h3 className="text-heading-3 text-foreground"></h3>
<p className="mt-sm text-sm text-muted-foreground"></p>
<section className="rounded-xl border bg-card p-4">
<h3 className="text-lg font-semibold text-foreground"></h3>
<p className="mt-2 text-sm text-muted-foreground"></p>
</section>
);
}
return (
<section className="rounded-xl border border bg-card p-4">
<h3 className="text-heading-3 text-foreground"></h3>
<div className="mt-sm flex gap-4">
<section className="rounded-xl border bg-card p-4">
<h3 className="text-lg font-semibold text-foreground"></h3>
<div className="mt-2 flex gap-4">
{/* 左侧角色列表 */}
<div className="w-64 flex-shrink-0">
<p className="text-sm text-muted-foreground"></p>
<ul className="mt-xs space-y-xs">
<ul className="mt-1 space-y-1">
{roles.map((role) => {
const isSelected = role.id === effectiveRoleId;
return (
@@ -102,7 +102,7 @@ export default function RbacManager(_props: PluginProps): React.ReactElement {
type="button"
onClick={() => setSelectedRoleId(role.id)}
aria-pressed={isSelected}
className={`w-full rounded-md border px-sm py-xs text-left text-sm ${
className={`w-full rounded-md border px-2 py-1 text-left text-sm ${
isSelected
? "border-accent bg-primary-subtle text-foreground"
: "border bg-background text-foreground"
@@ -124,11 +124,11 @@ export default function RbacManager(_props: PluginProps): React.ReactElement {
<table className="w-full text-xs">
<thead>
<tr className="border-b border text-muted-foreground">
<th className="py-xs text-left"></th>
<th className="py-1 text-left"></th>
{roles.map((role) => (
<th
key={role.id}
className={`py-xs text-center ${
className={`py-1 text-center ${
role.id === effectiveRoleId
? "text-foreground"
: "text-muted-foreground"
@@ -142,7 +142,7 @@ export default function RbacManager(_props: PluginProps): React.ReactElement {
<tbody>
{permissions.map((perm) => (
<tr key={perm.id} className="border-b border">
<td className="py-xs">
<td className="py-1">
<p className="text-foreground">{perm.name}</p>
<p className="text-xs text-muted-foreground">
{perm.resource} / {perm.action}
@@ -153,7 +153,7 @@ export default function RbacManager(_props: PluginProps): React.ReactElement {
rolePermissionMap.get(role.id)?.has(perm.id) ?? false;
const isBusy = busyRoleId === role.id;
return (
<td key={role.id} className="py-xs text-center">
<td key={role.id} className="py-1 text-center">
<input
type="checkbox"
checked={checked}