@beweco/aurora-ui 0.1.27 → 0.1.29

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/index.cjs.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var react = require('@heroui/react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
6
5
  var react$1 = require('@iconify/react');
6
+ var React = require('react');
7
7
  var recharts = require('recharts');
8
8
  var framerMotion = require('framer-motion');
9
9
  var reactDom = require('react-dom');
@@ -102,6 +102,129 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
102
102
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
103
103
  };
104
104
 
105
+ var sizeMap = {
106
+ sm: "16px",
107
+ md: "20px",
108
+ lg: "24px",
109
+ xl: "32px",
110
+ };
111
+ var IconComponent = function (_a) {
112
+ var _b;
113
+ var icon = _a.icon, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, style = _a.style, color = _a.color, hFlip = _a.hFlip, vFlip = _a.vFlip, flip = _a.flip, rotate = _a.rotate, nativeProps = __rest(_a, ["icon", "size", "className", "style", "color", "hFlip", "vFlip", "flip", "rotate"]);
114
+ var iconSize = (_b = sizeMap[size]) !== null && _b !== void 0 ? _b : sizeMap.md;
115
+ return (jsxRuntime.jsx("span", __assign({}, nativeProps, { children: jsxRuntime.jsx(react$1.Icon, { icon: icon, width: iconSize, height: iconSize, className: className, style: style, color: color, hFlip: hFlip, vFlip: vFlip, flip: flip, rotate: rotate }) })));
116
+ };
117
+
118
+ /**
119
+ * AccordionList - A flexible component for displaying lists of items
120
+ * Supports two modes:
121
+ * - accordion: Expandable items with collapsible content
122
+ * - list: Flat list of items (similar to client notes/communications)
123
+ *
124
+ * **IMPORTANTE - Paginación:**
125
+ * Este componente NO maneja paginación internamente. El padre debe:
126
+ * 1. Pasar solo items de la página actual (ej: 20-30 items)
127
+ * 2. Calcular totalPages basado en total de registros del backend
128
+ * 3. Manejar onPageChange para fetch de nuevos datos
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * // Accordion mode (Social Networks - Proposed Content)
133
+ * <AccordionList
134
+ * mode="accordion"
135
+ * items={contents}
136
+ * header={{
137
+ * getTitle: (item) => item.title,
138
+ * getMetadata: (item) => [
139
+ * { key: "type", label: item.type, color: "primary" }
140
+ * ]
141
+ * }}
142
+ * content={{
143
+ * render: (item) => <div>{item.description}</div>
144
+ * }}
145
+ * actions={[
146
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
147
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
148
+ * ]}
149
+ * />
150
+ *
151
+ * // List mode (Clients - Notes History)
152
+ * <AccordionList
153
+ * mode="list"
154
+ * items={notes}
155
+ * header={{
156
+ * getTitle: (item) => item.title,
157
+ * getSubtitle: (item) => item.description
158
+ * }}
159
+ * actions={[
160
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
161
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
162
+ * ]}
163
+ * />
164
+ *
165
+ * // With pagination (controlled by parent)
166
+ * <AccordionList
167
+ * items={currentPageItems} // Only items of current page
168
+ * pagination={{
169
+ * currentPage: 1,
170
+ * totalPages: Math.ceil(totalRecords / pageSize), // Based on backend total
171
+ * onPageChange: (page) => fetchPage(page) // Parent fetches new data
172
+ * }}
173
+ * />
174
+ * ```
175
+ */
176
+ function AccordionList(_a) {
177
+ var items = _a.items, header = _a.header, content = _a.content, _b = _a.actions, actions = _b === void 0 ? [] : _b, _c = _a.mode, mode = _c === void 0 ? "list" : _c, pagination = _a.pagination, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, emptyState = _a.emptyState, sectionTitle = _a.sectionTitle, sectionIcon = _a.sectionIcon, _e = _a.showCount, showCount = _e === void 0 ? true : _e, _f = _a.className, className = _f === void 0 ? "" : _f, _g = _a.accordionVariant, accordionVariant = _g === void 0 ? "splitted" : _g, _h = _a.selectionMode, selectionMode = _h === void 0 ? "multiple" : _h, _j = _a.disableIndicatorAnimation, disableIndicatorAnimation = _j === void 0 ? false : _j, loadingComponent = _a.loadingComponent, emptyStateComponent = _a.emptyStateComponent;
178
+ // Loading State
179
+ if (isLoading) {
180
+ if (loadingComponent) {
181
+ return jsxRuntime.jsx("div", { className: className, children: loadingComponent });
182
+ }
183
+ return (jsxRuntime.jsx("div", { className: "flex flex-col gap-3 ".concat(className), children: Array.from({ length: 3 }).map(function (_, index) { return (jsxRuntime.jsxs("div", { className: "p-4 border border-default-100 rounded-lg", children: [jsxRuntime.jsx(react.Skeleton, { className: "h-4 w-3/4 mb-2" }), jsxRuntime.jsx(react.Skeleton, { className: "h-3 w-full mb-2" }), jsxRuntime.jsx(react.Skeleton, { className: "h-3 w-2/3" })] }, "skeleton-".concat(index))); }) }));
184
+ }
185
+ // Empty State
186
+ if (items.length === 0) {
187
+ if (emptyStateComponent) {
188
+ return jsxRuntime.jsx("div", { className: className, children: emptyStateComponent });
189
+ }
190
+ if (emptyState) {
191
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 ".concat(className), children: [jsxRuntime.jsx(IconComponent, { icon: emptyState.icon, className: "w-16 h-16 text-default-300 mb-4" }), jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-default-900 mb-2", children: emptyState.title }), emptyState.description && (jsxRuntime.jsx("p", { className: "text-sm text-default-500 mb-4 text-center max-w-md", children: emptyState.description })), emptyState.actionText && emptyState.onAction && (jsxRuntime.jsx(react.Button, { color: "primary", onPress: emptyState.onAction, children: emptyState.actionText }))] }));
192
+ }
193
+ return null;
194
+ }
195
+ // Render Actions
196
+ var renderActions = function (item) {
197
+ var visibleActions = actions.filter(function (action) {
198
+ if (action.show === undefined)
199
+ return true;
200
+ if (typeof action.show === "function")
201
+ return action.show(item);
202
+ return action.show;
203
+ });
204
+ return (jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: function (e) { return e.stopPropagation(); }, children: visibleActions.map(function (action) { return (jsxRuntime.jsx(react.Button, { variant: "light", color: action.color || "default", size: "sm", isIconOnly: true, onPress: function () { return action.onPress(item); }, className: action.className, title: action.tooltip, children: jsxRuntime.jsx(IconComponent, { icon: action.icon, className: "w-4 h-4" }) }, action.key)); }) }));
205
+ };
206
+ // Render Metadata Chips
207
+ var renderMetadata = function (item) {
208
+ if (!header.getMetadata)
209
+ return null;
210
+ var metadata = header.getMetadata(item);
211
+ return (jsxRuntime.jsx("div", { className: "flex items-center gap-2 flex-wrap", children: metadata.map(function (meta) { return (jsxRuntime.jsx(react.Chip, { size: "sm", variant: meta.variant || "flat", color: meta.color || "default", className: "text-xs", startContent: meta.icon ? jsxRuntime.jsx(IconComponent, { icon: meta.icon, className: "w-3 h-3" }) : undefined, children: meta.label }, meta.key)); }) }));
212
+ };
213
+ // Accordion Mode
214
+ if (mode === "accordion") {
215
+ if (!content) {
216
+ console.warn("AccordionList: content prop is required for accordion mode");
217
+ return null;
218
+ }
219
+ return (jsxRuntime.jsxs("div", { className: "h-full w-full ".concat(className), children: [(sectionTitle || sectionIcon) && (jsxRuntime.jsx("div", { className: "mb-4 flex items-center justify-between", children: jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [sectionIcon && (jsxRuntime.jsx(IconComponent, { icon: sectionIcon, className: "w-5 h-5 text-violet-600 dark:text-violet-400" })), sectionTitle && (jsxRuntime.jsx("h3", { className: "text-base font-semibold text-foreground", children: sectionTitle })), showCount && (jsxRuntime.jsx(react.Chip, { size: "sm", variant: "flat", color: "secondary", children: items.length }))] }) })), jsxRuntime.jsx(react.Accordion, { variant: accordionVariant, selectionMode: selectionMode, disableIndicatorAnimation: disableIndicatorAnimation, children: items.map(function (item) { return (jsxRuntime.jsx(react.AccordionItem, { "aria-label": header.getTitle(item), indicator: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", className: "w-4 h-4 text-default-400 transition-transform duration-200 data-[open=true]:rotate-180" }), classNames: {
220
+ indicator: "data-[open=true]:rotate-180 transition-transform duration-200",
221
+ }, title: jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full pr-4", children: [jsxRuntime.jsx("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: header.customRender ? (header.customRender(item)) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "text-sm text-default-900 truncate", children: header.getTitle(item) }), renderMetadata(item)] })) }), actions.length > 0 && renderActions(item)] }), children: jsxRuntime.jsx("div", { className: "pb-4", children: content.render(item) }) }, item.id)); }) }), pagination && pagination.totalPages > 1 && (jsxRuntime.jsx("div", { className: "flex justify-center mt-4", children: jsxRuntime.jsx(react.Pagination, { isCompact: pagination.isCompact, showControls: pagination.showControls, showShadow: true, color: "primary", page: pagination.currentPage, total: pagination.totalPages, onChange: pagination.onPageChange }) }))] }));
222
+ }
223
+ // List Mode
224
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [(sectionTitle || sectionIcon) && (jsxRuntime.jsx("div", { className: "mb-1 flex items-center justify-between", children: jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [sectionIcon && (jsxRuntime.jsx(IconComponent, { icon: sectionIcon, className: "w-5 h-5 text-primary-600 dark:text-primary-400" })), sectionTitle && (jsxRuntime.jsx("h3", { className: "text-base font-semibold text-foreground", children: sectionTitle })), showCount && (jsxRuntime.jsx(react.Chip, { size: "sm", variant: "flat", color: "primary", children: items.length }))] }) })), items.map(function (item) { return (jsxRuntime.jsxs("div", { className: "flex items-start justify-between p-4 border border-default-100 rounded-lg transition-colors bg-default-50 hover:bg-default-100", children: [jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: header.customRender ? (header.customRender(item)) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "flex items-center gap-2 mb-2", children: jsxRuntime.jsx("span", { className: "text-sm font-medium text-default-900 truncate", children: header.getTitle(item) }) }), header.getSubtitle && (jsxRuntime.jsx("p", { className: "text-sm text-default-700 line-clamp-2 leading-relaxed mb-2", children: header.getSubtitle(item) })), renderMetadata(item)] })) }), actions.length > 0 && (jsxRuntime.jsx("div", { className: "ml-4 flex-shrink-0", children: renderActions(item) }))] }, item.id)); }), pagination && pagination.totalPages > 1 && (jsxRuntime.jsx("div", { className: "flex justify-center mt-4", children: jsxRuntime.jsx(react.Pagination, { isCompact: pagination.isCompact, showControls: pagination.showControls, showShadow: true, color: "primary", page: pagination.currentPage, total: pagination.totalPages, onChange: pagination.onPageChange }) }))] }));
225
+ }
226
+ AccordionList.displayName = "AccordionList";
227
+
105
228
  exports.HolidayType = void 0;
