tee3apps-cms-sdk-react 0.0.5 → 0.0.7
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/README.md +244 -2
- package/dist/index.d.ts +189 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/App.css +37 -0
- package/src/Page.tsx +5 -2
- package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +182 -318
- package/src/PageComponents/Visual-Components/RichTextComponent.tsx +28 -0
- package/src/PageFormComponents/BooleanField.tsx +56 -0
- package/src/PageFormComponents/BoxRenderer.tsx +229 -0
- package/src/PageFormComponents/Button.tsx +127 -0
- package/src/PageFormComponents/DateField.tsx +46 -0
- package/src/PageFormComponents/ImageComponent.tsx +163 -0
- package/src/PageFormComponents/InputField.tsx +62 -0
- package/src/PageFormComponents/NumberField.tsx +56 -0
- package/src/PageFormComponents/PageForm.css +213 -0
- package/src/PageFormComponents/PageForm.tsx +267 -0
- package/src/PageFormComponents/RadioField.tsx +59 -0
- package/src/PageFormComponents/RowComponent.tsx +82 -0
- package/src/PageFormComponents/SelectField.tsx +183 -0
- package/src/PageFormComponents/Styles/BooleanField.css +56 -0
- package/src/PageFormComponents/Styles/DateField.css +44 -0
- package/src/PageFormComponents/Styles/InputField.css +50 -0
- package/src/PageFormComponents/Styles/NumberField.css +57 -0
- package/src/PageFormComponents/Styles/RadioField.css +66 -0
- package/src/PageFormComponents/Styles/SelectField.css +264 -0
- package/src/PageFormComponents/TextComponent.tsx +45 -0
- package/src/index.ts +2 -2
|
@@ -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
|
+
|
|
7
|
+
if (!text?.all) {
|
|
8
|
+
return <span className="text-sm text-gray-500">No text content</span>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const textStyle: React.CSSProperties = {
|
|
12
|
+
fontSize: style?.fontSize ? `${style.fontSize}px` : '16px',
|
|
13
|
+
fontWeight: style?.fontStyle?.isBold ? 'bold' : 'normal',
|
|
14
|
+
fontStyle: style?.fontStyle?.isItalic ? 'italic' : 'normal',
|
|
15
|
+
textDecoration: style?.fontStyle?.isUnderLine ? 'underline' : 'none',
|
|
16
|
+
textDecorationLine: style?.fontStyle?.isStrikeThrough ? 'line-through' : 'none',
|
|
17
|
+
color: style?.fontColor || '#000',
|
|
18
|
+
textAlign: (style?.textAlign as any) || 'left',
|
|
19
|
+
fontFamily: style?.fontFamily || 'inherit',
|
|
20
|
+
margin: 5,
|
|
21
|
+
display: 'inline', // keeps it inline instead of block like p/div
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const textElement = (
|
|
25
|
+
<span style={textStyle}>
|
|
26
|
+
{text.all}
|
|
27
|
+
</span>
|
|
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
|
-
|
|
2
|
-
export default
|
|
1
|
+
export { default as Page } from "./Page";
|
|
2
|
+
export { default as PageForm } from './PageFormComponents/PageForm';
|