chore: initial deploy for code base
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import * as React from "react";
|
||||
import { Typography } from "antd";
|
||||
|
||||
export interface IHeadingProps {
|
||||
/** Display ellipsis when text overflows. Configure rows and expandability using an object */
|
||||
ellipsis?: boolean | { rows?: number, expandable?: boolean };
|
||||
|
||||
/** H1: 24px, H2: 20px, H3: 18px, H4: 16px. Default is 1 (H1) */
|
||||
level?: 1 | 2 | 3 | 4;
|
||||
|
||||
/** Margin bottom in pixels. Default is 0 */
|
||||
marginBottom?: 0 | 4 | 8 | 16;
|
||||
|
||||
/** Use strong weight. Default is true */
|
||||
strong?: boolean;
|
||||
|
||||
/** Text color. Default is "black" */
|
||||
color?: "black" | "secondary" | "white";
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
*/
|
||||
const Heading: React.FC<IHeadingProps> = (props) => {
|
||||
const { marginBottom = 0, style = {}, color = "black", strong = true, level = 1, ...validProps } = (props as any);
|
||||
let className = 'tempo-typography';
|
||||
|
||||
// margin
|
||||
style.marginBottom = props.marginBottom;
|
||||
style.marginTop = 0;
|
||||
|
||||
// color
|
||||
if (color !== "black") {
|
||||
className = `${className} tempo-typography--${color}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Typography.Title {...validProps} className={className} style={style} strong={strong} level={level}>{props.children}</Typography.Title>
|
||||
);
|
||||
}
|
||||
|
||||
export default Heading;
|
||||
@@ -0,0 +1,4 @@
|
||||
import Heading, { IHeadingProps } from "./Heading";
|
||||
|
||||
export default Heading;
|
||||
export { IHeadingProps };
|
||||
Reference in New Issue
Block a user