lizaui 9.0.25 → 9.0.27

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.
Files changed (72) hide show
  1. package/dist/autocomplete/index.cjs.js +14149 -0
  2. package/dist/autocomplete/index.cjs.js.map +1 -0
  3. package/dist/autocomplete/index.es.js +14133 -0
  4. package/dist/autocomplete/index.es.js.map +1 -0
  5. package/dist/autocomplete.d.ts +2 -0
  6. package/dist/calendar/index.cjs.js +138 -28
  7. package/dist/calendar/index.cjs.js.map +1 -1
  8. package/dist/calendar/index.es.js +138 -28
  9. package/dist/calendar/index.es.js.map +1 -1
  10. package/dist/chunks/_commonjsHelpers-Bc2YnDe1.js +8 -0
  11. package/dist/chunks/_commonjsHelpers-Bc2YnDe1.js.map +1 -0
  12. package/dist/chunks/_commonjsHelpers-DWwsNxpa.js +9 -0
  13. package/dist/chunks/_commonjsHelpers-DWwsNxpa.js.map +1 -0
  14. package/dist/chunks/{index-BPW1Qzmi.js → createLucideIcon-Bxsl-Fn_.js} +1 -35
  15. package/dist/chunks/createLucideIcon-Bxsl-Fn_.js.map +1 -0
  16. package/dist/chunks/{index-BAHiLt0S.js → createLucideIcon-C5oU6LEj.js} +2 -20
  17. package/dist/chunks/createLucideIcon-C5oU6LEj.js.map +1 -0
  18. package/dist/chunks/index-CADDwL6K.js +38 -0
  19. package/dist/chunks/index-CADDwL6K.js.map +1 -0
  20. package/dist/chunks/index-DBpvJQOe.js +22 -0
  21. package/dist/chunks/index-DBpvJQOe.js.map +1 -0
  22. package/dist/chunks/{scroll-area-B-5YmafW.js → scroll-area-BOU8O70p.js} +13 -12
  23. package/dist/chunks/{scroll-area-B-5YmafW.js.map → scroll-area-BOU8O70p.js.map} +1 -1
  24. package/dist/chunks/{scroll-area-WNAy-5-i.js → scroll-area-DAQUXpBS.js} +3 -2
  25. package/dist/chunks/{scroll-area-WNAy-5-i.js.map → scroll-area-DAQUXpBS.js.map} +1 -1
  26. package/dist/chunks/{select-C9BYUpJm.js → select-BSYrEccf.js} +5 -4
  27. package/dist/chunks/select-BSYrEccf.js.map +1 -0
  28. package/dist/chunks/{select-CLIZOVIj.js → select-BVS-SGsI.js} +5 -4
  29. package/dist/chunks/select-BVS-SGsI.js.map +1 -0
  30. package/dist/chunks/{styled-components.browser.esm-CYnGom5T.js → styled-components.browser.esm-C5L9Ov58.js} +2 -4
  31. package/dist/chunks/{styled-components.browser.esm-CYnGom5T.js.map → styled-components.browser.esm-C5L9Ov58.js.map} +1 -1
  32. package/dist/chunks/{styled-components.browser.esm-CPR7VH_x.js → styled-components.browser.esm-Cg8LpeaI.js} +3 -5
  33. package/dist/chunks/{styled-components.browser.esm-CPR7VH_x.js.map → styled-components.browser.esm-Cg8LpeaI.js.map} +1 -1
  34. package/dist/components/autocomplete/autocomplete-dropdown.d.ts +3 -0
  35. package/dist/components/autocomplete/autocomplete-dropdown.d.ts.map +1 -0
  36. package/dist/components/autocomplete/autocomplete-option-item.d.ts +18 -0
  37. package/dist/components/autocomplete/autocomplete-option-item.d.ts.map +1 -0
  38. package/dist/components/autocomplete/autocomplete-option-list.d.ts +4 -0
  39. package/dist/components/autocomplete/autocomplete-option-list.d.ts.map +1 -0
  40. package/dist/components/autocomplete/autocomplete-types.d.ts +97 -0
  41. package/dist/components/autocomplete/autocomplete-types.d.ts.map +1 -0
  42. package/dist/components/autocomplete/autocomplete-utils.d.ts +19 -0
  43. package/dist/components/autocomplete/autocomplete-utils.d.ts.map +1 -0
  44. package/dist/components/autocomplete/index.d.ts +5 -0
  45. package/dist/components/autocomplete/index.d.ts.map +1 -0
  46. package/dist/components/autocomplete/input-autocomplete-form.d.ts +3 -0
  47. package/dist/components/autocomplete/input-autocomplete-form.d.ts.map +1 -0
  48. package/dist/components/autocomplete/use-autocomplete-dropdown.d.ts +9 -0
  49. package/dist/components/autocomplete/use-autocomplete-dropdown.d.ts.map +1 -0
  50. package/dist/components/autocomplete/use-key-press.d.ts +6 -0
  51. package/dist/components/autocomplete/use-key-press.d.ts.map +1 -0
  52. package/dist/components/button/use-button.d.ts +46 -46
  53. package/dist/components/calendar/date-picker/date-picker.d.ts.map +1 -1
  54. package/dist/components/calendar/date-picker/date-picker.style.d.ts.map +1 -1
  55. package/dist/components/chip/use-chip.d.ts +50 -50
  56. package/dist/pagination/index.cjs.js +1 -1
  57. package/dist/pagination/index.es.js +1 -1
  58. package/dist/phone-input/index.cjs.js +2 -2
  59. package/dist/phone-input/index.es.js +2 -2
  60. package/dist/time-input/index.cjs.js +1 -1
  61. package/dist/time-input/index.es.js +1 -1
  62. package/dist/types/icon.type.d.ts +7 -1
  63. package/dist/types/icon.type.d.ts.map +1 -1
  64. package/dist/ui/index.cjs.js +19 -18
  65. package/dist/ui/index.cjs.js.map +1 -1
  66. package/dist/ui/index.es.js +21 -20
  67. package/dist/ui/index.es.js.map +1 -1
  68. package/package.json +7 -1
  69. package/dist/chunks/index-BAHiLt0S.js.map +0 -1
  70. package/dist/chunks/index-BPW1Qzmi.js.map +0 -1
  71. package/dist/chunks/select-C9BYUpJm.js.map +0 -1
  72. package/dist/chunks/select-CLIZOVIj.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ export * from './components/autocomplete/index'
