@redneckz/wildless-cms-uni-blocks 0.6.42 → 0.6.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/migration-scripts/0.6.34.js +2 -0
- package/bin/migration-scripts/0.6.43.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +84 -70
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/dist/components/ProductTile/ProductTile.js +9 -22
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/dist/components/ProductTile/renderBenefit.js +32 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/dist/components/ProductTile/renderImage.js +12 -0
- package/dist/components/ProductTile/renderImage.js.map +1 -0
- package/dist/components/TextBlock/TextBlock.js +13 -28
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +1 -1
- package/dist/content-page-repository/transformImg.js +4 -10
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformMarkdown.js +3 -3
- package/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/dist/ui-kit/Text/Text.js +1 -5
- package/dist/ui-kit/Text/Text.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ProductTile/ProductTile.js +10 -23
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/lib/components/ProductTile/renderBenefit.js +29 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/lib/components/ProductTile/renderImage.js +9 -0
- package/lib/components/ProductTile/renderImage.js.map +1 -0
- package/lib/components/TextBlock/TextBlock.js +13 -28
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +1 -1
- package/lib/content-page-repository/transformImg.js +4 -10
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformMarkdown.js +3 -3
- package/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/lib/ui-kit/Text/Text.js +1 -5
- package/lib/ui-kit/Text/Text.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
- package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/dist/components/ProductTile/renderImage.js +12 -0
- package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformImg.js +4 -10
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/dist/ui-kit/Text/Text.js +1 -5
- package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
- package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
- package/mobile/lib/components/ProductTile/renderImage.js +9 -0
- package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
- package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformImg.js +4 -10
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
- package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
- package/mobile/lib/ui-kit/Text/Text.js +1 -5
- package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
- package/mobile/src/common.css +50 -0
- package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
- package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
- package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
- package/mobile/src/content-page-repository/transformImg.ts +6 -14
- package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
- package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/mobile/src/ui-kit/Text/Text.tsx +5 -7
- package/package.json +1 -1
- package/src/common.css +50 -0
- package/src/components/ProductTile/ProductTile.example.json +3 -0
- package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
- package/src/components/ProductTile/ProductTile.tsx +13 -44
- package/src/components/ProductTile/ProductTile.ui.json +14 -1
- package/src/components/ProductTile/ProductTileContent.ts +26 -2
- package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
- package/src/components/ProductTile/renderBenefit.tsx +39 -0
- package/src/components/ProductTile/renderImage.tsx +15 -0
- package/src/components/TextBlock/TextBlock.tsx +49 -41
- package/src/content-page-repository/transformImg.ts +6 -14
- package/src/content-page-repository/transformMarkdown.ts +3 -3
- package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
- package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
- package/src/ui-kit/Text/Text.tsx +5 -7
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import { MarkdownText } from '../../ui-kit/MarkdownText/MarkdownText';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
import type { TextColor } from '../../ui-kit/Text/TextProps';
|
|
5
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
6
|
+
import type { Benefit } from './ProductTileContent';
|
|
7
|
+
|
|
8
|
+
const LABEL_STYLE_MAP: Record<BlockVersion, TextColor> = {
|
|
9
|
+
primary: 'text-secondary-text',
|
|
10
|
+
secondary: 'text-white',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const renderBenefit =
|
|
14
|
+
(version: BlockVersion = 'primary') =>
|
|
15
|
+
// Linter doesn't understand that switch processes all cases
|
|
16
|
+
// eslint-disable-next-line consistent-return
|
|
17
|
+
(benefit: Benefit, i: number) => {
|
|
18
|
+
const { type } = benefit;
|
|
19
|
+
|
|
20
|
+
if (!(type === 'default' || type === 'md')) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
switch (type) {
|
|
25
|
+
case 'default':
|
|
26
|
+
return [
|
|
27
|
+
<Text key={`label-${i}`} size="text-h6">
|
|
28
|
+
{benefit.label}
|
|
29
|
+
</Text>,
|
|
30
|
+
<Text key={`desc-${i}`} size="text-m-light" color={LABEL_STYLE_MAP[version]}>
|
|
31
|
+
{benefit.description}
|
|
32
|
+
</Text>,
|
|
33
|
+
];
|
|
34
|
+
case 'md':
|
|
35
|
+
return <MarkdownText md={benefit.md} />;
|
|
36
|
+
default:
|
|
37
|
+
assertUnreachable(benefit);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
3
|
+
|
|
4
|
+
export function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
|
|
5
|
+
if (!image?.src) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Img
|
|
11
|
+
className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
|
|
12
|
+
image={image}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -3,51 +3,43 @@ import type { UniBlockProps } from '../../model/JSXBlock';
|
|
|
3
3
|
import type { Picture } from '../../model/Picture';
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
7
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
6
8
|
import type { TextBlockContent, TextBlockVersion } from './TextBlockContent';
|
|
7
9
|
|
|
8
10
|
export interface TextBlockProps extends TextBlockContent, UniBlockProps {}
|
|
9
11
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
primary: {
|
|
15
|
-
background: 'bg-white',
|
|
16
|
-
icon: 'bg-primary-main text-white',
|
|
17
|
-
title: 'text-primary-text',
|
|
18
|
-
description: 'text-secondary-text',
|
|
19
|
-
},
|
|
20
|
-
secondary: {
|
|
21
|
-
background: 'bg-primary-main',
|
|
22
|
-
icon: 'bg-white text-primary-main',
|
|
23
|
-
title: 'text-white',
|
|
24
|
-
description: 'text-white',
|
|
25
|
-
},
|
|
26
|
-
'secondary-light': {
|
|
27
|
-
background: 'bg-primary-main/10',
|
|
28
|
-
icon: 'bg-primary-main text-white',
|
|
29
|
-
title: 'text-primary-text',
|
|
30
|
-
description: 'text-secondary-text',
|
|
31
|
-
},
|
|
12
|
+
const textBlockBack: Record<TextBlockVersion, string> = {
|
|
13
|
+
primary: 'bg-white',
|
|
14
|
+
secondary: 'bg-primary-main',
|
|
15
|
+
'secondary-light': 'bg-primary-main/10',
|
|
32
16
|
};
|
|
33
17
|
|
|
34
18
|
export const TextBlock = JSX<TextBlockProps>(
|
|
35
|
-
({
|
|
36
|
-
|
|
19
|
+
({
|
|
20
|
+
className = '',
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
blockVersion = 'primary',
|
|
24
|
+
iconVersion,
|
|
25
|
+
image,
|
|
26
|
+
...rest
|
|
27
|
+
}) => {
|
|
28
|
+
const isSecondaryBlock = blockVersion === 'secondary';
|
|
37
29
|
|
|
38
30
|
return (
|
|
39
31
|
<BlockWrapper
|
|
40
|
-
className={`
|
|
32
|
+
className={`px-9 py-4 flex gap-3 ${textBlockBack[blockVersion]} ${className}`}
|
|
41
33
|
{...rest}
|
|
42
34
|
>
|
|
43
|
-
{iconVersion === 'small' ?
|
|
35
|
+
{iconVersion === 'small' ? (
|
|
36
|
+
<div className="mt-1">{renderIcon(isSecondaryBlock)}</div>
|
|
37
|
+
) : null}
|
|
44
38
|
{iconVersion === 'big' ? renderImage(image) : null}
|
|
45
|
-
<div
|
|
46
|
-
{title ? (
|
|
47
|
-
<div className={`text-l font-medium mb-1 ${textBlockStyleMap.title}`}>{title}</div>
|
|
48
|
-
) : null}
|
|
39
|
+
<div>
|
|
40
|
+
{title ? renderTitle(title, isSecondaryBlock) : null}
|
|
49
41
|
{description ? (
|
|
50
|
-
<div className=
|
|
42
|
+
<div className="mt-1">{renderDescription(description, isSecondaryBlock)}</div>
|
|
51
43
|
) : null}
|
|
52
44
|
</div>
|
|
53
45
|
</BlockWrapper>
|
|
@@ -55,14 +47,30 @@ export const TextBlock = JSX<TextBlockProps>(
|
|
|
55
47
|
},
|
|
56
48
|
);
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
const renderIcon = (isSecondaryBlock: boolean) => (
|
|
51
|
+
<div
|
|
52
|
+
className={`rounded-full h-4 w-4 text-center text-xs-light ${
|
|
53
|
+
isSecondaryBlock ? 'bg-white text-primary-main' : 'bg-primary-main text-white'
|
|
54
|
+
}`}
|
|
55
|
+
>
|
|
56
|
+
i
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
const renderImage = (image?: Picture) => (image?.src ? <Img image={image} /> : null);
|
|
61
|
+
|
|
62
|
+
const renderTitle = (title: string, isSecondaryBlock: boolean) => (
|
|
63
|
+
<Text
|
|
64
|
+
size="text-l"
|
|
65
|
+
font="font-medium"
|
|
66
|
+
color={isSecondaryBlock ? 'text-white' : 'text-primary-text'}
|
|
67
|
+
>
|
|
68
|
+
{title}
|
|
69
|
+
</Text>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const renderDescription = (description: string, isSecondaryBlock: boolean) => (
|
|
73
|
+
<Paragraph size="text-s" color={isSecondaryBlock ? 'text-white' : 'text-secondary-text'}>
|
|
74
|
+
{description}
|
|
75
|
+
</Paragraph>
|
|
76
|
+
);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import util from 'util';
|
|
4
|
-
import sharp from 'sharp';
|
|
5
3
|
import type { ResizeOptions, Sharp } from 'sharp';
|
|
4
|
+
import sharp from 'sharp';
|
|
5
|
+
import util from 'util';
|
|
6
6
|
import type { ImageSize } from '../model/ImageSize';
|
|
7
|
-
import type { TransformationOptions } from './TransformationOptions';
|
|
8
7
|
import type { ImgAlignment, ImgSource, Picture } from '../model/Picture';
|
|
9
|
-
import { transformSrc } from './transformSrc';
|
|
10
8
|
import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
|
|
9
|
+
import type { TransformationOptions } from './TransformationOptions';
|
|
10
|
+
import { transformSrc } from './transformSrc';
|
|
11
11
|
|
|
12
12
|
const mkdir = util.promisify(fs.mkdir);
|
|
13
13
|
|
|
@@ -126,20 +126,12 @@ function getCompositionResizeSize(
|
|
|
126
126
|
const { width, height } = size;
|
|
127
127
|
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
128
128
|
|
|
129
|
-
let widthRatio = 0;
|
|
130
|
-
let heightRatio = 0;
|
|
131
|
-
|
|
132
129
|
if (!(width || height)) {
|
|
133
130
|
return undefined;
|
|
134
131
|
}
|
|
135
132
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (height) {
|
|
141
|
-
heightRatio = containerHeight / height;
|
|
142
|
-
}
|
|
133
|
+
const widthRatio = width ? containerWidth / width : 0;
|
|
134
|
+
const heightRatio = height ? containerHeight / height : 0;
|
|
143
135
|
|
|
144
136
|
return widthRatio > heightRatio
|
|
145
137
|
? { width: Math.min(Number(width), containerWidth) }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { unified } from 'unified';
|
|
2
|
-
import remarkParse from 'remark-parse';
|
|
3
1
|
import remarkHtml from 'remark-html';
|
|
2
|
+
import remarkParse from 'remark-parse';
|
|
3
|
+
import { unified } from 'unified';
|
|
4
4
|
|
|
5
5
|
export async function transformMarkdown(markdown: string | null | undefined): Promise<string> {
|
|
6
6
|
if (!markdown) {
|
|
@@ -9,5 +9,5 @@ export async function transformMarkdown(markdown: string | null | undefined): Pr
|
|
|
9
9
|
|
|
10
10
|
const result = await unified().use(remarkParse).use(remarkHtml).process(markdown);
|
|
11
11
|
|
|
12
|
-
return result.toString('utf-8');
|
|
12
|
+
return result.toString('utf-8').replaceAll(/<h(\d)>([^<]*)<\/h\d>/g, '<p class="h$1">$2</p>');
|
|
13
13
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { MarkdownTextProps } from './MarkdownTextProps';
|
|
3
|
+
|
|
4
|
+
export const MarkdownText = JSX<MarkdownTextProps>((props) => {
|
|
5
|
+
const { md = '' } = props;
|
|
6
|
+
|
|
7
|
+
return <div className="md-container" dangerouslySetInnerHTML={{ __html: md }} />;
|
|
8
|
+
});
|
package/src/ui-kit/Text/Text.tsx
CHANGED
|
@@ -8,10 +8,8 @@ interface TextProps {
|
|
|
8
8
|
font?: FontWeight;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const Text = JSX<TextProps>((
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return <span className={textClasses}>{children}</span>;
|
|
17
|
-
});
|
|
11
|
+
export const Text = JSX<TextProps>(({ size, color, align, font, children }) => (
|
|
12
|
+
<span className={['font-sans', size, color, align, font].filter(Boolean).join(' ')}>
|
|
13
|
+
{children}
|
|
14
|
+
</span>
|
|
15
|
+
));
|