tee3apps-cms-sdk-react 0.0.19 → 0.0.22

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 (27) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +2 -2
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/src/Page.tsx +2 -2
  7. package/src/PageComponents/BoxComponent.tsx +142 -92
  8. package/src/PageComponents/Visual-Components/CarouselComponent.tsx +497 -364
  9. package/src/PageComponents/Visual-Components/GroupBrandComponent.tsx +396 -390
  10. package/src/PageComponents/Visual-Components/GroupCategoryComponent.tsx +21 -13
  11. package/src/PageComponents/Visual-Components/GroupImageList.tsx +642 -668
  12. package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +46 -20
  13. package/src/PageComponents/Visual-Components/GroupVideoList.tsx +693 -589
  14. package/src/PageComponents/Visual-Components/ImageComponent.tsx +72 -17
  15. package/src/PageComponents/Visual-Components/LottieComponent.tsx +14 -8
  16. package/src/PageComponents/Visual-Components/NavigationComponent.tsx +74 -27
  17. package/src/PageComponents/Visual-Components/RichTextComponent.tsx +1 -1
  18. package/src/PageComponents/Visual-Components/TabComponent.tsx +1625 -875
  19. package/src/PageComponents/Visual-Components/TextComponent.tsx +24 -10
  20. package/src/PageComponents/Visual-Components/VideoComponent.tsx +33 -11
  21. package/src/PageComponents/Visual-Components/tab.css +645 -611
  22. package/src/index.css +126 -80
  23. package/src/Components/BoxRenderer.tsx +0 -108
  24. package/src/Components/ComponentRenderer.tsx +0 -29
  25. package/src/Components/ImageComponent.tsx +0 -68
  26. package/src/Components/RowComponent.tsx +0 -66
  27. package/src/Components/TextComponent.tsx +0 -47