2
+ export {}
@@ -10,13 +10,12 @@ const DatePicker = require("react-date-picker");
10
10
  const React = require("react");
11
11
  const ReactDOM = require("react-dom");
12
12
  const clsx = require("clsx");
13
- const styledComponents_browser_esm = require("../chunks/styled-components.browser.esm-CPR7VH_x.js");
13
+ const styledComponents_browser_esm = require("../chunks/styled-components.browser.esm-Cg8LpeaI.js");
14
14
  const DateInput = require("react-date-picker/dist/DateInput");
15
15
  const tailwindMerge = require("tailwind-merge");
16
16
  const uuid = require("uuid");
17
17
  const labelError = require("../chunks/label-error-C8lIsfXu.js");
18
18
  const utils = require("../chunks/utils-ij3i9zTT.js");
19
- const button = require("../chunks/button-d5z8H59K.js");
20
19
  function FaArrowLeft(props) {
21
20
  return iconBase.GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" }, "child": [] }] })(props);
22
21
  }
@@ -417,18 +416,18 @@ const CalendarStyle = styledComponents_browser_esm.dt.div`
417
416
  width: ${({ widthcalendar }) => `${widthcalendar}px`};
418
417
  } */
419
418
 
420
- .react-calendar--doubleView{
421
- --cal-cell-size: 34px !important;
422
- width: 512px !important;
423
- }
419
+ .react-calendar--doubleView {
420
+ --cal-cell-size: 34px !important;
421
+ width: 512px !important;
422
+ }
424
423
 
425
- .react-calendar--doubleView .react-calendar__month-view__weekdays{
426
- gap: 0px;
427
- }
424
+ .react-calendar--doubleView .react-calendar__month-view__weekdays {
425
+ gap: 0px;
426
+ }
428
427
 
429
- .react-calendar--doubleView .react-calendar__month-view__days {
430
- gap: 0px;
431
- }
428
+ .react-calendar--doubleView .react-calendar__month-view__days {
429
+ gap: 0px;
430
+ }
432
431
 
433
432
  .react-calendar__navigation {
434
433
  height: 40px; /* Más compacto */
@@ -533,6 +532,11 @@ const CalendarStyle = styledComponents_browser_esm.dt.div`
533
532
  transition: background-color 0.18s ease, color 0.18s ease, border-radius 0.25s ease, transform 0.18s ease;
534
533
  }
535
534
 
535
+ .react-calendar__tile--hasActive {
536
+ background: var(--color-primary-300);
537
+ border-radius: 50% !important;
538
+ }
539
+
536
540
  /* Suavizar botones navegación (heredan selector button) */
