funuicss 3.9.2 → 3.9.3
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/css/fun.css +17 -0
- package/package.json +1 -1
- package/ui/div/Div.d.ts +5 -1
- package/ui/div/Div.js +3 -3
- package/ui/products/ProductCard.js +106 -4
- package/ui/products/ProductDetail.js +1 -1
- package/ui/vista/Vista.d.ts +1 -1
- package/ui/vista/Vista.js +766 -12
package/css/fun.css
CHANGED
|
@@ -5476,6 +5476,23 @@ background-color: rgba(0, 0, 0, 0.2);
|
|
|
5476
5476
|
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
|
5477
5477
|
}
|
|
5478
5478
|
|
|
5479
|
+
/* Optional: Add loading animation */
|
|
5480
|
+
@keyframes imageLoading {
|
|
5481
|
+
0% { opacity: 0.3; }
|
|
5482
|
+
50% { opacity: 0.7; }
|
|
5483
|
+
100% { opacity: 0.3; }
|
|
5484
|
+
}
|
|
5485
|
+
|
|
5486
|
+
.funui_store_no-image {
|
|
5487
|
+
display: flex;
|
|
5488
|
+
align-items: center;
|
|
5489
|
+
justify-content: center;
|
|
5490
|
+
width: 100%;
|
|
5491
|
+
height: 100%;
|
|
5492
|
+
background-color: #f5f5f5;
|
|
5493
|
+
animation: imageLoading 1.5s infinite;
|
|
5494
|
+
}
|
|
5495
|
+
|
|
5479
5496
|
/* Badges */
|
|
5480
5497
|
.funui_store_product-badges {
|
|
5481
5498
|
position: absolute;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.9.
|
|
2
|
+
"version": "3.9.3",
|
|
3
3
|
"name": "funuicss",
|
|
4
4
|
"description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
|
|
5
5
|
"main": "index.js",
|
package/ui/div/Div.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ type DivProps = {
|
|
|
18
18
|
ref?: React.Ref<HTMLDivElement>;
|
|
19
19
|
customStyle?: React.CSSProperties;
|
|
20
20
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
21
|
+
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
22
|
+
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
23
|
+
onMouseOver?: React.MouseEventHandler<HTMLDivElement>;
|
|
24
|
+
onMouseOut?: React.MouseEventHandler<HTMLDivElement>;
|
|
21
25
|
};
|
|
22
|
-
declare const Div: ({ children, funcss, content, minHeight, maxHeight, maxWidth, minWidth, height, width, padding, className, style, margin, id, fit, ref, customStyle, ...rest }: DivProps) => React.JSX.Element;
|
|
26
|
+
declare const Div: ({ children, funcss, content, minHeight, maxHeight, maxWidth, minWidth, height, width, padding, className, style, margin, id, fit, ref, customStyle, onClick, onMouseEnter, onMouseLeave, onMouseOver, onMouseOut, ...rest }: DivProps) => React.JSX.Element;
|
|
23
27
|
export default Div;
|
package/ui/div/Div.js
CHANGED
|
@@ -58,8 +58,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
59
|
var React = __importStar(require("react"));
|
|
60
60
|
var Div = function (_a) {
|
|
61
|
-
var children = _a.children, funcss = _a.funcss, content = _a.content, minHeight = _a.minHeight, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, minWidth = _a.minWidth, height = _a.height, width = _a.width, padding = _a.padding, className = _a.className, style = _a.style, margin = _a.margin, id = _a.id, fit = _a.fit, ref = _a.ref, customStyle = _a.customStyle, rest = __rest(_a, ["children", "funcss", "content", "minHeight", "maxHeight", "maxWidth", "minWidth", "height", "width", "padding", "className", "style", "margin", "id", "fit", "ref", "customStyle"]);
|
|
62
|
-
return (React.createElement("div",
|
|
63
|
-
React.createElement("div", __assign({
|
|
61
|
+
var children = _a.children, funcss = _a.funcss, content = _a.content, minHeight = _a.minHeight, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, minWidth = _a.minWidth, height = _a.height, width = _a.width, padding = _a.padding, className = _a.className, style = _a.style, margin = _a.margin, id = _a.id, fit = _a.fit, ref = _a.ref, customStyle = _a.customStyle, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onMouseOver = _a.onMouseOver, onMouseOut = _a.onMouseOut, rest = __rest(_a, ["children", "funcss", "content", "minHeight", "maxHeight", "maxWidth", "minWidth", "height", "width", "padding", "className", "style", "margin", "id", "fit", "ref", "customStyle", "onClick", "onMouseEnter", "onMouseLeave", "onMouseOver", "onMouseOut"]);
|
|
62
|
+
return (React.createElement("div", { ref: ref, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onClick: onClick },
|
|
63
|
+
React.createElement("div", __assign({ className: "".concat(fit ? 'width-100-p height-100-p' : '', " ").concat(funcss, " ").concat(className || ''), style: __assign(__assign({ height: height || '', maxHeight: maxHeight || '', minHeight: minHeight || '', maxWidth: maxWidth || '', minWidth: minWidth || '', width: width || '', padding: padding || '', margin: margin || '' }, style), customStyle), id: id }, rest), content || children)));
|
|
64
64
|
};
|
|
65
65
|
exports.default = Div;
|
|
@@ -1,30 +1,132 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
37
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38
|
+
if (ar || !(i in from)) {
|
|
39
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
40
|
+
ar[i] = from[i];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
44
|
+
};
|
|
3
45
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
47
|
};
|
|
6
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var react_1 =
|
|
49
|
+
var react_1 = __importStar(require("react"));
|
|
8
50
|
var Div_1 = __importDefault(require("../div/Div"));
|
|
9
51
|
var Text_1 = __importDefault(require("../text/Text"));
|
|
10
52
|
var Flex_1 = __importDefault(require("../flex/Flex"));
|
|
11
53
|
var ProductCard = function (_a) {
|
|
12
|
-
var _b;
|
|
13
|
-
var product = _a.product, _c = _a.currency, currency = _c === void 0 ? '$' : _c, onClick = _a.onClick, onAddToCart = _a.onAddToCart, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.funcss, funcss = _e === void 0 ? '' : _e, _f = _a.showBadges, showBadges = _f === void 0 ? true : _f;
|
|
54
|
+
var product = _a.product, _b = _a.currency, currency = _b === void 0 ? '$' : _b, onClick = _a.onClick, onAddToCart = _a.onAddToCart, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.funcss, funcss = _d === void 0 ? '' : _d, _e = _a.showBadges, showBadges = _e === void 0 ? true : _e;
|
|
14
55
|
var hasDiscount = product.comparePrice && product.comparePrice > product.price;
|
|
15
56
|
var discountPercent = hasDiscount
|
|
16
57
|
? Math.round(((product.comparePrice - product.price) / product.comparePrice) * 100)
|
|
17
58
|
: 0;
|
|
59
|
+
// Track which image is currently displayed
|
|
60
|
+
var _f = (0, react_1.useState)(0), currentImageIndex = _f[0], setCurrentImageIndex = _f[1];
|
|
61
|
+
var _g = (0, react_1.useState)([]), imagesLoaded = _g[0], setImagesLoaded = _g[1];
|
|
62
|
+
// Check if product has multiple images
|
|
63
|
+
var hasMultipleImages = product.images && product.images.length > 1;
|
|
64
|
+
// Handle image preloading
|
|
65
|
+
(0, react_1.useEffect)(function () {
|
|
66
|
+
if (!product.images || product.images.length === 0)
|
|
67
|
+
return;
|
|
68
|
+
// Track loaded images
|
|
69
|
+
var loadedStatus = new Array(product.images.length).fill(false);
|
|
70
|
+
setImagesLoaded(loadedStatus);
|
|
71
|
+
// Preload all images
|
|
72
|
+
product.images.forEach(function (src, index) {
|
|
73
|
+
var img = new Image();
|
|
74
|
+
img.src = src;
|
|
75
|
+
img.onload = function () {
|
|
76
|
+
setImagesLoaded(function (prev) {
|
|
77
|
+
var updated = __spreadArray([], prev, true);
|
|
78
|
+
updated[index] = true;
|
|
79
|
+
return updated;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}, [product.images]);
|
|
18
84
|
var handleClick = function () {
|
|
19
85
|
onClick === null || onClick === void 0 ? void 0 : onClick(product);
|
|
20
86
|
};
|
|
87
|
+
var handleMouseEnter = function () {
|
|
88
|
+
if (hasMultipleImages && product.images && product.images.length > 1) {
|
|
89
|
+
// Switch to next image (or first if at the end)
|
|
90
|
+
setCurrentImageIndex(function (prev) {
|
|
91
|
+
return prev === product.images.length - 1 ? 0 : prev + 1;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var handleMouseLeave = function () {
|
|
96
|
+
// Reset to first image when mouse leaves
|
|
97
|
+
setCurrentImageIndex(0);
|
|
98
|
+
};
|
|
21
99
|
var getDisplayPrice = function () {
|
|
22
100
|
var price = product.price || 0;
|
|
23
101
|
var productCurrency = product.currency || currency;
|
|
24
102
|
return "".concat(productCurrency).concat(price.toFixed(2));
|
|
25
103
|
};
|
|
26
104
|
return (react_1.default.createElement(Div_1.default, { funcss: "funui_store_product-card ".concat(className, " ").concat(funcss), onClick: handleClick, customStyle: { cursor: 'pointer' } },
|
|
27
|
-
react_1.default.createElement(Div_1.default, { funcss: "funui_store_image-container
|
|
105
|
+
react_1.default.createElement(Div_1.default, { funcss: "funui_store_image-container round-edge", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, customStyle: { position: 'relative', overflow: 'hidden' } }, product.images && product.images.length > 0 ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
106
|
+
react_1.default.createElement("img", { src: product.images[0], alt: product.name, loading: "lazy", className: "funui_store_product-image", style: {
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
top: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
width: '100%',
|
|
111
|
+
height: '100%',
|
|
112
|
+
objectFit: 'cover',
|
|
113
|
+
opacity: currentImageIndex === 0 ? 1 : 0,
|
|
114
|
+
transition: 'opacity 0.3s ease-in-out',
|
|
115
|
+
zIndex: 1
|
|
116
|
+
} }),
|
|
117
|
+
product.images.slice(1).map(function (imageSrc, index) { return (react_1.default.createElement("img", { key: "preload-".concat(index + 1), src: imageSrc, alt: "".concat(product.name, " - View ").concat(index + 2), loading: "lazy", style: {
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
top: 0,
|
|
120
|
+
left: 0,
|
|
121
|
+
width: '100%',
|
|
122
|
+
height: '100%',
|
|
123
|
+
objectFit: 'cover',
|
|
124
|
+
opacity: currentImageIndex === index + 1 ? 1 : 0,
|
|
125
|
+
transition: 'opacity 0.3s ease-in-out',
|
|
126
|
+
zIndex: 2
|
|
127
|
+
} })); }),
|
|
128
|
+
(!product.images[0] || imagesLoaded[0] === false) && (react_1.default.createElement(Div_1.default, { funcss: "funui_store_no-image" },
|
|
129
|
+
react_1.default.createElement(Text_1.default, { text: "No Image", color: "text-muted", size: "sm" }))))) : (react_1.default.createElement(Div_1.default, { funcss: "funui_store_no-image" },
|
|
28
130
|
react_1.default.createElement(Text_1.default, { text: "No Image", color: "text-muted", size: "sm" })))),
|
|
29
131
|
react_1.default.createElement(Div_1.default, { funcss: "funui_store_product-info " },
|
|
30
132
|
product.category && (react_1.default.createElement(Text_1.default, { size: 'xs', opacity: 4, uppercase: true }, product.category)),
|
|
@@ -190,7 +190,7 @@ var ProductDetail = function (_a) {
|
|
|
190
190
|
react_1.default.createElement(Text_1.default, { size: 'xs', opacity: 4 },
|
|
191
191
|
product.stock,
|
|
192
192
|
" units available"))),
|
|
193
|
-
((product.colors && product.colors.length > 0) || (product.sizes && product.sizes.length > 0)) && (react_1.default.createElement(Flex_1.default, { width: '100%', gap: 1
|
|
193
|
+
((product.colors && product.colors.length > 0) || (product.sizes && product.sizes.length > 0)) && (react_1.default.createElement(Flex_1.default, { width: '100%', gap: 1 },
|
|
194
194
|
product.colors && product.colors.length > 0 && (react_1.default.createElement("div", { className: "col" },
|
|
195
195
|
react_1.default.createElement(Text_1.default, { size: "sm", weight: 500, funcss: "mb-1" },
|
|
196
196
|
"Color",
|
package/ui/vista/Vista.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type VistaProps = {
|
|
|
5
5
|
gradientOverlay?: boolean;
|
|
6
6
|
gradientColor?: string;
|
|
7
7
|
gradientOpacity?: number;
|
|
8
|
-
gradientDirection?: 'linear' | 'radial';
|
|
8
|
+
gradientDirection?: 'linear' | 'radial' | 'even';
|
|
9
9
|
gradientLinearDirection?: 'to right' | 'to left' | 'to top' | 'to bottom' | 'to top right' | 'to top left' | 'to bottom right' | 'to bottom left';
|
|
10
10
|
backgroundMedia?: 'none' | 'image' | 'video';
|
|
11
11
|
backgroundImage?: string;
|
package/ui/vista/Vista.js
CHANGED
|
@@ -98,7 +98,6 @@ var Vista = function (localProps) {
|
|
|
98
98
|
var layoutClass = [
|
|
99
99
|
final.layout || 'centered',
|
|
100
100
|
final.reverse ? 'reverse' : '',
|
|
101
|
-
"text-".concat(final.textAlign || 'left'),
|
|
102
101
|
]
|
|
103
102
|
.filter(Boolean)
|
|
104
103
|
.join(' ');
|
|
@@ -136,10 +135,11 @@ var Vista = function (localProps) {
|
|
|
136
135
|
var ContentComponent = (react_1.default.createElement("div", { ref: contentRef, className: "vista-content ".concat(final.layout === 'centered' ? "text-center" : "", " ").concat(final.contentWrapperClass || ''), style: {
|
|
137
136
|
position: 'relative',
|
|
138
137
|
zIndex: 2,
|
|
138
|
+
textAlign: final.textAlign || 'center', // Moved text-align here
|
|
139
139
|
} },
|
|
140
|
-
final.heading && (react_1.default.createElement(Text_1.default, { block: true, size: final.headingSize || "6xl", weight: final.headingWeight, color: final.headingColor || getDefaultTextColor(), funcss: final.headingClass }, final.heading)),
|
|
141
|
-
final.subheading && (react_1.default.createElement(Text_1.default, { block: true, size: final.subheadingSize || "lg", weight: final.subheadingWeight, color: final.subheadingColor || getDefaultTextColor(), funcss: "mt-2 ".concat(final.subheadingClass || '') }, final.subheading)),
|
|
142
|
-
final.content && (react_1.default.createElement(Text_1.default, { block: true, size: final.contentSize, weight: final.contentWeight, color: final.contentColor || getDefaultTextColor(), funcss: "mt-4 ".concat(final.contentClass || ''), article: true }, localProps.children || (typeof final.content === 'string' ? react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: final.content } }) : final.content))),
|
|
140
|
+
final.heading && (react_1.default.createElement(Text_1.default, { block: true, size: final.headingSize || "6xl", weight: final.headingWeight, color: final.headingColor || getDefaultTextColor(), funcss: final.headingClass, textAlign: final.textAlign || "center" }, final.heading)),
|
|
141
|
+
final.subheading && (react_1.default.createElement(Text_1.default, { block: true, size: final.subheadingSize || "lg", weight: final.subheadingWeight, color: final.subheadingColor || getDefaultTextColor(), funcss: "mt-2 ".concat(final.subheadingClass || ''), textAlign: final.textAlign || "center" }, final.subheading)),
|
|
142
|
+
final.content && (react_1.default.createElement(Text_1.default, { block: true, size: final.contentSize, weight: final.contentWeight, color: final.contentColor || getDefaultTextColor(), funcss: "mt-4 ".concat(final.contentClass || ''), article: true, textAlign: final.textAlign || "center" }, localProps.children || (typeof final.content === 'string' ? react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: final.content } }) : final.content))),
|
|
143
143
|
final.cta ? (react_1.default.createElement("div", { className: "mt-6 ".concat(final.ctaClass || '') }, final.cta)) : (react_1.default.createElement(CTAButtons, null))));
|
|
144
144
|
// Media Component (only shown when not in background mode)
|
|
145
145
|
var MediaComponent = function () {
|
|
@@ -202,29 +202,38 @@ var Vista = function (localProps) {
|
|
|
202
202
|
var gradientStyle = __assign({ position: 'absolute', width: final.gradientSize || "200px", height: final.gradientSize || "200px", background: final.gradientColors
|
|
203
203
|
? "radial-gradient(circle, ".concat(getColorValue(final.gradientColors.split(',')[0]), ", ").concat(getColorValue(final.gradientColors.split(',')[1]), ")")
|
|
204
204
|
: "radial-gradient(circle, ".concat(primaryColor, ", ").concat(secondaryColor, ")"), opacity: final.opacity || 0.7, filter: "blur(".concat(final.blurry || 4, "rem)"), pointerEvents: 'none', zIndex: 0 }, positionStyles[final.gradientPosition || 'center']);
|
|
205
|
-
// Get gradient overlay style
|
|
205
|
+
// Get gradient overlay style - UPDATED with 'even' option
|
|
206
206
|
var getGradientOverlayStyle = function () {
|
|
207
207
|
if (!final.gradientOverlay)
|
|
208
208
|
return {};
|
|
209
209
|
var gradientColor = getGradientColorValue();
|
|
210
210
|
var opacity = final.gradientOpacity || 0.7;
|
|
211
|
+
// When 'even' is selected, use solid color (same color from 0% to 100%)
|
|
212
|
+
if (final.gradientDirection === 'even') {
|
|
213
|
+
return {
|
|
214
|
+
background: gradientColor,
|
|
215
|
+
opacity: opacity,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
211
218
|
if (final.gradientDirection === 'radial') {
|
|
212
219
|
return {
|
|
213
220
|
background: "radial-gradient(circle at center, ".concat(gradientColor, " 0%, transparent 100%)"),
|
|
214
221
|
opacity: opacity,
|
|
215
222
|
};
|
|
216
223
|
}
|
|
224
|
+
// Default to linear gradient
|
|
217
225
|
var direction = final.gradientLinearDirection || 'to right';
|
|
226
|
+
// Correct gradient stops for different directions
|
|
218
227
|
var gradientStops = '';
|
|
219
228
|
switch (direction) {
|
|
220
229
|
case 'to right':
|
|
221
|
-
gradientStops = "".concat(gradientColor, " 0%,transparent 100%");
|
|
230
|
+
gradientStops = "".concat(gradientColor, " 0%, transparent 100%");
|
|
222
231
|
break;
|
|
223
232
|
case 'to left':
|
|
224
233
|
gradientStops = "transparent 0%, ".concat(gradientColor, " 100%");
|
|
225
234
|
break;
|
|
226
235
|
case 'to bottom':
|
|
227
|
-
gradientStops = "".concat(gradientColor, " 0%,transparent 100%");
|
|
236
|
+
gradientStops = "".concat(gradientColor, " 0%, transparent 100%");
|
|
228
237
|
break;
|
|
229
238
|
case 'to top':
|
|
230
239
|
gradientStops = "transparent 0%, ".concat(gradientColor, " 100%");
|
|
@@ -233,16 +242,16 @@ var Vista = function (localProps) {
|
|
|
233
242
|
gradientStops = "transparent 0%, ".concat(gradientColor, " 100%");
|
|
234
243
|
break;
|
|
235
244
|
case 'to top left':
|
|
236
|
-
gradientStops = "
|
|
245
|
+
gradientStops = "".concat(gradientColor, " 0%, transparent 100%");
|
|
237
246
|
break;
|
|
238
247
|
case 'to bottom right':
|
|
239
248
|
gradientStops = "".concat(gradientColor, " 0%, transparent 100%");
|
|
240
249
|
break;
|
|
241
250
|
case 'to bottom left':
|
|
242
|
-
gradientStops = "".concat(gradientColor, "
|
|
251
|
+
gradientStops = "transparent 0%, ".concat(gradientColor, " 100%");
|
|
243
252
|
break;
|
|
244
253
|
default:
|
|
245
|
-
gradientStops = "".concat(gradientColor, " 0%,transparent 100%");
|
|
254
|
+
gradientStops = "".concat(gradientColor, " 0%, transparent 100%");
|
|
246
255
|
}
|
|
247
256
|
return {
|
|
248
257
|
background: "linear-gradient(".concat(direction, ", ").concat(gradientStops, ")"),
|
|
@@ -360,7 +369,6 @@ var Vista = function (localProps) {
|
|
|
360
369
|
react_1.default.createElement("div", { style: {
|
|
361
370
|
maxWidth: final.contentWrapperMaxWidth || '700px',
|
|
362
371
|
width: '100%',
|
|
363
|
-
textAlign: final.textAlign || 'left',
|
|
364
372
|
} }, ContentComponent))) : (
|
|
365
373
|
// PLAIN MODE: Regular layout with mediaLeft/mediaRight positioning
|
|
366
374
|
react_1.default.createElement("div", { className: "vista-container ".concat(final.containerClass || ''), style: {
|
|
@@ -382,7 +390,6 @@ var Vista = function (localProps) {
|
|
|
382
390
|
react_1.default.createElement("div", { style: {
|
|
383
391
|
maxWidth: final.contentWrapperMaxWidth || '100%',
|
|
384
392
|
width: '100%',
|
|
385
|
-
textAlign: final.textAlign || 'left',
|
|
386
393
|
} }, ContentComponent),
|
|
387
394
|
(final.mediaPosition === 'bottom' || !final.mediaPosition) && react_1.default.createElement(MediaComponent, null))) : final.reverse ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
388
395
|
react_1.default.createElement("div", { style: { flex: 1 } },
|
|
@@ -395,3 +402,750 @@ var Vista = function (localProps) {
|
|
|
395
402
|
react_1.default.createElement(MediaComponent, null)))))))));
|
|
396
403
|
};
|
|
397
404
|
exports.default = Vista;
|
|
405
|
+
// 'use client';
|
|
406
|
+
// import React, { useRef } from 'react';
|
|
407
|
+
// import { getCssVariableValue } from '../../utils/getCssVariable';
|
|
408
|
+
// import { useComponentConfiguration } from '../../utils/componentUtils';
|
|
409
|
+
// import Text from '../text/Text';
|
|
410
|
+
// import Button from '../button/Button';
|
|
411
|
+
// import Flex from '../flex/Flex';
|
|
412
|
+
// import Video from '../video/Video';
|
|
413
|
+
// type VistaProps = {
|
|
414
|
+
// // Main component ID
|
|
415
|
+
// id?: string;
|
|
416
|
+
// // Background Mode Props
|
|
417
|
+
// backgroundMode?: 'plain' | 'background';
|
|
418
|
+
// gradientOverlay?: boolean;
|
|
419
|
+
// gradientColor?: string;
|
|
420
|
+
// gradientOpacity?: number;
|
|
421
|
+
// gradientDirection?: 'linear' | 'radial';
|
|
422
|
+
// gradientLinearDirection?: 'to right' | 'to left' | 'to top' | 'to bottom' | 'to top right' | 'to top left' | 'to bottom right' | 'to bottom left';
|
|
423
|
+
// // Background Media Props
|
|
424
|
+
// backgroundMedia?: 'none' | 'image' | 'video';
|
|
425
|
+
// backgroundImage?: string;
|
|
426
|
+
// backgroundVideo?: string;
|
|
427
|
+
// backgroundImageSize?: 'cover' | 'contain' | 'auto';
|
|
428
|
+
// backgroundImagePosition?: 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
429
|
+
// backgroundImageRepeat?: boolean;
|
|
430
|
+
// videoAutoplay?: boolean;
|
|
431
|
+
// videoLoop?: boolean;
|
|
432
|
+
// videoMuted?: boolean;
|
|
433
|
+
// videoPoster?: string;
|
|
434
|
+
// videoControls?: boolean;
|
|
435
|
+
// layout?: 'centered' | 'mediaLeft' | 'mediaRight' | 'stacked';
|
|
436
|
+
// pattern?: 'grid' | 'dots' | 'diagonal' | 'checkerboard' | 'horizontal' | 'vertical';
|
|
437
|
+
// patternOpacity?: number;
|
|
438
|
+
// reverse?: boolean;
|
|
439
|
+
// bg?: string;
|
|
440
|
+
// padding?: string;
|
|
441
|
+
// textAlign?: 'left' | 'center' | 'right';
|
|
442
|
+
// contentWrapperMaxWidth?: string;
|
|
443
|
+
// // Flex positioning props for background mode
|
|
444
|
+
// contentJustify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
445
|
+
// contentAlign?: 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
|
|
446
|
+
// mediaPosition?: 'top' | 'bottom';
|
|
447
|
+
// funcss?: string;
|
|
448
|
+
// blurry?: number;
|
|
449
|
+
// opacity?: number;
|
|
450
|
+
// // Content Props
|
|
451
|
+
// heading?: React.ReactNode;
|
|
452
|
+
// headingSize?: string;
|
|
453
|
+
// headingWeight?: number;
|
|
454
|
+
// headingColor?: string;
|
|
455
|
+
// headingClass?: string;
|
|
456
|
+
// subheading?: React.ReactNode;
|
|
457
|
+
// subheadingSize?: string;
|
|
458
|
+
// subheadingWeight?: number;
|
|
459
|
+
// subheadingColor?: string;
|
|
460
|
+
// subheadingClass?: string;
|
|
461
|
+
// content?: React.ReactNode;
|
|
462
|
+
// contentSize?: string;
|
|
463
|
+
// contentWeight?: number;
|
|
464
|
+
// contentColor?: string;
|
|
465
|
+
// contentClass?: string;
|
|
466
|
+
// media?: React.ReactNode;
|
|
467
|
+
// mediaUrl?: string;
|
|
468
|
+
// mediaAlt?: string;
|
|
469
|
+
// mediaClass?: string;
|
|
470
|
+
// mediaSize?: string;
|
|
471
|
+
// cta?: React.ReactNode;
|
|
472
|
+
// ctaClass?: string;
|
|
473
|
+
// sectionClass?: string;
|
|
474
|
+
// containerClass?: string;
|
|
475
|
+
// gap?: string;
|
|
476
|
+
// contentWrapperClass?: string;
|
|
477
|
+
// mediaWrapperClass?: string;
|
|
478
|
+
// children?: React.ReactNode;
|
|
479
|
+
// // Gradient Blob Props
|
|
480
|
+
// showGradient?: boolean;
|
|
481
|
+
// gradientPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
482
|
+
// gradientSize?: string;
|
|
483
|
+
// gradientColors?: string;
|
|
484
|
+
// fade?: boolean;
|
|
485
|
+
// fadeColor?: string;
|
|
486
|
+
// fadeDirection?: 'top' | 'bottom' | 'left' | 'right';
|
|
487
|
+
// fadeRadial?: boolean;
|
|
488
|
+
// variant?: string;
|
|
489
|
+
// // Responsive props
|
|
490
|
+
// mediaCss?: string;
|
|
491
|
+
// // CTA Button Props
|
|
492
|
+
// showPrimaryCTA?: boolean;
|
|
493
|
+
// showSecondaryCTA?: boolean;
|
|
494
|
+
// showAccentCTA?: boolean;
|
|
495
|
+
// primaryButtonOutlined?: boolean;
|
|
496
|
+
// secondaryButtonOutlined?: boolean;
|
|
497
|
+
// accentButtonOutlined?: boolean;
|
|
498
|
+
// ctaPrimaryUrl?: string;
|
|
499
|
+
// ctaSecondaryUrl?: string;
|
|
500
|
+
// ctaAccentUrl?: string;
|
|
501
|
+
// ctaPrimaryText?: string;
|
|
502
|
+
// ctaSecondaryText?: string;
|
|
503
|
+
// ctaAccentText?: string;
|
|
504
|
+
// // Primary CTA Button Props
|
|
505
|
+
// ctaPrimaryRounded?: boolean;
|
|
506
|
+
// ctaPrimaryFlat?: boolean;
|
|
507
|
+
// ctaPrimaryPrefix?: string;
|
|
508
|
+
// ctaPrimarySuffix?: string;
|
|
509
|
+
// primaryIconSize?: number;
|
|
510
|
+
// primaryButtonFuncss?: string;
|
|
511
|
+
// primaryButtonSmall?: boolean;
|
|
512
|
+
// primaryButtonBig?: boolean;
|
|
513
|
+
// // Secondary CTA Button Props
|
|
514
|
+
// ctaSecondaryRounded?: boolean;
|
|
515
|
+
// ctaSecondaryFlat?: boolean;
|
|
516
|
+
// ctaSecondaryPrefix?: string;
|
|
517
|
+
// ctaSecondarySuffix?: string;
|
|
518
|
+
// secondaryIconSize?: number;
|
|
519
|
+
// secondaryButtonFuncss?: string;
|
|
520
|
+
// secondaryButtonSmall?: boolean;
|
|
521
|
+
// secondaryButtonBig?: boolean;
|
|
522
|
+
// // Accent CTA Button Props
|
|
523
|
+
// ctaAccentRounded?: boolean;
|
|
524
|
+
// ctaAccentFlat?: boolean;
|
|
525
|
+
// ctaAccentPrefix?: string;
|
|
526
|
+
// ctaAccentSuffix?: string;
|
|
527
|
+
// accentIconSize?: number;
|
|
528
|
+
// accentButtonFuncss?: string;
|
|
529
|
+
// accentButtonSmall?: boolean;
|
|
530
|
+
// accentButtonBig?: boolean;
|
|
531
|
+
// ctaGap?: number;
|
|
532
|
+
// ctaFlexJustify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
|
|
533
|
+
// // Media Type Props
|
|
534
|
+
// mediaType?: 'image' | 'video' | 'iframe' | 'custom';
|
|
535
|
+
// videoUrl?: string;
|
|
536
|
+
// iframeUrl?: string;
|
|
537
|
+
// iframeSize?: string;
|
|
538
|
+
// customMedia?: React.ReactNode;
|
|
539
|
+
// // Media Effects
|
|
540
|
+
// mediaFilter?: 'grayscale' | 'sepia' | 'blur' | 'brightness' | 'contrast' | 'none';
|
|
541
|
+
// mediaFilterValue?: number;
|
|
542
|
+
// };
|
|
543
|
+
// const Vista: React.FC<VistaProps> = (localProps) => {
|
|
544
|
+
// const { mergeWithLocal } = useComponentConfiguration('Vista', localProps.variant);
|
|
545
|
+
// const { props: mergedProps } = mergeWithLocal(localProps);
|
|
546
|
+
// const final = mergedProps;
|
|
547
|
+
// const sectionRef = useRef<HTMLDivElement>(null);
|
|
548
|
+
// const contentRef = useRef<HTMLDivElement>(null);
|
|
549
|
+
// // Helper function to get color from CSS variable name
|
|
550
|
+
// const getColorValue = (colorName?: string, fallback: string = '#000000'): string => {
|
|
551
|
+
// if (!colorName) return fallback;
|
|
552
|
+
// return getCssVariableValue(colorName) || fallback;
|
|
553
|
+
// };
|
|
554
|
+
// // Check if there's a background image/video
|
|
555
|
+
// const hasBackgroundMedia = () => {
|
|
556
|
+
// return final.backgroundMode === 'background' &&
|
|
557
|
+
// final.backgroundMedia !== 'none' &&
|
|
558
|
+
// (final.backgroundImage || final.backgroundVideo);
|
|
559
|
+
// };
|
|
560
|
+
// // Get default text colors based on background
|
|
561
|
+
// const getDefaultTextColor = () => {
|
|
562
|
+
// if (hasBackgroundMedia() || final.bg) {
|
|
563
|
+
// return '';
|
|
564
|
+
// }
|
|
565
|
+
// return '';
|
|
566
|
+
// };
|
|
567
|
+
// // Get gradient color value
|
|
568
|
+
// const getGradientColorValue = () => {
|
|
569
|
+
// return getColorValue(final.gradientColor, 'primary');
|
|
570
|
+
// };
|
|
571
|
+
// // Get media size
|
|
572
|
+
// const getMediaSize = () => {
|
|
573
|
+
// if (final.mediaSize) {
|
|
574
|
+
// return final.mediaSize;
|
|
575
|
+
// }
|
|
576
|
+
// if (final.mediaType === 'iframe' && final.iframeSize) {
|
|
577
|
+
// return final.iframeSize;
|
|
578
|
+
// }
|
|
579
|
+
// return undefined;
|
|
580
|
+
// };
|
|
581
|
+
// const layoutClass = [
|
|
582
|
+
// final.layout || 'centered',
|
|
583
|
+
// final.reverse ? 'reverse' : '',
|
|
584
|
+
// `text-${final.textAlign || 'left'}`,
|
|
585
|
+
// ]
|
|
586
|
+
// .filter(Boolean)
|
|
587
|
+
// .join(' ');
|
|
588
|
+
// // Filter styles helper
|
|
589
|
+
// const getFilterStyle = (
|
|
590
|
+
// filter?: 'grayscale' | 'sepia' | 'blur' | 'brightness' | 'contrast' | 'none',
|
|
591
|
+
// filterValue?: number
|
|
592
|
+
// ) => {
|
|
593
|
+
// if (!filter || filter === 'none') return '';
|
|
594
|
+
// const value = filterValue || 1;
|
|
595
|
+
// switch (filter) {
|
|
596
|
+
// case 'grayscale':
|
|
597
|
+
// return `grayscale(${value})`;
|
|
598
|
+
// case 'sepia':
|
|
599
|
+
// return `sepia(${value})`;
|
|
600
|
+
// case 'blur':
|
|
601
|
+
// return `blur(${value}px)`;
|
|
602
|
+
// case 'brightness':
|
|
603
|
+
// return `brightness(${value})`;
|
|
604
|
+
// case 'contrast':
|
|
605
|
+
// return `contrast(${value})`;
|
|
606
|
+
// default:
|
|
607
|
+
// return '';
|
|
608
|
+
// }
|
|
609
|
+
// };
|
|
610
|
+
// // CTA Buttons Component
|
|
611
|
+
// const CTAButtons = () => {
|
|
612
|
+
// const hasCTAs = final.showPrimaryCTA || final.showSecondaryCTA || final.showAccentCTA;
|
|
613
|
+
// if (!hasCTAs) return null;
|
|
614
|
+
// return (
|
|
615
|
+
// <Flex
|
|
616
|
+
// gap={final.ctaGap}
|
|
617
|
+
// justify={final.ctaFlexJustify}
|
|
618
|
+
// className={`mt-6 ${final.ctaClass || ''}`}
|
|
619
|
+
// wrap="wrap"
|
|
620
|
+
// width='100%'
|
|
621
|
+
// >
|
|
622
|
+
// {final.showPrimaryCTA && (
|
|
623
|
+
// <Button
|
|
624
|
+
// bg={"primary"}
|
|
625
|
+
// outlined={final.primaryButtonOutlined}
|
|
626
|
+
// onClick={() => final.ctaPrimaryUrl && (window.location.href = final.ctaPrimaryUrl)}
|
|
627
|
+
// rounded={final.ctaPrimaryRounded}
|
|
628
|
+
// flat={final.ctaPrimaryFlat}
|
|
629
|
+
// stringPrefix={final.ctaPrimaryPrefix}
|
|
630
|
+
// stringSuffix={final.ctaPrimarySuffix}
|
|
631
|
+
// iconSize={final.primaryIconSize}
|
|
632
|
+
// funcss={final.primaryButtonFuncss}
|
|
633
|
+
// small={final.primaryButtonSmall}
|
|
634
|
+
// big={final.primaryButtonBig}
|
|
635
|
+
// >
|
|
636
|
+
// {final.ctaPrimaryText}
|
|
637
|
+
// </Button>
|
|
638
|
+
// )}
|
|
639
|
+
// {final.showSecondaryCTA && (
|
|
640
|
+
// <Button
|
|
641
|
+
// bg={"secondary"}
|
|
642
|
+
// outlined={final.secondaryButtonOutlined}
|
|
643
|
+
// onClick={() => final.ctaSecondaryUrl && (window.location.href = final.ctaSecondaryUrl)}
|
|
644
|
+
// rounded={final.ctaSecondaryRounded}
|
|
645
|
+
// flat={final.ctaSecondaryFlat}
|
|
646
|
+
// stringPrefix={final.ctaSecondaryPrefix}
|
|
647
|
+
// stringSuffix={final.ctaSecondarySuffix}
|
|
648
|
+
// iconSize={final.secondaryIconSize}
|
|
649
|
+
// funcss={final.secondaryButtonFuncss}
|
|
650
|
+
// small={final.secondaryButtonSmall}
|
|
651
|
+
// big={final.secondaryButtonBig}
|
|
652
|
+
// >
|
|
653
|
+
// {final.ctaSecondaryText}
|
|
654
|
+
// </Button>
|
|
655
|
+
// )}
|
|
656
|
+
// {final.showAccentCTA && (
|
|
657
|
+
// <Button
|
|
658
|
+
// bg={"accent"}
|
|
659
|
+
// outlined={final.accentButtonOutlined}
|
|
660
|
+
// onClick={() => final.ctaAccentUrl && (window.location.href = final.ctaAccentUrl)}
|
|
661
|
+
// rounded={final.ctaAccentRounded}
|
|
662
|
+
// flat={final.ctaAccentFlat}
|
|
663
|
+
// stringPrefix={final.ctaAccentPrefix}
|
|
664
|
+
// stringSuffix={final.ctaAccentSuffix}
|
|
665
|
+
// iconSize={final.accentIconSize}
|
|
666
|
+
// funcss={final.accentButtonFuncss}
|
|
667
|
+
// small={final.accentButtonSmall}
|
|
668
|
+
// big={final.accentButtonBig}
|
|
669
|
+
// >
|
|
670
|
+
// {final.ctaAccentText}
|
|
671
|
+
// </Button>
|
|
672
|
+
// )}
|
|
673
|
+
// </Flex>
|
|
674
|
+
// );
|
|
675
|
+
// };
|
|
676
|
+
// // Content Component
|
|
677
|
+
// const ContentComponent = (
|
|
678
|
+
// <div
|
|
679
|
+
// ref={contentRef}
|
|
680
|
+
// className={`vista-content ${final.layout === 'centered' ? "text-center" : ""} ${final.contentWrapperClass || ''}`}
|
|
681
|
+
// style={{
|
|
682
|
+
// position: 'relative',
|
|
683
|
+
// zIndex: 2,
|
|
684
|
+
// }}
|
|
685
|
+
// >
|
|
686
|
+
// {final.heading && (
|
|
687
|
+
// <Text
|
|
688
|
+
// block
|
|
689
|
+
// size={final.headingSize || "6xl"}
|
|
690
|
+
// weight={final.headingWeight}
|
|
691
|
+
// color={final.headingColor || getDefaultTextColor()}
|
|
692
|
+
// funcss={final.headingClass}
|
|
693
|
+
// >
|
|
694
|
+
// {final.heading}
|
|
695
|
+
// </Text>
|
|
696
|
+
// )}
|
|
697
|
+
// {final.subheading && (
|
|
698
|
+
// <Text
|
|
699
|
+
// block
|
|
700
|
+
// size={final.subheadingSize || "lg"}
|
|
701
|
+
// weight={final.subheadingWeight}
|
|
702
|
+
// color={final.subheadingColor || getDefaultTextColor()}
|
|
703
|
+
// funcss={`mt-2 ${final.subheadingClass || ''}`}
|
|
704
|
+
// >
|
|
705
|
+
// {final.subheading}
|
|
706
|
+
// </Text>
|
|
707
|
+
// )}
|
|
708
|
+
// {final.content && (
|
|
709
|
+
// <Text
|
|
710
|
+
// block
|
|
711
|
+
// size={final.contentSize}
|
|
712
|
+
// weight={final.contentWeight}
|
|
713
|
+
// color={final.contentColor || getDefaultTextColor()}
|
|
714
|
+
// funcss={`mt-4 ${final.contentClass || ''}`}
|
|
715
|
+
// article
|
|
716
|
+
// >
|
|
717
|
+
// {localProps.children || (typeof final.content === 'string' ? <div dangerouslySetInnerHTML={{ __html: final.content }} /> : final.content)}
|
|
718
|
+
// </Text>
|
|
719
|
+
// )}
|
|
720
|
+
// {final.cta ? (
|
|
721
|
+
// <div className={`mt-6 ${final.ctaClass || ''}`}>
|
|
722
|
+
// {final.cta}
|
|
723
|
+
// </div>
|
|
724
|
+
// ) : (
|
|
725
|
+
// <CTAButtons />
|
|
726
|
+
// )}
|
|
727
|
+
// </div>
|
|
728
|
+
// );
|
|
729
|
+
// // Media Component (only shown when not in background mode)
|
|
730
|
+
// const MediaComponent = () => {
|
|
731
|
+
// if (final.backgroundMode === 'background') return null;
|
|
732
|
+
// const mediaType = final.mediaType || 'image';
|
|
733
|
+
// const hasMedia = final.media || final.mediaUrl || final.videoUrl || final.iframeUrl || final.customMedia;
|
|
734
|
+
// if (!hasMedia) return null;
|
|
735
|
+
// const mediaSize = getMediaSize();
|
|
736
|
+
// const mediaWrapperStyle: React.CSSProperties = {
|
|
737
|
+
// position: 'relative',
|
|
738
|
+
// width: '100%',
|
|
739
|
+
// maxWidth: mediaSize || '100%',
|
|
740
|
+
// margin: '0 auto',
|
|
741
|
+
// };
|
|
742
|
+
// const mediaStyle: React.CSSProperties = {
|
|
743
|
+
// objectFit: 'cover',
|
|
744
|
+
// maxWidth: mediaSize,
|
|
745
|
+
// width: '100%',
|
|
746
|
+
// borderRadius: 'inherit',
|
|
747
|
+
// filter: getFilterStyle(final.mediaFilter, final.mediaFilterValue),
|
|
748
|
+
// };
|
|
749
|
+
// return (
|
|
750
|
+
// <div
|
|
751
|
+
// className={`vista-media ${final.mediaCss || ''} ${final.mediaWrapperClass || ''}`}
|
|
752
|
+
// style={mediaWrapperStyle}
|
|
753
|
+
// >
|
|
754
|
+
// {/* Custom Media */}
|
|
755
|
+
// {mediaType === 'custom' && final.customMedia && (
|
|
756
|
+
// <div style={{ position: 'relative', width: '100%' }}>
|
|
757
|
+
// {final.customMedia}
|
|
758
|
+
// </div>
|
|
759
|
+
// )}
|
|
760
|
+
// {/* Video */}
|
|
761
|
+
// {mediaType === 'video' && final.videoUrl && (
|
|
762
|
+
// <div style={{ position: 'relative', maxWidth: mediaSize, width: '100%', aspectRatio: '16/9', margin: '0 auto'}}>
|
|
763
|
+
// <Video
|
|
764
|
+
// src={final.videoUrl}
|
|
765
|
+
// autoPlay={final.videoAutoplay}
|
|
766
|
+
// loop={final.videoLoop}
|
|
767
|
+
// muted={final.videoMuted}
|
|
768
|
+
// poster={final.videoPoster}
|
|
769
|
+
// funcss={final.mediaCss || ''}
|
|
770
|
+
// style={{
|
|
771
|
+
// filter: getFilterStyle(final.mediaFilter, final.mediaFilterValue),
|
|
772
|
+
// }}
|
|
773
|
+
// />
|
|
774
|
+
// </div>
|
|
775
|
+
// )}
|
|
776
|
+
// {/* iFrame */}
|
|
777
|
+
// {mediaType === 'iframe' && final.iframeUrl && (
|
|
778
|
+
// <div
|
|
779
|
+
// className="vista-iframe-wrapper"
|
|
780
|
+
// style={{
|
|
781
|
+
// position: 'relative',
|
|
782
|
+
// width: '100%',
|
|
783
|
+
// maxWidth: mediaSize || '100%',
|
|
784
|
+
// margin: '0 auto',
|
|
785
|
+
// height: 'fit-content',
|
|
786
|
+
// }}
|
|
787
|
+
// >
|
|
788
|
+
// <iframe
|
|
789
|
+
// src={final.iframeUrl}
|
|
790
|
+
// className={`vista-iframe ${final.mediaCss || ''}`}
|
|
791
|
+
// style={{
|
|
792
|
+
// width: '100%',
|
|
793
|
+
// height: 'auto',
|
|
794
|
+
// aspectRatio: '16/9',
|
|
795
|
+
// border: 'none',
|
|
796
|
+
// display: 'block',
|
|
797
|
+
// filter: getFilterStyle(final.mediaFilter, final.mediaFilterValue),
|
|
798
|
+
// }}
|
|
799
|
+
// allowFullScreen
|
|
800
|
+
// allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
801
|
+
// title="Vista media content"
|
|
802
|
+
// />
|
|
803
|
+
// </div>
|
|
804
|
+
// )}
|
|
805
|
+
// {/* Image */}
|
|
806
|
+
// {mediaType === 'image' && (final.media || final.mediaUrl) && (
|
|
807
|
+
// <div style={{ position: 'relative', width: '100%' }}>
|
|
808
|
+
// {final.media ? (
|
|
809
|
+
// <div style={{ width: '100%', maxWidth: mediaSize, margin: '0 auto' }}>
|
|
810
|
+
// {final.media}
|
|
811
|
+
// </div>
|
|
812
|
+
// ) : (
|
|
813
|
+
// <img
|
|
814
|
+
// src={final.mediaUrl}
|
|
815
|
+
// alt={final.mediaAlt || 'Vista media'}
|
|
816
|
+
// className={final.mediaCss || ''}
|
|
817
|
+
// style={mediaStyle}
|
|
818
|
+
// loading="lazy"
|
|
819
|
+
// />
|
|
820
|
+
// )}
|
|
821
|
+
// </div>
|
|
822
|
+
// )}
|
|
823
|
+
// </div>
|
|
824
|
+
// );
|
|
825
|
+
// };
|
|
826
|
+
// const isCentered = final.layout === 'centered';
|
|
827
|
+
// const isStacked = final.layout === 'stacked';
|
|
828
|
+
// const isMediaLeft = final.layout === 'mediaLeft';
|
|
829
|
+
// const isMediaRight = final.layout === 'mediaRight';
|
|
830
|
+
// const positionStyles: Record<string, React.CSSProperties> = {
|
|
831
|
+
// 'top-left': { top: '-100px', left: '-100px' },
|
|
832
|
+
// 'top-right': { top: '-100px', right: '-100px' },
|
|
833
|
+
// 'bottom-left': { bottom: '-100px', left: '-100px' },
|
|
834
|
+
// 'bottom-right': { bottom: '-100px', right: '-100px' },
|
|
835
|
+
// center: { top: '50%', left: '50%', transform: 'translate(-50%, -50%)' },
|
|
836
|
+
// };
|
|
837
|
+
// const primaryColor = getColorValue('primary');
|
|
838
|
+
// const secondaryColor = getColorValue('secondary');
|
|
839
|
+
// const gradientStyle: React.CSSProperties = {
|
|
840
|
+
// position: 'absolute',
|
|
841
|
+
// width: final.gradientSize || "200px",
|
|
842
|
+
// height: final.gradientSize || "200px",
|
|
843
|
+
// background: final.gradientColors
|
|
844
|
+
// ? `radial-gradient(circle, ${getColorValue(final.gradientColors.split(',')[0])}, ${getColorValue(final.gradientColors.split(',')[1])})`
|
|
845
|
+
// : `radial-gradient(circle, ${primaryColor}, ${secondaryColor})`,
|
|
846
|
+
// opacity: final.opacity || 0.7,
|
|
847
|
+
// filter: `blur(${final.blurry || 4}rem)`,
|
|
848
|
+
// pointerEvents: 'none',
|
|
849
|
+
// zIndex: 0,
|
|
850
|
+
// ...positionStyles[final.gradientPosition || 'center'],
|
|
851
|
+
// };
|
|
852
|
+
// // Get gradient overlay style
|
|
853
|
+
// const getGradientOverlayStyle = () => {
|
|
854
|
+
// if (!final.gradientOverlay) return {};
|
|
855
|
+
// const gradientColor = getGradientColorValue();
|
|
856
|
+
// const opacity = final.gradientOpacity || 0.7;
|
|
857
|
+
// if (final.gradientDirection === 'radial') {
|
|
858
|
+
// return {
|
|
859
|
+
// background: `radial-gradient(circle at center, ${gradientColor} 0%, transparent 100%)`,
|
|
860
|
+
// opacity: opacity,
|
|
861
|
+
// };
|
|
862
|
+
// }
|
|
863
|
+
// const direction = final.gradientLinearDirection || 'to right';
|
|
864
|
+
// let gradientStops = '';
|
|
865
|
+
// switch (direction) {
|
|
866
|
+
// case 'to right':
|
|
867
|
+
// gradientStops = `${gradientColor} 0%,transparent 100%`;
|
|
868
|
+
// break;
|
|
869
|
+
// case 'to left':
|
|
870
|
+
// gradientStops = `transparent 0%, ${gradientColor} 100%`;
|
|
871
|
+
// break;
|
|
872
|
+
// case 'to bottom':
|
|
873
|
+
// gradientStops = `${gradientColor} 0%,transparent 100%`;
|
|
874
|
+
// break;
|
|
875
|
+
// case 'to top':
|
|
876
|
+
// gradientStops = `transparent 0%, ${gradientColor} 100%`;
|
|
877
|
+
// break;
|
|
878
|
+
// case 'to top right':
|
|
879
|
+
// gradientStops = `transparent 0%, ${gradientColor} 100%`;
|
|
880
|
+
// break;
|
|
881
|
+
// case 'to top left':
|
|
882
|
+
// gradientStops = `transparent 0%, ${gradientColor} 100%`;
|
|
883
|
+
// break;
|
|
884
|
+
// case 'to bottom right':
|
|
885
|
+
// gradientStops = `${gradientColor} 0%, transparent 100%`;
|
|
886
|
+
// break;
|
|
887
|
+
// case 'to bottom left':
|
|
888
|
+
// gradientStops = `${gradientColor} 0%, transparent 100%`;
|
|
889
|
+
// break;
|
|
890
|
+
// default:
|
|
891
|
+
// gradientStops = `${gradientColor} 0%,transparent 100%`;
|
|
892
|
+
// }
|
|
893
|
+
// return {
|
|
894
|
+
// background: `linear-gradient(${direction}, ${gradientStops})`,
|
|
895
|
+
// opacity: opacity,
|
|
896
|
+
// };
|
|
897
|
+
// };
|
|
898
|
+
// // Get fade color
|
|
899
|
+
// const getFadeColorValue = (): string => {
|
|
900
|
+
// if (!final.fade) return '';
|
|
901
|
+
// return getColorValue(final.fadeColor, 'page-bg') || '#ffffff';
|
|
902
|
+
// };
|
|
903
|
+
// // Get fade style
|
|
904
|
+
// const getFadeStyle = () => {
|
|
905
|
+
// const fadeColor = getFadeColorValue();
|
|
906
|
+
// if (!fadeColor) return {};
|
|
907
|
+
// if (final.fadeRadial) {
|
|
908
|
+
// return {
|
|
909
|
+
// background: `radial-gradient(circle, transparent 30%, ${fadeColor} 100%)`,
|
|
910
|
+
// };
|
|
911
|
+
// }
|
|
912
|
+
// const direction = final.fadeDirection || 'bottom';
|
|
913
|
+
// const toDirectionMap: Record<string, string> = {
|
|
914
|
+
// top: 'to top',
|
|
915
|
+
// bottom: 'to bottom',
|
|
916
|
+
// left: 'to left',
|
|
917
|
+
// right: 'to right'
|
|
918
|
+
// };
|
|
919
|
+
// return {
|
|
920
|
+
// background: `linear-gradient(${toDirectionMap[direction]}, transparent 0%, ${fadeColor} 100%)`,
|
|
921
|
+
// };
|
|
922
|
+
// };
|
|
923
|
+
// return (
|
|
924
|
+
// <div
|
|
925
|
+
// ref={sectionRef}
|
|
926
|
+
// id={final.id}
|
|
927
|
+
// className={`vista
|
|
928
|
+
// ${final.backgroundMode === 'background' ? 'vista-background-mode' : ''}
|
|
929
|
+
// ${final.pattern === 'grid' ? 'grid-bg' :
|
|
930
|
+
// final.pattern === 'dots' ? 'bg-pattern-dots' :
|
|
931
|
+
// final.pattern === 'diagonal' ? 'bg-pattern-diagonal' :
|
|
932
|
+
// final.pattern === 'checkerboard' ? 'bg-pattern-checkerboard' :
|
|
933
|
+
// final.pattern === 'horizontal' ? 'bg-pattern-horizontal' :
|
|
934
|
+
// final.pattern === 'vertical' ? 'bg-pattern-vertical' : ''}
|
|
935
|
+
// ${final.bg ? `bg-${final.bg}` : ''} ${final.padding ? `p-${final.padding}` : ''} ${layoutClass} ${final.sectionClass || ''} ${final.funcss || ''}`}
|
|
936
|
+
// style={{
|
|
937
|
+
// position: 'relative',
|
|
938
|
+
// overflow: 'hidden',
|
|
939
|
+
// minHeight: 'auto',
|
|
940
|
+
// height: 'fit-content',
|
|
941
|
+
// display: 'flex',
|
|
942
|
+
// flexDirection: 'column',
|
|
943
|
+
// alignItems: 'center',
|
|
944
|
+
// justifyContent: 'center',
|
|
945
|
+
// backgroundImage: final.pattern && final.backgroundMode !== 'background' ?
|
|
946
|
+
// (final.pattern === 'grid' ? `linear-gradient(to right, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px),
|
|
947
|
+
// linear-gradient(to bottom, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px)` :
|
|
948
|
+
// final.pattern === 'dots' ? `radial-gradient(rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px)` :
|
|
949
|
+
// final.pattern === 'diagonal' ? `repeating-linear-gradient(45deg, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}), rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px, transparent 10px)` :
|
|
950
|
+
// final.pattern === 'checkerboard' ? `linear-gradient(45deg, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 25%, transparent 25%), linear-gradient(-45deg, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 75%), linear-gradient(-45deg, transparent 75%, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 75%)` :
|
|
951
|
+
// final.pattern === 'horizontal' ? `linear-gradient(to bottom, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px)` :
|
|
952
|
+
// final.pattern === 'vertical' ? `linear-gradient(to right, rgba(var(--borderRgb), ${final.patternOpacity || 0.1}) 1px, transparent 1px)` : '') : undefined,
|
|
953
|
+
// backgroundSize: final.pattern && final.backgroundMode !== 'background' ? '40px 40px' : undefined,
|
|
954
|
+
// }}
|
|
955
|
+
// >
|
|
956
|
+
// {/* Background Image/Video */}
|
|
957
|
+
// {final.backgroundMode === 'background' && (
|
|
958
|
+
// <>
|
|
959
|
+
// {/* Background Image */}
|
|
960
|
+
// {final.backgroundMedia === 'image' && final.backgroundImage && (
|
|
961
|
+
// <div
|
|
962
|
+
// style={{
|
|
963
|
+
// position: 'absolute',
|
|
964
|
+
// top: 0,
|
|
965
|
+
// left: 0,
|
|
966
|
+
// width: '100%',
|
|
967
|
+
// height: '100%',
|
|
968
|
+
// zIndex: 0,
|
|
969
|
+
// backgroundImage: `url(${final.backgroundImage})`,
|
|
970
|
+
// backgroundSize: final.backgroundImageSize || 'cover',
|
|
971
|
+
// backgroundPosition: final.backgroundImagePosition || 'center',
|
|
972
|
+
// backgroundRepeat: final.backgroundImageRepeat ? 'repeat' : 'no-repeat',
|
|
973
|
+
// }}
|
|
974
|
+
// />
|
|
975
|
+
// )}
|
|
976
|
+
// {/* Background Video */}
|
|
977
|
+
// {final.backgroundMedia === 'video' && final.backgroundVideo && (
|
|
978
|
+
// <div
|
|
979
|
+
// style={{
|
|
980
|
+
// position: 'absolute',
|
|
981
|
+
// top: 0,
|
|
982
|
+
// left: 0,
|
|
983
|
+
// width: '100%',
|
|
984
|
+
// height: '100%',
|
|
985
|
+
// zIndex: 0,
|
|
986
|
+
// overflow: 'hidden',
|
|
987
|
+
// }}
|
|
988
|
+
// >
|
|
989
|
+
// <video
|
|
990
|
+
// autoPlay={final.videoAutoplay !== false}
|
|
991
|
+
// loop={final.videoLoop !== false}
|
|
992
|
+
// muted={final.videoMuted !== false}
|
|
993
|
+
// poster={final.videoPoster}
|
|
994
|
+
// style={{
|
|
995
|
+
// position: 'absolute',
|
|
996
|
+
// top: '50%',
|
|
997
|
+
// left: '50%',
|
|
998
|
+
// transform: 'translate(-50%, -50%)',
|
|
999
|
+
// minWidth: '100%',
|
|
1000
|
+
// minHeight: '100%',
|
|
1001
|
+
// width: 'auto',
|
|
1002
|
+
// height: 'auto',
|
|
1003
|
+
// objectFit: 'cover',
|
|
1004
|
+
// }}
|
|
1005
|
+
// >
|
|
1006
|
+
// <source src={final.backgroundVideo} type="video/mp4" />
|
|
1007
|
+
// Your browser does not support the video tag.
|
|
1008
|
+
// </video>
|
|
1009
|
+
// {!final.videoControls && (
|
|
1010
|
+
// <div
|
|
1011
|
+
// style={{
|
|
1012
|
+
// position: 'absolute',
|
|
1013
|
+
// top: 0,
|
|
1014
|
+
// left: 0,
|
|
1015
|
+
// width: '100%',
|
|
1016
|
+
// height: '100%',
|
|
1017
|
+
// backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
1018
|
+
// }}
|
|
1019
|
+
// />
|
|
1020
|
+
// )}
|
|
1021
|
+
// </div>
|
|
1022
|
+
// )}
|
|
1023
|
+
// </>
|
|
1024
|
+
// )}
|
|
1025
|
+
// {/* Gradient Blob */}
|
|
1026
|
+
// {final.showGradient && (
|
|
1027
|
+
// <div
|
|
1028
|
+
// className="vista-gradient-blob"
|
|
1029
|
+
// style={gradientStyle}
|
|
1030
|
+
// />
|
|
1031
|
+
// )}
|
|
1032
|
+
// {/* Gradient Overlay (in background mode) */}
|
|
1033
|
+
// {final.backgroundMode === 'background' && final.gradientOverlay && (
|
|
1034
|
+
// <div
|
|
1035
|
+
// style={{
|
|
1036
|
+
// position: 'absolute',
|
|
1037
|
+
// inset: 0,
|
|
1038
|
+
// width: '100%',
|
|
1039
|
+
// height: '100%',
|
|
1040
|
+
// ...getGradientOverlayStyle(),
|
|
1041
|
+
// zIndex: 1,
|
|
1042
|
+
// pointerEvents: 'none'
|
|
1043
|
+
// }}
|
|
1044
|
+
// />
|
|
1045
|
+
// )}
|
|
1046
|
+
// {/* Fade Overlay */}
|
|
1047
|
+
// {final.fade && (
|
|
1048
|
+
// <div
|
|
1049
|
+
// className="vista-fade-overlay"
|
|
1050
|
+
// style={{
|
|
1051
|
+
// position: 'absolute',
|
|
1052
|
+
// inset: 0,
|
|
1053
|
+
// width: '100%',
|
|
1054
|
+
// height: '100%',
|
|
1055
|
+
// ...getFadeStyle(),
|
|
1056
|
+
// zIndex: 2,
|
|
1057
|
+
// pointerEvents: 'none'
|
|
1058
|
+
// }}
|
|
1059
|
+
// />
|
|
1060
|
+
// )}
|
|
1061
|
+
// {/* Main Container - Different behavior for background vs plain mode */}
|
|
1062
|
+
// {final.backgroundMode === 'background' ? (
|
|
1063
|
+
// // BACKGROUND MODE: Full flex container for positioning
|
|
1064
|
+
// <div
|
|
1065
|
+
// className={`vista-container ${final.containerClass || ''}`}
|
|
1066
|
+
// style={{
|
|
1067
|
+
// position: 'relative',
|
|
1068
|
+
// zIndex: 3,
|
|
1069
|
+
// display: 'flex',
|
|
1070
|
+
// width: '100%',
|
|
1071
|
+
// height: '100%',
|
|
1072
|
+
// justifyContent: final.contentJustify || 'center',
|
|
1073
|
+
// alignItems: final.contentAlign || 'center',
|
|
1074
|
+
// padding: '2rem',
|
|
1075
|
+
// }}
|
|
1076
|
+
// >
|
|
1077
|
+
// {/* Content wrapper with max-width */}
|
|
1078
|
+
// <div
|
|
1079
|
+
// style={{
|
|
1080
|
+
// maxWidth: final.contentWrapperMaxWidth || '700px',
|
|
1081
|
+
// width: '100%',
|
|
1082
|
+
// textAlign: final.textAlign || 'left',
|
|
1083
|
+
// }}
|
|
1084
|
+
// >
|
|
1085
|
+
// {ContentComponent}
|
|
1086
|
+
// </div>
|
|
1087
|
+
// </div>
|
|
1088
|
+
// ) : (
|
|
1089
|
+
// // PLAIN MODE: Regular layout with mediaLeft/mediaRight positioning
|
|
1090
|
+
// <div className={`vista-container ${final.containerClass || ''}`} style={{
|
|
1091
|
+
// position: 'relative',
|
|
1092
|
+
// zIndex: 3,
|
|
1093
|
+
// gap: final.gap || "2rem",
|
|
1094
|
+
// display: 'flex',
|
|
1095
|
+
// flexDirection: isCentered || isStacked ? 'column' : 'row',
|
|
1096
|
+
// alignItems: 'center',
|
|
1097
|
+
// justifyContent: 'center',
|
|
1098
|
+
// width: '100%',
|
|
1099
|
+
// height: '100%',
|
|
1100
|
+
// maxWidth: '1200px',
|
|
1101
|
+
// margin: '0 auto',
|
|
1102
|
+
// padding: '2rem',
|
|
1103
|
+
// minHeight: 'auto',
|
|
1104
|
+
// }}>
|
|
1105
|
+
// {isCentered || isStacked ? (
|
|
1106
|
+
// <>
|
|
1107
|
+
// {(final.mediaPosition === 'top') && <MediaComponent />}
|
|
1108
|
+
// {/* Content wrapper with max-width for centered content */}
|
|
1109
|
+
// <div
|
|
1110
|
+
// style={{
|
|
1111
|
+
// maxWidth: final.contentWrapperMaxWidth || '100%',
|
|
1112
|
+
// width: '100%',
|
|
1113
|
+
// textAlign: final.textAlign || 'left',
|
|
1114
|
+
// }}
|
|
1115
|
+
// >
|
|
1116
|
+
// {ContentComponent}
|
|
1117
|
+
// </div>
|
|
1118
|
+
// {(final.mediaPosition === 'bottom' || !final.mediaPosition) && <MediaComponent />}
|
|
1119
|
+
// </>
|
|
1120
|
+
// ) : final.reverse ? (
|
|
1121
|
+
// <>
|
|
1122
|
+
// <div style={{ flex: 1 }}>
|
|
1123
|
+
// <MediaComponent />
|
|
1124
|
+
// </div>
|
|
1125
|
+
// <div style={{ flex: 1 }}>
|
|
1126
|
+
// {ContentComponent}
|
|
1127
|
+
// </div>
|
|
1128
|
+
// </>
|
|
1129
|
+
// ) : (
|
|
1130
|
+
// <>
|
|
1131
|
+
// {isMediaLeft && (
|
|
1132
|
+
// <div style={{ flex: 1 }}>
|
|
1133
|
+
// <MediaComponent />
|
|
1134
|
+
// </div>
|
|
1135
|
+
// )}
|
|
1136
|
+
// <div style={{ flex: 1 }}>
|
|
1137
|
+
// {ContentComponent}
|
|
1138
|
+
// </div>
|
|
1139
|
+
// {isMediaRight && (
|
|
1140
|
+
// <div style={{ flex: 1 }}>
|
|
1141
|
+
// <MediaComponent />
|
|
1142
|
+
// </div>
|
|
1143
|
+
// )}
|
|
1144
|
+
// </>
|
|
1145
|
+
// )}
|
|
1146
|
+
// </div>
|
|
1147
|
+
// )}
|
|
1148
|
+
// </div>
|
|
1149
|
+
// );
|
|
1150
|
+
// };
|
|
1151
|
+
// export default Vista;
|