@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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +168 -23
- package/dist/index.esm.js +168 -24
- package/dist/types/components/schedule-row/index.d.ts +2 -1
- package/dist/types/components/schedule-row/index.d.ts.map +1 -1
- package/dist/types/components/schedule-row/schedule-row.constants.d.ts +34 -0
- package/dist/types/components/schedule-row/schedule-row.constants.d.ts.map +1 -0
- package/dist/types/components/schedule-row/schedule-row.d.ts +31 -0
- package/dist/types/components/schedule-row/schedule-row.d.ts.map +1 -1
- package/dist/types/components/schedule-row/schedule-row.types.d.ts +41 -16
- package/dist/types/components/schedule-row/schedule-row.types.d.ts.map +1 -1
- package/dist/types/components/upload-file/UploadFile.d.ts +0 -16
- package/dist/types/components/upload-file/UploadFile.d.ts.map +1 -1
- package/dist/types/components/upload-file/UploadFile.types.d.ts +8 -2
- package/dist/types/components/upload-file/UploadFile.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -140,7 +140,7 @@ var Input = function (_a) {
|
|
|
140
140
|
} })));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
var defaultTranslations$
|
|
143
|
+
var defaultTranslations$8 = {
|
|
144
144
|
addHolidayTitle: "Add holiday",
|
|
145
145
|
dayOption: "Day",
|
|
146
146
|
dateRangeOption: "Date range",
|
|
@@ -164,7 +164,7 @@ var INITIAL_HOLIDAY_STATE = {
|
|
|
164
164
|
*/
|
|
165
165
|
var AddHolidayForm = function (_a) {
|
|
166
166
|
var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
|
|
167
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
167
|
+
var t = __assign(__assign({}, defaultTranslations$8), translations);
|
|
168
168
|
var _b = useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
|
|
169
169
|
/**
|
|
170
170
|
* A boolean flag that determines if a date has been set.
|
|
@@ -234,7 +234,7 @@ var P = function (_a) {
|
|
|
234
234
|
return (jsx("p", __assign({ className: cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
var defaultTranslations$
|
|
237
|
+
var defaultTranslations$7 = {
|
|
238
238
|
title: "Analytics",
|
|
239
239
|
description: "Monthly growth of your metrics during the selected period",
|
|
240
240
|
viewDetails: "View Details",
|
|
@@ -288,7 +288,7 @@ var formatMonth = function (month) {
|
|
|
288
288
|
var AnalyticsCard = function (_a) {
|
|
289
289
|
var _b, _c;
|
|
290
290
|
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"]);
|
|
291
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
291
|
+
var t = __assign(__assign({}, defaultTranslations$7), translations);
|
|
292
292
|
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];
|
|
293
293
|
var activeChartData = useMemo(function () {
|
|
294
294
|
var _a;
|
|
@@ -953,7 +953,7 @@ var Chip = function (_a) {
|
|
|
953
953
|
};
|
|
954
954
|
|
|
955
955
|
// Traducciones por defecto en español
|
|
956
|
-
var defaultTranslations$
|
|
956
|
+
var defaultTranslations$6 = {
|
|
957
957
|
dayOption: "Día específico",
|
|
958
958
|
dateRangeOption: "Rango de fechas",
|
|
959
959
|
selectDateAriaLabel: "Seleccionar fecha",
|
|
@@ -971,7 +971,7 @@ var DateSelector = function (_a) {
|
|
|
971
971
|
var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
|
|
972
972
|
var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
|
|
973
973
|
// Combinar traducciones por defecto con las proporcionadas
|
|
974
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
974
|
+
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
975
975
|
var handleTypeChange = function (value) {
|
|
976
976
|
var newType = value;
|
|
977
977
|
setType(newType);
|
|
@@ -1338,13 +1338,13 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
1338
1338
|
];
|
|
1339
1339
|
}
|
|
1340
1340
|
|
|
1341
|
-
var defaultTranslations$
|
|
1341
|
+
var defaultTranslations$5 = {
|
|
1342
1342
|
checkIconTitle: "Check",
|
|
1343
1343
|
};
|
|
1344
1344
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
1345
1345
|
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"]);
|
|
1346
1346
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
1347
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1347
|
+
var t = __assign(__assign({}, defaultTranslations$5), translations);
|
|
1348
1348
|
var steps = React.useMemo(function () {
|
|
1349
1349
|
if (typeof stepsProp === "number") {
|
|
1350
1350
|
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
@@ -1593,7 +1593,7 @@ var countries = [
|
|
|
1593
1593
|
];
|
|
1594
1594
|
var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
|
|
1595
1595
|
// Traducciones por defecto
|
|
1596
|
-
var defaultTranslations$
|
|
1596
|
+
var defaultTranslations$4 = {
|
|
1597
1597
|
label: "Teléfono",
|
|
1598
1598
|
placeholder: "Número de teléfono",
|
|
1599
1599
|
searchPlaceholder: "Buscar país...",
|
|
@@ -1611,7 +1611,7 @@ var Phone = function (_a) {
|
|
|
1611
1611
|
var portalDropdownRef = useRef(null);
|
|
1612
1612
|
var _l = useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
1613
1613
|
var _m = useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
1614
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1614
|
+
var t = __assign(__assign({}, defaultTranslations$4), translations);
|
|
1615
1615
|
var finalLabel = label || t.label;
|
|
1616
1616
|
useEffect(function () {
|
|
1617
1617
|
if (value) {
|
|
@@ -1690,7 +1690,7 @@ var Phone = function (_a) {
|
|
|
1690
1690
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsx("span", { className: "text-xs text-default-500", children: country.code })] }, country.code)); })) : (jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
1691
1691
|
};
|
|
1692
1692
|
|
|
1693
|
-
var defaultTranslations$
|
|
1693
|
+
var defaultTranslations$3 = {
|
|
1694
1694
|
message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
|
|
1695
1695
|
buttonText: "Explore",
|
|
1696
1696
|
closeButtonLabel: "Close Banner",
|
|
@@ -1700,7 +1700,7 @@ var defaultTranslations$2 = {
|
|
|
1700
1700
|
*/
|
|
1701
1701
|
var PromotionalBanner = function (_a) {
|
|
1702
1702
|
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;
|
|
1703
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
1703
|
+
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
1704
1704
|
var finalMessage = message || t.message;
|
|
1705
1705
|
var finalButtonText = buttonText || t.buttonText;
|
|
1706
1706
|
var handleClose = function () {
|
|
@@ -1998,6 +1998,52 @@ var TimeInput = function (_a) {
|
|
|
1998
1998
|
} })));
|
|
1999
1999
|
};
|
|
2000
2000
|
|
|
2001
|
+
/**
|
|
2002
|
+
* @file schedule-row.constants.ts
|
|
2003
|
+
* @description Default translations for the ScheduleRow component.
|
|
2004
|
+
* These translations are used when no custom translations are provided via props.
|
|
2005
|
+
* The component supports full internationalization by overriding these defaults.
|
|
2006
|
+
*/
|
|
2007
|
+
/**
|
|
2008
|
+
* @constant defaultTranslations
|
|
2009
|
+
* @description Default translations in Spanish for the ScheduleRow component.
|
|
2010
|
+
* These can be overridden by passing a `translations` prop to the component.
|
|
2011
|
+
*
|
|
2012
|
+
* @example
|
|
2013
|
+
* ```tsx
|
|
2014
|
+
* // Using default Spanish translations
|
|
2015
|
+
* <ScheduleRow day="Lunes" daySchedule={...} />
|
|
2016
|
+
*
|
|
2017
|
+
* // Overriding with English translations
|
|
2018
|
+
* <ScheduleRow
|
|
2019
|
+
* day="Monday"
|
|
2020
|
+
* daySchedule={...}
|
|
2021
|
+
* translations={{
|
|
2022
|
+
* from: "From",
|
|
2023
|
+
* to: "To",
|
|
2024
|
+
* open: "Open",
|
|
2025
|
+
* closed: "Closed",
|
|
2026
|
+
* copyToAll: "Copy to all",
|
|
2027
|
+
* addTimeSlot: "Add time slot"
|
|
2028
|
+
* }}
|
|
2029
|
+
* />
|
|
2030
|
+
* ```
|
|
2031
|
+
*/
|
|
2032
|
+
var defaultTranslations$2 = {
|
|
2033
|
+
/** Label for the start time input field */
|
|
2034
|
+
from: "Desde",
|
|
2035
|
+
/** Label for the end time input field */
|
|
2036
|
+
to: "Hasta",
|
|
2037
|
+
/** Label shown when the day is active/open */
|
|
2038
|
+
open: "Abierto",
|
|
2039
|
+
/** Label shown when the day is inactive/closed */
|
|
2040
|
+
closed: "Cerrado",
|
|
2041
|
+
/** Label for the button that copies schedule to all days */
|
|
2042
|
+
copyToAll: "Copiar a todos",
|
|
2043
|
+
/** Label for the button that adds a new time slot */
|
|
2044
|
+
addTimeSlot: "Agregar horario",
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2001
2047
|
/**
|
|
2002
2048
|
* @component ScheduleRow
|
|
2003
2049
|
* @description A React component for managing the schedule of a single day.
|
|
@@ -2005,11 +2051,43 @@ var TimeInput = function (_a) {
|
|
|
2005
2051
|
* and modify the start and end times of each slot. The component is fully
|
|
2006
2052
|
* controlled and reports changes to the parent via the `onChange` callback.
|
|
2007
2053
|
*
|
|
2054
|
+
* Features:
|
|
2055
|
+
* - Toggle day open/closed status
|
|
2056
|
+
* - Add multiple time slots per day
|
|
2057
|
+
* - Edit start (from) and end (to) times for each slot
|
|
2058
|
+
* - Remove time slots (with minimum of one slot)
|
|
2059
|
+
* - Automatic validation to prevent invalid time ranges (from > to)
|
|
2060
|
+
* - Copy schedule to all days functionality
|
|
2061
|
+
* - Always displays an empty slot for adding new times
|
|
2062
|
+
* - Internationalization support via translations prop
|
|
2063
|
+
*
|
|
2064
|
+
* @example
|
|
2065
|
+
* ```tsx
|
|
2066
|
+
* <ScheduleRow
|
|
2067
|
+
* day="Monday"
|
|
2068
|
+
* daySchedule={{
|
|
2069
|
+
* isOpen: true,
|
|
2070
|
+
* timeSlots: [{ from: "09:00", to: "17:00" }]
|
|
2071
|
+
* }}
|
|
2072
|
+
* translations={{
|
|
2073
|
+
* from: "From",
|
|
2074
|
+
* to: "To",
|
|
2075
|
+
* open: "Open",
|
|
2076
|
+
* closed: "Closed",
|
|
2077
|
+
* copyToAll: "Copy to all",
|
|
2078
|
+
* addTimeSlot: "Add time slot"
|
|
2079
|
+
* }}
|
|
2080
|
+
* onChange={(newSchedule) => console.log(newSchedule)}
|
|
2081
|
+
* onCopyToAll={(day) => console.log(`Copy from ${day}`)}
|
|
2082
|
+
* />
|
|
2083
|
+
* ```
|
|
2084
|
+
*
|
|
2008
2085
|
* @param {ScheduleRowProps} props - The props for the component.
|
|
2009
2086
|
* @returns {React.ReactElement} The rendered ScheduleRow component.
|
|
2010
2087
|
*/
|
|
2011
2088
|
var ScheduleRow = function (_a) {
|
|
2012
|
-
var day = _a.day, daySchedule = _a.daySchedule,
|
|
2089
|
+
var day = _a.day, daySchedule = _a.daySchedule, _b = _a.translations, translations = _b === void 0 ? {} : _b, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
|
|
2090
|
+
var t = __assign(__assign({}, defaultTranslations$2), translations);
|
|
2013
2091
|
/**
|
|
2014
2092
|
* @function validateTimeSlots
|
|
2015
2093
|
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
@@ -2071,28 +2149,58 @@ var ScheduleRow = function (_a) {
|
|
|
2071
2149
|
var handleTimeChange = function (index, field, value) {
|
|
2072
2150
|
var _a;
|
|
2073
2151
|
var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
|
|
2152
|
+
// Update the specific field
|
|
2074
2153
|
newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
|
|
2075
2154
|
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
2076
2155
|
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
2077
2156
|
};
|
|
2078
2157
|
/**
|
|
2079
2158
|
* @function handleAddTimeSlot
|
|
2080
|
-
* @description Adds a new
|
|
2159
|
+
* @description Adds a new empty time slot when the + button is clicked.
|
|
2160
|
+
* The button is only enabled when the last slot is filled, so no validation needed here.
|
|
2081
2161
|
*/
|
|
2082
2162
|
var handleAddTimeSlot = function () {
|
|
2163
|
+
// Add a new empty slot
|
|
2083
2164
|
var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
|
|
2084
|
-
|
|
2165
|
+
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
2166
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
2085
2167
|
};
|
|
2086
2168
|
/**
|
|
2087
2169
|
* @function handleRemoveTimeSlot
|
|
2088
2170
|
* @description Removes a time slot from the schedule at the specified index.
|
|
2171
|
+
* Ensures at least one empty slot remains.
|
|
2089
2172
|
* @param {number} index - The index of the time slot to remove.
|
|
2090
2173
|
*/
|
|
2091
2174
|
var handleRemoveTimeSlot = function (index) {
|
|
2092
2175
|
var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
|
|
2176
|
+
// Ensure there's always at least one slot (empty if needed)
|
|
2177
|
+
if (newTimeSlots.length === 0) {
|
|
2178
|
+
newTimeSlots = [{ from: "", to: "" }];
|
|
2179
|
+
}
|
|
2093
2180
|
onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
2094
2181
|
};
|
|
2095
|
-
|
|
2182
|
+
/**
|
|
2183
|
+
* @function getSlotsToDisplay
|
|
2184
|
+
* @description Returns the time slots to display exactly as they are in the schedule.
|
|
2185
|
+
* No automatic additions - slots are only added when the user clicks the + button.
|
|
2186
|
+
* @returns {TimeSlot[]} The time slots to display.
|
|
2187
|
+
*/
|
|
2188
|
+
var getSlotsToDisplay = function () {
|
|
2189
|
+
var slots = daySchedule.timeSlots;
|
|
2190
|
+
// If there are no slots, return one empty slot to start
|
|
2191
|
+
if (slots.length === 0) {
|
|
2192
|
+
return [{ from: "", to: "" }];
|
|
2193
|
+
}
|
|
2194
|
+
// Return slots exactly as they are - no automatic additions
|
|
2195
|
+
return slots;
|
|
2196
|
+
};
|
|
2197
|
+
return (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: [jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsx(Chip$1, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? t.open : t.closed })] }), jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: t.copyToAll })] })] }), daySchedule.isOpen && (jsx("div", { className: "flex flex-col justify-around gap-y-3 ", children: getSlotsToDisplay().map(function (slot, index) {
|
|
2198
|
+
var slotsToDisplay = getSlotsToDisplay();
|
|
2199
|
+
var isLastSlot = index === slotsToDisplay.length - 1;
|
|
2200
|
+
var isSlotFilled = slot.from && slot.to;
|
|
2201
|
+
var canDelete = slotsToDisplay.length > 1;
|
|
2202
|
+
return (jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsx(TimeInput, { label: t.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), 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 ? (jsx(Button, { isIconOnly: true, size: "sm", color: "primary", variant: "light", onPress: handleAddTimeSlot, isDisabled: !isSlotFilled, startContent: jsx(IconComponent, { icon: "solar:add-circle-bold" }) })) : (jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: !canDelete, startContent: jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) }))] }, "".concat(day, "-timeslot-").concat(index)));
|
|
2203
|
+
}) }))] }, day));
|
|
2096
2204
|
};
|
|
2097
2205
|
|
|
2098
2206
|
/**
|
|
@@ -2538,14 +2646,19 @@ var FilePreview = function (_a) {
|
|
|
2538
2646
|
* />
|
|
2539
2647
|
* ```
|
|
2540
2648
|
*/
|
|
2649
|
+
// Tamaños predefinidos del componente
|
|
2650
|
+
var SIZE_DIMENSIONS = {
|
|
2651
|
+
micro: { width: "64px", height: "64px" },
|
|
2652
|
+
small: { width: "100px", height: "100px" },
|
|
2653
|
+
medium: { width: "200px", height: "200px" },
|
|
2654
|
+
large: { width: "100%", height: "auto" },
|
|
2655
|
+
};
|
|
2541
2656
|
var UploadFile = function (_a) {
|
|
2542
2657
|
var text = _a.text, textColor = _a.textColor, subText = _a.subText,
|
|
2543
2658
|
// borderColor, // TODO: Implementar colores personalizados
|
|
2544
2659
|
iconColor = _a.iconColor,
|
|
2545
2660
|
// backgroundColor, // TODO: Implementar colores personalizados
|
|
2546
|
-
_b = _a.width,
|
|
2547
|
-
// backgroundColor, // TODO: Implementar colores personalizados
|
|
2548
|
-
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;
|
|
2661
|
+
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;
|
|
2549
2662
|
var inputRef = useRef(null);
|
|
2550
2663
|
var uploadImageRef = useRef(image || null);
|
|
2551
2664
|
var _o = useState(false), isDragging = _o[0], setIsDragging = _o[1];
|
|
@@ -2685,8 +2798,25 @@ var UploadFile = function (_a) {
|
|
|
2685
2798
|
uploadImageRef.current = null;
|
|
2686
2799
|
onUpload([]);
|
|
2687
2800
|
};
|
|
2801
|
+
// Obtener dimensiones basadas en size o usar width/height personalizados
|
|
2802
|
+
var dimensions = useMemo(function () {
|
|
2803
|
+
if (size) {
|
|
2804
|
+
return SIZE_DIMENSIONS[size];
|
|
2805
|
+
}
|
|
2806
|
+
return { width: width, height: height };
|
|
2807
|
+
}, [size, width, height]);
|
|
2808
|
+
// Determina si se debe mostrar texto
|
|
2809
|
+
// Micro y small siempre muestran texto; medium y large solo en pantallas grandes
|
|
2810
|
+
var shouldShowText = useMemo(function () {
|
|
2811
|
+
// Si hay un tamaño definido, siempre se puede mostrar texto
|
|
2812
|
+
if (size !== "micro" && size !== "small") {
|
|
2813
|
+
return true;
|
|
2814
|
+
}
|
|
2815
|
+
// Si no hay size pero width es 100%, se comporta como large
|
|
2816
|
+
return dimensions.width === "100%";
|
|
2817
|
+
}, [size, dimensions.width]);
|
|
2688
2818
|
// Clases CSS dinámicas usando Tailwind
|
|
2689
|
-
var containerClasses = "\n\t\trelative
|
|
2819
|
+
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
|
|
2690
2820
|
? "border-primary-500 bg-primary-50 dark:bg-primary-900"
|
|
2691
2821
|
: error
|
|
2692
2822
|
? "border-danger-500 bg-danger-50 dark:bg-danger-950"
|
|
@@ -2697,11 +2827,25 @@ var UploadFile = function (_a) {
|
|
|
2697
2827
|
: "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")
|
|
2698
2828
|
.trim()
|
|
2699
2829
|
.replace(/\s+/g, " ");
|
|
2700
|
-
|
|
2830
|
+
// Estilos inline para dimensiones exactas cuando hay un size definido
|
|
2831
|
+
var containerStyle = size && dimensions.width !== "100%"
|
|
2832
|
+
? {
|
|
2833
|
+
width: dimensions.width,
|
|
2834
|
+
height: dimensions.height,
|
|
2835
|
+
boxSizing: "border-box"
|
|
2836
|
+
}
|
|
2837
|
+
: undefined;
|
|
2838
|
+
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");
|
|
2701
2839
|
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");
|
|
2702
|
-
return (jsxs("div", { className: "relative", children: [jsx(Card$1, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxs(CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4
|
|
2840
|
+
return (jsxs("div", { className: "relative", children: [jsx(Card$1, { className: containerClasses, style: containerStyle, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxs(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 && (jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsx("div", { className: uploadImageRef.current
|
|
2703
2841
|
? "opacity-0"
|
|
2704
|
-
: "opacity-100 transition-opacity", children: jsxs("div", { className: "flex flex-col items-center
|
|
2842
|
+
: "opacity-100 transition-opacity", children: jsxs("div", { className: "flex flex-col items-center ".concat(size === "micro" ? "gap-1" : size === "small" ? "gap-1.5" : "gap-3 sm:gap-4"), children: [jsx(IconComponent, { icon: icon, size: size === "micro" ? "sm" : size === "small" ? "md" : "xl", className: "".concat(size === "micro" ? "text-lg"
|
|
2843
|
+
: size === "small" ? "text-xl sm:text-2xl"
|
|
2844
|
+
: "sm:text-4xl lg:text-5xl", " ").concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), shouldShowText && (jsxs("div", { className: "text-center ".concat(size === "micro" ? "px-0.5"
|
|
2845
|
+
: size === "small" ? "px-1"
|
|
2846
|
+
: "px-2", " ").concat(size === "micro" || size === "small"
|
|
2847
|
+
? "block"
|
|
2848
|
+
: "hidden sm:block"), children: [jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsx("p", { className: subTextClasses, children: finalSubText }))] }))] }) }), jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
|
|
2705
2849
|
? acceptedFiles.join(",")
|
|
2706
2850
|
: acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
|
|
2707
2851
|
};
|
|
@@ -3299,4 +3443,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
3299
3443
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
3300
3444
|
};
|
|
3301
3445
|
|
|
3302
|
-
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, 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, sizeMap, themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|
|
3446
|
+
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, 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, defaultTranslations$2 as defaultTranslations, sizeMap, themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ScheduleRow } from "./schedule-row";
|
|
2
|
-
export type { ScheduleRowProps, DaySchedule, TimeSlot, } from "./schedule-row.types";
|
|
2
|
+
export type { ScheduleRowProps, ScheduleRowTranslations, DaySchedule, TimeSlot, } from "./schedule-row.types";
|
|
3
|
+
export { defaultTranslations } from "./schedule-row.constants";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACX,gBAAgB,EAChB,WAAW,EACX,QAAQ,GACR,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACX,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,QAAQ,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ScheduleRowTranslations } from "./schedule-row.types";
|
|
2
|
+
/**
|
|
3
|
+
* @file schedule-row.constants.ts
|
|
4
|
+
* @description Default translations for the ScheduleRow component.
|
|
5
|
+
* These translations are used when no custom translations are provided via props.
|
|
6
|
+
* The component supports full internationalization by overriding these defaults.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @constant defaultTranslations
|
|
10
|
+
* @description Default translations in Spanish for the ScheduleRow component.
|
|
11
|
+
* These can be overridden by passing a `translations` prop to the component.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Using default Spanish translations
|
|
16
|
+
* <ScheduleRow day="Lunes" daySchedule={...} />
|
|
17
|
+
*
|
|
18
|
+
* // Overriding with English translations
|
|
19
|
+
* <ScheduleRow
|
|
20
|
+
* day="Monday"
|
|
21
|
+
* daySchedule={...}
|
|
22
|
+
* translations={{
|
|
23
|
+
* from: "From",
|
|
24
|
+
* to: "To",
|
|
25
|
+
* open: "Open",
|
|
26
|
+
* closed: "Closed",
|
|
27
|
+
* copyToAll: "Copy to all",
|
|
28
|
+
* addTimeSlot: "Add time slot"
|
|
29
|
+
* }}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const defaultTranslations: Required<ScheduleRowTranslations>;
|
|
34
|
+
//# sourceMappingURL=schedule-row.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-row.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/schedule-row.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,uBAAuB,CAajE,CAAC"}
|
|
@@ -7,6 +7,37 @@ import type { ScheduleRowProps } from "./schedule-row.types";
|
|
|
7
7
|
* and modify the start and end times of each slot. The component is fully
|
|
8
8
|
* controlled and reports changes to the parent via the `onChange` callback.
|
|
9
9
|
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Toggle day open/closed status
|
|
12
|
+
* - Add multiple time slots per day
|
|
13
|
+
* - Edit start (from) and end (to) times for each slot
|
|
14
|
+
* - Remove time slots (with minimum of one slot)
|
|
15
|
+
* - Automatic validation to prevent invalid time ranges (from > to)
|
|
16
|
+
* - Copy schedule to all days functionality
|
|
17
|
+
* - Always displays an empty slot for adding new times
|
|
18
|
+
* - Internationalization support via translations prop
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <ScheduleRow
|
|
23
|
+
* day="Monday"
|
|
24
|
+
* daySchedule={{
|
|
25
|
+
* isOpen: true,
|
|
26
|
+
* timeSlots: [{ from: "09:00", to: "17:00" }]
|
|
27
|
+
* }}
|
|
28
|
+
* translations={{
|
|
29
|
+
* from: "From",
|
|
30
|
+
* to: "To",
|
|
31
|
+
* open: "Open",
|
|
32
|
+
* closed: "Closed",
|
|
33
|
+
* copyToAll: "Copy to all",
|
|
34
|
+
* addTimeSlot: "Add time slot"
|
|
35
|
+
* }}
|
|
36
|
+
* onChange={(newSchedule) => console.log(newSchedule)}
|
|
37
|
+
* onCopyToAll={(day) => console.log(`Copy from ${day}`)}
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
10
41
|
* @param {ScheduleRowProps} props - The props for the component.
|
|
11
42
|
* @returns {React.ReactElement} The rendered ScheduleRow component.
|
|
12
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-row.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/schedule-row.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule-row.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/schedule-row.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,sBAAsB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuOlD,CAAC"}
|
|
@@ -20,6 +20,43 @@ export interface DaySchedule {
|
|
|
20
20
|
isOpen: boolean;
|
|
21
21
|
timeSlots: TimeSlot[];
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @interface ScheduleRowTranslations
|
|
25
|
+
* @description Translation strings for the ScheduleRow component.
|
|
26
|
+
* Supports internationalization (i18n) without imposing any specific system.
|
|
27
|
+
* @property {string} from - Label for the "from" time field (default: "Desde").
|
|
28
|
+
* @property {string} to - Label for the "to" time field (default: "Hasta").
|
|
29
|
+
* @property {string} open - Label for the open status chip (default: "Abierto").
|
|
30
|
+
* @property {string} closed - Label for the closed status chip (default: "Cerrado").
|
|
31
|
+
* @property {string} copyToAll - Label for the copy to all button (default: "Copiar a todos").
|
|
32
|
+
* @property {string} addTimeSlot - Label for the add time slot button (default: "Agregar horario").
|
|
33
|
+
*/
|
|
34
|
+
export interface ScheduleRowTranslations {
|
|
35
|
+
/**
|
|
36
|
+
* Label for the "from" time input field
|
|
37
|
+
*/
|
|
38
|
+
from: string;
|
|
39
|
+
/**
|
|
40
|
+
* Label for the "to" time input field
|
|
41
|
+
*/
|
|
42
|
+
to: string;
|
|
43
|
+
/**
|
|
44
|
+
* Label displayed when the day is open/active
|
|
45
|
+
*/
|
|
46
|
+
open: string;
|
|
47
|
+
/**
|
|
48
|
+
* Label displayed when the day is closed/inactive
|
|
49
|
+
*/
|
|
50
|
+
closed: string;
|
|
51
|
+
/**
|
|
52
|
+
* Label for the button that copies the current schedule to all other days
|
|
53
|
+
*/
|
|
54
|
+
copyToAll: string;
|
|
55
|
+
/**
|
|
56
|
+
* Label for the button that adds a new time slot
|
|
57
|
+
*/
|
|
58
|
+
addTimeSlot: string;
|
|
59
|
+
}
|
|
23
60
|
/**
|
|
24
61
|
* @interface ScheduleRowProps
|
|
25
62
|
* @description Props for the ScheduleRow component.
|
|
@@ -34,22 +71,10 @@ export type ScheduleRowProps = {
|
|
|
34
71
|
*/
|
|
35
72
|
daySchedule: DaySchedule;
|
|
36
73
|
/**
|
|
37
|
-
* @property {
|
|
38
|
-
*
|
|
39
|
-
* @property {string} translations.to - Label for the "to" time input.
|
|
40
|
-
* @property {string} translations.open - Text to display when the schedule is open.
|
|
41
|
-
* @property {string} translations.closed - Text to display when the schedule is closed.
|
|
42
|
-
* @property {string} translations.copyToAll - Label for the "Copy to all" button.
|
|
43
|
-
* @property {string} translations.addTimeSlot - Label for the "Add time slot" button.
|
|
74
|
+
* @property {Partial<ScheduleRowTranslations>} [translations] - An object containing translated strings for the component.
|
|
75
|
+
* Allows full internationalization support. If not provided, uses default Spanish translations.
|
|
44
76
|
*/
|
|
45
|
-
translations
|
|
46
|
-
from: string;
|
|
47
|
-
to: string;
|
|
48
|
-
open: string;
|
|
49
|
-
closed: string;
|
|
50
|
-
copyToAll: string;
|
|
51
|
-
addTimeSlot: string;
|
|
52
|
-
};
|
|
77
|
+
translations?: Partial<ScheduleRowTranslations>;
|
|
53
78
|
/**
|
|
54
79
|
* @function onChange
|
|
55
80
|
* @description Callback function that is invoked when the schedule is modified.
|
|
@@ -60,7 +85,7 @@ export type ScheduleRowProps = {
|
|
|
60
85
|
/**
|
|
61
86
|
* @function onCopyToAll
|
|
62
87
|
* @description Callback function that is invoked when the "Copy to all" button is clicked.
|
|
63
|
-
* @param {
|
|
88
|
+
* @param {string} day - The day of the week to copy from.
|
|
64
89
|
* @returns {void}
|
|
65
90
|
*/
|
|
66
91
|
onCopyToAll: (day: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-row.types.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/schedule-row.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED
|
|
1
|
+
{"version":3,"file":"schedule-row.types.d.ts","sourceRoot":"","sources":["../../../../src/components/schedule-row/schedule-row.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { UploadFileProps } from "./UploadFile.types";
|
|
3
|
-
/**
|
|
4
|
-
* Componente UploadDocument basado en Hero UI con funcionalidad mejorada
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* <UploadDocument
|
|
9
|
-
* onUpload={(files) => console.log(files)}
|
|
10
|
-
* acceptedFiles="image/*,.pdf"
|
|
11
|
-
* multiple={false}
|
|
12
|
-
* translations={{
|
|
13
|
-
* uploadText: "Upload your files",
|
|
14
|
-
* dragText: "Drop files here"
|
|
15
|
-
* }}
|
|
16
|
-
* />
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
3
|
export declare const UploadFile: React.FC<UploadFileProps>;
|
|
20
4
|
//# sourceMappingURL=UploadFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadFile.d.ts","sourceRoot":"","sources":["../../../../src/components/upload-file/UploadFile.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"UploadFile.d.ts","sourceRoot":"","sources":["../../../../src/components/upload-file/UploadFile.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,oBAAoB,CAAC;AA6jB5B,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6XhD,CAAC"}
|
|
@@ -50,6 +50,10 @@ export interface CropConfig {
|
|
|
50
50
|
/** Color del botón de guardar recorte */
|
|
51
51
|
colorButton?: string;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Tamaños predefinidos para el componente UploadFile
|
|
55
|
+
*/
|
|
56
|
+
export type UploadFileSize = "micro" | "small" | "medium" | "large";
|
|
53
57
|
/**
|
|
54
58
|
* Props del componente UploadFile
|
|
55
59
|
*/
|
|
@@ -66,9 +70,11 @@ export interface UploadFileProps {
|
|
|
66
70
|
iconColor?: string;
|
|
67
71
|
/** Color de fondo */
|
|
68
72
|
backgroundColor?: string;
|
|
69
|
-
/**
|
|
73
|
+
/** Tamaño predefinido del componente (micro, small, medium, large) */
|
|
74
|
+
size?: UploadFileSize;
|
|
75
|
+
/** Ancho del componente (se usa si size no está definido) */
|
|
70
76
|
width?: string;
|
|
71
|
-
/** Alto del componente */
|
|
77
|
+
/** Alto del componente (se usa si size no está definido) */
|
|
72
78
|
height?: string;
|
|
73
79
|
/** Permitir múltiples archivos */
|
|
74
80
|
multiple?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadFile.types.d.ts","sourceRoot":"","sources":["../../../../src/components/upload-file/UploadFile.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,
|
|
1
|
+
{"version":3,"file":"UploadFile.types.d.ts","sourceRoot":"","sources":["../../../../src/components/upload-file/UploadFile.types.ts"],"names":[],"mappings":"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"}
|