diff --git a/ordinis-admin-ui/src/lib/scope-style.ts b/ordinis-admin-ui/src/lib/scope-style.ts new file mode 100644 index 0000000..b412fe4 --- /dev/null +++ b/ordinis-admin-ui/src/lib/scope-style.ts @@ -0,0 +1,42 @@ +import type { DataScope } from '@/api/client' + +/** + * Visual ordering: PUBLIC → INTERNAL → RESTRICTED. + * Reads as escalating sensitivity, matches semaphore mental model. + */ +export const SCOPE_ORDER: ReadonlyArray = [ + 'PUBLIC', + 'INTERNAL', + 'RESTRICTED', +] + +/** + * Solid background classes for ●-shaped scope indicators (size-2 dots, + * section-header bullets). + */ +export const SCOPE_DOT: Record = { + PUBLIC: 'bg-emerald-500', + INTERNAL: 'bg-amber-500', + RESTRICTED: 'bg-rose-500', +} + +/** + * `before:` background classes used for the 4px left-accent stripe on + * dictionary cards. Pair with `relative` + `before:absolute before:left-0 + * before:top-0 before:bottom-0 before:w-1 before:rounded-l-lg`. + */ +export const SCOPE_ACCENT: Record = { + PUBLIC: 'before:bg-emerald-500', + INTERNAL: 'before:bg-amber-500', + RESTRICTED: 'before:bg-rose-500', +} + +/** + * Solid border-top classes for page-level scope banner stripes (used on + * dictionary detail page). + */ +export const SCOPE_BORDER_TOP: Record = { + PUBLIC: 'border-t-emerald-500', + INTERNAL: 'border-t-amber-500', + RESTRICTED: 'border-t-rose-500', +} diff --git a/ordinis-admin-ui/src/routes/dictionaries.$name.tsx b/ordinis-admin-ui/src/routes/dictionaries.$name.tsx index 6c5abdb..8f41ed2 100644 --- a/ordinis-admin-ui/src/routes/dictionaries.$name.tsx +++ b/ordinis-admin-ui/src/routes/dictionaries.$name.tsx @@ -28,6 +28,7 @@ import { SchemaDrivenForm } from '@/components/form/SchemaDrivenForm' import { DictionaryEditorDialog } from '@/components/schema/DictionaryEditorDialog' import { RecordHistoryDrawer } from '@/components/record/RecordHistoryDrawer' import { nowIsoLocal } from '@/lib/dates' +import { SCOPE_BORDER_TOP, SCOPE_DOT } from '@/lib/scope-style' export const Route = createFileRoute('/dictionaries/$name')({ component: DictionaryDetail, @@ -87,14 +88,33 @@ function DictionaryDetail() { const serverError = serverErrorMessage(activeMutation?.error) const totalRecords = recordsResult.data?.length ?? 0 + const scope = detailQuery.data?.scope return (
+ {scope && ( +