@beweco/aurora-ui 0.1.23 → 0.1.24
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 +93 -17
- package/dist/index.esm.js +93 -18
- package/dist/types/components/social-media-preview/SocialMediaPreview.d.ts +19 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.d.ts.map +1 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.types.d.ts +46 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.types.d.ts.map +1 -0
- package/dist/types/components/social-media-preview/index.d.ts +3 -0
- package/dist/types/components/social-media-preview/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -177,7 +177,7 @@ var Input = function (_a) {
|
|
|
177
177
|
} })));
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
var defaultTranslations$
|
|
180
|
+
var defaultTranslations$b = {
|
|
181
181
|
addHolidayTitle: "Add holiday",
|
|
182
182
|
dayOption: "Day",
|
|
183
183
|
dateRangeOption: "Date range",
|
|
@@ -201,7 +201,7 @@ var INITIAL_HOLIDAY_STATE = {
|
|
|
201
201
|
*/
|
|
202
202
|
var AddHolidayForm = function (_a) {
|
|
203
203
|
var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
|
|
204
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
204
|
+
var t = __assign(__assign({}, defaultTranslations$b), translations);
|
|
205
205
|
var _b = React.useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
|
|
206
206
|
/**
|
|
207
207
|
* A boolean flag that determines if a date has been set.
|
|
@@ -271,7 +271,7 @@ var P = function (_a) {
|
|
|
271
271
|
return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
var defaultTranslations$
|
|
274
|
+
var defaultTranslations$a = {
|
|
275
275
|
title: "Analytics",
|
|
276
276
|
description: "Monthly growth of your metrics during the selected period",
|
|
277
277
|
viewDetails: "View Details",
|
|
@@ -325,7 +325,7 @@ var formatMonth = function (month) {
|
|
|
325
325
|
var AnalyticsCard = function (_a) {
|
|
326
326
|
var _b, _c;
|
|
327
327
|
var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
|
|
328
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
328
|
+
var t = __assign(__assign({}, defaultTranslations$a), translations);
|
|
329
329
|
var _h = React.useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
|
|
330
330
|
var activeChartData = React.useMemo(function () {
|
|
331
331
|
var _a;
|
|
@@ -990,7 +990,7 @@ var Chip = function (_a) {
|
|
|
990
990
|
};
|
|
991
991
|
|
|
992
992
|
// Traducciones por defecto en español
|
|
993
|
-
var defaultTranslations$
|
|
993
|
+
var defaultTranslations$9 = {
|
|
994
994
|
dayOption: "Día específico",
|
|
995
995
|
dateRangeOption: "Rango de fechas",
|
|
996
996
|
selectDateAriaLabel: "Seleccionar fecha",
|
|
@@ -1008,7 +1008,7 @@ var DateSelector = function (_a) {
|
|
|
1008
1008
|
var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
|
|
1009
1009
|
var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
|
|
1010
1010
|
// Combinar traducciones por defecto con las proporcionadas
|
|
1011
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1011
|
+
var t = __assign(__assign({}, defaultTranslations$9), translations);
|
|
1012
1012
|
var handleTypeChange = function (value) {
|
|
1013
1013
|
var newType = value;
|
|
1014
1014
|
setType(newType);
|
|
@@ -1115,7 +1115,7 @@ var HeaderComponent = function (_a) {
|
|
|
1115
1115
|
};
|
|
1116
1116
|
HeaderComponent.displayName = "Header";
|
|
1117
1117
|
|
|
1118
|
-
var defaultTranslations$
|
|
1118
|
+
var defaultTranslations$8 = {
|
|
1119
1119
|
previewAlt: "Vista previa de imagen",
|
|
1120
1120
|
removeButtonAriaLabel: "Eliminar imagen",
|
|
1121
1121
|
emptyStateText: "No hay imágenes para mostrar",
|
|
@@ -1148,7 +1148,7 @@ var normalizeImages = function (images) {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
var ImagePreview = function (_a) {
|
|
1150
1150
|
var images = _a.images, _b = _a.size, size = _b === void 0 ? "small" : _b, onRemove = _a.onRemove, _c = _a.showRemoveButton, showRemoveButton = _c === void 0 ? true : _c, _d = _a.className, className = _d === void 0 ? "" : _d, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.backgroundColor, backgroundColor = _f === void 0 ? "bg-white dark:bg-gray-800" : _f, _g = _a.radius, radius = _g === void 0 ? "lg" : _g, _h = _a.showBorder, showBorder = _h === void 0 ? true : _h, onImageClick = _a.onImageClick;
|
|
1151
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1151
|
+
var t = __assign(__assign({}, defaultTranslations$8), translations);
|
|
1152
1152
|
var normalizedImages = normalizeImages(images);
|
|
1153
1153
|
var sizeClass = sizeClasses[size];
|
|
1154
1154
|
var radiusClass = radiusClasses[radius];
|
|
@@ -1436,13 +1436,13 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
1436
1436
|
];
|
|
1437
1437
|
}
|
|
1438
1438
|
|
|
1439
|
-
var defaultTranslations$
|
|
1439
|
+
var defaultTranslations$7 = {
|
|
1440
1440
|
checkIconTitle: "Check",
|
|
1441
1441
|
};
|
|
1442
1442
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
1443
1443
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
1444
1444
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
1445
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1445
|
+
var t = __assign(__assign({}, defaultTranslations$7), translations);
|
|
1446
1446
|
var steps = React.useMemo(function () {
|
|
1447
1447
|
if (typeof stepsProp === "number") {
|
|
1448
1448
|
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
@@ -2081,7 +2081,7 @@ var countries = [
|
|
|
2081
2081
|
];
|
|
2082
2082
|
var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
|
|
2083
2083
|
// Traducciones por defecto
|
|
2084
|
-
var defaultTranslations$
|
|
2084
|
+
var defaultTranslations$6 = {
|
|
2085
2085
|
label: "Teléfono",
|
|
2086
2086
|
placeholder: "Número de teléfono",
|
|
2087
2087
|
searchPlaceholder: "Buscar país...",
|
|
@@ -2099,7 +2099,7 @@ var Phone = function (_a) {
|
|
|
2099
2099
|
var portalDropdownRef = React.useRef(null);
|
|
2100
2100
|
var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
2101
2101
|
var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
2102
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2102
|
+
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
2103
2103
|
var finalLabel = label || t.label;
|
|
2104
2104
|
React.useEffect(function () {
|
|
2105
2105
|
if (value) {
|
|
@@ -2178,7 +2178,7 @@ var Phone = function (_a) {
|
|
|
2178
2178
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3", children: jsxRuntime.jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
2179
2179
|
};
|
|
2180
2180
|
|
|
2181
|
-
var defaultTranslations$
|
|
2181
|
+
var defaultTranslations$5 = {
|
|
2182
2182
|
message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
|
|
2183
2183
|
buttonText: "Explore",
|
|
2184
2184
|
closeButtonLabel: "Close Banner",
|
|
@@ -2188,7 +2188,7 @@ var defaultTranslations$4 = {
|
|
|
2188
2188
|
*/
|
|
2189
2189
|
var PromotionalBanner = function (_a) {
|
|
2190
2190
|
var message = _a.message, buttonText = _a.buttonText, _b = _a.messageHref, messageHref = _b === void 0 ? "#" : _b, _c = _a.buttonHref, buttonHref = _c === void 0 ? "#" : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, _e = _a.isVisible, isVisible = _e === void 0 ? true : _e, _f = _a.gradientColors, gradientColors = _f === void 0 ? ["default-100", "danger-100", "secondary-100"] : _f, _g = _a.buttonGradientColors, buttonGradientColors = _g === void 0 ? ["#F871A0", "#9353D3"] : _g, onClose = _a.onClose, onMessageClick = _a.onMessageClick, onButtonClick = _a.onButtonClick, _h = _a.messageLinkProps, messageLinkProps = _h === void 0 ? {} : _h, _j = _a.buttonProps, buttonProps = _j === void 0 ? {} : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
|
|
2191
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2191
|
+
var t = __assign(__assign({}, defaultTranslations$5), translations);
|
|
2192
2192
|
var finalMessage = message || t.message;
|
|
2193
2193
|
var finalButtonText = buttonText || t.buttonText;
|
|
2194
2194
|
var handleClose = function () {
|
|
@@ -2517,7 +2517,7 @@ var TimeInput = function (_a) {
|
|
|
2517
2517
|
* />
|
|
2518
2518
|
* ```
|
|
2519
2519
|
*/
|
|
2520
|
-
var defaultTranslations$
|
|
2520
|
+
var defaultTranslations$4 = {
|
|
2521
2521
|
/** Label for the start time input field */
|
|
2522
2522
|
from: "Desde",
|
|
2523
2523
|
/** Label for the end time input field */
|
|
@@ -2575,7 +2575,7 @@ var defaultTranslations$3 = {
|
|
|
2575
2575
|
*/
|
|
2576
2576
|
var ScheduleRow = function (_a) {
|
|
2577
2577
|
var day = _a.day, daySchedule = _a.daySchedule, _b = _a.translations, translations = _b === void 0 ? {} : _b, _c = _a.showCopyToAll, showCopyToAll = _c === void 0 ? false : _c, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
|
|
2578
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2578
|
+
var t = __assign(__assign({}, defaultTranslations$4), translations);
|
|
2579
2579
|
/**
|
|
2580
2580
|
* @function validateTimeSlots
|
|
2581
2581
|
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
@@ -2728,6 +2728,81 @@ var Select = function (_a) {
|
|
|
2728
2728
|
} })) }));
|
|
2729
2729
|
};
|
|
2730
2730
|
|
|
2731
|
+
var defaultTranslations$3 = {
|
|
2732
|
+
username: "tu_negocio",
|
|
2733
|
+
sendMessage: "Enviar mensaje",
|
|
2734
|
+
viewMore: "ver más",
|
|
2735
|
+
viewLess: "ver menos",
|
|
2736
|
+
timeAgo: "hace unos momentos",
|
|
2737
|
+
imageAlt: "Vista previa de red social",
|
|
2738
|
+
};
|
|
2739
|
+
/**
|
|
2740
|
+
* SocialMediaPreview component for displaying social media post previews
|
|
2741
|
+
* across multiple platforms: Instagram, Facebook, TikTok, and Twitter.
|
|
2742
|
+
*
|
|
2743
|
+
* @component
|
|
2744
|
+
* @example
|
|
2745
|
+
* ```tsx
|
|
2746
|
+
* <SocialMediaPreview
|
|
2747
|
+
* platform="instagram"
|
|
2748
|
+
* imageUrl="/path/to/image.jpg"
|
|
2749
|
+
* caption="Check out our new product!"
|
|
2750
|
+
* variant="full"
|
|
2751
|
+
* />
|
|
2752
|
+
* ```
|
|
2753
|
+
*/
|
|
2754
|
+
var SocialMediaPreview = function (_a) {
|
|
2755
|
+
var platform = _a.platform, imageUrl = _a.imageUrl, caption = _a.caption, _b = _a.variant, variant = _b === void 0 ? "full" : _b, _c = _a.showHeader, showHeader = _c === void 0 ? true : _c, _d = _a.maxCaptionLength, maxCaptionLength = _d === void 0 ? 125 : _d, onToggleCaption = _a.onToggleCaption, showFullCaption = _a.showFullCaption, username = _a.username, avatarUrl = _a.avatarUrl, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.className, className = _f === void 0 ? "" : _f, _g = _a.imageProps, imageProps = _g === void 0 ? {} : _g;
|
|
2756
|
+
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
2757
|
+
var displayUsername = username || t.username;
|
|
2758
|
+
var shouldTruncate = variant === "compact" && caption.length > maxCaptionLength;
|
|
2759
|
+
var getTruncatedCaption = function () {
|
|
2760
|
+
if (variant !== "compact") {
|
|
2761
|
+
return caption;
|
|
2762
|
+
}
|
|
2763
|
+
if (!shouldTruncate || showFullCaption) {
|
|
2764
|
+
return caption;
|
|
2765
|
+
}
|
|
2766
|
+
var firstLineEnd = caption.indexOf("\n");
|
|
2767
|
+
var truncateAt = firstLineEnd > 0 && firstLineEnd < maxCaptionLength
|
|
2768
|
+
? firstLineEnd
|
|
2769
|
+
: maxCaptionLength;
|
|
2770
|
+
return "".concat(caption.substring(0, truncateAt).trim(), "...");
|
|
2771
|
+
};
|
|
2772
|
+
var displayCaption = getTruncatedCaption();
|
|
2773
|
+
// Render Instagram Preview
|
|
2774
|
+
var renderInstagram = function () {
|
|
2775
|
+
if (variant === "story") {
|
|
2776
|
+
return renderInstagramStory();
|
|
2777
|
+
}
|
|
2778
|
+
return renderInstagramPost();
|
|
2779
|
+
};
|
|
2780
|
+
var renderInstagramStory = function () { return (jsxRuntime.jsxs("div", { className: "relative w-full bg-gradient-to-b from-gray-900 to-gray-800 rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxRuntime.jsxs("div", { className: "absolute inset-0", children: [jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsxRuntime.jsx("div", { className: "absolute inset-0 bg-black bg-opacity-20" })] })), showHeader && (jsxRuntime.jsxs("div", { className: "absolute top-0 left-0 right-0 z-10 p-4", children: [jsxRuntime.jsx("div", { className: "w-full h-0.5 bg-white bg-opacity-30 rounded-full mb-3", children: jsxRuntime.jsx("div", { className: "h-full w-1/3 bg-white rounded-full" }) }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center border-2 border-white", children: avatarUrl ? (jsxRuntime.jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsxRuntime.jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxRuntime.jsx("span", { className: "text-sm font-semibold text-white drop-shadow-lg", children: displayUsername }), jsxRuntime.jsx("span", { className: "text-xs text-white text-opacity-90", children: "hace 5min" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:play-circle-bold", className: "text-lg text-white drop-shadow-lg" }), jsxRuntime.jsx(IconComponent, { icon: "solar:volume-loud-bold", className: "text-lg text-white drop-shadow-lg" }), jsxRuntime.jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-white drop-shadow-lg" })] })] })] })), jsxRuntime.jsxs("div", { className: "absolute bottom-6 left-0 right-0 z-20 px-4 flex items-center gap-3", children: [jsxRuntime.jsx("input", { type: "text", placeholder: t.sendMessage, className: "flex-1 bg-transparent border-2 border-white border-opacity-70 rounded-full px-4 py-2 text-white placeholder-white placeholder-opacity-70 text-sm", readOnly: true }), jsxRuntime.jsx(IconComponent, { icon: "solar:heart-outline", className: "text-2xl text-white drop-shadow-lg" }), jsxRuntime.jsx(IconComponent, { icon: "solar:plain-outline", className: "text-2xl text-white drop-shadow-lg" })] })] })); };
|
|
2781
|
+
var renderInstagramPost = function () { return (jsxRuntime.jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-b-xl overflow-hidden", " h-full ").concat(className), children: [showHeader && (jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-800", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center", children: avatarUrl ? (jsxRuntime.jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsxRuntime.jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxRuntime.jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername })] }), jsxRuntime.jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-gray-900 dark:text-white" })] })), imageUrl && (jsxRuntime.jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800 overflow-hidden rounded-none ".concat(variant === "full" ? "h-80" : ""), style: variant === "compact" ? { aspectRatio: "1/1" } : {}, children: jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover rounded-none", radius: "none" }, imageProps)) })), jsxRuntime.jsxs("div", { className: "flex-1 p-3 overflow-y-auto", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:heart-bold", className: "text-xl text-gray-900 dark:text-white" }), jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl text-gray-900 dark:text-white" }), jsxRuntime.jsx(IconComponent, { icon: "solar:plain-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsxRuntime.jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsxRuntime.jsxs("div", { className: "text-sm text-left", children: [jsxRuntime.jsxs("div", { className: showFullCaption ? "overflow-y-auto" : "", style: { maxHeight: showFullCaption ? "150px" : "none" }, children: [jsxRuntime.jsx("span", { className: "font-semibold mr-2 text-gray-900 dark:text-white", children: displayUsername }), jsxRuntime.jsx("span", { className: "text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words", children: displayCaption })] }), shouldTruncate && onToggleCaption && variant !== "compact" && (jsxRuntime.jsx("button", { type: "button", onClick: function (e) {
|
|
2782
|
+
e.stopPropagation();
|
|
2783
|
+
onToggleCaption();
|
|
2784
|
+
}, className: "text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-300 font-normal mt-1 underline text-xs block", children: showFullCaption ? t.viewLess : t.viewMore }))] }), variant !== "compact" && (jsxRuntime.jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1 text-left", children: t.timeAgo }))] })] })); };
|
|
2785
|
+
// Render Facebook Preview
|
|
2786
|
+
var renderFacebook = function () { return (jsxRuntime.jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-xl overflow-hidden", " ").concat(className), children: [showHeader && (jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-full bg-blue-600 flex items-center justify-center", children: avatarUrl ? (jsxRuntime.jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsxRuntime.jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxRuntime.jsxs("div", { className: "flex-1", children: [jsxRuntime.jsx("p", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername }), jsxRuntime.jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400 flex items-center gap-1", children: [t.timeAgo, " \u00B7 ", jsxRuntime.jsx(IconComponent, { icon: "solar:earth-bold", className: "text-xs" })] })] }), jsxRuntime.jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-xl text-gray-600 dark:text-gray-400" })] }) })), jsxRuntime.jsx("div", { className: "px-4 py-2", children: jsxRuntime.jsx("p", { className: "text-sm text-gray-900 dark:text-white whitespace-pre-wrap break-words", children: displayCaption }) }), imageUrl && (jsxRuntime.jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800", children: jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsxRuntime.jsx("div", { className: "p-3 border-t border-gray-200 dark:border-gray-800", children: jsxRuntime.jsxs("div", { className: "flex items-center justify-around", children: [jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:like-bold", className: "text-xl" }), jsxRuntime.jsx("span", { className: "text-sm font-medium", children: "Me gusta" })] }), jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl" }), jsxRuntime.jsx("span", { className: "text-sm font-medium", children: "Comentar" })] }), jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:share-bold", className: "text-xl" }), jsxRuntime.jsx("span", { className: "text-sm font-medium", children: "Compartir" })] })] }) })] })); };
|
|
2787
|
+
// Render TikTok Preview
|
|
2788
|
+
var renderTikTok = function () { return (jsxRuntime.jsxs("div", { className: "relative w-full bg-black rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxRuntime.jsxs("div", { className: "absolute inset-0", children: [jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black opacity-60" })] })), jsxRuntime.jsxs("div", { className: "absolute right-2 bottom-20 flex flex-col items-center gap-6 z-20", children: [jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-full border-2 border-white bg-gray-900 flex items-center justify-center", children: avatarUrl ? (jsxRuntime.jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsxRuntime.jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-pink-500 flex items-center justify-center -mt-3 border-2 border-black", children: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-bold", className: "text-xs text-white" }) })] }), jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:heart-bold", className: "text-3xl text-white drop-shadow-lg" }), jsxRuntime.jsx("span", { className: "text-xs text-white font-semibold", children: "24.5K" })] }), jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-3xl text-white drop-shadow-lg" }), jsxRuntime.jsx("span", { className: "text-xs text-white font-semibold", children: "1,234" })] }), jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-3xl text-white drop-shadow-lg" }), jsxRuntime.jsx("span", { className: "text-xs text-white font-semibold", children: "453" })] }), jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:share-bold", className: "text-3xl text-white drop-shadow-lg" }), jsxRuntime.jsx("span", { className: "text-xs text-white font-semibold", children: "892" })] }), jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-lg bg-gray-800 border border-gray-700 flex items-center justify-center", children: jsxRuntime.jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-xl text-white" }) })] }), jsxRuntime.jsxs("div", { className: "absolute bottom-0 left-0 right-14 z-20 p-4", children: [jsxRuntime.jsxs("p", { className: "text-sm font-semibold text-white mb-1", children: ["@", displayUsername] }), jsxRuntime.jsx("p", { className: "text-sm text-white mb-2 line-clamp-2", children: displayCaption }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-white", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-sm" }), jsxRuntime.jsxs("span", { className: "truncate", children: ["Sonido original - ", displayUsername] })] })] })] })); };
|
|
2789
|
+
// Render Twitter Preview
|
|
2790
|
+
var renderTwitter = function () { return (jsxRuntime.jsx("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-xl border border-gray-200 dark:border-gray-800" : "rounded-xl border border-gray-200 dark:border-gray-800", " ").concat(className), children: jsxRuntime.jsx("div", { className: "p-4", children: jsxRuntime.jsxs("div", { className: "flex gap-3", children: [jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center flex-shrink-0", children: avatarUrl ? (jsxRuntime.jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsxRuntime.jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-1 mb-1", children: [jsxRuntime.jsx("span", { className: "font-bold text-gray-900 dark:text-white text-sm truncate", children: displayUsername }), jsxRuntime.jsx(IconComponent, { icon: "solar:verified-check-bold", className: "text-blue-500 text-base flex-shrink-0" }), jsxRuntime.jsxs("span", { className: "text-gray-500 dark:text-gray-400 text-sm truncate", children: ["@", displayUsername.toLowerCase().replace(/\s/g, "_")] }), jsxRuntime.jsx("span", { className: "text-gray-500 dark:text-gray-400 text-sm", children: "\u00B7 2h" })] }), jsxRuntime.jsx("p", { className: "text-gray-900 dark:text-white text-sm mb-3 whitespace-pre-wrap break-words", children: displayCaption }), imageUrl && (jsxRuntime.jsx("div", { className: "rounded-2xl overflow-hidden border border-gray-200 dark:border-gray-700 mb-3", children: jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsxRuntime.jsxs("div", { className: "flex items-center justify-between max-w-md mt-3", children: [jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-lg" }), jsxRuntime.jsx("span", { className: "text-xs", children: "234" })] }), jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-green-500 dark:hover:text-green-400 transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:repost-bold", className: "text-lg" }), jsxRuntime.jsx("span", { className: "text-xs", children: "1.2K" })] }), jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-pink-500 dark:hover:text-pink-400 transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:heart-bold", className: "text-lg" }), jsxRuntime.jsx("span", { className: "text-xs", children: "5.6K" })] }), jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:chart-2-bold", className: "text-lg" }), jsxRuntime.jsx("span", { className: "text-xs", children: "12K" })] }), jsxRuntime.jsx("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: jsxRuntime.jsx(IconComponent, { icon: "solar:share-bold", className: "text-lg" }) })] })] })] }) }) })); };
|
|
2791
|
+
// Main render logic
|
|
2792
|
+
switch (platform) {
|
|
2793
|
+
case "instagram":
|
|
2794
|
+
return renderInstagram();
|
|
2795
|
+
case "facebook":
|
|
2796
|
+
return renderFacebook();
|
|
2797
|
+
case "tiktok":
|
|
2798
|
+
return renderTikTok();
|
|
2799
|
+
case "twitter":
|
|
2800
|
+
return renderTwitter();
|
|
2801
|
+
default:
|
|
2802
|
+
return renderInstagram();
|
|
2803
|
+
}
|
|
2804
|
+
};
|
|
2805
|
+
|
|
2731
2806
|
function AuraTable(_a) {
|
|
2732
2807
|
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
2733
2808
|
return (jsxRuntime.jsxs(react.Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsxRuntime.jsx(react.TableHeader, { columns: columns, children: function (column) { return jsxRuntime.jsx(react.TableColumn, { children: column.label }, column.key); } }), jsxRuntime.jsx(react.TableBody, { items: items, children: function (item) { return (jsxRuntime.jsx(react.TableRow, { children: function (columnKey) { return (jsxRuntime.jsx(react.TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
|
|
@@ -4329,6 +4404,7 @@ exports.RowSteps = RowSteps;
|
|
|
4329
4404
|
exports.ScheduleRow = ScheduleRow;
|
|
4330
4405
|
exports.SearchInput = SearchInput;
|
|
4331
4406
|
exports.Select = Select;
|
|
4407
|
+
exports.SocialMediaPreview = SocialMediaPreview;
|
|
4332
4408
|
exports.StepIndicator = StepIndicator;
|
|
4333
4409
|
exports.SwitchComponent = Switch;
|
|
4334
4410
|
exports.Textarea = Textarea;
|
|
@@ -4342,7 +4418,7 @@ exports.VerticalSteps = VerticalSteps;
|
|
|
4342
4418
|
exports.Wizard = Wizard;
|
|
4343
4419
|
exports.WizardNavigation = WizardNavigation;
|
|
4344
4420
|
exports.WizardSidebar = WizardSidebar;
|
|
4345
|
-
exports.defaultTranslations = defaultTranslations$
|
|
4421
|
+
exports.defaultTranslations = defaultTranslations$4;
|
|
4346
4422
|
exports.sizeMap = sizeMap;
|
|
4347
4423
|
exports.themeColors = themeColors;
|
|
4348
4424
|
exports.useAuraToast = useAuraToast;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button as Button$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, Input as Input$1, RadioGroup, Radio, cn, Card as Card$1, Spacer, Tabs, Tab, Chip as Chip$1, Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Autocomplete, Breadcrumbs, BreadcrumbItem, DropdownSection, ListboxItem, Popover, PopoverTrigger, Tooltip as Tooltip$1, PopoverContent, Listbox, Accordion, AccordionItem, ListboxSection, Avatar, CardBody, CardFooter, Pagination as Pagination$1, Link, Switch as Switch$1, TimeInput as TimeInput$1, Select as Select$1, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Textarea as Textarea$1, Alert, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, Slider, ModalFooter as ModalFooter$1, Spinner, SelectItem, Drawer, DrawerContent, DrawerBody } from '@heroui/react';
|
|
1
|
+
import { Button as Button$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, Input as Input$1, RadioGroup, Radio, cn, Card as Card$1, Spacer, Tabs, Tab, Chip as Chip$1, Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Autocomplete, Breadcrumbs, BreadcrumbItem, DropdownSection, ListboxItem, Popover, PopoverTrigger, Tooltip as Tooltip$1, PopoverContent, Listbox, Accordion, AccordionItem, ListboxSection, Avatar, CardBody, CardFooter, Pagination as Pagination$1, Link, Switch as Switch$1, TimeInput as TimeInput$1, Select as Select$1, Image as Image$1, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Textarea as Textarea$1, Alert, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, Slider, ModalFooter as ModalFooter$1, Spinner, SelectItem, Drawer, DrawerContent, DrawerBody } from '@heroui/react';
|
|
2
2
|
export * from '@heroui/react';
|
|
3
3
|
export { Slider } from '@heroui/react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -178,7 +178,7 @@ var Input = function (_a) {
|
|
|
178
178
|
} })));
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
var defaultTranslations$
|
|
181
|
+
var defaultTranslations$b = {
|
|
182
182
|
addHolidayTitle: "Add holiday",
|
|
183
183
|
dayOption: "Day",
|
|
184
184
|
dateRangeOption: "Date range",
|
|
@@ -202,7 +202,7 @@ var INITIAL_HOLIDAY_STATE = {
|
|
|
202
202
|
*/
|
|
203
203
|
var AddHolidayForm = function (_a) {
|
|
204
204
|
var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
|
|
205
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
205
|
+
var t = __assign(__assign({}, defaultTranslations$b), translations);
|
|
206
206
|
var _b = useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
|
|
207
207
|
/**
|
|
208
208
|
* A boolean flag that determines if a date has been set.
|
|
@@ -272,7 +272,7 @@ var P = function (_a) {
|
|
|
272
272
|
return (jsx("p", __assign({ className: cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
var defaultTranslations$
|
|
275
|
+
var defaultTranslations$a = {
|
|
276
276
|
title: "Analytics",
|
|
277
277
|
description: "Monthly growth of your metrics during the selected period",
|
|
278
278
|
viewDetails: "View Details",
|
|
@@ -326,7 +326,7 @@ var formatMonth = function (month) {
|
|
|
326
326
|
var AnalyticsCard = function (_a) {
|
|
327
327
|
var _b, _c;
|
|
328
328
|
var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
|
|
329
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
329
|
+
var t = __assign(__assign({}, defaultTranslations$a), translations);
|
|
330
330
|
var _h = useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
|
|
331
331
|
var activeChartData = useMemo(function () {
|
|
332
332
|
var _a;
|
|
@@ -991,7 +991,7 @@ var Chip = function (_a) {
|
|
|
991
991
|
};
|
|
992
992
|
|
|
993
993
|
// Traducciones por defecto en español
|
|
994
|
-
var defaultTranslations$
|
|
994
|
+
var defaultTranslations$9 = {
|
|
995
995
|
dayOption: "Día específico",
|
|
996
996
|
dateRangeOption: "Rango de fechas",
|
|
997
997
|
selectDateAriaLabel: "Seleccionar fecha",
|
|
@@ -1009,7 +1009,7 @@ var DateSelector = function (_a) {
|
|
|
1009
1009
|
var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
|
|
1010
1010
|
var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
|
|
1011
1011
|
// Combinar traducciones por defecto con las proporcionadas
|
|
1012
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1012
|
+
var t = __assign(__assign({}, defaultTranslations$9), translations);
|
|
1013
1013
|
var handleTypeChange = function (value) {
|
|
1014
1014
|
var newType = value;
|
|
1015
1015
|
setType(newType);
|
|
@@ -1116,7 +1116,7 @@ var HeaderComponent = function (_a) {
|
|
|
1116
1116
|
};
|
|
1117
1117
|
HeaderComponent.displayName = "Header";
|
|
1118
1118
|
|
|
1119
|
-
var defaultTranslations$
|
|
1119
|
+
var defaultTranslations$8 = {
|
|
1120
1120
|
previewAlt: "Vista previa de imagen",
|
|
1121
1121
|
removeButtonAriaLabel: "Eliminar imagen",
|
|
1122
1122
|
emptyStateText: "No hay imágenes para mostrar",
|
|
@@ -1149,7 +1149,7 @@ var normalizeImages = function (images) {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
var ImagePreview = function (_a) {
|
|
1151
1151
|
var images = _a.images, _b = _a.size, size = _b === void 0 ? "small" : _b, onRemove = _a.onRemove, _c = _a.showRemoveButton, showRemoveButton = _c === void 0 ? true : _c, _d = _a.className, className = _d === void 0 ? "" : _d, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.backgroundColor, backgroundColor = _f === void 0 ? "bg-white dark:bg-gray-800" : _f, _g = _a.radius, radius = _g === void 0 ? "lg" : _g, _h = _a.showBorder, showBorder = _h === void 0 ? true : _h, onImageClick = _a.onImageClick;
|
|
1152
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1152
|
+
var t = __assign(__assign({}, defaultTranslations$8), translations);
|
|
1153
1153
|
var normalizedImages = normalizeImages(images);
|
|
1154
1154
|
var sizeClass = sizeClasses[size];
|
|
1155
1155
|
var radiusClass = radiusClasses[radius];
|
|
@@ -1437,13 +1437,13 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
1437
1437
|
];
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
-
var defaultTranslations$
|
|
1440
|
+
var defaultTranslations$7 = {
|
|
1441
1441
|
checkIconTitle: "Check",
|
|
1442
1442
|
};
|
|
1443
1443
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
1444
1444
|
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
1445
1445
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
1446
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1446
|
+
var t = __assign(__assign({}, defaultTranslations$7), translations);
|
|
1447
1447
|
var steps = React.useMemo(function () {
|
|
1448
1448
|
if (typeof stepsProp === "number") {
|
|
1449
1449
|
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
@@ -2082,7 +2082,7 @@ var countries = [
|
|
|
2082
2082
|
];
|
|
2083
2083
|
var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
|
|
2084
2084
|
// Traducciones por defecto
|
|
2085
|
-
var defaultTranslations$
|
|
2085
|
+
var defaultTranslations$6 = {
|
|
2086
2086
|
label: "Teléfono",
|
|
2087
2087
|
placeholder: "Número de teléfono",
|
|
2088
2088
|
searchPlaceholder: "Buscar país...",
|
|
@@ -2100,7 +2100,7 @@ var Phone = function (_a) {
|
|
|
2100
2100
|
var portalDropdownRef = useRef(null);
|
|
2101
2101
|
var _l = useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
2102
2102
|
var _m = useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
2103
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2103
|
+
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
2104
2104
|
var finalLabel = label || t.label;
|
|
2105
2105
|
useEffect(function () {
|
|
2106
2106
|
if (value) {
|
|
@@ -2179,7 +2179,7 @@ var Phone = function (_a) {
|
|
|
2179
2179
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3", children: jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
2180
2180
|
};
|
|
2181
2181
|
|
|
2182
|
-
var defaultTranslations$
|
|
2182
|
+
var defaultTranslations$5 = {
|
|
2183
2183
|
message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
|
|
2184
2184
|
buttonText: "Explore",
|
|
2185
2185
|
closeButtonLabel: "Close Banner",
|
|
@@ -2189,7 +2189,7 @@ var defaultTranslations$4 = {
|
|
|
2189
2189
|
*/
|
|
2190
2190
|
var PromotionalBanner = function (_a) {
|
|
2191
2191
|
var message = _a.message, buttonText = _a.buttonText, _b = _a.messageHref, messageHref = _b === void 0 ? "#" : _b, _c = _a.buttonHref, buttonHref = _c === void 0 ? "#" : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, _e = _a.isVisible, isVisible = _e === void 0 ? true : _e, _f = _a.gradientColors, gradientColors = _f === void 0 ? ["default-100", "danger-100", "secondary-100"] : _f, _g = _a.buttonGradientColors, buttonGradientColors = _g === void 0 ? ["#F871A0", "#9353D3"] : _g, onClose = _a.onClose, onMessageClick = _a.onMessageClick, onButtonClick = _a.onButtonClick, _h = _a.messageLinkProps, messageLinkProps = _h === void 0 ? {} : _h, _j = _a.buttonProps, buttonProps = _j === void 0 ? {} : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
|
|
2192
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2192
|
+
var t = __assign(__assign({}, defaultTranslations$5), translations);
|
|
2193
2193
|
var finalMessage = message || t.message;
|
|
2194
2194
|
var finalButtonText = buttonText || t.buttonText;
|
|
2195
2195
|
var handleClose = function () {
|
|
@@ -2518,7 +2518,7 @@ var TimeInput = function (_a) {
|
|
|
2518
2518
|
* />
|
|
2519
2519
|
* ```
|
|
2520
2520
|
*/
|
|
2521
|
-
var defaultTranslations$
|
|
2521
|
+
var defaultTranslations$4 = {
|
|
2522
2522
|
/** Label for the start time input field */
|
|
2523
2523
|
from: "Desde",
|
|
2524
2524
|
/** Label for the end time input field */
|
|
@@ -2576,7 +2576,7 @@ var defaultTranslations$3 = {
|
|
|
2576
2576
|
*/
|
|
2577
2577
|
var ScheduleRow = function (_a) {
|
|
2578
2578
|
var day = _a.day, daySchedule = _a.daySchedule, _b = _a.translations, translations = _b === void 0 ? {} : _b, _c = _a.showCopyToAll, showCopyToAll = _c === void 0 ? false : _c, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
|
|
2579
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
2579
|
+
var t = __assign(__assign({}, defaultTranslations$4), translations);
|
|
2580
2580
|
/**
|
|
2581
2581
|
* @function validateTimeSlots
|
|
2582
2582
|
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
@@ -2729,6 +2729,81 @@ var Select = function (_a) {
|
|
|
2729
2729
|
} })) }));
|
|
2730
2730
|
};
|
|
2731
2731
|
|
|
2732
|
+
var defaultTranslations$3 = {
|
|
2733
|
+
username: "tu_negocio",
|
|
2734
|
+
sendMessage: "Enviar mensaje",
|
|
2735
|
+
viewMore: "ver más",
|
|
2736
|
+
viewLess: "ver menos",
|
|
2737
|
+
timeAgo: "hace unos momentos",
|
|
2738
|
+
imageAlt: "Vista previa de red social",
|
|
2739
|
+
};
|
|
2740
|
+
/**
|
|
2741
|
+
* SocialMediaPreview component for displaying social media post previews
|
|
2742
|
+
* across multiple platforms: Instagram, Facebook, TikTok, and Twitter.
|
|
2743
|
+
*
|
|
2744
|
+
* @component
|
|
2745
|
+
* @example
|
|
2746
|
+
* ```tsx
|
|
2747
|
+
* <SocialMediaPreview
|
|
2748
|
+
* platform="instagram"
|
|
2749
|
+
* imageUrl="/path/to/image.jpg"
|
|
2750
|
+
* caption="Check out our new product!"
|
|
2751
|
+
* variant="full"
|
|
2752
|
+
* />
|
|
2753
|
+
* ```
|
|
2754
|
+
*/
|
|
2755
|
+
var SocialMediaPreview = function (_a) {
|
|
2756
|
+
var platform = _a.platform, imageUrl = _a.imageUrl, caption = _a.caption, _b = _a.variant, variant = _b === void 0 ? "full" : _b, _c = _a.showHeader, showHeader = _c === void 0 ? true : _c, _d = _a.maxCaptionLength, maxCaptionLength = _d === void 0 ? 125 : _d, onToggleCaption = _a.onToggleCaption, showFullCaption = _a.showFullCaption, username = _a.username, avatarUrl = _a.avatarUrl, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.className, className = _f === void 0 ? "" : _f, _g = _a.imageProps, imageProps = _g === void 0 ? {} : _g;
|
|
2757
|
+
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
2758
|
+
var displayUsername = username || t.username;
|
|
2759
|
+
var shouldTruncate = variant === "compact" && caption.length > maxCaptionLength;
|
|
2760
|
+
var getTruncatedCaption = function () {
|
|
2761
|
+
if (variant !== "compact") {
|
|
2762
|
+
return caption;
|
|
2763
|
+
}
|
|
2764
|
+
if (!shouldTruncate || showFullCaption) {
|
|
2765
|
+
return caption;
|
|
2766
|
+
}
|
|
2767
|
+
var firstLineEnd = caption.indexOf("\n");
|
|
2768
|
+
var truncateAt = firstLineEnd > 0 && firstLineEnd < maxCaptionLength
|
|
2769
|
+
? firstLineEnd
|
|
2770
|
+
: maxCaptionLength;
|
|
2771
|
+
return "".concat(caption.substring(0, truncateAt).trim(), "...");
|
|
2772
|
+
};
|
|
2773
|
+
var displayCaption = getTruncatedCaption();
|
|
2774
|
+
// Render Instagram Preview
|
|
2775
|
+
var renderInstagram = function () {
|
|
2776
|
+
if (variant === "story") {
|
|
2777
|
+
return renderInstagramStory();
|
|
2778
|
+
}
|
|
2779
|
+
return renderInstagramPost();
|
|
2780
|
+
};
|
|
2781
|
+
var renderInstagramStory = function () { return (jsxs("div", { className: "relative w-full bg-gradient-to-b from-gray-900 to-gray-800 rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxs("div", { className: "absolute inset-0", children: [jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsx("div", { className: "absolute inset-0 bg-black bg-opacity-20" })] })), showHeader && (jsxs("div", { className: "absolute top-0 left-0 right-0 z-10 p-4", children: [jsx("div", { className: "w-full h-0.5 bg-white bg-opacity-30 rounded-full mb-3", children: jsx("div", { className: "h-full w-1/3 bg-white rounded-full" }) }), jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center border-2 border-white", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("span", { className: "text-sm font-semibold text-white drop-shadow-lg", children: displayUsername }), jsx("span", { className: "text-xs text-white text-opacity-90", children: "hace 5min" })] }), jsxs("div", { className: "flex items-center gap-3", children: [jsx(IconComponent, { icon: "solar:play-circle-bold", className: "text-lg text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:volume-loud-bold", className: "text-lg text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-white drop-shadow-lg" })] })] })] })), jsxs("div", { className: "absolute bottom-6 left-0 right-0 z-20 px-4 flex items-center gap-3", children: [jsx("input", { type: "text", placeholder: t.sendMessage, className: "flex-1 bg-transparent border-2 border-white border-opacity-70 rounded-full px-4 py-2 text-white placeholder-white placeholder-opacity-70 text-sm", readOnly: true }), jsx(IconComponent, { icon: "solar:heart-outline", className: "text-2xl text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:plain-outline", className: "text-2xl text-white drop-shadow-lg" })] })] })); };
|
|
2782
|
+
var renderInstagramPost = function () { return (jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-b-xl overflow-hidden", " h-full ").concat(className), children: [showHeader && (jsxs("div", { className: "flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-800", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername })] }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-gray-900 dark:text-white" })] })), imageUrl && (jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800 overflow-hidden rounded-none ".concat(variant === "full" ? "h-80" : ""), style: variant === "compact" ? { aspectRatio: "1/1" } : {}, children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover rounded-none", radius: "none" }, imageProps)) })), jsxs("div", { className: "flex-1 p-3 overflow-y-auto", children: [jsxs("div", { className: "flex items-center justify-between mb-2", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-xl text-gray-900 dark:text-white" }), jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl text-gray-900 dark:text-white" }), jsx(IconComponent, { icon: "solar:plain-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsxs("div", { className: "text-sm text-left", children: [jsxs("div", { className: showFullCaption ? "overflow-y-auto" : "", style: { maxHeight: showFullCaption ? "150px" : "none" }, children: [jsx("span", { className: "font-semibold mr-2 text-gray-900 dark:text-white", children: displayUsername }), jsx("span", { className: "text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words", children: displayCaption })] }), shouldTruncate && onToggleCaption && variant !== "compact" && (jsx("button", { type: "button", onClick: function (e) {
|
|
2783
|
+
e.stopPropagation();
|
|
2784
|
+
onToggleCaption();
|
|
2785
|
+
}, className: "text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-300 font-normal mt-1 underline text-xs block", children: showFullCaption ? t.viewLess : t.viewMore }))] }), variant !== "compact" && (jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1 text-left", children: t.timeAgo }))] })] })); };
|
|
2786
|
+
// Render Facebook Preview
|
|
2787
|
+
var renderFacebook = function () { return (jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-xl overflow-hidden", " ").concat(className), children: [showHeader && (jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: jsxs("div", { className: "flex items-center gap-3", children: [jsx("div", { className: "w-10 h-10 rounded-full bg-blue-600 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxs("div", { className: "flex-1", children: [jsx("p", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername }), jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400 flex items-center gap-1", children: [t.timeAgo, " \u00B7 ", jsx(IconComponent, { icon: "solar:earth-bold", className: "text-xs" })] })] }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-xl text-gray-600 dark:text-gray-400" })] }) })), jsx("div", { className: "px-4 py-2", children: jsx("p", { className: "text-sm text-gray-900 dark:text-white whitespace-pre-wrap break-words", children: displayCaption }) }), imageUrl && (jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800", children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsx("div", { className: "p-3 border-t border-gray-200 dark:border-gray-800", children: jsxs("div", { className: "flex items-center justify-around", children: [jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:like-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Me gusta" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Comentar" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:share-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Compartir" })] })] }) })] })); };
|
|
2788
|
+
// Render TikTok Preview
|
|
2789
|
+
var renderTikTok = function () { return (jsxs("div", { className: "relative w-full bg-black rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxs("div", { className: "absolute inset-0", children: [jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black opacity-60" })] })), jsxs("div", { className: "absolute right-2 bottom-20 flex flex-col items-center gap-6 z-20", children: [jsxs("div", { className: "flex flex-col items-center", children: [jsx("div", { className: "w-12 h-12 rounded-full border-2 border-white bg-gray-900 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("div", { className: "w-6 h-6 rounded-full bg-pink-500 flex items-center justify-center -mt-3 border-2 border-black", children: jsx(IconComponent, { icon: "solar:add-circle-bold", className: "text-xs text-white" }) })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "24.5K" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "1,234" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "453" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:share-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "892" })] }), jsx("div", { className: "w-10 h-10 rounded-lg bg-gray-800 border border-gray-700 flex items-center justify-center", children: jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-xl text-white" }) })] }), jsxs("div", { className: "absolute bottom-0 left-0 right-14 z-20 p-4", children: [jsxs("p", { className: "text-sm font-semibold text-white mb-1", children: ["@", displayUsername] }), jsx("p", { className: "text-sm text-white mb-2 line-clamp-2", children: displayCaption }), jsxs("div", { className: "flex items-center gap-2 text-xs text-white", children: [jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-sm" }), jsxs("span", { className: "truncate", children: ["Sonido original - ", displayUsername] })] })] })] })); };
|
|
2790
|
+
// Render Twitter Preview
|
|
2791
|
+
var renderTwitter = function () { return (jsx("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-xl border border-gray-200 dark:border-gray-800" : "rounded-xl border border-gray-200 dark:border-gray-800", " ").concat(className), children: jsx("div", { className: "p-4", children: jsxs("div", { className: "flex gap-3", children: [jsx("div", { className: "w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center flex-shrink-0", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-1 mb-1", children: [jsx("span", { className: "font-bold text-gray-900 dark:text-white text-sm truncate", children: displayUsername }), jsx(IconComponent, { icon: "solar:verified-check-bold", className: "text-blue-500 text-base flex-shrink-0" }), jsxs("span", { className: "text-gray-500 dark:text-gray-400 text-sm truncate", children: ["@", displayUsername.toLowerCase().replace(/\s/g, "_")] }), jsx("span", { className: "text-gray-500 dark:text-gray-400 text-sm", children: "\u00B7 2h" })] }), jsx("p", { className: "text-gray-900 dark:text-white text-sm mb-3 whitespace-pre-wrap break-words", children: displayCaption }), imageUrl && (jsx("div", { className: "rounded-2xl overflow-hidden border border-gray-200 dark:border-gray-700 mb-3", children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsxs("div", { className: "flex items-center justify-between max-w-md mt-3", children: [jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "234" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-green-500 dark:hover:text-green-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:repost-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "1.2K" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-pink-500 dark:hover:text-pink-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "5.6K" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:chart-2-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "12K" })] }), jsx("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: jsx(IconComponent, { icon: "solar:share-bold", className: "text-lg" }) })] })] })] }) }) })); };
|
|
2792
|
+
// Main render logic
|
|
2793
|
+
switch (platform) {
|
|
2794
|
+
case "instagram":
|
|
2795
|
+
return renderInstagram();
|
|
2796
|
+
case "facebook":
|
|
2797
|
+
return renderFacebook();
|
|
2798
|
+
case "tiktok":
|
|
2799
|
+
return renderTikTok();
|
|
2800
|
+
case "twitter":
|
|
2801
|
+
return renderTwitter();
|
|
2802
|
+
default:
|
|
2803
|
+
return renderInstagram();
|
|
2804
|
+
}
|
|
2805
|
+
};
|
|
2806
|
+
|
|
2732
2807
|
function AuraTable(_a) {
|
|
2733
2808
|
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
2734
2809
|
return (jsxs(Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsx(TableHeader, { columns: columns, children: function (column) { return jsx(TableColumn, { children: column.label }, column.key); } }), jsx(TableBody, { items: items, children: function (item) { return (jsx(TableRow, { children: function (columnKey) { return (jsx(TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
|
|
@@ -4280,4 +4355,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
4280
4355
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
4281
4356
|
};
|
|
4282
4357
|
|
|
4283
|
-
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, Wizard, WizardNavigation, WizardSidebar, defaultTranslations$
|
|
4358
|
+
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, Wizard, WizardNavigation, WizardSidebar, defaultTranslations$4 as defaultTranslations, sizeMap, themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { SocialMediaPreviewProps } from "./SocialMediaPreview.types";
|
|
3
|
+
/**
|
|
4
|
+
* SocialMediaPreview component for displaying social media post previews
|
|
5
|
+
* across multiple platforms: Instagram, Facebook, TikTok, and Twitter.
|
|
6
|
+
*
|
|
7
|
+
* @component
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <SocialMediaPreview
|
|
11
|
+
* platform="instagram"
|
|
12
|
+
* imageUrl="/path/to/image.jpg"
|
|
13
|
+
* caption="Check out our new product!"
|
|
14
|
+
* variant="full"
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const SocialMediaPreview: React.FC<SocialMediaPreviewProps>;
|
|
19
|
+
//# sourceMappingURL=SocialMediaPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialMediaPreview.d.ts","sourceRoot":"","sources":["../../../../src/components/social-media-preview/SocialMediaPreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACX,uBAAuB,EAEvB,MAAM,4BAA4B,CAAC;AAWpC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+chE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ImageProps } from "@heroui/react";
|
|
2
|
+
export type SocialPlatform = "instagram" | "facebook" | "tiktok" | "twitter";
|
|
3
|
+
export type PreviewVariant = "compact" | "full" | "story";
|
|
4
|
+
export interface SocialMediaPreviewTranslations {
|
|
5
|
+
/** Username placeholder */
|
|
6
|
+
username?: string;
|
|
7
|
+
/** "Send message" placeholder text */
|
|
8
|
+
sendMessage?: string;
|
|
9
|
+
/** "View more" text for caption truncation */
|
|
10
|
+
viewMore?: string;
|
|
11
|
+
/** "View less" text for caption truncation */
|
|
12
|
+
viewLess?: string;
|
|
13
|
+
/** Time ago text */
|
|
14
|
+
timeAgo?: string;
|
|
15
|
+
/** Alt text for images */
|
|
16
|
+
imageAlt?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SocialMediaPreviewProps {
|
|
19
|
+
/** Social media platform to preview */
|
|
20
|
+
platform: SocialPlatform;
|
|
21
|
+
/** Image URL to display */
|
|
22
|
+
imageUrl?: string;
|
|
23
|
+
/** Caption/text content */
|
|
24
|
+
caption: string;
|
|
25
|
+
/** Preview variant */
|
|
26
|
+
variant?: PreviewVariant;
|
|
27
|
+
/** Show header with user info */
|
|
28
|
+
showHeader?: boolean;
|
|
29
|
+
/** Maximum caption length before truncation */
|
|
30
|
+
maxCaptionLength?: number;
|
|
31
|
+
/** Callback for "view more/less" toggle */
|
|
32
|
+
onToggleCaption?: () => void;
|
|
33
|
+
/** State for expanded caption */
|
|
34
|
+
showFullCaption?: boolean;
|
|
35
|
+
/** Custom username (defaults to platform-specific) */
|
|
36
|
+
username?: string;
|
|
37
|
+
/** Custom avatar URL */
|
|
38
|
+
avatarUrl?: string;
|
|
39
|
+
/** Translations for i18n support */
|
|
40
|
+
translations?: SocialMediaPreviewTranslations;
|
|
41
|
+
/** Additional className for custom styling */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Props passed to the Image component */
|
|
44
|
+
imageProps?: Omit<ImageProps, "src" | "alt">;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=SocialMediaPreview.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialMediaPreview.types.d.ts","sourceRoot":"","sources":["../../../../src/components/social-media-preview/SocialMediaPreview.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7E,MAAM,MAAM,cAAc,GACvB,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AAEX,MAAM,WAAW,8BAA8B;IAC9C,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACvC,uCAAuC;IACvC,QAAQ,EAAE,cAAc,CAAC;IACzB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,iCAAiC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,YAAY,CAAC,EAAE,8BAA8B,CAAC;IAC9C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;CAC7C"}
|