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.
Files changed (31) hide show
  1. package/README.md +244 -2
  2. package/dist/index.d.ts +189 -1
  3. package/dist/index.js +3 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +3 -3
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/App.css +37 -0
  9. package/src/Page.tsx +5 -2
  10. package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +182 -318
  11. package/src/PageComponents/Visual-Components/RichTextComponent.tsx +28 -0
  12. package/src/PageFormComponents/BooleanField.tsx +56 -0
  13. package/src/PageFormComponents/BoxRenderer.tsx +229 -0
  14. package/src/PageFormComponents/Button.tsx +127 -0
  15. package/src/PageFormComponents/DateField.tsx +46 -0
  16. package/src/PageFormComponents/ImageComponent.tsx +163 -0
  17. package/src/PageFormComponents/InputField.tsx +62 -0
  18. package/src/PageFormComponents/NumberField.tsx +56 -0
  19. package/src/PageFormComponents/PageForm.css +213 -0
  20. package/src/PageFormComponents/PageForm.tsx +267 -0
  21. package/src/PageFormComponents/RadioField.tsx +59 -0
  22. package/src/PageFormComponents/RowComponent.tsx +82 -0
  23. package/src/PageFormComponents/SelectField.tsx +183 -0
  24. package/src/PageFormComponents/Styles/BooleanField.css +56 -0
  25. package/src/PageFormComponents/Styles/DateField.css +44 -0
  26. package/src/PageFormComponents/Styles/InputField.css +50 -0
  27. package/src/PageFormComponents/Styles/NumberField.css +57 -0
  28. package/src/PageFormComponents/Styles/RadioField.css +66 -0
  29. package/src/PageFormComponents/Styles/SelectField.css +264 -0
  30. package/src/PageFormComponents/TextComponent.tsx +45 -0
  31. 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
- import Page from "./Page";
2
- export default Page
1
+ export { default as Page } from "./Page";
2
+ export { default as PageForm } from './PageFormComponents/PageForm';