This commit is contained in:
sunzhongyi
2026-05-19 21:09:56 +08:00
commit f3e6b95be9
78 changed files with 10099 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import React from 'react';
import { visualWeights, resolveFontSize } from '@newspaperui/theme';
export interface CaptionProps {
children: React.ReactNode;
}
export const Caption: React.FC<CaptionProps> = ({ children }) => {
const config = visualWeights.Caption.Standard;
if (!config) {
throw new Error('Caption configuration not found');
}
return (
<figcaption
className="newspaper-caption"
style={{
fontSize: resolveFontSize(config.fontSize),
fontWeight: config.fontWeight,
lineHeight: config.lineHeight,
color: config.color,
margin: config.margin,
}}
>
{children}
</figcaption>
);
};