106
229
  (function (HolidayType) {
107
230
  HolidayType["SingleDay"] = "singleDay";
@@ -144,19 +267,6 @@ var DateRangePicker = function (_a) {
144
267
  } }, props, { id: autoId })));
145
268
  };
146
269
 
147
- var sizeMap = {
148
- sm: "16px",
149
- md: "20px",
150
- lg: "24px",
151
- xl: "32px",
152
- };
153
- var IconComponent = function (_a) {
154
- var _b;
155
- var icon = _a.icon, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, style = _a.style, color = _a.color, hFlip = _a.hFlip, vFlip = _a.vFlip, flip = _a.flip, rotate = _a.rotate, nativeProps = __rest(_a, ["icon", "size", "className", "style", "color", "hFlip", "vFlip", "flip", "rotate"]);
156
- var iconSize = (_b = sizeMap[size]) !== null && _b !== void 0 ? _b : sizeMap.md;
157
- return (jsxRuntime.jsx("span", __assign({}, nativeProps, { children: jsxRuntime.jsx(react$1.Icon, { icon: icon, width: iconSize, height: iconSize, className: className, style: style, color: color, hFlip: hFlip, vFlip: vFlip, flip: flip, rotate: rotate }) })));
158
- };
159
-
160
270
  /**
161
271
  * Input genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
162
272
  *
@@ -2974,10 +3084,23 @@ var defaultTranslations$3 = {
2974
3084
  * ```
2975
3085
  */
