lkd-web-kit 0.3.4 → 0.3.5

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 (56) hide show
  1. package/dist/src/components/EmptyState/index.js +36 -0
  2. package/dist/src/components/Icon.js +47 -0
  3. package/dist/src/components/InfinityLoader/index.js +9 -0
  4. package/dist/src/components/MyDatePickerInput/CalendarIcon.js +61 -0
  5. package/dist/src/components/MyDatePickerInput/index.js +14 -0
  6. package/dist/src/components/MyDateTimePicker/index.js +14 -0
  7. package/dist/src/components/MyMonthPickerInput/index.js +14 -0
  8. package/dist/src/components/MyMultiSelect/index.js +12 -0
  9. package/dist/src/components/MyNotifications/index.js +13 -0
  10. package/dist/src/components/MyNumberInput/index.js +12 -0
  11. package/dist/src/components/MySelect/index.js +12 -0
  12. package/dist/src/components/MyTextInput/index.js +12 -0
  13. package/dist/src/components/MyTextarea/index.js +12 -0
  14. package/dist/src/components/MyTimeInput/index.js +12 -0
  15. package/dist/src/components/NavItems.js +36 -0
  16. package/dist/src/components/SelectInfinity/index.js +106 -0
  17. package/dist/src/consts/http-status.js +4 -0
  18. package/dist/src/consts/revalidate.js +4 -0
  19. package/dist/src/contexts/NavigationHistoryContext/index.js +47 -0
  20. package/dist/src/contexts/PageDataContext/index.js +15 -0
  21. package/dist/src/form/Form.js +23 -0
  22. package/dist/src/form/FormButtonSubmit.js +18 -0
  23. package/dist/src/form/base/FormCheckbox.js +15 -0
  24. package/dist/src/form/base/FormDatePickerInput.js +21 -0
  25. package/dist/src/form/base/FormDateTimePicker.js +21 -0
  26. package/dist/src/form/base/FormMonthPickerInput.js +21 -0
  27. package/dist/src/form/base/FormMultiSelect.js +21 -0
  28. package/dist/src/form/base/FormNumberInput.js +21 -0
  29. package/dist/src/form/base/FormRadioGroup.js +14 -0
  30. package/dist/src/form/base/FormSelect.js +21 -0
  31. package/dist/src/form/base/FormSelectInfinity.js +21 -0
  32. package/dist/src/form/base/FormTextInput.js +21 -0
  33. package/dist/src/form/base/FormTextarea.js +21 -0
  34. package/dist/src/form/base/FormTimeInput.js +29 -0
  35. package/dist/src/form/utils/nullable-but-required.js +10 -0
  36. package/dist/src/form/utils/optional-but-required.js +10 -0
  37. package/dist/src/form/utils/zodValidator.js +9 -0
  38. package/dist/src/hocs/withForm.js +59 -0
  39. package/dist/src/hocs/withModalManager.js +29 -0
  40. package/dist/src/hooks/useBreakpoint.js +8 -0
  41. package/dist/src/hooks/useFetchNextPageOnScroll.js +19 -0
  42. package/dist/src/hooks/useOnScrollProgress.js +25 -0
  43. package/dist/src/hooks/useUpdateSearchParams.js +19 -0
  44. package/dist/src/main.js +113 -0
  45. package/dist/src/mantine/breakpoints-with-px.js +11 -0
  46. package/dist/src/mantine/my-default-theme.js +39 -0
  47. package/dist/src/mantine/to-tailwind-colors.js +10 -0
  48. package/dist/src/utils/array/groupBy.js +36 -0
  49. package/dist/src/utils/array/shuffleArray.js +13 -0
  50. package/dist/src/utils/formatBytes.js +8 -0
  51. package/dist/src/utils/isInfinityEmpty.js +4 -0
  52. package/dist/src/utils/ky/addBodyJsonHook.js +12 -0
  53. package/dist/src/utils/ky/parseJson.js +6 -0
  54. package/dist/src/utils/newHref.js +20 -0
  55. package/package.json +3 -3
  56. package/dist/main.js +0 -779