537
541
  .react-calendar__navigation button {
538
542
  transition: background-color 0.18s ease, color 0.18s ease, border-radius 0.25s ease;
@@ -584,16 +588,16 @@ const CalendarStyle = styledComponents_browser_esm.dt.div`
584
588
  border-radius: 50%;
585
589
  width: var(--cal-cell-size);
586
590
  height: var(--cal-cell-size);
587
- min-width: var(--cal-cell-size);
588
- max-width: var(--cal-cell-size);
589
- min-height: var(--cal-cell-size);
590
- max-height: var(--cal-cell-size);
591
- color: hsl(var(--color-default-400) / 1);
591
+ min-width: var(--cal-cell-size);
592
+ max-width: var(--cal-cell-size);
593
+ min-height: var(--cal-cell-size);
594
+ max-height: var(--cal-cell-size);
595
+ color: hsl(var(--color-default-400) / 1);
592
596
  }
593
597
 
594
- .react-calendar__year-view__months__month{
595
- border-radius: 8px !important;
596
- }
598
+ .react-calendar__year-view__months__month {
599
+ border-radius: 8px !important;
600
+ }
597
601
 
598
602
  ${({ color }) => {
599
603
  switch (color) {
@@ -717,15 +721,21 @@ const CalendarStyle = styledComponents_browser_esm.dt.div`
717
721
  }}
718
722
 
719
723
  .react-calendar--doubleView .react-calendar__tile--active {
720
- background-color: var(--color-default-100);
721
- color: var(--color-default-900);
724
+ background-color: var(--color-primary-50);
725
+ color: var(--color-primary);
722
726
  border-radius: 0px;
727
+ position: relative;
723
728
  }
724
729
 
730
+
725
731
  .react-calendar--selectRange .react-calendar__tile--hover {
726
732
  background-color: var(--color-default-100);
727
733
  }
728
734
 