2976
3086
  var SocialMediaPreview = function (_a) {
2977
- 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;
3087
+ var platform = _a.platform, imageUrl = _a.imageUrl, caption = _a.caption, _b = _a.variant, variant = _b === void 0 ? "full" : _b, _c = _a.postAspectRatio, postAspectRatio = _c === void 0 ? "square" : _c, _d = _a.showHeader, showHeader = _d === void 0 ? true : _d, _e = _a.maxCaptionLength, maxCaptionLength = _e === void 0 ? 125 : _e, onToggleCaption = _a.onToggleCaption, showFullCaption = _a.showFullCaption, username = _a.username, avatarUrl = _a.avatarUrl, _f = _a.translations, translations = _f === void 0 ? {} : _f, _g = _a.className, className = _g === void 0 ? "" : _g, _h = _a.imageProps, imageProps = _h === void 0 ? {} : _h;
2978
3088
  var t = __assign(__assign({}, defaultTranslations$3), translations);
2979
3089
  var displayUsername = username || t.username;
2980
3090
  var shouldTruncate = variant === "compact" && caption.length > maxCaptionLength;
3091
+ // Get aspect ratio based on postAspectRatio prop
3092
+ var getAspectRatio = function () {
3093
+ switch (postAspectRatio) {
3094
+ case "square":
3095
+ return "1/1"; // 1080 x 1080px
3096
+ case "portrait":
3097
+ return "4/5"; // 1080 x 1350px
3098
+ case "landscape":
3099
+ return "1.91/1"; // 1080 x 566px
3100
+ default:
3101
+ return "1/1";
3102
+ }
3103
+ };
2981
3104
  var getTruncatedCaption = function () {
2982
3105
  if (variant !== "compact") {
2983
3106
  return caption;
@@ -3000,7 +3123,7 @@ var SocialMediaPreview = function (_a) {
3000
3123
  return renderInstagramPost();
3001
3124
  };
3002
3125
  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" })] })] })); };
3003
- 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) {
3126
+ 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-black overflow-hidden rounded-none flex items-center justify-center", style: { aspectRatio: getAspectRatio() }, children: jsxRuntime.jsx(react.Image, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-contain 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) {
3004
3127
  e.stopPropagation();
3005
3128
  onToggleCaption();
3006
3129
  }, 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 }))] })] })); };
