@beweco/aurora-ui 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +319 -1346
- package/dist/index.esm.js +327 -1355
- package/dist/types/components/social-media-preview/SocialMediaPreview.d.ts +19 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.d.ts.map +1 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.types.d.ts +46 -0
- package/dist/types/components/social-media-preview/SocialMediaPreview.types.d.ts.map +1 -0
- package/dist/types/components/social-media-preview/index.d.ts +3 -0
- package/dist/types/components/social-media-preview/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button as Button$
|
|
1
|
+
import { Button as Button$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, Input as Input$1, RadioGroup, Radio, cn, Card as Card$1, Spacer, Tabs, Tab, Chip as Chip$1, Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Autocomplete, Breadcrumbs, BreadcrumbItem, DropdownSection, ListboxItem, Popover, PopoverTrigger, Tooltip as Tooltip$1, PopoverContent, Listbox, Accordion, AccordionItem, ListboxSection, Avatar, CardBody, CardFooter, Pagination as Pagination$1, Link, Switch as Switch$1, TimeInput as TimeInput$1, Select as Select$1, Image as Image$1, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Textarea as Textarea$1, Alert, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, Slider, ModalFooter as ModalFooter$1, Spinner, SelectItem, Drawer, DrawerContent, DrawerBody } from '@heroui/react';
|
|
2
2
|
export * from '@heroui/react';
|
|
3
3
|
export { Slider } from '@heroui/react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -27,18 +27,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
27
27
|
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var __assign
|
|
31
|
-
__assign
|
|
30
|
+
var __assign = function() {
|
|
31
|
+
__assign = Object.assign || function __assign(t) {
|
|
32
32
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
33
|
s = arguments[i];
|
|
34
34
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
};
|
|
38
|
-
return __assign
|
|
38
|
+
return __assign.apply(this, arguments);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
function __rest
|
|
41
|
+
function __rest(s, e) {
|
|
42
42
|
var t = {};
|
|
43
43
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
44
44
|
t[p] = s[p];
|
|
@@ -88,7 +88,7 @@ function __generator(thisArg, body) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function __spreadArray
|
|
91
|
+
function __spreadArray(to, from, pack) {
|
|
92
92
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
93
93
|
if (ar || !(i in from)) {
|
|
94
94
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -103,11 +103,11 @@ 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 HolidayType
|
|
106
|
+
var HolidayType;
|
|
107
107
|
(function (HolidayType) {
|
|
108
108
|
HolidayType["SingleDay"] = "singleDay";
|
|
109
109
|
HolidayType["DateRange"] = "dateRange";
|
|
110
|
-
})(HolidayType
|
|
110
|
+
})(HolidayType || (HolidayType = {}));
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* Botón genérico basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
@@ -120,42 +120,42 @@ var HolidayType$1;
|
|
|
120
120
|
* - Radius: md (por defecto)
|
|
121
121
|
* - isIconOnly: True, False
|
|
122
122
|
*/
|
|
123
|
-
var Button
|
|
124
|
-
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "solid" : _d, _e = _a.radius, radius = _e === void 0 ? "sm" : _e, startContent = _a.startContent, endContent = _a.endContent, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, _g = _a.isIconOnly, isIconOnly = _g === void 0 ? false : _g, props = __rest
|
|
125
|
-
return (jsx(Button$
|
|
123
|
+
var Button = function (_a) {
|
|
124
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "solid" : _d, _e = _a.radius, radius = _e === void 0 ? "sm" : _e, startContent = _a.startContent, endContent = _a.endContent, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, _g = _a.isIconOnly, isIconOnly = _g === void 0 ? false : _g, props = __rest(_a, ["color", "size", "variant", "radius", "startContent", "endContent", "isLoading", "isIconOnly"]);
|
|
125
|
+
return (jsx(Button$1, __assign({}, props, { color: color, size: size, variant: variant, radius: radius, startContent: startContent, endContent: endContent, isLoading: isLoading, isIconOnly: isIconOnly })));
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
var DatePicker = function (_a) {
|
|
129
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest
|
|
129
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["label", "id", "size"]);
|
|
130
130
|
var generatedId = useId();
|
|
131
131
|
var autoId = id || generatedId;
|
|
132
|
-
return (jsx(DatePicker$1, __assign
|
|
132
|
+
return (jsx(DatePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
133
133
|
label: "text-sm font-medium text-default-600",
|
|
134
134
|
segment: "focus:bg-primary-50",
|
|
135
135
|
}, id: autoId }, props)));
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
var DateRangePicker = function (_a) {
|
|
139
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest
|
|
139
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["label", "id", "size"]);
|
|
140
140
|
var generatedId = useId();
|
|
141
141
|
var autoId = id || generatedId;
|
|
142
|
-
return (jsx(DateRangePicker$1, __assign
|
|
142
|
+
return (jsx(DateRangePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
143
143
|
label: "text-sm font-medium text-default-600",
|
|
144
144
|
segment: "focus:bg-primary-50",
|
|
145
145
|
} }, props, { id: autoId })));
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
var sizeMap
|
|
148
|
+
var sizeMap = {
|
|
149
149
|
sm: "16px",
|
|
150
150
|
md: "20px",
|
|
151
151
|
lg: "24px",
|
|
152
152
|
xl: "32px",
|
|
153
153
|
};
|
|
154
|
-
var IconComponent
|
|
154
|
+
var IconComponent = function (_a) {
|
|
155
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
|
|
157
|
-
var iconSize = (_b = sizeMap
|
|
158
|
-
return (jsx("span", __assign
|
|
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
159
|
};
|
|
160
160
|
|
|
161
161
|
/**
|
|
@@ -168,17 +168,17 @@ var IconComponent$1 = function (_a) {
|
|
|
168
168
|
* - Radius configurable
|
|
169
169
|
*/
|
|
170
170
|
var Input = function (_a) {
|
|
171
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest
|
|
171
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
|
|
172
172
|
var generatedId = useId();
|
|
173
173
|
var inputId = id || generatedId;
|
|
174
|
-
return (jsx(Input$1, __assign
|
|
174
|
+
return (jsx(Input$1, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
175
175
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
176
176
|
inputWrapper: "focus-within:!border-primary-500",
|
|
177
177
|
errorMessage: "text-left",
|
|
178
178
|
} })));
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
var defaultTranslations$
|
|
181
|
+
var defaultTranslations$b = {
|
|
182
182
|
addHolidayTitle: "Add holiday",
|
|
183
183
|
dayOption: "Day",
|
|
184
184
|
dateRangeOption: "Date range",
|
|
@@ -189,7 +189,7 @@ var defaultTranslations$a = {
|
|
|
189
189
|
addButton: "Add",
|
|
190
190
|
};
|
|
191
191
|
var INITIAL_HOLIDAY_STATE = {
|
|
192
|
-
type: HolidayType
|
|
192
|
+
type: HolidayType.SingleDay,
|
|
193
193
|
startDate: null,
|
|
194
194
|
endDate: null,
|
|
195
195
|
title: "",
|
|
@@ -202,14 +202,14 @@ var INITIAL_HOLIDAY_STATE = {
|
|
|
202
202
|
*/
|
|
203
203
|
var AddHolidayForm = function (_a) {
|
|
204
204
|
var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
|
|
205
|
-
var t = __assign
|
|
205
|
+
var t = __assign(__assign({}, defaultTranslations$b), translations);
|
|
206
206
|
var _b = useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
|
|
207
207
|
/**
|
|
208
208
|
* A boolean flag that determines if a date has been set.
|
|
209
209
|
* For a single day, it checks if `startDate` is not null.
|
|
210
210
|
* For a date range, it checks if both `startDate` and `endDate` are not null.
|
|
211
211
|
*/
|
|
212
|
-
var isDateSet = newHoliday.type === HolidayType
|
|
212
|
+
var isDateSet = newHoliday.type === HolidayType.SingleDay
|
|
213
213
|
? newHoliday.startDate !== null
|
|
214
214
|
: newHoliday.startDate !== null && newHoliday.endDate !== null;
|
|
215
215
|
/**
|
|
@@ -223,7 +223,7 @@ var AddHolidayForm = function (_a) {
|
|
|
223
223
|
* @param date The selected date.
|
|
224
224
|
*/
|
|
225
225
|
var handleDateChange = useCallback(function (date) {
|
|
226
|
-
setNewHoliday(function (prev) { return (__assign
|
|
226
|
+
setNewHoliday(function (prev) { return (__assign(__assign({}, prev), { startDate: date, endDate: null })); });
|
|
227
227
|
}, []);
|
|
228
228
|
/**
|
|
229
229
|
* Handles changes to the date range picker.
|
|
@@ -232,7 +232,7 @@ var AddHolidayForm = function (_a) {
|
|
|
232
232
|
var handleDateRangeChange = useCallback(function (range) {
|
|
233
233
|
setNewHoliday(function (prev) {
|
|
234
234
|
var _a, _b;
|
|
235
|
-
return (__assign
|
|
235
|
+
return (__assign(__assign({}, prev), { startDate: (_a = range === null || range === void 0 ? void 0 : range.start) !== null && _a !== void 0 ? _a : null, endDate: (_b = range === null || range === void 0 ? void 0 : range.end) !== null && _b !== void 0 ? _b : null }));
|
|
236
236
|
});
|
|
237
237
|
}, []);
|
|
238
238
|
/**
|
|
@@ -253,26 +253,26 @@ var AddHolidayForm = function (_a) {
|
|
|
253
253
|
});
|
|
254
254
|
resetForm();
|
|
255
255
|
}, [newHoliday, onAddHoliday, resetForm, isDateSet]);
|
|
256
|
-
return (jsxs("div", { className: "flex flex-col gap-4 ".concat(className), children: [jsx("h3", { className: "font-semibold text-small text-foreground", children: t.addHolidayTitle }), jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxs(RadioGroup, __assign
|
|
257
|
-
return setNewHoliday(__assign
|
|
258
|
-
} }, radioGroupProps, { children: [jsx(Radio, { value: HolidayType
|
|
256
|
+
return (jsxs("div", { className: "flex flex-col gap-4 ".concat(className), children: [jsx("h3", { className: "font-semibold text-small text-foreground", children: t.addHolidayTitle }), jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxs(RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: newHoliday.type, onValueChange: function (value) {
|
|
257
|
+
return setNewHoliday(__assign(__assign({}, INITIAL_HOLIDAY_STATE), { type: value }));
|
|
258
|
+
} }, radioGroupProps, { children: [jsx(Radio, { value: HolidayType.SingleDay, children: t.dayOption }), jsx(Radio, { value: HolidayType.DateRange, children: t.dateRangeOption })] })), newHoliday.type === HolidayType.DateRange ? (jsx(DateRangePicker, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: newHoliday.startDate && newHoliday.endDate
|
|
259
259
|
? { start: newHoliday.startDate, end: newHoliday.endDate }
|
|
260
|
-
: null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent
|
|
261
|
-
setNewHoliday(function (prev) { return (__assign
|
|
262
|
-
}, "aria-label": t.optionalTitle }), jsx("div", { className: "w-full", children: jsx(Button
|
|
260
|
+
: null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsx(DatePicker, { className: "xs:w-full md:flex-1 md:max-w-40", value: newHoliday.startDate, onChange: handleDateChange, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }))] }), jsx(Input, { label: t.optionalTitle, placeholder: t.titlePlaceholder, className: "w-full", value: newHoliday.title, onValueChange: function (value) {
|
|
261
|
+
setNewHoliday(function (prev) { return (__assign(__assign({}, prev), { title: value })); });
|
|
262
|
+
}, "aria-label": t.optionalTitle }), jsx("div", { className: "w-full", children: jsx(Button, __assign({ size: "sm", fullWidth: true, variant: "flat", startContent: jsx(IconComponent, { icon: "solar:add-circle-outline" }), onPress: handleAddHoliday, isDisabled: !isDateSet }, buttonProps, { children: t.addButton })) })] }));
|
|
263
263
|
};
|
|
264
264
|
|
|
265
265
|
var H2 = function (_a) {
|
|
266
|
-
var children = _a.children, className = _a.className, props = __rest
|
|
267
|
-
return (jsx("h2", __assign
|
|
266
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
267
|
+
return (jsx("h2", __assign({ className: cn("text-lg font-semibold", className) }, props, { children: children })));
|
|
268
268
|
};
|
|
269
269
|
|
|
270
270
|
var P = function (_a) {
|
|
271
|
-
var children = _a.children, className = _a.className, props = __rest
|
|
272
|
-
return (jsx("p", __assign
|
|
271
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
272
|
+
return (jsx("p", __assign({ className: cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
var defaultTranslations$
|
|
275
|
+
var defaultTranslations$a = {
|
|
276
276
|
title: "Analytics",
|
|
277
277
|
description: "Monthly growth of your metrics during the selected period",
|
|
278
278
|
viewDetails: "View Details",
|
|
@@ -325,8 +325,8 @@ var formatMonth = function (month) {
|
|
|
325
325
|
*/
|
|
326
326
|
var AnalyticsCard = function (_a) {
|
|
327
327
|
var _b, _c;
|
|
328
|
-
var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest
|
|
329
|
-
var t = __assign
|
|
328
|
+
var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
|
|
329
|
+
var t = __assign(__assign({}, defaultTranslations$a), translations);
|
|
330
330
|
var _h = useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
|
|
331
331
|
var activeChartData = useMemo(function () {
|
|
332
332
|
var _a;
|
|
@@ -353,7 +353,7 @@ var AnalyticsCard = function (_a) {
|
|
|
353
353
|
var handleTimePeriodChange = function (period) {
|
|
354
354
|
onTimePeriodChange === null || onTimePeriodChange === void 0 ? void 0 : onTimePeriodChange(period);
|
|
355
355
|
};
|
|
356
|
-
return (jsx(Card$1, __assign
|
|
356
|
+
return (jsx(Card$1, __assign({ as: "dl", className: "dark:border-default-100 border border-transparent" }, props, { children: jsxs("section", { className: "flex flex-col flex-nowrap", children: [jsx("div", { className: "flex flex-col justify-between gap-y-2 p-6", children: jsxs("div", { className: "flex flex-col gap-y-2", children: [jsxs("div", { className: "flex flex-col gap-y-0", children: [jsx(H2, { children: t.title }), jsx(P, { children: t.description })] }), jsx(Spacer, { y: 2 }), showTimePeriods && (jsxs(Tabs, { size: "md", className: " self-end", onSelectionChange: function (key) { return handleTimePeriodChange(String(key)); }, children: [jsx(Tab, { title: t.months6 }, "6-months"), jsx(Tab, { title: t.months3 }, "3-months"), jsx(Tab, { title: t.days30 }, "30-days"), jsx(Tab, { title: t.days7 }, "7-days"), jsx(Tab, { title: t.hours24 }, "24-hours")] })), showMetricCards && (jsx("div", { className: "mt-2 flex w-full items-center", children: jsx("div", { className: "-my-3 flex w-full max-w-[800px] items-center gap-x-3 overflow-x-auto py-3", children: data.map(function (_a) {
|
|
357
357
|
var key = _a.key, change = _a.change, changeType = _a.changeType, type = _a.type, value = _a.value, title = _a.title;
|
|
358
358
|
return (jsxs("button", { type: "button", className: cn("rounded-medium flex w-full flex-col gap-2 p-3 transition-colors", {
|
|
359
359
|
"bg-default-100": activeChart === key,
|
|
@@ -365,7 +365,7 @@ var AnalyticsCard = function (_a) {
|
|
|
365
365
|
? "success"
|
|
366
366
|
: changeType === "negative"
|
|
367
367
|
? "danger"
|
|
368
|
-
: "default", radius: "md", size: "sm", startContent: changeType === "positive" ? (jsx(IconComponent
|
|
368
|
+
: "default", radius: "md", size: "sm", startContent: changeType === "positive" ? (jsx(IconComponent, { icon: "solar:arrow-right-up-linear", size: "sm" })) : changeType === "negative" ? (jsx(IconComponent, { icon: "solar:arrow-right-down-linear", size: "sm" })) : (jsx(IconComponent, { icon: "solar:arrow-right-linear", size: "sm" })), variant: "bordered", children: jsx("span", { children: change }) })] })] }, key));
|
|
369
369
|
}) }) }))] }) }), jsx(ResponsiveContainer, { className: "min-h-[300px] [&_.recharts-surface]:outline-hidden", height: "100%", width: "100%", children: jsxs(AreaChart, { accessibilityLayer: true, data: chartData, height: 300, margin: {
|
|
370
370
|
left: 0,
|
|
371
371
|
right: 0,
|
|
@@ -393,7 +393,7 @@ var AnalyticsCard = function (_a) {
|
|
|
393
393
|
r: 4,
|
|
394
394
|
}, animationDuration: 1000, animationEasing: "ease", dataKey: "value", fill: "url(#colorGradient)", stroke: "hsl(var(--heroui-".concat(color, "))"), strokeWidth: 2, type: "monotone" })] }) }), showDropdownMenu && (jsxs(Dropdown, { classNames: {
|
|
395
395
|
content: "min-w-[120px]",
|
|
396
|
-
}, placement: "bottom-end", children: [jsx(DropdownTrigger, { children: jsx(Button$
|
|
396
|
+
}, placement: "bottom-end", children: [jsx(DropdownTrigger, { children: jsx(Button$1, { isIconOnly: true, className: "absolute top-2 right-2 w-auto rounded-full", size: "lg", variant: "bordered", children: jsx(IconComponent, { icon: "solar:menu-dots-bold", size: "sm" }) }) }), jsxs(DropdownMenu, { itemClasses: {
|
|
397
397
|
title: "text-tiny",
|
|
398
398
|
}, variant: "bordered", onAction: function (key) { return handleMenuAction(String(key)); }, children: [jsx(DropdownItem, { children: t.viewDetails }, "view-details"), jsx(DropdownItem, { children: t.exportData }, "export-data"), jsx(DropdownItem, { children: t.setAlert }, "set-alert")] })] }))] }) })));
|
|
399
399
|
};
|
|
@@ -408,10 +408,10 @@ var AnalyticsCard = function (_a) {
|
|
|
408
408
|
* - Size: sm, md, lg (configurable)
|
|
409
409
|
*/
|
|
410
410
|
var AuraAutocomplete = function (_a) {
|
|
411
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest
|
|
411
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest(_a, ["label", "id", "size", "variant", "radius"]);
|
|
412
412
|
var generatedId = useId();
|
|
413
413
|
var autoId = id || generatedId;
|
|
414
|
-
return (jsxs("div", { children: [label && (jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsx(Autocomplete, __assign
|
|
414
|
+
return (jsxs("div", { children: [label && (jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsx(Autocomplete, __assign({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
|
|
415
415
|
base: "[&_[data-slot=input-wrapper][data-focus=true]]:!border-primary-500",
|
|
416
416
|
popoverContent: "[&_li[data-hover=true]]:!bg-primary-50 [&_li[data-hover=true]]:!text-default-600 [&_li]:!text-default-500",
|
|
417
417
|
} }))] }));
|
|
@@ -433,7 +433,7 @@ var useThemeContext = function () {
|
|
|
433
433
|
return context;
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
var themeColors
|
|
436
|
+
var themeColors = {
|
|
437
437
|
"blue-light": {
|
|
438
438
|
extend: "light",
|
|
439
439
|
colors: {
|
|
@@ -933,7 +933,7 @@ var ColorSelector = function (_a) {
|
|
|
933
933
|
* - label: the base color name (e.g., "blue")
|
|
934
934
|
* - color: the primary color hex value
|
|
935
935
|
*/
|
|
936
|
-
var colorOptions = Object.entries(themeColors
|
|
936
|
+
var colorOptions = Object.entries(themeColors)
|
|
937
937
|
.filter(function (_a) {
|
|
938
938
|
var themeData = _a[1];
|
|
939
939
|
var themeMode = themeData.extend;
|
|
@@ -964,7 +964,7 @@ var ColorSelector = function (_a) {
|
|
|
964
964
|
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
965
965
|
*/
|
|
966
966
|
var Chip = function (_a) {
|
|
967
|
-
var _b = _a.color, color = _b === void 0 ? "default" : _b, props = __rest
|
|
967
|
+
var _b = _a.color, color = _b === void 0 ? "default" : _b, props = __rest(_a, ["color"]);
|
|
968
968
|
// Colores estándar de HeroUI
|
|
969
969
|
var standardColors = [
|
|
970
970
|
"default",
|
|
@@ -976,7 +976,7 @@ var Chip = function (_a) {
|
|
|
976
976
|
];
|
|
977
977
|
// Si es un color estándar, usar HeroUI normalmente
|
|
978
978
|
if (standardColors.includes(color)) {
|
|
979
|
-
return (jsx(Chip$1, __assign
|
|
979
|
+
return (jsx(Chip$1, __assign({}, props, { color: color, onClose: props.onClose })));
|
|
980
980
|
}
|
|
981
981
|
// Si es un color personalizado, aplicar clases CSS específicas
|
|
982
982
|
var customColorClasses = {
|
|
@@ -987,1239 +987,136 @@ var Chip = function (_a) {
|
|
|
987
987
|
orange: "bg-orange-100 text-orange-500",
|
|
988
988
|
};
|
|
989
989
|
var colorClasses = customColorClasses[color];
|
|
990
|
-
return (jsx(Chip$1, __assign
|
|
990
|
+
return (jsx(Chip$1, __assign({}, props, { onClose: props.onClose, classNames: __assign({ base: colorClasses }, props.classNames) })));
|
|
991
991
|
};
|
|
992
992
|
|
|
993
993
|
// Traducciones por defecto en español
|
|
994
|
-
var defaultTranslations$
|
|
994
|
+
var defaultTranslations$9 = {
|
|
995
995
|
dayOption: "Día específico",
|
|
996
996
|
dateRangeOption: "Rango de fechas",
|
|
997
997
|
selectDateAriaLabel: "Seleccionar fecha",
|
|
998
998
|
selectDateRangeAriaLabel: "Seleccionar rango de fechas",
|
|
999
999
|
};
|
|
1000
1000
|
/**
|
|
1001
|
-
* DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
|
|
1002
|
-
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
1003
|
-
* Maneja su propio estado interno de manera autónoma.
|
|
1004
|
-
*/
|
|
1005
|
-
var DateSelector = function (_a) {
|
|
1006
|
-
var _b = _a.initialType, initialType = _b === void 0 ? HolidayType
|
|
1007
|
-
// Estado interno del componente
|
|
1008
|
-
var _e = React.useState(initialType), type = _e[0], setType = _e[1];
|
|
1009
|
-
var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
|
|
1010
|
-
var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
|
|
1011
|
-
// Combinar traducciones por defecto con las proporcionadas
|
|
1012
|
-
var t = __assign
|
|
1013
|
-
var handleTypeChange = function (value) {
|
|
1014
|
-
var newType = value;
|
|
1015
|
-
setType(newType);
|
|
1016
|
-
// Limpiar valores cuando cambia el tipo
|
|
1017
|
-
if (newType === HolidayType
|
|
1018
|
-
setDateRange(null);
|
|
1019
|
-
}
|
|
1020
|
-
else {
|
|
1021
|
-
setDate(null);
|
|
1022
|
-
}
|
|
1023
|
-
// Notificar cambio
|
|
1024
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1025
|
-
type: newType,
|
|
1026
|
-
date: newType === HolidayType$1.SingleDay ? date : null,
|
|
1027
|
-
dateRange: newType === HolidayType$1.DateRange ? dateRange : null,
|
|
1028
|
-
});
|
|
1029
|
-
};
|
|
1030
|
-
var handleDateChange = function (selectedDate) {
|
|
1031
|
-
setDate(selectedDate);
|
|
1032
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1033
|
-
type: type,
|
|
1034
|
-
date: selectedDate,
|
|
1035
|
-
dateRange: null,
|
|
1036
|
-
});
|
|
1037
|
-
};
|
|
1038
|
-
var handleDateRangeChange = function (range) {
|
|
1039
|
-
setDateRange(range);
|
|
1040
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1041
|
-
type: type,
|
|
1042
|
-
date: null,
|
|
1043
|
-
dateRange: range,
|
|
1044
|
-
});
|
|
1045
|
-
};
|
|
1046
|
-
return (jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxs(RadioGroup, __assign$1({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsx(Radio, __assign$1({ value: HolidayType$1.SingleDay }, radioItemProps, { children: t.dayOption })), jsx(Radio, __assign$1({ value: HolidayType$1.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === HolidayType$1.DateRange ? (jsx(DateRangePicker$1, __assign$1({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent$1, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsx(DatePicker$1, __assign$1({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsx(IconComponent$1, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
|
|
1047
|
-
};
|
|
1048
|
-
|
|
1049
|
-
var H1 = function (_a) {
|
|
1050
|
-
var children = _a.children, className = _a.className, props = __rest$1(_a, ["children", "className"]);
|
|
1051
|
-
return (jsx("h1", __assign$1({ className: cn("text-xl font-bold", className) }, props, { children: children })));
|
|
1052
|
-
};
|
|
1053
|
-
|
|
1054
|
-
var H3 = function (_a) {
|
|
1055
|
-
var children = _a.children, className = _a.className, props = __rest$1(_a, ["children", "className"]);
|
|
1056
|
-
return (jsx("h3", __assign$1({ className: cn("text-base font-medium", className) }, props, { children: children })));
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
var H4 = function (_a) {
|
|
1060
|
-
var children = _a.children, className = _a.className, props = __rest$1(_a, ["children", "className"]);
|
|
1061
|
-
return (jsx("h4", __assign$1({ className: cn("text-sm font-medium ", className) }, props, { children: children })));
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
/**
|
|
1065
|
-
* Breadcrumbs - Wrapper simple del componente HeroUI Breadcrumbs
|
|
1066
|
-
*
|
|
1067
|
-
* Este componente es un wrapper directo del componente Breadcrumbs de HeroUI,
|
|
1068
|
-
* proporcionando una interfaz simplificada y consistente con el resto de la librería.
|
|
1069
|
-
*
|
|
1070
|
-
* @example
|
|
1071
|
-
* ```tsx
|
|
1072
|
-
* // Uso básico
|
|
1073
|
-
* <Breadcrumbs>
|
|
1074
|
-
* <BreadcrumbItem href="/">Inicio</BreadcrumbItem>
|
|
1075
|
-
* <BreadcrumbItem href="/products">Productos</BreadcrumbItem>
|
|
1076
|
-
* <BreadcrumbItem>Detalle</BreadcrumbItem>
|
|
1077
|
-
* </Breadcrumbs>
|
|
1078
|
-
*
|
|
1079
|
-
* // Con items como prop
|
|
1080
|
-
* <Breadcrumbs
|
|
1081
|
-
* items={[
|
|
1082
|
-
* { label: "Inicio", href: "/" },
|
|
1083
|
-
* { label: "Productos", href: "/products" },
|
|
1084
|
-
* { label: "Detalle", isCurrent: true }
|
|
1085
|
-
* ]}
|
|
1086
|
-
* />
|
|
1087
|
-
* ```
|
|
1088
|
-
*/
|
|
1089
|
-
var BreadcrumbsComponent = function (_a) {
|
|
1090
|
-
var items = _a.items, children = _a.children, heroUIProps = __rest$1(_a, ["items", "children"]);
|
|
1091
|
-
return (jsx(Breadcrumbs, __assign$1({}, heroUIProps, { children: items
|
|
1092
|
-
? items.map(function (item, index) { return (jsx(BreadcrumbItem, { href: item.href, isCurrent: item.isCurrent, children: item.label }, "".concat(item.href || item.label, "-").concat(index))); })
|
|
1093
|
-
: children })));
|
|
1094
|
-
};
|
|
1095
|
-
|
|
1096
|
-
var ConfigMenu = function (_a) {
|
|
1097
|
-
var _b;
|
|
1098
|
-
var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
|
|
1099
|
-
return (jsxs(Dropdown, { className: "min-w-40", children: [jsx(DropdownTrigger, { children: jsx(Button$2, { isIconOnly: true, color: "default", startContent: jsx(IconComponent$1, { icon: "solar:settings-linear" }) }) }), jsxs(DropdownMenu, { "aria-label": "Configuration", children: [jsx(DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsx(DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
|
|
1100
|
-
base: "text-default-500",
|
|
1101
|
-
}, startContent: item.icon ? jsx(IconComponent$1, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsx(DropdownSection, { children: jsx(DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
|
|
1102
|
-
base: "text-default-500",
|
|
1103
|
-
}, startContent: jsx(IconComponent$1, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
|
|
1104
|
-
};
|
|
1105
|
-
ConfigMenu.displayName = "ConfigMenu";
|
|
1106
|
-
|
|
1107
|
-
var NotificationButton = function (_a) {
|
|
1108
|
-
var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
|
|
1109
|
-
return (jsx(Button$2, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsx(IconComponent$1, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsx("span", { className: "notification__alert", children: notificationCount })) }));
|
|
1110
|
-
};
|
|
1111
|
-
NotificationButton.displayName = "NotificationButton";
|
|
1112
|
-
|
|
1113
|
-
var HeaderComponent = function (_a) {
|
|
1114
|
-
var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations, breadcrumbs = _a.breadcrumbs;
|
|
1115
|
-
return (jsx("header", { className: "header__container", children: jsxs("div", { className: "flex items-center justify-between w-full", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsx(Button$2, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsx(IconComponent$1, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), breadcrumbs && breadcrumbs.length > 0 && (jsx(BreadcrumbsComponent, { items: breadcrumbs }))] }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(NotificationButton, { notificationCount: notificationCount }), jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }) }));
|
|
1116
|
-
};
|
|
1117
|
-
HeaderComponent.displayName = "Header";
|
|
1118
|
-
|
|
1119
|
-
/******************************************************************************
|
|
1120
|
-
Copyright (c) Microsoft Corporation.
|
|
1121
|
-
|
|
1122
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1123
|
-
purpose with or without fee is hereby granted.
|
|
1124
|
-
|
|
1125
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1126
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1127
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1128
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1129
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1130
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1131
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1132
|
-
***************************************************************************** */
|
|
1133
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
var __assign = function() {
|
|
1137
|
-
__assign = Object.assign || function __assign(t) {
|
|
1138
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1139
|
-
s = arguments[i];
|
|
1140
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1141
|
-
}
|
|
1142
|
-
return t;
|
|
1143
|
-
};
|
|
1144
|
-
return __assign.apply(this, arguments);
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
function __rest(s, e) {
|
|
1148
|
-
var t = {};
|
|
1149
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1150
|
-
t[p] = s[p];
|
|
1151
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1152
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1153
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1154
|
-
t[p[i]] = s[p[i]];
|
|
1155
|
-
}
|
|
1156
|
-
return t;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
function __spreadArray(to, from, pack) {
|
|
1160
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1161
|
-
if (ar || !(i in from)) {
|
|
1162
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1163
|
-
ar[i] = from[i];
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1170
|
-
var e = new Error(message);
|
|
1171
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1172
|
-
};
|
|
1173
|
-
|
|
1174
|
-
var HolidayType;
|
|
1175
|
-
(function (HolidayType) {
|
|
1176
|
-
HolidayType["SingleDay"] = "singleDay";
|
|
1177
|
-
HolidayType["DateRange"] = "dateRange";
|
|
1178
|
-
})(HolidayType || (HolidayType = {}));
|
|
1179
|
-
|
|
1180
|
-
/**
|
|
1181
|
-
* Botón genérico basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
1182
|
-
*
|
|
1183
|
-
* Reglas aplicadas:
|
|
1184
|
-
* - Variant: Solid, Bordered, Light, Flat, Faded
|
|
1185
|
-
* - Size: sm, md, lg
|
|
1186
|
-
* - StartContent: On, Off
|
|
1187
|
-
* - isLoading: On, Off
|
|
1188
|
-
* - Radius: md (por defecto)
|
|
1189
|
-
* - isIconOnly: True, False
|
|
1190
|
-
*/
|
|
1191
|
-
var Button = function (_a) {
|
|
1192
|
-
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "solid" : _d, _e = _a.radius, radius = _e === void 0 ? "sm" : _e, startContent = _a.startContent, endContent = _a.endContent, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, _g = _a.isIconOnly, isIconOnly = _g === void 0 ? false : _g, props = __rest(_a, ["color", "size", "variant", "radius", "startContent", "endContent", "isLoading", "isIconOnly"]);
|
|
1193
|
-
return (jsx(Button$2, __assign({}, props, { color: color, size: size, variant: variant, radius: radius, startContent: startContent, endContent: endContent, isLoading: isLoading, isIconOnly: isIconOnly })));
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
var sizeMap = {
|
|
1197
|
-
sm: "16px",
|
|
1198
|
-
md: "20px",
|
|
1199
|
-
lg: "24px",
|
|
1200
|
-
xl: "32px",
|
|
1201
|
-
};
|
|
1202
|
-
var IconComponent = function (_a) {
|
|
1203
|
-
var _b;
|
|
1204
|
-
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"]);
|
|
1205
|
-
var iconSize = (_b = sizeMap[size]) !== null && _b !== void 0 ? _b : sizeMap.md;
|
|
1206
|
-
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 }) })));
|
|
1207
|
-
};
|
|
1208
|
-
({
|
|
1209
|
-
type: HolidayType.SingleDay});
|
|
1210
|
-
|
|
1211
|
-
createContext({
|
|
1212
|
-
mode: "light",
|
|
1213
|
-
color: "blue",
|
|
1214
|
-
// biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
|
|
1215
|
-
setMode: function () { },
|
|
1216
|
-
// biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
|
|
1217
|
-
setColor: function () { },
|
|
1218
|
-
});
|
|
1219
|
-
|
|
1220
|
-
var themeColors = {
|
|
1221
|
-
"blue-light": {
|
|
1222
|
-
extend: "light",
|
|
1223
|
-
colors: {
|
|
1224
|
-
primary: {
|
|
1225
|
-
"50": "#dfedfd",
|
|
1226
|
-
"100": "#b3d4fa",
|
|
1227
|
-
"200": "#86bbf7",
|
|
1228
|
-
"300": "#59a1f4",
|
|
1229
|
-
"400": "#2d88f1",
|
|
1230
|
-
"500": "#006fee",
|
|
1231
|
-
"600": "#005cc4",
|
|
1232
|
-
"700": "#00489b",
|
|
1233
|
-
"800": "#003571",
|
|
1234
|
-
"900": "#002147",
|
|
1235
|
-
foreground: "#fff",
|
|
1236
|
-
DEFAULT: "#006fee",
|
|
1237
|
-
},
|
|
1238
|
-
secondary: {
|
|
1239
|
-
"50": "#eee4f8",
|
|
1240
|
-
"100": "#d7bfef",
|
|
1241
|
-
"200": "#bf99e5",
|
|
1242
|
-
"300": "#a773db",
|
|
1243
|
-
"400": "#904ed2",
|
|
1244
|
-
"500": "#7828c8",
|
|
1245
|
-
"600": "#6321a5",
|
|
1246
|
-
"700": "#4e1a82",
|
|
1247
|
-
"800": "#39135f",
|
|
1248
|
-
"900": "#240c3c",
|
|
1249
|
-
foreground: "#fff",
|
|
1250
|
-
DEFAULT: "#7828c8",
|
|
1251
|
-
},
|
|
1252
|
-
success: {
|
|
1253
|
-
"50": "#e2f8ec",
|
|
1254
|
-
"100": "#b9efd1",
|
|
1255
|
-
"200": "#91e5b5",
|
|
1256
|
-
"300": "#68dc9a",
|
|
1257
|
-
"400": "#40d27f",
|
|
1258
|
-
"500": "#17c964",
|
|
1259
|
-
"600": "#13a653",
|
|
1260
|
-
"700": "#0f8341",
|
|
1261
|
-
"800": "#0b5f30",
|
|
1262
|
-
"900": "#073c1e",
|
|
1263
|
-
foreground: "#000",
|
|
1264
|
-
DEFAULT: "#17c964",
|
|
1265
|
-
},
|
|
1266
|
-
warning: {
|
|
1267
|
-
"50": "#fef4e4",
|
|
1268
|
-
"100": "#fce4bd",
|
|
1269
|
-
"200": "#fad497",
|
|
1270
|
-
"300": "#f9c571",
|
|
1271
|
-
"400": "#f7b54a",
|
|
1272
|
-
"500": "#f5a524",
|
|
1273
|
-
"600": "#ca881e",
|
|
1274
|
-
"700": "#9f6b17",
|
|
1275
|
-
"800": "#744e11",
|
|
1276
|
-
"900": "#4a320b",
|
|
1277
|
-
foreground: "#000",
|
|
1278
|
-
DEFAULT: "#f5a524",
|
|
1279
|
-
},
|
|
1280
|
-
danger: {
|
|
1281
|
-
"50": "#fee1eb",
|
|
1282
|
-
"100": "#fbb8cf",
|
|
1283
|
-
"200": "#f98eb3",
|
|
1284
|
-
"300": "#f76598",
|
|
1285
|
-
"400": "#f53b7c",
|
|
1286
|
-
"500": "#f31260",
|
|
1287
|
-
"600": "#c80f4f",
|
|
1288
|
-
"700": "#9e0c3e",
|
|
1289
|
-
"800": "#73092e",
|
|
1290
|
-
"900": "#49051d",
|
|
1291
|
-
foreground: "#000",
|
|
1292
|
-
DEFAULT: "#f31260",
|
|
1293
|
-
},
|
|
1294
|
-
focus: "#006FEE",
|
|
1295
|
-
overlay: "#000000",
|
|
1296
|
-
},
|
|
1297
|
-
},
|
|
1298
|
-
"blue-dark": {
|
|
1299
|
-
extend: "dark",
|
|
1300
|
-
colors: {
|
|
1301
|
-
primary: {
|
|
1302
|
-
"50": "#002147",
|
|
1303
|
-
"100": "#003571",
|
|
1304
|
-
"200": "#00489b",
|
|
1305
|
-
"300": "#005cc4",
|
|
1306
|
-
"400": "#006fee",
|
|
1307
|
-
"500": "#2d88f1",
|
|
1308
|
-
"600": "#59a1f4",
|
|
1309
|
-
"700": "#86bbf7",
|
|
1310
|
-
"800": "#b3d4fa",
|
|
1311
|
-
"900": "#dfedfd",
|
|
1312
|
-
foreground: "#fff",
|
|
1313
|
-
DEFAULT: "#006fee",
|
|
1314
|
-
},
|
|
1315
|
-
secondary: {
|
|
1316
|
-
"50": "#240c3c",
|
|
1317
|
-
"100": "#39135f",
|
|
1318
|
-
"200": "#4e1a82",
|
|
1319
|
-
"300": "#6321a5",
|
|
1320
|
-
"400": "#7828c8",
|
|
1321
|
-
"500": "#904ed2",
|
|
1322
|
-
"600": "#a773db",
|
|
1323
|
-
"700": "#bf99e5",
|
|
1324
|
-
"800": "#d7bfef",
|
|
1325
|
-
"900": "#eee4f8",
|
|
1326
|
-
foreground: "#fff",
|
|
1327
|
-
DEFAULT: "#7828c8",
|
|
1328
|
-
},
|
|
1329
|
-
success: {
|
|
1330
|
-
"50": "#073c1e",
|
|
1331
|
-
"100": "#0b5f30",
|
|
1332
|
-
"200": "#0f8341",
|
|
1333
|
-
"300": "#13a653",
|
|
1334
|
-
"400": "#17c964",
|
|
1335
|
-
"500": "#40d27f",
|
|
1336
|
-
"600": "#68dc9a",
|
|
1337
|
-
"700": "#91e5b5",
|
|
1338
|
-
"800": "#b9efd1",
|
|
1339
|
-
"900": "#e2f8ec",
|
|
1340
|
-
foreground: "#000",
|
|
1341
|
-
DEFAULT: "#17c964",
|
|
1342
|
-
},
|
|
1343
|
-
warning: {
|
|
1344
|
-
"50": "#4a320b",
|
|
1345
|
-
"100": "#744e11",
|
|
1346
|
-
"200": "#9f6b17",
|
|
1347
|
-
"300": "#ca881e",
|
|
1348
|
-
"400": "#f5a524",
|
|
1349
|
-
"500": "#f7b54a",
|
|
1350
|
-
"600": "#f9c571",
|
|
1351
|
-
"700": "#fad497",
|
|
1352
|
-
"800": "#fce4bd",
|
|
1353
|
-
"900": "#fef4e4",
|
|
1354
|
-
foreground: "#000",
|
|
1355
|
-
DEFAULT: "#f5a524",
|
|
1356
|
-
},
|
|
1357
|
-
danger: {
|
|
1358
|
-
"50": "#49051d",
|
|
1359
|
-
"100": "#73092e",
|
|
1360
|
-
"200": "#9e0c3e",
|
|
1361
|
-
"300": "#c80f4f",
|
|
1362
|
-
"400": "#f31260",
|
|
1363
|
-
"500": "#f53b7c",
|
|
1364
|
-
"600": "#f76598",
|
|
1365
|
-
"700": "#f98eb3",
|
|
1366
|
-
"800": "#fbb8cf",
|
|
1367
|
-
"900": "#fee1eb",
|
|
1368
|
-
foreground: "#000",
|
|
1369
|
-
DEFAULT: "#f31260",
|
|
1370
|
-
},
|
|
1371
|
-
focus: "#006FEE",
|
|
1372
|
-
overlay: "#ffffff",
|
|
1373
|
-
},
|
|
1374
|
-
},
|
|
1375
|
-
"purple-light": {
|
|
1376
|
-
extend: "light",
|
|
1377
|
-
colors: {
|
|
1378
|
-
primary: {
|
|
1379
|
-
"50": "#eee4f8",
|
|
1380
|
-
"100": "#d7bfef",
|
|
1381
|
-
"200": "#bf99e5",
|
|
1382
|
-
"300": "#a773db",
|
|
1383
|
-
"400": "#904ed2",
|
|
1384
|
-
"500": "#7828c8",
|
|
1385
|
-
"600": "#6321a5",
|
|
1386
|
-
"700": "#4e1a82",
|
|
1387
|
-
"800": "#39135f",
|
|
1388
|
-
"900": "#240c3c",
|
|
1389
|
-
foreground: "#fff",
|
|
1390
|
-
DEFAULT: "#7828c8",
|
|
1391
|
-
},
|
|
1392
|
-
secondary: {
|
|
1393
|
-
"50": "#dfedfd",
|
|
1394
|
-
"100": "#b3d4fa",
|
|
1395
|
-
"200": "#86bbf7",
|
|
1396
|
-
"300": "#59a1f4",
|
|
1397
|
-
"400": "#2d88f1",
|
|
1398
|
-
"500": "#006fee",
|
|
1399
|
-
"600": "#005cc4",
|
|
1400
|
-
"700": "#00489b",
|
|
1401
|
-
"800": "#003571",
|
|
1402
|
-
"900": "#002147",
|
|
1403
|
-
foreground: "#fff",
|
|
1404
|
-
DEFAULT: "#006fee",
|
|
1405
|
-
},
|
|
1406
|
-
focus: "#7828c8",
|
|
1407
|
-
overlay: "#000000",
|
|
1408
|
-
},
|
|
1409
|
-
},
|
|
1410
|
-
"purple-dark": {
|
|
1411
|
-
extend: "dark",
|
|
1412
|
-
colors: {
|
|
1413
|
-
primary: {
|
|
1414
|
-
"50": "#2c193f",
|
|
1415
|
-
"100": "#462764",
|
|
1416
|
-
"200": "#603689",
|
|
1417
|
-
"300": "#7944ae",
|
|
1418
|
-
"400": "#9353d3",
|
|
1419
|
-
"500": "#a671db",
|
|
1420
|
-
"600": "#b98fe2",
|
|
1421
|
-
"700": "#ccadea",
|
|
1422
|
-
"800": "#dfcbf2",
|
|
1423
|
-
"900": "#f2eafa",
|
|
1424
|
-
foreground: "#fff",
|
|
1425
|
-
DEFAULT: "#9353d3",
|
|
1426
|
-
},
|
|
1427
|
-
secondary: {
|
|
1428
|
-
"50": "#1e254d",
|
|
1429
|
-
"100": "#2f3a79",
|
|
1430
|
-
"200": "#404fa6",
|
|
1431
|
-
"300": "#5265d2",
|
|
1432
|
-
"400": "#637aff",
|
|
1433
|
-
"500": "#7e91ff",
|
|
1434
|
-
"600": "#9aa9ff",
|
|
1435
|
-
"700": "#b5c0ff",
|
|
1436
|
-
"800": "#d0d7ff",
|
|
1437
|
-
"900": "#eceeff",
|
|
1438
|
-
foreground: "#000",
|
|
1439
|
-
DEFAULT: "#637aff",
|
|
1440
|
-
},
|
|
1441
|
-
focus: "#9353d3",
|
|
1442
|
-
},
|
|
1443
|
-
},
|
|
1444
|
-
"yellow-light": {
|
|
1445
|
-
extend: "light",
|
|
1446
|
-
colors: {
|
|
1447
|
-
primary: {
|
|
1448
|
-
"50": "#fffbe6",
|
|
1449
|
-
"100": "#FFFACD",
|
|
1450
|
-
"200": "#FFF39B",
|
|
1451
|
-
"300": "#FFEB69",
|
|
1452
|
-
"400": "#FFE243",
|
|
1453
|
-
"500": "#FFD505",
|
|
1454
|
-
"600": "#DBB303",
|
|
1455
|
-
"700": "#B79202",
|
|
1456
|
-
"800": "#937301",
|
|
1457
|
-
"900": "#7A5D00",
|
|
1458
|
-
foreground: "#000",
|
|
1459
|
-
DEFAULT: "#FFD505",
|
|
1460
|
-
},
|
|
1461
|
-
secondary: {
|
|
1462
|
-
"50": "#F3F7FD",
|
|
1463
|
-
"100": "#D1DFFB",
|
|
1464
|
-
"200": "#A5BEF7",
|
|
1465
|
-
"300": "#7494E7",
|
|
1466
|
-
"400": "#4E6FCF",
|
|
1467
|
-
"500": "#1E40AF",
|
|
1468
|
-
"600": "#153096",
|
|
1469
|
-
"700": "#0F237D",
|
|
1470
|
-
"800": "#091865",
|
|
1471
|
-
"900": "#051053",
|
|
1472
|
-
foreground: "#fff",
|
|
1473
|
-
DEFAULT: "#1E40AF",
|
|
1474
|
-
},
|
|
1475
|
-
focus: "#FFD505",
|
|
1476
|
-
overlay: "#000000",
|
|
1477
|
-
},
|
|
1478
|
-
},
|
|
1479
|
-
"yellow-dark": {
|
|
1480
|
-
extend: "dark",
|
|
1481
|
-
colors: {
|
|
1482
|
-
primary: {
|
|
1483
|
-
"50": "#7A5D00",
|
|
1484
|
-
"100": "#937301",
|
|
1485
|
-
"200": "#B79202",
|
|
1486
|
-
"300": "#DBB303",
|
|
1487
|
-
"400": "#FFD505",
|
|
1488
|
-
"500": "#FFE243",
|
|
1489
|
-
"600": "#FFEB69",
|
|
1490
|
-
"700": "#FFF39B",
|
|
1491
|
-
"800": "#FFFACD",
|
|
1492
|
-
"900": "#fffbe6",
|
|
1493
|
-
foreground: "#000",
|
|
1494
|
-
DEFAULT: "#FFD505",
|
|
1495
|
-
},
|
|
1496
|
-
secondary: {
|
|
1497
|
-
50: "#e1efff",
|
|
1498
|
-
100: "#b2d0ff",
|
|
1499
|
-
200: "#83b1fc",
|
|
1500
|
-
300: "#5292f8",
|
|
1501
|
-
400: "#2473f5",
|
|
1502
|
-
500: "#0a5adb",
|
|
1503
|
-
600: "#0246ac",
|
|
1504
|
-
700: "#00327c",
|
|
1505
|
-
800: "#001e4d",
|
|
1506
|
-
900: "#000a1f",
|
|
1507
|
-
foreground: "#fff",
|
|
1508
|
-
DEFAULT: "#0a5adb",
|
|
1509
|
-
},
|
|
1510
|
-
focus: "#FFD505",
|
|
1511
|
-
overlay: "#ffffff",
|
|
1512
|
-
},
|
|
1513
|
-
},
|
|
1514
|
-
"coral-light": {
|
|
1515
|
-
extend: "light",
|
|
1516
|
-
colors: {
|
|
1517
|
-
primary: {
|
|
1518
|
-
"50": "#ffe9e9",
|
|
1519
|
-
"100": "#ffcaca",
|
|
1520
|
-
"200": "#ffabab",
|
|
1521
|
-
"300": "#ff8d8d",
|
|
1522
|
-
"400": "#ff6e6e",
|
|
1523
|
-
"500": "#ff4f4f",
|
|
1524
|
-
"600": "#d24141",
|
|
1525
|
-
"700": "#a63333",
|
|
1526
|
-
"800": "#792626",
|
|
1527
|
-
"900": "#4d1818",
|
|
1528
|
-
foreground: "#000",
|
|
1529
|
-
DEFAULT: "#ff4f4f",
|
|
1530
|
-
},
|
|
1531
|
-
focus: "#ff4f4f",
|
|
1532
|
-
},
|
|
1533
|
-
},
|
|
1534
|
-
"coral-dark": {
|
|
1535
|
-
extend: "dark",
|
|
1536
|
-
colors: {
|
|
1537
|
-
primary: {
|
|
1538
|
-
"50": "#4d1818",
|
|
1539
|
-
"100": "#792626",
|
|
1540
|
-
"200": "#a63333",
|
|
1541
|
-
"300": "#d24141",
|
|
1542
|
-
"400": "#ff4f4f",
|
|
1543
|
-
"500": "#ff6e6e",
|
|
1544
|
-
"600": "#ff8d8d",
|
|
1545
|
-
"700": "#ffabab",
|
|
1546
|
-
"800": "#ffcaca",
|
|
1547
|
-
"900": "#ffe9e9",
|
|
1548
|
-
foreground: "#000",
|
|
1549
|
-
DEFAULT: "#ff4f4f",
|
|
1550
|
-
},
|
|
1551
|
-
focus: "#ff4f4f",
|
|
1552
|
-
},
|
|
1553
|
-
},
|
|
1554
|
-
"green-light": {
|
|
1555
|
-
extend: "light",
|
|
1556
|
-
colors: {
|
|
1557
|
-
primary: {
|
|
1558
|
-
50: "#EFFFEF",
|
|
1559
|
-
100: "#CFFCD1",
|
|
1560
|
-
200: "#A0F9AC",
|
|
1561
|
-
300: "#6FEE8D",
|
|
1562
|
-
400: "#49DE7B",
|
|
1563
|
-
500: "#16C964",
|
|
1564
|
-
600: "#10AC64",
|
|
1565
|
-
700: "#0B905F",
|
|
1566
|
-
800: "#077457",
|
|
1567
|
-
900: "#046051",
|
|
1568
|
-
foreground: "#000",
|
|
1569
|
-
DEFAULT: "#16C964",
|
|
1570
|
-
},
|
|
1571
|
-
secondary: {
|
|
1572
|
-
"50": "#e3eaff",
|
|
1573
|
-
"100": "#D7DFFE",
|
|
1574
|
-
"200": "#AFBFFE",
|
|
1575
|
-
"300": "#889DFD",
|
|
1576
|
-
"400": "#6A82FB",
|
|
1577
|
-
"500": "#3956F9",
|
|
1578
|
-
"600": "#2941D6",
|
|
1579
|
-
"700": "#1C2EB3",
|
|
1580
|
-
"800": "#121F90",
|
|
1581
|
-
"900": "#0A1477",
|
|
1582
|
-
foreground: "#fff",
|
|
1583
|
-
DEFAULT: "#3956F9",
|
|
1584
|
-
},
|
|
1585
|
-
success: {
|
|
1586
|
-
"50": "#e7fde3",
|
|
1587
|
-
"100": "#E8FCD3",
|
|
1588
|
-
"200": "#CBFAA8",
|
|
1589
|
-
"300": "#A4F17B",
|
|
1590
|
-
"400": "#7EE358",
|
|
1591
|
-
"500": "#49D127",
|
|
1592
|
-
"600": "#2FB31C",
|
|
1593
|
-
"700": "#1A9613",
|
|
1594
|
-
"800": "#0C790E",
|
|
1595
|
-
"900": "#076410",
|
|
1596
|
-
foreground: "#000",
|
|
1597
|
-
DEFAULT: "#49D127",
|
|
1598
|
-
},
|
|
1599
|
-
warning: {
|
|
1600
|
-
"50": "#fff9da",
|
|
1601
|
-
"100": "#FFF7CC",
|
|
1602
|
-
"200": "#FFEE99",
|
|
1603
|
-
"300": "#FFE266",
|
|
1604
|
-
"400": "#FFD63F",
|
|
1605
|
-
"500": "#FFC300",
|
|
1606
|
-
"600": "#DBA200",
|
|
1607
|
-
"700": "#B78300",
|
|
1608
|
-
"800": "#936600",
|
|
1609
|
-
"900": "#7A5100",
|
|
1610
|
-
foreground: "#000",
|
|
1611
|
-
DEFAULT: "#FFC300",
|
|
1612
|
-
},
|
|
1613
|
-
danger: {
|
|
1614
|
-
"50": "#ffe2e5",
|
|
1615
|
-
"100": "#FFE3D8",
|
|
1616
|
-
"200": "#FFC1B2",
|
|
1617
|
-
"300": "#FF988B",
|
|
1618
|
-
"400": "#FF726F",
|
|
1619
|
-
"500": "#FF3F4C",
|
|
1620
|
-
"600": "#DB2E49",
|
|
1621
|
-
"700": "#B71F45",
|
|
1622
|
-
"800": "#93143F",
|
|
1623
|
-
"900": "#7A0C3B",
|
|
1624
|
-
foreground: "#000",
|
|
1625
|
-
DEFAULT: "#FF3F4C",
|
|
1626
|
-
},
|
|
1627
|
-
focus: "#66cc8a",
|
|
1628
|
-
overlay: "#000000",
|
|
1629
|
-
},
|
|
1630
|
-
},
|
|
1631
|
-
"green-dark": {
|
|
1632
|
-
extend: "dark",
|
|
1633
|
-
colors: {
|
|
1634
|
-
primary: {
|
|
1635
|
-
50: "#EFFFEF",
|
|
1636
|
-
100: "#CFFCD1",
|
|
1637
|
-
200: "#A0F9AC",
|
|
1638
|
-
300: "#6FEE8D",
|
|
1639
|
-
400: "#49DE7B",
|
|
1640
|
-
500: "#16C964",
|
|
1641
|
-
600: "#10AC64",
|
|
1642
|
-
700: "#0B905F",
|
|
1643
|
-
800: "#077457",
|
|
1644
|
-
900: "#046051",
|
|
1645
|
-
foreground: "#000",
|
|
1646
|
-
DEFAULT: "#16C964",
|
|
1647
|
-
},
|
|
1648
|
-
secondary: {
|
|
1649
|
-
"50": "#e3eaff",
|
|
1650
|
-
"100": "#D7DFFE",
|
|
1651
|
-
"200": "#AFBFFE",
|
|
1652
|
-
"300": "#889DFD",
|
|
1653
|
-
"400": "#6A82FB",
|
|
1654
|
-
"500": "#3956F9",
|
|
1655
|
-
"600": "#2941D6",
|
|
1656
|
-
"700": "#1C2EB3",
|
|
1657
|
-
"800": "#121F90",
|
|
1658
|
-
"900": "#0A1477",
|
|
1659
|
-
foreground: "#fff",
|
|
1660
|
-
DEFAULT: "#3956F9",
|
|
1661
|
-
},
|
|
1662
|
-
success: {
|
|
1663
|
-
"50": "#e7fde3",
|
|
1664
|
-
"100": "#E8FCD3",
|
|
1665
|
-
"200": "#CBFAA8",
|
|
1666
|
-
"300": "#A4F17B",
|
|
1667
|
-
"400": "#7EE358",
|
|
1668
|
-
"500": "#49D127",
|
|
1669
|
-
"600": "#2FB31C",
|
|
1670
|
-
"700": "#1A9613",
|
|
1671
|
-
"800": "#0C790E",
|
|
1672
|
-
"900": "#076410",
|
|
1673
|
-
foreground: "#000",
|
|
1674
|
-
DEFAULT: "#49D127",
|
|
1675
|
-
},
|
|
1676
|
-
warning: {
|
|
1677
|
-
"50": "#fff9da",
|
|
1678
|
-
"100": "#FFF7CC",
|
|
1679
|
-
"200": "#FFEE99",
|
|
1680
|
-
"300": "#FFE266",
|
|
1681
|
-
"400": "#FFD63F",
|
|
1682
|
-
"500": "#FFC300",
|
|
1683
|
-
"600": "#DBA200",
|
|
1684
|
-
"700": "#B78300",
|
|
1685
|
-
"800": "#936600",
|
|
1686
|
-
"900": "#7A5100",
|
|
1687
|
-
foreground: "#000",
|
|
1688
|
-
DEFAULT: "#FFC300",
|
|
1689
|
-
},
|
|
1690
|
-
danger: {
|
|
1691
|
-
"50": "#ffe2e5",
|
|
1692
|
-
"100": "#FFE3D8",
|
|
1693
|
-
"200": "#FFC1B2",
|
|
1694
|
-
"300": "#FF988B",
|
|
1695
|
-
"400": "#FF726F",
|
|
1696
|
-
"500": "#FF3F4C",
|
|
1697
|
-
"600": "#DB2E49",
|
|
1698
|
-
"700": "#B71F45",
|
|
1699
|
-
"800": "#93143F",
|
|
1700
|
-
"900": "#7A0C3B",
|
|
1701
|
-
foreground: "#fff",
|
|
1702
|
-
DEFAULT: "#FF3F4C",
|
|
1703
|
-
},
|
|
1704
|
-
focus: "#66cc8a",
|
|
1705
|
-
overlay: "#ffffff",
|
|
1706
|
-
},
|
|
1707
|
-
},
|
|
1708
|
-
};
|
|
1709
|
-
|
|
1710
|
-
function normalizeClass$1(value) {
|
|
1711
|
-
if (typeof value === "string") {
|
|
1712
|
-
return value || undefined;
|
|
1713
|
-
}
|
|
1714
|
-
if (Array.isArray(value)) {
|
|
1715
|
-
return value.filter(Boolean).join(" ") || undefined;
|
|
1716
|
-
}
|
|
1717
|
-
return undefined;
|
|
1718
|
-
}
|
|
1719
|
-
var getSectionClasses$1 = function (isCollapsed, sectionClassesProp) {
|
|
1720
|
-
if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
|
|
1721
|
-
return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
|
|
1722
|
-
var k = _a[0], v = _a[1];
|
|
1723
|
-
return [k, normalizeClass$1(v)];
|
|
1724
|
-
}))), { base: normalizeClass$1(cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
|
|
1725
|
-
"p-0 max-w-[44px]": isCollapsed,
|
|
1726
|
-
})), group: normalizeClass$1(cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.group, {
|
|
1727
|
-
"flex flex-col gap-1": isCollapsed,
|
|
1728
|
-
})), heading: normalizeClass$1(cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.heading, {
|
|
1729
|
-
hidden: isCollapsed,
|
|
1730
|
-
})) }));
|
|
1731
|
-
};
|
|
1732
|
-
var getItemClasses$1 = function (isCollapsed, itemClassesProp) {
|
|
1733
|
-
if (itemClassesProp === void 0) { itemClassesProp = {}; }
|
|
1734
|
-
return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
|
|
1735
|
-
var k = _a[0], v = _a[1];
|
|
1736
|
-
return [k, normalizeClass$1(v)];
|
|
1737
|
-
}))), { base: normalizeClass$1(cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
|
|
1738
|
-
"w-11 h-11 gap-0 p-0": isCollapsed,
|
|
1739
|
-
})) }));
|
|
1740
|
-
};
|
|
1741
|
-
|
|
1742
|
-
var EnumMenuNavListItem$1;
|
|
1743
|
-
(function (EnumMenuNavListItem) {
|
|
1744
|
-
EnumMenuNavListItem["Nest"] = "nest";
|
|
1745
|
-
})(EnumMenuNavListItem$1 || (EnumMenuNavListItem$1 = {}));
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* @component MenuNavList
|
|
1749
|
-
* @description A versatile navigation list component that can be displayed in an expanded or collapsed state.
|
|
1750
|
-
* It supports nested items, sections, and tooltips for items in the collapsed state.
|
|
1751
|
-
*
|
|
1752
|
-
* @param {MenuNavListProps} props - Props for configuring the component.
|
|
1753
|
-
* @param {MenuNavListItem[]} props.items - Array of items to display in the list.
|
|
1754
|
-
* @param {boolean} [props.isCollapsed] - If `true`, the menu is displayed in its collapsed state (icons only).
|
|
1755
|
-
* @param {React.Key} [props.defaultSelectedKey] - The key of the default selected item.
|
|
1756
|
-
* @param {(key: React.Key) => void} [props.onSelect] - Callback executed when an item is selected.
|
|
1757
|
-
* @param {boolean} [props.hideEndContent] - If `true`, hides the end content of the items.
|
|
1758
|
-
* @param {object} [props.sectionClasses] - CSS classes to customize the sections.
|
|
1759
|
-
* @param {object} [props.itemClasses] - CSS classes to customize the items.
|
|
1760
|
-
* @param {string} [props.iconClassName] - CSS class for the icons.
|
|
1761
|
-
* @param {object} [props.classNames] - CSS classes to customize the Listbox component.
|
|
1762
|
-
* @param {string} [props.className] - CSS class for the main container.
|
|
1763
|
-
*
|
|
1764
|
-
* @forwardRef
|
|
1765
|
-
*/
|
|
1766
|
-
var MenuNavList$1 = React.forwardRef(function (_a, ref) {
|
|
1767
|
-
var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
|
|
1768
|
-
var _d = useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
|
|
1769
|
-
// Component styles
|
|
1770
|
-
var sectionClasses = getSectionClasses$1(isCollapsed, sectionClassesProp);
|
|
1771
|
-
var itemClasses = getItemClasses$1(isCollapsed, itemClassesProp);
|
|
1772
|
-
// Handles the click event on an item, updating the selection state.
|
|
1773
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
1774
|
-
var handleItemPress = React.useCallback(function (item, parentKey) {
|
|
1775
|
-
var keySelected = typeof parentKey === "string" ? parentKey : item.key;
|
|
1776
|
-
setSelected(keySelected);
|
|
1777
|
-
// Force blur to remove hover state after click.
|
|
1778
|
-
if (document.activeElement instanceof HTMLElement) {
|
|
1779
|
-
document.activeElement.blur();
|
|
1780
|
-
}
|
|
1781
|
-
}, [setSelected]);
|
|
1782
|
-
// Renders the item displayed inside the Popover when the menu is collapsed.
|
|
1783
|
-
var renderCompactItem = React.useCallback(function (item, parentKey) {
|
|
1784
|
-
var _a, _b;
|
|
1785
|
-
return (createElement(ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
|
|
1786
|
-
}, [handleItemPress, iconClassName]);
|
|
1787
|
-
// Renders a nested item, i.e., an item that has sub-items.
|
|
1788
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
1789
|
-
var renderNestItem = React.useCallback(function (item) {
|
|
1790
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1791
|
-
var isNestType = item.items &&
|
|
1792
|
-
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
1793
|
-
(item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem$1.Nest;
|
|
1794
|
-
if (isNestType) {
|
|
1795
|
-
item.href = undefined;
|
|
1796
|
-
}
|
|
1797
|
-
return (createElement(ListboxItem, __assign({}, item, { key: item.key, classNames: {
|
|
1798
|
-
base: cn({
|
|
1799
|
-
"h-auto p-0": !isCollapsed && isNestType,
|
|
1800
|
-
}, {
|
|
1801
|
-
"inline-block w-11": isCollapsed && isNestType,
|
|
1802
|
-
}, {
|
|
1803
|
-
"data-[selected=true]:bg-primary-100 h-11 justify-center items-center flex": isCollapsed && isNestType,
|
|
1804
|
-
}, "rounded-large"),
|
|
1805
|
-
}, endContent: isCollapsed || isNestType || hideEndContent
|
|
1806
|
-
? null
|
|
1807
|
-
: ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
|
|
1808
|
-
isCollapsed && isNestType ? (jsxs(Popover, { placement: "right", offset: 10, children: [jsx(PopoverTrigger, { children: jsx("div", { className: "flex w-full items-center justify-center", children: jsx(Tooltip$1, { content: item.title, placement: "right", classNames: {
|
|
1809
|
-
base: "text-default-500",
|
|
1810
|
-
}, children: jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsx(PopoverContent, { className: "p-0", children: jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsx(Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
|
|
1811
|
-
? item.items.map(function (child) {
|
|
1812
|
-
return renderCompactItem(child, item.key);
|
|
1813
|
-
})
|
|
1814
|
-
: renderCompactItem(item) })] }) })] })) : null,
|
|
1815
|
-
!isCollapsed && isNestType ? (jsx(Accordion, { className: "p-0", children: jsx(AccordionItem, { "aria-label": item.title, classNames: {
|
|
1816
|
-
heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
|
|
1817
|
-
trigger: "p-0",
|
|
1818
|
-
content: "py-0 pl-4",
|
|
1819
|
-
}, title: item.icon ? (jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsx(Listbox, { className: "mt-0.5 text-default-500", classNames: {
|
|
1820
|
-
list: cn("border-l border-default-200 pl-4"),
|
|
1821
|
-
}, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
|
|
1822
|
-
}, [isCollapsed, hideEndContent, iconClassName, items, selected]);
|
|
1823
|
-
// Renders a simple item (without children) in the navigation list.
|
|
1824
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
1825
|
-
var renderItem = React.useCallback(function (item, parentKey) {
|
|
1826
|
-
var _a, _b, _c, _d;
|
|
1827
|
-
var isNestType = item.items &&
|
|
1828
|
-
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
1829
|
-
(item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem$1.Nest;
|
|
1830
|
-
if (isNestType) {
|
|
1831
|
-
return renderNestItem(item);
|
|
1832
|
-
}
|
|
1833
|
-
var isItemSelected = selected === item.key;
|
|
1834
|
-
return (createElement(ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsx(Tooltip$1, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
|
|
1835
|
-
base: "text-default-500",
|
|
1836
|
-
}, children: jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
|
|
1837
|
-
},
|
|
1838
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1839
|
-
[isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
|
|
1840
|
-
return (jsx(Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
|
|
1841
|
-
var _a, _b;
|
|
1842
|
-
return item.items &&
|
|
1843
|
-
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
1844
|
-
(item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem$1.Nest ? (renderNestItem(item)) : item.items && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsx(ListboxSection, { classNames: sectionClasses, showDivider: isCollapsed, title: item.title, children: item.items.map(renderItem) }, item.key)) : (renderItem(item));
|
|
1845
|
-
} }), isCollapsed ? "compact" : "default"));
|
|
1846
|
-
});
|
|
1847
|
-
MenuNavList$1.displayName = "MenuNavList";
|
|
1848
|
-
|
|
1849
|
-
/**
|
|
1850
|
-
* Sidebar menu component for navigation and user actions.
|
|
1851
|
-
* @param commerceInfo - Object with logo and name of the company.
|
|
1852
|
-
* @param userInfo - Object with user avatar, name, and email.
|
|
1853
|
-
* @param helpButton - Help button configuration.
|
|
1854
|
-
* @param upgradeCard - Optional upgrade card configuration.
|
|
1855
|
-
* @param isOpenSidebar - Controls sidebar visibility.
|
|
1856
|
-
* @param onOpenSidebarChange - Callback to open/close sidebar.
|
|
1857
|
-
*/
|
|
1858
|
-
React.memo(function Menu(_a) {
|
|
1859
|
-
var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, upgradeCard = _a.upgradeCard, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems;
|
|
1860
|
-
// State to control menu collapse on desktop devices
|
|
1861
|
-
var _b = React.useState(false), isCollapsed = _b[0], setIsCollapsed = _b[1];
|
|
1862
|
-
// Memoized handlers for performance
|
|
1863
|
-
var handleSidebarClose = useCallback(function () {
|
|
1864
|
-
onOpenSidebarChange === null || onOpenSidebarChange === void 0 ? void 0 : onOpenSidebarChange(false);
|
|
1865
|
-
}, [onOpenSidebarChange]);
|
|
1866
|
-
var handleCollapseToggle = useCallback(function () {
|
|
1867
|
-
setIsCollapsed(function (prev) { return !prev; });
|
|
1868
|
-
}, []);
|
|
1869
|
-
var handleUpgradeClick = useCallback(function () {
|
|
1870
|
-
if (upgradeCard) {
|
|
1871
|
-
window.open(upgradeCard.buttonLink, "_blank");
|
|
1872
|
-
}
|
|
1873
|
-
}, [upgradeCard]);
|
|
1874
|
-
var handleHelpClick = useCallback(function () {
|
|
1875
|
-
window.open(helpButton.redirect, "_blank");
|
|
1876
|
-
}, [helpButton]);
|
|
1877
|
-
if (!isOpenSidebar) {
|
|
1878
|
-
return null;
|
|
1879
|
-
}
|
|
1880
|
-
return (jsxs(Fragment, { children: [jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsx("div", { className: "container__menu ".concat(isCollapsed
|
|
1881
|
-
? "container__menu--collapsed"
|
|
1882
|
-
: "container__menu--expanded"), children: jsxs("div", { className: "content__menu", children: [jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxs("div", { className: "flex items-center", children: [jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsx(IconComponent, { icon: isCollapsed
|
|
1883
|
-
? "solar:alt-arrow-right-outline"
|
|
1884
|
-
: "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsx(Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxs("div", { className: "collapsible-item flex flex-col", children: [jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsx(MenuNavList$1, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxs("div", { className: "collapsible-item relative", children: [jsxs(Card$1, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxs(CardBody, { className: "items-center py-5 text-center gap-1", children: [jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsx(CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsx(Button$2, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsx(Spacer, { y: 9 })] })), jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsx(Button$2, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
|
|
1885
|
-
});
|
|
1886
|
-
|
|
1887
|
-
var StepIndicator$1 = function (_a) {
|
|
1888
|
-
var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.showStepText, showStepText = _c === void 0 ? true : _c, stepTextFormatter = _a.stepTextFormatter, className = _a.className, props = __rest(_a, ["currentStep", "totalSteps", "color", "showStepText", "stepTextFormatter", "className"]);
|
|
1889
|
-
var progressPercentage = Math.min((currentStep / totalSteps) * 100, 100);
|
|
1890
|
-
var colorClasses = {
|
|
1891
|
-
primary: "bg-primary",
|
|
1892
|
-
secondary: "bg-secondary",
|
|
1893
|
-
success: "bg-success",
|
|
1894
|
-
warning: "bg-warning",
|
|
1895
|
-
danger: "bg-danger",
|
|
1896
|
-
};
|
|
1897
|
-
var defaultStepText = function (current, total) {
|
|
1898
|
-
return "Step ".concat(current, " of ").concat(total);
|
|
1899
|
-
};
|
|
1900
|
-
var stepText = stepTextFormatter
|
|
1901
|
-
? stepTextFormatter(currentStep, totalSteps)
|
|
1902
|
-
: defaultStepText(currentStep, totalSteps);
|
|
1903
|
-
return (jsxs("div", __assign({ className: cn("w-full", className) }, props, { children: [showStepText && (jsx("div", { className: "text-center text-sm font-medium text-default-400 mb-3", children: stepText })), jsx("div", { className: "w-full bg-content2 rounded-full h-2 overflow-hidden", children: jsx("div", { className: cn("h-full transition-all duration-300 ease-out rounded-full", colorClasses[color]), style: { width: "".concat(progressPercentage, "%") } }) })] })));
|
|
1904
|
-
};
|
|
1905
|
-
|
|
1906
|
-
/*
|
|
1907
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
1908
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
1909
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
1910
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1911
|
-
*
|
|
1912
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
1913
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
1914
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
1915
|
-
* governing permissions and limitations under the License.
|
|
1916
|
-
*/
|
|
1917
|
-
function $458b0a5536c1a7cf$export$40bfa8c7b0832715$1(value, defaultValue, onChange) {
|
|
1918
|
-
let [stateValue, setStateValue] = (useState)(value || defaultValue);
|
|
1919
|
-
let isControlledRef = (useRef)(value !== undefined);
|
|
1920
|
-
let isControlled = value !== undefined;
|
|
1921
|
-
(useEffect)(()=>{
|
|
1922
|
-
let wasControlled = isControlledRef.current;
|
|
1923
|
-
if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
|
|
1924
|
-
isControlledRef.current = isControlled;
|
|
1925
|
-
}, [
|
|
1926
|
-
isControlled
|
|
1927
|
-
]);
|
|
1928
|
-
let currentValue = isControlled ? value : stateValue;
|
|
1929
|
-
let setValue = (useCallback)((value, ...args)=>{
|
|
1930
|
-
let onChangeCaller = (value, ...onChangeArgs)=>{
|
|
1931
|
-
if (onChange) {
|
|
1932
|
-
if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
|
|
1933
|
-
}
|
|
1934
|
-
if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
|
|
1935
|
-
// calling setState multiple times with the same value only emits onChange once.
|
|
1936
|
-
// We do not use a ref for this because we specifically _do_ want the value to
|
|
1937
|
-
// reset every render, and assigning to a ref in render breaks aborted suspended renders.
|
|
1938
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1939
|
-
currentValue = value;
|
|
1940
|
-
};
|
|
1941
|
-
if (typeof value === 'function') {
|
|
1942
|
-
if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
|
|
1943
|
-
// this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
|
|
1944
|
-
// when someone using useControlledState calls setControlledState(myFunc)
|
|
1945
|
-
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
|
|
1946
|
-
// if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
|
|
1947
|
-
// otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
|
|
1948
|
-
let updateFunction = (oldValue, ...functionArgs)=>{
|
|
1949
|
-
let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
1950
|
-
onChangeCaller(interceptedValue, ...args);
|
|
1951
|
-
if (!isControlled) return interceptedValue;
|
|
1952
|
-
return oldValue;
|
|
1953
|
-
};
|
|
1954
|
-
setStateValue(updateFunction);
|
|
1955
|
-
} else {
|
|
1956
|
-
if (!isControlled) setStateValue(value);
|
|
1957
|
-
onChangeCaller(value, ...args);
|
|
1958
|
-
}
|
|
1959
|
-
}, [
|
|
1960
|
-
isControlled,
|
|
1961
|
-
currentValue,
|
|
1962
|
-
onChange
|
|
1963
|
-
]);
|
|
1964
|
-
return [
|
|
1965
|
-
currentValue,
|
|
1966
|
-
setValue
|
|
1967
|
-
];
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
var defaultTranslations$6$1 = {
|
|
1971
|
-
checkIconTitle: "Check",
|
|
1972
|
-
};
|
|
1973
|
-
var VerticalSteps$1 = React.forwardRef(function (_a, ref) {
|
|
1974
|
-
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"]);
|
|
1975
|
-
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715$1(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
1976
|
-
var t = __assign(__assign({}, defaultTranslations$6$1), translations);
|
|
1977
|
-
var steps = React.useMemo(function () {
|
|
1978
|
-
if (typeof stepsProp === "number") {
|
|
1979
|
-
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
1980
|
-
}
|
|
1981
|
-
return stepsProp;
|
|
1982
|
-
}, [stepsProp]);
|
|
1983
|
-
var colors = React.useMemo(function () {
|
|
1984
|
-
var _a;
|
|
1985
|
-
var colorMappings = {
|
|
1986
|
-
primary: [
|
|
1987
|
-
"[--step-color:hsl(var(--heroui-primary))]",
|
|
1988
|
-
"[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
|
|
1989
|
-
],
|
|
1990
|
-
secondary: [
|
|
1991
|
-
"[--step-color:hsl(var(--heroui-secondary))]",
|
|
1992
|
-
"[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
|
|
1993
|
-
],
|
|
1994
|
-
success: [
|
|
1995
|
-
"[--step-color:hsl(var(--heroui-success))]",
|
|
1996
|
-
"[--step-fg-color:hsl(var(--heroui-success-foreground))]",
|
|
1997
|
-
],
|
|
1998
|
-
warning: [
|
|
1999
|
-
"[--step-color:hsl(var(--heroui-warning))]",
|
|
2000
|
-
"[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
|
|
2001
|
-
],
|
|
2002
|
-
danger: [
|
|
2003
|
-
"[--step-color:hsl(var(--heroui-danger))]",
|
|
2004
|
-
"[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
|
|
2005
|
-
],
|
|
2006
|
-
default: [
|
|
2007
|
-
"[--step-color:hsl(var(--heroui-default))]",
|
|
2008
|
-
"[--step-fg-color:hsl(var(--heroui-default-foreground))]",
|
|
2009
|
-
],
|
|
2010
|
-
};
|
|
2011
|
-
var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
|
|
2012
|
-
var colorsVars = [
|
|
2013
|
-
"[--active-fg-color:var(--step-fg-color)]",
|
|
2014
|
-
"[--active-border-color:var(--step-color)]",
|
|
2015
|
-
"[--active-color:var(--step-color)]",
|
|
2016
|
-
"[--complete-background-color:var(--step-color)]",
|
|
2017
|
-
"[--complete-border-color:var(--step-color)]",
|
|
2018
|
-
"[--inactive-border-color:hsl(var(--heroui-default-300))]",
|
|
2019
|
-
"[--inactive-color:hsl(var(--heroui-default-300))]",
|
|
2020
|
-
];
|
|
2021
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
|
|
2022
|
-
colorsVars.unshift(fgColor);
|
|
2023
|
-
}
|
|
2024
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
|
|
2025
|
-
colorsVars.unshift(userColor);
|
|
2026
|
-
}
|
|
2027
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
|
|
2028
|
-
colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
|
|
2029
|
-
}
|
|
2030
|
-
return colorsVars;
|
|
2031
|
-
}, [color, className]);
|
|
2032
|
-
return (jsx("nav", { "aria-label": "Progress", className: "max-w-fit", children: jsx("ol", { className: cn("flex flex-col gap-y-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
2033
|
-
var status = currentStep === stepIdx
|
|
2034
|
-
? "active"
|
|
2035
|
-
: step.isCompleted
|
|
2036
|
-
? "complete"
|
|
2037
|
-
: "inactive";
|
|
2038
|
-
var isDisabled = status === "inactive";
|
|
2039
|
-
return (
|
|
2040
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
2041
|
-
jsxs("li", { className: "relative", children: [jsx("div", { className: "flex w-full max-w-full items-center", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName, {
|
|
2042
|
-
"cursor-not-allowed": isDisabled,
|
|
2043
|
-
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsx("div", { className: "flex h-full items-center", children: jsx(LazyMotion, { features: domAnimation, children: jsx("div", { className: "relative", children: jsx(m.div, { animate: status, className: cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
|
|
2044
|
-
"shadow-lg": status === "complete",
|
|
2045
|
-
}), "data-status": status, initial: false, transition: { duration: 0.25 }, variants: {
|
|
2046
|
-
inactive: {
|
|
2047
|
-
backgroundColor: "transparent",
|
|
2048
|
-
borderColor: "var(--inactive-border-color)",
|
|
2049
|
-
color: "var(--inactive-color)",
|
|
2050
|
-
},
|
|
2051
|
-
active: {
|
|
2052
|
-
backgroundColor: "transparent",
|
|
2053
|
-
borderColor: "var(--active-border-color)",
|
|
2054
|
-
color: "var(--active-color)",
|
|
2055
|
-
},
|
|
2056
|
-
complete: {
|
|
2057
|
-
backgroundColor: "var(--complete-background-color)",
|
|
2058
|
-
borderColor: "var(--complete-border-color)",
|
|
2059
|
-
},
|
|
2060
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsx("div", { className: "flex-1 text-left", children: jsxs("div", { children: [jsx("div", { className: cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2061
|
-
"text-default-300": status === "inactive",
|
|
2062
|
-
}), children: step.title }), jsx("div", { className: cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2063
|
-
"text-default-300": status === "inactive",
|
|
2064
|
-
}), children: step.description })] }) })] }), stepIdx) }), stepIdx < steps.length - 1 && !hideProgressBars && (jsx("div", { "aria-hidden": "true", className: cn("pointer-events-none absolute top-[calc(64px*var(--idx)+1)] left-3 flex h-1/2 -translate-y-1/3 items-center px-4"), style: {
|
|
2065
|
-
// @ts-ignore
|
|
2066
|
-
"--idx": stepIdx,
|
|
2067
|
-
}, children: jsx("div", { className: cn("relative h-full w-0.5 bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-0 after:w-full after:bg-[var(--active-border-color)] after:transition-[height] after:duration-300 after:content-['']", {
|
|
2068
|
-
"after:h-full": stepIdx < currentStep,
|
|
2069
|
-
}) }) }))] }, stepIdx));
|
|
2070
|
-
}) }) }));
|
|
2071
|
-
});
|
|
2072
|
-
VerticalSteps$1.displayName = "VerticalSteps";
|
|
2073
|
-
|
|
2074
|
-
var stepperClasses$1 = cn(
|
|
2075
|
-
// light
|
|
2076
|
-
"[--step-color:hsl(var(--heroui-primary-400))]", "[--active-color:hsl(var(--heroui-primary-400))]", "[--inactive-border-color:hsl(var(--heroui-primary-200))]", "[--inactive-bar-color:hsl(var(--heroui-primary-200))]", "[--inactive-color:hsl(var(--heroui-primary-300))]",
|
|
2077
|
-
// dark
|
|
2078
|
-
"dark:[--step-color:rgba(255,255,255,0.1)]", "dark:[--active-color:hsl(var(--heroui-foreground-600))]", "dark:[--active-border-color:rgba(255,255,255,0.5)]", "dark:[--inactive-border-color:rgba(255,255,255,0.1)]", "dark:[--inactive-bar-color:rgba(255,255,255,0.1)]", "dark:[--inactive-color:rgba(255,255,255,0.2)]");
|
|
2079
|
-
var MultiStepSidebar$1 = React.forwardRef(function (_a, ref) {
|
|
2080
|
-
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose"]);
|
|
2081
|
-
var handleOverlayClick = function (e) {
|
|
2082
|
-
if (e.target === e.currentTarget) {
|
|
2083
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
1001
|
+
* DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
|
|
1002
|
+
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
1003
|
+
* Maneja su propio estado interno de manera autónoma.
|
|
1004
|
+
*/
|
|
1005
|
+
var DateSelector = function (_a) {
|
|
1006
|
+
var _b = _a.initialType, initialType = _b === void 0 ? HolidayType.SingleDay : _b, initialDate = _a.initialDate, initialDateRange = _a.initialDateRange, onChange = _a.onChange, _c = _a.translations, translations = _c === void 0 ? {} : _c, radioGroupProps = _a.radioGroupProps, radioItemProps = _a.radioItemProps, datePickerProps = _a.datePickerProps, dateRangePickerProps = _a.dateRangePickerProps, _d = _a.className, className = _d === void 0 ? "" : _d;
|
|
1007
|
+
// Estado interno del componente
|
|
1008
|
+
var _e = React.useState(initialType), type = _e[0], setType = _e[1];
|
|
1009
|
+
var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
|
|
1010
|
+
var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
|
|
1011
|
+
// Combinar traducciones por defecto con las proporcionadas
|
|
1012
|
+
var t = __assign(__assign({}, defaultTranslations$9), translations);
|
|
1013
|
+
var handleTypeChange = function (value) {
|
|
1014
|
+
var newType = value;
|
|
1015
|
+
setType(newType);
|
|
1016
|
+
// Limpiar valores cuando cambia el tipo
|
|
1017
|
+
if (newType === HolidayType.SingleDay) {
|
|
1018
|
+
setDateRange(null);
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
setDate(null);
|
|
2084
1022
|
}
|
|
1023
|
+
// Notificar cambio
|
|
1024
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1025
|
+
type: newType,
|
|
1026
|
+
date: newType === HolidayType.SingleDay ? date : null,
|
|
1027
|
+
dateRange: newType === HolidayType.DateRange ? dateRange : null,
|
|
1028
|
+
});
|
|
2085
1029
|
};
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
1030
|
+
var handleDateChange = function (selectedDate) {
|
|
1031
|
+
setDate(selectedDate);
|
|
1032
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1033
|
+
type: type,
|
|
1034
|
+
date: selectedDate,
|
|
1035
|
+
dateRange: null,
|
|
1036
|
+
});
|
|
1037
|
+
};
|
|
1038
|
+
var handleDateRangeChange = function (range) {
|
|
1039
|
+
setDateRange(range);
|
|
1040
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
1041
|
+
type: type,
|
|
1042
|
+
date: null,
|
|
1043
|
+
dateRange: range,
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
return (jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxs(RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsx(Radio, __assign({ value: HolidayType.SingleDay }, radioItemProps, { children: t.dayOption })), jsx(Radio, __assign({ value: HolidayType.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === HolidayType.DateRange ? (jsx(DateRangePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsx(DatePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
|
|
1047
|
+
};
|
|
2089
1048
|
|
|
2090
|
-
|
|
2091
|
-
var
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
{ code: "+55", name: "Brazil", country: "BR" },
|
|
2095
|
-
{ code: "+52", name: "Mexico", country: "MX" },
|
|
2096
|
-
{ code: "+503", name: "El Salvador", country: "SV" },
|
|
2097
|
-
{ code: "+51", name: "Peru", country: "PE" },
|
|
2098
|
-
{ code: "+56", name: "Chile", country: "CL" },
|
|
2099
|
-
{ code: "+1", name: "United States", country: "US" },
|
|
2100
|
-
{ code: "+7", name: "Russia", country: "RU" },
|
|
2101
|
-
{ code: "+20", name: "Egypt", country: "EG" },
|
|
2102
|
-
{ code: "+27", name: "South Africa", country: "ZA" },
|
|
2103
|
-
{ code: "+33", name: "France", country: "FR" },
|
|
2104
|
-
{ code: "+34", name: "Spain", country: "ES" },
|
|
2105
|
-
{ code: "+39", name: "Italy", country: "IT" },
|
|
2106
|
-
{ code: "+44", name: "United Kingdom", country: "GB" },
|
|
2107
|
-
{ code: "+49", name: "Germany", country: "DE" },
|
|
2108
|
-
{ code: "+61", name: "Australia", country: "AU" },
|
|
2109
|
-
{ code: "+62", name: "Indonesia", country: "ID" },
|
|
2110
|
-
{ code: "+64", name: "New Zealand", country: "NZ" },
|
|
2111
|
-
{ code: "+65", name: "Singapore", country: "SG" },
|
|
2112
|
-
{ code: "+81", name: "Japan", country: "JP" },
|
|
2113
|
-
{ code: "+86", name: "China", country: "CN" },
|
|
2114
|
-
{ code: "+91", name: "India", country: "IN" },
|
|
2115
|
-
{ code: "+351", name: "Portugal", country: "PT" },
|
|
2116
|
-
{ code: "+971", name: "UAE", country: "AE" },
|
|
2117
|
-
];
|
|
2118
|
-
Array.from(new Map(countries$1.map(function (item) { return [item.code + item.name, item]; })).values());
|
|
1049
|
+
var H1 = function (_a) {
|
|
1050
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
1051
|
+
return (jsx("h1", __assign({ className: cn("text-xl font-bold", className) }, props, { children: children })));
|
|
1052
|
+
};
|
|
2119
1053
|
|
|
2120
|
-
var
|
|
2121
|
-
var
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
if (typeof stepsProp === "number") {
|
|
2125
|
-
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
2126
|
-
}
|
|
2127
|
-
return stepsProp;
|
|
2128
|
-
}, [stepsProp]);
|
|
2129
|
-
var colors = React.useMemo(function () {
|
|
2130
|
-
var _a;
|
|
2131
|
-
var colorMappings = {
|
|
2132
|
-
primary: [
|
|
2133
|
-
"[--step-color:hsl(var(--heroui-primary))]",
|
|
2134
|
-
"[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
|
|
2135
|
-
],
|
|
2136
|
-
secondary: [
|
|
2137
|
-
"[--step-color:hsl(var(--heroui-secondary))]",
|
|
2138
|
-
"[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
|
|
2139
|
-
],
|
|
2140
|
-
success: [
|
|
2141
|
-
"[--step-color:hsl(var(--heroui-success))]",
|
|
2142
|
-
"[--step-fg-color:hsl(var(--heroui-success-foreground))]",
|
|
2143
|
-
],
|
|
2144
|
-
warning: [
|
|
2145
|
-
"[--step-color:hsl(var(--heroui-warning))]",
|
|
2146
|
-
"[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
|
|
2147
|
-
],
|
|
2148
|
-
danger: [
|
|
2149
|
-
"[--step-color:hsl(var(--heroui-danger))]",
|
|
2150
|
-
"[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
|
|
2151
|
-
],
|
|
2152
|
-
default: [
|
|
2153
|
-
"[--step-color:hsl(var(--heroui-default))]",
|
|
2154
|
-
"[--step-fg-color:hsl(var(--heroui-default-foreground))]",
|
|
2155
|
-
],
|
|
2156
|
-
};
|
|
2157
|
-
var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
|
|
2158
|
-
var colorsVars = [
|
|
2159
|
-
"[--active-fg-color:var(--step-fg-color)]",
|
|
2160
|
-
"[--active-border-color:var(--step-color)]",
|
|
2161
|
-
"[--active-color:var(--step-color)]",
|
|
2162
|
-
"[--complete-background-color:var(--step-color)]",
|
|
2163
|
-
"[--complete-border-color:var(--step-color)]",
|
|
2164
|
-
"[--inactive-border-color:hsl(var(--heroui-default-300))]",
|
|
2165
|
-
"[--inactive-color:hsl(var(--heroui-default-300))]",
|
|
2166
|
-
];
|
|
2167
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
|
|
2168
|
-
colorsVars.unshift(fgColor);
|
|
2169
|
-
}
|
|
2170
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
|
|
2171
|
-
colorsVars.unshift(userColor);
|
|
2172
|
-
}
|
|
2173
|
-
if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
|
|
2174
|
-
colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
|
|
2175
|
-
}
|
|
2176
|
-
return colorsVars;
|
|
2177
|
-
}, [color, className]);
|
|
2178
|
-
return (jsx("nav", { "aria-label": "Progress", className: "-my-4 max-w-fit overflow-x-auto py-4", children: jsx("ol", { className: cn("flex flex-row flex-nowrap gap-x-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
|
|
2179
|
-
var status = currentStep === stepIdx
|
|
2180
|
-
? "active"
|
|
2181
|
-
: currentStep < stepIdx
|
|
2182
|
-
? "inactive"
|
|
2183
|
-
: "complete";
|
|
2184
|
-
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsx("div", { className: "h-ful relative flex items-center", children: jsx(LazyMotion, { features: domAnimation, children: jsx(m.div, { animate: status, className: "relative", children: jsx(m.div, { className: cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
|
|
2185
|
-
"shadow-lg": status === "complete",
|
|
2186
|
-
}), initial: false, transition: { duration: 0.25 }, variants: {
|
|
2187
|
-
inactive: {
|
|
2188
|
-
backgroundColor: "transparent",
|
|
2189
|
-
borderColor: "var(--inactive-border-color)",
|
|
2190
|
-
color: "var(--inactive-color)",
|
|
2191
|
-
},
|
|
2192
|
-
active: {
|
|
2193
|
-
backgroundColor: "transparent",
|
|
2194
|
-
borderColor: "var(--active-border-color)",
|
|
2195
|
-
color: "var(--active-color)",
|
|
2196
|
-
},
|
|
2197
|
-
complete: {
|
|
2198
|
-
backgroundColor: "var(--complete-background-color)",
|
|
2199
|
-
borderColor: "var(--complete-border-color)",
|
|
2200
|
-
},
|
|
2201
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsx("div", { className: "max-w-full flex-1 text-start", children: jsx("div", { className: cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
2202
|
-
"text-default-300": status === "inactive",
|
|
2203
|
-
}), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
2204
|
-
// @ts-ignore
|
|
2205
|
-
"--idx": stepIdx,
|
|
2206
|
-
}, children: jsx("div", { className: cn("relative h-0.5 w-full bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-full after:w-0 after:bg-[var(--active-border-color)] after:transition-[width] after:duration-300 after:content-['']", {
|
|
2207
|
-
"after:w-full": stepIdx < currentStep,
|
|
2208
|
-
}) }) }))] }), stepIdx) }, stepIdx));
|
|
2209
|
-
}) }) }));
|
|
2210
|
-
});
|
|
2211
|
-
RowSteps$1.displayName = "RowSteps";
|
|
1054
|
+
var H3 = function (_a) {
|
|
1055
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
1056
|
+
return (jsx("h3", __assign({ className: cn("text-base font-medium", className) }, props, { children: children })));
|
|
1057
|
+
};
|
|
2212
1058
|
|
|
2213
|
-
|
|
1059
|
+
var H4 = function (_a) {
|
|
1060
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
1061
|
+
return (jsx("h4", __assign({ className: cn("text-sm font-medium ", className) }, props, { children: children })));
|
|
1062
|
+
};
|
|
2214
1063
|
|
|
2215
1064
|
/**
|
|
2216
|
-
*
|
|
1065
|
+
* Breadcrumbs - Wrapper simple del componente HeroUI Breadcrumbs
|
|
1066
|
+
*
|
|
1067
|
+
* Este componente es un wrapper directo del componente Breadcrumbs de HeroUI,
|
|
1068
|
+
* proporcionando una interfaz simplificada y consistente con el resto de la librería.
|
|
1069
|
+
*
|
|
1070
|
+
* @example
|
|
1071
|
+
* ```tsx
|
|
1072
|
+
* // Uso básico
|
|
1073
|
+
* <Breadcrumbs>
|
|
1074
|
+
* <BreadcrumbItem href="/">Inicio</BreadcrumbItem>
|
|
1075
|
+
* <BreadcrumbItem href="/products">Productos</BreadcrumbItem>
|
|
1076
|
+
* <BreadcrumbItem>Detalle</BreadcrumbItem>
|
|
1077
|
+
* </Breadcrumbs>
|
|
1078
|
+
*
|
|
1079
|
+
* // Con items como prop
|
|
1080
|
+
* <Breadcrumbs
|
|
1081
|
+
* items={[
|
|
1082
|
+
* { label: "Inicio", href: "/" },
|
|
1083
|
+
* { label: "Productos", href: "/products" },
|
|
1084
|
+
* { label: "Detalle", isCurrent: true }
|
|
1085
|
+
* ]}
|
|
1086
|
+
* />
|
|
1087
|
+
* ```
|
|
2217
1088
|
*/
|
|
2218
|
-
|
|
1089
|
+
var BreadcrumbsComponent = function (_a) {
|
|
1090
|
+
var items = _a.items, children = _a.children, heroUIProps = __rest(_a, ["items", "children"]);
|
|
1091
|
+
return (jsx(Breadcrumbs, __assign({}, heroUIProps, { children: items
|
|
1092
|
+
? items.map(function (item, index) { return (jsx(BreadcrumbItem, { href: item.href, isCurrent: item.isCurrent, children: item.label }, "".concat(item.href || item.label, "-").concat(index))); })
|
|
1093
|
+
: children })));
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
var ConfigMenu = function (_a) {
|
|
1097
|
+
var _b;
|
|
1098
|
+
var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
|
|
1099
|
+
return (jsxs(Dropdown, { className: "min-w-40", children: [jsx(DropdownTrigger, { children: jsx(Button$1, { isIconOnly: true, color: "default", startContent: jsx(IconComponent, { icon: "solar:settings-linear" }) }) }), jsxs(DropdownMenu, { "aria-label": "Configuration", children: [jsx(DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsx(DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
|
|
1100
|
+
base: "text-default-500",
|
|
1101
|
+
}, startContent: item.icon ? jsx(IconComponent, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsx(DropdownSection, { children: jsx(DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
|
|
1102
|
+
base: "text-default-500",
|
|
1103
|
+
}, startContent: jsx(IconComponent, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
|
|
1104
|
+
};
|
|
1105
|
+
ConfigMenu.displayName = "ConfigMenu";
|
|
1106
|
+
|
|
1107
|
+
var NotificationButton = function (_a) {
|
|
1108
|
+
var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
|
|
1109
|
+
return (jsx(Button$1, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsx(IconComponent, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsx("span", { className: "notification__alert", children: notificationCount })) }));
|
|
1110
|
+
};
|
|
1111
|
+
NotificationButton.displayName = "NotificationButton";
|
|
2219
1112
|
|
|
2220
|
-
|
|
1113
|
+
var HeaderComponent = function (_a) {
|
|
1114
|
+
var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations, breadcrumbs = _a.breadcrumbs;
|
|
1115
|
+
return (jsx("header", { className: "header__container", children: jsxs("div", { className: "flex items-center justify-between w-full", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsx(Button$1, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), breadcrumbs && breadcrumbs.length > 0 && (jsx(BreadcrumbsComponent, { items: breadcrumbs }))] }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(NotificationButton, { notificationCount: notificationCount }), jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }) }));
|
|
1116
|
+
};
|
|
1117
|
+
HeaderComponent.displayName = "Header";
|
|
2221
1118
|
|
|
2222
|
-
var defaultTranslations$
|
|
1119
|
+
var defaultTranslations$8 = {
|
|
2223
1120
|
previewAlt: "Vista previa de imagen",
|
|
2224
1121
|
removeButtonAriaLabel: "Eliminar imagen",
|
|
2225
1122
|
emptyStateText: "No hay imágenes para mostrar",
|
|
@@ -2247,12 +1144,12 @@ var normalizeImages = function (images) {
|
|
|
2247
1144
|
if (typeof img === "string") {
|
|
2248
1145
|
return { src: img, id: "img-".concat(index) };
|
|
2249
1146
|
}
|
|
2250
|
-
return __assign
|
|
1147
|
+
return __assign(__assign({}, img), { id: img.id || "img-".concat(index) });
|
|
2251
1148
|
});
|
|
2252
1149
|
};
|
|
2253
1150
|
var ImagePreview = function (_a) {
|
|
2254
1151
|
var images = _a.images, _b = _a.size, size = _b === void 0 ? "small" : _b, onRemove = _a.onRemove, _c = _a.showRemoveButton, showRemoveButton = _c === void 0 ? true : _c, _d = _a.className, className = _d === void 0 ? "" : _d, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.backgroundColor, backgroundColor = _f === void 0 ? "bg-white dark:bg-gray-800" : _f, _g = _a.radius, radius = _g === void 0 ? "lg" : _g, _h = _a.showBorder, showBorder = _h === void 0 ? true : _h, onImageClick = _a.onImageClick;
|
|
2255
|
-
var t = __assign
|
|
1152
|
+
var t = __assign(__assign({}, defaultTranslations$8), translations);
|
|
2256
1153
|
var normalizedImages = normalizeImages(images);
|
|
2257
1154
|
var sizeClass = sizeClasses[size];
|
|
2258
1155
|
var radiusClass = radiusClasses[radius];
|
|
@@ -2291,7 +1188,7 @@ function normalizeClass(value) {
|
|
|
2291
1188
|
}
|
|
2292
1189
|
var getSectionClasses = function (isCollapsed, sectionClassesProp) {
|
|
2293
1190
|
if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
|
|
2294
|
-
return (__assign
|
|
1191
|
+
return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
|
|
2295
1192
|
var k = _a[0], v = _a[1];
|
|
2296
1193
|
return [k, normalizeClass(v)];
|
|
2297
1194
|
}))), { base: normalizeClass(cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
|
|
@@ -2304,7 +1201,7 @@ var getSectionClasses = function (isCollapsed, sectionClassesProp) {
|
|
|
2304
1201
|
};
|
|
2305
1202
|
var getItemClasses = function (isCollapsed, itemClassesProp) {
|
|
2306
1203
|
if (itemClassesProp === void 0) { itemClassesProp = {}; }
|
|
2307
|
-
return (__assign
|
|
1204
|
+
return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
|
|
2308
1205
|
var k = _a[0], v = _a[1];
|
|
2309
1206
|
return [k, normalizeClass(v)];
|
|
2310
1207
|
}))), { base: normalizeClass(cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
|
|
@@ -2337,7 +1234,7 @@ var EnumMenuNavListItem;
|
|
|
2337
1234
|
* @forwardRef
|
|
2338
1235
|
*/
|
|
2339
1236
|
var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
2340
|
-
var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest
|
|
1237
|
+
var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
|
|
2341
1238
|
var _d = useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
|
|
2342
1239
|
// Component styles
|
|
2343
1240
|
var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
|
|
@@ -2355,7 +1252,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2355
1252
|
// Renders the item displayed inside the Popover when the menu is collapsed.
|
|
2356
1253
|
var renderCompactItem = React.useCallback(function (item, parentKey) {
|
|
2357
1254
|
var _a, _b;
|
|
2358
|
-
return (createElement(ListboxItem, __assign
|
|
1255
|
+
return (createElement(ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
|
|
2359
1256
|
}, [handleItemPress, iconClassName]);
|
|
2360
1257
|
// Renders a nested item, i.e., an item that has sub-items.
|
|
2361
1258
|
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
@@ -2367,7 +1264,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2367
1264
|
if (isNestType) {
|
|
2368
1265
|
item.href = undefined;
|
|
2369
1266
|
}
|
|
2370
|
-
return (createElement(ListboxItem, __assign
|
|
1267
|
+
return (createElement(ListboxItem, __assign({}, item, { key: item.key, classNames: {
|
|
2371
1268
|
base: cn({
|
|
2372
1269
|
"h-auto p-0": !isCollapsed && isNestType,
|
|
2373
1270
|
}, {
|
|
@@ -2377,10 +1274,10 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2377
1274
|
}, "rounded-large"),
|
|
2378
1275
|
}, endContent: isCollapsed || isNestType || hideEndContent
|
|
2379
1276
|
? null
|
|
2380
|
-
: ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsx(IconComponent
|
|
1277
|
+
: ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
|
|
2381
1278
|
isCollapsed && isNestType ? (jsxs(Popover, { placement: "right", offset: 10, children: [jsx(PopoverTrigger, { children: jsx("div", { className: "flex w-full items-center justify-center", children: jsx(Tooltip$1, { content: item.title, placement: "right", classNames: {
|
|
2382
1279
|
base: "text-default-500",
|
|
2383
|
-
}, children: jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsx(IconComponent
|
|
1280
|
+
}, children: jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsx(PopoverContent, { className: "p-0", children: jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsx(Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
|
|
2384
1281
|
? item.items.map(function (child) {
|
|
2385
1282
|
return renderCompactItem(child, item.key);
|
|
2386
1283
|
})
|
|
@@ -2389,7 +1286,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2389
1286
|
heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
|
|
2390
1287
|
trigger: "p-0",
|
|
2391
1288
|
content: "py-0 pl-4",
|
|
2392
|
-
}, title: item.icon ? (jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsx(IconComponent
|
|
1289
|
+
}, title: item.icon ? (jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsx(IconComponent, { className: cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsx(Listbox, { className: "mt-0.5 text-default-500", classNames: {
|
|
2393
1290
|
list: cn("border-l border-default-200 pl-4"),
|
|
2394
1291
|
}, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
|
|
2395
1292
|
}, [isCollapsed, hideEndContent, iconClassName, items, selected]);
|
|
@@ -2404,13 +1301,13 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
2404
1301
|
return renderNestItem(item);
|
|
2405
1302
|
}
|
|
2406
1303
|
var isItemSelected = selected === item.key;
|
|
2407
|
-
return (createElement(ListboxItem, __assign
|
|
1304
|
+
return (createElement(ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsx(Tooltip$1, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
|
|
2408
1305
|
base: "text-default-500",
|
|
2409
|
-
}, children: jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsx(IconComponent
|
|
1306
|
+
}, children: jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsx(IconComponent, { className: cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
|
|
2410
1307
|
},
|
|
2411
1308
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2412
1309
|
[isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
|
|
2413
|
-
return (jsx(Listbox, __assign
|
|
1310
|
+
return (jsx(Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
|
|
2414
1311
|
var _a, _b;
|
|
2415
1312
|
return item.items &&
|
|
2416
1313
|
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
@@ -2452,13 +1349,13 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
2452
1349
|
}
|
|
2453
1350
|
return (jsxs(Fragment, { children: [jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsx("div", { className: "container__menu ".concat(isCollapsed
|
|
2454
1351
|
? "container__menu--collapsed"
|
|
2455
|
-
: "container__menu--expanded"), children: jsxs("div", { className: "content__menu", children: [jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxs("div", { className: "flex items-center", children: [jsx(IconComponent
|
|
1352
|
+
: "container__menu--expanded"), children: jsxs("div", { className: "content__menu", children: [jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxs("div", { className: "flex items-center", children: [jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsx(IconComponent, { icon: isCollapsed
|
|
2456
1353
|
? "solar:alt-arrow-right-outline"
|
|
2457
|
-
: "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsx(Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxs("div", { className: "collapsible-item flex flex-col", children: [jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxs("div", { className: "collapsible-item relative", children: [jsxs(Card$1, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxs(CardBody, { className: "items-center py-5 text-center gap-1", children: [jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsx(CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsx(Button$
|
|
1354
|
+
: "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsx(Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxs("div", { className: "collapsible-item flex flex-col", children: [jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxs("div", { className: "collapsible-item relative", children: [jsxs(Card$1, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxs(CardBody, { className: "items-center py-5 text-center gap-1", children: [jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsx(CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsx(Button$1, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsx(Spacer, { y: 9 })] })), jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsx(Button$1, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
|
|
2458
1355
|
});
|
|
2459
1356
|
|
|
2460
1357
|
var StepIndicator = function (_a) {
|
|
2461
|
-
var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.showStepText, showStepText = _c === void 0 ? true : _c, stepTextFormatter = _a.stepTextFormatter, className = _a.className, props = __rest
|
|
1358
|
+
var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.showStepText, showStepText = _c === void 0 ? true : _c, stepTextFormatter = _a.stepTextFormatter, className = _a.className, props = __rest(_a, ["currentStep", "totalSteps", "color", "showStepText", "stepTextFormatter", "className"]);
|
|
2462
1359
|
var progressPercentage = Math.min((currentStep / totalSteps) * 100, 100);
|
|
2463
1360
|
var colorClasses = {
|
|
2464
1361
|
primary: "bg-primary",
|
|
@@ -2473,7 +1370,7 @@ var StepIndicator = function (_a) {
|
|
|
2473
1370
|
var stepText = stepTextFormatter
|
|
2474
1371
|
? stepTextFormatter(currentStep, totalSteps)
|
|
2475
1372
|
: defaultStepText(currentStep, totalSteps);
|
|
2476
|
-
return (jsxs("div", __assign
|
|
1373
|
+
return (jsxs("div", __assign({ className: cn("w-full", className) }, props, { children: [showStepText && (jsx("div", { className: "text-center text-sm font-medium text-default-400 mb-3", children: stepText })), jsx("div", { className: "w-full bg-content2 rounded-full h-2 overflow-hidden", children: jsx("div", { className: cn("h-full transition-all duration-300 ease-out rounded-full", colorClasses[color]), style: { width: "".concat(progressPercentage, "%") } }) })] })));
|
|
2477
1374
|
};
|
|
2478
1375
|
|
|
2479
1376
|
/*
|
|
@@ -2540,13 +1437,13 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
|
|
|
2540
1437
|
];
|
|
2541
1438
|
}
|
|
2542
1439
|
|
|
2543
|
-
var defaultTranslations$
|
|
1440
|
+
var defaultTranslations$7 = {
|
|
2544
1441
|
checkIconTitle: "Check",
|
|
2545
1442
|
};
|
|
2546
1443
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
2547
|
-
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
|
|
1444
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
2548
1445
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
2549
|
-
var t = __assign
|
|
1446
|
+
var t = __assign(__assign({}, defaultTranslations$7), translations);
|
|
2550
1447
|
var steps = React.useMemo(function () {
|
|
2551
1448
|
if (typeof stepsProp === "number") {
|
|
2552
1449
|
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
@@ -2611,7 +1508,7 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2611
1508
|
var isDisabled = status === "inactive";
|
|
2612
1509
|
return (
|
|
2613
1510
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
2614
|
-
jsxs("li", { className: "relative", children: [jsx("div", { className: "flex w-full max-w-full items-center", children: jsxs("button", __assign
|
|
1511
|
+
jsxs("li", { className: "relative", children: [jsx("div", { className: "flex w-full max-w-full items-center", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName, {
|
|
2615
1512
|
"cursor-not-allowed": isDisabled,
|
|
2616
1513
|
}), onClick: function () { return setCurrentStep(stepIdx); }, disabled: isDisabled }, props, { children: [jsx("div", { className: "flex h-full items-center", children: jsx(LazyMotion, { features: domAnimation, children: jsx("div", { className: "relative", children: jsx(m.div, { animate: status, className: cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
|
|
2617
1514
|
"shadow-lg": status === "complete",
|
|
@@ -2630,7 +1527,7 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
2630
1527
|
backgroundColor: "var(--complete-background-color)",
|
|
2631
1528
|
borderColor: "var(--complete-border-color)",
|
|
2632
1529
|
},
|
|
2633
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent
|
|
1530
|
+
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsx("div", { className: "flex-1 text-left", children: jsxs("div", { children: [jsx("div", { className: cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2634
1531
|
"text-default-300": status === "inactive",
|
|
2635
1532
|
}), children: step.title }), jsx("div", { className: cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
2636
1533
|
"text-default-300": status === "inactive",
|
|
@@ -2650,13 +1547,13 @@ var stepperClasses = cn(
|
|
|
2650
1547
|
// dark
|
|
2651
1548
|
"dark:[--step-color:rgba(255,255,255,0.1)]", "dark:[--active-color:hsl(var(--heroui-foreground-600))]", "dark:[--active-border-color:rgba(255,255,255,0.5)]", "dark:[--inactive-border-color:rgba(255,255,255,0.1)]", "dark:[--inactive-bar-color:rgba(255,255,255,0.1)]", "dark:[--inactive-color:rgba(255,255,255,0.2)]");
|
|
2652
1549
|
var MultiStepSidebar = React.forwardRef(function (_a, ref) {
|
|
2653
|
-
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, props = __rest
|
|
1550
|
+
var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; _a.onNext; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose"]);
|
|
2654
1551
|
var handleOverlayClick = function (e) {
|
|
2655
1552
|
if (e.target === e.currentTarget) {
|
|
2656
1553
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
2657
1554
|
}
|
|
2658
1555
|
};
|
|
2659
|
-
return (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxs("div", __assign
|
|
1556
|
+
return (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxs("div", __assign({ ref: ref, className: cn("flex h-full w-full max-w-4xl rounded-lg bg-background shadow-lg lg:h-auto", className) }, props, { children: [jsx("div", { className: "hidden w-1/3 flex-col items-center justify-center gap-y-8 p-8 md:flex", children: jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxs("div", { className: "relative flex h-auto justify-between w-full flex-col items-center gap-4 md:p-4 lg:w-2/3", children: [jsx(Button, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsx(IconComponent, { className: "text-foreground", icon: "material-symbols:close-rounded", size: "lg" }) }), jsx("div", { className: "pt-9 w-10/12 md:hidden", children: jsx("div", { className: "flex w-full justify-center", children: jsx(StepIndicator, { className: cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsx("div", { className: " flex flex-col h-full w-full justify-between p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
|
|
2660
1557
|
});
|
|
2661
1558
|
MultiStepSidebar.displayName = "MultiStepSidebar";
|
|
2662
1559
|
|
|
@@ -2664,9 +1561,9 @@ var MultistepNavigationButtons = function (_a) {
|
|
|
2664
1561
|
var nextButtonProps = _a.nextButtonProps, cancelButtonProps = _a.cancelButtonProps, className = _a.className;
|
|
2665
1562
|
// const { children: backButtonChildren, ...restBackButtonProps } =
|
|
2666
1563
|
// backButtonProps || {};
|
|
2667
|
-
var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest
|
|
2668
|
-
var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest
|
|
2669
|
-
return (jsx("div", { className: cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsx(Button$
|
|
1564
|
+
var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
|
|
1565
|
+
var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
|
|
1566
|
+
return (jsx("div", { className: cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
|
|
2670
1567
|
};
|
|
2671
1568
|
|
|
2672
1569
|
var MultiStepWizard = function (_a) {
|
|
@@ -2677,7 +1574,7 @@ var MultiStepWizard = function (_a) {
|
|
|
2677
1574
|
setPage(0);
|
|
2678
1575
|
}
|
|
2679
1576
|
}, [isOpen]);
|
|
2680
|
-
var t = __assign
|
|
1577
|
+
var t = __assign({
|
|
2681
1578
|
continue: "Continue",
|
|
2682
1579
|
goBack: "Back",
|
|
2683
1580
|
cancel: "Cancel",
|
|
@@ -2734,7 +1631,7 @@ var MultiStepWizard = function (_a) {
|
|
|
2734
1631
|
if (!isOpen) {
|
|
2735
1632
|
return null;
|
|
2736
1633
|
}
|
|
2737
|
-
return (jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxs("div", { children: [jsx(Button
|
|
1634
|
+
return (jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxs("div", { children: [jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsx(MultistepNavigationButtons, { backButtonProps: {
|
|
2738
1635
|
isDisabled: page === 0,
|
|
2739
1636
|
onPress: onBack,
|
|
2740
1637
|
children: t.goBack,
|
|
@@ -2749,8 +1646,8 @@ var MultiStepWizard = function (_a) {
|
|
|
2749
1646
|
};
|
|
2750
1647
|
|
|
2751
1648
|
var Pagination = function (_a) {
|
|
2752
|
-
_a.size; var props = __rest
|
|
2753
|
-
return jsx(Pagination$1, __assign
|
|
1649
|
+
_a.size; var props = __rest(_a, ["size"]);
|
|
1650
|
+
return jsx(Pagination$1, __assign({ showControls: true, isCompact: true }, props));
|
|
2754
1651
|
};
|
|
2755
1652
|
|
|
2756
1653
|
var Andorra = function () {
|
|
@@ -3185,7 +2082,7 @@ var countries = [
|
|
|
3185
2082
|
];
|
|
3186
2083
|
var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
|
|
3187
2084
|
// Traducciones por defecto
|
|
3188
|
-
var defaultTranslations$
|
|
2085
|
+
var defaultTranslations$6 = {
|
|
3189
2086
|
label: "Teléfono",
|
|
3190
2087
|
placeholder: "Número de teléfono",
|
|
3191
2088
|
searchPlaceholder: "Buscar país...",
|
|
@@ -3203,7 +2100,7 @@ var Phone = function (_a) {
|
|
|
3203
2100
|
var portalDropdownRef = useRef(null);
|
|
3204
2101
|
var _l = useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
3205
2102
|
var _m = useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
3206
|
-
var t = __assign
|
|
2103
|
+
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
3207
2104
|
var finalLabel = label || t.label;
|
|
3208
2105
|
useEffect(function () {
|
|
3209
2106
|
if (value) {
|
|
@@ -3282,7 +2179,7 @@ var Phone = function (_a) {
|
|
|
3282
2179
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3", children: jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
3283
2180
|
};
|
|
3284
2181
|
|
|
3285
|
-
var defaultTranslations$
|
|
2182
|
+
var defaultTranslations$5 = {
|
|
3286
2183
|
message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
|
|
3287
2184
|
buttonText: "Explore",
|
|
3288
2185
|
closeButtonLabel: "Close Banner",
|
|
@@ -3292,7 +2189,7 @@ var defaultTranslations$4 = {
|
|
|
3292
2189
|
*/
|
|
3293
2190
|
var PromotionalBanner = function (_a) {
|
|
3294
2191
|
var message = _a.message, buttonText = _a.buttonText, _b = _a.messageHref, messageHref = _b === void 0 ? "#" : _b, _c = _a.buttonHref, buttonHref = _c === void 0 ? "#" : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, _e = _a.isVisible, isVisible = _e === void 0 ? true : _e, _f = _a.gradientColors, gradientColors = _f === void 0 ? ["default-100", "danger-100", "secondary-100"] : _f, _g = _a.buttonGradientColors, buttonGradientColors = _g === void 0 ? ["#F871A0", "#9353D3"] : _g, onClose = _a.onClose, onMessageClick = _a.onMessageClick, onButtonClick = _a.onButtonClick, _h = _a.messageLinkProps, messageLinkProps = _h === void 0 ? {} : _h, _j = _a.buttonProps, buttonProps = _j === void 0 ? {} : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
|
|
3295
|
-
var t = __assign
|
|
2192
|
+
var t = __assign(__assign({}, defaultTranslations$5), translations);
|
|
3296
2193
|
var finalMessage = message || t.message;
|
|
3297
2194
|
var finalButtonText = buttonText || t.buttonText;
|
|
3298
2195
|
var handleClose = function () {
|
|
@@ -3309,16 +2206,16 @@ var PromotionalBanner = function (_a) {
|
|
|
3309
2206
|
}
|
|
3310
2207
|
var fromColor = gradientColors[0], viaColor = gradientColors[1], toColor = gradientColors[2];
|
|
3311
2208
|
var buttonGradient1 = buttonGradientColors[0], buttonGradient2 = buttonGradientColors[1];
|
|
3312
|
-
return (jsxs("div", { className: "border-divider flex w-full items-center gap-x-3 border-b-1 bg-gradient-to-r from-".concat(fromColor, " via-").concat(viaColor, " to-").concat(toColor, " px-6 py-2 sm:px-3.5 sm:before:flex-1"), children: [jsx("p", { className: "text-small text-foreground", children: jsxs(Link, __assign
|
|
2209
|
+
return (jsxs("div", { className: "border-divider flex w-full items-center gap-x-3 border-b-1 bg-gradient-to-r from-".concat(fromColor, " via-").concat(viaColor, " to-").concat(toColor, " px-6 py-2 sm:px-3.5 sm:before:flex-1"), children: [jsx("p", { className: "text-small text-foreground", children: jsxs(Link, __assign({ className: "text-inherit", href: messageHref, onClick: handleMessageClick }, messageLinkProps, { children: [finalMessage, "\u00A0"] })) }), jsx(Button$1, __assign({ as: Link, className: "group text-small relative h-9 overflow-hidden bg-transparent font-normal", color: "default", endContent: jsx(IconComponent, { className: "flex-none transition-transform outline-hidden group-data-[hover=true]:translate-x-0.5 [&>path]:stroke-2", icon: "solar:arrow-right-linear", size: "sm" }), href: buttonHref, style: {
|
|
3313
2210
|
border: "solid 2px transparent",
|
|
3314
2211
|
backgroundImage: "linear-gradient(hsl(var(--heroui-danger-50)), hsl(var(--heroui-danger-50))), linear-gradient(to right, ".concat(buttonGradient1, ", ").concat(buttonGradient2, ")"),
|
|
3315
2212
|
backgroundOrigin: "border-box",
|
|
3316
2213
|
backgroundClip: "padding-box, border-box",
|
|
3317
|
-
}, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsx("div", { className: "flex flex-1 justify-end", children: jsx(Button$
|
|
2214
|
+
}, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsx("div", { className: "flex flex-1 justify-end", children: jsx(Button$1, { isIconOnly: true, "aria-label": t.closeButtonLabel, className: "-m-1", size: "lg", variant: "bordered", onClick: handleClose, children: jsx(IconComponent, { "aria-hidden": "true", className: "text-default-500", icon: "lucide:x", size: "md" }) }) }))] }));
|
|
3318
2215
|
};
|
|
3319
2216
|
|
|
3320
2217
|
var RowSteps = React.forwardRef(function (_a, ref) {
|
|
3321
|
-
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; _a.translations; var props = __rest
|
|
2218
|
+
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; _a.translations; var props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
3322
2219
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
3323
2220
|
var steps = React.useMemo(function () {
|
|
3324
2221
|
if (typeof stepsProp === "number") {
|
|
@@ -3381,7 +2278,7 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
3381
2278
|
: currentStep < stepIdx
|
|
3382
2279
|
? "inactive"
|
|
3383
2280
|
: "complete";
|
|
3384
|
-
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign
|
|
2281
|
+
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsx("div", { className: "h-ful relative flex items-center", children: jsx(LazyMotion, { features: domAnimation, children: jsx(m.div, { animate: status, className: "relative", children: jsx(m.div, { className: cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
|
|
3385
2282
|
"shadow-lg": status === "complete",
|
|
3386
2283
|
}), initial: false, transition: { duration: 0.25 }, variants: {
|
|
3387
2284
|
inactive: {
|
|
@@ -3398,7 +2295,7 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
3398
2295
|
backgroundColor: "var(--complete-background-color)",
|
|
3399
2296
|
borderColor: "var(--complete-border-color)",
|
|
3400
2297
|
},
|
|
3401
|
-
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent
|
|
2298
|
+
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsx("div", { className: "max-w-full flex-1 text-start", children: jsx("div", { className: cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
|
|
3402
2299
|
"text-default-300": status === "inactive",
|
|
3403
2300
|
}), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
|
|
3404
2301
|
// @ts-ignore
|
|
@@ -3571,20 +2468,20 @@ class $35ea8db9cb2ccb90$export$680ea196effce5f {
|
|
|
3571
2468
|
}
|
|
3572
2469
|
|
|
3573
2470
|
var Switch = function (_a) {
|
|
3574
|
-
var id = _a.id, props = __rest
|
|
2471
|
+
var id = _a.id, props = __rest(_a, ["id"]);
|
|
3575
2472
|
var generatedId = useId();
|
|
3576
2473
|
var autoId = id || generatedId;
|
|
3577
|
-
return jsx(Switch$1, __assign
|
|
2474
|
+
return jsx(Switch$1, __assign({}, props, { id: autoId }));
|
|
3578
2475
|
};
|
|
3579
2476
|
|
|
3580
2477
|
/**
|
|
3581
2478
|
* TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
3582
2479
|
*/
|
|
3583
2480
|
var TimeInput = function (_a) {
|
|
3584
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest
|
|
2481
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest(_a, ["label", "id", "size", "radius", "variant"]);
|
|
3585
2482
|
var generatedId = useId();
|
|
3586
2483
|
var autoId = id || generatedId;
|
|
3587
|
-
return (jsx(TimeInput$1, __assign
|
|
2484
|
+
return (jsx(TimeInput$1, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
|
|
3588
2485
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
3589
2486
|
inputWrapper: "focus-within:!border-primary-500",
|
|
3590
2487
|
} })));
|
|
@@ -3621,7 +2518,7 @@ var TimeInput = function (_a) {
|
|
|
3621
2518
|
* />
|
|
3622
2519
|
* ```
|
|
3623
2520
|
*/
|
|
3624
|
-
var defaultTranslations$
|
|
2521
|
+
var defaultTranslations$4 = {
|
|
3625
2522
|
/** Label for the start time input field */
|
|
3626
2523
|
from: "Desde",
|
|
3627
2524
|
/** Label for the end time input field */
|
|
@@ -3679,7 +2576,7 @@ var defaultTranslations$3 = {
|
|
|
3679
2576
|
*/
|
|
3680
2577
|
var ScheduleRow = function (_a) {
|
|
3681
2578
|
var day = _a.day, daySchedule = _a.daySchedule, _b = _a.translations, translations = _b === void 0 ? {} : _b, _c = _a.showCopyToAll, showCopyToAll = _c === void 0 ? false : _c, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
|
|
3682
|
-
var t = __assign
|
|
2579
|
+
var t = __assign(__assign({}, defaultTranslations$4), translations);
|
|
3683
2580
|
/**
|
|
3684
2581
|
* @function validateTimeSlots
|
|
3685
2582
|
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
@@ -3689,13 +2586,13 @@ var ScheduleRow = function (_a) {
|
|
|
3689
2586
|
var validateTimeSlots = function (timeSlots) {
|
|
3690
2587
|
return timeSlots.map(function (slot) {
|
|
3691
2588
|
if (slot.from && slot.to) {
|
|
3692
|
-
var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray
|
|
3693
|
-
var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray
|
|
2589
|
+
var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
|
|
2590
|
+
var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
|
|
3694
2591
|
if (fromTime.compare(toTime) > 0) {
|
|
3695
|
-
return __assign
|
|
2592
|
+
return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
|
|
3696
2593
|
}
|
|
3697
2594
|
}
|
|
3698
|
-
return __assign
|
|
2595
|
+
return __assign(__assign({}, slot), { error: null });
|
|
3699
2596
|
});
|
|
3700
2597
|
};
|
|
3701
2598
|
/**
|
|
@@ -3729,7 +2626,7 @@ var ScheduleRow = function (_a) {
|
|
|
3729
2626
|
* @description Toggles the `isOpen` status of the schedule for the day.
|
|
3730
2627
|
*/
|
|
3731
2628
|
var handleToggleDay = function () {
|
|
3732
|
-
onChange(__assign
|
|
2629
|
+
onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
|
|
3733
2630
|
};
|
|
3734
2631
|
/**
|
|
3735
2632
|
* @function handleTimeChange
|
|
@@ -3740,11 +2637,11 @@ var ScheduleRow = function (_a) {
|
|
|
3740
2637
|
*/
|
|
3741
2638
|
var handleTimeChange = function (index, field, value) {
|
|
3742
2639
|
var _a;
|
|
3743
|
-
var newTimeSlots = __spreadArray
|
|
2640
|
+
var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
|
|
3744
2641
|
// Update the specific field
|
|
3745
|
-
newTimeSlots[index] = __assign
|
|
2642
|
+
newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
|
|
3746
2643
|
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
3747
|
-
onChange(__assign
|
|
2644
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
3748
2645
|
};
|
|
3749
2646
|
/**
|
|
3750
2647
|
* @function handleAddTimeSlot
|
|
@@ -3753,9 +2650,9 @@ var ScheduleRow = function (_a) {
|
|
|
3753
2650
|
*/
|
|
3754
2651
|
var handleAddTimeSlot = function () {
|
|
3755
2652
|
// Add a new empty slot
|
|
3756
|
-
var newTimeSlots = __spreadArray
|
|
2653
|
+
var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
|
|
3757
2654
|
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
3758
|
-
onChange(__assign
|
|
2655
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
3759
2656
|
};
|
|
3760
2657
|
/**
|
|
3761
2658
|
* @function handleRemoveTimeSlot
|
|
@@ -3769,7 +2666,7 @@ var ScheduleRow = function (_a) {
|
|
|
3769
2666
|
if (newTimeSlots.length === 0) {
|
|
3770
2667
|
newTimeSlots = [{ from: "", to: "" }];
|
|
3771
2668
|
}
|
|
3772
|
-
onChange(__assign
|
|
2669
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
3773
2670
|
};
|
|
3774
2671
|
/**
|
|
3775
2672
|
* @function getSlotsToDisplay
|
|
@@ -3786,12 +2683,12 @@ var ScheduleRow = function (_a) {
|
|
|
3786
2683
|
// Return slots exactly as they are - no automatic additions
|
|
3787
2684
|
return slots;
|
|
3788
2685
|
};
|
|
3789
|
-
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 }), showCopyToAll && onCopyToAll && (jsx(Button
|
|
2686
|
+
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 }), showCopyToAll && onCopyToAll && (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) {
|
|
3790
2687
|
var slotsToDisplay = getSlotsToDisplay();
|
|
3791
2688
|
var isLastSlot = index === slotsToDisplay.length - 1;
|
|
3792
2689
|
var isSlotFilled = slot.from && slot.to;
|
|
3793
2690
|
var canDelete = slotsToDisplay.length > 1;
|
|
3794
|
-
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
|
|
2691
|
+
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)));
|
|
3795
2692
|
}) }))] }, day));
|
|
3796
2693
|
};
|
|
3797
2694
|
|
|
@@ -3805,11 +2702,11 @@ var ScheduleRow = function (_a) {
|
|
|
3805
2702
|
* - Follows BeweOS design guidelines
|
|
3806
2703
|
*/
|
|
3807
2704
|
var SearchInput = function (_a) {
|
|
3808
|
-
var _b = _a.searchPlaceholder, searchPlaceholder = _b === void 0 ? "Buscar..." : _b, _c = _a.searchIcon, searchIcon = _c === void 0 ? "solar:magnifer-outline" : _c, iconProps = _a.iconProps, onSearchChange = _a.onSearchChange, searchValue = _a.searchValue, value = _a.value, onValueChange = _a.onValueChange, placeholder = _a.placeholder, _d = _a.size, size = _d === void 0 ? "sm" : _d, _e = _a.className, className = _e === void 0 ? "flex-1 max-w-xs min-w-52" : _e, props = __rest
|
|
2705
|
+
var _b = _a.searchPlaceholder, searchPlaceholder = _b === void 0 ? "Buscar..." : _b, _c = _a.searchIcon, searchIcon = _c === void 0 ? "solar:magnifer-outline" : _c, iconProps = _a.iconProps, onSearchChange = _a.onSearchChange, searchValue = _a.searchValue, value = _a.value, onValueChange = _a.onValueChange, placeholder = _a.placeholder, _d = _a.size, size = _d === void 0 ? "sm" : _d, _e = _a.className, className = _e === void 0 ? "flex-1 max-w-xs min-w-52" : _e, props = __rest(_a, ["searchPlaceholder", "searchIcon", "iconProps", "onSearchChange", "searchValue", "value", "onValueChange", "placeholder", "size", "className"]);
|
|
3809
2706
|
// Use searchValue/onSearchChange if provided, otherwise fall back to value/onValueChange
|
|
3810
2707
|
var inputValue = searchValue !== null && searchValue !== void 0 ? searchValue : value;
|
|
3811
2708
|
var handleValueChange = onSearchChange !== null && onSearchChange !== void 0 ? onSearchChange : onValueChange;
|
|
3812
|
-
return (jsx(Input, __assign
|
|
2709
|
+
return (jsx(Input, __assign({}, props, { className: className, size: size, placeholder: placeholder || searchPlaceholder, value: inputValue, onValueChange: handleValueChange, endContent: jsx(IconComponent, __assign({ icon: searchIcon, className: "text-default-400", size: "sm" }, iconProps)) })));
|
|
3813
2710
|
};
|
|
3814
2711
|
|
|
3815
2712
|
/**
|
|
@@ -3822,29 +2719,104 @@ var SearchInput = function (_a) {
|
|
|
3822
2719
|
* - Size: sm, md, lg (configurable)
|
|
3823
2720
|
*/
|
|
3824
2721
|
var Select = function (_a) {
|
|
3825
|
-
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest
|
|
2722
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
|
|
3826
2723
|
var generatedId = useId();
|
|
3827
2724
|
var selectId = id || generatedId;
|
|
3828
|
-
return (jsx("div", { className: "group", children: jsx(Select$1, __assign
|
|
2725
|
+
return (jsx("div", { className: "group", children: jsx(Select$1, __assign({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
3829
2726
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
3830
2727
|
trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
|
|
3831
2728
|
popoverContent: "[&_[data-focus-visible=true]]:!outline-none [&_[data-selectable=true]:focus]:!bg-primary-50 [&_li]:!text-default-500 [&_li[data-hover=true]]:!text-default-600",
|
|
3832
2729
|
} })) }));
|
|
3833
2730
|
};
|
|
3834
2731
|
|
|
2732
|
+
var defaultTranslations$3 = {
|
|
2733
|
+
username: "tu_negocio",
|
|
2734
|
+
sendMessage: "Enviar mensaje",
|
|
2735
|
+
viewMore: "ver más",
|
|
2736
|
+
viewLess: "ver menos",
|
|
2737
|
+
timeAgo: "hace unos momentos",
|
|
2738
|
+
imageAlt: "Vista previa de red social",
|
|
2739
|
+
};
|
|
2740
|
+
/**
|
|
2741
|
+
* SocialMediaPreview component for displaying social media post previews
|
|
2742
|
+
* across multiple platforms: Instagram, Facebook, TikTok, and Twitter.
|
|
2743
|
+
*
|
|
2744
|
+
* @component
|
|
2745
|
+
* @example
|
|
2746
|
+
* ```tsx
|
|
2747
|
+
* <SocialMediaPreview
|
|
2748
|
+
* platform="instagram"
|
|
2749
|
+
* imageUrl="/path/to/image.jpg"
|
|
2750
|
+
* caption="Check out our new product!"
|
|
2751
|
+
* variant="full"
|
|
2752
|
+
* />
|
|
2753
|
+
* ```
|
|
2754
|
+
*/
|
|
2755
|
+
var SocialMediaPreview = function (_a) {
|
|
2756
|
+
var platform = _a.platform, imageUrl = _a.imageUrl, caption = _a.caption, _b = _a.variant, variant = _b === void 0 ? "full" : _b, _c = _a.showHeader, showHeader = _c === void 0 ? true : _c, _d = _a.maxCaptionLength, maxCaptionLength = _d === void 0 ? 125 : _d, onToggleCaption = _a.onToggleCaption, showFullCaption = _a.showFullCaption, username = _a.username, avatarUrl = _a.avatarUrl, _e = _a.translations, translations = _e === void 0 ? {} : _e, _f = _a.className, className = _f === void 0 ? "" : _f, _g = _a.imageProps, imageProps = _g === void 0 ? {} : _g;
|
|
2757
|
+
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
2758
|
+
var displayUsername = username || t.username;
|
|
2759
|
+
var shouldTruncate = variant === "compact" && caption.length > maxCaptionLength;
|
|
2760
|
+
var getTruncatedCaption = function () {
|
|
2761
|
+
if (variant !== "compact") {
|
|
2762
|
+
return caption;
|
|
2763
|
+
}
|
|
2764
|
+
if (!shouldTruncate || showFullCaption) {
|
|
2765
|
+
return caption;
|
|
2766
|
+
}
|
|
2767
|
+
var firstLineEnd = caption.indexOf("\n");
|
|
2768
|
+
var truncateAt = firstLineEnd > 0 && firstLineEnd < maxCaptionLength
|
|
2769
|
+
? firstLineEnd
|
|
2770
|
+
: maxCaptionLength;
|
|
2771
|
+
return "".concat(caption.substring(0, truncateAt).trim(), "...");
|
|
2772
|
+
};
|
|
2773
|
+
var displayCaption = getTruncatedCaption();
|
|
2774
|
+
// Render Instagram Preview
|
|
2775
|
+
var renderInstagram = function () {
|
|
2776
|
+
if (variant === "story") {
|
|
2777
|
+
return renderInstagramStory();
|
|
2778
|
+
}
|
|
2779
|
+
return renderInstagramPost();
|
|
2780
|
+
};
|
|
2781
|
+
var renderInstagramStory = function () { return (jsxs("div", { className: "relative w-full bg-gradient-to-b from-gray-900 to-gray-800 rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxs("div", { className: "absolute inset-0", children: [jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsx("div", { className: "absolute inset-0 bg-black bg-opacity-20" })] })), showHeader && (jsxs("div", { className: "absolute top-0 left-0 right-0 z-10 p-4", children: [jsx("div", { className: "w-full h-0.5 bg-white bg-opacity-30 rounded-full mb-3", children: jsx("div", { className: "h-full w-1/3 bg-white rounded-full" }) }), jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center border-2 border-white", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("span", { className: "text-sm font-semibold text-white drop-shadow-lg", children: displayUsername }), jsx("span", { className: "text-xs text-white text-opacity-90", children: "hace 5min" })] }), jsxs("div", { className: "flex items-center gap-3", children: [jsx(IconComponent, { icon: "solar:play-circle-bold", className: "text-lg text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:volume-loud-bold", className: "text-lg text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-white drop-shadow-lg" })] })] })] })), jsxs("div", { className: "absolute bottom-6 left-0 right-0 z-20 px-4 flex items-center gap-3", children: [jsx("input", { type: "text", placeholder: t.sendMessage, className: "flex-1 bg-transparent border-2 border-white border-opacity-70 rounded-full px-4 py-2 text-white placeholder-white placeholder-opacity-70 text-sm", readOnly: true }), jsx(IconComponent, { icon: "solar:heart-outline", className: "text-2xl text-white drop-shadow-lg" }), jsx(IconComponent, { icon: "solar:plain-outline", className: "text-2xl text-white drop-shadow-lg" })] })] })); };
|
|
2782
|
+
var renderInstagramPost = function () { return (jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-b-xl overflow-hidden", " h-full ").concat(className), children: [showHeader && (jsxs("div", { className: "flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-800", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-500 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername })] }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-lg text-gray-900 dark:text-white" })] })), imageUrl && (jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800 overflow-hidden rounded-none ".concat(variant === "full" ? "h-80" : ""), style: variant === "compact" ? { aspectRatio: "1/1" } : {}, children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover rounded-none", radius: "none" }, imageProps)) })), jsxs("div", { className: "flex-1 p-3 overflow-y-auto", children: [jsxs("div", { className: "flex items-center justify-between mb-2", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-xl text-gray-900 dark:text-white" }), jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl text-gray-900 dark:text-white" }), jsx(IconComponent, { icon: "solar:plain-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-xl text-gray-900 dark:text-white" })] }), jsxs("div", { className: "text-sm text-left", children: [jsxs("div", { className: showFullCaption ? "overflow-y-auto" : "", style: { maxHeight: showFullCaption ? "150px" : "none" }, children: [jsx("span", { className: "font-semibold mr-2 text-gray-900 dark:text-white", children: displayUsername }), jsx("span", { className: "text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words", children: displayCaption })] }), shouldTruncate && onToggleCaption && variant !== "compact" && (jsx("button", { type: "button", onClick: function (e) {
|
|
2783
|
+
e.stopPropagation();
|
|
2784
|
+
onToggleCaption();
|
|
2785
|
+
}, className: "text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-300 font-normal mt-1 underline text-xs block", children: showFullCaption ? t.viewLess : t.viewMore }))] }), variant !== "compact" && (jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1 text-left", children: t.timeAgo }))] })] })); };
|
|
2786
|
+
// Render Facebook Preview
|
|
2787
|
+
var renderFacebook = function () { return (jsxs("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-lg shadow-xl overflow-hidden" : "rounded-xl overflow-hidden", " ").concat(className), children: [showHeader && (jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: jsxs("div", { className: "flex items-center gap-3", children: [jsx("div", { className: "w-10 h-10 rounded-full bg-blue-600 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxs("div", { className: "flex-1", children: [jsx("p", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: displayUsername }), jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400 flex items-center gap-1", children: [t.timeAgo, " \u00B7 ", jsx(IconComponent, { icon: "solar:earth-bold", className: "text-xs" })] })] }), jsx(IconComponent, { icon: "solar:menu-dots-bold", className: "text-xl text-gray-600 dark:text-gray-400" })] }) })), jsx("div", { className: "px-4 py-2", children: jsx("p", { className: "text-sm text-gray-900 dark:text-white whitespace-pre-wrap break-words", children: displayCaption }) }), imageUrl && (jsx("div", { className: "relative w-full bg-gray-50 dark:bg-gray-800", children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsx("div", { className: "p-3 border-t border-gray-200 dark:border-gray-800", children: jsxs("div", { className: "flex items-center justify-around", children: [jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:like-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Me gusta" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Comentar" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 px-4 py-2 rounded-lg transition-colors", children: [jsx(IconComponent, { icon: "solar:share-bold", className: "text-xl" }), jsx("span", { className: "text-sm font-medium", children: "Compartir" })] })] }) })] })); };
|
|
2788
|
+
// Render TikTok Preview
|
|
2789
|
+
var renderTikTok = function () { return (jsxs("div", { className: "relative w-full bg-black rounded-2xl shadow-2xl overflow-hidden ".concat(className), style: { aspectRatio: "9/16", maxHeight: "640px" }, children: [imageUrl && (jsxs("div", { className: "absolute inset-0", children: [jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-full object-cover" }, imageProps)), jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black opacity-60" })] })), jsxs("div", { className: "absolute right-2 bottom-20 flex flex-col items-center gap-6 z-20", children: [jsxs("div", { className: "flex flex-col items-center", children: [jsx("div", { className: "w-12 h-12 rounded-full border-2 border-white bg-gray-900 flex items-center justify-center", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-xs font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsx("div", { className: "w-6 h-6 rounded-full bg-pink-500 flex items-center justify-center -mt-3 border-2 border-black", children: jsx(IconComponent, { icon: "solar:add-circle-bold", className: "text-xs text-white" }) })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "24.5K" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "1,234" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:bookmark-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "453" })] }), jsxs("div", { className: "flex flex-col items-center gap-2", children: [jsx(IconComponent, { icon: "solar:share-bold", className: "text-3xl text-white drop-shadow-lg" }), jsx("span", { className: "text-xs text-white font-semibold", children: "892" })] }), jsx("div", { className: "w-10 h-10 rounded-lg bg-gray-800 border border-gray-700 flex items-center justify-center", children: jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-xl text-white" }) })] }), jsxs("div", { className: "absolute bottom-0 left-0 right-14 z-20 p-4", children: [jsxs("p", { className: "text-sm font-semibold text-white mb-1", children: ["@", displayUsername] }), jsx("p", { className: "text-sm text-white mb-2 line-clamp-2", children: displayCaption }), jsxs("div", { className: "flex items-center gap-2 text-xs text-white", children: [jsx(IconComponent, { icon: "solar:music-note-2-bold", className: "text-sm" }), jsxs("span", { className: "truncate", children: ["Sonido original - ", displayUsername] })] })] })] })); };
|
|
2790
|
+
// Render Twitter Preview
|
|
2791
|
+
var renderTwitter = function () { return (jsx("div", { className: "flex flex-col bg-white dark:bg-gray-900 ".concat(variant === "full" ? "rounded-xl border border-gray-200 dark:border-gray-800" : "rounded-xl border border-gray-200 dark:border-gray-800", " ").concat(className), children: jsx("div", { className: "p-4", children: jsxs("div", { className: "flex gap-3", children: [jsx("div", { className: "w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center flex-shrink-0", children: avatarUrl ? (jsx("img", { src: avatarUrl, alt: displayUsername, className: "w-full h-full rounded-full object-cover" })) : (jsx("span", { className: "text-white text-sm font-bold", children: displayUsername.substring(0, 2).toUpperCase() })) }), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-1 mb-1", children: [jsx("span", { className: "font-bold text-gray-900 dark:text-white text-sm truncate", children: displayUsername }), jsx(IconComponent, { icon: "solar:verified-check-bold", className: "text-blue-500 text-base flex-shrink-0" }), jsxs("span", { className: "text-gray-500 dark:text-gray-400 text-sm truncate", children: ["@", displayUsername.toLowerCase().replace(/\s/g, "_")] }), jsx("span", { className: "text-gray-500 dark:text-gray-400 text-sm", children: "\u00B7 2h" })] }), jsx("p", { className: "text-gray-900 dark:text-white text-sm mb-3 whitespace-pre-wrap break-words", children: displayCaption }), imageUrl && (jsx("div", { className: "rounded-2xl overflow-hidden border border-gray-200 dark:border-gray-700 mb-3", children: jsx(Image$1, __assign({ src: imageUrl, alt: t.imageAlt, className: "w-full h-auto object-cover", radius: "none" }, imageProps)) })), jsxs("div", { className: "flex items-center justify-between max-w-md mt-3", children: [jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:chat-round-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "234" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-green-500 dark:hover:text-green-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:repost-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "1.2K" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-pink-500 dark:hover:text-pink-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:heart-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "5.6K" })] }), jsxs("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: [jsx(IconComponent, { icon: "solar:chart-2-bold", className: "text-lg" }), jsx("span", { className: "text-xs", children: "12K" })] }), jsx("button", { type: "button", className: "flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-blue-500 dark:hover:text-blue-400 transition-colors", children: jsx(IconComponent, { icon: "solar:share-bold", className: "text-lg" }) })] })] })] }) }) })); };
|
|
2792
|
+
// Main render logic
|
|
2793
|
+
switch (platform) {
|
|
2794
|
+
case "instagram":
|
|
2795
|
+
return renderInstagram();
|
|
2796
|
+
case "facebook":
|
|
2797
|
+
return renderFacebook();
|
|
2798
|
+
case "tiktok":
|
|
2799
|
+
return renderTikTok();
|
|
2800
|
+
case "twitter":
|
|
2801
|
+
return renderTwitter();
|
|
2802
|
+
default:
|
|
2803
|
+
return renderInstagram();
|
|
2804
|
+
}
|
|
2805
|
+
};
|
|
2806
|
+
|
|
3835
2807
|
function AuraTable(_a) {
|
|
3836
|
-
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest
|
|
3837
|
-
return (jsxs(Table, __assign
|
|
2808
|
+
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
2809
|
+
return (jsxs(Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsx(TableHeader, { columns: columns, children: function (column) { return jsx(TableColumn, { children: column.label }, column.key); } }), jsx(TableBody, { items: items, children: function (item) { return (jsx(TableRow, { children: function (columnKey) { return (jsx(TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
|
|
3838
2810
|
}
|
|
3839
2811
|
|
|
3840
2812
|
/**
|
|
3841
2813
|
* Textarea component that wraps the HeroUI TextArea component.
|
|
3842
2814
|
*/
|
|
3843
2815
|
var Textarea = function (_a) {
|
|
3844
|
-
var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest
|
|
2816
|
+
var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
|
|
3845
2817
|
var generatedId = useId();
|
|
3846
2818
|
var autoId = id || generatedId;
|
|
3847
|
-
return (jsx(Textarea$1, __assign
|
|
2819
|
+
return (jsx(Textarea$1, __assign({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
|
|
3848
2820
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
3849
2821
|
inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
|
|
3850
2822
|
} })));
|
|
@@ -3867,7 +2839,7 @@ var defaultTranslations$2 = {
|
|
|
3867
2839
|
var ThemePicker = function (_a) {
|
|
3868
2840
|
var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
|
|
3869
2841
|
// Combinar traducciones por defecto con las proporcionadas
|
|
3870
|
-
var t = __assign
|
|
2842
|
+
var t = __assign(__assign({}, defaultTranslations$2), translations);
|
|
3871
2843
|
var themes = [
|
|
3872
2844
|
{
|
|
3873
2845
|
key: "light",
|
|
@@ -4202,7 +3174,7 @@ var ImageCropModal = function (_a) {
|
|
|
4202
3174
|
backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
|
|
4203
3175
|
backgroundSize: "8px 8px",
|
|
4204
3176
|
backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
|
|
4205
|
-
} }), jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxs(ModalFooter$1, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsx(Button$
|
|
3177
|
+
} }), jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxs(ModalFooter$1, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsx(Button$1, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsx(Button$1, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
|
|
4206
3178
|
};
|
|
4207
3179
|
/**
|
|
4208
3180
|
* Componente de previsualización de archivo
|
|
@@ -4220,7 +3192,7 @@ var FilePreview = function (_a) {
|
|
|
4220
3192
|
if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
|
|
4221
3193
|
return null;
|
|
4222
3194
|
}
|
|
4223
|
-
return (jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsx(Button$
|
|
3195
|
+
return (jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsx(Button$1, { isIconOnly: true, size: "sm", color: "danger", variant: "solid", className: "absolute top-2 right-2 sm:top-3 sm:right-3 z-20 bg-red-100 hover:bg-red-200 text-red-600 min-w-8 h-8 sm:min-w-10 sm:h-10", onPress: onRemove, "aria-label": removeAriaLabel, children: jsx(IconComponent, { icon: "heroicons:trash", size: "sm" }) })] }));
|
|
4224
3196
|
};
|
|
4225
3197
|
/**
|
|
4226
3198
|
* Componente UploadDocument basado en Hero UI con funcionalidad mejorada
|
|
@@ -4259,7 +3231,7 @@ var UploadFile = function (_a) {
|
|
|
4259
3231
|
var _q = useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
|
|
4260
3232
|
var _r = useState(null); _r[0]; var setOriginalFile = _r[1];
|
|
4261
3233
|
// Combinar traducciones por defecto con las proporcionadas
|
|
4262
|
-
var t = useMemo(function () { return (__assign
|
|
3234
|
+
var t = useMemo(function () { return (__assign(__assign({}, defaultTranslations$1), translations)); }, [translations]);
|
|
4263
3235
|
// Actualizar texto si se pasa como prop (retrocompatibilidad)
|
|
4264
3236
|
var finalText = text || t.uploadText;
|
|
4265
3237
|
var finalSubText = subText || t.subText;
|
|
@@ -4431,7 +3403,7 @@ var UploadFile = function (_a) {
|
|
|
4431
3403
|
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");
|
|
4432
3404
|
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
|
|
4433
3405
|
? "opacity-0"
|
|
4434
|
-
: "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
|
|
3406
|
+
: "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"
|
|
4435
3407
|
: size === "small" ? "text-xl sm:text-2xl"
|
|
4436
3408
|
: "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"
|
|
4437
3409
|
: size === "small" ? "px-1"
|
|
@@ -4486,7 +3458,7 @@ function WizardSidebar(_a) {
|
|
|
4486
3458
|
? "bg-primary-600 text-white shadow-lg scale-110 border-2 border-primary-600"
|
|
4487
3459
|
: isCompleted
|
|
4488
3460
|
? "border-2 border-primary-600 dark:border-primary-400 text-primary-600 dark:text-primary-400 bg-transparent"
|
|
4489
|
-
: "border-2 border-primary-300 dark:border-primary-700 text-primary-400 dark:text-primary-500 bg-transparent"), children: step.icon ? (jsx(IconComponent
|
|
3461
|
+
: "border-2 border-primary-300 dark:border-primary-700 text-primary-400 dark:text-primary-500 bg-transparent"), children: step.icon ? (jsx(IconComponent, { icon: step.icon, className: "text-base" })) : isCompleted ? (jsx(IconComponent, { icon: "solar:check-circle-bold", className: "text-base" })) : (step.number) }), jsx("div", { className: "flex-1 min-w-0", children: jsx("p", { className: "text-xs font-medium transition-colors leading-tight ".concat(isActive
|
|
4490
3462
|
? "text-primary-600 dark:text-primary-400"
|
|
4491
3463
|
: isCompleted
|
|
4492
3464
|
? "text-primary-600 dark:text-primary-400"
|
|
@@ -4516,8 +3488,8 @@ function WizardNavigation(_a) {
|
|
|
4516
3488
|
onNext();
|
|
4517
3489
|
}
|
|
4518
3490
|
};
|
|
4519
|
-
return (jsxs("div", { className: "flex justify-between items-center ".concat(className), children: [showBack && !isFirstStep ? (jsx(Button$
|
|
4520
|
-
), jsx(Button$
|
|
3491
|
+
return (jsxs("div", { className: "flex justify-between items-center ".concat(className), children: [showBack && !isFirstStep ? (jsx(Button$1, { variant: "light", size: "md", onPress: onBack, isDisabled: isBackDisabled || isLoading, startContent: jsx(IconComponent, { icon: "solar:alt-arrow-left-bold", className: "text-base" }), children: effectiveBackText })) : (jsx("div", {}) // Spacer para mantener el botón "Siguiente" a la derecha
|
|
3492
|
+
), jsx(Button$1, { color: "primary", variant: "solid", size: "md", onPress: handleNext, isDisabled: isNextDisabled || isLoading, isLoading: isLoading, endContent: isLastStep ? (jsx(IconComponent, { icon: "solar:check-circle-bold", className: "text-base" })) : (jsx(IconComponent, { icon: "solar:alt-arrow-right-bold", className: "text-base" })), children: isLastStep ? effectiveFinishText : effectiveNextText })] }));
|
|
4521
3493
|
}
|
|
4522
3494
|
|
|
4523
3495
|
/**
|
|
@@ -4571,7 +3543,7 @@ function Wizard(_a) {
|
|
|
4571
3543
|
var steps = _a.steps, currentStep = _a.currentStep, onStepChange = _a.onStepChange, renderStep = _a.renderStep, _b = _a.navigationConfig, navigationConfig = _b === void 0 ? {} : _b, _c = _a.validations, validations = _c === void 0 ? [] : _c, onComplete = _a.onComplete, onBeforeStepChange = _a.onBeforeStepChange, onAfterStepChange = _a.onAfterStepChange, _d = _a.showSidebar, showSidebar = _d === void 0 ? true : _d, _e = _a.sidebarPosition, sidebarPosition = _e === void 0 ? "left" : _e, _f = _a.minHeight, minHeight = _f === void 0 ? "600px" : _f, _g = _a.className, className = _g === void 0 ? "" : _g, _h = _a.isLoading, isLoading = _h === void 0 ? false : _h, loadingText = _a.loadingText, _j = _a.isDisabled, isDisabled = _j === void 0 ? false : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
|
|
4572
3544
|
var _l = useState(false), isTransitioning = _l[0], setIsTransitioning = _l[1];
|
|
4573
3545
|
// Merge default translations with provided ones
|
|
4574
|
-
var t = useMemo(function () { return (__assign
|
|
3546
|
+
var t = useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
|
|
4575
3547
|
// Use loadingText prop for backward compatibility, but prefer translations
|
|
4576
3548
|
var effectiveLoadingText = loadingText !== null && loadingText !== void 0 ? loadingText : t.loadingText;
|
|
4577
3549
|
// Configuración de navegación con valores por defecto
|
|
@@ -4809,7 +3781,7 @@ var NavigationLoadingOverlay = function (_a) {
|
|
|
4809
3781
|
var DrawerFiltersFooter = function (_a) {
|
|
4810
3782
|
var onClearFilters = _a.onClearFilters, onCancel = _a.onCancel, onApplyFilters = _a.onApplyFilters, _b = _a.translations, translations = _b === void 0 ? {} : _b;
|
|
4811
3783
|
var _c = translations.clearFilters, clearFilters = _c === void 0 ? "Limpiar filtro" : _c, _d = translations.cancel, cancel = _d === void 0 ? "Cancelar" : _d, _e = translations.applyFilters, applyFilters = _e === void 0 ? "Aplicar filtro" : _e;
|
|
4812
|
-
return (jsxs("div", { className: "flex items-center justify-between px-6 py-10 bg-content1", children: [jsx(Button
|
|
3784
|
+
return (jsxs("div", { className: "flex items-center justify-between px-6 py-10 bg-content1", children: [jsx(Button, { variant: "light", color: "primary", onPress: onClearFilters, className: "text-primary", children: clearFilters }), jsxs("div", { className: "flex items-center gap-3", children: [jsx(Button, { variant: "bordered", color: "primary", onPress: onCancel, children: cancel }), jsx(Button, { variant: "solid", color: "primary", onPress: onApplyFilters, children: applyFilters })] })] }));
|
|
4813
3785
|
};
|
|
4814
3786
|
|
|
4815
3787
|
/**
|
|
@@ -4844,7 +3816,7 @@ var RangeFilter = function (_a) {
|
|
|
4844
3816
|
tooltipProducts: "productos",
|
|
4845
3817
|
tooltipProduct: "producto",
|
|
4846
3818
|
};
|
|
4847
|
-
var t = __assign
|
|
3819
|
+
var t = __assign(__assign({}, defaultTranslations), translations);
|
|
4848
3820
|
// Function to check if a bar is in the selected range
|
|
4849
3821
|
var isBarInRange = function (barStart, barEnd) {
|
|
4850
3822
|
return barStart >= currentValue[0] && barEnd <= currentValue[1];
|
|
@@ -4886,7 +3858,7 @@ var RangeFilter = function (_a) {
|
|
|
4886
3858
|
alignSelf: "flex-end",
|
|
4887
3859
|
opacity: inRange ? 1 : 0.4,
|
|
4888
3860
|
}, title: "".concat(bar.priceRange, ": ").concat(bar.count, " ").concat(bar.count !== 1 ? t.tooltipProducts : t.tooltipProduct), children: jsx("div", { className: "absolute bottom-full left-1/2 transform -translate-x-1/2 mb-1 px-2 py-1 bg-default-900 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10", children: jsxs("div", { className: "text-center", children: [jsx("div", { className: "font-medium", children: formatValue(bar.midPrice) }), jsxs("div", { className: "text-xs opacity-75", children: [bar.count, " ", bar.count !== 1 ? t.tooltipProducts : t.tooltipProduct] })] }) }) }, "".concat(bar.binStart, "-").concat(bar.binEnd)));
|
|
4889
|
-
}) }) }), jsx("div", { className: "px-2", children: jsx(Slider, __assign
|
|
3861
|
+
}) }) }), jsx("div", { className: "px-2", children: jsx(Slider, __assign({ step: step, minValue: minValue, maxValue: maxValue, defaultValue: [minValue, maxValue], value: currentValue, onChange: function (newValue) {
|
|
4890
3862
|
var _a = newValue, min = _a[0], max = _a[1];
|
|
4891
3863
|
setCurrentValue([min, max]);
|
|
4892
3864
|
onChange([min, max]);
|
|
@@ -5000,7 +3972,7 @@ var FilterSection = function (_a) {
|
|
|
5000
3972
|
"--tw-shadow-colored": "var(--heroui-box-shadow-medium)",
|
|
5001
3973
|
}, children: [jsxs("button", { type: "button", className: "flex items-center justify-between w-full text-left p-4", onClick: handleToggleExpanded, children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx(H2, { className: "text-base font-normal text-foreground", children: filter.title }), hasActiveFilter() && (jsx("span", { className: "text-xs px-2 py-1 rounded-full text-black dark:text-white", style: {
|
|
5002
3974
|
backgroundColor: "hsl(var(--heroui-default) / var(--heroui-default-opacity, var(--tw-bg-opacity)))",
|
|
5003
|
-
}, children: getActiveFilterCount() }))] }), jsx(IconComponent
|
|
3975
|
+
}, children: getActiveFilterCount() }))] }), jsx(IconComponent, { icon: internalExpanded
|
|
5004
3976
|
? "solar:alt-arrow-down-outline"
|
|
5005
3977
|
: "solar:alt-arrow-right-outline", size: "sm", className: "text-default-500" })] }), internalExpanded && (jsxs("div", { className: "px-4 pb-4", onClick: function (e) { return e.stopPropagation(); }, children: [filter.description && (jsx(P, { className: "text-default-500 mb-4", children: filter.description })), renderFilterContent()] }))] }));
|
|
5006
3978
|
};
|
|
@@ -5050,7 +4022,7 @@ var DateFilter = function (_a) {
|
|
|
5050
4022
|
_a.filter; var value = _a.value, onChange = _a.onChange;
|
|
5051
4023
|
var handleDateSelectorChange = function (dateSelectorValue) {
|
|
5052
4024
|
onChange({
|
|
5053
|
-
type: dateSelectorValue.type === HolidayType
|
|
4025
|
+
type: dateSelectorValue.type === HolidayType.SingleDay
|
|
5054
4026
|
? "singleDay"
|
|
5055
4027
|
: "dateRange",
|
|
5056
4028
|
date: dateSelectorValue.date ? dateSelectorValue.date.toString() : null,
|
|
@@ -5069,9 +4041,9 @@ var DateFilter = function (_a) {
|
|
|
5069
4041
|
// Convert our internal format to DateSelector format
|
|
5070
4042
|
var getInitialType = function () {
|
|
5071
4043
|
if ((value === null || value === void 0 ? void 0 : value.type) === "dateRange") {
|
|
5072
|
-
return HolidayType
|
|
4044
|
+
return HolidayType.DateRange;
|
|
5073
4045
|
}
|
|
5074
|
-
return HolidayType
|
|
4046
|
+
return HolidayType.SingleDay;
|
|
5075
4047
|
};
|
|
5076
4048
|
// For now, we'll let DateSelector handle its own state
|
|
5077
4049
|
// The component will reset when the filter value changes
|
|
@@ -5123,7 +4095,7 @@ var DrawerFilters = function (_a) {
|
|
|
5123
4095
|
var handleFilterChange = useCallback(function (filterKey, value) {
|
|
5124
4096
|
setFilterValues(function (prev) {
|
|
5125
4097
|
var _a;
|
|
5126
|
-
return (__assign
|
|
4098
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[filterKey] = value, _a)));
|
|
5127
4099
|
});
|
|
5128
4100
|
}, []);
|
|
5129
4101
|
// Clear all filters
|
|
@@ -5213,7 +4185,7 @@ var DrawerFilters = function (_a) {
|
|
|
5213
4185
|
DrawerFilters.displayName = "DrawerFilters";
|
|
5214
4186
|
|
|
5215
4187
|
var Modal = function (props) {
|
|
5216
|
-
return (jsx(Modal$1, __assign
|
|
4188
|
+
return (jsx(Modal$1, __assign({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
|
|
5217
4189
|
};
|
|
5218
4190
|
|
|
5219
4191
|
var ModalContent = ModalContent$1;
|
|
@@ -5240,16 +4212,16 @@ var paddingClasses = {
|
|
|
5240
4212
|
* - Hereda de HeroUI Card con personalización BeweOS
|
|
5241
4213
|
*/
|
|
5242
4214
|
var Card = function (_a) {
|
|
5243
|
-
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.shadow, shadow = _c === void 0 ? "sm" : _c, _d = _a.radius, radius = _d === void 0 ? "sm" : _d, _e = _a.padding, padding = _e === void 0 ? "md" : _e, props = __rest
|
|
4215
|
+
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.shadow, shadow = _c === void 0 ? "sm" : _c, _d = _a.radius, radius = _d === void 0 ? "sm" : _d, _e = _a.padding, padding = _e === void 0 ? "md" : _e, props = __rest(_a, ["children", "className", "shadow", "radius", "padding"]);
|
|
5244
4216
|
var paddingClass = paddingClasses[padding];
|
|
5245
4217
|
var combinedClassName = [paddingClass, className].filter(Boolean).join(" ");
|
|
5246
|
-
return (jsx(Card$1, __assign
|
|
4218
|
+
return (jsx(Card$1, __assign({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
5247
4219
|
};
|
|
5248
4220
|
|
|
5249
4221
|
/**
|
|
5250
4222
|
* @file This file contains the theme configurations for the application.
|
|
5251
4223
|
*/
|
|
5252
|
-
var ALL_THEMES = __spreadArray
|
|
4224
|
+
var ALL_THEMES = __spreadArray(["light", "dark"], Object.keys(themeColors), true);
|
|
5253
4225
|
|
|
5254
4226
|
/**
|
|
5255
4227
|
* Custom hook to manage the theme state and side effects.
|
|
@@ -5333,13 +4305,13 @@ var AuraToastProvider = function (_a) {
|
|
|
5333
4305
|
clearTimeout(timerRef.current);
|
|
5334
4306
|
timerRef.current = null;
|
|
5335
4307
|
}
|
|
5336
|
-
setToast(function (currentToast) { return (__assign
|
|
4308
|
+
setToast(function (currentToast) { return (__assign(__assign({}, currentToast), { isVisible: false })); });
|
|
5337
4309
|
}, []);
|
|
5338
4310
|
var showToast = useCallback(function (options) {
|
|
5339
4311
|
if (timerRef.current) {
|
|
5340
4312
|
clearTimeout(timerRef.current);
|
|
5341
4313
|
}
|
|
5342
|
-
setToast(__assign
|
|
4314
|
+
setToast(__assign({ isVisible: true }, options));
|
|
5343
4315
|
var duration = options.duration === undefined ? 3000 : options.duration;
|
|
5344
4316
|
if (duration > 0) {
|
|
5345
4317
|
timerRef.current = setTimeout(function () {
|
|
@@ -5383,4 +4355,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
5383
4355
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
5384
4356
|
};
|
|
5385
4357
|
|
|
5386
|
-
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button
|
|
4358
|
+
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, Wizard, WizardNavigation, WizardSidebar, defaultTranslations$4 as defaultTranslations, sizeMap, themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|