tee3apps-cms-sdk-react 0.0.5 → 0.0.6

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.
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import type { ComponentProps } from '../types';
3
+
4
+ const TextComponent: React.FC<{ props: ComponentProps }> = ({ props }) => {
5
+ const { text, style } = props;
6
+ const Tag = (style?.headingTag as keyof JSX.IntrinsicElements) || 'p';
7
+
8
+ if (!text?.all) {
9
+ return <div className="text-sm text-gray-500">No text content</div>;
10
+ }
11
+
12
+ const textElement = (
13
+ <Tag
14
+ style={{
15
+ fontSize: style?.fontSize ? `${style.fontSize}px` : '16px',
16
+ fontWeight: style?.fontStyle?.isBold ? 'bold' : 'normal',
17
+ fontStyle: style?.fontStyle?.isItalic ? 'italic' : 'normal',
18
+ textDecoration: style?.fontStyle?.isUnderLine ? 'underline' : 'none',
19
+ textDecorationLine: style?.fontStyle?.isStrikeThrough ? 'line-through' : 'none',
20
+ color: style?.fontColor || '#000',
21
+ textAlign: (style?.textAlign as any) || 'left',
22
+ fontFamily: style?.fontFamily || 'inherit',
23
+ margin: 5,
24
+ }}
25
+ >
26
+ {text.all}
27
+ </Tag>
28
+ );
29
+
30
+ if (props.linktype === 'EXTERNAL' && props.link?.url) {
31
+ return (
32
+ <a
33
+ href={props.link.url}
34
+ target={props.link.target}
35
+ style={{ textDecoration: 'none' }}
36
+ >
37
+ {textElement}
38
+ </a>
39
+ );
40
+ }
41
+
42
+ return textElement;
43
+ };
44
+
45
+ export default TextComponent;
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- import Page from "./Page";
2
- export default Page
1
+ export { default as Page } from "./Page";
2
+ export { default as PageForm } from './PageFormComponents/PageForm';