@beweco/aurora-ui 0.1.16 → 0.1.19

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
@@ -139,7 +139,7 @@ var Input = function (_a) {
139
139
  } })));
140
140
  };
141
141
 
142
- var defaultTranslations$7 = {
142
+ var defaultTranslations$8 = {
143
143
  addHolidayTitle: "Add holiday",
144
144
  dayOption: "Day",
145
145
  dateRangeOption: "Date range",
@@ -163,7 +163,7 @@ var INITIAL_HOLIDAY_STATE = {
163
163
  */
164
164
  var AddHolidayForm = function (_a) {
165
165
  var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
166
- var t = __assign(__assign({}, defaultTranslations$7), translations);
166
+ var t = __assign(__assign({}, defaultTranslations$8), translations);
167
167
  var _b = React.useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
168
168
  /**
169
169
  * A boolean flag that determines if a date has been set.
@@ -233,7 +233,7 @@ var P = function (_a) {
233
233
  return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
234
234
  };
235
235
 
236
- var defaultTranslations$6 = {
236
+ var defaultTranslations$7 = {
237
237
  title: "Analytics",
238
238
  description: "Monthly growth of your metrics during the selected period",
239
239
  viewDetails: "View Details",
@@ -287,7 +287,7 @@ var formatMonth = function (month) {
287
287
  var AnalyticsCard = function (_a) {
288
288
  var _b, _c;
289
289
  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"]);
290
- var t = __assign(__assign({}, defaultTranslations$6), translations);
290
+ var t = __assign(__assign({}, defaultTranslations$7), translations);
291
291
  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];
292
292
  var activeChartData = React.useMemo(function () {
293
293
  var _a;
@@ -952,7 +952,7 @@ var Chip = function (_a) {
952
952
  };
953
953
 
954
954
  // Traducciones por defecto en español
955
- var defaultTranslations$5 = {
955
+ var defaultTranslations$6 = {
956
956
  dayOption: "Día específico",
957
957
  dateRangeOption: "Rango de fechas",
958
958
  selectDateAriaLabel: "Seleccionar fecha",
@@ -970,7 +970,7 @@ var DateSelector = function (_a) {
970
970
  var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
971
971
  var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
972
972
  // Combinar traducciones por defecto con las proporcionadas
973
- var t = __assign(__assign({}, defaultTranslations$5), translations);
973
+ var t = __assign(__assign({}, defaultTranslations$6), translations);
974
974
  var handleTypeChange = function (value) {
975
975
  var newType = value;
976
976
  setType(newType);
@@ -1337,13 +1337,13 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
1337
1337
  ];
1338
1338
  }
1339
1339
 
1340
- var defaultTranslations$4 = {
1340
+ var defaultTranslations$5 = {
1341
1341
  checkIconTitle: "Check",
1342
1342
  };
1343
1343
  var VerticalSteps = React.forwardRef(function (_a, ref) {
1344
1344
  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"]);
1345
1345
  var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
1346
- var t = __assign(__assign({}, defaultTranslations$4), translations);
1346
+ var t = __assign(__assign({}, defaultTranslations$5), translations);
1347
1347
  var steps = React.useMemo(function () {
1348
1348
  if (typeof stepsProp === "number") {
1349
1349
  return Array.from({ length: stepsProp }, function () { return ({}); });
@@ -1592,7 +1592,7 @@ var countries = [
1592
1592
  ];
1593
1593
  var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
1594
1594
  // Traducciones por defecto
1595
- var defaultTranslations$3 = {
1595
+ var defaultTranslations$4 = {
1596
1596
  label: "Teléfono",
1597
1597
  placeholder: "Número de teléfono",
1598
1598
  searchPlaceholder: "Buscar país...",
@@ -1610,7 +1610,7 @@ var Phone = function (_a) {
1610
1610
  var portalDropdownRef = React.useRef(null);
1611
1611
  var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
1612
1612
  var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
1613
- var t = __assign(__assign({}, defaultTranslations$3), translations);
1613
+ var t = __assign(__assign({}, defaultTranslations$4), translations);
1614
1614
  var finalLabel = label || t.label;
1615
1615
  React.useEffect(function () {
1616
1616
  if (value) {
@@ -1689,7 +1689,7 @@ var Phone = function (_a) {
1689
1689
  : ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3 text-lg", children: country.flag }), 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 })] }, country.code)); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
1690
1690
  };
1691
1691
 
1692
- var defaultTranslations$2 = {
1692
+ var defaultTranslations$3 = {
1693
1693
  message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
1694
1694
  buttonText: "Explore",
1695
1695
  closeButtonLabel: "Close Banner",
@@ -1699,7 +1699,7 @@ var defaultTranslations$2 = {
1699
1699
  */
1700
1700
  var PromotionalBanner = function (_a) {
1701
1701
  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;
1702
- var t = __assign(__assign({}, defaultTranslations$2), translations);
1702
+ var t = __assign(__assign({}, defaultTranslations$3), translations);
1703
1703
  var finalMessage = message || t.message;
1704
1704
  var finalButtonText = buttonText || t.buttonText;
1705
1705
  var handleClose = function () {
@@ -1997,6 +1997,52 @@ var TimeInput = function (_a) {
1997
1997
  } })));
1998
1998
  };
1999
1999
 
2000
+ /**
2001
+ * @file schedule-row.constants.ts
2002
+ * @description Default translations for the ScheduleRow component.
2003
+ * These translations are used when no custom translations are provided via props.
2004
+ * The component supports full internationalization by overriding these defaults.
2005
+ */
2006
+ /**
2007
+ * @constant defaultTranslations
2008
+ * @description Default translations in Spanish for the ScheduleRow component.
2009
+ * These can be overridden by passing a `translations` prop to the component.
2010
+ *
2011
+ * @example
2012
+ * ```tsx
2013
+ * // Using default Spanish translations
2014
+ * <ScheduleRow day="Lunes" daySchedule={...} />
2015
+ *
2016
+ * // Overriding with English translations
2017
+ * <ScheduleRow
2018
+ * day="Monday"
2019
+ * daySchedule={...}
2020
+ * translations={{
2021
+ * from: "From",
2022
+ * to: "To",
2023
+ * open: "Open",
2024
+ * closed: "Closed",
2025
+ * copyToAll: "Copy to all",
2026
+ * addTimeSlot: "Add time slot"
2027
+ * }}
2028
+ * />
2029
+ * ```
2030
+ */
2031
+ var defaultTranslations$2 = {
2032
+ /** Label for the start time input field */
2033
+ from: "Desde",
2034
+ /** Label for the end time input field */
2035
+ to: "Hasta",
2036
+ /** Label shown when the day is active/open */
2037
+ open: "Abierto",
2038
+ /** Label shown when the day is inactive/closed */
2039
+ closed: "Cerrado",
2040
+ /** Label for the button that copies schedule to all days */
2041
+ copyToAll: "Copiar a todos",
2042
+ /** Label for the button that adds a new time slot */
2043
+ addTimeSlot: "Agregar horario",
2044
+ };
2045
+
2000
2046
  /**
2001
2047
  * @component ScheduleRow
2002
2048
  * @description A React component for managing the schedule of a single day.
@@ -2004,11 +2050,43 @@ var TimeInput = function (_a) {
2004
2050
  * and modify the start and end times of each slot. The component is fully
2005
2051
  * controlled and reports changes to the parent via the `onChange` callback.
2006
2052
  *
2053
+ * Features:
2054
+ * - Toggle day open/closed status
2055
+ * - Add multiple time slots per day
2056
+ * - Edit start (from) and end (to) times for each slot
2057
+ * - Remove time slots (with minimum of one slot)
2058
+ * - Automatic validation to prevent invalid time ranges (from > to)
2059
+ * - Copy schedule to all days functionality
2060
+ * - Always displays an empty slot for adding new times
2061
+ * - Internationalization support via translations prop
2062
+ *
2063
+ * @example
2064
+ * ```tsx
2065
+ * <ScheduleRow
2066
+ * day="Monday"
2067
+ * daySchedule={{
2068
+ * isOpen: true,
2069
+ * timeSlots: [{ from: "09:00", to: "17:00" }]
2070
+ * }}
2071
+ * translations={{
2072
+ * from: "From",
2073
+ * to: "To",
2074
+ * open: "Open",
2075
+ * closed: "Closed",
2076
+ * copyToAll: "Copy to all",
2077
+ * addTimeSlot: "Add time slot"
2078
+ * }}
2079
+ * onChange={(newSchedule) => console.log(newSchedule)}
2080
+ * onCopyToAll={(day) => console.log(`Copy from ${day}`)}
2081
+ * />
2082
+ * ```
2083
+ *
2007
2084
  * @param {ScheduleRowProps} props - The props for the component.
2008
2085
  * @returns {React.ReactElement} The rendered ScheduleRow component.
2009
2086
  */
2010
2087
  var ScheduleRow = function (_a) {
2011
- var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
2088
+ var day = _a.day, daySchedule = _a.daySchedule, _b = _a.translations, translations = _b === void 0 ? {} : _b, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
2089
+ var t = __assign(__assign({}, defaultTranslations$2), translations);
2012
2090
  /**
2013
2091
  * @function validateTimeSlots
2014
2092
  * @description Validates all time slots to ensure the "from" time is not after the "to" time.
@@ -2070,28 +2148,58 @@ var ScheduleRow = function (_a) {
2070
2148
  var handleTimeChange = function (index, field, value) {
2071
2149
  var _a;
2072
2150
  var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
2151
+ // Update the specific field
2073
2152
  newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
2074
2153
  var validatedSlots = validateTimeSlots(newTimeSlots);
2075
2154
  onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
2076
2155
  };
2077
2156
  /**
2078
2157
  * @function handleAddTimeSlot
2079
- * @description Adds a new, empty time slot to the schedule.
2158
+ * @description Adds a new empty time slot when the + button is clicked.
2159
+ * The button is only enabled when the last slot is filled, so no validation needed here.
2080
2160
  */
2081
2161
  var handleAddTimeSlot = function () {
2162
+ // Add a new empty slot
2082
2163
  var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
2083
- onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
2164
+ var validatedSlots = validateTimeSlots(newTimeSlots);
2165
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
2084
2166
  };
2085
2167
  /**
2086
2168
  * @function handleRemoveTimeSlot
2087
2169
  * @description Removes a time slot from the schedule at the specified index.
2170
+ * Ensures at least one empty slot remains.
2088
2171
  * @param {number} index - The index of the time slot to remove.
2089
2172
  */
2090
2173
  var handleRemoveTimeSlot = function (index) {
2091
2174
  var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
2175
+ // Ensure there's always at least one slot (empty if needed)
2176
+ if (newTimeSlots.length === 0) {
2177
+ newTimeSlots = [{ from: "", to: "" }];
2178
+ }
2092
2179
  onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
2093
2180
  };
2094
- return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: translations.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsxRuntime.jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
2181
+ /**
2182
+ * @function getSlotsToDisplay
2183
+ * @description Returns the time slots to display exactly as they are in the schedule.
2184
+ * No automatic additions - slots are only added when the user clicks the + button.
2185
+ * @returns {TimeSlot[]} The time slots to display.
2186
+ */
2187
+ var getSlotsToDisplay = function () {
2188
+ var slots = daySchedule.timeSlots;
2189
+ // If there are no slots, return one empty slot to start
2190
+ if (slots.length === 0) {
2191
+ return [{ from: "", to: "" }];
2192
+ }
2193
+ // Return slots exactly as they are - no automatic additions
2194
+ return slots;
2195
+ };
2196
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? t.open : t.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: t.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsx("div", { className: "flex flex-col justify-around gap-y-3 ", children: getSlotsToDisplay().map(function (slot, index) {
2197
+ var slotsToDisplay = getSlotsToDisplay();
2198
+ var isLastSlot = index === slotsToDisplay.length - 1;
2199
+ var isSlotFilled = slot.from && slot.to;
2200
+ var canDelete = slotsToDisplay.length > 1;
2201
+ return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: t.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: t.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), isLastSlot ? (jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "primary", variant: "light", onPress: handleAddTimeSlot, isDisabled: !isSlotFilled, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-bold" }) })) : (jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: !canDelete, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) }))] }, "".concat(day, "-timeslot-").concat(index)));
2202
+ }) }))] }, day));
2095
2203
  };
