'use client'; import { Layout, Section, Article, Headline, Subhead, Kicker, BodyText, Quote, Byline, Dateline, Caption, } from 'newspaperui-components'; import { visualWeights, resolveFontSize } from 'newspaperui-theme'; import { Demo } from '@/components/Demo'; const longText = `Whitehall officials confirmed late Tuesday that the long-anticipated review of national infrastructure funding will be tabled before the recess. The 248-page document, drafted across three departments, recommends a recalibration of regional priorities and a measured shift toward rail electrification. Critics inside the cabinet caution that the timing risks overshadowing the chancellor's autumn statement, while supporters describe the proposals as the most coherent strategic blueprint in a generation.`; const longText2 = `Markets responded cautiously through the morning session. The pound traded sideways against the dollar, gilts firmed by three basis points, and the FTSE 100 closed marginally lower as defensive sectors absorbed the day's modest outflows. Analysts at three of the City's largest houses framed the move as a holding pattern, awaiting further detail on the spending envelope rather than a verdict on its substance.`; const longText3 = `In Manchester, regional officials greeted the announcement with measured optimism. "We have lobbied for this kind of clarity for the better part of a decade," said one senior figure who requested anonymity to discuss internal deliberations. The mayor's office is expected to issue a formal response by week's end, focusing on commitments to the trans-Pennine corridor and the long-deferred upgrade of suburban tram capacity.`; const longText4 = `Beyond the immediate fiscal arithmetic, the review's most consequential proposal may be its quietest: a standing technical commission, modeled on Australia's Infrastructure Australia, to depoliticize project sequencing. Whether that body acquires teeth — or settles into the advisory torpor that has consumed earlier attempts — will be determined by the legislation expected in the spring.`; interface WeightRow { component: string; weight: string; fontFamily: string; fontSize: string; fontWeight: number; lineHeight: number; color: string; } function buildWeightRows(): WeightRow[] { const rows: WeightRow[] = []; for (const [comp, weights] of Object.entries(visualWeights)) { for (const [w, cfg] of Object.entries(weights)) { if (!cfg) continue; rows.push({ component: comp, weight: w, fontFamily: cfg.fontFamily, fontSize: resolveFontSize(cfg.fontSize), fontWeight: cfg.fontWeight, lineHeight: cfg.lineHeight, color: cfg.color, }); } } return rows; } export default function TextPage() { const weightRows = buildWeightRows(); return (
文本组件 从 Headline 到 Caption 的完整文本谱系。每个组件按视觉权重映射到字体、字号、字重、 行高与颜色 token,避免硬编码样式。 Headline 三档
weight="High" A Quiet Revolution in the Treasury Forecast
weight="Medium" Whitehall Confirms Infrastructure Review
weight="Low" Briefing: regional rail commitments
Subhead 两档
A measured recalibration of regional priorities is expected to define the chancellor’s autumn agenda. Officials emphasized that the headline figures should be read as a planning envelope rather than a binding allocation.
Kicker
POLITICS · WHITEHALL A Standing Technical Commission, Quietly Proposed
BodyText 多栏文字流

{longText}

{longText2}

...

...

`} >

{longText}

{longText2}

{longText3}

{longText4}

{longText}

{longText2}

{longText3}

Quote 引用
We have lobbied for this kind of clarity for the better part of a decade.

按一位资深内阁人士的说法,这份评估 是一个时代以来最连贯的战略蓝图 ,但能否落地仍取决于春季立法。

Byline / Dateline / Caption
BY ALICE SMITH LONDON —
A view of the Treasury terrace at dusk; the new commission will report here from May.
视觉权重映射表

下表从 visualWeights 数据动态生成,反映组件实际渲染时所用的 token。修改 theme 后表格自动同步。

{weightRows.map((row, idx) => ( ))}
组件 权重 字体 字号 字重 行高 颜色
{row.component} {row.weight} {row.fontFamily} {row.fontSize} {row.fontWeight} {row.lineHeight} {row.color}
); }