@beweco/aurora-ui 0.1.21 → 0.1.22
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 +1470 -305
- package/dist/index.esm.js +1475 -311
- package/dist/types/components/image-preview/ImagePreview.d.ts +25 -0
- package/dist/types/components/image-preview/ImagePreview.d.ts.map +1 -0
- package/dist/types/components/image-preview/ImagePreview.types.d.ts +48 -0
- package/dist/types/components/image-preview/ImagePreview.types.d.ts.map +1 -0
- package/dist/types/components/image-preview/index.d.ts +3 -0
- package/dist/types/components/image-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$2, 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, Avatar, CardBody, CardFooter, ListboxSection, Pagination as Pagination$1, Link, Switch as Switch$1, TimeInput as TimeInput$1, Select as Select$1, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Textarea as Textarea$1, Alert, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, Slider, ModalFooter as ModalFooter$1, Spinner, SelectItem, Drawer, DrawerContent, DrawerBody } from '@heroui/react';
|
|
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 = function() {
|
|
31
|
-
__assign = Object.assign || function __assign(t) {
|
|
30
|
+
var __assign$1 = function() {
|
|
31
|
+
__assign$1 = 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.apply(this, arguments);
|
|
38
|
+
return __assign$1.apply(this, arguments);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
function __rest(s, e) {
|
|
41
|
+
function __rest$1(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(to, from, pack) {
|
|
91
|
+
function __spreadArray$1(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$1;
|
|
107
107
|
(function (HolidayType) {
|
|
108
108
|
HolidayType["SingleDay"] = "singleDay";
|
|
109
109
|
HolidayType["DateRange"] = "dateRange";
|
|
110
|
-
})(HolidayType || (HolidayType = {}));
|
|
110
|
+
})(HolidayType$1 || (HolidayType$1 = {}));
|
|
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;
|
|
|
120
120
|
* - Radius: md (por defecto)
|
|
121
121
|
* - isIconOnly: True, False
|
|
122
122
|
*/
|
|
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$
|
|
123
|
+
var Button$1 = 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$1(_a, ["color", "size", "variant", "radius", "startContent", "endContent", "isLoading", "isIconOnly"]);
|
|
125
|
+
return (jsx(Button$2, __assign$1({}, 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(_a, ["label", "id", "size"]);
|
|
129
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest$1(_a, ["label", "id", "size"]);
|
|
130
130
|
var generatedId = useId();
|
|
131
131
|
var autoId = id || generatedId;
|
|
132
|
-
return (jsx(DatePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
132
|
+
return (jsx(DatePicker$1, __assign$1({ 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(_a, ["label", "id", "size"]);
|
|
139
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest$1(_a, ["label", "id", "size"]);
|
|
140
140
|
var generatedId = useId();
|
|
141
141
|
var autoId = id || generatedId;
|
|
142
|
-
return (jsx(DateRangePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
142
|
+
return (jsx(DateRangePicker$1, __assign$1({ 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$1 = {
|
|
149
149
|
sm: "16px",
|
|
150
150
|
md: "20px",
|
|
151
151
|
lg: "24px",
|
|
152
152
|
xl: "32px",
|
|
153
153
|
};
|
|
154
|
-
var IconComponent = function (_a) {
|
|
154
|
+
var IconComponent$1 = 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(_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 }) })));
|
|
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$1(_a, ["icon", "size", "className", "style", "color", "hFlip", "vFlip", "flip", "rotate"]);
|
|
157
|
+
var iconSize = (_b = sizeMap$1[size]) !== null && _b !== void 0 ? _b : sizeMap$1.md;
|
|
158
|
+
return (jsx("span", __assign$1({}, 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 = 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(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
|
|
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$1(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
|
|
172
172
|
var generatedId = useId();
|
|
173
173
|
var inputId = id || generatedId;
|
|
174
|
-
return (jsx(Input$1, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
174
|
+
return (jsx(Input$1, __assign$1({}, 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$a = {
|
|
182
182
|
addHolidayTitle: "Add holiday",
|
|
183
183
|
dayOption: "Day",
|
|
184
184
|
dateRangeOption: "Date range",
|
|
@@ -189,7 +189,7 @@ var defaultTranslations$9 = {
|
|
|
189
189
|
addButton: "Add",
|
|
190
190
|
};
|
|
191
191
|
var INITIAL_HOLIDAY_STATE = {
|
|
192
|
-
type: HolidayType.SingleDay,
|
|
192
|
+
type: HolidayType$1.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(__assign({}, defaultTranslations$
|
|
205
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$a), 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.SingleDay
|
|
212
|
+
var isDateSet = newHoliday.type === HolidayType$1.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(__assign({}, prev), { startDate: date, endDate: null })); });
|
|
226
|
+
setNewHoliday(function (prev) { return (__assign$1(__assign$1({}, 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(__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 }));
|
|
235
|
+
return (__assign$1(__assign$1({}, 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({ 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
|
|
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$1({ color: "primary", orientation: "horizontal", size: "sm", value: newHoliday.type, onValueChange: function (value) {
|
|
257
|
+
return setNewHoliday(__assign$1(__assign$1({}, INITIAL_HOLIDAY_STATE), { type: value }));
|
|
258
|
+
} }, radioGroupProps, { children: [jsx(Radio, { value: HolidayType$1.SingleDay, children: t.dayOption }), jsx(Radio, { value: HolidayType$1.DateRange, children: t.dateRangeOption })] })), newHoliday.type === HolidayType$1.DateRange ? (jsx(DateRangePicker, __assign$1({ 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, { 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 })) })] }));
|
|
260
|
+
: null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent$1, { 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$1, { 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$1(__assign$1({}, prev), { title: value })); });
|
|
262
|
+
}, "aria-label": t.optionalTitle }), jsx("div", { className: "w-full", children: jsx(Button$1, __assign$1({ size: "sm", fullWidth: true, variant: "flat", startContent: jsx(IconComponent$1, { 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(_a, ["children", "className"]);
|
|
267
|
-
return (jsx("h2", __assign({ className: cn("text-lg font-semibold", className) }, props, { children: children })));
|
|
266
|
+
var children = _a.children, className = _a.className, props = __rest$1(_a, ["children", "className"]);
|
|
267
|
+
return (jsx("h2", __assign$1({ 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(_a, ["children", "className"]);
|
|
272
|
-
return (jsx("p", __assign({ className: cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
271
|
+
var children = _a.children, className = _a.className, props = __rest$1(_a, ["children", "className"]);
|
|
272
|
+
return (jsx("p", __assign$1({ className: cn("text-tiny text-default-500 font-normal", className) }, props, { children: children })));
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
var defaultTranslations$
|
|
275
|
+
var defaultTranslations$9 = {
|
|
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(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
|
|
329
|
-
var t = __assign(__assign({}, defaultTranslations$
|
|
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$1(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
|
|
329
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$9), 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({ 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) {
|
|
356
|
+
return (jsx(Card$1, __assign$1({ 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, { 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));
|
|
368
|
+
: "default", radius: "md", size: "sm", startContent: changeType === "positive" ? (jsx(IconComponent$1, { icon: "solar:arrow-right-up-linear", size: "sm" })) : changeType === "negative" ? (jsx(IconComponent$1, { icon: "solar:arrow-right-down-linear", size: "sm" })) : (jsx(IconComponent$1, { 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$2, { isIconOnly: true, className: "absolute top-2 right-2 w-auto rounded-full", size: "lg", variant: "bordered", children: jsx(IconComponent$1, { 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(_a, ["label", "id", "size", "variant", "radius"]);
|
|
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$1(_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({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
|
|
414
|
+
return (jsxs("div", { children: [label && (jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsx(Autocomplete, __assign$1({}, 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$1 = {
|
|
437
437
|
"blue-light": {
|
|
438
438
|
extend: "light",
|
|
439
439
|
colors: {
|
|
@@ -923,198 +923,1362 @@ var themeColors = {
|
|
|
923
923
|
},
|
|
924
924
|
};
|
|
925
925
|
|
|
926
|
-
var ColorSelector = function (_a) {
|
|
927
|
-
var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
|
|
928
|
-
var mode = useThemeContext().mode;
|
|
929
|
-
/**
|
|
930
|
-
* Filters and maps the available theme colors to the current theme mode (light/dark).
|
|
931
|
-
* Each color option contains:
|
|
932
|
-
* - value: the theme name (e.g., "blue-light")
|
|
933
|
-
* - label: the base color name (e.g., "blue")
|
|
934
|
-
* - color: the primary color hex value
|
|
935
|
-
*/
|
|
936
|
-
var colorOptions = Object.entries(themeColors)
|
|
937
|
-
.filter(function (_a) {
|
|
938
|
-
var themeData = _a[1];
|
|
939
|
-
var themeMode = themeData.extend;
|
|
940
|
-
return mode === "light" ? themeMode === "light" : themeMode === "dark";
|
|
941
|
-
})
|
|
942
|
-
.map(function (_a) {
|
|
943
|
-
var themeName = _a[0], theme = _a[1];
|
|
944
|
-
return ({
|
|
945
|
-
value: themeName,
|
|
946
|
-
label: themeName.split("-")[0],
|
|
947
|
-
color: theme.colors.primary.DEFAULT,
|
|
948
|
-
});
|
|
949
|
-
});
|
|
950
|
-
return (jsx(RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
|
|
951
|
-
base: "flex flex-wrap !gap-2",
|
|
952
|
-
wrapper: "flex flex-wrap !gap-2",
|
|
953
|
-
}, children: colorOptions.map(function (color) { return (jsx(Radio, { value: color.label, className: "p-0 m-0", classNames: {
|
|
954
|
-
base: "p-0 m-0",
|
|
955
|
-
wrapper: "hidden",
|
|
956
|
-
labelWrapper: "p-0 m-0",
|
|
957
|
-
}, children: jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
|
|
958
|
-
? "border-black border-opacity-20 scale-110"
|
|
959
|
-
: "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
|
|
960
|
-
};
|
|
926
|
+
var ColorSelector = function (_a) {
|
|
927
|
+
var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
|
|
928
|
+
var mode = useThemeContext().mode;
|
|
929
|
+
/**
|
|
930
|
+
* Filters and maps the available theme colors to the current theme mode (light/dark).
|
|
931
|
+
* Each color option contains:
|
|
932
|
+
* - value: the theme name (e.g., "blue-light")
|
|
933
|
+
* - label: the base color name (e.g., "blue")
|
|
934
|
+
* - color: the primary color hex value
|
|
935
|
+
*/
|
|
936
|
+
var colorOptions = Object.entries(themeColors$1)
|
|
937
|
+
.filter(function (_a) {
|
|
938
|
+
var themeData = _a[1];
|
|
939
|
+
var themeMode = themeData.extend;
|
|
940
|
+
return mode === "light" ? themeMode === "light" : themeMode === "dark";
|
|
941
|
+
})
|
|
942
|
+
.map(function (_a) {
|
|
943
|
+
var themeName = _a[0], theme = _a[1];
|
|
944
|
+
return ({
|
|
945
|
+
value: themeName,
|
|
946
|
+
label: themeName.split("-")[0],
|
|
947
|
+
color: theme.colors.primary.DEFAULT,
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
return (jsx(RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
|
|
951
|
+
base: "flex flex-wrap !gap-2",
|
|
952
|
+
wrapper: "flex flex-wrap !gap-2",
|
|
953
|
+
}, children: colorOptions.map(function (color) { return (jsx(Radio, { value: color.label, className: "p-0 m-0", classNames: {
|
|
954
|
+
base: "p-0 m-0",
|
|
955
|
+
wrapper: "hidden",
|
|
956
|
+
labelWrapper: "p-0 m-0",
|
|
957
|
+
}, children: jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
|
|
958
|
+
? "border-black border-opacity-20 scale-110"
|
|
959
|
+
: "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Chip - Componente para mostrar etiquetas o badges
|
|
964
|
+
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
965
|
+
*/
|
|
966
|
+
var Chip = function (_a) {
|
|
967
|
+
var _b = _a.color, color = _b === void 0 ? "default" : _b, props = __rest$1(_a, ["color"]);
|
|
968
|
+
// Colores estándar de HeroUI
|
|
969
|
+
var standardColors = [
|
|
970
|
+
"default",
|
|
971
|
+
"primary",
|
|
972
|
+
"secondary",
|
|
973
|
+
"success",
|
|
974
|
+
"warning",
|
|
975
|
+
"danger",
|
|
976
|
+
];
|
|
977
|
+
// Si es un color estándar, usar HeroUI normalmente
|
|
978
|
+
if (standardColors.includes(color)) {
|
|
979
|
+
return (jsx(Chip$1, __assign$1({}, props, { color: color, onClose: props.onClose })));
|
|
980
|
+
}
|
|
981
|
+
// Si es un color personalizado, aplicar clases CSS específicas
|
|
982
|
+
var customColorClasses = {
|
|
983
|
+
red: "bg-red-100 text-red-500",
|
|
984
|
+
purple: "bg-purple-100 text-purple-500",
|
|
985
|
+
blue: "bg-blue-100 text-blue-500",
|
|
986
|
+
green: "bg-green-100 text-green-500",
|
|
987
|
+
orange: "bg-orange-100 text-orange-500",
|
|
988
|
+
};
|
|
989
|
+
var colorClasses = customColorClasses[color];
|
|
990
|
+
return (jsx(Chip$1, __assign$1({}, props, { onClose: props.onClose, classNames: __assign$1({ base: colorClasses }, props.classNames) })));
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
// Traducciones por defecto en español
|
|
994
|
+
var defaultTranslations$8 = {
|
|
995
|
+
dayOption: "Día específico",
|
|
996
|
+
dateRangeOption: "Rango de fechas",
|
|
997
|
+
selectDateAriaLabel: "Seleccionar fecha",
|
|
998
|
+
selectDateRangeAriaLabel: "Seleccionar rango de fechas",
|
|
999
|
+
};
|
|
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$1.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$1(__assign$1({}, defaultTranslations$8), translations);
|
|
1013
|
+
var handleTypeChange = function (value) {
|
|
1014
|
+
var newType = value;
|
|
1015
|
+
setType(newType);
|
|
1016
|
+
// Limpiar valores cuando cambia el tipo
|
|
1017
|
+
if (newType === HolidayType$1.SingleDay) {
|
|
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();
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
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$1, { className: stepperClasses$1, 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$1, { className: cn(stepperClasses$1), 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 })] })] })) }));
|
|
2087
|
+
});
|
|
2088
|
+
MultiStepSidebar$1.displayName = "MultiStepSidebar";
|
|
2089
|
+
|
|
2090
|
+
// Lista de países con código telefónico y código ISO
|
|
2091
|
+
var countries$1 = [
|
|
2092
|
+
{ code: "+57", name: "Colombia", country: "CO" },
|
|
2093
|
+
{ code: "+54", name: "Argentina", country: "AR" },
|
|
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());
|
|
2119
|
+
|
|
2120
|
+
var RowSteps$1 = React.forwardRef(function (_a, ref) {
|
|
2121
|
+
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"]);
|
|
2122
|
+
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715$1(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
2123
|
+
var steps = React.useMemo(function () {
|
|
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";
|
|
2212
|
+
|
|
2213
|
+
createContext(undefined);
|
|
961
2214
|
|
|
962
2215
|
/**
|
|
963
|
-
*
|
|
964
|
-
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
2216
|
+
* @file This file contains the theme configurations for the application.
|
|
965
2217
|
*/
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
var standardColors = [
|
|
970
|
-
"default",
|
|
971
|
-
"primary",
|
|
972
|
-
"secondary",
|
|
973
|
-
"success",
|
|
974
|
-
"warning",
|
|
975
|
-
"danger",
|
|
976
|
-
];
|
|
977
|
-
// Si es un color estándar, usar HeroUI normalmente
|
|
978
|
-
if (standardColors.includes(color)) {
|
|
979
|
-
return (jsx(Chip$1, __assign({}, props, { color: color, onClose: props.onClose })));
|
|
980
|
-
}
|
|
981
|
-
// Si es un color personalizado, aplicar clases CSS específicas
|
|
982
|
-
var customColorClasses = {
|
|
983
|
-
red: "bg-red-100 text-red-500",
|
|
984
|
-
purple: "bg-purple-100 text-purple-500",
|
|
985
|
-
blue: "bg-blue-100 text-blue-500",
|
|
986
|
-
green: "bg-green-100 text-green-500",
|
|
987
|
-
orange: "bg-orange-100 text-orange-500",
|
|
988
|
-
};
|
|
989
|
-
var colorClasses = customColorClasses[color];
|
|
990
|
-
return (jsx(Chip$1, __assign({}, props, { onClose: props.onClose, classNames: __assign({ base: colorClasses }, props.classNames) })));
|
|
991
|
-
};
|
|
2218
|
+
__spreadArray(["light", "dark"], Object.keys(themeColors));
|
|
2219
|
+
|
|
2220
|
+
createContext(undefined);
|
|
992
2221
|
|
|
993
|
-
// Traducciones por defecto en español
|
|
994
2222
|
var defaultTranslations$7 = {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
2223
|
+
previewAlt: "Vista previa de imagen",
|
|
2224
|
+
removeButtonAriaLabel: "Eliminar imagen",
|
|
2225
|
+
emptyStateText: "No hay imágenes para mostrar",
|
|
2226
|
+
clickableImageAriaLabel: "Hacer clic para ampliar imagen",
|
|
2227
|
+
};
|
|
2228
|
+
var sizeClasses = {
|
|
2229
|
+
micro: "w-12 h-12",
|
|
2230
|
+
small: "w-[100px] h-[100px]",
|
|
2231
|
+
medium: "w-[150px] h-[150px]",
|
|
2232
|
+
large: "w-[200px] h-[200px]",
|
|
2233
|
+
};
|
|
2234
|
+
var radiusClasses = {
|
|
2235
|
+
none: "rounded-none",
|
|
2236
|
+
sm: "rounded-sm",
|
|
2237
|
+
md: "rounded-md",
|
|
2238
|
+
lg: "rounded-lg",
|
|
2239
|
+
full: "rounded-full",
|
|
999
2240
|
};
|
|
1000
2241
|
/**
|
|
1001
|
-
*
|
|
1002
|
-
* basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
1003
|
-
* Maneja su propio estado interno de manera autónoma.
|
|
2242
|
+
* Normalizes input to array of ImagePreviewItem
|
|
1004
2243
|
*/
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
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$7), 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);
|
|
2244
|
+
var normalizeImages = function (images) {
|
|
2245
|
+
var imgArray = Array.isArray(images) ? images : [images];
|
|
2246
|
+
return imgArray.map(function (img, index) {
|
|
2247
|
+
if (typeof img === "string") {
|
|
2248
|
+
return { src: img, id: "img-".concat(index) };
|
|
1019
2249
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
2250
|
+
return __assign$1(__assign$1({}, img), { id: img.id || "img-".concat(index) });
|
|
2251
|
+
});
|
|
2252
|
+
};
|
|
2253
|
+
var ImagePreview = function (_a) {
|
|
2254
|
+
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$1(__assign$1({}, defaultTranslations$7), translations);
|
|
2256
|
+
var normalizedImages = normalizeImages(images);
|
|
2257
|
+
var sizeClass = sizeClasses[size];
|
|
2258
|
+
var radiusClass = radiusClasses[radius];
|
|
2259
|
+
if (normalizedImages.length === 0) {
|
|
2260
|
+
return (jsx("div", { className: "text-sm text-default-500 text-center py-4", children: t.emptyStateText }));
|
|
2261
|
+
}
|
|
2262
|
+
var handleRemove = function (id, index) {
|
|
2263
|
+
if (onRemove) {
|
|
2264
|
+
onRemove(id, index);
|
|
1022
2265
|
}
|
|
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
|
-
});
|
|
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
2266
|
};
|
|
1038
|
-
var
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
date: null,
|
|
1043
|
-
dateRange: range,
|
|
1044
|
-
});
|
|
2267
|
+
var handleImageClick = function (image, index) {
|
|
2268
|
+
if (onImageClick) {
|
|
2269
|
+
onImageClick(image, index);
|
|
2270
|
+
}
|
|
1045
2271
|
};
|
|
1046
|
-
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
|
|
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
|
-
};
|
|
1058
|
-
|
|
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
|
-
};
|
|
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(_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") })] })] }));
|
|
2272
|
+
var isClickable = !!onImageClick;
|
|
2273
|
+
return (jsx("div", { className: "flex flex-wrap gap-3 ".concat(className), children: normalizedImages.map(function (image, index) { return (jsx("div", { className: "relative", children: jsxs("div", { className: "relative ".concat(sizeClass), children: [jsx("img", { src: image.src, alt: image.alt || t.previewAlt, className: "\n\t\t\t\t\t\t\t\t".concat(sizeClass, " \n\t\t\t\t\t\t\t\tobject-contain \n\t\t\t\t\t\t\t\t").concat(radiusClass, " \n\t\t\t\t\t\t\t\t").concat(backgroundColor, " \n\t\t\t\t\t\t\t\t").concat(showBorder ? "border border-default-200 dark:border-default-700" : "", "\n\t\t\t\t\t\t\t\tshadow-sm\n\t\t\t\t\t\t\t\t").concat(isClickable ? "cursor-pointer hover:opacity-80 transition-opacity" : "", "\n\t\t\t\t\t\t\t"), onClick: isClickable ? function () { return handleImageClick(image, index); } : undefined, onKeyDown: isClickable
|
|
2274
|
+
? function (e) {
|
|
2275
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2276
|
+
e.preventDefault();
|
|
2277
|
+
handleImageClick(image, index);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
: undefined, role: isClickable ? "button" : undefined, tabIndex: isClickable ? 0 : undefined, "aria-label": isClickable ? t.clickableImageAriaLabel : undefined }), showRemoveButton && onRemove && (jsx("button", { type: "button", onClick: function () { return handleRemove(image.id || "", index); }, "aria-label": t.removeButtonAriaLabel, className: "\n\t\t\t\t\t\t\t\t\tabsolute -top-2 -right-2 \n\t\t\t\t\t\t\t\t\tp-1 rounded-full \n\t\t\t\t\t\t\t\t\tbg-danger-500 hover:bg-danger-600 \n\t\t\t\t\t\t\t\t\ttext-white \n\t\t\t\t\t\t\t\t\tcursor-pointer \n\t\t\t\t\t\t\t\t\ttransition-colors\n\t\t\t\t\t\t\t\t\tfocus:outline-none \n\t\t\t\t\t\t\t\t\tfocus:ring-2 \n\t\t\t\t\t\t\t\t\tfocus:ring-danger-400 \n\t\t\t\t\t\t\t\t\tfocus:ring-offset-2\n\t\t\t\t\t\t\t\t", children: jsx(IconComponent, { size: size === "micro" ? "sm" : "md", icon: "solar:trash-bin-minimalistic-outline" }) }))] }) }, image.id || index)); }) }));
|
|
1104
2281
|
};
|
|
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";
|
|
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$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";
|
|
1118
2282
|
|
|
1119
2283
|
function normalizeClass(value) {
|
|
1120
2284
|
if (typeof value === "string") {
|
|
@@ -1127,7 +2291,7 @@ function normalizeClass(value) {
|
|
|
1127
2291
|
}
|
|
1128
2292
|
var getSectionClasses = function (isCollapsed, sectionClassesProp) {
|
|
1129
2293
|
if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
|
|
1130
|
-
return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
|
|
2294
|
+
return (__assign$1(__assign$1({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
|
|
1131
2295
|
var k = _a[0], v = _a[1];
|
|
1132
2296
|
return [k, normalizeClass(v)];
|
|
1133
2297
|
}))), { base: normalizeClass(cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
|
|
@@ -1140,7 +2304,7 @@ var getSectionClasses = function (isCollapsed, sectionClassesProp) {
|
|
|
1140
2304
|
};
|
|
1141
2305
|
var getItemClasses = function (isCollapsed, itemClassesProp) {
|
|
1142
2306
|
if (itemClassesProp === void 0) { itemClassesProp = {}; }
|
|
1143
|
-
return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
|
|
2307
|
+
return (__assign$1(__assign$1({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
|
|
1144
2308
|
var k = _a[0], v = _a[1];
|
|
1145
2309
|
return [k, normalizeClass(v)];
|
|
1146
2310
|
}))), { base: normalizeClass(cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
|
|
@@ -1173,7 +2337,7 @@ var EnumMenuNavListItem;
|
|
|
1173
2337
|
* @forwardRef
|
|
1174
2338
|
*/
|
|
1175
2339
|
var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
1176
|
-
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"]);
|
|
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$1(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
|
|
1177
2341
|
var _d = useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
|
|
1178
2342
|
// Component styles
|
|
1179
2343
|
var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
|
|
@@ -1191,7 +2355,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
1191
2355
|
// Renders the item displayed inside the Popover when the menu is collapsed.
|
|
1192
2356
|
var renderCompactItem = React.useCallback(function (item, parentKey) {
|
|
1193
2357
|
var _a, _b;
|
|
1194
|
-
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); } })));
|
|
2358
|
+
return (createElement(ListboxItem, __assign$1({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsx(IconComponent$1, { 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); } })));
|
|
1195
2359
|
}, [handleItemPress, iconClassName]);
|
|
1196
2360
|
// Renders a nested item, i.e., an item that has sub-items.
|
|
1197
2361
|
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
@@ -1203,7 +2367,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
1203
2367
|
if (isNestType) {
|
|
1204
2368
|
item.href = undefined;
|
|
1205
2369
|
}
|
|
1206
|
-
return (createElement(ListboxItem, __assign({}, item, { key: item.key, classNames: {
|
|
2370
|
+
return (createElement(ListboxItem, __assign$1({}, item, { key: item.key, classNames: {
|
|
1207
2371
|
base: cn({
|
|
1208
2372
|
"h-auto p-0": !isCollapsed && isNestType,
|
|
1209
2373
|
}, {
|
|
@@ -1213,10 +2377,10 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
1213
2377
|
}, "rounded-large"),
|
|
1214
2378
|
}, endContent: isCollapsed || isNestType || hideEndContent
|
|
1215
2379
|
? null
|
|
1216
|
-
: ((_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 }),
|
|
2380
|
+
: ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsx(IconComponent$1, { 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 }),
|
|
1217
2381
|
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: {
|
|
1218
2382
|
base: "text-default-500",
|
|
1219
|
-
}, 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
|
|
2383
|
+
}, children: jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsx(IconComponent$1, { 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
|
|
1220
2384
|
? item.items.map(function (child) {
|
|
1221
2385
|
return renderCompactItem(child, item.key);
|
|
1222
2386
|
})
|
|
@@ -1225,7 +2389,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
1225
2389
|
heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
|
|
1226
2390
|
trigger: "p-0",
|
|
1227
2391
|
content: "py-0 pl-4",
|
|
1228
|
-
}, 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: {
|
|
2392
|
+
}, title: item.icon ? (jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsx(IconComponent$1, { 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: {
|
|
1229
2393
|
list: cn("border-l border-default-200 pl-4"),
|
|
1230
2394
|
}, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
|
|
1231
2395
|
}, [isCollapsed, hideEndContent, iconClassName, items, selected]);
|
|
@@ -1240,13 +2404,13 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
1240
2404
|
return renderNestItem(item);
|
|
1241
2405
|
}
|
|
1242
2406
|
var isItemSelected = selected === item.key;
|
|
1243
|
-
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: {
|
|
2407
|
+
return (createElement(ListboxItem, __assign$1({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsx(IconComponent$1, { 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: {
|
|
1244
2408
|
base: "text-default-500",
|
|
1245
|
-
}, 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));
|
|
2409
|
+
}, children: jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsx(IconComponent$1, { 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));
|
|
1246
2410
|
},
|
|
1247
2411
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1248
2412
|
[isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
|
|
1249
|
-
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) {
|
|
2413
|
+
return (jsx(Listbox, __assign$1({ ref: ref, hideSelectedIcon: true, as: "nav", className: cn("list-none", className), classNames: __assign$1(__assign$1({}, classNames), { list: cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign$1(__assign$1({}, 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) {
|
|
1250
2414
|
var _a, _b;
|
|
1251
2415
|
return item.items &&
|
|
1252
2416
|
((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
@@ -1288,13 +2452,13 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
1288
2452
|
}
|
|
1289
2453
|
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
|
|
1290
2454
|
? "container__menu--collapsed"
|
|
1291
|
-
: "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
|
|
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$1, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsx(IconComponent$1, { icon: isCollapsed
|
|
1292
2456
|
? "solar:alt-arrow-right-outline"
|
|
1293
|
-
: "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$
|
|
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$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$1, { 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 })) }) })] }) })] }));
|
|
1294
2458
|
});
|
|
1295
2459
|
|
|
1296
2460
|
var StepIndicator = function (_a) {
|
|
1297
|
-
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"]);
|
|
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$1(_a, ["currentStep", "totalSteps", "color", "showStepText", "stepTextFormatter", "className"]);
|
|
1298
2462
|
var progressPercentage = Math.min((currentStep / totalSteps) * 100, 100);
|
|
1299
2463
|
var colorClasses = {
|
|
1300
2464
|
primary: "bg-primary",
|
|
@@ -1309,7 +2473,7 @@ var StepIndicator = function (_a) {
|
|
|
1309
2473
|
var stepText = stepTextFormatter
|
|
1310
2474
|
? stepTextFormatter(currentStep, totalSteps)
|
|
1311
2475
|
: defaultStepText(currentStep, totalSteps);
|
|
1312
|
-
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, "%") } }) })] })));
|
|
2476
|
+
return (jsxs("div", __assign$1({ 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, "%") } }) })] })));
|
|
1313
2477
|
};
|
|
1314
2478
|
|
|
1315
2479
|
/*
|
|
@@ -1380,9 +2544,9 @@ var defaultTranslations$6 = {
|
|
|
1380
2544
|
checkIconTitle: "Check",
|
|
1381
2545
|
};
|
|
1382
2546
|
var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
1383
|
-
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"]);
|
|
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$1(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
1384
2548
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
1385
|
-
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
2549
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$6), translations);
|
|
1386
2550
|
var steps = React.useMemo(function () {
|
|
1387
2551
|
if (typeof stepsProp === "number") {
|
|
1388
2552
|
return Array.from({ length: stepsProp }, function () { return ({}); });
|
|
@@ -1447,7 +2611,7 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
1447
2611
|
var isDisabled = status === "inactive";
|
|
1448
2612
|
return (
|
|
1449
2613
|
// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
|
|
1450
|
-
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, {
|
|
2614
|
+
jsxs("li", { className: "relative", children: [jsx("div", { className: "flex w-full max-w-full items-center", children: jsxs("button", __assign$1({ 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, {
|
|
1451
2615
|
"cursor-not-allowed": isDisabled,
|
|
1452
2616
|
}), 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", {
|
|
1453
2617
|
"shadow-lg": status === "complete",
|
|
@@ -1466,7 +2630,7 @@ var VerticalSteps = React.forwardRef(function (_a, ref) {
|
|
|
1466
2630
|
backgroundColor: "var(--complete-background-color)",
|
|
1467
2631
|
borderColor: "var(--complete-border-color)",
|
|
1468
2632
|
},
|
|
1469
|
-
}, 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", {
|
|
2633
|
+
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent$1, { 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", {
|
|
1470
2634
|
"text-default-300": status === "inactive",
|
|
1471
2635
|
}), children: step.title }), jsx("div", { className: cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
|
|
1472
2636
|
"text-default-300": status === "inactive",
|
|
@@ -1486,13 +2650,13 @@ var stepperClasses = cn(
|
|
|
1486
2650
|
// dark
|
|
1487
2651
|
"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)]");
|
|
1488
2652
|
var MultiStepSidebar = React.forwardRef(function (_a, ref) {
|
|
1489
|
-
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"]);
|
|
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$1(_a, ["children", "className", "currentPage", "onBack", "onNext", "onChangePage", "steps", "goBackTranslation", "onClose"]);
|
|
1490
2654
|
var handleOverlayClick = function (e) {
|
|
1491
2655
|
if (e.target === e.currentTarget) {
|
|
1492
2656
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
1493
2657
|
}
|
|
1494
2658
|
};
|
|
1495
|
-
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 })] })] })) }));
|
|
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$1({ 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$1, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsx(IconComponent$1, { 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 })] })] })) }));
|
|
1496
2660
|
});
|
|
1497
2661
|
MultiStepSidebar.displayName = "MultiStepSidebar";
|
|
1498
2662
|
|
|
@@ -1500,9 +2664,9 @@ var MultistepNavigationButtons = function (_a) {
|
|
|
1500
2664
|
var nextButtonProps = _a.nextButtonProps, cancelButtonProps = _a.cancelButtonProps, className = _a.className;
|
|
1501
2665
|
// const { children: backButtonChildren, ...restBackButtonProps } =
|
|
1502
2666
|
// backButtonProps || {};
|
|
1503
|
-
var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
|
|
1504
|
-
var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
|
|
1505
|
-
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$
|
|
2667
|
+
var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest$1(_b, ["children"]);
|
|
2668
|
+
var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest$1(_c, ["children"]);
|
|
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$2, __assign$1({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsx(Button$2, __assign$1({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
|
|
1506
2670
|
};
|
|
1507
2671
|
|
|
1508
2672
|
var MultiStepWizard = function (_a) {
|
|
@@ -1513,7 +2677,7 @@ var MultiStepWizard = function (_a) {
|
|
|
1513
2677
|
setPage(0);
|
|
1514
2678
|
}
|
|
1515
2679
|
}, [isOpen]);
|
|
1516
|
-
var t = __assign({
|
|
2680
|
+
var t = __assign$1({
|
|
1517
2681
|
continue: "Continue",
|
|
1518
2682
|
goBack: "Back",
|
|
1519
2683
|
cancel: "Cancel",
|
|
@@ -1570,7 +2734,7 @@ var MultiStepWizard = function (_a) {
|
|
|
1570
2734
|
if (!isOpen) {
|
|
1571
2735
|
return null;
|
|
1572
2736
|
}
|
|
1573
|
-
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: {
|
|
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$1, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsx(IconComponent$1, { 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: {
|
|
1574
2738
|
isDisabled: page === 0,
|
|
1575
2739
|
onPress: onBack,
|
|
1576
2740
|
children: t.goBack,
|
|
@@ -1585,8 +2749,8 @@ var MultiStepWizard = function (_a) {
|
|
|
1585
2749
|
};
|
|
1586
2750
|
|
|
1587
2751
|
var Pagination = function (_a) {
|
|
1588
|
-
_a.size; var props = __rest(_a, ["size"]);
|
|
1589
|
-
return jsx(Pagination$1, __assign({ showControls: true, isCompact: true }, props));
|
|
2752
|
+
_a.size; var props = __rest$1(_a, ["size"]);
|
|
2753
|
+
return jsx(Pagination$1, __assign$1({ showControls: true, isCompact: true }, props));
|
|
1590
2754
|
};
|
|
1591
2755
|
|
|
1592
2756
|
var Andorra = function () {
|
|
@@ -2039,7 +3203,7 @@ var Phone = function (_a) {
|
|
|
2039
3203
|
var portalDropdownRef = useRef(null);
|
|
2040
3204
|
var _l = useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
2041
3205
|
var _m = useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
2042
|
-
var t = __assign(__assign({}, defaultTranslations$5), translations);
|
|
3206
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$5), translations);
|
|
2043
3207
|
var finalLabel = label || t.label;
|
|
2044
3208
|
useEffect(function () {
|
|
2045
3209
|
if (value) {
|
|
@@ -2128,7 +3292,7 @@ var defaultTranslations$4 = {
|
|
|
2128
3292
|
*/
|
|
2129
3293
|
var PromotionalBanner = function (_a) {
|
|
2130
3294
|
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;
|
|
2131
|
-
var t = __assign(__assign({}, defaultTranslations$4), translations);
|
|
3295
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$4), translations);
|
|
2132
3296
|
var finalMessage = message || t.message;
|
|
2133
3297
|
var finalButtonText = buttonText || t.buttonText;
|
|
2134
3298
|
var handleClose = function () {
|
|
@@ -2145,16 +3309,16 @@ var PromotionalBanner = function (_a) {
|
|
|
2145
3309
|
}
|
|
2146
3310
|
var fromColor = gradientColors[0], viaColor = gradientColors[1], toColor = gradientColors[2];
|
|
2147
3311
|
var buttonGradient1 = buttonGradientColors[0], buttonGradient2 = buttonGradientColors[1];
|
|
2148
|
-
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$
|
|
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$1({ className: "text-inherit", href: messageHref, onClick: handleMessageClick }, messageLinkProps, { children: [finalMessage, "\u00A0"] })) }), jsx(Button$2, __assign$1({ as: Link, className: "group text-small relative h-9 overflow-hidden bg-transparent font-normal", color: "default", endContent: jsx(IconComponent$1, { 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: {
|
|
2149
3313
|
border: "solid 2px transparent",
|
|
2150
3314
|
backgroundImage: "linear-gradient(hsl(var(--heroui-danger-50)), hsl(var(--heroui-danger-50))), linear-gradient(to right, ".concat(buttonGradient1, ", ").concat(buttonGradient2, ")"),
|
|
2151
3315
|
backgroundOrigin: "border-box",
|
|
2152
3316
|
backgroundClip: "padding-box, border-box",
|
|
2153
|
-
}, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsx("div", { className: "flex flex-1 justify-end", children: jsx(Button$
|
|
3317
|
+
}, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsx("div", { className: "flex flex-1 justify-end", children: jsx(Button$2, { isIconOnly: true, "aria-label": t.closeButtonLabel, className: "-m-1", size: "lg", variant: "bordered", onClick: handleClose, children: jsx(IconComponent$1, { "aria-hidden": "true", className: "text-default-500", icon: "lucide:x", size: "md" }) }) }))] }));
|
|
2154
3318
|
};
|
|
2155
3319
|
|
|
2156
3320
|
var RowSteps = React.forwardRef(function (_a, ref) {
|
|
2157
|
-
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"]);
|
|
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$1(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
|
|
2158
3322
|
var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
|
|
2159
3323
|
var steps = React.useMemo(function () {
|
|
2160
3324
|
if (typeof stepsProp === "number") {
|
|
@@ -2217,7 +3381,7 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
2217
3381
|
: currentStep < stepIdx
|
|
2218
3382
|
? "inactive"
|
|
2219
3383
|
: "complete";
|
|
2220
|
-
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", {
|
|
3384
|
+
return (jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxs("button", __assign$1({ 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", {
|
|
2221
3385
|
"shadow-lg": status === "complete",
|
|
2222
3386
|
}), initial: false, transition: { duration: 0.25 }, variants: {
|
|
2223
3387
|
inactive: {
|
|
@@ -2234,7 +3398,7 @@ var RowSteps = React.forwardRef(function (_a, ref) {
|
|
|
2234
3398
|
backgroundColor: "var(--complete-background-color)",
|
|
2235
3399
|
borderColor: "var(--complete-border-color)",
|
|
2236
3400
|
},
|
|
2237
|
-
}, 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", {
|
|
3401
|
+
}, children: jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsx(IconComponent$1, { 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", {
|
|
2238
3402
|
"text-default-300": status === "inactive",
|
|
2239
3403
|
}), 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: {
|
|
2240
3404
|
// @ts-ignore
|
|
@@ -2407,20 +3571,20 @@ class $35ea8db9cb2ccb90$export$680ea196effce5f {
|
|
|
2407
3571
|
}
|
|
2408
3572
|
|
|
2409
3573
|
var Switch = function (_a) {
|
|
2410
|
-
var id = _a.id, props = __rest(_a, ["id"]);
|
|
3574
|
+
var id = _a.id, props = __rest$1(_a, ["id"]);
|
|
2411
3575
|
var generatedId = useId();
|
|
2412
3576
|
var autoId = id || generatedId;
|
|
2413
|
-
return jsx(Switch$1, __assign({}, props, { id: autoId }));
|
|
3577
|
+
return jsx(Switch$1, __assign$1({}, props, { id: autoId }));
|
|
2414
3578
|
};
|
|
2415
3579
|
|
|
2416
3580
|
/**
|
|
2417
3581
|
* TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
2418
3582
|
*/
|
|
2419
3583
|
var TimeInput = function (_a) {
|
|
2420
|
-
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"]);
|
|
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$1(_a, ["label", "id", "size", "radius", "variant"]);
|
|
2421
3585
|
var generatedId = useId();
|
|
2422
3586
|
var autoId = id || generatedId;
|
|
2423
|
-
return (jsx(TimeInput$1, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
|
|
3587
|
+
return (jsx(TimeInput$1, __assign$1({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
|
|
2424
3588
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
2425
3589
|
inputWrapper: "focus-within:!border-primary-500",
|
|
2426
3590
|
} })));
|
|
@@ -2515,7 +3679,7 @@ var defaultTranslations$3 = {
|
|
|
2515
3679
|
*/
|
|
2516
3680
|
var ScheduleRow = function (_a) {
|
|
2517
3681
|
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;
|
|
2518
|
-
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
3682
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$3), translations);
|
|
2519
3683
|
/**
|
|
2520
3684
|
* @function validateTimeSlots
|
|
2521
3685
|
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
@@ -2525,13 +3689,13 @@ var ScheduleRow = function (_a) {
|
|
|
2525
3689
|
var validateTimeSlots = function (timeSlots) {
|
|
2526
3690
|
return timeSlots.map(function (slot) {
|
|
2527
3691
|
if (slot.from && slot.to) {
|
|
2528
|
-
var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
|
|
2529
|
-
var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
|
|
3692
|
+
var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray$1([void 0], slot.from.split(":").map(Number), false)))();
|
|
3693
|
+
var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray$1([void 0], slot.to.split(":").map(Number), false)))();
|
|
2530
3694
|
if (fromTime.compare(toTime) > 0) {
|
|
2531
|
-
return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
|
|
3695
|
+
return __assign$1(__assign$1({}, slot), { error: "From time cannot be after to time" });
|
|
2532
3696
|
}
|
|
2533
3697
|
}
|
|
2534
|
-
return __assign(__assign({}, slot), { error: null });
|
|
3698
|
+
return __assign$1(__assign$1({}, slot), { error: null });
|
|
2535
3699
|
});
|
|
2536
3700
|
};
|
|
2537
3701
|
/**
|
|
@@ -2565,7 +3729,7 @@ var ScheduleRow = function (_a) {
|
|
|
2565
3729
|
* @description Toggles the `isOpen` status of the schedule for the day.
|
|
2566
3730
|
*/
|
|
2567
3731
|
var handleToggleDay = function () {
|
|
2568
|
-
onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
|
|
3732
|
+
onChange(__assign$1(__assign$1({}, daySchedule), { isOpen: !daySchedule.isOpen }));
|
|
2569
3733
|
};
|
|
2570
3734
|
/**
|
|
2571
3735
|
* @function handleTimeChange
|
|
@@ -2576,11 +3740,11 @@ var ScheduleRow = function (_a) {
|
|
|
2576
3740
|
*/
|
|
2577
3741
|
var handleTimeChange = function (index, field, value) {
|
|
2578
3742
|
var _a;
|
|
2579
|
-
var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
|
|
3743
|
+
var newTimeSlots = __spreadArray$1([], daySchedule.timeSlots, true);
|
|
2580
3744
|
// Update the specific field
|
|
2581
|
-
newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
|
|
3745
|
+
newTimeSlots[index] = __assign$1(__assign$1({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
|
|
2582
3746
|
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
2583
|
-
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
3747
|
+
onChange(__assign$1(__assign$1({}, daySchedule), { timeSlots: validatedSlots }));
|
|
2584
3748
|
};
|
|
2585
3749
|
/**
|
|
2586
3750
|
* @function handleAddTimeSlot
|
|
@@ -2589,9 +3753,9 @@ var ScheduleRow = function (_a) {
|
|
|
2589
3753
|
*/
|
|
2590
3754
|
var handleAddTimeSlot = function () {
|
|
2591
3755
|
// Add a new empty slot
|
|
2592
|
-
var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
|
|
3756
|
+
var newTimeSlots = __spreadArray$1(__spreadArray$1([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
|
|
2593
3757
|
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
2594
|
-
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
3758
|
+
onChange(__assign$1(__assign$1({}, daySchedule), { timeSlots: validatedSlots }));
|
|
2595
3759
|
};
|
|
2596
3760
|
/**
|
|
2597
3761
|
* @function handleRemoveTimeSlot
|
|
@@ -2605,7 +3769,7 @@ var ScheduleRow = function (_a) {
|
|
|
2605
3769
|
if (newTimeSlots.length === 0) {
|
|
2606
3770
|
newTimeSlots = [{ from: "", to: "" }];
|
|
2607
3771
|
}
|
|
2608
|
-
onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
3772
|
+
onChange(__assign$1(__assign$1({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
2609
3773
|
};
|
|
2610
3774
|
/**
|
|
2611
3775
|
* @function getSlotsToDisplay
|
|
@@ -2622,12 +3786,12 @@ var ScheduleRow = function (_a) {
|
|
|
2622
3786
|
// Return slots exactly as they are - no automatic additions
|
|
2623
3787
|
return slots;
|
|
2624
3788
|
};
|
|
2625
|
-
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) {
|
|
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$1, { 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) {
|
|
2626
3790
|
var slotsToDisplay = getSlotsToDisplay();
|
|
2627
3791
|
var isLastSlot = index === slotsToDisplay.length - 1;
|
|
2628
3792
|
var isSlotFilled = slot.from && slot.to;
|
|
2629
3793
|
var canDelete = slotsToDisplay.length > 1;
|
|
2630
|
-
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)));
|
|
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$1, { isIconOnly: true, size: "sm", color: "primary", variant: "light", onPress: handleAddTimeSlot, isDisabled: !isSlotFilled, startContent: jsx(IconComponent$1, { icon: "solar:add-circle-bold" }) })) : (jsx(Button$1, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: !canDelete, startContent: jsx(IconComponent$1, { icon: "solar:trash-bin-minimalistic-outline" }) }))] }, "".concat(day, "-timeslot-").concat(index)));
|
|
2631
3795
|
}) }))] }, day));
|
|
2632
3796
|
};
|
|
2633
3797
|
|
|
@@ -2641,11 +3805,11 @@ var ScheduleRow = function (_a) {
|
|
|
2641
3805
|
* - Follows BeweOS design guidelines
|
|
2642
3806
|
*/
|
|
2643
3807
|
var SearchInput = function (_a) {
|
|
2644
|
-
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"]);
|
|
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$1(_a, ["searchPlaceholder", "searchIcon", "iconProps", "onSearchChange", "searchValue", "value", "onValueChange", "placeholder", "size", "className"]);
|
|
2645
3809
|
// Use searchValue/onSearchChange if provided, otherwise fall back to value/onValueChange
|
|
2646
3810
|
var inputValue = searchValue !== null && searchValue !== void 0 ? searchValue : value;
|
|
2647
3811
|
var handleValueChange = onSearchChange !== null && onSearchChange !== void 0 ? onSearchChange : onValueChange;
|
|
2648
|
-
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)) })));
|
|
3812
|
+
return (jsx(Input, __assign$1({}, props, { className: className, size: size, placeholder: placeholder || searchPlaceholder, value: inputValue, onValueChange: handleValueChange, endContent: jsx(IconComponent$1, __assign$1({ icon: searchIcon, className: "text-default-400", size: "sm" }, iconProps)) })));
|
|
2649
3813
|
};
|
|
2650
3814
|
|
|
2651
3815
|
/**
|
|
@@ -2658,10 +3822,10 @@ var SearchInput = function (_a) {
|
|
|
2658
3822
|
* - Size: sm, md, lg (configurable)
|
|
2659
3823
|
*/
|
|
2660
3824
|
var Select = function (_a) {
|
|
2661
|
-
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"]);
|
|
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$1(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
|
|
2662
3826
|
var generatedId = useId();
|
|
2663
3827
|
var selectId = id || generatedId;
|
|
2664
|
-
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: {
|
|
3828
|
+
return (jsx("div", { className: "group", children: jsx(Select$1, __assign$1({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
2665
3829
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
2666
3830
|
trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
|
|
2667
3831
|
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",
|
|
@@ -2669,18 +3833,18 @@ var Select = function (_a) {
|
|
|
2669
3833
|
};
|
|
2670
3834
|
|
|
2671
3835
|
function AuraTable(_a) {
|
|
2672
|
-
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
2673
|
-
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)); } })] })));
|
|
3836
|
+
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest$1(_a, ["columns", "items", "renderCell", "children"]);
|
|
3837
|
+
return (jsxs(Table, __assign$1({ 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)); } })] })));
|
|
2674
3838
|
}
|
|
2675
3839
|
|
|
2676
3840
|
/**
|
|
2677
3841
|
* Textarea component that wraps the HeroUI TextArea component.
|
|
2678
3842
|
*/
|
|
2679
3843
|
var Textarea = function (_a) {
|
|
2680
|
-
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"]);
|
|
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$1(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
|
|
2681
3845
|
var generatedId = useId();
|
|
2682
3846
|
var autoId = id || generatedId;
|
|
2683
|
-
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: {
|
|
3847
|
+
return (jsx(Textarea$1, __assign$1({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
|
|
2684
3848
|
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
2685
3849
|
inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
|
|
2686
3850
|
} })));
|
|
@@ -2703,7 +3867,7 @@ var defaultTranslations$2 = {
|
|
|
2703
3867
|
var ThemePicker = function (_a) {
|
|
2704
3868
|
var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
|
|
2705
3869
|
// Combinar traducciones por defecto con las proporcionadas
|
|
2706
|
-
var t = __assign(__assign({}, defaultTranslations$2), translations);
|
|
3870
|
+
var t = __assign$1(__assign$1({}, defaultTranslations$2), translations);
|
|
2707
3871
|
var themes = [
|
|
2708
3872
|
{
|
|
2709
3873
|
key: "light",
|
|
@@ -3038,7 +4202,7 @@ var ImageCropModal = function (_a) {
|
|
|
3038
4202
|
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%)",
|
|
3039
4203
|
backgroundSize: "8px 8px",
|
|
3040
4204
|
backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
|
|
3041
|
-
} }), 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$
|
|
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$2, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsx(Button$2, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
|
|
3042
4206
|
};
|
|
3043
4207
|
/**
|
|
3044
4208
|
* Componente de previsualización de archivo
|
|
@@ -3056,7 +4220,7 @@ var FilePreview = function (_a) {
|
|
|
3056
4220
|
if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
|
|
3057
4221
|
return null;
|
|
3058
4222
|
}
|
|
3059
|
-
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$
|
|
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$2, { 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$1, { icon: "heroicons:trash", size: "sm" }) })] }));
|
|
3060
4224
|
};
|
|
3061
4225
|
/**
|
|
3062
4226
|
* Componente UploadDocument basado en Hero UI con funcionalidad mejorada
|
|
@@ -3095,7 +4259,7 @@ var UploadFile = function (_a) {
|
|
|
3095
4259
|
var _q = useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
|
|
3096
4260
|
var _r = useState(null); _r[0]; var setOriginalFile = _r[1];
|
|
3097
4261
|
// Combinar traducciones por defecto con las proporcionadas
|
|
3098
|
-
var t = useMemo(function () { return (__assign(__assign({}, defaultTranslations$1), translations)); }, [translations]);
|
|
4262
|
+
var t = useMemo(function () { return (__assign$1(__assign$1({}, defaultTranslations$1), translations)); }, [translations]);
|
|
3099
4263
|
// Actualizar texto si se pasa como prop (retrocompatibilidad)
|
|
3100
4264
|
var finalText = text || t.uploadText;
|
|
3101
4265
|
var finalSubText = subText || t.subText;
|
|
@@ -3267,7 +4431,7 @@ var UploadFile = function (_a) {
|
|
|
3267
4431
|
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");
|
|
3268
4432
|
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
|
|
3269
4433
|
? "opacity-0"
|
|
3270
|
-
: "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"
|
|
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$1, { icon: icon, size: size === "micro" ? "sm" : size === "small" ? "md" : "xl", className: "".concat(size === "micro" ? "text-lg"
|
|
3271
4435
|
: size === "small" ? "text-xl sm:text-2xl"
|
|
3272
4436
|
: "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"
|
|
3273
4437
|
: size === "small" ? "px-1"
|
|
@@ -3322,7 +4486,7 @@ function WizardSidebar(_a) {
|
|
|
3322
4486
|
? "bg-primary-600 text-white shadow-lg scale-110 border-2 border-primary-600"
|
|
3323
4487
|
: isCompleted
|
|
3324
4488
|
? "border-2 border-primary-600 dark:border-primary-400 text-primary-600 dark:text-primary-400 bg-transparent"
|
|
3325
|
-
: "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
|
|
4489
|
+
: "border-2 border-primary-300 dark:border-primary-700 text-primary-400 dark:text-primary-500 bg-transparent"), children: step.icon ? (jsx(IconComponent$1, { icon: step.icon, className: "text-base" })) : isCompleted ? (jsx(IconComponent$1, { 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
|
|
3326
4490
|
? "text-primary-600 dark:text-primary-400"
|
|
3327
4491
|
: isCompleted
|
|
3328
4492
|
? "text-primary-600 dark:text-primary-400"
|
|
@@ -3352,8 +4516,8 @@ function WizardNavigation(_a) {
|
|
|
3352
4516
|
onNext();
|
|
3353
4517
|
}
|
|
3354
4518
|
};
|
|
3355
|
-
return (jsxs("div", { className: "flex justify-between items-center ".concat(className), children: [showBack && !isFirstStep ? (jsx(Button$
|
|
3356
|
-
), jsx(Button$
|
|
4519
|
+
return (jsxs("div", { className: "flex justify-between items-center ".concat(className), children: [showBack && !isFirstStep ? (jsx(Button$2, { variant: "light", size: "md", onPress: onBack, isDisabled: isBackDisabled || isLoading, startContent: jsx(IconComponent$1, { icon: "solar:alt-arrow-left-bold", className: "text-base" }), children: effectiveBackText })) : (jsx("div", {}) // Spacer para mantener el botón "Siguiente" a la derecha
|
|
4520
|
+
), jsx(Button$2, { color: "primary", variant: "solid", size: "md", onPress: handleNext, isDisabled: isNextDisabled || isLoading, isLoading: isLoading, endContent: isLastStep ? (jsx(IconComponent$1, { icon: "solar:check-circle-bold", className: "text-base" })) : (jsx(IconComponent$1, { icon: "solar:alt-arrow-right-bold", className: "text-base" })), children: isLastStep ? effectiveFinishText : effectiveNextText })] }));
|
|
3357
4521
|
}
|
|
3358
4522
|
|
|
3359
4523
|
/**
|
|
@@ -3407,7 +4571,7 @@ function Wizard(_a) {
|
|
|
3407
4571
|
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;
|
|
3408
4572
|
var _l = useState(false), isTransitioning = _l[0], setIsTransitioning = _l[1];
|
|
3409
4573
|
// Merge default translations with provided ones
|
|
3410
|
-
var t = useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
|
|
4574
|
+
var t = useMemo(function () { return (__assign$1(__assign$1({}, defaultTranslations), translations)); }, [translations]);
|
|
3411
4575
|
// Use loadingText prop for backward compatibility, but prefer translations
|
|
3412
4576
|
var effectiveLoadingText = loadingText !== null && loadingText !== void 0 ? loadingText : t.loadingText;
|
|
3413
4577
|
// Configuración de navegación con valores por defecto
|
|
@@ -3645,7 +4809,7 @@ var NavigationLoadingOverlay = function (_a) {
|
|
|
3645
4809
|
var DrawerFiltersFooter = function (_a) {
|
|
3646
4810
|
var onClearFilters = _a.onClearFilters, onCancel = _a.onCancel, onApplyFilters = _a.onApplyFilters, _b = _a.translations, translations = _b === void 0 ? {} : _b;
|
|
3647
4811
|
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;
|
|
3648
|
-
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 })] })] }));
|
|
4812
|
+
return (jsxs("div", { className: "flex items-center justify-between px-6 py-10 bg-content1", children: [jsx(Button$1, { variant: "light", color: "primary", onPress: onClearFilters, className: "text-primary", children: clearFilters }), jsxs("div", { className: "flex items-center gap-3", children: [jsx(Button$1, { variant: "bordered", color: "primary", onPress: onCancel, children: cancel }), jsx(Button$1, { variant: "solid", color: "primary", onPress: onApplyFilters, children: applyFilters })] })] }));
|
|
3649
4813
|
};
|
|
3650
4814
|
|
|
3651
4815
|
/**
|
|
@@ -3680,7 +4844,7 @@ var RangeFilter = function (_a) {
|
|
|
3680
4844
|
tooltipProducts: "productos",
|
|
3681
4845
|
tooltipProduct: "producto",
|
|
3682
4846
|
};
|
|
3683
|
-
var t = __assign(__assign({}, defaultTranslations), translations);
|
|
4847
|
+
var t = __assign$1(__assign$1({}, defaultTranslations), translations);
|
|
3684
4848
|
// Function to check if a bar is in the selected range
|
|
3685
4849
|
var isBarInRange = function (barStart, barEnd) {
|
|
3686
4850
|
return barStart >= currentValue[0] && barEnd <= currentValue[1];
|
|
@@ -3722,7 +4886,7 @@ var RangeFilter = function (_a) {
|
|
|
3722
4886
|
alignSelf: "flex-end",
|
|
3723
4887
|
opacity: inRange ? 1 : 0.4,
|
|
3724
4888
|
}, 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)));
|
|
3725
|
-
}) }) }), jsx("div", { className: "px-2", children: jsx(Slider, __assign({ step: step, minValue: minValue, maxValue: maxValue, defaultValue: [minValue, maxValue], value: currentValue, onChange: function (newValue) {
|
|
4889
|
+
}) }) }), jsx("div", { className: "px-2", children: jsx(Slider, __assign$1({ step: step, minValue: minValue, maxValue: maxValue, defaultValue: [minValue, maxValue], value: currentValue, onChange: function (newValue) {
|
|
3726
4890
|
var _a = newValue, min = _a[0], max = _a[1];
|
|
3727
4891
|
setCurrentValue([min, max]);
|
|
3728
4892
|
onChange([min, max]);
|
|
@@ -3836,7 +5000,7 @@ var FilterSection = function (_a) {
|
|
|
3836
5000
|
"--tw-shadow-colored": "var(--heroui-box-shadow-medium)",
|
|
3837
5001
|
}, 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: {
|
|
3838
5002
|
backgroundColor: "hsl(var(--heroui-default) / var(--heroui-default-opacity, var(--tw-bg-opacity)))",
|
|
3839
|
-
}, children: getActiveFilterCount() }))] }), jsx(IconComponent, { icon: internalExpanded
|
|
5003
|
+
}, children: getActiveFilterCount() }))] }), jsx(IconComponent$1, { icon: internalExpanded
|
|
3840
5004
|
? "solar:alt-arrow-down-outline"
|
|
3841
5005
|
: "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()] }))] }));
|
|
3842
5006
|
};
|
|
@@ -3886,7 +5050,7 @@ var DateFilter = function (_a) {
|
|
|
3886
5050
|
_a.filter; var value = _a.value, onChange = _a.onChange;
|
|
3887
5051
|
var handleDateSelectorChange = function (dateSelectorValue) {
|
|
3888
5052
|
onChange({
|
|
3889
|
-
type: dateSelectorValue.type === HolidayType.SingleDay
|
|
5053
|
+
type: dateSelectorValue.type === HolidayType$1.SingleDay
|
|
3890
5054
|
? "singleDay"
|
|
3891
5055
|
: "dateRange",
|
|
3892
5056
|
date: dateSelectorValue.date ? dateSelectorValue.date.toString() : null,
|
|
@@ -3905,9 +5069,9 @@ var DateFilter = function (_a) {
|
|
|
3905
5069
|
// Convert our internal format to DateSelector format
|
|
3906
5070
|
var getInitialType = function () {
|
|
3907
5071
|
if ((value === null || value === void 0 ? void 0 : value.type) === "dateRange") {
|
|
3908
|
-
return HolidayType.DateRange;
|
|
5072
|
+
return HolidayType$1.DateRange;
|
|
3909
5073
|
}
|
|
3910
|
-
return HolidayType.SingleDay;
|
|
5074
|
+
return HolidayType$1.SingleDay;
|
|
3911
5075
|
};
|
|
3912
5076
|
// For now, we'll let DateSelector handle its own state
|
|
3913
5077
|
// The component will reset when the filter value changes
|
|
@@ -3959,7 +5123,7 @@ var DrawerFilters = function (_a) {
|
|
|
3959
5123
|
var handleFilterChange = useCallback(function (filterKey, value) {
|
|
3960
5124
|
setFilterValues(function (prev) {
|
|
3961
5125
|
var _a;
|
|
3962
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[filterKey] = value, _a)));
|
|
5126
|
+
return (__assign$1(__assign$1({}, prev), (_a = {}, _a[filterKey] = value, _a)));
|
|
3963
5127
|
});
|
|
3964
5128
|
}, []);
|
|
3965
5129
|
// Clear all filters
|
|
@@ -4049,7 +5213,7 @@ var DrawerFilters = function (_a) {
|
|
|
4049
5213
|
DrawerFilters.displayName = "DrawerFilters";
|
|
4050
5214
|
|
|
4051
5215
|
var Modal = function (props) {
|
|
4052
|
-
return (jsx(Modal$1, __assign({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
|
|
5216
|
+
return (jsx(Modal$1, __assign$1({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
|
|
4053
5217
|
};
|
|
4054
5218
|
|
|
4055
5219
|
var ModalContent = ModalContent$1;
|
|
@@ -4076,16 +5240,16 @@ var paddingClasses = {
|
|
|
4076
5240
|
* - Hereda de HeroUI Card con personalización BeweOS
|
|
4077
5241
|
*/
|
|
4078
5242
|
var Card = function (_a) {
|
|
4079
|
-
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"]);
|
|
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$1(_a, ["children", "className", "shadow", "radius", "padding"]);
|
|
4080
5244
|
var paddingClass = paddingClasses[padding];
|
|
4081
5245
|
var combinedClassName = [paddingClass, className].filter(Boolean).join(" ");
|
|
4082
|
-
return (jsx(Card$1, __assign({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
5246
|
+
return (jsx(Card$1, __assign$1({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
4083
5247
|
};
|
|
4084
5248
|
|
|
4085
5249
|
/**
|
|
4086
5250
|
* @file This file contains the theme configurations for the application.
|
|
4087
5251
|
*/
|
|
4088
|
-
var ALL_THEMES = __spreadArray(["light", "dark"], Object.keys(themeColors), true);
|
|
5252
|
+
var ALL_THEMES = __spreadArray$1(["light", "dark"], Object.keys(themeColors$1), true);
|
|
4089
5253
|
|
|
4090
5254
|
/**
|
|
4091
5255
|
* Custom hook to manage the theme state and side effects.
|
|
@@ -4169,13 +5333,13 @@ var AuraToastProvider = function (_a) {
|
|
|
4169
5333
|
clearTimeout(timerRef.current);
|
|
4170
5334
|
timerRef.current = null;
|
|
4171
5335
|
}
|
|
4172
|
-
setToast(function (currentToast) { return (__assign(__assign({}, currentToast), { isVisible: false })); });
|
|
5336
|
+
setToast(function (currentToast) { return (__assign$1(__assign$1({}, currentToast), { isVisible: false })); });
|
|
4173
5337
|
}, []);
|
|
4174
5338
|
var showToast = useCallback(function (options) {
|
|
4175
5339
|
if (timerRef.current) {
|
|
4176
5340
|
clearTimeout(timerRef.current);
|
|
4177
5341
|
}
|
|
4178
|
-
setToast(__assign({ isVisible: true }, options));
|
|
5342
|
+
setToast(__assign$1({ isVisible: true }, options));
|
|
4179
5343
|
var duration = options.duration === undefined ? 3000 : options.duration;
|
|
4180
5344
|
if (duration > 0) {
|
|
4181
5345
|
timerRef.current = setTimeout(function () {
|
|
@@ -4219,4 +5383,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
4219
5383
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
4220
5384
|
};
|
|
4221
5385
|
|
|
4222
|
-
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, Wizard, WizardNavigation, WizardSidebar, defaultTranslations$3 as defaultTranslations, sizeMap, themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|
|
5386
|
+
export { AddHolidayForm, AnalyticsCard, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button$1 as Button, Card, Chip, ColorSelector, DatePicker, DateRangePicker, DateSelector, DrawerFilters, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType$1 as HolidayType, IconComponent$1 as IconComponent, ImagePreview, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, Wizard, WizardNavigation, WizardSidebar, defaultTranslations$3 as defaultTranslations, sizeMap$1 as sizeMap, themeColors$1 as themeColors, useAuraToast, useNavigationLoading, useThemeContext };
|