@beweco/aurora-ui 0.6.24 → 0.6.25
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/dist/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +172 -24
- package/dist/index.esm.js +172 -24
- package/dist/types/components/content-carousel/ContentCarousel.d.ts.map +1 -1
- package/dist/types/components/content-carousel/ContentCarousel.types.d.ts +2 -0
- package/dist/types/components/content-carousel/ContentCarousel.types.d.ts.map +1 -1
- package/dist/types/components/content-carousel/useBreakpoint.d.ts +8 -0
- package/dist/types/components/content-carousel/useBreakpoint.d.ts.map +1 -0
- package/dist/types/components/content-carousel/variants/SocialMediaCarousel.d.ts.map +1 -1
- package/dist/types/components/currency/Currency.d.ts.map +1 -1
- package/dist/types/components/currency/Currency.types.d.ts +6 -0
- package/dist/types/components/currency/Currency.types.d.ts.map +1 -1
- package/dist/types/components/two-column-layout-agent/TwoColumnLayoutAgent.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2284,18 +2284,18 @@ var sanitizeAmountInput = function (raw, maxFractionDigits) {
|
|
|
2284
2284
|
return { display: display, amountForParent: amountForParent };
|
|
2285
2285
|
};
|
|
2286
2286
|
var Currency = function (_a) {
|
|
2287
|
-
var id = _a.id, label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.name, name = _f === void 0 ? "currency" : _f, _g = _a.currencySelectorLocked, currencySelectorLocked = _g === void 0 ? false : _g, _h = _a.showInput, showInput = _h === void 0 ? true : _h, optionsProp = _a.options, _j = _a.translations, translations =
|
|
2287
|
+
var id = _a.id, label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.name, name = _f === void 0 ? "currency" : _f, _g = _a.currencySelectorLocked, currencySelectorLocked = _g === void 0 ? false : _g, _h = _a.showInput, showInput = _h === void 0 ? true : _h, optionsProp = _a.options, _j = _a.listMaxHeight, listMaxHeight = _j === void 0 ? "max-h-60" : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k, _l = _a.maxFractionDigits, maxFractionDigits = _l === void 0 ? 0 : _l;
|
|
2288
2288
|
var options = React.useMemo(function () {
|
|
2289
2289
|
var o = optionsProp !== null && optionsProp !== void 0 ? optionsProp : defaultCurrencyOptions;
|
|
2290
2290
|
return o.length > 0 ? o : defaultCurrencyOptions;
|
|
2291
2291
|
}, [optionsProp]);
|
|
2292
|
-
var
|
|
2293
|
-
var
|
|
2294
|
-
var
|
|
2292
|
+
var _m = React.useState(false), isDropdownOpen = _m[0], setIsDropdownOpen = _m[1];
|
|
2293
|
+
var _o = React.useState(options[0]), selected = _o[0], setSelected = _o[1];
|
|
2294
|
+
var _p = React.useState(""), inputValue = _p[0], setInputValue = _p[1];
|
|
2295
2295
|
var dropdownRef = React.useRef(null);
|
|
2296
2296
|
var portalDropdownRef = React.useRef(null);
|
|
2297
|
-
var
|
|
2298
|
-
var
|
|
2297
|
+
var _q = React.useState({}), dropdownPosition = _q[0], setDropdownPosition = _q[1];
|
|
2298
|
+
var _r = React.useState(options), filteredOptions = _r[0], setFilteredOptions = _r[1];
|
|
2299
2299
|
var t = __assign(__assign({}, defaultTranslations$b), translations);
|
|
2300
2300
|
var getCountryName = function (opt) { var _a, _b; return (_b = (_a = t.countries) === null || _a === void 0 ? void 0 : _a[opt.country]) !== null && _b !== void 0 ? _b : opt.name; };
|
|
2301
2301
|
var finalLabel = label !== null && label !== void 0 ? label : t.label;
|
|
@@ -2403,13 +2403,51 @@ var Currency = function (_a) {
|
|
|
2403
2403
|
opt.country.toLowerCase().includes(searchTerm);
|
|
2404
2404
|
});
|
|
2405
2405
|
setFilteredOptions(filtered);
|
|
2406
|
-
} }) }), jsxRuntime.jsx("div", { className: "
|
|
2406
|
+
} }) }), jsxRuntime.jsx("div", { className: "".concat(listMaxHeight, " overflow-y-auto"), children: filteredOptions.length > 0 ? (filteredOptions.map(function (opt) { return (jsxRuntime.jsxs("button", { type: "button", role: "option", "aria-selected": opt.country === selected.country &&
|
|
2407
2407
|
opt.currency === selected.currency, className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(opt.country === selected.country &&
|
|
2408
2408
|
opt.currency === selected.currency
|
|
2409
2409
|
? "bg-primary-50"
|
|
2410
2410
|
: ""), onClick: function () { return handleOptionSelect(opt); }, children: [jsxRuntime.jsx("span", { className: "mr-3", children: jsxRuntime.jsx(FlagIcon, { countryCode: opt.country, size: "md" }) }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: getCountryName(opt) }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: opt.currency })] }, "".concat(opt.country, "-").concat(opt.currency))); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCurrenciesFound })) })] }), document.body)] }));
|
|
2411
2411
|
};
|
|
2412
2412
|
|
|
2413
|
+
/**
|
|
2414
|
+
* Internal hook — returns current breakpoint based on viewport width.
|
|
2415
|
+
* mobile: < 640px | tablet: 640-1023px | desktop: >= 1024px
|
|
2416
|
+
*/
|
|
2417
|
+
function useBreakpoint() {
|
|
2418
|
+
var _a = React.useState(function () {
|
|
2419
|
+
if (typeof window === "undefined")
|
|
2420
|
+
return "desktop";
|
|
2421
|
+
var w = window.innerWidth;
|
|
2422
|
+
if (w < 640)
|
|
2423
|
+
return "mobile";
|
|
2424
|
+
if (w < 1024)
|
|
2425
|
+
return "tablet";
|
|
2426
|
+
return "desktop";
|
|
2427
|
+
}), breakpoint = _a[0], setBreakpoint = _a[1];
|
|
2428
|
+
React.useEffect(function () {
|
|
2429
|
+
if (typeof window === "undefined")
|
|
2430
|
+
return;
|
|
2431
|
+
var mobileQuery = window.matchMedia("(max-width: 639px)");
|
|
2432
|
+
var tabletQuery = window.matchMedia("(min-width: 640px) and (max-width: 1023px)");
|
|
2433
|
+
var update = function () {
|
|
2434
|
+
if (mobileQuery.matches)
|
|
2435
|
+
setBreakpoint("mobile");
|
|
2436
|
+
else if (tabletQuery.matches)
|
|
2437
|
+
setBreakpoint("tablet");
|
|
2438
|
+
else
|
|
2439
|
+
setBreakpoint("desktop");
|
|
2440
|
+
};
|
|
2441
|
+
mobileQuery.addEventListener("change", update);
|
|
2442
|
+
tabletQuery.addEventListener("change", update);
|
|
2443
|
+
return function () {
|
|
2444
|
+
mobileQuery.removeEventListener("change", update);
|
|
2445
|
+
tabletQuery.removeEventListener("change", update);
|
|
2446
|
+
};
|
|
2447
|
+
}, []);
|
|
2448
|
+
return breakpoint;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2413
2451
|
// Default translations in Spanish
|
|
2414
2452
|
var defaultTranslations$a = {
|
|
2415
2453
|
emptyStateMessage: "No hay contenido disponible",
|
|
@@ -2438,7 +2476,14 @@ var defaultTranslations$a = {
|
|
|
2438
2476
|
var ContentCarousel = function (_a) {
|
|
2439
2477
|
var items = _a.items, onItemClick = _a.onItemClick, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.emptyStateRedirectPath, emptyStateRedirectPath = _c === void 0 ? "" : _c, _d = _a.translations, translations = _d === void 0 ? {} : _d, renderFooter = _a.renderFooter, renderHeader = _a.renderHeader, renderBody = _a.renderBody, _e = _a.haveChip, haveChip = _e === void 0 ? false : _e;
|
|
2440
2478
|
var t = __assign(__assign({}, defaultTranslations$a), translations);
|
|
2479
|
+
var breakpoint = useBreakpoint();
|
|
2480
|
+
var isMobile = breakpoint === "mobile";
|
|
2481
|
+
var isTablet = breakpoint === "tablet";
|
|
2441
2482
|
var _f = React.useState(items.length >= 3 ? 1 : 0), activeIndex = _f[0], setActiveIndex = _f[1];
|
|
2483
|
+
var _g = React.useState(0), swipeOffset = _g[0], setSwipeOffset = _g[1];
|
|
2484
|
+
var swipeOffsetRef = React.useRef(0);
|
|
2485
|
+
var touchStartRef = React.useRef(null);
|
|
2486
|
+
var isSwipingRef = React.useRef(false);
|
|
2442
2487
|
// Reset to show 3 images when items change
|
|
2443
2488
|
React.useEffect(function () {
|
|
2444
2489
|
setActiveIndex(items.length >= 3 ? 1 : 0);
|
|
@@ -2449,6 +2494,73 @@ var ContentCarousel = function (_a) {
|
|
|
2449
2494
|
var handlePrev = React.useCallback(function () {
|
|
2450
2495
|
setActiveIndex(function (prev) { return Math.max(prev - 1, 0); });
|
|
2451
2496
|
}, []);
|
|
2497
|
+
var handleDragStart = React.useCallback(function (clientX, clientY) {
|
|
2498
|
+
touchStartRef.current = { x: clientX, y: clientY };
|
|
2499
|
+
isSwipingRef.current = false;
|
|
2500
|
+
}, []);
|
|
2501
|
+
var handleDragMove = React.useCallback(function (clientX, clientY, preventDefault) {
|
|
2502
|
+
if (!touchStartRef.current)
|
|
2503
|
+
return;
|
|
2504
|
+
var deltaX = clientX - touchStartRef.current.x;
|
|
2505
|
+
var deltaY = clientY - touchStartRef.current.y;
|
|
2506
|
+
if (!isSwipingRef.current && Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 10) {
|
|
2507
|
+
isSwipingRef.current = true;
|
|
2508
|
+
}
|
|
2509
|
+
if (isSwipingRef.current) {
|
|
2510
|
+
preventDefault === null || preventDefault === void 0 ? void 0 : preventDefault();
|
|
2511
|
+
var clamped = Math.max(-150, Math.min(150, deltaX));
|
|
2512
|
+
swipeOffsetRef.current = clamped;
|
|
2513
|
+
setSwipeOffset(clamped);
|
|
2514
|
+
}
|
|
2515
|
+
}, []);
|
|
2516
|
+
var handleDragEnd = React.useCallback(function () {
|
|
2517
|
+
var offset = swipeOffsetRef.current;
|
|
2518
|
+
if (isSwipingRef.current && Math.abs(offset) > 50) {
|
|
2519
|
+
if (offset < 0) {
|
|
2520
|
+
handleNext();
|
|
2521
|
+
}
|
|
2522
|
+
else {
|
|
2523
|
+
handlePrev();
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
swipeOffsetRef.current = 0;
|
|
2527
|
+
setSwipeOffset(0);
|
|
2528
|
+
touchStartRef.current = null;
|
|
2529
|
+
isSwipingRef.current = false;
|
|
2530
|
+
}, [handleNext, handlePrev]);
|
|
2531
|
+
// Touch events
|
|
2532
|
+
var handleTouchStart = React.useCallback(function (e) {
|
|
2533
|
+
handleDragStart(e.touches[0].clientX, e.touches[0].clientY);
|
|
2534
|
+
}, [handleDragStart]);
|
|
2535
|
+
var handleTouchMove = React.useCallback(function (e) {
|
|
2536
|
+
handleDragMove(e.touches[0].clientX, e.touches[0].clientY, function () { return e.preventDefault(); });
|
|
2537
|
+
}, [handleDragMove]);
|
|
2538
|
+
var handleTouchEnd = React.useCallback(function () {
|
|
2539
|
+
handleDragEnd();
|
|
2540
|
+
}, [handleDragEnd]);
|
|
2541
|
+
// Mouse events
|
|
2542
|
+
var isDraggingRef = React.useRef(false);
|
|
2543
|
+
var handleMouseDown = React.useCallback(function (e) {
|
|
2544
|
+
isDraggingRef.current = true;
|
|
2545
|
+
handleDragStart(e.clientX, e.clientY);
|
|
2546
|
+
}, [handleDragStart]);
|
|
2547
|
+
var handleMouseMove = React.useCallback(function (e) {
|
|
2548
|
+
if (!isDraggingRef.current)
|
|
2549
|
+
return;
|
|
2550
|
+
handleDragMove(e.clientX, e.clientY);
|
|
2551
|
+
}, [handleDragMove]);
|
|
2552
|
+
var handleMouseUp = React.useCallback(function () {
|
|
2553
|
+
if (!isDraggingRef.current)
|
|
2554
|
+
return;
|
|
2555
|
+
isDraggingRef.current = false;
|
|
2556
|
+
handleDragEnd();
|
|
2557
|
+
}, [handleDragEnd]);
|
|
2558
|
+
var handleMouseLeave = React.useCallback(function () {
|
|
2559
|
+
if (!isDraggingRef.current)
|
|
2560
|
+
return;
|
|
2561
|
+
isDraggingRef.current = false;
|
|
2562
|
+
handleDragEnd();
|
|
2563
|
+
}, [handleDragEnd]);
|
|
2452
2564
|
// Get position of card relative to active index
|
|
2453
2565
|
var getPosition = function (index) {
|
|
2454
2566
|
if (index === activeIndex) {
|
|
@@ -2469,19 +2581,19 @@ var ContentCarousel = function (_a) {
|
|
|
2469
2581
|
}, [onItemClick]);
|
|
2470
2582
|
// Empty state when no items
|
|
2471
2583
|
if (items.length === 0) {
|
|
2472
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center
|
|
2584
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center px-6 gap-6 ".concat(isMobile ? "py-8" : "py-16", " ").concat(className), children: [jsxRuntime.jsx("p", { className: "text-default-500 text-center", children: t.emptyStateMessage }), emptyStateRedirectPath && (jsxRuntime.jsx(react.Button, { color: "primary", variant: "solid", size: "md", className: isMobile ? "w-full" : "", onPress: function () {
|
|
2473
2585
|
if (typeof window !== "undefined") {
|
|
2474
2586
|
window.location.href = emptyStateRedirectPath;
|
|
2475
2587
|
}
|
|
2476
2588
|
}, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-bold", className: "w-5 h-5" }), children: t.emptyStateButtonText }))] }));
|
|
2477
2589
|
}
|
|
2478
|
-
return (jsxRuntime.jsx("div", { className: "relative w-full ".concat(className), children: jsxRuntime.jsxs("div", { className: "relative w-full pt-4 pb-8", children: [jsxRuntime.jsxs("div", { className: "relative
|
|
2590
|
+
return (jsxRuntime.jsx("div", { className: "relative w-full ".concat(className), children: jsxRuntime.jsxs("div", { className: "relative w-full pt-4 pb-8", children: [jsxRuntime.jsxs("div", { className: "relative flex items-center justify-center ".concat(isMobile ? "h-[420px] overflow-visible" : isTablet ? "h-[380px] overflow-hidden" : "h-[450px] overflow-hidden"), onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseLeave, style: { cursor: isMobile ? "grab" : undefined }, children: [items.length > 1 && !isMobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 z-20 ".concat(isMobile ? "ml-2" : "ml-4"), children: jsxRuntime.jsx(react.Button, { isIconOnly: true, variant: "bordered", onPress: handlePrev, isDisabled: activeIndex === 0, className: "rounded-full bg-white/95 dark:bg-gray-800/95 backdrop-blur-md border-gray-200 dark:border-gray-700 shadow-xl hover:bg-white dark:hover:bg-gray-800 hover:border-gray-300 dark:hover:border-gray-600 hover:scale-110 hover:-translate-x-1 disabled:opacity-20 disabled:hover:scale-100 disabled:hover:translate-x-0 transition-all duration-300 ".concat(isMobile ? "w-8 h-8" : "w-12 h-12"), "aria-label": t.previousButtonLabel, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-left-outline", className: isMobile ? "w-4 h-4" : "w-6 h-6" }) }) }), jsxRuntime.jsx("div", { className: "absolute right-0 top-1/2 -translate-y-1/2 z-20 ".concat(isMobile ? "mr-2" : "mr-4"), children: jsxRuntime.jsx(react.Button, { isIconOnly: true, variant: "bordered", onPress: handleNext, isDisabled: activeIndex === items.length - 1, className: "rounded-full bg-white/95 dark:bg-gray-800/95 backdrop-blur-md border-gray-200 dark:border-gray-700 shadow-xl hover:bg-white dark:hover:bg-gray-800 hover:border-gray-300 dark:hover:border-gray-600 hover:scale-110 hover:translate-x-1 disabled:opacity-20 disabled:hover:scale-100 disabled:hover:translate-x-0 transition-all duration-300 ".concat(isMobile ? "w-8 h-8" : "w-12 h-12"), "aria-label": t.nextButtonLabel, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-right-outline", className: isMobile ? "w-4 h-4" : "w-6 h-6" }) }) })] })), items.map(function (item, index) {
|
|
2479
2591
|
var position = getPosition(index);
|
|
2480
2592
|
if (position === "hidden") {
|
|
2481
2593
|
return null;
|
|
2482
2594
|
}
|
|
2483
|
-
return (jsxRuntime.jsx(CarouselItemComponent, { item: item, position: position, onClick: function () { return handleItemClick(item); }, translations: t, renderFooter: renderFooter, renderHeader: renderHeader, renderBody: renderBody, haveChip: haveChip }, item.id));
|
|
2484
|
-
})] }), items.length > 1 && (jsxRuntime.jsx("div", { className: "flex justify-center mt-4", children: jsxRuntime.jsx("div", { className: "flex justify-center gap-2", children: items.map(function (_, index) { return (jsxRuntime.jsx("button", { type: "button", onClick: function () { return setActiveIndex(index); }, className: "rounded-full transition-all duration-300 hover:scale-110 ".concat(index === activeIndex
|
|
2595
|
+
return (jsxRuntime.jsx(CarouselItemComponent, { item: item, position: position, breakpoint: breakpoint, onClick: function () { return handleItemClick(item); }, translations: t, renderFooter: renderFooter, renderHeader: renderHeader, renderBody: renderBody, haveChip: haveChip, swipeOffset: swipeOffset }, item.id));
|
|
2596
|
+
})] }), items.length > 1 && (jsxRuntime.jsx("div", { className: "flex justify-center mt-4", children: jsxRuntime.jsx("div", { className: "flex justify-center ".concat(isMobile ? "gap-1.5" : "gap-2"), children: items.map(function (_, index) { return (jsxRuntime.jsx("button", { type: "button", onClick: function () { return setActiveIndex(index); }, className: "rounded-full transition-all duration-300 hover:scale-110 ".concat(index === activeIndex
|
|
2485
2597
|
? "w-8 h-2 bg-gradient-to-r from-primary-500 to-primary-600 shadow-lg shadow-primary-500/50"
|
|
2486
2598
|
: "w-2 h-2 bg-gray-300 dark:bg-gray-600 hover:bg-gray-400 dark:hover:bg-gray-500 hover:w-3"), "aria-label": "".concat(t.goToItemLabel, " ").concat(index + 1) }, index)); }) }) }))] }) }));
|
|
2487
2599
|
};
|
|
@@ -2491,11 +2603,42 @@ var ContentCarousel = function (_a) {
|
|
|
2491
2603
|
* @internal
|
|
2492
2604
|
*/
|
|
2493
2605
|
function CarouselItemComponent(_a) {
|
|
2494
|
-
var item = _a.item, position = _a.position, onClick = _a.onClick, translations = _a.translations, renderFooter = _a.renderFooter, renderHeader = _a.renderHeader, renderBody = _a.renderBody, haveChip = _a.haveChip;
|
|
2495
|
-
var _b = React.useState(false),
|
|
2606
|
+
var item = _a.item, position = _a.position, breakpoint = _a.breakpoint, onClick = _a.onClick, translations = _a.translations, renderFooter = _a.renderFooter, renderHeader = _a.renderHeader, renderBody = _a.renderBody, haveChip = _a.haveChip, swipeOffset = _a.swipeOffset;
|
|
2607
|
+
var _b = React.useState(false), hoverState = _b[0], setHoverState = _b[1];
|
|
2608
|
+
var isMobile = breakpoint === "mobile";
|
|
2609
|
+
var isHovered = isMobile ? false : hoverState;
|
|
2496
2610
|
var captionText = item.caption || item.title;
|
|
2497
|
-
// Get styles based on position
|
|
2611
|
+
// Get styles based on position and breakpoint
|
|
2498
2612
|
var getPositionStyles = function () {
|
|
2613
|
+
if (breakpoint === "mobile") {
|
|
2614
|
+
var baseStyles_1 = {
|
|
2615
|
+
minHeight: "380px",
|
|
2616
|
+
maxHeight: "380px",
|
|
2617
|
+
boxShadow: "0 10px 40px -5px rgba(0, 0, 0, 0.3), 0 8px 25px -8px rgba(0, 0, 0, 0.2)",
|
|
2618
|
+
};
|
|
2619
|
+
if (position === "center") {
|
|
2620
|
+
return __assign(__assign({}, baseStyles_1), { width: "85vw", transform: "translateX(".concat(swipeOffset, "px) scale(1)"), opacity: 1, zIndex: 10, transition: swipeOffset !== 0 ? "none" : undefined });
|
|
2621
|
+
}
|
|
2622
|
+
return __assign(__assign({}, baseStyles_1), { width: "85vw", transform: "scale(0.8)", opacity: 0, zIndex: 0, pointerEvents: "none" });
|
|
2623
|
+
}
|
|
2624
|
+
if (breakpoint === "tablet") {
|
|
2625
|
+
var baseStyles_2 = {
|
|
2626
|
+
minHeight: "340px",
|
|
2627
|
+
maxHeight: "340px",
|
|
2628
|
+
boxShadow: "0 10px 40px -5px rgba(0, 0, 0, 0.3), 0 8px 25px -8px rgba(0, 0, 0, 0.2)",
|
|
2629
|
+
};
|
|
2630
|
+
if (position === "center") {
|
|
2631
|
+
return __assign(__assign({}, baseStyles_2), { width: "420px", transform: "scale(1)", opacity: 1, zIndex: 10 });
|
|
2632
|
+
}
|
|
2633
|
+
if (position === "left") {
|
|
2634
|
+
return __assign(__assign({}, baseStyles_2), { width: "250px", transform: "translateX(-115%) scale(0.7)", opacity: 0.6, zIndex: 5 });
|
|
2635
|
+
}
|
|
2636
|
+
if (position === "right") {
|
|
2637
|
+
return __assign(__assign({}, baseStyles_2), { width: "250px", transform: "translateX(115%) scale(0.7)", opacity: 0.6, zIndex: 5 });
|
|
2638
|
+
}
|
|
2639
|
+
return baseStyles_2;
|
|
2640
|
+
}
|
|
2641
|
+
// Desktop: current behavior unchanged
|
|
2499
2642
|
var baseStyles = {
|
|
2500
2643
|
minHeight: "400px",
|
|
2501
2644
|
maxHeight: "400px",
|
|
@@ -2512,7 +2655,7 @@ function CarouselItemComponent(_a) {
|
|
|
2512
2655
|
}
|
|
2513
2656
|
return baseStyles;
|
|
2514
2657
|
};
|
|
2515
|
-
return (jsxRuntime.jsxs("div", { className: "absolute rounded-
|
|
2658
|
+
return (jsxRuntime.jsxs("div", { className: "absolute rounded-[2rem] shadow-lg transition-all duration-500 ease-in-out flex flex-col overflow-hidden", style: getPositionStyles(), onMouseEnter: function () { return !isMobile && setHoverState(true); }, onMouseLeave: function () { return !isMobile && setHoverState(false); }, children: [item.imageUrl ? (jsxRuntime.jsx("div", { className: "absolute inset-0 bg-cover bg-center transition-all duration-500 ease-in-out ".concat(isHovered ? "scale-110 blur-sm" : "scale-100 blur-0"), style: {
|
|
2516
2659
|
backgroundImage: "url(".concat(item.imageUrl, ")"),
|
|
2517
2660
|
} })) : (jsxRuntime.jsx("div", { className: "absolute inset-0 transition-all duration-500 ease-in-out ".concat(isHovered ? "scale-110 blur-sm" : "scale-100 blur-0"), style: {
|
|
2518
2661
|
background: item.gradient,
|
|
@@ -2522,7 +2665,7 @@ function CarouselItemComponent(_a) {
|
|
|
2522
2665
|
item: item,
|
|
2523
2666
|
isHovered: isHovered,
|
|
2524
2667
|
translations: translations,
|
|
2525
|
-
}) })), haveChip && item.chipContent != null && (jsxRuntime.jsx("div", { className: "absolute top-4 right-4 z-30", children: item.chipContent })), renderBody ? (jsxRuntime.jsx("div", { className: "relative w-full h-full z-10", children: renderBody(item, isHovered) })) : (jsxRuntime.jsxs("button", { type: "button", onClick: onClick, className: "relative w-full h-full cursor-pointer flex flex-col justify-between p-6 z-10", "aria-label": item.title, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("h3", { className: "text-white
|
|
2668
|
+
}) })), haveChip && item.chipContent != null && (jsxRuntime.jsx("div", { className: "absolute top-4 right-4 z-30 ".concat(breakpoint === "mobile" ? "scale-90" : ""), children: item.chipContent })), renderBody ? (jsxRuntime.jsx("div", { className: "relative w-full h-full z-10", children: renderBody(item, isHovered) })) : (jsxRuntime.jsxs("button", { type: "button", onClick: onClick, className: "relative w-full h-full cursor-pointer flex flex-col justify-between p-6 z-10", "aria-label": item.title, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("h3", { className: "text-white font-semibold mb-2 text-left drop-shadow-lg ".concat(breakpoint === "mobile" ? "text-xl" : "text-3xl"), children: item.title }) }), jsxRuntime.jsx("div", { className: "space-y-3 overflow-hidden", children: jsxRuntime.jsx("p", { className: "text-white text-sm text-left drop-shadow-md transition-all duration-500 ease-in-out ".concat(!isHovered && "line-clamp-2"), children: captionText }) })] })), renderFooter && (function () {
|
|
2526
2669
|
var footerContent = renderFooter({
|
|
2527
2670
|
item: item,
|
|
2528
2671
|
isHovered: isHovered,
|
|
@@ -2608,28 +2751,33 @@ var SocialMediaCarousel = function (_a) {
|
|
|
2608
2751
|
onPreview(item);
|
|
2609
2752
|
}
|
|
2610
2753
|
}, [onPreview]);
|
|
2754
|
+
var breakpoint = useBreakpoint();
|
|
2755
|
+
var isMobile = breakpoint === "mobile";
|
|
2611
2756
|
// Custom footer renderer with audience info + SocialMediaBar
|
|
2612
2757
|
var renderSocialFooterWithAudience = React.useCallback(function (_a) {
|
|
2613
2758
|
var item = _a.item, isHovered = _a.isHovered, translations = _a.translations;
|
|
2614
2759
|
var socialItem = item;
|
|
2615
2760
|
var showAudience = !hideAudienceInfo && socialItem.targetAudienceCount;
|
|
2616
|
-
|
|
2761
|
+
var isExpanded = isMobile || isHovered;
|
|
2762
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [showAudience && (jsxRuntime.jsxs("div", { className: "backdrop-blur-xl border border-white/30 shadow-xl flex items-center transition-all duration-500 ".concat(isExpanded
|
|
2617
2763
|
? "bg-gradient-to-br from-white/40 to-white/30 rounded-2xl px-4 py-2.5 gap-3 max-w-md"
|
|
2618
2764
|
: "bg-gradient-to-br from-white/30 to-white/20 rounded-3xl px-3 py-1.5 gap-1.5 w-fit"), style: {
|
|
2619
|
-
animation:
|
|
2765
|
+
animation: isExpanded
|
|
2620
2766
|
? "none"
|
|
2621
2767
|
: "pulse-subtle 3s ease-in-out infinite",
|
|
2622
|
-
}, children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:users-group-rounded-bold", className: "w-3.5 h-3.5 text-white transition-transform duration-300 hover:scale-110" }), jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-white transition-all duration-500 ".concat(
|
|
2768
|
+
}, children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:users-group-rounded-bold", className: "w-3.5 h-3.5 text-white transition-transform duration-300 hover:scale-110" }), jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-white transition-all duration-500 ".concat(isExpanded
|
|
2623
2769
|
? "opacity-100 max-w-20"
|
|
2624
|
-
: "opacity-100 max-w-20 whitespace-nowrap"), children:
|
|
2770
|
+
: "opacity-100 max-w-20 whitespace-nowrap"), children: isMobile && socialItem.targetAudienceCount >= 1000
|
|
2771
|
+
? "".concat((socialItem.targetAudienceCount / 1000).toFixed(1), "K")
|
|
2772
|
+
: socialItem.targetAudienceCount.toLocaleString("es-ES") })] }), socialItem.audienceReason && isExpanded && (jsxRuntime.jsx("div", { className: "text-[11px] text-white/95 leading-relaxed animate-fade-in", children: socialItem.audienceReason })), socialItem.requiredTags &&
|
|
2625
2773
|
socialItem.requiredTags.length > 0 &&
|
|
2626
|
-
|
|
2774
|
+
isExpanded && (jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 mt-2 pt-2 border-t border-white/20 animate-fade-in", children: socialItem.requiredTags.map(function (tag, idx) { return (jsxRuntime.jsx("span", { className: "rounded-md bg-white/20 text-white/95 backdrop-blur-sm border border-white/30 whitespace-nowrap ".concat(isMobile ? "text-[8px] px-1 py-0.5" : "text-[9px] px-1.5 py-0.5"), children: tag }, idx)); }) }))] })), !hideFooter && (jsxRuntime.jsx(SocialMediaBar, { platform: socialItem.type, isHovered: isHovered, showPreview: typeof onPreview === "function", onEdit: onEdit ? function () { return onEdit(socialItem); } : undefined, onDelete: onDelete ? function () { return onDelete(socialItem); } : undefined, onPublish: onPublish ? function () { return onPublish(socialItem); } : undefined, onPreview: function () { return handlePreview(socialItem); }, translations: {
|
|
2627
2775
|
editButtonLabel: translations.editButtonLabel,
|
|
2628
2776
|
deleteButtonLabel: translations.deleteButtonLabel,
|
|
2629
2777
|
publishButtonLabel: translations.publishButtonLabel,
|
|
2630
2778
|
previewButtonLabel: translations.previewButtonLabel,
|
|
2631
2779
|
} }))] }));
|
|
2632
|
-
}, [hideAudienceInfo, hideFooter, onEdit, onDelete, onPublish, handlePreview]);
|
|
2780
|
+
}, [hideAudienceInfo, hideFooter, onEdit, onDelete, onPublish, handlePreview, isMobile]);
|
|
2633
2781
|
return (jsxRuntime.jsx(ContentCarousel, { items: items, onItemClick: onItemClick, className: className, emptyStateRedirectPath: emptyStateRedirectPath, translations: translations, renderFooter: renderSocialFooterWithAudience, haveChip: haveChip }));
|
|
2634
2782
|
};
|
|
2635
2783
|
|
|
@@ -4794,7 +4942,7 @@ var SpeechBubble = React.memo(function (_a) {
|
|
|
4794
4942
|
return (jsxRuntime.jsxs(framerMotion.motion.div, { initial: { opacity: 0, y: 12, scale: 0.97 }, animate: { opacity: 1, y: 0, scale: 1 }, transition: {
|
|
4795
4943
|
duration: 0.6,
|
|
4796
4944
|
ease: [0.4, 0.0, 0.2, 1],
|
|
4797
|
-
}, className: "relative ".concat(className), style: { maxWidth: "".concat(maxWidth, "px") }, children: [jsxRuntime.jsx("div", { className: "bg-white/85 dark:bg-gray-900/85 backdrop-blur-xl rounded-3xl px-8 py-6 shadow-[0_8px_30px_rgba(0,0,0,0.04)] dark:shadow-[0_8px_30px_rgba(0,0,0,0.3)] border border-white/50 dark:border-gray-800/50", children: jsxRuntime.jsxs("p", { className: "text-lg text-gray-800 dark:text-gray-200 leading-relaxed font-sans font-normal", children: [displayedText, isTyping && (jsxRuntime.jsx(framerMotion.motion.span, { animate: { opacity: [0.3, 1, 0.3] }, transition: {
|
|
4945
|
+
}, className: "relative ".concat(className), style: { maxWidth: "".concat(maxWidth, "px") }, children: [jsxRuntime.jsx("div", { className: "bg-white/85 dark:bg-gray-900/85 backdrop-blur-xl rounded-3xl px-8 py-6 shadow-[0_8px_30px_rgba(0,0,0,0.04)] dark:shadow-[0_8px_30px_rgba(0,0,0,0.3)] border border-white/50 dark:border-gray-800/50", children: jsxRuntime.jsxs("p", { className: "text-sm md:text-lg text-gray-800 dark:text-gray-200 leading-relaxed font-sans font-normal", children: [displayedText, isTyping && (jsxRuntime.jsx(framerMotion.motion.span, { animate: { opacity: [0.3, 1, 0.3] }, transition: {
|
|
4798
4946
|
duration: 1.2,
|
|
4799
4947
|
repeat: Infinity,
|
|
4800
4948
|
ease: "easeInOut",
|
|
@@ -4900,7 +5048,7 @@ var TwoColumnLayoutAgent = function (_a) {
|
|
|
4900
5048
|
setShowRightContent(true);
|
|
4901
5049
|
}, 100);
|
|
4902
5050
|
};
|
|
4903
|
-
return (jsxRuntime.jsxs("div", { className: "min-h-screen relative isolate overflow-hidden ".concat(className), children: [jsxRuntime.jsx(BackButton, { onPress: handleBackPress, visible: showBackButton, label: t.backButtonLabel }), jsxRuntime.jsx(AnimatedBackground, {}), jsxRuntime.jsx("div", { className: "relative z-10 flex flex-col h-screen", children: jsxRuntime.jsxs("div", { className: "flex-grow flex overflow-hidden", children: [jsxRuntime.jsx(framerMotion.motion.div, { initial: false, animate: { opacity: 1, x: 0 }, transition: { duration: 0.8, ease: [0.4, 0.0, 0.2, 1] }, className: "".concat(isDesktop ? "flex w-2/5" : "hidden", " flex-col items-center justify-center p-8 xl:p-12"), children: jsxRuntime.jsx(AssistantOrb, { text: assistantSpeech, state: assistantState, size: assistantSize, animated: true, typing: enableSequence, typingSpeed: TYPING_SPEED_MS, hint: assistantHint, onTypingComplete: handleTypingComplete }) }), jsxRuntime.jsxs("div", { className: "".concat(isDesktop ? "w-3/5 p-12" : "w-full p-6 sm:p-8", " flex flex-col items-center
|
|
5051
|
+
return (jsxRuntime.jsxs("div", { className: "min-h-screen relative isolate overflow-hidden ".concat(className), children: [jsxRuntime.jsx(BackButton, { onPress: handleBackPress, visible: showBackButton, label: t.backButtonLabel }), jsxRuntime.jsx(AnimatedBackground, {}), jsxRuntime.jsx("div", { className: "relative z-10 flex flex-col h-screen", children: jsxRuntime.jsxs("div", { className: "flex-grow flex overflow-hidden", children: [jsxRuntime.jsx(framerMotion.motion.div, { initial: false, animate: { opacity: 1, x: 0 }, transition: { duration: 0.8, ease: [0.4, 0.0, 0.2, 1] }, className: "".concat(isDesktop ? "flex w-2/5" : "hidden", " flex-col items-center justify-center p-8 xl:p-12"), children: jsxRuntime.jsx(AssistantOrb, { text: assistantSpeech, state: assistantState, size: assistantSize, animated: true, typing: enableSequence, typingSpeed: TYPING_SPEED_MS, hint: assistantHint, onTypingComplete: handleTypingComplete }) }), jsxRuntime.jsxs("div", { className: "".concat(isDesktop ? "w-3/5 p-12 justify-center" : "w-full p-6 sm:p-8 justify-start", " flex flex-col items-center overflow-y-auto"), children: [!isDesktop && (jsxRuntime.jsx("div", { className: "mb-2 flex flex-col items-center gap-4", children: jsxRuntime.jsx(AssistantOrb, { text: assistantSpeech, state: assistantState, size: "sm", animated: true, typing: false, className: "!gap-1 [&>*:nth-child(2)]:-mt-10" }) })), jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", initial: false, children: showRightContent && (jsxRuntime.jsx(framerMotion.motion.div, { initial: false, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -30 }, transition: { duration: 0.6, ease: [0.4, 0.0, 0.2, 1] }, className: "w-full max-w-2xl", children: children }, "right-content")) })] })] }) })] }));
|
|
4904
5052
|
};
|
|
4905
5053
|
|
|
4906
5054
|
// Traducciones por defecto en español
|