@@ -0,0 +1,36 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import o from "clsx";
3
+ import { Icon as a } from "../Icon.js";
4
+ const x = {
5
+ sm: 48,
6
+ md: 60,
7
+ lg: 84
8
+ }, f = ({
9
+ label: s,
10
+ action: m,
11
+ icon: t,
12
+ className: r,
13
+ size: i = "md",
14
+ ...c
15
+ }) => /* @__PURE__ */ l(
16
+ "div",
17
+ {
18
+ className: o("justfiy-center flex flex-col items-center gap-1", r),
19
+ ...c,
20
+ children: [
21
+ t && /* @__PURE__ */ e(
22
+ a,
23
+ {
24
+ i: t,
25
+ size: x[i],
26
+ className: "text-gray-2"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ e("p", { className: "text-gray-6 text-sm font-semibold", children: s }),
30
+ /* @__PURE__ */ e("div", { children: m })
31
+ ]
32
+ }
33
+ );
34
+ export {
35
+ f as EmptyState
36
+ };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import d from "clsx";
4
+ const n = ({ i: h, size: t = "md", style: i, rotate: e, className: o, ...r }) => /* @__PURE__ */ s(
5
+ h,
6
+ {
7
+ ...typeof t == "number" ? {
8
+ height: t,
9
+ width: t
10
+ } : m[t],
11
+ viewBox: "0 0 24 24",
12
+ style: {
13
+ ...i,
14
+ transform: `rotate(${e}deg)`
15
+ },
16
+ className: d("shrink-0", o),
17
+ ...r
18
+ }
19
+ ), m = {
20
+ xs: {
21
+ height: 16,
22
+ width: 16
23
+ },
24
+ sm: {
25
+ height: 20,
26
+ width: 20
27
+ },
28
+ md: {
29
+ height: 24,
30
+ width: 24
31
+ },
32
+ lg: {
33
+ height: 28,
34
+ width: 28
35
+ },
36
+ xl: {
37
+ height: 32,
38
+ width: 32
39
+ },
40
+ "2xl": {
41
+ height: 40,
42
+ width: 40
43
+ }
44
+ };
45
+ export {
46
+ n as Icon
47
+ };
@@ -0,0 +1,9 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Center as s, Loader as d } from "@mantine/core";
3
+ const n = ({ infinity: e, loaderProps: t, ...a }) => {
4
+ var o;
5
+ return /* @__PURE__ */ r(s, { ...a, children: e.isFetching ? /* @__PURE__ */ r(d, { ...t }) : !e.hasNextPage && (((o = e.data) == null ? void 0 : o.pages.length) ?? 0) > 1 && /* @__PURE__ */ r("p", { children: "No hay más resultados" }) });
6
+ };
7
+ export {
8
+ n as InfinityLoader
9
+ };
@@ -0,0 +1,61 @@
1
+ import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
+ const r = ({ size: e = "sm", ...d }) => /* @__PURE__ */ C(
3
+ "svg",
4
+ {
5
+ viewBox: "0 0 24 24",
6
+ fill: "none",
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: e === "sm" ? 20 : 24,
9
+ height: e === "sm" ? 20 : 24,
10
+ children: [
11
+ /* @__PURE__ */ l(
12
+ "path",
13
+ {
14
+ fillRule: "evenodd",
15
+ clipRule: "evenodd",
16
+ d: "M6 5.5C5.66848 5.5 5.35054 5.6317 5.11612 5.86612C4.8817 6.10054 4.75 6.41848 4.75 6.75V18.75C4.75 19.0815 4.8817 19.3995 5.11612 19.6339C5.35054 19.8683 5.66848 20 6 20H18C18.3315 20 18.6495 19.8683 18.8839 19.6339C19.1183 19.3995 19.25 19.0815 19.25 18.75V6.75C19.25 6.41848 19.1183 6.10054 18.8839 5.86612C18.6495 5.6317 18.3315 5.5 18 5.5H6ZM4.05546 4.80546C4.57118 4.28973 5.27065 4 6 4H18C18.7293 4 19.4288 4.28973 19.9445 4.80546C20.4603 5.32118 20.75 6.02065 20.75 6.75V18.75C20.75 19.4793 20.4603 20.1788 19.9445 20.6945C19.4288 21.2103 18.7293 21.5 18 21.5H6C5.27065 21.5 4.57118 21.2103 4.05546 20.6945C3.53973 20.1788 3.25 19.4793 3.25 18.75V6.75C3.25 6.02065 3.53973 5.32118 4.05546 4.80546Z",
17
+ fill: "currentColor"
18
+ }
19
+ ),
20
+ /* @__PURE__ */ l(
21
+ "path",
22
+ {
23
+ fillRule: "evenodd",
24
+ clipRule: "evenodd",
25
+ d: "M16 2C16.4142 2 16.75 2.33579 16.75 2.75V6.75C16.75 7.16421 16.4142 7.5 16 7.5C15.5858 7.5 15.25 7.16421 15.25 6.75V2.75C15.25 2.33579 15.5858 2 16 2Z",
26
+ fill: "currentColor"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ l(
30
+ "path",
31
+ {
32
+ fillRule: "evenodd",
33
+ clipRule: "evenodd",
34
+ d: "M8 2C8.41421 2 8.75 2.33579 8.75 2.75V6.75C8.75 7.16421 8.41421 7.5 8 7.5C7.58579 7.5 7.25 7.16421 7.25 6.75V2.75C7.25 2.33579 7.58579 2 8 2Z",
35
+ fill: "currentColor"
36
+ }
37
+ ),
38
+ /* @__PURE__ */ l(
39
+ "path",
40
+ {
41
+ fillRule: "evenodd",
42
+ clipRule: "evenodd",
43
+ d: "M3.25 10.75C3.25 10.3358 3.58579 10 4 10H20C20.4142 10 20.75 10.3358 20.75 10.75C20.75 11.1642 20.4142 11.5 20 11.5H4C3.58579 11.5 3.25 11.1642 3.25 10.75Z",
44
+ fill: "currentColor"
45
+ }
46
+ ),
47
+ /* @__PURE__ */ l(
48
+ "path",
49
+ {
50
+ fillRule: "evenodd",
51
+ clipRule: "evenodd",
52
+ d: "M7 14.3929C7 14.0378 7.28782 13.75 7.64286 13.75H9.35714C9.71218 13.75 10 14.0378 10 14.3929V16.1071C10 16.4622 9.71218 16.75 9.35714 16.75H7.64286C7.28782 16.75 7 16.4622 7 16.1071V14.3929Z",
53
+ fill: "currentColor"
54
+ }
55
+ )
56
+ ]
57
+ }
58
+ );
59
+ export {
60
+ r as default
61
+ };
@@ -0,0 +1,14 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { DatePickerInput as i } from "@mantine/dates";
3
+ import r from "./CalendarIcon.js";
4
+ const f = (e) => /* @__PURE__ */ t(
5
+ i,
6
+ {
7
+ leftSection: /* @__PURE__ */ t(r, { size: e.size }),
8
+ variant: e.readOnly ? "filled" : "default",
9
+ ...e
10
+ }
11
+ );
12
+ export {
13
+ f as MyDatePickerInput
14
+ };
@@ -0,0 +1,14 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { DateTimePicker as t } from "@mantine/dates";
3
+ import r from "../MyDatePickerInput/CalendarIcon.js";
4
+ const f = (e) => /* @__PURE__ */ i(
5
+ t,
6
+ {
7
+ leftSection: /* @__PURE__ */ i(r, { size: e.size }),
8
+ variant: e.readOnly ? "filled" : "default",
9
+ ...e
10
+ }
11
+ );
12
+ export {
13
+ f as MyDateTimePicker
14
+ };
@@ -0,0 +1,14 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { MonthPickerInput as i } from "@mantine/dates";
3
+ import n from "../MyDatePickerInput/CalendarIcon.js";
4
+ const f = (t) => /* @__PURE__ */ e(
5
+ i,
6
+ {
7
+ leftSection: /* @__PURE__ */ e(n, { size: t.size }),
8
+ variant: t.readOnly ? "filled" : "default",
9
+ ...t
10
+ }
11
+ );
12
+ export {
13
+ f as MyMonthPickerInput
14
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { MultiSelect as l } from "@mantine/core";
3
+ const o = (t) => /* @__PURE__ */ e(
4
+ l,
5
+ {
6
+ variant: t.readOnly ? "filled" : "default",
7
+ ...t
8
+ }
9
+ );
10
+ export {
11
+ o as MyMultiSelect
12
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Notifications as i } from "@mantine/notifications";
3
+ /* empty css */
4
+ const n = (o) => /* @__PURE__ */ t(
5
+ i,
6
+ {
7
+ position: "top-center",
8
+ ...o
9
+ }
10
+ );
11
+ export {
12
+ n as MyNotifications
13
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { NumberInput as e } from "@mantine/core";
3
+ const o = (r) => /* @__PURE__ */ t(
4
+ e,
5
+ {
6
+ variant: r.readOnly ? "filled" : "default",
7
+ ...r
8
+ }
9
+ );
10
+ export {
11
+ o as MyNumberInput
12
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Select as l } from "@mantine/core";
3
+ const a = (e) => /* @__PURE__ */ t(
4
+ l,
5
+ {
6
+ variant: e.readOnly ? "filled" : "default",
7
+ ...e
8
+ }
9
+ );
10
+ export {
11
+ a as MySelect
12
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { TextInput as r } from "@mantine/core";
3
+ const a = (t) => /* @__PURE__ */ e(
4
+ r,
5
+ {
6
+ variant: t.readOnly ? "filled" : "default",
7
+ ...t
8
+ }
9
+ );
10
+ export {
11
+ a as MyTextInput
12
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Textarea as r } from "@mantine/core";
3
+ const f = (a) => /* @__PURE__ */ e(
4
+ r,
5
+ {
6
+ variant: a.readOnly ? "filled" : "default",
7
+ ...a
8
+ }
9
+ );
10
+ export {
11
+ f as MyTextarea
12
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { TextInput as r } from "@mantine/core";
3
+ const n = (t) => /* @__PURE__ */ e(
4
+ r,
5
+ {
6
+ variant: t.readOnly ? "filled" : "default",
7
+ ...t
8
+ }
9
+ );
10
+ export {
11
+ n as MyTimeInput
12
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { Stack as u, NavLink as a } from "@mantine/core";
4
+ import i from "next/link";
5
+ import { usePathname as p } from "next/navigation";
6
+ const x = ({ items: c, activeStrategy: r = "includes" }) => {
7
+ const o = p();
8
+ return /* @__PURE__ */ m(u, { gap: 0, children: c.map(({ href: t, isActive: n, ...e }) => {
9
+ if (t) {
10
+ const l = n ?? (r === "equals" ? t === o : t.includes(o));
11
+ return /* @__PURE__ */ m(
12
+ a,
13
+ {
14
+ active: l,
15
+ component: i,
16
+ prefetch: !1,
17
+ href: t,
18
+ ...e
19
+ },
20
+ e.label
21
+ );
22
+ }
23
+ return /* @__PURE__ */ m(
24
+ a,
25
+ {
26
+ active: n,
27
+ component: "button",
28
+ ...e
29
+ },
30
+ e.label
31
+ );
32
+ }) });
33
+ };
34
+ export {
35
+ x as NavItems
36
+ };
@@ -0,0 +1,106 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
3
+ import { useCombobox as D, Combobox as r, InputBase as I, Input as N, ScrollArea as P } from "@mantine/core";
4
+ import { useRef as y } from "react";
5
+ import { useFetchNextPageOnScroll as A } from "../../hooks/useFetchNextPageOnScroll.js";
6
+ import { InfinityLoader as E } from "../InfinityLoader/index.js";
7
+ function F({
8
+ value: b,
9
+ onChange: s,
10
+ data: u = [],
11
+ searchValue: a,
12
+ onSearchChange: t,
13
+ renderOption: m,
14
+ onOptionSubmit: c,
15
+ nothingFoundMessage: x,
16
+ infinity: i,
17
+ placeholder: v,
18
+ ...w
19
+ }) {
20
+ const l = D({
21
+ onDropdownClose: () => {
22
+ l.resetSelectedOption(), l.focusTarget(), t == null || t("");
23
+ },
24
+ onDropdownOpen: () => {
25
+ l.focusSearchInput();
26
+ }
27
+ }), d = u.map((o) => /* @__PURE__ */ e(
28
+ r.Option,
29
+ {
30
+ value: o.value,
31
+ children: m ? m({ option: o }) : o.label
32
+ },
33
+ o.value
34
+ )), p = u.find((o) => o.value === b), f = y(null);
35
+ return A({ infinity: i, scrollRef: f }), /* @__PURE__ */ n(
36
+ r,
37
+ {
38
+ store: l,
39
+ middlewares: {
40
+ shift: {
41
+ crossAxis: !0
42
+ }
43
+ },
44
+ onOptionSubmit: (o) => {
45
+ s == null || s(o), c == null || c(o), l.closeDropdown();
46
+ },
47
+ children: [
48
+ /* @__PURE__ */ e(r.Target, { children: /* @__PURE__ */ e(
49
+ I,
50
+ {
51
+ component: "button",
52
+ type: "button",
53
+ pointer: !0,
54
+ rightSection: /* @__PURE__ */ e(r.Chevron, {}),
55
+ onClick: () => l.toggleDropdown(),
56
+ rightSectionPointerEvents: "none",
57
+ ...w,
58
+ children: (p == null ? void 0 : p.label) || /* @__PURE__ */ e(N.Placeholder, { children: v })
59
+ }
60
+ ) }),
61
+ /* @__PURE__ */ n(r.Dropdown, { children: [
62
+ /* @__PURE__ */ e(
63
+ r.Search,
64
+ {
65
+ value: a,
66
+ onChange: (o) => t == null ? void 0 : t(o.currentTarget.value),
67
+ placeholder: "Escribe para buscar"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ e(r.Options, { children: /* @__PURE__ */ n(
71
+ P.Autosize,
72
+ {
73
+ mah: 200,
74
+ type: "scroll",
75
+ viewportRef: f,
76
+ children: [
77
+ d.length > 0 ? d : i.isFetching ? null : /* @__PURE__ */ e(
78
+ r.Empty,
79
+ {
80
+ onClick: () => l.closeDropdown(),
81
+ className: "min-h-6",
82
+ children: x ?? "Sin resultados"
83
+ }
84
+ ),
85
+ /* @__PURE__ */ e(
86
+ E,
87
+ {
88
+ className: "text-sm",
89
+ infinity: i,
90
+ loaderProps: {
91
+ size: "sm",
92
+ className: "mt-1 mb-2"
93
+ }
94
+ }
95
+ )
96
+ ]
97
+ }
98
+ ) })
99
+ ] })
100
+ ]
101
+ }
102
+ );
103
+ }
104
+ export {
105
+ F as SelectInfinity
106
+ };
@@ -0,0 +1,4 @@
1
+ var o = /* @__PURE__ */ ((e) => (e[e.Continue = 100] = "Continue", e[e.SwitchingProtocols = 101] = "SwitchingProtocols", e[e.Processing = 102] = "Processing", e[e.EarlyHints = 103] = "EarlyHints", e[e.Ok = 200] = "Ok", e[e.Created = 201] = "Created", e[e.Accepted = 202] = "Accepted", e[e.NonAuthoritativeInformation = 203] = "NonAuthoritativeInformation", e[e.NoContent = 204] = "NoContent", e[e.ResetContent = 205] = "ResetContent", e[e.PartialContent = 206] = "PartialContent", e[e.MultiStatus = 207] = "MultiStatus", e[e.AlreadyReported = 208] = "AlreadyReported", e[e.ImUsed = 226] = "ImUsed", e[e.MultipleChoices = 300] = "MultipleChoices", e[e.MovedPermanently = 301] = "MovedPermanently", e[e.Found = 302] = "Found", e[e.SeeOther = 303] = "SeeOther", e[e.NotModified = 304] = "NotModified", e[e.UseProxy = 305] = "UseProxy", e[e.TemporaryRedirect = 307] = "TemporaryRedirect", e[e.PermanentRedirect = 308] = "PermanentRedirect", e[e.BadRequest = 400] = "BadRequest", e[e.Unauthorized = 401] = "Unauthorized", e[e.PaymentRequired = 402] = "PaymentRequired", e[e.Forbidden = 403] = "Forbidden", e[e.NotFound = 404] = "NotFound", e[e.MethodNotAllowed = 405] = "MethodNotAllowed", e[e.NotAcceptable = 406] = "NotAcceptable", e[e.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", e[e.RequestTimeout = 408] = "RequestTimeout", e[e.Conflict = 409] = "Conflict", e[e.Gone = 410] = "Gone", e[e.LengthRequired = 411] = "LengthRequired", e[e.PreconditionFailed = 412] = "PreconditionFailed", e[e.PayloadTooLarge = 413] = "PayloadTooLarge", e[e.UriTooLong = 414] = "UriTooLong", e[e.UnsupportedMediaType = 415] = "UnsupportedMediaType", e[e.RangeNotSatisfiable = 416] = "RangeNotSatisfiable", e[e.ExpectationFailed = 417] = "ExpectationFailed", e[e.MisdirectedRequest = 421] = "MisdirectedRequest", e[e.UnprocessableEntity = 422] = "UnprocessableEntity", e[e.Locked = 423] = "Locked", e[e.FailedDependency = 424] = "FailedDependency", e[e.TooEarly = 425] = "TooEarly", e[e.UpgradeRequired = 426] = "UpgradeRequired", e[e.PreconditionRequired = 428] = "PreconditionRequired", e[e.TooManyRequests = 429] = "TooManyRequests", e[e.RequestHeaderFieldsTooLarge = 431] = "RequestHeaderFieldsTooLarge", e[e.UnavailableForLegalReasons = 451] = "UnavailableForLegalReasons", e[e.InternalServerError = 500] = "InternalServerError", e[e.NotImplemented = 501] = "NotImplemented", e[e.BadGateway = 502] = "BadGateway", e[e.ServiceUnavailable = 503] = "ServiceUnavailable", e[e.GatewayTimeout = 504] = "GatewayTimeout", e[e.HttpVersionNotSupported = 505] = "HttpVersionNotSupported", e[e.VariantAlsoNegotiates = 506] = "VariantAlsoNegotiates", e[e.InsufficientStorage = 507] = "InsufficientStorage", e[e.LoopDetected = 508] = "LoopDetected", e[e.NotExtended = 510] = "NotExtended", e[e.NetworkAuthenticationRequired = 511] = "NetworkAuthenticationRequired", e))(o || {});
2
+ export {
3
+ o as HttpStatus
4
+ };
@@ -0,0 +1,4 @@
1
+ var O = /* @__PURE__ */ ((n) => (n[n.OneHour = 3600] = "OneHour", n[n.OneDay = 86400] = "OneDay", n[n.OneWeek = 604800] = "OneWeek", n[n.OneMonth = 2592e3] = "OneMonth", n[n.OneYear = 31536e3] = "OneYear", n))(O || {});
2
+ export {
3
+ O as Revalidate
4
+ };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx as g } from "react/jsx-runtime";
3
+ import { usePathname as l, useSearchParams as i, useRouter as f } from "next/navigation";
4
+ import { createContext as m, useState as P, useEffect as v, useContext as y } from "react";
5
+ const c = m(null);
6
+ function H({ children: s }) {
7
+ const e = l(), o = i(), [t, u] = P([]);
8
+ return v(() => {
9
+ const r = o != null && o.size ? `${e}?${o.toString()}` : e;
10
+ r && u((n) => n.length > 0 && n[n.length - 1] === r ? n : [...n, r]);
11
+ }, [e, o]), /* @__PURE__ */ g(c.Provider, { value: { history: t }, children: s });
12
+ }
13
+ const R = "backUrl";
14
+ function N() {
15
+ const s = y(c), e = f();
16
+ if (!s)
17
+ throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
18
+ const o = i(), { history: t } = s;
19
+ return {
20
+ history: t,
21
+ goBack: (r) => {
22
+ const n = o.get(R);
23
+ if (n) {
24
+ e.push(n);
25
+ return;
26
+ }
27
+ if (t.length <= 1) {
28
+ e.push(r ?? "/");
29
+ return;
30
+ }
31
+ const a = t[t.length - 2], h = t[t.length - 1];
32
+ if (t.length >= 3 && t[t.length - 3] === h) {
33
+ e.push(r ?? "/");
34
+ return;
35
+ }
36
+ e.push(a ?? "/");
37
+ },
38
+ currentRoute: t.length > 0 ? t[t.length - 1] : null,
39
+ hasPreviousRoute: t.length > 1,
40
+ getPreviousRoute: () => t.length >= 2 ? t[t.length - 2] : null
41
+ };
42
+ }
43
+ export {
44
+ H as NavigationHistoryProvider,
45
+ R as QP_BACK_URL_NAME,
46
+ N as useNavigationHistory
47
+ };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { createContext as a, useContext as n } from "react";
4
+ const e = a(void 0), c = ({
5
+ value: t,
6
+ children: o
7
+ }) => /* @__PURE__ */ r(e.Provider, { value: t, children: o }), u = () => {
8
+ const t = n(e);
9
+ if (t === void 0) throw new Error("Out of context: usePageData");
10
+ return t;
11
+ };
12
+ export {
13
+ c as PageDataProvider,
14
+ u as usePageData
15
+ };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { Box as p } from "@mantine/core";
4
+ import { FormProvider as e } from "react-hook-form";
5
+ const a = ({
6
+ methods: o,
7
+ onSubmit: t = () => {
8
+ },
9
+ onSubmitError: i,
10
+ ...n
11
+ }) => /* @__PURE__ */ m(e, { ...o, children: /* @__PURE__ */ m(
12
+ p,
13
+ {
14
+ component: "form",
15
+ onSubmit: (r) => {
16
+ r.stopPropagation(), o.handleSubmit(t, i)(r);
17
+ },
18
+ ...n
19
+ }
20
+ ) });
21
+ export {
22
+ a as Form
23
+ };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { Button as i } from "@mantine/core";
4
+ import { useFormContext as n } from "react-hook-form";
5
+ const p = (t) => {
6
+ const { formState: o } = n(), { isSubmitting: m } = o;
7
+ return /* @__PURE__ */ r(
8
+ i,
9
+ {
10
+ loading: m,
11
+ type: "submit",
12
+ ...t
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ p as FormButtonSubmit
18
+ };
@@ -0,0 +1,15 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Checkbox as t } from "@mantine/core";
3
+ import { withForm as c } from "../../hocs/withForm.js";
4
+ import "react";
5
+ const x = c(({ field: o, props: r }) => /* @__PURE__ */ m(
6
+ t,
7
+ {
8
+ ...o,
9
+ checked: o.value,
10
+ ...r
11
+ }
12
+ ));
13
+ export {
14
+ x as FormCheckbox
15
+ };
@@ -0,0 +1,21 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "clsx";
3
+ import "@mantine/core";
4
+ import "next/link";
5
+ import "next/navigation";
6
+ import { MyDatePickerInput as m } from "../../components/MyDatePickerInput/index.js";
7
+ import "@mantine/dates";
8
+ import "@mantine/notifications";
9
+ /* empty css */
10
+ import "react";
11
+ import { withForm as i } from "../../hocs/withForm.js";
12
+ const F = i(({ field: r, props: o }) => /* @__PURE__ */ t(
13
+ m,
14
+ {
15
+ ...r,
16
+ ...o
17
+ }
18
+ ));
19
+ export {
20
+ F as FormDatePickerInput
21
+ };
@@ -0,0 +1,21 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "clsx";
3
+ import "@mantine/core";
4
+ import "next/link";
5
+ import "next/navigation";
6
+ import "@mantine/dates";
7
+ import { MyDateTimePicker as i } from "../../components/MyDateTimePicker/index.js";
8
+ import "@mantine/notifications";
9
+ /* empty css */
10
+ import "react";
11
+ import { withForm as t } from "../../hocs/withForm.js";
12
+ const T = t(({ field: r, props: m }) => /* @__PURE__ */ o(
13
+ i,
14
+ {
15
+ ...r,
16
+ ...m
17
+ }
18
+ ));
19
+ export {
20
+ T as FormDateTimePicker
21
+ };
@@ -0,0 +1,21 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "clsx";
3
+ import "@mantine/core";
4
+ import "next/link";
5
+ import "next/navigation";
6
+ import "@mantine/dates";
7
+ import "@mantine/notifications";
8
+ /* empty css */
9
+ import "react";
10
+ import { MyMonthPickerInput as m } from "../../components/MyMonthPickerInput/index.js";
11
+ import { withForm as i } from "../../hocs/withForm.js";
12
+ const F = i(({ field: o, props: r }) => /* @__PURE__ */ t(
13
+ m,
14
+ {
15
+ ...o,
16
+ ...r
17
+ }
18
+ ));
19
+ export {
20
+ F as FormMonthPickerInput
21
+ };
@@ -0,0 +1,21 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import "clsx";
3
+ import "@mantine/core";
4
+ import "next/link";
5
+ import "next/navigation";
6
+ import "@mantine/dates";
7
+ import "@mantine/notifications";
8
+ /* empty css */
9
+ import "react";
10
+ import { MyMultiSelect as m } from "../../components/MyMultiSelect/index.js";
11
+ import { withForm as i } from "../../hocs/withForm.js";
12
+ const h = i(({ field: o, props: t }) => /* @__PURE__ */ r(
13
+ m,
14
+ {
15
+ ...o,
16
+ ...t
17
+ }
18
+ ));
19
+ export {
20
+ h as FormMultiSelect
21
+ };