@@ -4584,6 +4707,7 @@ Object.defineProperty(exports, "loadIcons", {
4584
4707
  enumerable: true,
4585
4708
  get: function () { return react$1.loadIcons; }
4586
4709
  });
4710
+ exports.AccordionList = AccordionList;
4587
4711
  exports.AddHolidayForm = AddHolidayForm;
4588
4712
  exports.AnalyticsCard = AnalyticsCard;
4589
4713
  exports.AuraAutocomplete = AuraAutocomplete;
package/dist/index.esm.js CHANGED
@@ -1,10 +1,10 @@
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';
1
+ import { Skeleton, Button as Button$1, Chip as Chip$1, Accordion, AccordionItem, Pagination as Pagination$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, Input as Input$1, RadioGroup, Radio, cn, Card as Card$1, Spacer, Tabs, Tab, Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Autocomplete, Breadcrumbs, BreadcrumbItem, DropdownSection, ListboxItem, Popover, PopoverTrigger, Tooltip as Tooltip$1, PopoverContent, Listbox, ListboxSection, Avatar, CardBody, CardFooter, 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';
5
- import React, { useId, useState, useCallback, useMemo, createContext, useContext, useEffect, createElement, useRef, useLayoutEffect } from 'react';
6
5
  import { Icon } from '@iconify/react';
7
6
  export { loadIcons } from '@iconify/react';
7
+ import React, { useId, useState, useCallback, useMemo, createContext, useContext, useEffect, createElement, useRef, useLayoutEffect } from 'react';
8
8
  import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip, Area } from 'recharts';
9
9
  import { LazyMotion, domAnimation, m } from 'framer-motion';
10
10
  import { createPortal } from 'react-dom';
@@ -103,6 +103,129 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
103
103
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
104
104
  };
105
105
 