2096
2204
 
2097
2205
  /**
@@ -2537,14 +2645,19 @@ var FilePreview = function (_a) {
2537
2645
  * />
2538
2646
  * ```
2539
2647
  */
2648
+ // Tamaños predefinidos del componente
2649
+ var SIZE_DIMENSIONS = {
2650
+ micro: { width: "64px", height: "64px" },
2651
+ small: { width: "100px", height: "100px" },
2652
+ medium: { width: "200px", height: "200px" },
2653
+ large: { width: "100%", height: "auto" },
2654
+ };
2540
2655
  var UploadFile = function (_a) {
2541
2656
  var text = _a.text, textColor = _a.textColor, subText = _a.subText,
2542
2657
  // borderColor, // TODO: Implementar colores personalizados
2543
2658
  iconColor = _a.iconColor,
2544
2659
  // backgroundColor, // TODO: Implementar colores personalizados
2545
- _b = _a.width,
2546
- // backgroundColor, // TODO: Implementar colores personalizados
2547
- width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
2660
+ size = _a.size, _b = _a.width, width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
2548
2661
  var inputRef = React.useRef(null);
2549
2662
  var uploadImageRef = React.useRef(image || null);
2550
2663
  var _o = React.useState(false), isDragging = _o[0], setIsDragging = _o[1];
@@ -2684,8 +2797,25 @@ var UploadFile = function (_a) {
2684
2797
  uploadImageRef.current = null;
2685
2798
  onUpload([]);
2686
2799
  };
2800
+ // Obtener dimensiones basadas en size o usar width/height personalizados
2801
+ var dimensions = React.useMemo(function () {
2802
+ if (size) {
2803
+ return SIZE_DIMENSIONS[size];
2804
+ }
2805
+ return { width: width, height: height };
2806
+ }, [size, width, height]);
2807
+ // Determina si se debe mostrar texto
2808
+ // Micro y small siempre muestran texto; medium y large solo en pantallas grandes
2809
+ var shouldShowText = React.useMemo(function () {
2810
+ // Si hay un tamaño definido, siempre se puede mostrar texto
2811
+ if (size !== "micro" && size !== "small") {
2812
+ return true;
2813
+ }
2814
+ // Si no hay size pero width es 100%, se comporta como large
2815
+ return dimensions.width === "100%";
2816
+ }, [size, dimensions.width]);
2687
2817
  // Clases CSS dinámicas usando Tailwind
2688
- var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
2818
+ var containerClasses = "\n\t\trelative border-2 border-dashed rounded-2xl transition-all duration-300\n\t\t".concat(dimensions.width === "100%" ? "w-full" : "", "\n\t\t").concat(dimensions.height === "auto" ? "min-h-28" : "", "\n\t\t").concat(size === "micro" ? "p-1" : size === "small" ? "p-2" : "p-3", "\n\t\t").concat(isDragging
2689
2819
  ? "border-primary-500 bg-primary-50 dark:bg-primary-900"
2690
2820
  : error
2691
2821
  ? "border-danger-500 bg-danger-50 dark:bg-danger-950"
@@ -2696,11 +2826,25 @@ var UploadFile = function (_a) {
2696
2826
  : "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
2697
2827
  .trim()
2698
2828
  .replace(/\s+/g, " ");
2699
- var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
2829
+ // Estilos inline para dimensiones exactas cuando hay un size definido
2830
+ var containerStyle = size && dimensions.width !== "100%"
2831
+ ? {
2832
+ width: dimensions.width,
2833
+ height: dimensions.height,
2834
+ boxSizing: "border-box"
2835
+ }
2836
+ : undefined;
2837
+ var textClasses = "\n\t\ttext-center font-medium\n\t\t".concat(size === "micro" ? "text-xs" : size === "small" ? "text-sm" : "text-base", "\n\t\t").concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
2700
2838
  var subTextClasses = "\n\t\ttext-tiny text-center\n\t\t".concat(disabled ? "text-default-400" : "text-default-500 dark:text-default-400", "\n\t");
2701
- return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
2839
+ return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, style: containerStyle, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center relative overflow-hidden ".concat(size === "micro" ? "gap-1" : size === "small" ? "gap-1.5" : "gap-3 sm:gap-4"), onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
2702
2840
  ? "opacity-0"
2703
- : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxRuntime.jsxs("div", { className: "text-center px-2", children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
2841
+ : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center ".concat(size === "micro" ? "gap-1" : size === "small" ? "gap-1.5" : "gap-3 sm:gap-4"), children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: size === "micro" ? "sm" : size === "small" ? "md" : "xl", className: "".concat(size === "micro" ? "text-lg"
2842
+ : size === "small" ? "text-xl sm:text-2xl"
2843
+ : "sm:text-4xl lg:text-5xl", " ").concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), shouldShowText && (jsxRuntime.jsxs("div", { className: "text-center ".concat(size === "micro" ? "px-0.5"
2844
+ : size === "small" ? "px-1"
2845
+ : "px-2", " ").concat(size === "micro" || size === "small"
2846
+ ? "block"
2847
+ : "hidden sm:block"), children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] }))] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
2704
2848
  ? acceptedFiles.join(",")
2705
2849
  : acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsxRuntime.jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsxRuntime.jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
2706
2850
  };
@@ -3357,6 +3501,7 @@ exports.TimeInputComponent = TimeInput;
3357
3501
  exports.ToastContext = ToastContext;
3358
3502
  exports.UploadFile = UploadFile;
3359
3503
  exports.VerticalSteps = VerticalSteps;
3504
+ exports.defaultTranslations = defaultTranslations$2;
3360
3505
  exports.sizeMap = sizeMap;
3361
3506
  exports.themeColors = themeColors;
3362
3507
  exports.useAuraToast = useAuraToast;