package/src/index.css CHANGED
@@ -1,81 +1,127 @@
1
- /* Webkit browsers (Chrome, Safari) */
2
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
3
- :root {
4
- --font-primary: 'Inter', sans-serif;
5
- }
6
-
7
- body {
8
- margin: 0;
9
- padding: 0;
10
- font-family: var(--font-primary);
11
- background-color: #f9f9f9; /* optional */
12
- color: #1a1a1a; /* optional */
13
- }
14
- .groupBrandCarousel::-webkit-scrollbar {
15
- height: 8px;
16
- width: 8px;
17
- }
18
-
19
- .groupBrandCarousel::-webkit-scrollbar-thumb {
20
- background-color: #888;
21
- border-radius: 4px;
22
- }
23
-
24
- .groupBrandCarousel::-webkit-scrollbar-track {
25
- background-color: #f1f1f1;
26
- }
27
-
28
- /* Firefox */
29
- .groupBrandCarousel {
30
- scrollbar-width: thin;
31
- scrollbar-color: #888 #f1f1f1;
32
- }
33
- .GroupImageComponent{
34
- container-type: inline-size;
35
-
36
- }
37
- .GroupBrandComponent{
38
- container-type: inline-size;
39
-
40
- }
41
- .GroupProductComponent {
42
- container-type: inline-size;
43
- }
44
-
45
- @container (max-width: 480px) {
46
- .groupProductCarousel {
47
- gap: 8px !important;
48
- }
49
-
50
- .productImageSlide {
51
- min-width: 100px !important;
52
- }
53
- }
54
-
55
- /* -------------- IMAGE STYLES --------------- */
56
-
57
- .image-box {
58
- width: 100%;
59
- overflow: hidden;
60
- display: block;
61
- position: relative;
62
- max-height: 280px;
63
- }
64
-
65
- .fitted-image {
66
- width: 100%;
67
- height: auto;
68
- max-height: 280px;
69
- display: block;
70
- }
71
- .mainpagearea{
72
- background-color: rgb(205, 205, 205);
73
- width: 100%;
74
- flex: flex;
75
- justify-items: center;
76
- }
77
- .pagerender{
78
- /* background-color: #888; */
79
- width: 95%;
80
-
1
+ /* Webkit browsers (Chrome, Safari) */
2
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
3
+ :root {
4
+ --font-primary: 'Inter', sans-serif;
5
+ }
6
+
7
+ body {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-family: var(--font-primary);
11
+ background-color: #f9f9f9; /* optional */
12
+ color: #1a1a1a; /* optional */
13
+ }
14
+ .groupBrandCarousel::-webkit-scrollbar {
15
+ height: 8px;
16
+ width: 8px;
17
+ }
18
+
19
+ .groupBrandCarousel::-webkit-scrollbar-thumb {
20
+ background-color: #888;
21
+ border-radius: 4px;
22
+ }
23
+
24
+ .groupBrandCarousel::-webkit-scrollbar-track {
25
+ background-color: #f1f1f1;
26
+ }
27
+
28
+ /* Firefox */
29
+ .groupBrandCarousel {
30
+ scrollbar-width: thin;
31
+ scrollbar-color: #888 #f1f1f1;
32
+ }
33
+
34
+ /* Webkit browsers (Chrome, Safari) - Group Category Carousel */
35
+ .groupCategoryCarousel::-webkit-scrollbar {
36
+ height: 8px;
37
+ width: 8px;
38
+ }
39
+
40
+ .groupCategoryCarousel::-webkit-scrollbar-thumb {
41
+ background-color: #c1c1c1;
42
+ border-radius: 4px;
43
+ }
44
+
45
+ .groupCategoryCarousel::-webkit-scrollbar-track {
46
+ background-color: #f0f0f0;
47
+ }
48
+
49
+ /* Firefox - Group Category Carousel */
50
+ .groupCategoryCarousel {
51
+ scrollbar-width: thin;
52
+ scrollbar-color: #c1c1c1 #f0f0f0;
53
+ }
54
+
55
+ /* Webkit browsers (Chrome, Safari) - Group Image List Scrollable Container */
56
+ .groupImageCarousel .scrollable-container::-webkit-scrollbar {
57
+ height: 8px;
58
+ width: 8px;
59
+ }
60
+
61
+ .groupImageCarousel .scrollable-container::-webkit-scrollbar-thumb {
62
+ background-color: #c1c1c1;
63
+ border-radius: 4px;
64
+ }
65
+
66
+ .groupImageCarousel .scrollable-container::-webkit-scrollbar-track {
67
+ background-color: #f0f0f0;
68
+ }
69
+
70
+ /* Firefox - Group Image List Scrollable Container */
71
+ .groupImageCarousel .scrollable-container {
72
+ scrollbar-width: thin;
73
+ scrollbar-color: #c1c1c1 #f0f0f0;
74
+ }
75
+ .GroupImageComponent{
76
+ container-type: inline-size;
77
+
78
+ }
79
+ .GroupBrandComponent{
80
+ container-type: inline-size;
81
+
82
+ }
83
+ .GroupProductComponent {
84
+ container-type: inline-size;
85
+ }
86
+
87
+ @container (max-width: 480px) {
88
+ .groupProductCarousel {
89
+ gap: 8px !important;
90
+ }
91
+
92
+ .productImageSlide {
93
+ min-width: 100px !important;
94
+ }
95
+ }
96
+
97
+ /* -------------- IMAGE STYLES --------------- */
98
+ .image-box {
99
+ width: 100%;
100
+ height: 100%;
101
+ overflow: hidden;
102
+ display: flex;
103
+ align-items: stretch;
104
+ justify-content: stretch;
105
+ position: relative;
106
+ }
107
+
108
+ .fitted-image {
109
+ width: 100%;
110
+ height: 100%;
111
+ object-fit: fill;
112
+ display: block;
113
+ min-width: 0;
114
+ min-height: 0;
115
+ }
116
+
117
+ .mainpagearea{
118
+ background-color: rgb(205, 205, 205);
119
+ width: 100%;
120
+ flex: flex;
121
+ justify-items: center;
122
+ }
123
+ .pagerender{
124
+ /* background-color: #888; */
125
+ width: 95%;
126
+
81
127
  }
@@ -1,108 +0,0 @@
1
- import React from 'react';
2
- import ComponentRenderer from './ComponentRenderer';
3
- import { Box } from '../types';
4
-
5
- interface BoxRendererProps {
6
- box: Box;
7
- deviceMode?: string;
8
- autoAdjustForImages?: boolean;
9
- totalColumns?: number;
10
- }
11
-
12
- const BoxRenderer: React.FC<BoxRendererProps> = ({
13
- box,
14
- deviceMode = 'web',
15
- autoAdjustForImages = true,
16
- totalColumns = 12
17
- }) => {
18
- // Get colspan based on device mode
19
- const getColspan = () => {
20
- switch(deviceMode) {
21
- case 'mobileweb':
22
- return box.props.mode.mobileweb?.colspan || 12;
23
- case 'mobileapp':
24
- return box.props.mode.mobileapp?.colspan || 12;
25
- case 'tablet':
26
- return box.props.mode.tablet?.colspan || 12;
27
- case 'web':
28
- default:
29
- return box.props.mode.web.colspan || 12;
30
- }
31
- };
32
-
33
- // Get device-specific mode properties
34
- const getCurrentMode = () => {
35
- switch(deviceMode) {
36
- case 'mobileweb':
37
- return box.props.mode.mobileweb || {};
38
- case 'mobileapp':
39
- return box.props.mode.mobileapp || {};
40
- case 'tablet':
41
- return box.props.mode.tablet || {};
42
- case 'web':
43
- default:
44
- return box.props.mode.web;
45
- }
46
- };
47
-
48
- const colspan = getColspan();
49
- const currentMode = getCurrentMode();
50
- const widthPercentage = (colspan / totalColumns) * 100;
51
-
52
- // Dynamic height calculation based on content type
53
- const getBoxHeight = () => {
54
- if (!autoAdjustForImages) {
55
- return currentMode.height || 'auto';
56
- }
57
-
58
- const hasImageComponent = box.components.some(component =>
59
- component.name === 'ImageComponent'
60
- );
61
-
62
- if (hasImageComponent) {
63
- return 'auto';
64
- }
65
-
66
- return currentMode.height || 'auto';
67
- };
68
-
69
- return (
70
- <div
71
- style={{
72
- backgroundColor: box.props.bgColor,
73
- display: currentMode.isVisible !== false ? 'block' : 'none',
74
- backgroundSize: box.props.bgsize || 'cover',
75
- height: getBoxHeight(),
76
- minHeight: autoAdjustForImages ? 'auto' : (currentMode.height || 'auto'),
77
- borderRadius: currentMode.radius || '0px',
78
- width: `${widthPercentage}%`,
79
- float: 'left',
80
- boxSizing: 'border-box',
81
- padding: 'px',
82
- margin: 0,
83
- overflow: 'hidden',
84
- position: 'relative'
85
- }}
86
- >
87
- <div style={{
88
- width: '100%',
89
- height: autoAdjustForImages ? 'auto' : '100%',
90
- display: 'flex',
91
- flexDirection: 'column',
92
- alignItems: box.props.align || 'flex-start',
93
- justifyContent: box.props.justify || 'flex-start',
94
- padding: 0,
95
- margin: 0,
96
- boxSizing: 'border-box'
97
- }}>
98
- {box.components.map((component, index) => (
99
- <div key={index} className="relative" style={{width: '100%'}}>
100
- <ComponentRenderer component={component} />
101
- </div>
102
- ))}
103
- </div>
104
- </div>
105
- );
106
- };
107
-
108
- export default BoxRenderer;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { Component } from '../types';
3
- import TextComponent from './TextComponent';
4
-
5
- import ImageComponent from './ImageComponent';
6
-
7
- interface ComponentRendererProps {
8
- component: Component;
9
- }
10
-
11
- const ComponentRenderer: React.FC<ComponentRendererProps> = ({ component }) => {
12
- switch (component.name) {
13
-
14
- case 'ImageComponent':
15
- return <ImageComponent props={component.props} />;
16
-
17
- case 'TextComponent':
18
- return <TextComponent props={component.props} />;
19
-
20
- default:
21
- return (
22
- <div className="mb-4 p-4 bg-gray-100 rounded-md border-2 border-dashed border-gray-300">
23
- <p className="text-sm text-gray-500">Unknown component: {component.name}</p>
24
- </div>
25
- );
26
- }
27
- };
28
-
29
- export default ComponentRenderer;
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- import { ComponentProps } from '../types';
3
-
4
- const ImageComponent: React.FC<{ props: ComponentProps; deviceMode?: string }> = ({
5
- props,
6
- deviceMode = 'web'
7
- }) => {
8
- // Safe access to nested properties with fallbacks
9
- const getCurrentMode = () => {
10
- if (!props.mode) return { borderRadius: 0 };
11
-
12
- switch(deviceMode) {
13
- case 'mobileweb':
14
- return props.mode.mobileweb || props.mode.web || { borderRadius: 0 };
15
- case 'mobileapp':
16
- return props.mode.mobileapp || props.mode.web || { borderRadius: 0 };
17
- case 'tablet':
18
- return props.mode.tablet || props.mode.web || { borderRadius: 0 };
19
- case 'web':
20
- default:
21
- return props.mode.web || { borderRadius: 0 };
22
- }
23
- };
24
-
25
- const currentMode = getCurrentMode();
26
- const imageData = props.images?.all || { url: '' };
27
- const link = props.link || { url: '', target: '_blank' };
28
-
29
- const handleClick = () => {
30
- if (props.linktype === 'EXTERNAL' && link.url) {
31
- window.open(link.url, link.target || '_blank');
32
- }
33
- };
34
-
35
- const imageElement = (
36
- <img src={imageData.url} alt="" />
37
- );
38
-
39
- if (props.linktype === 'EXTERNAL' && link.url) {
40
- return (
41
- <a
42
- href={link.url}
43
- target={link.target}
44
- style={{
45
- display: 'block',
46
- width: '100%',
47
- textDecoration: 'none'
48
- }}
49
- >
50
- {imageElement}
51
- </a>
52
- );
53
- }
54
-
55
- return (
56
- <div
57
- style={{
58
- width: '100%',
59
- cursor: props.linktype !== 'NONE' ? 'pointer' : 'default'
60
- }}
61
- onClick={handleClick}
62
- >
63
- {imageElement}
64
- </div>
65
- );
66
- };
67
-
68
- export default ImageComponent;
@@ -1,66 +0,0 @@
1
- import React from 'react';
2
- import BoxRenderer from './BoxRenderer';
3
- import { Row } from '../types';
4
-
5
- interface RowComponentProps {
6
- row: Row;
7
- deviceMode?: string;
8
- }
9
-
10
- const RowComponent: React.FC<RowComponentProps> = ({
11
- row,
12
- deviceMode = 'web'
13
- }) => {
14
- const getCurrentMode = () => {
15
- switch(deviceMode) {
16
- case 'mobileweb':
17
- return row.props.mode.mobileweb || {};
18
- case 'mobileapp':
19
- return row.props.mode.mobileapp || {};
20
- case 'tablet':
21
- return row.props.mode.tablet || {};
22
- case 'web':
23
- default:
24
- return row.props.mode.web;
25
- }
26
- };
27
-
28
- const currentMode = getCurrentMode();
29
-
30
- return (
31
- <div
32
- style={{
33
- minHeight: row.props.minHeight,
34
- backgroundColor: row.props.bgColor,
35
- backgroundImage: row.props.bgImage ? `url(${row.props.bgImage})` : 'none',
36
- backgroundSize: row.props.bgsize,
37
- backgroundPosition: 'center',
38
- width: '100%',
39
- marginBottom: '2px',
40
- border: '1px solid #e0e0e0',
41
- borderRadius: '4px',
42
- boxSizing: 'border-box',
43
- overflow: 'hidden',
44
- position: 'relative',
45
- display: currentMode.isVisible !== false ? 'block' : 'none',
46
- }}
47
- >
48
- {/* Row Content */}
49
- <div style={{
50
- width: '100%',
51
- display: 'block',
52
- position: 'relative',
53
- padding: '10px',
54
- boxSizing: 'border-box'
55
- }}>
56
- {row.columns.map((box, boxIndex) => (
57
- <BoxRenderer key={boxIndex} box={box} deviceMode={deviceMode} />
58
- ))}
59
- {/* Clear float after all children */}
60
- <div style={{ clear: 'both' }} />
61
- </div>
62
- </div>
63
- );
64
- };
65
-
66
- export default RowComponent;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { ComponentProps } from '../types';
3
-
4
- const TextComponent: React.FC<{ props: ComponentProps }> = ({ props }) => {
5
- const { text, style } = props;
6
-
7
- const tagName = style?.headingTag ?? 'p';
8
-
9
- if (!text?.all) {
10
- return <div className="text-sm text-gray-500">No text content</div>;
11
- }
12
-
13
- const textStyle = {
14
- fontSize: style?.fontSize ? `${style.fontSize}px` : '16px',
15
- fontWeight: style?.fontStyle?.isBold ? 'bold' : 'normal',
16
- fontStyle: style?.fontStyle?.isItalic ? 'italic' : 'normal',
17
- textDecoration: style?.fontStyle?.isUnderLine ? 'underline' : 'none',
18
- textDecorationLine: style?.fontStyle?.isStrikeThrough ? 'line-through' : 'none',
19
- color: style?.fontColor || '#000',
20
- textAlign: style?.textAlign || 'left',
21
- fontFamily: style?.fontFamily || 'inherit',
22
- margin: 5,
23
- };
24
-
25
- // Create the text element
26
- const textElement = React.createElement(
27
- tagName,
28
- { style: textStyle },
29
- text.all
30
- );
31
-
32
- if (props.linktype === 'EXTERNAL' && props.link?.url) {
33
- return (
34
- <a
35
- href={props.link.url}
36
- target={props.link.target}
37
- style={{ textDecoration: 'none' }}
38
- >
39
- {textElement}
40
- </a>
41
- );
42
- }
43
-
44
- return textElement;
45
- };
46
-
47
- export default TextComponent;