106
+ var sizeMap = {
107
+ sm: "16px",
108
+ md: "20px",
109
+ lg: "24px",
110
+ xl: "32px",
111
+ };
112
+ var IconComponent = function (_a) {
113
+ var _b;
114
+ var icon = _a.icon, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, style = _a.style, color = _a.color, hFlip = _a.hFlip, vFlip = _a.vFlip, flip = _a.flip, rotate = _a.rotate, nativeProps = __rest(_a, ["icon", "size", "className", "style", "color", "hFlip", "vFlip", "flip", "rotate"]);
115
+ var iconSize = (_b = sizeMap[size]) !== null && _b !== void 0 ? _b : sizeMap.md;
116
+ return (jsx("span", __assign({}, nativeProps, { children: jsx(Icon, { icon: icon, width: iconSize, height: iconSize, className: className, style: style, color: color, hFlip: hFlip, vFlip: vFlip, flip: flip, rotate: rotate }) })));
117
+ };
118
+
119
+ /**
120
+ * AccordionList - A flexible component for displaying lists of items
121
+ * Supports two modes:
122
+ * - accordion: Expandable items with collapsible content
123
+ * - list: Flat list of items (similar to client notes/communications)
124
+ *
125
+ * **IMPORTANTE - Paginación:**
126
+ * Este componente NO maneja paginación internamente. El padre debe:
127
+ * 1. Pasar solo items de la página actual (ej: 20-30 items)
128
+ * 2. Calcular totalPages basado en total de registros del backend
129
+ * 3. Manejar onPageChange para fetch de nuevos datos
130
+ *
131
+ * @example
132
+ * ```tsx
133
+ * // Accordion mode (Social Networks - Proposed Content)
134
+ * <AccordionList
135
+ * mode="accordion"
136
+ * items={contents}
137
+ * header={{
138
+ * getTitle: (item) => item.title,
139
+ * getMetadata: (item) => [
140
+ * { key: "type", label: item.type, color: "primary" }
141
+ * ]
142
+ * }}
143
+ * content={{
144
+ * render: (item) => <div>{item.description}</div>
145
+ * }}
146
+ * actions={[
147
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
148
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
149
+ * ]}
150
+ * />
151
+ *
152
+ * // List mode (Clients - Notes History)
153
+ * <AccordionList
154
+ * mode="list"
155
+ * items={notes}
156
+ * header={{
157
+ * getTitle: (item) => item.title,
158
+ * getSubtitle: (item) => item.description
159
+ * }}
160
+ * actions={[
161
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
162
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
163
+ * ]}
164
+ * />
165
+ *
166
+ * // With pagination (controlled by parent)
167
+ * <AccordionList
168
+ * items={currentPageItems} // Only items of current page
169
+ * pagination={{
170
+ * currentPage: 1,
171
+ * totalPages: Math.ceil(totalRecords / pageSize), // Based on backend total
172
+ * onPageChange: (page) => fetchPage(page) // Parent fetches new data
173
+ * }}
174
+ * />
175
+ * ```
176
+ */
177
+ function AccordionList(_a) {
178
+ var items = _a.items, header = _a.header, content = _a.content, _b = _a.actions, actions = _b === void 0 ? [] : _b, _c = _a.mode, mode = _c === void 0 ? "list" : _c, pagination = _a.pagination, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, emptyState = _a.emptyState, sectionTitle = _a.sectionTitle, sectionIcon = _a.sectionIcon, _e = _a.showCount, showCount = _e === void 0 ? true : _e, _f = _a.className, className = _f === void 0 ? "" : _f, _g = _a.accordionVariant, accordionVariant = _g === void 0 ? "splitted" : _g, _h = _a.selectionMode, selectionMode = _h === void 0 ? "multiple" : _h, _j = _a.disableIndicatorAnimation, disableIndicatorAnimation = _j === void 0 ? false : _j, loadingComponent = _a.loadingComponent, emptyStateComponent = _a.emptyStateComponent;
179
+ // Loading State
180
+ if (isLoading) {
181
+ if (loadingComponent) {
182
+ return jsx("div", { className: className, children: loadingComponent });
183
+ }
184
+ return (jsx("div", { className: "flex flex-col gap-3 ".concat(className), children: Array.from({ length: 3 }).map(function (_, index) { return (jsxs("div", { className: "p-4 border border-default-100 rounded-lg", children: [jsx(Skeleton, { className: "h-4 w-3/4 mb-2" }), jsx(Skeleton, { className: "h-3 w-full mb-2" }), jsx(Skeleton, { className: "h-3 w-2/3" })] }, "skeleton-".concat(index))); }) }));
185
+ }
186
+ // Empty State
187
+ if (items.length === 0) {
188
+ if (emptyStateComponent) {
189
+ return jsx("div", { className: className, children: emptyStateComponent });
190
+ }
191
+ if (emptyState) {
192
+ return (jsxs("div", { className: "flex flex-col items-center justify-center py-12 ".concat(className), children: [jsx(IconComponent, { icon: emptyState.icon, className: "w-16 h-16 text-default-300 mb-4" }), jsx("h3", { className: "text-lg font-semibold text-default-900 mb-2", children: emptyState.title }), emptyState.description && (jsx("p", { className: "text-sm text-default-500 mb-4 text-center max-w-md", children: emptyState.description })), emptyState.actionText && emptyState.onAction && (jsx(Button$1, { color: "primary", onPress: emptyState.onAction, children: emptyState.actionText }))] }));
193
+ }
194
+ return null;
195
+ }
196
+ // Render Actions
197
+ var renderActions = function (item) {
198
+ var visibleActions = actions.filter(function (action) {
199
+ if (action.show === undefined)
200
+ return true;
201
+ if (typeof action.show === "function")
202
+ return action.show(item);
203
+ return action.show;
204
+ });
205
+ return (jsx("div", { className: "flex items-center gap-1", onClick: function (e) { return e.stopPropagation(); }, children: visibleActions.map(function (action) { return (jsx(Button$1, { variant: "light", color: action.color || "default", size: "sm", isIconOnly: true, onPress: function () { return action.onPress(item); }, className: action.className, title: action.tooltip, children: jsx(IconComponent, { icon: action.icon, className: "w-4 h-4" }) }, action.key)); }) }));
206
+ };
207
+ // Render Metadata Chips
208
+ var renderMetadata = function (item) {
209
+ if (!header.getMetadata)
210
+ return null;
211
+ var metadata = header.getMetadata(item);
212
+ return (jsx("div", { className: "flex items-center gap-2 flex-wrap", children: metadata.map(function (meta) { return (jsx(Chip$1, { size: "sm", variant: meta.variant || "flat", color: meta.color || "default", className: "text-xs", startContent: meta.icon ? jsx(IconComponent, { icon: meta.icon, className: "w-3 h-3" }) : undefined, children: meta.label }, meta.key)); }) }));
213
+ };
214
+ // Accordion Mode
215
+ if (mode === "accordion") {
216
+ if (!content) {
217
+ console.warn("AccordionList: content prop is required for accordion mode");
218
+ return null;
219
+ }
220
+ return (jsxs("div", { className: "h-full w-full ".concat(className), children: [(sectionTitle || sectionIcon) && (jsx("div", { className: "mb-4 flex items-center justify-between", children: jsxs("div", { className: "flex items-center gap-2", children: [sectionIcon && (jsx(IconComponent, { icon: sectionIcon, className: "w-5 h-5 text-violet-600 dark:text-violet-400" })), sectionTitle && (jsx("h3", { className: "text-base font-semibold text-foreground", children: sectionTitle })), showCount && (jsx(Chip$1, { size: "sm", variant: "flat", color: "secondary", children: items.length }))] }) })), jsx(Accordion, { variant: accordionVariant, selectionMode: selectionMode, disableIndicatorAnimation: disableIndicatorAnimation, children: items.map(function (item) { return (jsx(AccordionItem, { "aria-label": header.getTitle(item), indicator: jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", className: "w-4 h-4 text-default-400 transition-transform duration-200 data-[open=true]:rotate-180" }), classNames: {
221
+ indicator: "data-[open=true]:rotate-180 transition-transform duration-200",
222
+ }, title: jsxs("div", { className: "flex items-center justify-between w-full pr-4", children: [jsx("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: header.customRender ? (header.customRender(item)) : (jsxs(Fragment, { children: [jsx("span", { className: "text-sm text-default-900 truncate", children: header.getTitle(item) }), renderMetadata(item)] })) }), actions.length > 0 && renderActions(item)] }), children: jsx("div", { className: "pb-4", children: content.render(item) }) }, item.id)); }) }), pagination && pagination.totalPages > 1 && (jsx("div", { className: "flex justify-center mt-4", children: jsx(Pagination$1, { isCompact: pagination.isCompact, showControls: pagination.showControls, showShadow: true, color: "primary", page: pagination.currentPage, total: pagination.totalPages, onChange: pagination.onPageChange }) }))] }));
223
+ }
224
+ // List Mode
225
+ return (jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [(sectionTitle || sectionIcon) && (jsx("div", { className: "mb-1 flex items-center justify-between", children: jsxs("div", { className: "flex items-center gap-2", children: [sectionIcon && (jsx(IconComponent, { icon: sectionIcon, className: "w-5 h-5 text-primary-600 dark:text-primary-400" })), sectionTitle && (jsx("h3", { className: "text-base font-semibold text-foreground", children: sectionTitle })), showCount && (jsx(Chip$1, { size: "sm", variant: "flat", color: "primary", children: items.length }))] }) })), items.map(function (item) { return (jsxs("div", { className: "flex items-start justify-between p-4 border border-default-100 rounded-lg transition-colors bg-default-50 hover:bg-default-100", children: [jsx("div", { className: "flex-1 min-w-0", children: header.customRender ? (header.customRender(item)) : (jsxs(Fragment, { children: [jsx("div", { className: "flex items-center gap-2 mb-2", children: jsx("span", { className: "text-sm font-medium text-default-900 truncate", children: header.getTitle(item) }) }), header.getSubtitle && (jsx("p", { className: "text-sm text-default-700 line-clamp-2 leading-relaxed mb-2", children: header.getSubtitle(item) })), renderMetadata(item)] })) }), actions.length > 0 && (jsx("div", { className: "ml-4 flex-shrink-0", children: renderActions(item) }))] }, item.id)); }), pagination && pagination.totalPages > 1 && (jsx("div", { className: "flex justify-center mt-4", children: jsx(Pagination$1, { isCompact: pagination.isCompact, showControls: pagination.showControls, showShadow: true, color: "primary", page: pagination.currentPage, total: pagination.totalPages, onChange: pagination.onPageChange }) }))] }));
226
+ }
227
+ AccordionList.displayName = "AccordionList";
228
+
106
229
  var HolidayType;
107
230
  (function (HolidayType) {
108
231
  HolidayType["SingleDay"] = "singleDay";
@@ -145,19 +268,6 @@ var DateRangePicker = function (_a) {
145
268
  } }, props, { id: autoId })));
146
269
  };
147
270
 
148
- var sizeMap = {
149
- sm: "16px",
150
- md: "20px",
151
- lg: "24px",
152
- xl: "32px",
153
- };
154
- var IconComponent = function (_a) {
155
- var _b;
156
- var icon = _a.icon, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, style = _a.style, color = _a.color, hFlip = _a.hFlip, vFlip = _a.vFlip, flip = _a.flip, rotate = _a.rotate, nativeProps = __rest(_a, ["icon", "size", "className", "style", "color", "hFlip", "vFlip", "flip", "rotate"]);
157
- var iconSize = (_b = sizeMap[size]) !== null && _b !== void 0 ? _b : sizeMap.md;
158
- return (jsx("span", __assign({}, nativeProps, { children: jsx(Icon, { icon: icon, width: iconSize, height: iconSize, className: className, style: style, color: color, hFlip: hFlip, vFlip: vFlip, flip: flip, rotate: rotate }) })));
159
- };
160
-
161
271
  /**
162
272
  * Input genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
163
273
  *
@@ -2975,10 +3085,23 @@ var defaultTranslations$3 = {
2975
3085
  * ```
2976
3086
  */
2977
3087
  var SocialMediaPreview = function (_a) {
2978
- 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;
3088
+ var platform = _a.platform, imageUrl = _a.imageUrl, caption = _a.caption, _b = _a.variant, variant = _b === void 0 ? "full" : _b, _c = _a.postAspectRatio, postAspectRatio = _c === void 0 ? "square" : _c, _d = _a.showHeader, showHeader = _d === void 0 ? true : _d, _e = _a.maxCaptionLength, maxCaptionLength = _e === void 0 ? 125 : _e, onToggleCaption = _a.onToggleCaption, showFullCaption = _a.showFullCaption, username = _a.username, avatarUrl = _a.avatarUrl, _f = _a.translations, translations = _f === void 0 ? {} : _f, _g = _a.className, className = _g === void 0 ? "" : _g, _h = _a.imageProps, imageProps = _h === void 0 ? {} : _h;
2979
3089
  var t = __assign(__assign({}, defaultTranslations$3), translations);
2980
3090
  var displayUsername = username || t.username;
2981
3091
  var shouldTruncate = variant === "compact" && caption.length > maxCaptionLength;
3092
+ // Get aspect ratio based on postAspectRatio prop
3093
+ var getAspectRatio = function () {
3094
+ switch (postAspectRatio) {
3095
+ case "square":
3096
+ return "1/1"; // 1080 x 1080px
3097
+ case "portrait":
3098
+ return "4/5"; // 1080 x 1350px
3099
+ case "landscape":
3100
+ return "1.91/1"; // 1080 x 566px
3101
+ default:
3102
+ return "1/1";
3103
+ }
3104
+ };
2982
3105
  var getTruncatedCaption = function () {
2983
3106
  if (variant !== "compact") {
2984
3107
  return caption;
@@ -3001,7 +3124,7 @@ var SocialMediaPreview = function (_a) {
3001
3124
  return renderInstagramPost();
3002
3125
  };
3003
3126
  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" })] })] })); };
3004
- 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) {
3127
+ 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-black overflow-hidden rounded-none flex items-center justify-center", style: { aspectRatio: getAspectRatio() }, children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-contain 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) {
3005
3128
  e.stopPropagation();
3006
3129
  onToggleCaption();
3007
3130
  }, 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 }))] })] })); };