735
+ .react-calendar--selectRange .react-calendar__tile--hover.react-calendar__month-view__days__day{
736
+ /* border-radius: 0px !important; */
737
+ }
738
+
729
739
  .react-calendar__tile--active.react-calendar__month-view__days__day.react-calendar__month-view__days__day--neighboringMonth {
730
740
  background-color: var(--color-content1-default);
731
741
  color: var(--color-default-300);
@@ -795,6 +805,81 @@ const CalendarPicker = ({
795
805
  handleChange(date);
796
806
  }
797
807
  };
808
+ const startOfDay = React.useCallback((d) => new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0, 0), []);
809
+ const addDays = React.useCallback((d, n) => startOfDay(new Date(d.getFullYear(), d.getMonth(), d.getDate() + n)), [startOfDay]);
810
+ const startOfMonth = React.useCallback((d) => new Date(d.getFullYear(), d.getMonth(), 1, 0, 0, 0, 0), []);
811
+ const endOfMonth = React.useCallback((d) => new Date(d.getFullYear(), d.getMonth() + 1, 0, 23, 59, 59, 999), []);
812
+ const isSameDay = (a, b) => {
813
+ if (!a || !b) return false;
814
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
815
+ };
816
+ const isSameRange = (range, target) => {
817
+ if (!Array.isArray(range) || !Array.isArray(target)) return false;
818
+ const [r0, r1] = range;
819
+ const [t0, t1] = target;
820
+ return isSameDay(r0, t0) && isSameDay(r1, t1);
821
+ };
822
+ const presets = React.useMemo(() => {
823
+ const today = startOfDay(/* @__PURE__ */ new Date());
824
+ if (type === "date-picker") {
825
+ return [
826
+ { key: "today", label: "Hoy", getValue: () => today },
827
+ { key: "tomorrow", label: "Mañana", getValue: () => addDays(today, 1) },
828
+ { key: "in7", label: "+7 días", getValue: () => addDays(today, 7) },
829
+ { key: "in30", label: "+30 días", getValue: () => addDays(today, 30) },
830
+ { key: "clear", label: "Limpiar", action: () => onChange(null), separator: true }
831
+ ];
832
+ } else {
833
+ const last7Start = addDays(today, -6);
834
+ const next7End = addDays(today, 6);
835
+ const thisMonthStart = startOfMonth(today);
836
+ const thisMonthEnd = endOfMonth(today);
837
+ const lastMonthRef = addDays(thisMonthStart, -1);
838
+ const lastMonthStart = startOfMonth(lastMonthRef);
839
+ const lastMonthEnd = endOfMonth(lastMonthRef);
840
+ return [
841
+ { key: "today", label: "Hoy", getValue: () => [today, today] },
842
+ { key: "last7", label: "Últimos 7 días", getValue: () => [last7Start, today] },
843
+ { key: "next7", label: "Próx. 7 días", getValue: () => [today, next7End] },
844
+ { key: "thisMonth", label: "Este mes", getValue: () => [thisMonthStart, thisMonthEnd] },
845
+ {
846
+ key: "nextMonth",
847
+ label: "Próximo mes",
848
+ getValue: () => {
849
+ const nextMonthRef = addDays(thisMonthEnd, 1);
850
+ const nextMonthStart = startOfMonth(nextMonthRef);
851
+ const nextMonthEnd = endOfMonth(nextMonthRef);
852
+ return [nextMonthStart, nextMonthEnd];
853
+ }
854
+ },
855
+ { key: "lastMonth", label: "Mes pasado", getValue: () => [lastMonthStart, lastMonthEnd] }
856
+ // { key: "clear", label: "Limpiar", action: () => onChange(null), separator: true },
857
+ ];
858
+ }
859
+ }, [type, onChange, addDays, startOfDay, startOfMonth, endOfMonth]);
860
+ const isPresetActive = (preset) => {
861
+ if (preset.getValue) {
862
+ const pv = preset.getValue();
863
+ if (type === "date-picker") {
864
+ return !Array.isArray(value) && !Array.isArray(pv) && isSameDay(value, pv);
865
+ } else {
866
+ return Array.isArray(value) && Array.isArray(pv) && isSameRange(value, pv);
867
+ }
868
+ }
869
+ return false;
870
+ };
871
+ const handlePresetClick = (preset) => {
872
+ if (preset.action) {
873
+ preset.action();
874
+ setShow(false);
875
+ return;
876
+ }
877
+ if (preset.getValue) {
878
+ const v = preset.getValue();
879
+ onChange(v);
880
+ setShow(false);
881
+ }
882
+ };
798
883
  const handleCloseCalendar = () => {
799
884
  if (disabled) return;
800
885
  setShow(false);
@@ -836,7 +921,36 @@ const CalendarPicker = ({
836
921
  /* <Loading size="sm" color="secondary" /> */
837
922
  /* @__PURE__ */ jsxRuntime.jsx("p", { children: "loading" })
838
923
  ) : null,
839
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full relative flex flex-col gap-2", children: [
924
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full relative flex gap-2", children: [
925
+ showActionButtons && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-[150px] border-r border-default-200 px-3 py-3 flex flex-col gap-1 overflow-y-auto max-h-[340px]", children: [
926
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-default-400 mb-1 select-none uppercase tracking-wide", children: "Atajos" }),
927
+ presets.map((p) => {
928
+ const active = isPresetActive(p);
929
+ return /* @__PURE__ */ jsxRuntime.jsx(
930
+ "button",
931
+ {
932
+ type: "button",
933
+ onClick: () => handlePresetClick(p),
934
+ className: tailwindMerge.twMerge(
935
+ "text-left rounded-md px-2 py-1.5 text-sm w-full cursor-pointer transition-colors",
936
+ active ? "bg-default-200/70 dark:bg-default-100 font-medium" : "bg-content1 hover:bg-default-100"
937
+ ),
938
+ "data-active": active || void 0,
939
+ children: p.label
940
+ },
941
+ p.key
942
+ );
943
+ }),
944
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 pt-2 border-t border-default-200 flex flex-col gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(
945
+ "button",
946
+ {
947
+ type: "button",
948
+ onClick: handleChangeToDay,
949
+ className: "text-left rounded-md px-2 py-1.5 text-sm w-full cursor-pointer bg-content1 hover:bg-default-100",
950
+ children: "Ir a hoy (Cerrar)"
951
+ }
952
+ ) })
953
+ ] }),
840
954
  /* @__PURE__ */ jsxRuntime.jsx(
841
955
  Calendar,
842
956
  {
@@ -854,11 +968,7 @@ const CalendarPicker = ({
854
968
  nextLabel: /* @__PURE__ */ jsxRuntime.jsx(FaArrowRight, { className: "w-4 h-4 text-default-400" }),
855
969
  tileContent
856
970
  }
857
- ),
858
- showActionButtons && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-x-4 p-3 w-full", children: [
859
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: handleChangeToDay, color, className: "flex-1", children: "Hoy" }),
860
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { color: "default", variant: "bordered", className: "flex-1", onClick: () => setShow(false), children: "Cerrar" })
861
- ] })
971
+ )
862
972
  ] })
863
973
  ]
864
974
  }