@beweco/aurora-ui 0.1.3 → 0.1.4
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 +1096 -210
- package/dist/index.esm.js +1084 -216
- package/dist/types/components/add-holiday-form/AddHolidayForm.d.ts +10 -0
- package/dist/types/components/add-holiday-form/AddHolidayForm.d.ts.map +1 -0
- package/dist/types/components/add-holiday-form/AddHolidayForm.types.d.ts +56 -0
- package/dist/types/components/add-holiday-form/AddHolidayForm.types.d.ts.map +1 -0
- package/dist/types/components/add-holiday-form/index.d.ts +3 -0
- package/dist/types/components/add-holiday-form/index.d.ts.map +1 -0
- package/dist/types/components/button/Button.types.d.ts +1 -1
- package/dist/types/components/button/Button.types.d.ts.map +1 -1
- package/dist/types/components/datepicker/DatePicker.d.ts +4 -0
- package/dist/types/components/datepicker/DatePicker.d.ts.map +1 -0
- package/dist/types/components/datepicker/DatePicker.types.d.ts +5 -0
- package/dist/types/components/datepicker/DatePicker.types.d.ts.map +1 -0
- package/dist/types/components/datepicker/index.d.ts +3 -0
- package/dist/types/components/datepicker/index.d.ts.map +1 -0
- package/dist/types/components/daterangepicker/DateRangePicker.d.ts +5 -0
- package/dist/types/components/daterangepicker/DateRangePicker.d.ts.map +1 -0
- package/dist/types/components/daterangepicker/DateRangePicker.types.d.ts +5 -0
- package/dist/types/components/daterangepicker/DateRangePicker.types.d.ts.map +1 -0
- package/dist/types/components/daterangepicker/index.d.ts +3 -0
- package/dist/types/components/daterangepicker/index.d.ts.map +1 -0
- package/dist/types/components/input/Input.d.ts.map +1 -1
- package/dist/types/components/modal/Modal.d.ts +5 -0
- package/dist/types/components/modal/Modal.d.ts.map +1 -0
- package/dist/types/components/modal/Modal.types.d.ts +4 -0
- package/dist/types/components/modal/Modal.types.d.ts.map +1 -0
- package/dist/types/components/modal/_internal/ModalBody.d.ts +3 -0
- package/dist/types/components/modal/_internal/ModalBody.d.ts.map +1 -0
- package/dist/types/components/modal/_internal/ModalContent.d.ts +6 -0
- package/dist/types/components/modal/_internal/ModalContent.d.ts.map +1 -0
- package/dist/types/components/modal/_internal/ModalFooter.d.ts +3 -0
- package/dist/types/components/modal/_internal/ModalFooter.d.ts.map +1 -0
- package/dist/types/components/modal/_internal/ModalHeader.d.ts +3 -0
- package/dist/types/components/modal/_internal/ModalHeader.d.ts.map +1 -0
- package/dist/types/components/modal/_internal/index.d.ts +5 -0
- package/dist/types/components/modal/_internal/index.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +4 -0
- package/dist/types/components/modal/index.d.ts.map +1 -0
- package/dist/types/components/pagination/Pagination.d.ts +5 -0
- package/dist/types/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/types/components/pagination/Pagination.types.d.ts +4 -0
- package/dist/types/components/pagination/Pagination.types.d.ts.map +1 -0
- package/dist/types/components/pagination/index.d.ts +3 -0
- package/dist/types/components/pagination/index.d.ts.map +1 -0
- package/dist/types/components/schedule-row/index.d.ts +3 -0
- package/dist/types/components/schedule-row/index.d.ts.map +1 -0
- package/dist/types/components/schedule-row/schedule-row.d.ts +14 -0
- package/dist/types/components/schedule-row/schedule-row.d.ts.map +1 -0
- package/dist/types/components/schedule-row/schedule-row.types.d.ts +68 -0
- package/dist/types/components/schedule-row/schedule-row.types.d.ts.map +1 -0
- package/dist/types/components/switch/Switch.d.ts +4 -0
- package/dist/types/components/switch/Switch.d.ts.map +1 -0
- package/dist/types/components/switch/Switch.types.d.ts +3 -0
- package/dist/types/components/switch/Switch.types.d.ts.map +1 -0
- package/dist/types/components/switch/index.d.ts +3 -0
- package/dist/types/components/switch/index.d.ts.map +1 -0
- package/dist/types/components/table/AuraTable.d.ts +9 -0
- package/dist/types/components/table/AuraTable.d.ts.map +1 -0
- package/dist/types/components/table/AuraTable.types.d.ts +15 -0
- package/dist/types/components/table/AuraTable.types.d.ts.map +1 -0
- package/dist/types/components/table/_internal/TableBody.d.ts +5 -0
- package/dist/types/components/table/_internal/TableBody.d.ts.map +1 -0
- package/dist/types/components/table/_internal/TableCell.d.ts +4 -0
- package/dist/types/components/table/_internal/TableCell.d.ts.map +1 -0
- package/dist/types/components/table/_internal/TableColumn.d.ts +5 -0
- package/dist/types/components/table/_internal/TableColumn.d.ts.map +1 -0
- package/dist/types/components/table/_internal/TableHeader.d.ts +5 -0
- package/dist/types/components/table/_internal/TableHeader.d.ts.map +1 -0
- package/dist/types/components/table/_internal/TableRow.d.ts +4 -0
- package/dist/types/components/table/_internal/TableRow.d.ts.map +1 -0
- package/dist/types/components/table/_internal/index.d.ts +7 -0
- package/dist/types/components/table/_internal/index.d.ts.map +1 -0
- package/dist/types/components/table/index.d.ts +3 -0
- package/dist/types/components/table/index.d.ts.map +1 -0
- package/dist/types/components/textarea/Textarea.d.ts +7 -0
- package/dist/types/components/textarea/Textarea.d.ts.map +1 -0
- package/dist/types/components/textarea/Textarea.types.d.ts +3 -0
- package/dist/types/components/textarea/Textarea.types.d.ts.map +1 -0
- package/dist/types/components/textarea/index.d.ts +3 -0
- package/dist/types/components/textarea/index.d.ts.map +1 -0
- package/dist/types/components/time-input/TimeInput.d.ts +7 -0
- package/dist/types/components/time-input/TimeInput.d.ts.map +1 -0
- package/dist/types/components/time-input/TimeInput.types.d.ts +5 -0
- package/dist/types/components/time-input/TimeInput.types.d.ts.map +1 -0
- package/dist/types/components/time-input/index.d.ts +3 -0
- package/dist/types/components/time-input/index.d.ts.map +1 -0
- package/dist/types/components/toast/GlobalToast.d.ts +2 -0
- package/dist/types/components/toast/GlobalToast.d.ts.map +1 -0
- package/dist/types/components/toast/index.d.ts +2 -0
- package/dist/types/components/toast/index.d.ts.map +1 -0
- package/dist/types/contexts/theme/index.d.ts +2 -2
- package/dist/types/contexts/theme/index.d.ts.map +1 -1
- package/dist/types/contexts/theme/theme-context.d.ts.map +1 -1
- package/dist/types/contexts/theme/theme-context.type.d.ts +6 -3
- package/dist/types/contexts/theme/theme-context.type.d.ts.map +1 -1
- package/dist/types/contexts/toast/index.d.ts +3 -0
- package/dist/types/contexts/toast/index.d.ts.map +1 -0
- package/dist/types/contexts/toast/toast.context.d.ts +4 -0
- package/dist/types/contexts/toast/toast.context.d.ts.map +1 -0
- package/dist/types/contexts/toast/toast.context.type.d.ts +15 -0
- package/dist/types/contexts/toast/toast.context.type.d.ts.map +1 -0
- package/dist/types/index.d.ts +20 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/providers/theme/theme-provider.d.ts +10 -2
- package/dist/types/providers/theme/theme-provider.d.ts.map +1 -1
- package/dist/types/providers/theme/theme-provider.types.d.ts +8 -0
- package/dist/types/providers/theme/theme-provider.types.d.ts.map +1 -1
- package/dist/types/providers/theme/theme.utils.d.ts +5 -0
- package/dist/types/providers/theme/theme.utils.d.ts.map +1 -0
- package/dist/types/providers/theme/useThemeManager.d.ts +12 -0
- package/dist/types/providers/theme/useThemeManager.d.ts.map +1 -0
- package/dist/types/providers/toast/index.d.ts +2 -0
- package/dist/types/providers/toast/index.d.ts.map +1 -0
- package/dist/types/providers/toast/toast-provider.d.ts +7 -0
- package/dist/types/providers/toast/toast-provider.d.ts.map +1 -0
- package/dist/types/styles/colors.default.d.ts +385 -74
- package/dist/types/styles/colors.default.d.ts.map +1 -1
- package/dist/types/types/calendar.types.d.ts +12 -0
- package/dist/types/types/calendar.types.d.ts.map +1 -0
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Autocomplete, cn, ListboxItem, Popover, PopoverTrigger, Tooltip, PopoverContent, Listbox, Accordion, AccordionItem, ListboxSection, Spacer, Avatar, Card as Card$1, CardBody, CardFooter,
|
|
1
|
+
import { Autocomplete, Button as Button$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, Input as Input$1, RadioGroup, Radio, cn, ListboxItem, Popover, PopoverTrigger, Tooltip, PopoverContent, Listbox, Accordion, AccordionItem, ListboxSection, Spacer, Avatar, Card as Card$1, CardBody, CardFooter, Select as Select$1, Switch as Switch$1, TimeInput as TimeInput$1, Chip, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Textarea as Textarea$1, Dropdown, DropdownTrigger, DropdownMenu, DropdownSection, DropdownItem, Alert, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, Slider, ModalFooter as ModalFooter$1, Pagination as Pagination$1 } from '@heroui/react';
|
|
2
2
|
export * from '@heroui/react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import React, { useId, useState,
|
|
4
|
+
import React, { useId, useState, useCallback, createElement, useRef, useEffect, createContext, useContext, useMemo } from 'react';
|
|
5
5
|
import { Icon } from '@iconify/react';
|
|
6
6
|
import { useTheme } from '@heroui/use-theme';
|
|
7
7
|
|
|
@@ -45,6 +45,16 @@ function __rest(s, e) {
|
|
|
45
45
|
return t;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
function __spreadArray(to, from, pack) {
|
|
49
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
+
if (ar || !(i in from)) {
|
|
51
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
+
ar[i] = from[i];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
49
59
|
var e = new Error(message);
|
|
50
60
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -69,6 +79,48 @@ var AutoComplete = function (_a) {
|
|
|
69
79
|
} }))] }));
|
|
70
80
|
};
|
|
71
81
|
|
|
82
|
+
var HolidayType;
|
|
83
|
+
(function (HolidayType) {
|
|
84
|
+
HolidayType["SingleDay"] = "singleDay";
|
|
85
|
+
HolidayType["DateRange"] = "dateRange";
|
|
86
|
+
})(HolidayType || (HolidayType = {}));
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Botón genérico basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
90
|
+
*
|
|
91
|
+
* Reglas aplicadas:
|
|
92
|
+
* - Variant: Solid, Bordered, Light, Flat, Faded
|
|
93
|
+
* - Size: sm, md, lg
|
|
94
|
+
* - StartContent: On, Off
|
|
95
|
+
* - isLoading: On, Off
|
|
96
|
+
* - Radius: md (por defecto)
|
|
97
|
+
* - isIconOnly: True, False
|
|
98
|
+
*/
|
|
99
|
+
var Button = function (_a) {
|
|
100
|
+
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"]);
|
|
101
|
+
return (jsx(Button$1, __assign({}, props, { color: color, size: size, variant: variant, radius: radius, startContent: startContent, endContent: endContent, isLoading: isLoading, isIconOnly: isIconOnly })));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var DatePicker = function (_a) {
|
|
105
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["label", "id", "size"]);
|
|
106
|
+
var generatedId = useId();
|
|
107
|
+
var autoId = id || generatedId;
|
|
108
|
+
return (jsx(DatePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
109
|
+
label: "text-sm font-medium text-default-600",
|
|
110
|
+
segment: "focus:bg-primary-50",
|
|
111
|
+
}, id: autoId }, props)));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var DateRangePicker = function (_a) {
|
|
115
|
+
var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["label", "id", "size"]);
|
|
116
|
+
var generatedId = useId();
|
|
117
|
+
var autoId = id || generatedId;
|
|
118
|
+
return (jsx(DateRangePicker$1, __assign({ label: label, size: size, labelPlacement: "outside", classNames: {
|
|
119
|
+
label: "text-sm font-medium text-default-600",
|
|
120
|
+
segment: "focus:bg-primary-50",
|
|
121
|
+
} }, props, { id: autoId })));
|
|
122
|
+
};
|
|
123
|
+
|
|
72
124
|
var sizeMap = {
|
|
73
125
|
sm: "16px",
|
|
74
126
|
md: "20px",
|
|
@@ -82,6 +134,109 @@ var IconComponent = function (_a) {
|
|
|
82
134
|
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 }) })));
|
|
83
135
|
};
|
|
84
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Input genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
139
|
+
*
|
|
140
|
+
* Reglas aplicadas:
|
|
141
|
+
* - Variant: Bordered (por defecto)
|
|
142
|
+
* - labelPlacement: Outside
|
|
143
|
+
* - Size: sm, md, lg (configurable)
|
|
144
|
+
* - Radius configurable
|
|
145
|
+
*/
|
|
146
|
+
var Input = function (_a) {
|
|
147
|
+
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"]);
|
|
148
|
+
var generatedId = useId();
|
|
149
|
+
var inputId = id || generatedId;
|
|
150
|
+
return (jsx(Input$1, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
151
|
+
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
152
|
+
inputWrapper: "focus-within:!border-primary-500",
|
|
153
|
+
} })));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
var defaultTranslations$3 = {
|
|
157
|
+
addHolidayTitle: "Add holiday",
|
|
158
|
+
dayOption: "Day",
|
|
159
|
+
dateRangeOption: "Date range",
|
|
160
|
+
selectDateRangeAriaLabel: "Select date range",
|
|
161
|
+
selectDateAriaLabel: "Select date",
|
|
162
|
+
optionalTitle: "Title (optional)",
|
|
163
|
+
titlePlaceholder: "e.g., Summer vacation",
|
|
164
|
+
addButton: "Add",
|
|
165
|
+
};
|
|
166
|
+
var INITIAL_HOLIDAY_STATE = {
|
|
167
|
+
type: HolidayType.SingleDay,
|
|
168
|
+
startDate: null,
|
|
169
|
+
endDate: null,
|
|
170
|
+
title: "",
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* A form component for adding single or date-range holidays.
|
|
174
|
+
* It includes options for setting a date or a date range, an optional title,
|
|
175
|
+
* and handles form submission and state reset.
|
|
176
|
+
* The 'Add' button is disabled until a date is selected.
|
|
177
|
+
*/
|
|
178
|
+
var AddHolidayForm = function (_a) {
|
|
179
|
+
var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
|
|
180
|
+
var t = __assign(__assign({}, defaultTranslations$3), translations);
|
|
181
|
+
var _b = useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
|
|
182
|
+
/**
|
|
183
|
+
* A boolean flag that determines if a date has been set.
|
|
184
|
+
* For a single day, it checks if `startDate` is not null.
|
|
185
|
+
* For a date range, it checks if both `startDate` and `endDate` are not null.
|
|
186
|
+
*/
|
|
187
|
+
var isDateSet = newHoliday.type === HolidayType.SingleDay
|
|
188
|
+
? newHoliday.startDate !== null
|
|
189
|
+
: newHoliday.startDate !== null && newHoliday.endDate !== null;
|
|
190
|
+
/**
|
|
191
|
+
* Resets the form to its initial state.
|
|
192
|
+
*/
|
|
193
|
+
var resetForm = useCallback(function () {
|
|
194
|
+
setNewHoliday(INITIAL_HOLIDAY_STATE);
|
|
195
|
+
}, []);
|
|
196
|
+
/**
|
|
197
|
+
* Handles changes to the single date picker.
|
|
198
|
+
* @param date The selected date.
|
|
199
|
+
*/
|
|
200
|
+
var handleDateChange = useCallback(function (date) {
|
|
201
|
+
setNewHoliday(function (prev) { return (__assign(__assign({}, prev), { startDate: date, endDate: null })); });
|
|
202
|
+
}, []);
|
|
203
|
+
/**
|
|
204
|
+
* Handles changes to the date range picker.
|
|
205
|
+
* @param range The selected date range.
|
|
206
|
+
*/
|
|
207
|
+
var handleDateRangeChange = useCallback(function (range) {
|
|
208
|
+
setNewHoliday(function (prev) {
|
|
209
|
+
var _a, _b;
|
|
210
|
+
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 }));
|
|
211
|
+
});
|
|
212
|
+
}, []);
|
|
213
|
+
/**
|
|
214
|
+
* Handles the submission of the form.
|
|
215
|
+
* If a date is set, it calls the `onAddHoliday` callback and resets the form.
|
|
216
|
+
*/
|
|
217
|
+
var handleAddHoliday = useCallback(function () {
|
|
218
|
+
var _a;
|
|
219
|
+
// biome-ignore lint/complexity/useSimplifiedLogicExpression: <explanation>
|
|
220
|
+
if (!isDateSet || !newHoliday.startDate) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
onAddHoliday({
|
|
224
|
+
type: newHoliday.type,
|
|
225
|
+
title: newHoliday.title,
|
|
226
|
+
startDate: newHoliday.startDate.toDate("UTC"),
|
|
227
|
+
endDate: (_a = newHoliday.endDate) === null || _a === void 0 ? void 0 : _a.toDate("UTC"),
|
|
228
|
+
});
|
|
229
|
+
resetForm();
|
|
230
|
+
}, [newHoliday, onAddHoliday, resetForm, isDateSet]);
|
|
231
|
+
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) {
|
|
232
|
+
return setNewHoliday(__assign(__assign({}, INITIAL_HOLIDAY_STATE), { type: value }));
|
|
233
|
+
} }, 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
|
|
234
|
+
? { start: newHoliday.startDate, end: newHoliday.endDate }
|
|
235
|
+
: 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) {
|
|
236
|
+
setNewHoliday(function (prev) { return (__assign(__assign({}, prev), { title: value })); });
|
|
237
|
+
}, "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 })) })] }));
|
|
238
|
+
};
|
|
239
|
+
|
|
85
240
|
function normalizeClass(value) {
|
|
86
241
|
if (typeof value === "string") {
|
|
87
242
|
return value || undefined;
|
|
@@ -370,7 +525,7 @@ var Phone = function (_a) {
|
|
|
370
525
|
onChange(selectedCountry.code + val);
|
|
371
526
|
}
|
|
372
527
|
};
|
|
373
|
-
return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-
|
|
528
|
+
return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-600 mb-1", children: [finalLabel, " ", required && jsx("span", { className: "text-pink-600", children: "*" })] })), jsxs("div", { className: "flex items-center w-full min-h-[56px] bg-white dark:bg-gray-900 transition-colors shadow-sm border border-[#E4E4E7] dark:border-gray-700 rounded-2xl focus-within:border-blue-500 dark:focus-within:border-blue-400 ".concat(error
|
|
374
529
|
? "border-pink-500 dark:border-pink-600"
|
|
375
530
|
: "border-[#E4E4E7] dark:border-gray-700").concat(disabled ? " bg-gray-100 dark:bg-gray-800 opacity-60" : ""), children: [jsxs("div", { className: "relative ml-2", ref: dropdownRef, children: [jsxs("button", { type: "button",
|
|
376
531
|
///bg-gray-100
|
|
@@ -386,6 +541,321 @@ var Phone = function (_a) {
|
|
|
386
541
|
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsx("span", { className: "flex-1 text-left dark:text-gray-100", children: country.name }), jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: country.code })] }, country.code)); })) : (jsx("div", { className: "px-4 py-2 text-sm text-gray-500 dark:text-gray-400", children: t.noCountriesFound })) })] }))] }), jsx(Input$1, { type: "tel", className: "flex-1 border-none bg-transparent text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 h-10 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsx("span", { className: "text-xs text-pink-600 dark:text-pink-400 mt-1", children: errorText }))] }));
|
|
387
542
|
};
|
|
388
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
546
|
+
*
|
|
547
|
+
* Reglas aplicadas:
|
|
548
|
+
* - Variant: Bordered (por defecto)
|
|
549
|
+
* - Radius: md (por defecto)
|
|
550
|
+
* - labelPlacement: Outside
|
|
551
|
+
* - Size: sm, md, lg (configurable)
|
|
552
|
+
*/
|
|
553
|
+
var Select = function (_a) {
|
|
554
|
+
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"]);
|
|
555
|
+
var generatedId = useId();
|
|
556
|
+
var selectId = id || generatedId;
|
|
557
|
+
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: {
|
|
558
|
+
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
559
|
+
trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
|
|
560
|
+
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",
|
|
561
|
+
} })) }));
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
|
|
565
|
+
return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
|
|
566
|
+
}
|
|
567
|
+
function $14e0f24ef4ac5c92$var$timeToMs(a) {
|
|
568
|
+
return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
|
|
572
|
+
let inverseDuration = {};
|
|
573
|
+
for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
|
|
574
|
+
return inverseDuration;
|
|
575
|
+
}
|
|
576
|
+
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
|
|
577
|
+
let mutableValue = value.copy();
|
|
578
|
+
if (fields.hour != null) mutableValue.hour = fields.hour;
|
|
579
|
+
if (fields.minute != null) mutableValue.minute = fields.minute;
|
|
580
|
+
if (fields.second != null) mutableValue.second = fields.second;
|
|
581
|
+
if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
|
|
582
|
+
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
|
|
583
|
+
return mutableValue;
|
|
584
|
+
}
|
|
585
|
+
function $735220c2d4774dd3$var$balanceTime(time) {
|
|
586
|
+
time.second += Math.floor(time.millisecond / 1000);
|
|
587
|
+
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
|
|
588
|
+
time.minute += Math.floor(time.second / 60);
|
|
589
|
+
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
|
|
590
|
+
time.hour += Math.floor(time.minute / 60);
|
|
591
|
+
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
|
|
592
|
+
let days = Math.floor(time.hour / 24);
|
|
593
|
+
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
|
|
594
|
+
return days;
|
|
595
|
+
}
|
|
596
|
+
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
|
|
597
|
+
time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
|
|
598
|
+
time.second = Math.max(0, Math.min(time.second, 59));
|
|
599
|
+
time.minute = Math.max(0, Math.min(time.minute, 59));
|
|
600
|
+
time.hour = Math.max(0, Math.min(time.hour, 23));
|
|
601
|
+
}
|
|
602
|
+
function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
|
|
603
|
+
let result = a % b;
|
|
604
|
+
if (result < 0) result += b;
|
|
605
|
+
return result;
|
|
606
|
+
}
|
|
607
|
+
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
|
|
608
|
+
time.hour += duration.hours || 0;
|
|
609
|
+
time.minute += duration.minutes || 0;
|
|
610
|
+
time.second += duration.seconds || 0;
|
|
611
|
+
time.millisecond += duration.milliseconds || 0;
|
|
612
|
+
return $735220c2d4774dd3$var$balanceTime(time);
|
|
613
|
+
}
|
|
614
|
+
function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
|
|
615
|
+
let res = time.copy();
|
|
616
|
+
$735220c2d4774dd3$var$addTimeFields(res, duration);
|
|
617
|
+
return res;
|
|
618
|
+
}
|
|
619
|
+
function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
|
|
620
|
+
return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
621
|
+
}
|
|
622
|
+
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
|
|
623
|
+
let mutable = value.copy();
|
|
624
|
+
switch(field){
|
|
625
|
+
case 'hour':
|
|
626
|
+
{
|
|
627
|
+
let hours = value.hour;
|
|
628
|
+
let min = 0;
|
|
629
|
+
let max = 23;
|
|
630
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
631
|
+
let isPM = hours >= 12;
|
|
632
|
+
min = isPM ? 12 : 0;
|
|
633
|
+
max = isPM ? 23 : 11;
|
|
634
|
+
}
|
|
635
|
+
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
case 'minute':
|
|
639
|
+
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
640
|
+
break;
|
|
641
|
+
case 'second':
|
|
642
|
+
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
643
|
+
break;
|
|
644
|
+
case 'millisecond':
|
|
645
|
+
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
|
|
646
|
+
break;
|
|
647
|
+
default:
|
|
648
|
+
throw new Error('Unsupported field ' + field);
|
|
649
|
+
}
|
|
650
|
+
return mutable;
|
|
651
|
+
}
|
|
652
|
+
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
|
|
653
|
+
if (round) {
|
|
654
|
+
value += Math.sign(amount);
|
|
655
|
+
if (value < min) value = max;
|
|
656
|
+
let div = Math.abs(amount);
|
|
657
|
+
if (amount > 0) value = Math.ceil(value / div) * div;
|
|
658
|
+
else value = Math.floor(value / div) * div;
|
|
659
|
+
if (value > max) value = min;
|
|
660
|
+
} else {
|
|
661
|
+
value += amount;
|
|
662
|
+
if (value < min) value = max - (min - value - 1);
|
|
663
|
+
else if (value > max) value = min + (value - max - 1);
|
|
664
|
+
}
|
|
665
|
+
return value;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
|
|
669
|
+
return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
673
|
+
if (privateCollection.has(obj)) {
|
|
674
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
679
|
+
_check_private_redeclaration(obj, privateMap);
|
|
680
|
+
privateMap.set(obj, value);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
var // This prevents TypeScript from allowing other types with the same fields to match.
|
|
684
|
+
// @ts-ignore
|
|
685
|
+
$35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
|
|
686
|
+
class $35ea8db9cb2ccb90$export$680ea196effce5f {
|
|
687
|
+
/** Returns a copy of this time. */ copy() {
|
|
688
|
+
return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
|
|
689
|
+
}
|
|
690
|
+
/** Returns a new `Time` with the given duration added to it. */ add(duration) {
|
|
691
|
+
return ($735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
|
|
692
|
+
}
|
|
693
|
+
/** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
|
|
694
|
+
return ($735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
|
|
695
|
+
}
|
|
696
|
+
/** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
|
|
697
|
+
return ($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Returns a new `Time` with the given field adjusted by a specified amount.
|
|
701
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
702
|
+
*/ cycle(field, amount, options) {
|
|
703
|
+
return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
|
|
704
|
+
}
|
|
705
|
+
/** Converts the time to an ISO 8601 formatted string. */ toString() {
|
|
706
|
+
return ($fae977aafc393c5c$export$f59dee82248f5ad4)(this);
|
|
707
|
+
}
|
|
708
|
+
/** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
|
|
709
|
+
return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
|
|
710
|
+
}
|
|
711
|
+
constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
|
|
712
|
+
(_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type1, {
|
|
713
|
+
writable: true,
|
|
714
|
+
value: void 0
|
|
715
|
+
});
|
|
716
|
+
this.hour = hour;
|
|
717
|
+
this.minute = minute;
|
|
718
|
+
this.second = second;
|
|
719
|
+
this.millisecond = millisecond;
|
|
720
|
+
($735220c2d4774dd3$export$7555de1e070510cb)(this);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
var Switch = function (_a) {
|
|
725
|
+
var id = _a.id, props = __rest(_a, ["id"]);
|
|
726
|
+
var generatedId = useId();
|
|
727
|
+
var autoId = id || generatedId;
|
|
728
|
+
return jsx(Switch$1, __assign({}, props, { id: autoId }));
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
733
|
+
*/
|
|
734
|
+
var TimeInput = function (_a) {
|
|
735
|
+
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"]);
|
|
736
|
+
var generatedId = useId();
|
|
737
|
+
var autoId = id || generatedId;
|
|
738
|
+
return (jsx(TimeInput$1, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
|
|
739
|
+
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
740
|
+
inputWrapper: "focus-within:!border-primary-500",
|
|
741
|
+
} })));
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* @component ScheduleRow
|
|
746
|
+
* @description A React component for managing the schedule of a single day.
|
|
747
|
+
* It allows users to open or close the schedule, add or remove time slots,
|
|
748
|
+
* and modify the start and end times of each slot. The component is fully
|
|
749
|
+
* controlled and reports changes to the parent via the `onChange` callback.
|
|
750
|
+
*
|
|
751
|
+
* @param {ScheduleRowProps} props - The props for the component.
|
|
752
|
+
* @returns {React.ReactElement} The rendered ScheduleRow component.
|
|
753
|
+
*/
|
|
754
|
+
var ScheduleRow = function (_a) {
|
|
755
|
+
var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
|
|
756
|
+
/**
|
|
757
|
+
* @function validateTimeSlots
|
|
758
|
+
* @description Validates all time slots to ensure the "from" time is not after the "to" time.
|
|
759
|
+
* @param {TimeSlot[]} timeSlots - The array of time slots to validate.
|
|
760
|
+
* @returns {TimeSlot[]} The updated array of time slots with error messages if any.
|
|
761
|
+
*/
|
|
762
|
+
var validateTimeSlots = function (timeSlots) {
|
|
763
|
+
return timeSlots.map(function (slot) {
|
|
764
|
+
if (slot.from && slot.to) {
|
|
765
|
+
var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
|
|
766
|
+
var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
|
|
767
|
+
if (fromTime.compare(toTime) > 0) {
|
|
768
|
+
return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return __assign(__assign({}, slot), { error: null });
|
|
772
|
+
});
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* @function toTimeValue
|
|
776
|
+
* @description Converts a time string (e.g., "09:00") to a `TimeValue` object
|
|
777
|
+
* required by the `TimeInput` component.
|
|
778
|
+
* @param {string} time - The time string to convert.
|
|
779
|
+
* @returns {TimeValue | null} The corresponding `TimeValue` object, or `null` if the input is empty.
|
|
780
|
+
*/
|
|
781
|
+
var toTimeValue = function (time) {
|
|
782
|
+
if (!time) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
var _a = time.split(":").map(Number), hour = _a[0], minute = _a[1];
|
|
786
|
+
return new $35ea8db9cb2ccb90$export$680ea196effce5f(hour, minute);
|
|
787
|
+
};
|
|
788
|
+
/**
|
|
789
|
+
* @function fromTimeValue
|
|
790
|
+
* @description Converts a `TimeValue` object back to a formatted time string (e.g., "09:00").
|
|
791
|
+
* @param {TimeValue | null} time - The `TimeValue` object to convert.
|
|
792
|
+
* @returns {string} The formatted time string.
|
|
793
|
+
*/
|
|
794
|
+
var fromTimeValue = function (time) {
|
|
795
|
+
if (!time) {
|
|
796
|
+
return "";
|
|
797
|
+
}
|
|
798
|
+
return "".concat(String(time.hour).padStart(2, "0"), ":").concat(String(time.minute).padStart(2, "0"));
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* @function handleToggleDay
|
|
802
|
+
* @description Toggles the `isOpen` status of the schedule for the day.
|
|
803
|
+
*/
|
|
804
|
+
var handleToggleDay = function () {
|
|
805
|
+
onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* @function handleTimeChange
|
|
809
|
+
* @description Updates the time for a specific time slot.
|
|
810
|
+
* @param {number} index - The index of the time slot to modify.
|
|
811
|
+
* @param {"from" | "to"} field - The field to update ("from" or "to").
|
|
812
|
+
* @param {TimeValue | null} value - The new time value from the `TimeInput` component.
|
|
813
|
+
*/
|
|
814
|
+
var handleTimeChange = function (index, field, value) {
|
|
815
|
+
var _a;
|
|
816
|
+
var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
|
|
817
|
+
newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
|
|
818
|
+
var validatedSlots = validateTimeSlots(newTimeSlots);
|
|
819
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
|
|
820
|
+
};
|
|
821
|
+
/**
|
|
822
|
+
* @function handleAddTimeSlot
|
|
823
|
+
* @description Adds a new, empty time slot to the schedule.
|
|
824
|
+
*/
|
|
825
|
+
var handleAddTimeSlot = function () {
|
|
826
|
+
var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
|
|
827
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
828
|
+
};
|
|
829
|
+
/**
|
|
830
|
+
* @function handleRemoveTimeSlot
|
|
831
|
+
* @description Removes a time slot from the schedule at the specified index.
|
|
832
|
+
* @param {number} index - The index of the time slot to remove.
|
|
833
|
+
*/
|
|
834
|
+
var handleRemoveTimeSlot = function (index) {
|
|
835
|
+
var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
|
|
836
|
+
onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
|
|
837
|
+
};
|
|
838
|
+
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, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { 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: translations.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: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
function AuraTable(_a) {
|
|
842
|
+
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
843
|
+
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)); } })] })));
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Textarea component that wraps the HeroUI TextArea component.
|
|
848
|
+
*/
|
|
849
|
+
var Textarea = function (_a) {
|
|
850
|
+
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"]);
|
|
851
|
+
var generatedId = useId();
|
|
852
|
+
var autoId = id || generatedId;
|
|
853
|
+
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: {
|
|
854
|
+
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
855
|
+
inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
|
|
856
|
+
} })));
|
|
857
|
+
};
|
|
858
|
+
|
|
389
859
|
// Traducciones por defecto en español según las reglas de diseño
|
|
390
860
|
var defaultTranslations$1 = {
|
|
391
861
|
lightTheme: "Claro",
|
|
@@ -427,6 +897,46 @@ var ThemePicker = function (_a) {
|
|
|
427
897
|
return (jsx(RadioGroup, { value: value, onChange: function (e) { return onChange(e.target.value); }, className: "flex gap-6 w-full ".concat(className || ""), style: { gap: 16 }, children: themes.map(function (theme) { return (jsxs("div", { className: "relative rounded-[14px] ".concat(theme.cardClass, " p-6 w-1/2 min-h-[180px] transition-all duration-200 flex flex-col justify-start"), children: [jsx("div", { className: "absolute top-6 right-6", children: jsx(Radio, { "aria-label": theme.label, color: theme.radioColor, size: "sm", value: theme.key }) }), jsx("span", { className: theme.labelClass, children: theme.label }), theme.previewContent] }, theme.key)); }) }));
|
|
428
898
|
};
|
|
429
899
|
|
|
900
|
+
var ConfigMenu = function (_a) {
|
|
901
|
+
var _b;
|
|
902
|
+
var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
|
|
903
|
+
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: {
|
|
904
|
+
base: "text-default-500",
|
|
905
|
+
}, 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: {
|
|
906
|
+
base: "text-default-500",
|
|
907
|
+
}, 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") })] })] }));
|
|
908
|
+
};
|
|
909
|
+
ConfigMenu.displayName = "ConfigMenu";
|
|
910
|
+
|
|
911
|
+
var NotificationButton = function (_a) {
|
|
912
|
+
var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
|
|
913
|
+
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 })) }));
|
|
914
|
+
};
|
|
915
|
+
NotificationButton.displayName = "NotificationButton";
|
|
916
|
+
|
|
917
|
+
var HeaderComponent = function (_a) {
|
|
918
|
+
var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
|
|
919
|
+
return (jsxs("header", { className: "header__container", children: [jsx(Button$1, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(NotificationButton, { notificationCount: notificationCount }), jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
|
|
920
|
+
};
|
|
921
|
+
HeaderComponent.displayName = "Header";
|
|
922
|
+
|
|
923
|
+
var ToastContext = createContext(undefined);
|
|
924
|
+
var useAuraToast = function () {
|
|
925
|
+
var context = useContext(ToastContext);
|
|
926
|
+
if (!context) {
|
|
927
|
+
throw new Error("useAuraToast must be used within a AuraToastProvider");
|
|
928
|
+
}
|
|
929
|
+
return context;
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
function GlobalToast() {
|
|
933
|
+
var _a = useAuraToast(), toast = _a.toast, hideToast = _a.hideToast;
|
|
934
|
+
if (!toast.isVisible) {
|
|
935
|
+
return null;
|
|
936
|
+
}
|
|
937
|
+
return (jsx("div", { className: "fixed top-4 right-4 z-50 w-full max-w-sm", children: jsx(Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
|
|
938
|
+
}
|
|
939
|
+
|
|
430
940
|
// Traducciones por defecto en español
|
|
431
941
|
var defaultTranslations = {
|
|
432
942
|
uploadText: "Da clic y selecciona tus archivos",
|
|
@@ -701,11 +1211,11 @@ var ImageCropModal = function (_a) {
|
|
|
701
1211
|
window.removeEventListener("resize", handleResize);
|
|
702
1212
|
};
|
|
703
1213
|
}, [isOpen, updateCanvasSize]);
|
|
704
|
-
return (jsx(Modal, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
|
|
1214
|
+
return (jsx(Modal$1, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
|
|
705
1215
|
backdrop: "bg-black/80",
|
|
706
1216
|
wrapper: "p-0 sm:p-4",
|
|
707
1217
|
base: "m-0 sm:m-4 max-h-screen sm:max-h-[90vh] w-full sm:w-auto",
|
|
708
|
-
}, children: jsxs(ModalContent, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxs(ModalHeader, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsx(ModalBody, { className: "px-4 sm:px-6 py-4", children: jsxs("div", { className: "flex flex-col gap-4", children: [jsx("div", { className: "flex justify-center overflow-hidden", children: jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsx(Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
|
|
1218
|
+
}, children: jsxs(ModalContent$1, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxs(ModalHeader$1, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsx(ModalBody$1, { className: "px-4 sm:px-6 py-4", children: jsxs("div", { className: "flex flex-col gap-4", children: [jsx("div", { className: "flex justify-center overflow-hidden", children: jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsx(Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
|
|
709
1219
|
{ value: -1, label: "Out" },
|
|
710
1220
|
{ value: 0, label: "0" },
|
|
711
1221
|
{ value: 1, label: "In" },
|
|
@@ -719,7 +1229,7 @@ var ImageCropModal = function (_a) {
|
|
|
719
1229
|
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%)",
|
|
720
1230
|
backgroundSize: "8px 8px",
|
|
721
1231
|
backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
|
|
722
|
-
} }), jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxs(ModalFooter, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsx(Button$1, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsx(Button$1, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
|
|
1232
|
+
} }), jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxs(ModalFooter$1, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsx(Button$1, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsx(Button$1, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
|
|
723
1233
|
};
|
|
724
1234
|
/**
|
|
725
1235
|
* Componente de previsualización de archivo
|
|
@@ -903,65 +1413,43 @@ var UploadFile = function (_a) {
|
|
|
903
1413
|
onUpload([]);
|
|
904
1414
|
};
|
|
905
1415
|
// Clases CSS dinámicas usando Tailwind
|
|
906
|
-
var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-
|
|
907
|
-
? "border-
|
|
1416
|
+
var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
|
|
1417
|
+
? "border-primary-500 bg-primary-50 dark:bg-primary-900"
|
|
908
1418
|
: error
|
|
909
|
-
? "border-
|
|
1419
|
+
? "border-danger-500 bg-danger-50 dark:bg-danger-950"
|
|
910
1420
|
: success
|
|
911
|
-
? "border-
|
|
1421
|
+
? "border-success-500 bg-success-50 dark:bg-success-950"
|
|
912
1422
|
: disabled
|
|
913
1423
|
? "border-gray-300 bg-gray-100 dark:bg-gray-800"
|
|
914
|
-
: "border-gray-300 hover:border-gray-400 bg-
|
|
1424
|
+
: "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
|
|
915
1425
|
.trim()
|
|
916
1426
|
.replace(/\s+/g, " ");
|
|
917
|
-
var textClasses = "\n\t\ttext-
|
|
918
|
-
var subTextClasses = "\n\t\ttext-
|
|
919
|
-
return (jsxs("div", { className: "relative", children: [jsx(Card$1, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxs(CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative", 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
|
|
1427
|
+
var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
|
|
1428
|
+
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");
|
|
1429
|
+
return (jsxs("div", { className: "relative", children: [jsx(Card$1, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxs(CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", 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
|
|
920
1430
|
? "opacity-0"
|
|
921
|
-
: "opacity-100 transition-opacity", children: jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxs("div", { className: "
|
|
1431
|
+
: "opacity-100 transition-opacity", children: jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxs("div", { className: "text-center px-2", children: [jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
|
|
922
1432
|
? acceptedFiles.join(",")
|
|
923
1433
|
: acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
|
|
924
1434
|
};
|
|
925
1435
|
UploadFile.displayName = "UploadFile";
|
|
926
1436
|
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
|
|
930
|
-
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-50 data-[hover=true]:text-default-700", classNames: {
|
|
931
|
-
base: "text-default-500",
|
|
932
|
-
}, 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-50 data-[hover=true]:text-default-700", classNames: {
|
|
933
|
-
base: "text-default-500",
|
|
934
|
-
}, 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") })] })] }));
|
|
1437
|
+
var Pagination = function (_a) {
|
|
1438
|
+
_a.size; var props = __rest(_a, ["size"]);
|
|
1439
|
+
return jsx(Pagination$1, __assign({ showControls: true, isCompact: true }, props));
|
|
935
1440
|
};
|
|
936
|
-
ConfigMenu.displayName = "ConfigMenu";
|
|
937
1441
|
|
|
938
|
-
var
|
|
939
|
-
|
|
940
|
-
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 })) }));
|
|
1442
|
+
var Modal = function (props) {
|
|
1443
|
+
return (jsx(Modal$1, __assign({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
|
|
941
1444
|
};
|
|
942
|
-
NotificationButton.displayName = "NotificationButton";
|
|
943
1445
|
|
|
944
|
-
var
|
|
945
|
-
var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
|
|
946
|
-
return (jsxs("header", { className: "header__container", children: [jsx(Button$1, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(NotificationButton, { notificationCount: notificationCount }), jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
|
|
947
|
-
};
|
|
948
|
-
HeaderComponent.displayName = "Header";
|
|
1446
|
+
var ModalContent = ModalContent$1;
|
|
949
1447
|
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
* - Size: sm, md, lg
|
|
956
|
-
* - StartContent: On, Off
|
|
957
|
-
* - isLoading: On, Off
|
|
958
|
-
* - Radius: md (por defecto)
|
|
959
|
-
* - isIconOnly: True, False
|
|
960
|
-
*/
|
|
961
|
-
var Button = function (_a) {
|
|
962
|
-
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"]);
|
|
963
|
-
return (jsx(Button$1, __assign({}, props, { color: color, size: size, variant: variant, radius: radius, startContent: startContent, endContent: endContent, isLoading: isLoading, isIconOnly: isIconOnly })));
|
|
964
|
-
};
|
|
1448
|
+
var ModalHeader = ModalHeader$1;
|
|
1449
|
+
|
|
1450
|
+
var ModalBody = ModalBody$1;
|
|
1451
|
+
|
|
1452
|
+
var ModalFooter = ModalFooter$1;
|
|
965
1453
|
|
|
966
1454
|
var paddingClasses = {
|
|
967
1455
|
sm: "p-4",
|
|
@@ -985,228 +1473,503 @@ var Card = function (_a) {
|
|
|
985
1473
|
return (jsx(Card$1, __assign({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
986
1474
|
};
|
|
987
1475
|
|
|
988
|
-
/**
|
|
989
|
-
* Input genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
990
|
-
*
|
|
991
|
-
* Reglas aplicadas:
|
|
992
|
-
* - Variant: Bordered (por defecto)
|
|
993
|
-
* - labelPlacement: Outside
|
|
994
|
-
* - Size: sm, md, lg (configurable)
|
|
995
|
-
* - Radius configurable
|
|
996
|
-
*/
|
|
997
|
-
var Input = function (_a) {
|
|
998
|
-
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"]);
|
|
999
|
-
var generatedId = useId();
|
|
1000
|
-
var inputId = id || generatedId;
|
|
1001
|
-
return (jsx(Input$1, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
|
|
1002
|
-
label: "text-default-600 text-tiny",
|
|
1003
|
-
inputWrapper: "focus-within:!border-primary-500",
|
|
1004
|
-
} })));
|
|
1005
|
-
};
|
|
1006
|
-
|
|
1007
|
-
/**
|
|
1008
|
-
* Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
|
|
1009
|
-
*
|
|
1010
|
-
* Reglas aplicadas:
|
|
1011
|
-
* - Variant: Bordered (por defecto)
|
|
1012
|
-
* - Radius: md (por defecto)
|
|
1013
|
-
* - labelPlacement: Outside
|
|
1014
|
-
* - Size: sm, md, lg (configurable)
|
|
1015
|
-
*/
|
|
1016
|
-
var Select = function (_a) {
|
|
1017
|
-
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"]);
|
|
1018
|
-
var generatedId = useId();
|
|
1019
|
-
var selectId = id || generatedId;
|
|
1020
|
-
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: {
|
|
1021
|
-
label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
|
|
1022
|
-
trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
|
|
1023
|
-
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",
|
|
1024
|
-
} })) }));
|
|
1025
|
-
};
|
|
1026
|
-
|
|
1027
1476
|
var themeColors = {
|
|
1477
|
+
"blue-light": {
|
|
1478
|
+
extend: "light",
|
|
1479
|
+
colors: {
|
|
1480
|
+
primary: {
|
|
1481
|
+
"50": "#dfedfd",
|
|
1482
|
+
"100": "#b3d4fa",
|
|
1483
|
+
"200": "#86bbf7",
|
|
1484
|
+
"300": "#59a1f4",
|
|
1485
|
+
"400": "#2d88f1",
|
|
1486
|
+
"500": "#006fee",
|
|
1487
|
+
"600": "#005cc4",
|
|
1488
|
+
"700": "#00489b",
|
|
1489
|
+
"800": "#003571",
|
|
1490
|
+
"900": "#002147",
|
|
1491
|
+
foreground: "#fff",
|
|
1492
|
+
DEFAULT: "#006fee",
|
|
1493
|
+
},
|
|
1494
|
+
secondary: {
|
|
1495
|
+
"50": "#eee4f8",
|
|
1496
|
+
"100": "#d7bfef",
|
|
1497
|
+
"200": "#bf99e5",
|
|
1498
|
+
"300": "#a773db",
|
|
1499
|
+
"400": "#904ed2",
|
|
1500
|
+
"500": "#7828c8",
|
|
1501
|
+
"600": "#6321a5",
|
|
1502
|
+
"700": "#4e1a82",
|
|
1503
|
+
"800": "#39135f",
|
|
1504
|
+
"900": "#240c3c",
|
|
1505
|
+
foreground: "#fff",
|
|
1506
|
+
DEFAULT: "#7828c8",
|
|
1507
|
+
},
|
|
1508
|
+
success: {
|
|
1509
|
+
"50": "#e2f8ec",
|
|
1510
|
+
"100": "#b9efd1",
|
|
1511
|
+
"200": "#91e5b5",
|
|
1512
|
+
"300": "#68dc9a",
|
|
1513
|
+
"400": "#40d27f",
|
|
1514
|
+
"500": "#17c964",
|
|
1515
|
+
"600": "#13a653",
|
|
1516
|
+
"700": "#0f8341",
|
|
1517
|
+
"800": "#0b5f30",
|
|
1518
|
+
"900": "#073c1e",
|
|
1519
|
+
foreground: "#000",
|
|
1520
|
+
DEFAULT: "#17c964",
|
|
1521
|
+
},
|
|
1522
|
+
warning: {
|
|
1523
|
+
"50": "#fef4e4",
|
|
1524
|
+
"100": "#fce4bd",
|
|
1525
|
+
"200": "#fad497",
|
|
1526
|
+
"300": "#f9c571",
|
|
1527
|
+
"400": "#f7b54a",
|
|
1528
|
+
"500": "#f5a524",
|
|
1529
|
+
"600": "#ca881e",
|
|
1530
|
+
"700": "#9f6b17",
|
|
1531
|
+
"800": "#744e11",
|
|
1532
|
+
"900": "#4a320b",
|
|
1533
|
+
foreground: "#000",
|
|
1534
|
+
DEFAULT: "#f5a524",
|
|
1535
|
+
},
|
|
1536
|
+
danger: {
|
|
1537
|
+
"50": "#fee1eb",
|
|
1538
|
+
"100": "#fbb8cf",
|
|
1539
|
+
"200": "#f98eb3",
|
|
1540
|
+
"300": "#f76598",
|
|
1541
|
+
"400": "#f53b7c",
|
|
1542
|
+
"500": "#f31260",
|
|
1543
|
+
"600": "#c80f4f",
|
|
1544
|
+
"700": "#9e0c3e",
|
|
1545
|
+
"800": "#73092e",
|
|
1546
|
+
"900": "#49051d",
|
|
1547
|
+
foreground: "#000",
|
|
1548
|
+
DEFAULT: "#f31260",
|
|
1549
|
+
},
|
|
1550
|
+
focus: "#006FEE",
|
|
1551
|
+
overlay: "#000000",
|
|
1552
|
+
},
|
|
1553
|
+
},
|
|
1554
|
+
"blue-dark": {
|
|
1555
|
+
extend: "dark",
|
|
1556
|
+
colors: {
|
|
1557
|
+
primary: {
|
|
1558
|
+
"50": "#002147",
|
|
1559
|
+
"100": "#003571",
|
|
1560
|
+
"200": "#00489b",
|
|
1561
|
+
"300": "#005cc4",
|
|
1562
|
+
"400": "#006fee",
|
|
1563
|
+
"500": "#2d88f1",
|
|
1564
|
+
"600": "#59a1f4",
|
|
1565
|
+
"700": "#86bbf7",
|
|
1566
|
+
"800": "#b3d4fa",
|
|
1567
|
+
"900": "#dfedfd",
|
|
1568
|
+
foreground: "#fff",
|
|
1569
|
+
DEFAULT: "#006fee",
|
|
1570
|
+
},
|
|
1571
|
+
secondary: {
|
|
1572
|
+
"50": "#240c3c",
|
|
1573
|
+
"100": "#39135f",
|
|
1574
|
+
"200": "#4e1a82",
|
|
1575
|
+
"300": "#6321a5",
|
|
1576
|
+
"400": "#7828c8",
|
|
1577
|
+
"500": "#904ed2",
|
|
1578
|
+
"600": "#a773db",
|
|
1579
|
+
"700": "#bf99e5",
|
|
1580
|
+
"800": "#d7bfef",
|
|
1581
|
+
"900": "#eee4f8",
|
|
1582
|
+
foreground: "#fff",
|
|
1583
|
+
DEFAULT: "#7828c8",
|
|
1584
|
+
},
|
|
1585
|
+
success: {
|
|
1586
|
+
"50": "#073c1e",
|
|
1587
|
+
"100": "#0b5f30",
|
|
1588
|
+
"200": "#0f8341",
|
|
1589
|
+
"300": "#13a653",
|
|
1590
|
+
"400": "#17c964",
|
|
1591
|
+
"500": "#40d27f",
|
|
1592
|
+
"600": "#68dc9a",
|
|
1593
|
+
"700": "#91e5b5",
|
|
1594
|
+
"800": "#b9efd1",
|
|
1595
|
+
"900": "#e2f8ec",
|
|
1596
|
+
foreground: "#000",
|
|
1597
|
+
DEFAULT: "#17c964",
|
|
1598
|
+
},
|
|
1599
|
+
warning: {
|
|
1600
|
+
"50": "#4a320b",
|
|
1601
|
+
"100": "#744e11",
|
|
1602
|
+
"200": "#9f6b17",
|
|
1603
|
+
"300": "#ca881e",
|
|
1604
|
+
"400": "#f5a524",
|
|
1605
|
+
"500": "#f7b54a",
|
|
1606
|
+
"600": "#f9c571",
|
|
1607
|
+
"700": "#fad497",
|
|
1608
|
+
"800": "#fce4bd",
|
|
1609
|
+
"900": "#fef4e4",
|
|
1610
|
+
foreground: "#000",
|
|
1611
|
+
DEFAULT: "#f5a524",
|
|
1612
|
+
},
|
|
1613
|
+
danger: {
|
|
1614
|
+
"50": "#49051d",
|
|
1615
|
+
"100": "#73092e",
|
|
1616
|
+
"200": "#9e0c3e",
|
|
1617
|
+
"300": "#c80f4f",
|
|
1618
|
+
"400": "#f31260",
|
|
1619
|
+
"500": "#f53b7c",
|
|
1620
|
+
"600": "#f76598",
|
|
1621
|
+
"700": "#f98eb3",
|
|
1622
|
+
"800": "#fbb8cf",
|
|
1623
|
+
"900": "#fee1eb",
|
|
1624
|
+
foreground: "#000",
|
|
1625
|
+
DEFAULT: "#f31260",
|
|
1626
|
+
},
|
|
1627
|
+
focus: "#006FEE",
|
|
1628
|
+
overlay: "#ffffff",
|
|
1629
|
+
},
|
|
1630
|
+
},
|
|
1028
1631
|
"purple-light": {
|
|
1029
1632
|
extend: "light",
|
|
1030
1633
|
colors: {
|
|
1031
|
-
background: "#ffffff",
|
|
1032
|
-
foreground: "#111827",
|
|
1033
1634
|
primary: {
|
|
1034
|
-
50: "#eee4f8",
|
|
1035
|
-
100: "#d7bfef",
|
|
1036
|
-
200: "#bf99e5",
|
|
1037
|
-
300: "#a773db",
|
|
1038
|
-
400: "#904ed2",
|
|
1039
|
-
500: "#7828c8",
|
|
1040
|
-
600: "#6321a5",
|
|
1041
|
-
700: "#4e1a82",
|
|
1042
|
-
800: "#39135f",
|
|
1043
|
-
900: "#240c3c",
|
|
1635
|
+
"50": "#eee4f8",
|
|
1636
|
+
"100": "#d7bfef",
|
|
1637
|
+
"200": "#bf99e5",
|
|
1638
|
+
"300": "#a773db",
|
|
1639
|
+
"400": "#904ed2",
|
|
1640
|
+
"500": "#7828c8",
|
|
1641
|
+
"600": "#6321a5",
|
|
1642
|
+
"700": "#4e1a82",
|
|
1643
|
+
"800": "#39135f",
|
|
1644
|
+
"900": "#240c3c",
|
|
1645
|
+
foreground: "#fff",
|
|
1044
1646
|
DEFAULT: "#7828c8",
|
|
1045
|
-
foreground: "#ffffff",
|
|
1046
1647
|
},
|
|
1047
|
-
|
|
1648
|
+
secondary: {
|
|
1649
|
+
"50": "#dfedfd",
|
|
1650
|
+
"100": "#b3d4fa",
|
|
1651
|
+
"200": "#86bbf7",
|
|
1652
|
+
"300": "#59a1f4",
|
|
1653
|
+
"400": "#2d88f1",
|
|
1654
|
+
"500": "#006fee",
|
|
1655
|
+
"600": "#005cc4",
|
|
1656
|
+
"700": "#00489b",
|
|
1657
|
+
"800": "#003571",
|
|
1658
|
+
"900": "#002147",
|
|
1659
|
+
foreground: "#fff",
|
|
1660
|
+
DEFAULT: "#006fee",
|
|
1661
|
+
},
|
|
1662
|
+
focus: "#7828c8",
|
|
1663
|
+
overlay: "#000000",
|
|
1048
1664
|
},
|
|
1049
1665
|
},
|
|
1050
1666
|
"purple-dark": {
|
|
1051
1667
|
extend: "dark",
|
|
1052
1668
|
colors: {
|
|
1053
|
-
background: "#1A1023",
|
|
1054
|
-
foreground: "#ffffff",
|
|
1055
1669
|
primary: {
|
|
1056
|
-
50: "#2c193f",
|
|
1057
|
-
100: "#462764",
|
|
1058
|
-
200: "#603689",
|
|
1059
|
-
300: "#7944ae",
|
|
1060
|
-
400: "#9353d3",
|
|
1061
|
-
500: "#a671db",
|
|
1062
|
-
600: "#b98fe2",
|
|
1063
|
-
700: "#
|
|
1064
|
-
800: "#dfcbf2",
|
|
1065
|
-
900: "#f2eafa",
|
|
1670
|
+
"50": "#2c193f",
|
|
1671
|
+
"100": "#462764",
|
|
1672
|
+
"200": "#603689",
|
|
1673
|
+
"300": "#7944ae",
|
|
1674
|
+
"400": "#9353d3",
|
|
1675
|
+
"500": "#a671db",
|
|
1676
|
+
"600": "#b98fe2",
|
|
1677
|
+
"700": "#ccadea",
|
|
1678
|
+
"800": "#dfcbf2",
|
|
1679
|
+
"900": "#f2eafa",
|
|
1680
|
+
foreground: "#fff",
|
|
1066
1681
|
DEFAULT: "#9353d3",
|
|
1067
|
-
foreground: "#ffffff",
|
|
1068
1682
|
},
|
|
1069
|
-
|
|
1683
|
+
secondary: {
|
|
1684
|
+
"50": "#1e254d",
|
|
1685
|
+
"100": "#2f3a79",
|
|
1686
|
+
"200": "#404fa6",
|
|
1687
|
+
"300": "#5265d2",
|
|
1688
|
+
"400": "#637aff",
|
|
1689
|
+
"500": "#7e91ff",
|
|
1690
|
+
"600": "#9aa9ff",
|
|
1691
|
+
"700": "#b5c0ff",
|
|
1692
|
+
"800": "#d0d7ff",
|
|
1693
|
+
"900": "#eceeff",
|
|
1694
|
+
foreground: "#000",
|
|
1695
|
+
DEFAULT: "#637aff",
|
|
1696
|
+
},
|
|
1697
|
+
focus: "#9353d3",
|
|
1070
1698
|
},
|
|
1071
1699
|
},
|
|
1072
|
-
"
|
|
1700
|
+
"yellow-light": {
|
|
1073
1701
|
extend: "light",
|
|
1074
1702
|
colors: {
|
|
1075
|
-
background: "#ffffff",
|
|
1076
|
-
foreground: "#111827",
|
|
1077
1703
|
primary: {
|
|
1078
|
-
50: "#
|
|
1079
|
-
100: "#
|
|
1080
|
-
200: "#
|
|
1081
|
-
300: "#
|
|
1082
|
-
400: "#
|
|
1083
|
-
500: "#
|
|
1084
|
-
600: "#
|
|
1085
|
-
700: "#
|
|
1086
|
-
800: "#
|
|
1087
|
-
900: "#
|
|
1088
|
-
|
|
1089
|
-
|
|
1704
|
+
"50": "#fffbe6",
|
|
1705
|
+
"100": "#FFFACD",
|
|
1706
|
+
"200": "#FFF39B",
|
|
1707
|
+
"300": "#FFEB69",
|
|
1708
|
+
"400": "#FFE243",
|
|
1709
|
+
"500": "#FFD505",
|
|
1710
|
+
"600": "#DBB303",
|
|
1711
|
+
"700": "#B79202",
|
|
1712
|
+
"800": "#937301",
|
|
1713
|
+
"900": "#7A5D00",
|
|
1714
|
+
foreground: "#000",
|
|
1715
|
+
DEFAULT: "#FFD505",
|
|
1716
|
+
},
|
|
1717
|
+
secondary: {
|
|
1718
|
+
"50": "#F3F7FD",
|
|
1719
|
+
"100": "#D1DFFB",
|
|
1720
|
+
"200": "#A5BEF7",
|
|
1721
|
+
"300": "#7494E7",
|
|
1722
|
+
"400": "#4E6FCF",
|
|
1723
|
+
"500": "#1E40AF",
|
|
1724
|
+
"600": "#153096",
|
|
1725
|
+
"700": "#0F237D",
|
|
1726
|
+
"800": "#091865",
|
|
1727
|
+
"900": "#051053",
|
|
1728
|
+
foreground: "#fff",
|
|
1729
|
+
DEFAULT: "#1E40AF",
|
|
1090
1730
|
},
|
|
1091
|
-
focus: "#
|
|
1731
|
+
focus: "#FFD505",
|
|
1732
|
+
overlay: "#000000",
|
|
1092
1733
|
},
|
|
1093
1734
|
},
|
|
1094
|
-
"
|
|
1735
|
+
"yellow-dark": {
|
|
1095
1736
|
extend: "dark",
|
|
1096
1737
|
colors: {
|
|
1097
|
-
background: "#0F1D15",
|
|
1098
|
-
foreground: "#ffffff",
|
|
1099
1738
|
primary: {
|
|
1100
|
-
50: "#
|
|
1101
|
-
100: "#
|
|
1102
|
-
200: "#
|
|
1103
|
-
300: "#
|
|
1104
|
-
400: "#
|
|
1105
|
-
500: "#
|
|
1106
|
-
600: "#
|
|
1107
|
-
700: "#
|
|
1108
|
-
800: "#
|
|
1109
|
-
900: "#
|
|
1110
|
-
|
|
1111
|
-
|
|
1739
|
+
"50": "#7A5D00",
|
|
1740
|
+
"100": "#937301",
|
|
1741
|
+
"200": "#B79202",
|
|
1742
|
+
"300": "#DBB303",
|
|
1743
|
+
"400": "#FFD505",
|
|
1744
|
+
"500": "#FFE243",
|
|
1745
|
+
"600": "#FFEB69",
|
|
1746
|
+
"700": "#FFF39B",
|
|
1747
|
+
"800": "#FFFACD",
|
|
1748
|
+
"900": "#fffbe6",
|
|
1749
|
+
foreground: "#000",
|
|
1750
|
+
DEFAULT: "#FFD505",
|
|
1751
|
+
},
|
|
1752
|
+
secondary: {
|
|
1753
|
+
50: "#e1efff",
|
|
1754
|
+
100: "#b2d0ff",
|
|
1755
|
+
200: "#83b1fc",
|
|
1756
|
+
300: "#5292f8",
|
|
1757
|
+
400: "#2473f5",
|
|
1758
|
+
500: "#0a5adb",
|
|
1759
|
+
600: "#0246ac",
|
|
1760
|
+
700: "#00327c",
|
|
1761
|
+
800: "#001e4d",
|
|
1762
|
+
900: "#000a1f",
|
|
1763
|
+
foreground: "#fff",
|
|
1764
|
+
DEFAULT: "#0a5adb",
|
|
1112
1765
|
},
|
|
1113
|
-
focus: "#
|
|
1766
|
+
focus: "#FFD505",
|
|
1767
|
+
overlay: "#ffffff",
|
|
1114
1768
|
},
|
|
1115
1769
|
},
|
|
1116
|
-
"
|
|
1770
|
+
"coral-light": {
|
|
1117
1771
|
extend: "light",
|
|
1118
1772
|
colors: {
|
|
1119
|
-
background: "#ffffff",
|
|
1120
|
-
foreground: "#111827",
|
|
1121
1773
|
primary: {
|
|
1122
|
-
50: "#
|
|
1123
|
-
100: "#
|
|
1124
|
-
200: "#
|
|
1125
|
-
300: "#
|
|
1126
|
-
400: "#
|
|
1127
|
-
500: "#
|
|
1128
|
-
600: "#
|
|
1129
|
-
700: "#
|
|
1130
|
-
800: "#
|
|
1131
|
-
900: "#
|
|
1132
|
-
|
|
1133
|
-
|
|
1774
|
+
"50": "#ffe9e9",
|
|
1775
|
+
"100": "#ffcaca",
|
|
1776
|
+
"200": "#ffabab",
|
|
1777
|
+
"300": "#ff8d8d",
|
|
1778
|
+
"400": "#ff6e6e",
|
|
1779
|
+
"500": "#ff4f4f",
|
|
1780
|
+
"600": "#d24141",
|
|
1781
|
+
"700": "#a63333",
|
|
1782
|
+
"800": "#792626",
|
|
1783
|
+
"900": "#4d1818",
|
|
1784
|
+
foreground: "#000",
|
|
1785
|
+
DEFAULT: "#ff4f4f",
|
|
1134
1786
|
},
|
|
1135
|
-
focus: "#
|
|
1787
|
+
focus: "#ff4f4f",
|
|
1136
1788
|
},
|
|
1137
1789
|
},
|
|
1138
|
-
"
|
|
1790
|
+
"coral-dark": {
|
|
1139
1791
|
extend: "dark",
|
|
1140
1792
|
colors: {
|
|
1141
|
-
background: "#101d3a",
|
|
1142
|
-
foreground: "#ffffff",
|
|
1143
1793
|
primary: {
|
|
1144
|
-
50: "#
|
|
1145
|
-
100: "#
|
|
1146
|
-
200: "#
|
|
1147
|
-
300: "#
|
|
1148
|
-
400: "#
|
|
1149
|
-
500: "#
|
|
1150
|
-
600: "#
|
|
1151
|
-
700: "#
|
|
1152
|
-
800: "#
|
|
1153
|
-
900: "#
|
|
1154
|
-
|
|
1155
|
-
|
|
1794
|
+
"50": "#4d1818",
|
|
1795
|
+
"100": "#792626",
|
|
1796
|
+
"200": "#a63333",
|
|
1797
|
+
"300": "#d24141",
|
|
1798
|
+
"400": "#ff4f4f",
|
|
1799
|
+
"500": "#ff6e6e",
|
|
1800
|
+
"600": "#ff8d8d",
|
|
1801
|
+
"700": "#ffabab",
|
|
1802
|
+
"800": "#ffcaca",
|
|
1803
|
+
"900": "#ffe9e9",
|
|
1804
|
+
foreground: "#000",
|
|
1805
|
+
DEFAULT: "#ff4f4f",
|
|
1156
1806
|
},
|
|
1157
|
-
focus: "#
|
|
1807
|
+
focus: "#ff4f4f",
|
|
1158
1808
|
},
|
|
1159
1809
|
},
|
|
1160
|
-
"
|
|
1810
|
+
"green-light": {
|
|
1161
1811
|
extend: "light",
|
|
1162
1812
|
colors: {
|
|
1163
|
-
background: "#ffffff",
|
|
1164
|
-
foreground: "#111827",
|
|
1165
1813
|
primary: {
|
|
1166
|
-
50: "#
|
|
1167
|
-
100: "#
|
|
1168
|
-
200: "#
|
|
1169
|
-
300: "#
|
|
1170
|
-
400: "#
|
|
1171
|
-
500: "#
|
|
1172
|
-
600: "#
|
|
1173
|
-
700: "#
|
|
1174
|
-
800: "#
|
|
1175
|
-
900: "#
|
|
1176
|
-
|
|
1177
|
-
|
|
1814
|
+
50: "#EFFFEF",
|
|
1815
|
+
100: "#CFFCD1",
|
|
1816
|
+
200: "#A0F9AC",
|
|
1817
|
+
300: "#6FEE8D",
|
|
1818
|
+
400: "#49DE7B",
|
|
1819
|
+
500: "#16C964",
|
|
1820
|
+
600: "#10AC64",
|
|
1821
|
+
700: "#0B905F",
|
|
1822
|
+
800: "#077457",
|
|
1823
|
+
900: "#046051",
|
|
1824
|
+
foreground: "#000",
|
|
1825
|
+
DEFAULT: "#16C964",
|
|
1826
|
+
},
|
|
1827
|
+
secondary: {
|
|
1828
|
+
"50": "#e3eaff",
|
|
1829
|
+
"100": "#D7DFFE",
|
|
1830
|
+
"200": "#AFBFFE",
|
|
1831
|
+
"300": "#889DFD",
|
|
1832
|
+
"400": "#6A82FB",
|
|
1833
|
+
"500": "#3956F9",
|
|
1834
|
+
"600": "#2941D6",
|
|
1835
|
+
"700": "#1C2EB3",
|
|
1836
|
+
"800": "#121F90",
|
|
1837
|
+
"900": "#0A1477",
|
|
1838
|
+
foreground: "#fff",
|
|
1839
|
+
DEFAULT: "#3956F9",
|
|
1840
|
+
},
|
|
1841
|
+
success: {
|
|
1842
|
+
"50": "#e7fde3",
|
|
1843
|
+
"100": "#E8FCD3",
|
|
1844
|
+
"200": "#CBFAA8",
|
|
1845
|
+
"300": "#A4F17B",
|
|
1846
|
+
"400": "#7EE358",
|
|
1847
|
+
"500": "#49D127",
|
|
1848
|
+
"600": "#2FB31C",
|
|
1849
|
+
"700": "#1A9613",
|
|
1850
|
+
"800": "#0C790E",
|
|
1851
|
+
"900": "#076410",
|
|
1852
|
+
foreground: "#000",
|
|
1853
|
+
DEFAULT: "#49D127",
|
|
1854
|
+
},
|
|
1855
|
+
warning: {
|
|
1856
|
+
"50": "#fff9da",
|
|
1857
|
+
"100": "#FFF7CC",
|
|
1858
|
+
"200": "#FFEE99",
|
|
1859
|
+
"300": "#FFE266",
|
|
1860
|
+
"400": "#FFD63F",
|
|
1861
|
+
"500": "#FFC300",
|
|
1862
|
+
"600": "#DBA200",
|
|
1863
|
+
"700": "#B78300",
|
|
1864
|
+
"800": "#936600",
|
|
1865
|
+
"900": "#7A5100",
|
|
1866
|
+
foreground: "#000",
|
|
1867
|
+
DEFAULT: "#FFC300",
|
|
1868
|
+
},
|
|
1869
|
+
danger: {
|
|
1870
|
+
"50": "#ffe2e5",
|
|
1871
|
+
"100": "#FFE3D8",
|
|
1872
|
+
"200": "#FFC1B2",
|
|
1873
|
+
"300": "#FF988B",
|
|
1874
|
+
"400": "#FF726F",
|
|
1875
|
+
"500": "#FF3F4C",
|
|
1876
|
+
"600": "#DB2E49",
|
|
1877
|
+
"700": "#B71F45",
|
|
1878
|
+
"800": "#93143F",
|
|
1879
|
+
"900": "#7A0C3B",
|
|
1880
|
+
foreground: "#000",
|
|
1881
|
+
DEFAULT: "#FF3F4C",
|
|
1178
1882
|
},
|
|
1179
|
-
focus: "#
|
|
1883
|
+
focus: "#66cc8a",
|
|
1884
|
+
overlay: "#000000",
|
|
1180
1885
|
},
|
|
1181
1886
|
},
|
|
1182
|
-
"
|
|
1887
|
+
"green-dark": {
|
|
1183
1888
|
extend: "dark",
|
|
1184
1889
|
colors: {
|
|
1185
|
-
background: "#18181b",
|
|
1186
|
-
foreground: "#ffffff",
|
|
1187
1890
|
primary: {
|
|
1188
|
-
50: "#
|
|
1189
|
-
100: "#
|
|
1190
|
-
200: "#
|
|
1191
|
-
300: "#
|
|
1192
|
-
400: "#
|
|
1193
|
-
500: "#
|
|
1194
|
-
600: "#
|
|
1195
|
-
700: "#
|
|
1196
|
-
800: "#
|
|
1197
|
-
900: "#
|
|
1198
|
-
|
|
1199
|
-
|
|
1891
|
+
50: "#EFFFEF",
|
|
1892
|
+
100: "#CFFCD1",
|
|
1893
|
+
200: "#A0F9AC",
|
|
1894
|
+
300: "#6FEE8D",
|
|
1895
|
+
400: "#49DE7B",
|
|
1896
|
+
500: "#16C964",
|
|
1897
|
+
600: "#10AC64",
|
|
1898
|
+
700: "#0B905F",
|
|
1899
|
+
800: "#077457",
|
|
1900
|
+
900: "#046051",
|
|
1901
|
+
foreground: "#000",
|
|
1902
|
+
DEFAULT: "#16C964",
|
|
1903
|
+
},
|
|
1904
|
+
secondary: {
|
|
1905
|
+
"50": "#e3eaff",
|
|
1906
|
+
"100": "#D7DFFE",
|
|
1907
|
+
"200": "#AFBFFE",
|
|
1908
|
+
"300": "#889DFD",
|
|
1909
|
+
"400": "#6A82FB",
|
|
1910
|
+
"500": "#3956F9",
|
|
1911
|
+
"600": "#2941D6",
|
|
1912
|
+
"700": "#1C2EB3",
|
|
1913
|
+
"800": "#121F90",
|
|
1914
|
+
"900": "#0A1477",
|
|
1915
|
+
foreground: "#fff",
|
|
1916
|
+
DEFAULT: "#3956F9",
|
|
1917
|
+
},
|
|
1918
|
+
success: {
|
|
1919
|
+
"50": "#e7fde3",
|
|
1920
|
+
"100": "#E8FCD3",
|
|
1921
|
+
"200": "#CBFAA8",
|
|
1922
|
+
"300": "#A4F17B",
|
|
1923
|
+
"400": "#7EE358",
|
|
1924
|
+
"500": "#49D127",
|
|
1925
|
+
"600": "#2FB31C",
|
|
1926
|
+
"700": "#1A9613",
|
|
1927
|
+
"800": "#0C790E",
|
|
1928
|
+
"900": "#076410",
|
|
1929
|
+
foreground: "#000",
|
|
1930
|
+
DEFAULT: "#49D127",
|
|
1931
|
+
},
|
|
1932
|
+
warning: {
|
|
1933
|
+
"50": "#fff9da",
|
|
1934
|
+
"100": "#FFF7CC",
|
|
1935
|
+
"200": "#FFEE99",
|
|
1936
|
+
"300": "#FFE266",
|
|
1937
|
+
"400": "#FFD63F",
|
|
1938
|
+
"500": "#FFC300",
|
|
1939
|
+
"600": "#DBA200",
|
|
1940
|
+
"700": "#B78300",
|
|
1941
|
+
"800": "#936600",
|
|
1942
|
+
"900": "#7A5100",
|
|
1943
|
+
foreground: "#000",
|
|
1944
|
+
DEFAULT: "#FFC300",
|
|
1200
1945
|
},
|
|
1201
|
-
|
|
1946
|
+
danger: {
|
|
1947
|
+
"50": "#ffe2e5",
|
|
1948
|
+
"100": "#FFE3D8",
|
|
1949
|
+
"200": "#FFC1B2",
|
|
1950
|
+
"300": "#FF988B",
|
|
1951
|
+
"400": "#FF726F",
|
|
1952
|
+
"500": "#FF3F4C",
|
|
1953
|
+
"600": "#DB2E49",
|
|
1954
|
+
"700": "#B71F45",
|
|
1955
|
+
"800": "#93143F",
|
|
1956
|
+
"900": "#7A0C3B",
|
|
1957
|
+
foreground: "#fff",
|
|
1958
|
+
DEFAULT: "#FF3F4C",
|
|
1959
|
+
},
|
|
1960
|
+
focus: "#66cc8a",
|
|
1961
|
+
overlay: "#ffffff",
|
|
1202
1962
|
},
|
|
1203
1963
|
},
|
|
1204
1964
|
};
|
|
1205
1965
|
|
|
1206
1966
|
var ThemeContext = createContext({
|
|
1207
|
-
|
|
1967
|
+
mode: "light",
|
|
1968
|
+
color: "blue",
|
|
1969
|
+
// biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
|
|
1970
|
+
setMode: function () { },
|
|
1208
1971
|
// biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
|
|
1209
|
-
|
|
1972
|
+
setColor: function () { },
|
|
1210
1973
|
});
|
|
1211
1974
|
var useThemeContext = function () {
|
|
1212
1975
|
var context = useContext(ThemeContext);
|
|
@@ -1216,10 +1979,115 @@ var useThemeContext = function () {
|
|
|
1216
1979
|
return context;
|
|
1217
1980
|
};
|
|
1218
1981
|
|
|
1982
|
+
/**
|
|
1983
|
+
* @file This file contains the theme configurations for the application.
|
|
1984
|
+
*/
|
|
1985
|
+
var ALL_THEMES = __spreadArray(["light", "dark"], Object.keys(themeColors), true);
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Custom hook to manage the theme state and side effects.
|
|
1989
|
+
* @returns An object with the current mode, color, and functions to set them.
|
|
1990
|
+
*/
|
|
1991
|
+
var useThemeManager = function () {
|
|
1992
|
+
var _a = useTheme(), rawTheme = _a.theme, setRawTheme = _a.setTheme;
|
|
1993
|
+
var setTheme = useCallback(function (theme) {
|
|
1994
|
+
var _a;
|
|
1995
|
+
var html = document.documentElement;
|
|
1996
|
+
(_a = html.classList).remove.apply(_a, ALL_THEMES);
|
|
1997
|
+
setRawTheme(theme);
|
|
1998
|
+
}, [setRawTheme]);
|
|
1999
|
+
useEffect(function () {
|
|
2000
|
+
var _a;
|
|
2001
|
+
var html = document.documentElement;
|
|
2002
|
+
(_a = html.classList).remove.apply(_a, ALL_THEMES);
|
|
2003
|
+
html.classList.add(rawTheme);
|
|
2004
|
+
}, [rawTheme]);
|
|
2005
|
+
var _b = useMemo(function () {
|
|
2006
|
+
var parts = rawTheme.split("-");
|
|
2007
|
+
var parsedColor = "blue";
|
|
2008
|
+
var parsedMode = "light";
|
|
2009
|
+
if (parts.length === 2) {
|
|
2010
|
+
var colorPart = parts[0], modePart = parts[1];
|
|
2011
|
+
parsedColor = colorPart;
|
|
2012
|
+
parsedMode = modePart;
|
|
2013
|
+
}
|
|
2014
|
+
else if (rawTheme === "light" || rawTheme === "dark") {
|
|
2015
|
+
parsedMode = rawTheme;
|
|
2016
|
+
}
|
|
2017
|
+
return { mode: parsedMode, color: parsedColor };
|
|
2018
|
+
}, [rawTheme]), mode = _b.mode, color = _b.color;
|
|
2019
|
+
var setMode = useCallback(function (newMode) {
|
|
2020
|
+
var newTheme = color === "blue" ? newMode : "".concat(color, "-").concat(newMode);
|
|
2021
|
+
setTheme(newTheme);
|
|
2022
|
+
}, [color, setTheme]);
|
|
2023
|
+
var setColor = useCallback(function (newColor) {
|
|
2024
|
+
var newTheme = newColor === "blue" ? mode : "".concat(newColor, "-").concat(mode);
|
|
2025
|
+
setTheme(newTheme);
|
|
2026
|
+
}, [mode, setTheme]);
|
|
2027
|
+
return {
|
|
2028
|
+
mode: mode,
|
|
2029
|
+
color: color,
|
|
2030
|
+
setMode: setMode,
|
|
2031
|
+
setColor: setColor,
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
2034
|
+
|
|
2035
|
+
/**
|
|
2036
|
+
* The ThemeProvider component is a wrapper that provides theme context to its children.
|
|
2037
|
+
* It uses the useThemeManager hook to manage the theme state and provides the current
|
|
2038
|
+
* theme mode and color, along with functions to update them, to its children.
|
|
2039
|
+
*
|
|
2040
|
+
* @param {IThemeProvider} { children }
|
|
2041
|
+
* @returns {JSX.Element}
|
|
2042
|
+
*/
|
|
1219
2043
|
var ThemeProvider = function (_a) {
|
|
1220
2044
|
var children = _a.children;
|
|
1221
|
-
var _b =
|
|
1222
|
-
return (jsx(ThemeContext.Provider, { value: {
|
|
2045
|
+
var _b = useThemeManager(), mode = _b.mode, color = _b.color, setMode = _b.setMode, setColor = _b.setColor;
|
|
2046
|
+
return (jsx(ThemeContext.Provider, { value: {
|
|
2047
|
+
mode: mode,
|
|
2048
|
+
color: color,
|
|
2049
|
+
setMode: setMode,
|
|
2050
|
+
setColor: setColor,
|
|
2051
|
+
}, children: children }));
|
|
2052
|
+
};
|
|
2053
|
+
|
|
2054
|
+
var AuraToastProvider = function (_a) {
|
|
2055
|
+
var children = _a.children;
|
|
2056
|
+
var _b = useState({
|
|
2057
|
+
isVisible: false,
|
|
2058
|
+
title: "",
|
|
2059
|
+
description: "",
|
|
2060
|
+
color: "primary",
|
|
2061
|
+
duration: 3000,
|
|
2062
|
+
}), toast = _b[0], setToast = _b[1];
|
|
2063
|
+
var timerRef = useRef(null);
|
|
2064
|
+
var hideToast = useCallback(function () {
|
|
2065
|
+
if (timerRef.current) {
|
|
2066
|
+
clearTimeout(timerRef.current);
|
|
2067
|
+
timerRef.current = null;
|
|
2068
|
+
}
|
|
2069
|
+
setToast(function (currentToast) { return (__assign(__assign({}, currentToast), { isVisible: false })); });
|
|
2070
|
+
}, []);
|
|
2071
|
+
var showToast = useCallback(function (options) {
|
|
2072
|
+
if (timerRef.current) {
|
|
2073
|
+
clearTimeout(timerRef.current);
|
|
2074
|
+
}
|
|
2075
|
+
setToast(__assign({ isVisible: true }, options));
|
|
2076
|
+
var duration = options.duration === undefined ? 3000 : options.duration;
|
|
2077
|
+
if (duration > 0) {
|
|
2078
|
+
timerRef.current = setTimeout(function () {
|
|
2079
|
+
hideToast();
|
|
2080
|
+
}, duration);
|
|
2081
|
+
}
|
|
2082
|
+
}, [hideToast]);
|
|
2083
|
+
useEffect(function () {
|
|
2084
|
+
return function () {
|
|
2085
|
+
if (timerRef.current) {
|
|
2086
|
+
clearTimeout(timerRef.current);
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
}, []);
|
|
2090
|
+
return (jsx(ToastContext.Provider, { value: { toast: toast, showToast: showToast, hideToast: hideToast }, children: children }));
|
|
1223
2091
|
};
|
|
1224
2092
|
|
|
1225
|
-
export { AutoComplete, Button, Card, HeaderComponent, IconComponent, Input, MenuComponent, Phone, Select, ThemeContext, ThemePicker, ThemeProvider, UploadFile, sizeMap, themeColors, useThemeContext };
|
|
2093
|
+
export { AddHolidayForm, AuraTable, AuraToastProvider, AutoComplete, Button, Card, DatePicker, DateRangePicker, GlobalToast, HeaderComponent, HolidayType, IconComponent, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Pagination, Phone, ScheduleRow, Select, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, sizeMap, themeColors, useAuraToast, useThemeContext };
|