@@ -4577,4 +4700,4 @@ var NavigationLoadingProvider = function (_a) {
4577
4700
  return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
4578
4701
  };
4579
4702
 
4580
- export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, ContentCarousel, 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, SocialMediaBar, SocialMediaCarousel, 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 };
4703
+ export { AccordionList, AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, ContentCarousel, 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, SocialMediaBar, SocialMediaCarousel, 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,64 @@
1
+ import type { AccordionListProps, BaseAccordionItem } from "./AccordionList.types";
2
+ /**
3
+ * AccordionList - A flexible component for displaying lists of items
4
+ * Supports two modes:
5
+ * - accordion: Expandable items with collapsible content
6
+ * - list: Flat list of items (similar to client notes/communications)
7
+ *
8
+ * **IMPORTANTE - Paginación:**
9
+ * Este componente NO maneja paginación internamente. El padre debe:
10
+ * 1. Pasar solo items de la página actual (ej: 20-30 items)
11
+ * 2. Calcular totalPages basado en total de registros del backend
12
+ * 3. Manejar onPageChange para fetch de nuevos datos
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // Accordion mode (Social Networks - Proposed Content)
17
+ * <AccordionList
18
+ * mode="accordion"
19
+ * items={contents}
20
+ * header={{
21
+ * getTitle: (item) => item.title,
22
+ * getMetadata: (item) => [
23
+ * { key: "type", label: item.type, color: "primary" }
24
+ * ]
25
+ * }}
26
+ * content={{
27
+ * render: (item) => <div>{item.description}</div>
28
+ * }}
29
+ * actions={[
30
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
31
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
32
+ * ]}
33
+ * />
34
+ *
35
+ * // List mode (Clients - Notes History)
36
+ * <AccordionList
37
+ * mode="list"
38
+ * items={notes}
39
+ * header={{
40
+ * getTitle: (item) => item.title,
41
+ * getSubtitle: (item) => item.description
42
+ * }}
43
+ * actions={[
44
+ * { key: "edit", icon: "solar:pen-outline", onPress: handleEdit },
45
+ * { key: "delete", icon: "solar:trash-bin-minimalistic-outline", onPress: handleDelete, color: "danger" }
46
+ * ]}
47
+ * />
48
+ *
49
+ * // With pagination (controlled by parent)
50
+ * <AccordionList
51
+ * items={currentPageItems} // Only items of current page
52
+ * pagination={{
53
+ * currentPage: 1,
54
+ * totalPages: Math.ceil(totalRecords / pageSize), // Based on backend total
55
+ * onPageChange: (page) => fetchPage(page) // Parent fetches new data
56
+ * }}
57
+ * />
58
+ * ```
59
+ */
60
+ export declare function AccordionList<T extends BaseAccordionItem = BaseAccordionItem>({ items, header, content, actions, mode, pagination, isLoading, emptyState, sectionTitle, sectionIcon, showCount, className, accordionVariant, selectionMode, disableIndicatorAnimation, loadingComponent, emptyStateComponent, }: AccordionListProps<T>): import("react/jsx-runtime").JSX.Element | null;
61
+ export declare namespace AccordionList {
62
+ var displayName: string;
63
+ }
64
+ //# sourceMappingURL=AccordionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccordionList.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion-list/AccordionList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,kBAAkB,EAClB,iBAAiB,EAEjB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAAE,EAC9E,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAY,EACZ,IAAa,EACb,UAAU,EACV,SAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,SAAgB,EAChB,SAAc,EACd,gBAA6B,EAC7B,aAA0B,EAC1B,yBAAiC,EACjC,gBAAgB,EAChB,mBAAmB,GACnB,EAAE,kBAAkB,CAAC,CAAC,CAAC,kDA8QvB;yBAhSe,aAAa"}