feat: port TechLog shells and styles
This commit is contained in:
@@ -3,6 +3,12 @@ import { createRoot } from "react-dom/client";
|
||||
import { recordBootFailure } from "../adapters/diagnostics/bounded-diagnostics.ts";
|
||||
import { BootErrorShell } from "../presentation/boundaries/boot-error-shell.tsx";
|
||||
import "../presentation/styles/theme.css";
|
||||
import "pretendard/dist/web/variable/pretendardvariable.css";
|
||||
import "@fontsource/ibm-plex-mono/400.css";
|
||||
import "@fontsource/ibm-plex-mono/500.css";
|
||||
import "../features/tech-log/presentation/styles/globals.css";
|
||||
import "../features/tech-log/presentation/styles/studio.css";
|
||||
import "../features/tech-log/presentation/styles/studio-editor.css";
|
||||
import { createRuntimeComposition } from "./create-runtime-composition.ts";
|
||||
import { initializeColorScheme } from "./initialize-color-scheme.ts";
|
||||
import { ReleaseManifestError } from "./load-release-manifest.ts";
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import { projects, publicRecords, releases } from "./public-content.ts";
|
||||
import { getHomeFocusItems, searchPublicContent } from "./public-query.ts";
|
||||
|
||||
export const siteConfig = {
|
||||
brandTitle: "TechLog",
|
||||
identityStatement: "문제를 재현하고 검증해 운영 가능한 설계로 연결합니다.",
|
||||
operator: "동현",
|
||||
contactLabel: "프로필",
|
||||
contactPath: "/profile",
|
||||
latestRelease: "/releases/0.1.0",
|
||||
} as const;
|
||||
export { publicSiteConfig as siteConfig } from "../../contracts/public-site-config.ts";
|
||||
|
||||
export type {
|
||||
FocusKey,
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export const publicSiteConfig = Object.freeze({
|
||||
brandTitle: "TechLog",
|
||||
identityStatement: "문제를 재현하고 검증해 운영 가능한 설계로 연결합니다.",
|
||||
operator: "동현",
|
||||
contactLabel: "프로필",
|
||||
contactPath: "/profile",
|
||||
latestRelease: "/releases/0.1.0",
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
type FatalErrorStateProps = {
|
||||
traceId: string;
|
||||
onRetry?: () => void;
|
||||
retryHref?: string;
|
||||
};
|
||||
|
||||
export function FatalErrorState({
|
||||
traceId,
|
||||
onRetry,
|
||||
retryHref = "/",
|
||||
}: FatalErrorStateProps) {
|
||||
return (
|
||||
<main id="main-content" className="shell fatal-state">
|
||||
<p className="context-label">Service error</p>
|
||||
<h1>페이지를 불러오지 못했습니다.</h1>
|
||||
<p>
|
||||
잠시 후 다시 시도해 주세요. 문제가 계속되면 아래 Trace ID를 함께
|
||||
전달해 주세요.
|
||||
</p>
|
||||
<p className="trace-id">
|
||||
<span>Trace ID</span>
|
||||
<code>{traceId}</code>
|
||||
</p>
|
||||
{onRetry ? (
|
||||
<button className="primary-link" type="button" onClick={onRetry}>
|
||||
다시 시도
|
||||
</button>
|
||||
) : (
|
||||
<Link className="primary-link" to={retryHref}>
|
||||
다시 시도
|
||||
</Link>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import { useId, useRef, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { TECH_LOG_FEATURE_ID } from "../../../application/tech-log-feature-input.ts";
|
||||
import { useApplication } from "../../../../../presentation/providers/application-provider.tsx";
|
||||
|
||||
type SearchDialogProps = {
|
||||
className?: string;
|
||||
onBeforeOpen?: () => void;
|
||||
};
|
||||
|
||||
export function SearchDialog({
|
||||
className = "",
|
||||
onBeforeOpen,
|
||||
}: SearchDialogProps) {
|
||||
const dialogId = useId();
|
||||
const dialogRef = useRef<HTMLDialogElement>(null);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const triggerRef = useRef<HTMLButtonElement>(null);
|
||||
const [query, setQuery] = useState("");
|
||||
const normalizedQuery = query.trim().toLocaleLowerCase("ko-KR");
|
||||
const { publicContent } = useApplication().features.get(TECH_LOG_FEATURE_ID);
|
||||
const results = publicContent.searchPublicContent(normalizedQuery);
|
||||
|
||||
function open() {
|
||||
onBeforeOpen?.();
|
||||
dialogRef.current?.showModal();
|
||||
requestAnimationFrame(() => inputRef.current?.focus());
|
||||
}
|
||||
|
||||
function close() {
|
||||
dialogRef.current?.close();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
ref={triggerRef}
|
||||
className={className}
|
||||
type="button"
|
||||
aria-haspopup="dialog"
|
||||
aria-controls={dialogId}
|
||||
aria-label="TechLog 검색 열기"
|
||||
onClick={open}
|
||||
>
|
||||
검색
|
||||
</button>
|
||||
<dialog
|
||||
ref={dialogRef}
|
||||
className="search-dialog"
|
||||
id={dialogId}
|
||||
aria-labelledby={dialogId + "-title"}
|
||||
onClose={() => triggerRef.current?.focus()}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
close();
|
||||
}
|
||||
}}
|
||||
onClick={(event) => {
|
||||
if (event.target === event.currentTarget) close();
|
||||
}}
|
||||
>
|
||||
<div className="search-dialog-inner">
|
||||
<header>
|
||||
<div>
|
||||
<p className="context-label">Public records</p>
|
||||
<h2 id={dialogId + "-title"}>TechLog 검색</h2>
|
||||
</div>
|
||||
<button type="button" className="dialog-close" onClick={close}>
|
||||
닫기
|
||||
</button>
|
||||
</header>
|
||||
<label className="search-field">
|
||||
<span className="visually-hidden">검색어</span>
|
||||
<span aria-hidden="true">⌕</span>
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="search"
|
||||
value={query}
|
||||
onChange={(event) => setQuery(event.target.value)}
|
||||
placeholder="제목, 요약, 주제, 프로젝트 검색"
|
||||
autoComplete="off"
|
||||
/>
|
||||
</label>
|
||||
<p className="search-count" aria-live="polite">
|
||||
{results.length}개의 공개 기록
|
||||
</p>
|
||||
{results.length > 0 ? (
|
||||
<>
|
||||
<ul className="search-results">
|
||||
{results.map((entry) => (
|
||||
<li key={entry.path}>
|
||||
<Link to={entry.path} onClick={close}>
|
||||
<span>{entry.contentType}</span>
|
||||
<strong>{entry.title}</strong>
|
||||
<p>{entry.summary}</p>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{normalizedQuery ? (
|
||||
<Link
|
||||
className="search-all-link"
|
||||
to={`/search?q=${encodeURIComponent(query.trim())}`}
|
||||
onClick={close}
|
||||
>
|
||||
전체 검색 결과 보기 <span aria-hidden="true">→</span>
|
||||
</Link>
|
||||
) : null}
|
||||
</>
|
||||
) : (
|
||||
<p className="search-empty">일치하는 공개 기록이 없습니다.</p>
|
||||
)}
|
||||
</div>
|
||||
</dialog>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { useRef } from "react";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
|
||||
import { publicSiteConfig } from "../../../contracts/public-site-config.ts";
|
||||
import { SearchDialog } from "./search-dialog.tsx";
|
||||
|
||||
const navigation = [
|
||||
{ label: "탐색", path: "/explore" },
|
||||
{ label: "프로젝트", path: "/projects" },
|
||||
{ label: "변경 기록", path: "/releases" },
|
||||
{ label: "프로필", path: "/profile" },
|
||||
] as const;
|
||||
|
||||
export function SiteHeader({ currentPath }: { currentPath?: string }) {
|
||||
const location = useLocation();
|
||||
const activePath = currentPath ?? location.pathname;
|
||||
const menuRef = useRef<HTMLDetailsElement>(null);
|
||||
const summaryRef = useRef<HTMLElement>(null);
|
||||
|
||||
function isCurrent(path: string) {
|
||||
return (
|
||||
activePath === path ||
|
||||
(path !== "/" && activePath.startsWith(path + "/"))
|
||||
);
|
||||
}
|
||||
|
||||
function closeMenu(restoreFocus = false) {
|
||||
if (!menuRef.current) return;
|
||||
menuRef.current.open = false;
|
||||
if (restoreFocus) summaryRef.current?.focus();
|
||||
}
|
||||
|
||||
return (
|
||||
<header className="site-header">
|
||||
<div className="shell header-inner">
|
||||
<div className="header-brand-zone">
|
||||
<Link className="wordmark" to="/" aria-label="TechLog 홈">
|
||||
{publicSiteConfig.brandTitle}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="header-menu-zone">
|
||||
<nav className="desktop-nav" aria-label="주요 탐색">
|
||||
{navigation.map((item) => (
|
||||
<Link
|
||||
key={item.path}
|
||||
className="nav-link"
|
||||
to={item.path}
|
||||
aria-current={isCurrent(item.path) ? "page" : undefined}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
<div className="header-search-zone">
|
||||
<SearchDialog
|
||||
className="search-button"
|
||||
onBeforeOpen={() => closeMenu()}
|
||||
/>
|
||||
</div>
|
||||
<details
|
||||
ref={menuRef}
|
||||
className="mobile-nav"
|
||||
onKeyDown={(event) => {
|
||||
if (event.key !== "Escape") return;
|
||||
event.preventDefault();
|
||||
closeMenu(true);
|
||||
}}
|
||||
>
|
||||
<summary ref={summaryRef}>메뉴</summary>
|
||||
<nav aria-label="모바일 주요 탐색">
|
||||
{navigation.map((item) => (
|
||||
<Link
|
||||
key={item.path}
|
||||
to={item.path}
|
||||
aria-current={isCurrent(item.path) ? "page" : undefined}
|
||||
onClick={() => closeMenu()}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { publicSiteConfig } from "../../contracts/public-site-config.ts";
|
||||
import { SiteHeader } from "./components/site-header.tsx";
|
||||
|
||||
type PublicShellProps = {
|
||||
children: ReactNode;
|
||||
currentPath?: string;
|
||||
};
|
||||
|
||||
export function PublicShell({ children, currentPath }: PublicShellProps) {
|
||||
return (
|
||||
<div className="site-frame">
|
||||
<a className="skip-link" href="#main-content">
|
||||
본문으로 건너뛰기
|
||||
</a>
|
||||
<SiteHeader currentPath={currentPath} />
|
||||
|
||||
{children}
|
||||
|
||||
<footer className="site-footer">
|
||||
<div className="shell footer-inner">
|
||||
<div>
|
||||
<p className="footer-name">{publicSiteConfig.operator}</p>
|
||||
<p>{publicSiteConfig.identityStatement}</p>
|
||||
</div>
|
||||
<div className="footer-links">
|
||||
<Link to={publicSiteConfig.contactPath}>
|
||||
{publicSiteConfig.contactLabel}
|
||||
</Link>
|
||||
<Link to={publicSiteConfig.latestRelease}>최신 Release</Link>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,533 @@
|
||||
.page,
|
||||
.snapshotPage {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.heading {
|
||||
max-width: 780px;
|
||||
padding-bottom: 44px;
|
||||
border-bottom: 1px solid var(--line-strong);
|
||||
}
|
||||
|
||||
.heading h1,
|
||||
.routeState h1 {
|
||||
margin: 0 0 16px;
|
||||
font-size: clamp(36px, 6vw, 62px);
|
||||
line-height: 1.08;
|
||||
letter-spacing: -0.045em;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.heading > p:last-child,
|
||||
.routeState > p {
|
||||
color: var(--muted);
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 13px;
|
||||
color: var(--muted);
|
||||
font-family: "IBM Plex Mono", monospace;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.loading {
|
||||
min-height: 220px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.routeState,
|
||||
.errorState,
|
||||
.emptyState {
|
||||
max-width: 740px;
|
||||
padding-block: 48px;
|
||||
}
|
||||
|
||||
.routeState a,
|
||||
.routeState button,
|
||||
.errorState button {
|
||||
display: inline-flex;
|
||||
min-height: 44px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 18px;
|
||||
padding-inline: 16px;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: 5px;
|
||||
background: var(--paper);
|
||||
color: var(--signal);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.summary {
|
||||
margin-top: 30px;
|
||||
border-block: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.summary dl {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.summary dl > div {
|
||||
min-width: 0;
|
||||
padding: 20px;
|
||||
border-right: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.summary dl > div:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.summary dt,
|
||||
.snapshotToolbar dt {
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.summary dd,
|
||||
.snapshotToolbar dd {
|
||||
margin: 7px 0 0;
|
||||
font-size: 14px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.changeSummary,
|
||||
.publishAction,
|
||||
.blocked,
|
||||
.gateReady {
|
||||
max-width: 850px;
|
||||
padding-block: 42px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.changeSummary h2,
|
||||
.publishAction h2,
|
||||
.blocked h2,
|
||||
.gateReady h2,
|
||||
.errorState h2,
|
||||
.emptyState h2 {
|
||||
margin: 0 0 12px;
|
||||
font-size: 27px;
|
||||
line-height: 1.3;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.changeSummary p,
|
||||
.publishAction > p,
|
||||
.blocked p,
|
||||
.gateReady p,
|
||||
.errorState p,
|
||||
.emptyState p {
|
||||
color: var(--muted);
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.blocked {
|
||||
margin-top: 30px;
|
||||
padding-inline: 22px;
|
||||
border-left: 3px solid #9a611e;
|
||||
background: #fff9f0;
|
||||
}
|
||||
|
||||
.blocked a,
|
||||
.gateReady a {
|
||||
display: inline-flex;
|
||||
min-height: 44px;
|
||||
align-items: center;
|
||||
color: var(--signal);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.gateReady {
|
||||
margin-top: 30px;
|
||||
padding-inline: 22px;
|
||||
border-left: 3px solid #2d7257;
|
||||
background: #f4fbf7;
|
||||
}
|
||||
|
||||
.warningGroup {
|
||||
margin: 26px 0 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--line-strong);
|
||||
}
|
||||
|
||||
.warningGroup legend {
|
||||
padding: 22px 0 0;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.warningGroup > p,
|
||||
.noWarnings {
|
||||
margin: 8px 0 16px;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.warningList {
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.warningItem {
|
||||
display: grid;
|
||||
grid-template-columns: 24px minmax(0, 1fr);
|
||||
gap: 13px;
|
||||
min-height: 66px;
|
||||
align-items: start;
|
||||
padding-block: 16px;
|
||||
border-top: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.warningItem input {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
accent-color: var(--signal);
|
||||
}
|
||||
|
||||
.warningItem span {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.warningItem strong {
|
||||
font-family: "IBM Plex Mono", monospace;
|
||||
font-size: 12px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.warningItem small {
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.actions,
|
||||
.dialogActions,
|
||||
.rowActions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
justify-content: flex-end;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.actions a,
|
||||
.actions button,
|
||||
.rowActions a,
|
||||
.rowActions button,
|
||||
.filters button,
|
||||
.dialogActions button {
|
||||
display: inline-flex;
|
||||
min-height: 44px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-inline: 15px;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: 5px;
|
||||
background: var(--paper);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.actions button,
|
||||
.filters button {
|
||||
border-color: var(--signal);
|
||||
background: var(--signal);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.actions button:disabled,
|
||||
.dialogActions button:disabled {
|
||||
opacity: 0.52;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.error {
|
||||
margin-top: 18px;
|
||||
padding: 13px 15px;
|
||||
border-left: 3px solid #a13b31;
|
||||
background: #fff7f4;
|
||||
color: #75271f !important;
|
||||
}
|
||||
|
||||
.success {
|
||||
margin-top: 22px;
|
||||
padding: 13px 15px;
|
||||
border-left: 3px solid #2d7257;
|
||||
background: #f4fbf7;
|
||||
color: #215943;
|
||||
}
|
||||
|
||||
.filters {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(260px, 1fr) 190px auto;
|
||||
gap: 14px;
|
||||
align-items: end;
|
||||
padding-block: 28px;
|
||||
border-bottom: 1px solid var(--line-strong);
|
||||
}
|
||||
|
||||
.filters label {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: 7px;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.filters input,
|
||||
.filters select {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 44px;
|
||||
padding-inline: 12px;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: 5px;
|
||||
background: var(--paper);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.historyList {
|
||||
margin: 28px 0 0;
|
||||
padding: 0;
|
||||
border-top: 1px solid var(--line-strong);
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.historyRow {
|
||||
display: grid;
|
||||
grid-template-columns: 100px minmax(260px, 1fr) 180px minmax(160px, auto);
|
||||
gap: 20px;
|
||||
align-items: start;
|
||||
padding-block: 25px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.eventType,
|
||||
.kind {
|
||||
margin: 3px 0 0;
|
||||
color: var(--muted);
|
||||
font-family: "IBM Plex Mono", monospace;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.eventMain {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.eventMain h2 {
|
||||
margin: 5px 0 0;
|
||||
font-size: 17px;
|
||||
line-height: 1.5;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.eventMain > p:last-child,
|
||||
.historyRow time {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.rowActions {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.rowActions a,
|
||||
.rowActions button {
|
||||
color: var(--signal);
|
||||
}
|
||||
|
||||
.dialog {
|
||||
width: min(580px, calc(100% - 32px));
|
||||
max-height: calc(100vh - 32px);
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: 8px;
|
||||
background: var(--paper);
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.dialog::backdrop {
|
||||
background: rgba(23, 24, 27, 0.5);
|
||||
}
|
||||
|
||||
.dialogBody {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.dialogBody h2 {
|
||||
margin: 0 0 12px;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.dialogBody > p {
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.preservedNote {
|
||||
margin-top: 22px;
|
||||
padding: 17px;
|
||||
border-left: 3px solid #2d7257;
|
||||
background: #f4fbf7;
|
||||
}
|
||||
|
||||
.preservedNote p {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.dialogActions {
|
||||
justify-content: flex-end;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.dialogActions button:last-child {
|
||||
border-color: #9b342d;
|
||||
background: #9b342d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.snapshotToolbar {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(220px, 1fr) minmax(420px, 1.4fr) auto;
|
||||
gap: 24px;
|
||||
align-items: center;
|
||||
padding-bottom: 28px;
|
||||
border-bottom: 1px solid var(--line-strong);
|
||||
}
|
||||
|
||||
.snapshotTitle {
|
||||
margin: 0;
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.snapshotToolbar dl {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 16px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.snapshotToolbar a {
|
||||
display: inline-flex;
|
||||
min-height: 44px;
|
||||
align-items: center;
|
||||
color: var(--signal);
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.snapshotDocument {
|
||||
min-width: 0;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.snapshotDocument :global(.public-record-embedded) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.summary dl {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.summary dl > div:nth-child(2) {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.summary dl > div:nth-child(-n + 2) {
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.historyRow {
|
||||
grid-template-columns: 84px minmax(0, 1fr) 170px;
|
||||
}
|
||||
|
||||
.rowActions {
|
||||
grid-column: 2 / -1;
|
||||
}
|
||||
|
||||
.snapshotToolbar {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
.snapshotToolbar dl {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.heading {
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
.summary dl,
|
||||
.filters,
|
||||
.historyRow,
|
||||
.snapshotToolbar,
|
||||
.snapshotToolbar dl {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.summary dl > div,
|
||||
.summary dl > div:nth-child(2) {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.summary dl > div:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.filters button,
|
||||
.actions a,
|
||||
.actions button,
|
||||
.rowActions a,
|
||||
.rowActions button,
|
||||
.dialogActions button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.historyRow {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.rowActions,
|
||||
.snapshotToolbar dl {
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.rowActions,
|
||||
.actions,
|
||||
.dialogActions {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.dialogBody {
|
||||
padding: 24px 20px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
.studio-app .studio-editor-page,
|
||||
.studio-app .studio-editor-layout,
|
||||
.studio-app .studio-editor-workspace,
|
||||
.studio-app .studio-editor-workspace > [role="tabpanel"] { min-width: 0; }
|
||||
|
||||
.studio-app .studio-editor-loading { min-height: 240px; padding-block: 56px; color: var(--muted); }
|
||||
.studio-app .studio-editor-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-editor-tabs button { position: relative; min-width: 112px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; }
|
||||
.studio-app .studio-editor-tabs button[aria-selected="true"] { color: var(--ink); }
|
||||
.studio-app .studio-editor-tabs button[aria-selected="true"]::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--signal); content: ""; }
|
||||
|
||||
.studio-app .studio-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); gap: 64px; align-items: start; padding-top: 40px; }
|
||||
.studio-app .studio-editor-heading { padding-bottom: 36px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-editor-heading h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.05; letter-spacing: -0.045em; }
|
||||
.studio-app .studio-editor-heading > p:last-child { max-width: 780px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
|
||||
.studio-app .studio-editor-section { padding: 48px 0; border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-editor-section-heading { margin-bottom: 24px; }
|
||||
.studio-app .studio-editor-section-heading .studio-eyebrow { margin-bottom: 8px; }
|
||||
.studio-app .studio-editor-section-heading h2,
|
||||
.studio-app .studio-document-status-rail h2,
|
||||
.studio-app .studio-preview-error h2 { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
|
||||
|
||||
.studio-app .studio-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
|
||||
.studio-app .studio-field,
|
||||
.studio-app .studio-ordered-item > label,
|
||||
.studio-app .studio-relation-item > label { display: grid; min-width: 0; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
|
||||
.studio-app .studio-field--wide { grid-column: 1 / -1; }
|
||||
.studio-app .studio-field input,
|
||||
.studio-app .studio-field select,
|
||||
.studio-app .studio-field textarea,
|
||||
.studio-app .studio-ordered-item input,
|
||||
.studio-app .studio-ordered-item textarea,
|
||||
.studio-app .studio-relation-item input,
|
||||
.studio-app .studio-relation-item select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; font-weight: 450; line-height: 1.55; }
|
||||
.studio-app .studio-field textarea,
|
||||
.studio-app .studio-ordered-item textarea { min-height: 112px; resize: vertical; }
|
||||
.studio-app .studio-field .studio-markdown-field { min-height: 420px; font-family: "IBM Plex Mono", monospace; font-size: 13px; }
|
||||
|
||||
.studio-app .studio-ordered-list,
|
||||
.studio-app .studio-resolution-fields { min-width: 0; margin: 34px 0 0; padding: 0; border: 0; }
|
||||
.studio-app .studio-ordered-list legend,
|
||||
.studio-app .studio-resolution-fields legend { margin-bottom: 14px; font-size: 17px; font-weight: 700; }
|
||||
.studio-app .studio-ordered-list > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
|
||||
.studio-app .studio-ordered-item,
|
||||
.studio-app .studio-relation-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
|
||||
.studio-app .studio-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.studio-app .studio-item-actions button,
|
||||
.studio-app .studio-add-item,
|
||||
.studio-app .studio-document-status-rail button { min-height: 44px; padding-inline: 13px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font-weight: 650; }
|
||||
.studio-app .studio-item-actions button:disabled,
|
||||
.studio-app .studio-add-item:disabled { opacity: 0.45; }
|
||||
.studio-app .studio-add-item { margin-top: 12px; }
|
||||
.studio-app .studio-resolution-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
|
||||
.studio-app .studio-resolution-fields legend { grid-column: 1 / -1; }
|
||||
|
||||
.studio-app .studio-document-status-rail { position: sticky; top: 28px; min-width: 0; padding: 24px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-document-status-rail .studio-eyebrow { margin-bottom: 8px; }
|
||||
.studio-app .studio-editor-status { margin: 20px 0; font-weight: 700; }
|
||||
.studio-app .studio-editor-status--dirty,
|
||||
.studio-app .studio-editor-status--conflict,
|
||||
.studio-app .studio-editor-conflict { color: #8f2f27; }
|
||||
.studio-app .studio-editor-status--clean { color: #166748; }
|
||||
.studio-app .studio-document-status-rail dl { display: grid; gap: 12px; margin: 0 0 20px; }
|
||||
.studio-app .studio-document-status-rail dl div { display: flex; justify-content: space-between; gap: 16px; }
|
||||
.studio-app .studio-document-status-rail dt { color: var(--muted); font-size: 12px; }
|
||||
.studio-app .studio-document-status-rail dd { margin: 0; font-size: 13px; }
|
||||
.studio-app .studio-document-status-rail button { width: 100%; border-color: var(--signal); background: var(--signal); color: #fff; }
|
||||
.studio-app .studio-document-status-rail button:disabled { border-color: var(--line-strong); background: var(--paper); color: var(--muted); }
|
||||
.studio-app .studio-document-status-rail > p:last-child { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
|
||||
|
||||
.studio-app .studio-instant-preview { min-width: 0; overflow: clip; border: 1px solid var(--line); }
|
||||
.studio-app .studio-instant-preview .public-record-embedded { width: 100%; max-width: none; margin: 0; padding: clamp(24px, 5vw, 56px); }
|
||||
.studio-app .studio-preview-error { padding: 48px 0; border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-preview-error ul { margin: 20px 0 0; padding-left: 20px; color: #8f2f27; line-height: 1.7; overflow-wrap: anywhere; }
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.studio-app .studio-editor-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
|
||||
.studio-app .studio-document-status-rail { position: static; }
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.studio-app .studio-editor-heading { padding-bottom: 28px; }
|
||||
.studio-app .studio-editor-tabs { gap: 18px; }
|
||||
.studio-app .studio-editor-tabs button { flex: 1; min-width: 0; }
|
||||
.studio-app .studio-editor-layout { padding-top: 28px; }
|
||||
.studio-app .studio-field-grid,
|
||||
.studio-app .studio-resolution-fields { grid-template-columns: minmax(0, 1fr); }
|
||||
.studio-app .studio-field--wide,
|
||||
.studio-app .studio-resolution-fields legend { grid-column: auto; }
|
||||
.studio-app .studio-item-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
|
||||
.studio-app .studio-instant-preview .public-record-embedded { padding: 22px 16px; }
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
.studio-app { min-height: 100vh; color: var(--ink); }
|
||||
.studio-app .studio-skip-link { position: fixed; z-index: 100; top: 12px; left: 16px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); transform: translateY(-160%); }
|
||||
.studio-app .studio-skip-link:focus { transform: translateY(0); }
|
||||
.studio-app .studio-header { border-bottom: 1px solid var(--line); background: rgba(252, 252, 251, 0.94); }
|
||||
.studio-app .studio-header-inner,
|
||||
.studio-app .studio-mobile-navigation,
|
||||
.studio-app .studio-main { width: min(1180px, calc(100% - 80px)); margin-inline: auto; }
|
||||
.studio-app .studio-header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 40px; }
|
||||
.studio-app .studio-wordmark { display: inline-flex; min-height: 44px; align-items: center; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
|
||||
.studio-app .studio-wordmark span { margin-left: 5px; color: var(--signal); font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
|
||||
.studio-app .studio-desktop-navigation nav,
|
||||
.studio-app .studio-mobile-navigation nav { display: flex; align-items: center; gap: 26px; }
|
||||
.studio-app .studio-desktop-navigation a,
|
||||
.studio-app .studio-mobile-navigation a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: 14px; }
|
||||
.studio-app nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
|
||||
.studio-app .studio-menu-trigger { display: none; min-height: 44px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); }
|
||||
.studio-app .studio-mobile-navigation { padding-bottom: 16px; }
|
||||
.studio-app .studio-main { padding-block: 72px 120px; }
|
||||
.studio-app .studio-page-heading { max-width: 760px; padding-bottom: 52px; }
|
||||
.studio-app .studio-page-heading h1,
|
||||
.studio-app .studio-route-state h1 { margin: 0 0 18px; font-size: clamp(36px, 6vw, 64px); line-height: 1.08; letter-spacing: -0.045em; }
|
||||
.studio-app .studio-eyebrow { margin: 0 0 14px; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: 0.08em; }
|
||||
.studio-app .studio-overview-list { border-top: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-overview-list section { display: grid; grid-template-columns: 130px minmax(180px, 0.8fr) minmax(260px, 1.4fr) auto; align-items: baseline; gap: 24px; padding-block: 28px; border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-overview-list h2,
|
||||
.studio-app .studio-overview-list p { margin: 0; }
|
||||
.studio-app .studio-overview-list a,
|
||||
.studio-app .studio-route-state > a { color: var(--signal); font-weight: 650; }
|
||||
.studio-app .studio-route-state { max-width: 720px; padding-block: 48px; }
|
||||
.studio-app .studio-route-state button { min-height: 44px; margin-top: 18px; padding-inline: 16px; border: 1px solid var(--signal); border-radius: 5px; background: var(--signal); color: #fff; }
|
||||
.studio-app .studio-loading { min-height: 180px; }
|
||||
.studio-app .studio-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
||||
.studio-app .studio-unsaved-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); }
|
||||
.studio-app .studio-unsaved-dialog::backdrop { background: rgba(23, 24, 27, 0.48); }
|
||||
.studio-app .studio-dialog-body { padding: 30px; }
|
||||
.studio-app .studio-dialog-body h2 { margin: 0 0 12px; font-size: 26px; }
|
||||
.studio-app .studio-dialog-error { color: #8f2f27; }
|
||||
.studio-app .studio-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 28px; }
|
||||
.studio-app .studio-dialog-actions button { min-height: 44px; padding-inline: 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); }
|
||||
.studio-app .studio-dialog-actions button:last-child { border-color: var(--signal); background: var(--signal); color: #fff; }
|
||||
|
||||
.studio-app .studio-page-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-page-top .studio-page-heading { padding-bottom: 42px; }
|
||||
.studio-app .studio-primary-action,
|
||||
.studio-app .studio-primary-button,
|
||||
.studio-app .studio-secondary-button,
|
||||
.studio-app .studio-document-tools button,
|
||||
.studio-app .studio-empty-state a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding-inline: 16px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font-weight: 650; }
|
||||
.studio-app .studio-primary-action,
|
||||
.studio-app .studio-primary-button { margin-bottom: 42px; border-color: var(--signal); background: var(--signal); color: #fff; }
|
||||
.studio-app .studio-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; border-block: 1px solid var(--line); }
|
||||
.studio-app .studio-summary-grid div { display: grid; gap: 9px; padding: 22px; border-right: 1px solid var(--line); }
|
||||
.studio-app .studio-summary-grid div:last-child { border-right: 0; }
|
||||
.studio-app .studio-summary-grid span { color: var(--muted); font-size: 12px; }
|
||||
.studio-app .studio-summary-grid strong { font-size: 24px; letter-spacing: -0.03em; }
|
||||
.studio-app .studio-work-section { padding-top: 54px; }
|
||||
.studio-app .studio-section-title { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-section-title h2 { margin: 0; font-size: 24px; }
|
||||
.studio-app .studio-section-title a { display: inline-flex; min-height: 44px; align-items: center; color: var(--signal); font-size: 13px; font-weight: 650; }
|
||||
.studio-app .studio-work-list,
|
||||
.studio-app .studio-document-list { border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-work-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 130px; gap: 24px; align-items: start; padding-block: 24px; border-top: 1px solid var(--line); }
|
||||
.studio-app .studio-work-list > :first-child { border-top: 0; }
|
||||
.studio-app .studio-row-label { margin: 3px 0 0; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
|
||||
.studio-app .studio-work-row h3 { margin: 0; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
|
||||
.studio-app .studio-work-row h3 a { display: inline-flex; min-height: 44px; align-items: flex-start; }
|
||||
.studio-app .studio-work-row div p,
|
||||
.studio-app .studio-work-row time { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
|
||||
.studio-app .studio-empty-inline { margin: 0; padding-block: 26px; color: var(--muted); }
|
||||
.studio-app .studio-screen-error { margin-top: 26px; padding: 16px; border-left: 3px solid #a13b31; background: #fff7f4; color: #75271f; }
|
||||
|
||||
.studio-app .studio-document-tools { display: grid; grid-template-columns: minmax(280px, 1fr) 180px 180px; gap: 16px; padding-block: 28px; border-bottom: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-document-tools form,
|
||||
.studio-app .studio-document-tools label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
|
||||
.studio-app .studio-document-tools form div { display: flex; gap: 8px; }
|
||||
.studio-app .studio-document-tools input,
|
||||
.studio-app .studio-document-tools select { width: 100%; min-width: 0; min-height: 44px; padding-inline: 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); }
|
||||
.studio-app .studio-document-tools input { flex: 1; }
|
||||
.studio-app .studio-result-count { margin: 24px 0 10px; color: var(--muted); font-size: 13px; }
|
||||
.studio-app .studio-document-row { display: grid; grid-template-columns: 105px minmax(240px, 1fr) minmax(360px, 0.9fr); gap: 24px; align-items: start; padding-block: 26px; border-top: 1px solid var(--line); }
|
||||
.studio-app .studio-document-list > :first-child { border-top: 0; }
|
||||
.studio-app .studio-document-title h2 { margin: 0; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
|
||||
.studio-app .studio-document-title h2 a { display: inline-flex; min-height: 44px; align-items: flex-start; }
|
||||
.studio-app .studio-document-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
|
||||
.studio-app .studio-document-row dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
|
||||
.studio-app .studio-document-row dt { color: var(--muted); font-size: 11px; }
|
||||
.studio-app .studio-document-row dd { margin: 5px 0 0; font-size: 13px; overflow-wrap: anywhere; }
|
||||
.studio-app .studio-secondary-button { margin-top: 24px; }
|
||||
.studio-app .studio-empty-state { padding-block: 56px; border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-empty-state h2 { margin: 0; font-size: 25px; }
|
||||
.studio-app .studio-empty-state p { margin: 12px 0 22px; color: var(--muted); }
|
||||
|
||||
.studio-app .studio-type-list { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line-strong); }
|
||||
.studio-app .studio-type-list legend { padding: 0 0 16px; font-size: 20px; font-weight: 700; }
|
||||
.studio-app .studio-type-list label { display: grid; grid-template-columns: 32px 140px minmax(260px, 1fr) minmax(220px, 0.8fr); gap: 18px; min-height: 88px; align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
|
||||
.studio-app .studio-type-list input { width: 20px; height: 20px; margin: 0; }
|
||||
.studio-app .studio-type-list strong { font-size: 18px; }
|
||||
.studio-app .studio-type-list span,
|
||||
.studio-app .studio-type-list small { color: var(--muted); line-height: 1.6; }
|
||||
.studio-app .studio-create-footer { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
|
||||
.studio-app .studio-create-footer .studio-primary-button { margin: 0; }
|
||||
.studio-app .studio-create-footer p { margin: 0; color: var(--muted); font-size: 13px; }
|
||||
.studio-app .studio-primary-button:disabled { opacity: 0.55; cursor: wait; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.studio-app .studio-overview-list section { grid-template-columns: 110px minmax(0, 1fr); }
|
||||
.studio-app .studio-overview-list section > p:nth-of-type(2),
|
||||
.studio-app .studio-overview-list section > a { grid-column: 2; }
|
||||
.studio-app .studio-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.studio-app .studio-summary-grid div:nth-child(2) { border-right: 0; }
|
||||
.studio-app .studio-summary-grid div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-document-tools { grid-template-columns: minmax(0, 1fr) repeat(2, 160px); }
|
||||
.studio-app .studio-document-row { grid-template-columns: 90px minmax(0, 1fr); }
|
||||
.studio-app .studio-document-row dl { grid-column: 2; }
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.studio-app .studio-header-inner,
|
||||
.studio-app .studio-mobile-navigation,
|
||||
.studio-app .studio-main { width: min(100% - 32px, 1180px); }
|
||||
.studio-app .studio-header-inner { min-height: 68px; gap: 16px; }
|
||||
.studio-app .studio-desktop-navigation { display: none; }
|
||||
.studio-app .studio-menu-trigger { display: inline-flex; align-items: center; }
|
||||
.studio-app .studio-mobile-navigation nav { align-items: stretch; flex-direction: column; gap: 2px; }
|
||||
.studio-app .studio-mobile-navigation a { width: 100%; }
|
||||
.studio-app .studio-main { padding-block: 48px 88px; }
|
||||
.studio-app .studio-overview-list section { display: block; }
|
||||
.studio-app .studio-overview-list h2 { margin-bottom: 8px; }
|
||||
.studio-app .studio-overview-list a { display: inline-flex; min-height: 44px; margin-top: 12px; align-items: center; }
|
||||
.studio-app .studio-dialog-body { padding: 24px 20px; }
|
||||
.studio-app .studio-dialog-actions { align-items: stretch; flex-direction: column; }
|
||||
.studio-app .studio-page-top { align-items: flex-start; flex-direction: column; gap: 0; }
|
||||
.studio-app .studio-page-top .studio-page-heading { padding-bottom: 24px; }
|
||||
.studio-app .studio-primary-action { width: 100%; margin: 0 0 32px; }
|
||||
.studio-app .studio-work-section { padding-top: 42px; }
|
||||
.studio-app .studio-work-row { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; }
|
||||
.studio-app .studio-work-row time { grid-column: 2; }
|
||||
.studio-app .studio-document-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.studio-app .studio-document-tools form { grid-column: 1 / -1; }
|
||||
.studio-app .studio-document-row { grid-template-columns: 74px minmax(0, 1fr); gap: 12px; }
|
||||
.studio-app .studio-document-row dl { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.studio-app .studio-type-list label { grid-template-columns: 30px minmax(0, 1fr); gap: 7px 12px; }
|
||||
.studio-app .studio-type-list span,
|
||||
.studio-app .studio-type-list small { grid-column: 2; }
|
||||
.studio-app .studio-create-footer { align-items: stretch; flex-direction: column; }
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.studio-app .studio-summary-grid { grid-template-columns: minmax(0, 1fr); }
|
||||
.studio-app .studio-summary-grid div { border-right: 0; border-bottom: 1px solid var(--line); }
|
||||
.studio-app .studio-summary-grid div:last-child { border-bottom: 0; }
|
||||
.studio-app .studio-document-tools { grid-template-columns: minmax(0, 1fr); }
|
||||
.studio-app .studio-document-tools form { grid-column: 1; }
|
||||
.studio-app .studio-document-row dl { grid-template-columns: minmax(0, 1fr); }
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
:global(.studio-workflow-screen),
|
||||
:global(.studio-preview-screen) { min-width: 0; }
|
||||
|
||||
:global(.studio-workflow-heading),
|
||||
:global(.studio-preview-toolbar) { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 42px; border-bottom: 1px solid var(--line-strong); }
|
||||
:global(.studio-workflow-heading) h1,
|
||||
:global(.studio-preview-toolbar) h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.06; letter-spacing: -0.045em; }
|
||||
:global(.studio-workflow-heading > div > p:last-child),
|
||||
:global(.studio-preview-toolbar > div > p:last-child) { max-width: 780px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
|
||||
:global(.studio-workflow-quiet-link) { display: inline-flex; min-height: 44px; align-items: center; color: var(--signal); font-weight: 650; white-space: nowrap; }
|
||||
|
||||
:global(.studio-workflow-gate) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; margin-top: 34px; padding: 28px; border: 1px solid var(--line-strong); border-left-width: 4px; }
|
||||
:global(.studio-workflow-gate--ready) { border-left-color: #166748; background: #f3faf6; }
|
||||
:global(.studio-workflow-gate--blocked) { border-left-color: #9a5a1f; background: #fff9f0; }
|
||||
:global(.studio-workflow-gate) h2 { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
|
||||
:global(.studio-workflow-gate) p:last-child { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
|
||||
:global(.studio-workflow-actions) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
:global(.studio-workflow-actions) button,
|
||||
:global(.studio-workflow-actions) a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding-inline: 15px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font-weight: 650; }
|
||||
:global(.studio-workflow-actions) button:first-child { border-color: var(--signal); background: var(--signal); color: #fff; }
|
||||
:global(.studio-workflow-actions) button:disabled { opacity: 0.55; cursor: wait; }
|
||||
:global(.studio-workflow-feedback) { margin: 18px 0 0; padding: 14px 16px; border-left: 3px solid var(--signal); background: #f5f7ff; }
|
||||
:global(.studio-workflow-loading) { min-height: 240px; padding-block: 56px; color: var(--muted); }
|
||||
|
||||
:global(.studio-workflow-report) { margin-top: 54px; border-top: 1px solid var(--line-strong); }
|
||||
:global(.studio-workflow-section-heading) { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; border-bottom: 1px solid var(--line); }
|
||||
:global(.studio-workflow-section-heading) h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
|
||||
:global(.studio-workflow-status) { display: inline-flex; min-height: 32px; align-items: center; padding-inline: 11px; border: 1px solid currentColor; border-radius: 999px; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; }
|
||||
:global(.studio-workflow-status--invalid) { color: #8f2f27; }
|
||||
:global(.studio-workflow-status--warnings) { color: #8b5a14; }
|
||||
:global(.studio-workflow-status--valid) { color: #166748; }
|
||||
:global(.studio-workflow-metadata),
|
||||
:global(.studio-preview-metadata) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); }
|
||||
:global(.studio-workflow-metadata) div,
|
||||
:global(.studio-preview-metadata) div { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
|
||||
:global(.studio-workflow-metadata) div:last-child,
|
||||
:global(.studio-preview-metadata) div:last-child { border-right: 0; }
|
||||
:global(.studio-workflow-metadata) dt,
|
||||
:global(.studio-preview-metadata) dt { color: var(--muted); font-size: 11px; }
|
||||
:global(.studio-workflow-metadata) dd,
|
||||
:global(.studio-preview-metadata) dd { margin: 7px 0 0; font-size: 13px; overflow-wrap: anywhere; }
|
||||
:global(.studio-workflow-issue-list) { margin: 0; padding: 0; list-style: none; }
|
||||
:global(.studio-workflow-issue-list) li { min-width: 0; border-bottom: 1px solid var(--line); }
|
||||
:global(.studio-workflow-issue-list) a { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; min-width: 0; gap: 18px; align-items: start; padding-block: 22px; color: inherit; }
|
||||
:global(.studio-workflow-issue-severity) { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
|
||||
:global(.studio-workflow-issue-body) { display: grid; min-width: 0; gap: 7px; }
|
||||
:global(.studio-workflow-issue-body) strong,
|
||||
:global(.studio-workflow-issue-body) small { overflow-wrap: anywhere; }
|
||||
:global(.studio-workflow-issue-body) small { color: var(--muted); font-family: "IBM Plex Mono", monospace; }
|
||||
:global(.studio-workflow-empty-issues),
|
||||
:global(.studio-workflow-empty-panel) { margin: 0; padding-block: 42px; border-bottom: 1px solid var(--line); color: var(--muted); }
|
||||
:global(.studio-workflow-empty-panel) h2 { margin: 0; color: var(--ink); font-size: 25px; }
|
||||
:global(.studio-workflow-empty-panel) p { margin: 10px 0 0; }
|
||||
|
||||
:global(.studio-preview-toolbar--compact) { padding-bottom: 28px; }
|
||||
:global(.studio-preview-title) { margin: 0; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
|
||||
:global(.studio-preview-state) { display: flex; justify-content: space-between; gap: 28px; align-items: center; margin-top: 24px; padding: 20px; border: 1px solid var(--line-strong); border-left-width: 4px; }
|
||||
:global(.studio-preview-state) strong { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
|
||||
:global(.studio-preview-state) p { margin: 5px 0 0; color: var(--muted); }
|
||||
:global(.studio-preview-state--current) { border-left-color: #166748; background: #f3faf6; }
|
||||
:global(.studio-preview-state--none),
|
||||
:global(.studio-preview-state--stale) { border-left-color: #9a5a1f; background: #fff9f0; }
|
||||
:global(.studio-preview-state--expired) { border-left-color: #8f2f27; background: #fff7f4; }
|
||||
:global(.studio-preview-metadata) { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); }
|
||||
:global(.studio-preview-public-frame) { min-width: 0; margin-top: 38px; overflow: clip; border: 1px solid var(--line); background: var(--paper); }
|
||||
:global(.studio-preview-public-frame .public-record-embedded) { width: 100%; max-width: none; margin: 0; padding: clamp(24px, 5vw, 56px); }
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
:global(.studio-workflow-gate) { grid-template-columns: minmax(0, 1fr); }
|
||||
:global(.studio-preview-state) { align-items: flex-start; flex-direction: column; }
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
:global(.studio-workflow-heading),
|
||||
:global(.studio-preview-toolbar) { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 28px; }
|
||||
:global(.studio-workflow-quiet-link) { white-space: normal; }
|
||||
:global(.studio-workflow-gate) { margin-top: 24px; padding: 22px 18px; }
|
||||
:global(.studio-workflow-actions) { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); }
|
||||
:global(.studio-workflow-metadata),
|
||||
:global(.studio-preview-metadata) { grid-template-columns: minmax(0, 1fr); }
|
||||
:global(.studio-workflow-metadata) div,
|
||||
:global(.studio-preview-metadata) div { border-right: 0; border-bottom: 1px solid var(--line); }
|
||||
:global(.studio-workflow-metadata) div:last-child,
|
||||
:global(.studio-preview-metadata) div:last-child { border-bottom: 0; }
|
||||
:global(.studio-workflow-issue-list) a { grid-template-columns: minmax(0, 1fr); gap: 8px; }
|
||||
:global(.studio-workflow-issue-list) a > span:last-child { display: none; }
|
||||
:global(.studio-preview-public-frame .public-record-embedded) { padding: 22px 16px; }
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createMemoryRouter, RouterProvider } from "react-router-dom";
|
||||
|
||||
import { createTechLogFeatureInstalledInput } from "../../../src/features/tech-log/adapters/create-tech-log-feature-input.ts";
|
||||
import { FatalErrorState } from "../../../src/features/tech-log/presentation/public/components/fatal-error-state.tsx";
|
||||
import { PublicShell } from "../../../src/features/tech-log/presentation/public/public-shell.tsx";
|
||||
import { ApplicationProvider } from "../../../src/presentation/providers/application-provider.tsx";
|
||||
import { createTestApplication } from "../../helpers/create-test-application.ts";
|
||||
|
||||
const originalShowModal = HTMLDialogElement.prototype.showModal;
|
||||
const originalClose = HTMLDialogElement.prototype.close;
|
||||
|
||||
beforeEach(() => {
|
||||
Object.defineProperty(HTMLDialogElement.prototype, "showModal", {
|
||||
configurable: true,
|
||||
value(this: HTMLDialogElement) {
|
||||
this.setAttribute("open", "");
|
||||
},
|
||||
});
|
||||
Object.defineProperty(HTMLDialogElement.prototype, "close", {
|
||||
configurable: true,
|
||||
value(this: HTMLDialogElement) {
|
||||
this.removeAttribute("open");
|
||||
this.dispatchEvent(new Event("close"));
|
||||
},
|
||||
});
|
||||
vi.stubGlobal("requestAnimationFrame", (callback: FrameRequestCallback) => {
|
||||
callback(0);
|
||||
return 1;
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
Object.defineProperty(HTMLDialogElement.prototype, "showModal", {
|
||||
configurable: true,
|
||||
value: originalShowModal,
|
||||
});
|
||||
Object.defineProperty(HTMLDialogElement.prototype, "close", {
|
||||
configurable: true,
|
||||
value: originalClose,
|
||||
});
|
||||
});
|
||||
|
||||
function renderShell(initialEntry = "/projects") {
|
||||
const techLog = createTechLogFeatureInstalledInput().input;
|
||||
const router = createMemoryRouter(
|
||||
[
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<PublicShell>
|
||||
<main id="main-content" className="shell">
|
||||
공개 본문
|
||||
</main>
|
||||
</PublicShell>
|
||||
),
|
||||
},
|
||||
],
|
||||
{ initialEntries: [initialEntry] },
|
||||
);
|
||||
const view = render(
|
||||
<ApplicationProvider
|
||||
application={createTestApplication({
|
||||
featureInputs: { "tech-log": techLog },
|
||||
})}
|
||||
>
|
||||
<RouterProvider router={router} />
|
||||
</ApplicationProvider>,
|
||||
);
|
||||
return { ...view, router };
|
||||
}
|
||||
|
||||
describe("TechLog Public shell", () => {
|
||||
it("preserves source landmark order, navigation copy, current state, and footer", () => {
|
||||
const view = renderShell();
|
||||
const frame = view.container.querySelector(".site-frame");
|
||||
|
||||
expect(
|
||||
Array.from(frame?.children ?? [], (child) => child.tagName),
|
||||
).toEqual(["A", "HEADER", "MAIN", "FOOTER"]);
|
||||
expect(screen.getByRole("link", { name: "본문으로 건너뛰기" })).toHaveAttribute(
|
||||
"href",
|
||||
"#main-content",
|
||||
);
|
||||
expect(screen.getByRole("banner")).toHaveClass("site-header");
|
||||
expect(screen.getByRole("main")).toHaveAttribute("id", "main-content");
|
||||
expect(screen.getByRole("contentinfo")).toHaveClass("site-footer");
|
||||
expect(screen.getByRole("navigation", { name: "주요 탐색" })).toBeVisible();
|
||||
expect(
|
||||
screen.getByRole("navigation", { name: "모바일 주요 탐색" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
Array.from(
|
||||
view.container.querySelectorAll<HTMLAnchorElement>(".desktop-nav a"),
|
||||
(link) => link.textContent,
|
||||
),
|
||||
).toEqual(["탐색", "프로젝트", "변경 기록", "프로필"]);
|
||||
expect(
|
||||
Array.from(
|
||||
view.container.querySelectorAll<HTMLAnchorElement>(
|
||||
".mobile-nav nav a",
|
||||
),
|
||||
(link) => link.textContent,
|
||||
),
|
||||
).toEqual(["탐색", "프로젝트", "변경 기록", "프로필"]);
|
||||
for (const link of screen.getAllByRole("link", { name: "프로젝트" })) {
|
||||
expect(link).toHaveAttribute("aria-current", "page");
|
||||
}
|
||||
expect(screen.getByText("동현")).toHaveClass("footer-name");
|
||||
expect(
|
||||
screen.getByText("문제를 재현하고 검증해 운영 가능한 설계로 연결합니다."),
|
||||
).toBeVisible();
|
||||
expect(view.container.querySelector(".app-shell")).toBeNull();
|
||||
});
|
||||
|
||||
it("uses the canonical root route for brand navigation", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { router } = renderShell("/projects/backend-skeleton");
|
||||
|
||||
await user.click(screen.getByRole("link", { name: "TechLog 홈" }));
|
||||
|
||||
expect(router.state.location.pathname).toBe("/");
|
||||
});
|
||||
|
||||
it("opens search by click, closes on Escape, and restores trigger focus", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderShell();
|
||||
const trigger = screen.getByRole("button", { name: "TechLog 검색 열기" });
|
||||
|
||||
await user.click(trigger);
|
||||
|
||||
const dialog = screen.getByRole("dialog", { name: "TechLog 검색" });
|
||||
const input = within(dialog).getByRole("searchbox", { name: "검색어" });
|
||||
expect(dialog).toHaveAttribute("open");
|
||||
expect(dialog).toHaveAttribute("aria-labelledby", `${dialog.id}-title`);
|
||||
expect(input).toHaveFocus();
|
||||
|
||||
await user.keyboard("{Escape}");
|
||||
|
||||
expect(dialog).not.toHaveAttribute("open");
|
||||
expect(trigger).toHaveFocus();
|
||||
});
|
||||
|
||||
it("opens the native search trigger from the keyboard", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderShell();
|
||||
const trigger = screen.getByRole("button", { name: "TechLog 검색 열기" });
|
||||
trigger.focus();
|
||||
|
||||
await user.keyboard("{Enter}");
|
||||
|
||||
expect(screen.getByRole("dialog", { name: "TechLog 검색" })).toHaveAttribute(
|
||||
"open",
|
||||
);
|
||||
expect(screen.getByRole("searchbox", { name: "검색어" })).toHaveFocus();
|
||||
});
|
||||
|
||||
it("returns source-equivalent results and navigates to their canonical route", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { router } = renderShell();
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "TechLog 검색 열기" }),
|
||||
);
|
||||
const input = screen.getByRole("searchbox", { name: "검색어" });
|
||||
|
||||
await user.type(input, "Keycloak");
|
||||
|
||||
expect(screen.getByText("1개의 공개 기록")).toBeVisible();
|
||||
const result = screen.getByRole("link", { name: /Auth Lab/ });
|
||||
expect(result).toHaveAttribute("href", "/projects/auth-lab");
|
||||
expect(
|
||||
screen.getByRole("link", { name: /전체 검색 결과 보기/ }),
|
||||
).toHaveAttribute("href", "/search?q=Keycloak");
|
||||
|
||||
await user.click(result);
|
||||
|
||||
expect(router.state.location.pathname).toBe("/projects/auth-lab");
|
||||
});
|
||||
|
||||
it("closes mobile navigation on Escape and before opening the one search dialog", async () => {
|
||||
const user = userEvent.setup();
|
||||
const view = renderShell();
|
||||
const details = view.container.querySelector<HTMLDetailsElement>(
|
||||
"details.mobile-nav",
|
||||
);
|
||||
const summary = details?.querySelector<HTMLElement>("summary");
|
||||
expect(details).not.toBeNull();
|
||||
expect(summary).not.toBeNull();
|
||||
|
||||
details!.open = true;
|
||||
fireEvent.keyDown(details!, { key: "Escape" });
|
||||
expect(details).not.toHaveAttribute("open");
|
||||
expect(summary).toHaveFocus();
|
||||
|
||||
details!.open = true;
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "TechLog 검색 열기" }),
|
||||
);
|
||||
expect(details).not.toHaveAttribute("open");
|
||||
expect(screen.getAllByRole("dialog", { hidden: true })).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("TechLog fatal Public state", () => {
|
||||
it("preserves error copy, trace relationship, and retry variants", async () => {
|
||||
const user = userEvent.setup();
|
||||
const retry = vi.fn();
|
||||
const view = render(
|
||||
<FatalErrorState traceId="PUBLIC-500" onRetry={retry} />,
|
||||
);
|
||||
|
||||
expect(screen.getByRole("main")).toHaveClass("shell", "fatal-state");
|
||||
expect(
|
||||
screen.getByRole("heading", { name: "페이지를 불러오지 못했습니다." }),
|
||||
).toBeVisible();
|
||||
expect(view.container.querySelector(".trace-id code")).toHaveTextContent(
|
||||
"PUBLIC-500",
|
||||
);
|
||||
await user.click(screen.getByRole("button", { name: "다시 시도" }));
|
||||
expect(retry).toHaveBeenCalledOnce();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,142 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { render } from "@testing-library/react";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { createElement } from "react";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
||||
|
||||
import { createTechLogFeatureInstalledInput } from "../../../src/features/tech-log/adapters/create-tech-log-feature-input.ts";
|
||||
import { FatalErrorState } from "../../../src/features/tech-log/presentation/public/components/fatal-error-state.tsx";
|
||||
import { PublicShell } from "../../../src/features/tech-log/presentation/public/public-shell.tsx";
|
||||
import { ApplicationProvider } from "../../../src/presentation/providers/application-provider.tsx";
|
||||
import { createTestApplication } from "../../helpers/create-test-application.ts";
|
||||
|
||||
let styleElement: HTMLStyleElement;
|
||||
|
||||
beforeAll(() => {
|
||||
styleElement = document.createElement("style");
|
||||
styleElement.textContent = readFileSync(
|
||||
resolve(
|
||||
process.cwd(),
|
||||
"src/features/tech-log/presentation/styles/globals.css",
|
||||
),
|
||||
"utf8",
|
||||
);
|
||||
document.head.append(styleElement);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
styleElement.remove();
|
||||
});
|
||||
|
||||
function renderPublicSurface(node: React.ReactNode) {
|
||||
const techLog = createTechLogFeatureInstalledInput().input;
|
||||
const shell = createElement(PublicShell, { children: node });
|
||||
const router = createElement(
|
||||
MemoryRouter,
|
||||
{ initialEntries: ["/projects"] },
|
||||
shell,
|
||||
);
|
||||
return render(
|
||||
createElement(ApplicationProvider, {
|
||||
application: createTestApplication({
|
||||
featureInputs: { "tech-log": techLog },
|
||||
}),
|
||||
children: router,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
describe("TechLog consumer-visible style contract", () => {
|
||||
it("applies the source typography, palette, shell width, and header spacing", () => {
|
||||
const view = renderPublicSurface(
|
||||
createElement(
|
||||
"main",
|
||||
{ id: "main-content", className: "shell" },
|
||||
"공개 본문",
|
||||
),
|
||||
);
|
||||
|
||||
const rootStyle = getComputedStyle(document.documentElement);
|
||||
const bodyStyle = getComputedStyle(document.body);
|
||||
const headerInner = view.container.querySelector<HTMLElement>(
|
||||
".header-inner",
|
||||
);
|
||||
const wordmark = view.getByRole("link", { name: "TechLog 홈" });
|
||||
|
||||
expect(rootStyle.getPropertyValue("--canvas")).toBe("#f7f7f5");
|
||||
expect(rootStyle.getPropertyValue("--ink")).toBe("#17181b");
|
||||
expect(rootStyle.getPropertyValue("--signal")).toBe("#3e5cc7");
|
||||
expect(rootStyle.getPropertyValue("--shell")).toBe("1180px");
|
||||
expect(rootStyle.getPropertyValue("--body-copy")).toBe("42rem");
|
||||
expect(bodyStyle.fontFamily).toContain("Pretendard Variable");
|
||||
expect(bodyStyle.fontSize).toBe("16px");
|
||||
expect(bodyStyle.fontWeight).toBe("400");
|
||||
expect(bodyStyle.lineHeight).toBe("1.6");
|
||||
expect(bodyStyle.minWidth).toBe("320px");
|
||||
expect(headerInner).not.toBeNull();
|
||||
expect(getComputedStyle(headerInner!).display).toBe("grid");
|
||||
expect(getComputedStyle(headerInner!).minHeight).toBe("76px");
|
||||
expect(getComputedStyle(headerInner!).gap).toBe("48px");
|
||||
expect(getComputedStyle(wordmark).fontSize).toBe("17px");
|
||||
expect(getComputedStyle(wordmark).fontWeight).toBe("680");
|
||||
});
|
||||
|
||||
it("keeps every header and dialog control at the source minimum target size", () => {
|
||||
const view = renderPublicSurface(
|
||||
createElement(
|
||||
"main",
|
||||
{ id: "main-content", className: "shell" },
|
||||
"공개 본문",
|
||||
),
|
||||
);
|
||||
|
||||
const wordmark = view.getByRole("link", { name: "TechLog 홈" });
|
||||
const navLink = view.container.querySelector<HTMLElement>(".nav-link");
|
||||
const searchButton = view.getByRole("button", {
|
||||
name: "TechLog 검색 열기",
|
||||
});
|
||||
const closeButton = view.container.querySelector<HTMLElement>(
|
||||
".dialog-close",
|
||||
);
|
||||
const searchField = view.container.querySelector<HTMLElement>(
|
||||
".search-field",
|
||||
);
|
||||
const dialogInner = view.container.querySelector<HTMLElement>(
|
||||
".search-dialog-inner",
|
||||
);
|
||||
|
||||
expect(getComputedStyle(wordmark).minHeight).toBe("44px");
|
||||
expect(getComputedStyle(navLink!).minHeight).toBe("44px");
|
||||
expect(getComputedStyle(searchButton).minHeight).toBe("44px");
|
||||
expect(getComputedStyle(closeButton!).minWidth).toBe("52px");
|
||||
expect(getComputedStyle(closeButton!).minHeight).toBe("44px");
|
||||
expect(getComputedStyle(searchField!).minHeight).toBe("56px");
|
||||
expect(getComputedStyle(searchField!).marginTop).toBe("24px");
|
||||
expect(getComputedStyle(searchField!).backgroundColor).toBe(
|
||||
"rgb(255, 255, 255)",
|
||||
);
|
||||
expect(getComputedStyle(dialogInner!).padding).toBe("27px 28px 22px");
|
||||
});
|
||||
|
||||
it("preserves footer spacing and fatal-action sizing", () => {
|
||||
const view = renderPublicSurface(
|
||||
createElement(FatalErrorState, {
|
||||
traceId: "PUBLIC-500",
|
||||
retryHref: "/",
|
||||
}),
|
||||
);
|
||||
|
||||
const footerInner = view.container.querySelector<HTMLElement>(
|
||||
".footer-inner",
|
||||
);
|
||||
const retry = view.getByRole("link", { name: "다시 시도" });
|
||||
|
||||
expect(getComputedStyle(footerInner!).minHeight).toBe("172px");
|
||||
expect(getComputedStyle(footerInner!).gap).toBe("40px");
|
||||
expect(getComputedStyle(retry).minHeight).toBe("44px");
|
||||
expect(getComputedStyle(retry).marginTop).toBe("34px");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user