@beweco/aurora-ui 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -135,10 +135,11 @@ var Input = function (_a) {
135
135
  return (jsxRuntime.jsx(react.Input, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
136
136
  label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
137
137
  inputWrapper: "focus-within:!border-primary-500",
138
+ errorMessage: "text-left",
138
139
  } })));
139
140
  };
140
141
 
141
- var defaultTranslations$6 = {
142
+ var defaultTranslations$7 = {
142
143
  addHolidayTitle: "Add holiday",
143
144
  dayOption: "Day",
144
145
  dateRangeOption: "Date range",
@@ -162,7 +163,7 @@ var INITIAL_HOLIDAY_STATE = {
162
163
  */
163
164
  var AddHolidayForm = function (_a) {
164
165
  var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
165
- var t = __assign(__assign({}, defaultTranslations$6), translations);
166
+ var t = __assign(__assign({}, defaultTranslations$7), translations);
166
167
  var _b = React.useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
167
168
  /**
168
169
  * A boolean flag that determines if a date has been set.
@@ -224,15 +225,15 @@ var AddHolidayForm = function (_a) {
224
225
 
225
226
  var H2 = function (_a) {
226
227
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
227
- return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-medium", className) }, props, { children: children })));
228
+ return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-semibold", className) }, props, { children: children })));
228
229
  };
229
230
 
230
231
  var P = function (_a) {
231
232
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
232
- return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500", className) }, props, { children: children })));
233
+ return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500 font-normal", className) }, props, { children: children })));
233
234
  };
234
235
 
235
- var defaultTranslations$5 = {
236
+ var defaultTranslations$6 = {
236
237
  title: "Analytics",
237
238
  description: "Monthly growth of your metrics during the selected period",
238
239
  viewDetails: "View Details",
@@ -286,7 +287,7 @@ var formatMonth = function (month) {
286
287
  var AnalyticsCard = function (_a) {
287
288
  var _b, _c;
288
289
  var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
289
- var t = __assign(__assign({}, defaultTranslations$5), translations);
290
+ var t = __assign(__assign({}, defaultTranslations$6), translations);
290
291
  var _h = React.useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
291
292
  var activeChartData = React.useMemo(function () {
292
293
  var _a;
@@ -919,6 +920,62 @@ var ColorSelector = function (_a) {
919
920
  : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
920
921
  };
921
922
 
923
+ // Traducciones por defecto en español
924
+ var defaultTranslations$5 = {
925
+ dayOption: "Día específico",
926
+ dateRangeOption: "Rango de fechas",
927
+ selectDateAriaLabel: "Seleccionar fecha",
928
+ selectDateRangeAriaLabel: "Seleccionar rango de fechas",
929
+ };
930
+ /**
931
+ * DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
932
+ * basado en HeroUI siguiendo las reglas de diseño BeweOS.
933
+ * Maneja su propio estado interno de manera autónoma.
934
+ */
935
+ var DateSelector = function (_a) {
936
+ var _b = _a.initialType, initialType = _b === void 0 ? exports.HolidayType.SingleDay : _b, initialDate = _a.initialDate, initialDateRange = _a.initialDateRange, onChange = _a.onChange, _c = _a.translations, translations = _c === void 0 ? {} : _c, radioGroupProps = _a.radioGroupProps, radioItemProps = _a.radioItemProps, datePickerProps = _a.datePickerProps, dateRangePickerProps = _a.dateRangePickerProps, _d = _a.className, className = _d === void 0 ? "" : _d;
937
+ // Estado interno del componente
938
+ var _e = React.useState(initialType), type = _e[0], setType = _e[1];
939
+ var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
940
+ var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
941
+ // Combinar traducciones por defecto con las proporcionadas
942
+ var t = __assign(__assign({}, defaultTranslations$5), translations);
943
+ var handleTypeChange = function (value) {
944
+ var newType = value;
945
+ setType(newType);
946
+ // Limpiar valores cuando cambia el tipo
947
+ if (newType === exports.HolidayType.SingleDay) {
948
+ setDateRange(null);
949
+ }
950
+ else {
951
+ setDate(null);
952
+ }
953
+ // Notificar cambio
954
+ onChange === null || onChange === void 0 ? void 0 : onChange({
955
+ type: newType,
956
+ date: newType === exports.HolidayType.SingleDay ? date : null,
957
+ dateRange: newType === exports.HolidayType.DateRange ? dateRange : null,
958
+ });
959
+ };
960
+ var handleDateChange = function (selectedDate) {
961
+ setDate(selectedDate);
962
+ onChange === null || onChange === void 0 ? void 0 : onChange({
963
+ type: type,
964
+ date: selectedDate,
965
+ dateRange: null,
966
+ });
967
+ };
968
+ var handleDateRangeChange = function (range) {
969
+ setDateRange(range);
970
+ onChange === null || onChange === void 0 ? void 0 : onChange({
971
+ type: type,
972
+ date: null,
973
+ dateRange: range,
974
+ });
975
+ };
976
+ return (jsxRuntime.jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxRuntime.jsxs(react.RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsxRuntime.jsx(react.Radio, __assign({ value: exports.HolidayType.SingleDay }, radioItemProps, { children: t.dayOption })), jsxRuntime.jsx(react.Radio, __assign({ value: exports.HolidayType.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === exports.HolidayType.DateRange ? (jsxRuntime.jsx(react.DateRangePicker, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsxRuntime.jsx(react.DatePicker, __assign({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
977
+ };
978
+
922
979
  var H1 = function (_a) {
923
980
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
924
981
  return (jsxRuntime.jsx("h1", __assign({ className: react.cn("text-xl font-bold", className) }, props, { children: children })));
@@ -926,12 +983,12 @@ var H1 = function (_a) {
926
983
 
927
984
  var H3 = function (_a) {
928
985
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
929
- return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium mb-1", className) }, props, { children: children })));
986
+ return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium", className) }, props, { children: children })));
930
987
  };
931
988
 
932
989
  var H4 = function (_a) {
933
990
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
934
- return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium mb-1", className) }, props, { children: children })));
991
+ return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium ", className) }, props, { children: children })));
935
992
  };
936
993
 
937
994
  var ConfigMenu = function (_a) {
@@ -1330,7 +1387,7 @@ var MultiStepSidebar = React.forwardRef(function (_a, ref) {
1330
1387
  onClose === null || onClose === void 0 ? void 0 : onClose();
1331
1388
  }
1332
1389
  };
1333
- return (jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxRuntime.jsxs("div", __assign({ ref: ref, className: react.cn("flex h-full w-full max-w-4xl rounded-lg bg-background shadow-lg lg:h-auto", className) }, props, { children: [jsxRuntime.jsx("div", { className: "hidden w-1/3 flex-col items-center gap-y-8 p-8 lg:flex", children: jsxRuntime.jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxRuntime.jsxs("div", { className: "relative flex h-auto w-full flex-col items-center gap-4 md:p-4 lg:w-2/3", children: [jsxRuntime.jsx(Button, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsxRuntime.jsx(IconComponent, { className: "text-foreground", icon: "material-symbols:close-rounded", size: "lg" }) }), jsxRuntime.jsx("div", { className: "pt-9 w-10/12 lg:hidden", children: jsxRuntime.jsx("div", { className: "flex justify-center", children: jsxRuntime.jsx(StepIndicator, { className: react.cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsxRuntime.jsx("div", { className: "h-full w-full p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
1390
+ return (jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxRuntime.jsxs("div", __assign({ ref: ref, className: react.cn("flex h-full w-full max-w-4xl rounded-lg bg-background shadow-lg lg:h-auto", className) }, props, { children: [jsxRuntime.jsx("div", { className: "hidden w-1/3 flex-col items-center justify-center gap-y-8 p-8 md:flex", children: jsxRuntime.jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxRuntime.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: [jsxRuntime.jsx(Button, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsxRuntime.jsx(IconComponent, { className: "text-foreground", icon: "material-symbols:close-rounded", size: "lg" }) }), jsxRuntime.jsx("div", { className: "pt-9 w-10/12 md:hidden", children: jsxRuntime.jsx("div", { className: "flex w-full justify-center", children: jsxRuntime.jsx(StepIndicator, { className: react.cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsxRuntime.jsx("div", { className: " flex flex-col h-full w-full justify-between p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
1334
1391
  });
1335
1392
  MultiStepSidebar.displayName = "MultiStepSidebar";
1336
1393
 
@@ -1340,47 +1397,31 @@ var MultistepNavigationButtons = function (_a) {
1340
1397
  // backButtonProps || {};
1341
1398
  var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
1342
1399
  var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
1343
- return (jsxRuntime.jsx("div", { className: react.cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row", children: [jsxRuntime.jsx(react.Button, __assign({ className: "w-full sm:w-auto", color: "primary", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsxRuntime.jsx(react.Button, __assign({ className: "w-full sm:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1400
+ return (jsxRuntime.jsx("div", { className: react.cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1344
1401
  };
1345
1402
 
1346
- var variants = {
1347
- enter: function (direction) { return ({
1348
- y: direction > 0 ? 30 : -30,
1349
- opacity: 0,
1350
- }); },
1351
- center: {
1352
- zIndex: 1,
1353
- y: 0,
1354
- opacity: 1,
1355
- },
1356
- exit: function (direction) { return ({
1357
- zIndex: 0,
1358
- y: direction < 0 ? 30 : -30,
1359
- opacity: 0,
1360
- }); },
1361
- };
1362
1403
  var MultiStepWizard = function (_a) {
1363
- var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose;
1364
- var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1404
+ var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText;
1405
+ var _b = React.useState(0), page = _b[0], setPage = _b[1];
1365
1406
  React.useEffect(function () {
1366
1407
  if (isOpen) {
1367
- setPage([0, 0]);
1408
+ setPage(0);
1368
1409
  }
1369
1410
  }, [isOpen]);
1370
1411
  var t = __assign({
1371
1412
  continue: "Continue",
1372
1413
  goBack: "Back",
1373
1414
  cancel: "Cancel",
1374
- signUp: "Sign Up for Free",
1375
- goToPayment: "Go to Payment",
1415
+ next: "Next",
1416
+ complete: "Complete",
1376
1417
  }, translations);
1377
1418
  var paginate = React.useCallback(function (newDirection) {
1378
1419
  setPage(function (prev) {
1379
- var nextPage = prev[0] + newDirection;
1420
+ var nextPage = prev + newDirection;
1380
1421
  if (nextPage < 0 || nextPage > steps.length - 1) {
1381
1422
  return prev;
1382
1423
  }
1383
- return [nextPage, newDirection];
1424
+ return nextPage;
1384
1425
  });
1385
1426
  }, [steps]);
1386
1427
  var onChangePage = React.useCallback(function (newPage) {
@@ -1388,8 +1429,7 @@ var MultiStepWizard = function (_a) {
1388
1429
  if (newPage < 0 || newPage > steps.length - 1) {
1389
1430
  return prev;
1390
1431
  }
1391
- var currentPage = prev[0];
1392
- return [newPage, newPage > currentPage ? 1 : -1];
1432
+ return newPage;
1393
1433
  });
1394
1434
  }, [steps]);
1395
1435
  var onBack = React.useCallback(function () {
@@ -1398,33 +1438,45 @@ var MultiStepWizard = function (_a) {
1398
1438
  var onNext = React.useCallback(function () {
1399
1439
  paginate(1);
1400
1440
  }, [paginate]);
1441
+ // Determinar el texto del botón según el paso
1442
+ var getButtonText = function () {
1443
+ if (page === 0) {
1444
+ return t.next;
1445
+ }
1446
+ if (page === steps.length - 1) {
1447
+ return completeButtonText || t.complete;
1448
+ }
1449
+ return t.continue;
1450
+ };
1451
+ // Determinar la acción del botón según el paso
1452
+ var handleNextAction = function () {
1453
+ if (page === steps.length - 1) {
1454
+ // Último paso: ejecutar acción de completado
1455
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
1456
+ }
1457
+ else {
1458
+ // Otros pasos: continuar al siguiente
1459
+ onNext();
1460
+ }
1461
+ };
1401
1462
  var content = React.useMemo(function () {
1402
- return (jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1403
- y: {
1404
- ease: "backOut",
1405
- duration: 0.35,
1406
- },
1407
- opacity: { duration: 0.4 },
1408
- }, variants: variants, children: steps[page].content }, page) }));
1409
- }, [page, steps, direction]);
1463
+ return (jsxRuntime.jsx("div", { className: "col-span-12", children: steps[page].content }, page));
1464
+ }, [page, steps]);
1410
1465
  if (!isOpen) {
1411
1466
  return null;
1412
1467
  }
1413
- return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsxs("div", { className: "relative flex h-fit w-full flex-col pt-6 text-center lg:h-full lg:justify-center lg:pt-0", children: [content, jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
1414
- isDisabled: page === 0,
1415
- onPress: onBack,
1416
- children: t.goBack,
1417
- }, cancelButtonProps: {
1418
- onPress: onClose,
1419
- children: t.cancel,
1420
- }, nextButtonProps: {
1421
- children: page === 0
1422
- ? t.signUp
1423
- : page === steps.length - 1
1424
- ? t.goToPayment
1425
- : t.continue,
1426
- onPress: onNext,
1427
- } })] })] }));
1468
+ return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsx("div", { className: "relative flex h-fit w-full flex-col text-center lg:justify-center lg:pt-0", children: content })] }), jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
1469
+ isDisabled: page === 0,
1470
+ onPress: onBack,
1471
+ children: t.goBack,
1472
+ }, cancelButtonProps: {
1473
+ onPress: onClose,
1474
+ children: t.cancel,
1475
+ }, nextButtonProps: {
1476
+ children: getButtonText(),
1477
+ onPress: handleNextAction,
1478
+ isDisabled: steps[page].isStepValid === false,
1479
+ } })] }));
1428
1480
  };
1429
1481
 
1430
1482
  var Pagination = function (_a) {
@@ -1550,7 +1602,7 @@ var Phone = function (_a) {
1550
1602
  onChange({ countryCode: selectedCountry.code, phoneNumber: val });
1551
1603
  }
1552
1604
  };
1553
- return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 dark:focus-within:border-primary-500 ".concat(error ? "border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: "text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1605
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1554
1606
  reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
1555
1607
  var searchTerm = e.target.value.toLowerCase();
1556
1608
  var filtered = uniqueCountries.filter(function (country) {
@@ -2718,6 +2770,7 @@ exports.Card = Card;
2718
2770
  exports.ColorSelector = ColorSelector;
2719
2771
  exports.DatePicker = DatePicker;
2720
2772
  exports.DateRangePicker = DateRangePicker;
2773
+ exports.DateSelector = DateSelector;
2721
2774
  exports.GlobalToast = GlobalToast;
2722
2775
  exports.H1 = H1;
2723
2776
  exports.H2 = H2;
package/dist/index.esm.js CHANGED
@@ -134,10 +134,11 @@ var Input = function (_a) {
134
134
  return (jsx(Input$1, __assign({}, props, { id: inputId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
135
135
  label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
136
136
  inputWrapper: "focus-within:!border-primary-500",
137
+ errorMessage: "text-left",
137
138
  } })));
138
139
  };
139
140
 
140
- var defaultTranslations$6 = {
141
+ var defaultTranslations$7 = {
141
142
  addHolidayTitle: "Add holiday",
142
143
  dayOption: "Day",
143
144
  dateRangeOption: "Date range",
@@ -161,7 +162,7 @@ var INITIAL_HOLIDAY_STATE = {
161
162
  */
162
163
  var AddHolidayForm = function (_a) {
163
164
  var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
164
- var t = __assign(__assign({}, defaultTranslations$6), translations);
165
+ var t = __assign(__assign({}, defaultTranslations$7), translations);
165
166
  var _b = useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
166
167
  /**
167
168
  * A boolean flag that determines if a date has been set.
@@ -223,15 +224,15 @@ var AddHolidayForm = function (_a) {
223
224
 
224
225
  var H2 = function (_a) {
225
226
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
226
- return (jsx("h2", __assign({ className: cn("text-lg font-medium", className) }, props, { children: children })));
227
+ return (jsx("h2", __assign({ className: cn("text-lg font-semibold", className) }, props, { children: children })));
227
228
  };
228
229
 
229
230
  var P = function (_a) {
230
231
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
231
- return (jsx("p", __assign({ className: cn("text-sm text-default-500", className) }, props, { children: children })));
232
+ return (jsx("p", __assign({ className: cn("text-sm text-default-500 font-normal", className) }, props, { children: children })));
232
233
  };
233
234
 
234
- var defaultTranslations$5 = {
235
+ var defaultTranslations$6 = {
235
236
  title: "Analytics",
236
237
  description: "Monthly growth of your metrics during the selected period",
237
238
  viewDetails: "View Details",
@@ -285,7 +286,7 @@ var formatMonth = function (month) {
285
286
  var AnalyticsCard = function (_a) {
286
287
  var _b, _c;
287
288
  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"]);
288
- var t = __assign(__assign({}, defaultTranslations$5), translations);
289
+ var t = __assign(__assign({}, defaultTranslations$6), translations);
289
290
  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];
290
291
  var activeChartData = useMemo(function () {
291
292
  var _a;
@@ -918,6 +919,62 @@ var ColorSelector = function (_a) {
918
919
  : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
919
920
  };
920
921
 
922
+ // Traducciones por defecto en español
923
+ var defaultTranslations$5 = {
924
+ dayOption: "Día específico",
925
+ dateRangeOption: "Rango de fechas",
926
+ selectDateAriaLabel: "Seleccionar fecha",
927
+ selectDateRangeAriaLabel: "Seleccionar rango de fechas",
928
+ };
929
+ /**
930
+ * DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
931
+ * basado en HeroUI siguiendo las reglas de diseño BeweOS.
932
+ * Maneja su propio estado interno de manera autónoma.
933
+ */
934
+ var DateSelector = function (_a) {
935
+ var _b = _a.initialType, initialType = _b === void 0 ? HolidayType.SingleDay : _b, initialDate = _a.initialDate, initialDateRange = _a.initialDateRange, onChange = _a.onChange, _c = _a.translations, translations = _c === void 0 ? {} : _c, radioGroupProps = _a.radioGroupProps, radioItemProps = _a.radioItemProps, datePickerProps = _a.datePickerProps, dateRangePickerProps = _a.dateRangePickerProps, _d = _a.className, className = _d === void 0 ? "" : _d;
936
+ // Estado interno del componente
937
+ var _e = React.useState(initialType), type = _e[0], setType = _e[1];
938
+ var _f = React.useState(initialDate || null), date = _f[0], setDate = _f[1];
939
+ var _g = React.useState(initialDateRange || null), dateRange = _g[0], setDateRange = _g[1];
940
+ // Combinar traducciones por defecto con las proporcionadas
941
+ var t = __assign(__assign({}, defaultTranslations$5), translations);
942
+ var handleTypeChange = function (value) {
943
+ var newType = value;
944
+ setType(newType);
945
+ // Limpiar valores cuando cambia el tipo
946
+ if (newType === HolidayType.SingleDay) {
947
+ setDateRange(null);
948
+ }
949
+ else {
950
+ setDate(null);
951
+ }
952
+ // Notificar cambio
953
+ onChange === null || onChange === void 0 ? void 0 : onChange({
954
+ type: newType,
955
+ date: newType === HolidayType.SingleDay ? date : null,
956
+ dateRange: newType === HolidayType.DateRange ? dateRange : null,
957
+ });
958
+ };
959
+ var handleDateChange = function (selectedDate) {
960
+ setDate(selectedDate);
961
+ onChange === null || onChange === void 0 ? void 0 : onChange({
962
+ type: type,
963
+ date: selectedDate,
964
+ dateRange: null,
965
+ });
966
+ };
967
+ var handleDateRangeChange = function (range) {
968
+ setDateRange(range);
969
+ onChange === null || onChange === void 0 ? void 0 : onChange({
970
+ type: type,
971
+ date: null,
972
+ dateRange: range,
973
+ });
974
+ };
975
+ return (jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxs(RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsx(Radio, __assign({ value: HolidayType.SingleDay }, radioItemProps, { children: t.dayOption })), jsx(Radio, __assign({ value: HolidayType.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === HolidayType.DateRange ? (jsx(DateRangePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsx(DatePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
976
+ };
977
+
921
978
  var H1 = function (_a) {
922
979
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
923
980
  return (jsx("h1", __assign({ className: cn("text-xl font-bold", className) }, props, { children: children })));
@@ -925,12 +982,12 @@ var H1 = function (_a) {
925
982
 
926
983
  var H3 = function (_a) {
927
984
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
928
- return (jsx("h3", __assign({ className: cn("text-base font-medium mb-1", className) }, props, { children: children })));
985
+ return (jsx("h3", __assign({ className: cn("text-base font-medium", className) }, props, { children: children })));
929
986
  };
930
987
 
931
988
  var H4 = function (_a) {
932
989
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
933
- return (jsx("h4", __assign({ className: cn("text-sm font-medium mb-1", className) }, props, { children: children })));
990
+ return (jsx("h4", __assign({ className: cn("text-sm font-medium ", className) }, props, { children: children })));
934
991
  };
935
992
 
936
993
  var ConfigMenu = function (_a) {
@@ -1329,7 +1386,7 @@ var MultiStepSidebar = React.forwardRef(function (_a, ref) {
1329
1386
  onClose === null || onClose === void 0 ? void 0 : onClose();
1330
1387
  }
1331
1388
  };
1332
- 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 gap-y-8 p-8 lg:flex", children: jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxs("div", { className: "relative flex h-auto 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 lg:hidden", children: jsx("div", { className: "flex justify-center", children: jsx(StepIndicator, { className: cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsx("div", { className: "h-full w-full p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
1389
+ 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 })] })] })) }));
1333
1390
  });
1334
1391
  MultiStepSidebar.displayName = "MultiStepSidebar";
1335
1392
 
@@ -1339,47 +1396,31 @@ var MultistepNavigationButtons = function (_a) {
1339
1396
  // backButtonProps || {};
1340
1397
  var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
1341
1398
  var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
1342
- 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 sm:w-auto sm:flex-row", children: [jsx(Button$1, __assign({ className: "w-full sm:w-auto", color: "primary", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsx(Button$1, __assign({ className: "w-full sm:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1399
+ return (jsx("div", { className: cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1343
1400
  };
1344
1401
 
1345
- var variants = {
1346
- enter: function (direction) { return ({
1347
- y: direction > 0 ? 30 : -30,
1348
- opacity: 0,
1349
- }); },
1350
- center: {
1351
- zIndex: 1,
1352
- y: 0,
1353
- opacity: 1,
1354
- },
1355
- exit: function (direction) { return ({
1356
- zIndex: 0,
1357
- y: direction < 0 ? 30 : -30,
1358
- opacity: 0,
1359
- }); },
1360
- };
1361
1402
  var MultiStepWizard = function (_a) {
1362
- var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose;
1363
- var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1403
+ var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText;
1404
+ var _b = React.useState(0), page = _b[0], setPage = _b[1];
1364
1405
  React.useEffect(function () {
1365
1406
  if (isOpen) {
1366
- setPage([0, 0]);
1407
+ setPage(0);
1367
1408
  }
1368
1409
  }, [isOpen]);
1369
1410
  var t = __assign({
1370
1411
  continue: "Continue",
1371
1412
  goBack: "Back",
1372
1413
  cancel: "Cancel",
1373
- signUp: "Sign Up for Free",
1374
- goToPayment: "Go to Payment",
1414
+ next: "Next",
1415
+ complete: "Complete",
1375
1416
  }, translations);
1376
1417
  var paginate = React.useCallback(function (newDirection) {
1377
1418
  setPage(function (prev) {
1378
- var nextPage = prev[0] + newDirection;
1419
+ var nextPage = prev + newDirection;
1379
1420
  if (nextPage < 0 || nextPage > steps.length - 1) {
1380
1421
  return prev;
1381
1422
  }
1382
- return [nextPage, newDirection];
1423
+ return nextPage;
1383
1424
  });
1384
1425
  }, [steps]);
1385
1426
  var onChangePage = React.useCallback(function (newPage) {
@@ -1387,8 +1428,7 @@ var MultiStepWizard = function (_a) {
1387
1428
  if (newPage < 0 || newPage > steps.length - 1) {
1388
1429
  return prev;
1389
1430
  }
1390
- var currentPage = prev[0];
1391
- return [newPage, newPage > currentPage ? 1 : -1];
1431
+ return newPage;
1392
1432
  });
1393
1433
  }, [steps]);
1394
1434
  var onBack = React.useCallback(function () {
@@ -1397,33 +1437,45 @@ var MultiStepWizard = function (_a) {
1397
1437
  var onNext = React.useCallback(function () {
1398
1438
  paginate(1);
1399
1439
  }, [paginate]);
1440
+ // Determinar el texto del botón según el paso
1441
+ var getButtonText = function () {
1442
+ if (page === 0) {
1443
+ return t.next;
1444
+ }
1445
+ if (page === steps.length - 1) {
1446
+ return completeButtonText || t.complete;
1447
+ }
1448
+ return t.continue;
1449
+ };
1450
+ // Determinar la acción del botón según el paso
1451
+ var handleNextAction = function () {
1452
+ if (page === steps.length - 1) {
1453
+ // Último paso: ejecutar acción de completado
1454
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
1455
+ }
1456
+ else {
1457
+ // Otros pasos: continuar al siguiente
1458
+ onNext();
1459
+ }
1460
+ };
1400
1461
  var content = React.useMemo(function () {
1401
- return (jsx(LazyMotion, { features: domAnimation, children: jsx(m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1402
- y: {
1403
- ease: "backOut",
1404
- duration: 0.35,
1405
- },
1406
- opacity: { duration: 0.4 },
1407
- }, variants: variants, children: steps[page].content }, page) }));
1408
- }, [page, steps, direction]);
1462
+ return (jsx("div", { className: "col-span-12", children: steps[page].content }, page));
1463
+ }, [page, steps]);
1409
1464
  if (!isOpen) {
1410
1465
  return null;
1411
1466
  }
1412
- return (jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, 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" }), jsxs("div", { className: "relative flex h-fit w-full flex-col pt-6 text-center lg:h-full lg:justify-center lg:pt-0", children: [content, jsx(MultistepNavigationButtons, { backButtonProps: {
1413
- isDisabled: page === 0,
1414
- onPress: onBack,
1415
- children: t.goBack,
1416
- }, cancelButtonProps: {
1417
- onPress: onClose,
1418
- children: t.cancel,
1419
- }, nextButtonProps: {
1420
- children: page === 0
1421
- ? t.signUp
1422
- : page === steps.length - 1
1423
- ? t.goToPayment
1424
- : t.continue,
1425
- onPress: onNext,
1426
- } })] })] }));
1467
+ 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: {
1468
+ isDisabled: page === 0,
1469
+ onPress: onBack,
1470
+ children: t.goBack,
1471
+ }, cancelButtonProps: {
1472
+ onPress: onClose,
1473
+ children: t.cancel,
1474
+ }, nextButtonProps: {
1475
+ children: getButtonText(),
1476
+ onPress: handleNextAction,
1477
+ isDisabled: steps[page].isStepValid === false,
1478
+ } })] }));
1427
1479
  };
1428
1480
 
1429
1481
  var Pagination = function (_a) {
@@ -1549,7 +1601,7 @@ var Phone = function (_a) {
1549
1601
  onChange({ countryCode: selectedCountry.code, phoneNumber: val });
1550
1602
  }
1551
1603
  };
1552
- return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1", children: [finalLabel, " ", required && jsx("span", { className: "text-danger-500", children: "*" })] })), jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 dark:focus-within:border-primary-500 ".concat(error ? "border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsx("title", { children: t.expandListAriaLabel }), jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsx(Input$1, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 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-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1604
+ return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsx("span", { className: "text-danger-500", children: "*" })] })), jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsx("title", { children: t.expandListAriaLabel }), jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsx(Input$1, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 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-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1553
1605
  createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", children: [jsx("div", { className: "p-2", children: jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
1554
1606
  var searchTerm = e.target.value.toLowerCase();
1555
1607
  var filtered = uniqueCountries.filter(function (country) {
@@ -2707,4 +2759,4 @@ var AuraToastProvider = function (_a) {
2707
2759
  return (jsx(ToastContext.Provider, { value: { toast: toast, showToast: showToast, hideToast: hideToast }, children: children }));
2708
2760
  };
2709
2761
 
2710
- export { AddHolidayForm, AnalyticsCard, AuraTable, AuraToastProvider, AutoComplete, Button, Card, ColorSelector, DatePicker, DateRangePicker, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, P, Pagination, Phone, PromotionalBanner, RowSteps, ScheduleRow, Select, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, sizeMap, themeColors, useAuraToast, useThemeContext };
2762
+ export { AddHolidayForm, AnalyticsCard, AuraTable, AuraToastProvider, AutoComplete, Button, Card, ColorSelector, DatePicker, DateRangePicker, DateSelector, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, Input, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, P, Pagination, Phone, PromotionalBanner, RowSteps, ScheduleRow, Select, StepIndicator, Switch as SwitchComponent, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, UploadFile, VerticalSteps, sizeMap, themeColors, useAuraToast, useThemeContext };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { DateSelectorProps } from "./DateSelector.types";
3
+ /**
4
+ * DateSelector - Componente para seleccionar fechas individuales o rangos de fechas
5
+ * basado en HeroUI siguiendo las reglas de diseño BeweOS.
6
+ * Maneja su propio estado interno de manera autónoma.
7
+ */
8
+ export declare const DateSelector: React.FC<DateSelectorProps>;
9
+ //# sourceMappingURL=DateSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/date-selector/DateSelector.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAU9D;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmGpD,CAAC"}