2022-03-21 23:14:00 +00:00
|
|
|
/**
|
|
|
|
* @deprecated create new a new set of components, waiting for designs
|
|
|
|
*/
|
2021-07-15 14:10:26 +00:00
|
|
|
import React from "react";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2021-07-15 14:10:26 +00:00
|
|
|
import Body from "./Body";
|
|
|
|
import Caption from "./Caption";
|
|
|
|
import Caption2 from "./Caption2";
|
|
|
|
import Footnote from "./Footnote";
|
|
|
|
import Headline from "./Headline";
|
|
|
|
import Largetitle from "./Largetitle";
|
|
|
|
import Overline from "./Overline";
|
|
|
|
import Subheadline from "./Subheadline";
|
|
|
|
import Subtitle from "./Subtitle";
|
|
|
|
import Title from "./Title";
|
|
|
|
import Title2 from "./Title2";
|
|
|
|
import Title3 from "./Title3";
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
variant?:
|
|
|
|
| "overline"
|
|
|
|
| "caption"
|
|
|
|
| "body"
|
|
|
|
| "caption2"
|
|
|
|
| "footnote"
|
|
|
|
| "headline"
|
|
|
|
| "largetitle"
|
|
|
|
| "subheadline"
|
|
|
|
| "subtitle"
|
|
|
|
| "title"
|
|
|
|
| "title2"
|
|
|
|
| "title3";
|
|
|
|
children: any;
|
|
|
|
text?: string;
|
|
|
|
tx?: string;
|
|
|
|
className?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TextProps = {
|
|
|
|
children: any;
|
|
|
|
text?: string;
|
|
|
|
tx?: string;
|
|
|
|
className?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* static let largeTitle: Font
|
|
|
|
* A font with the large title text style.
|
|
|
|
*
|
|
|
|
* static let title: Font
|
|
|
|
* A font with the title text style.
|
|
|
|
*
|
|
|
|
* static let title2: Font
|
|
|
|
* Create a font for second level hierarchical headings.
|
|
|
|
*
|
|
|
|
* static let title3: Font
|
|
|
|
* Create a font for third level hierarchical headings.
|
|
|
|
*
|
|
|
|
* static let headline: Font
|
|
|
|
* A font with the headline text style.
|
|
|
|
*
|
|
|
|
* static let subheadline: Font
|
|
|
|
* A font with the subheadline text style.
|
|
|
|
*
|
|
|
|
* static let body: Font
|
|
|
|
* A font with the body text style.
|
|
|
|
*
|
|
|
|
* static let callout: Font
|
|
|
|
* A font with the callout text style.
|
|
|
|
*
|
|
|
|
* static let caption: Font
|
|
|
|
* A font with the caption text style.
|
|
|
|
*
|
|
|
|
* static let caption2: Font
|
|
|
|
* Create a font with the alternate caption text style.
|
|
|
|
*
|
|
|
|
* static let footnote: Font
|
|
|
|
* A font with the footnote text style.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const Text: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
|
switch (props?.variant) {
|
|
|
|
case "overline":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Overline text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Overline>
|
|
|
|
);
|
|
|
|
case "body":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Body text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Body>
|
|
|
|
);
|
|
|
|
case "caption":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Caption text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Caption>
|
|
|
|
);
|
|
|
|
case "caption2":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Caption2 text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Caption2>
|
|
|
|
);
|
|
|
|
case "footnote":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Footnote text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Footnote>
|
|
|
|
);
|
|
|
|
case "headline":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Headline text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Headline>
|
|
|
|
);
|
|
|
|
case "largetitle":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Largetitle text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Largetitle>
|
|
|
|
);
|
|
|
|
case "subheadline":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Subheadline text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Subheadline>
|
|
|
|
);
|
|
|
|
case "subtitle":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Subtitle text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Subtitle>
|
|
|
|
);
|
|
|
|
case "title":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Title text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Title>
|
|
|
|
);
|
|
|
|
case "title2":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Title2 text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Title2>
|
|
|
|
);
|
|
|
|
case "title3":
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Title3 text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Title3>
|
|
|
|
);
|
|
|
|
default:
|
|
|
|
return (
|
2021-09-02 12:13:19 +00:00
|
|
|
<Body text={props?.text} tx={props?.tx} className={props?.className}>
|
2021-07-15 14:10:26 +00:00
|
|
|
{props.children}
|
|
|
|
</Body>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Text;
|