lkd-web-kit 0.3.18 → 0.3.20

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 (110) hide show
  1. package/dist/components/EmptyState/index.cjs +43 -0
  2. package/dist/{index2.mjs → components/EmptyState/index.js} +1 -1
  3. package/dist/components/Icon.cjs +54 -0
  4. package/dist/components/InfinityLoader/index.cjs +46 -0
  5. package/dist/components/MyDatePickerInput/CalendarIcon.cjs +65 -0
  6. package/dist/components/MyDatePickerInput/index.cjs +19 -0
  7. package/dist/{index6.mjs → components/MyDatePickerInput/index.js} +1 -1
  8. package/dist/components/MyDateTimePicker/index.cjs +19 -0
  9. package/dist/{index7.mjs → components/MyDateTimePicker/index.js} +1 -1
  10. package/dist/components/MyMonthPickerInput/index.cjs +19 -0
  11. package/dist/{index16.mjs → components/MyMonthPickerInput/index.js} +1 -1
  12. package/dist/components/MyMultiSelect/index.cjs +16 -0
  13. package/dist/components/MyNotifications/index.cjs +17 -0
  14. package/dist/{index8.mjs → components/MyNotifications/index.js} +1 -1
  15. package/dist/components/MyNumberInput/index.cjs +16 -0
  16. package/dist/components/MySelect/index.cjs +16 -0
  17. package/dist/components/MyTextInput/index.cjs +16 -0
  18. package/dist/components/MyTextarea/index.cjs +16 -0
  19. package/dist/components/MyTimeInput/index.cjs +16 -0
  20. package/dist/components/NavItems.cjs +40 -0
  21. package/dist/components/SelectInfinity/index.cjs +118 -0
  22. package/dist/{index14.mjs → components/SelectInfinity/index.js} +2 -2
  23. package/dist/consts/http-status.cjs +70 -0
  24. package/dist/consts/revalidate.cjs +14 -0
  25. package/dist/contexts/NavigationHistoryContext/index.cjs +66 -0
  26. package/dist/contexts/PageDataContext/index.cjs +21 -0
  27. package/dist/form/Form.cjs +30 -0
  28. package/dist/form/FormButtonSubmit.cjs +24 -0
  29. package/dist/form/base/FormCheckbox.cjs +18 -0
  30. package/dist/{index26.mjs → form/base/FormCheckbox.js} +1 -1
  31. package/dist/form/base/FormDatePickerInput.cjs +17 -0
  32. package/dist/{index27.mjs → form/base/FormDatePickerInput.js} +2 -2
  33. package/dist/form/base/FormDateTimePicker.cjs +17 -0
  34. package/dist/{index28.mjs → form/base/FormDateTimePicker.js} +2 -2
  35. package/dist/form/base/FormMonthPickerInput.cjs +17 -0
  36. package/dist/{index37.mjs → form/base/FormMonthPickerInput.js} +2 -2
  37. package/dist/form/base/FormMultiSelect.cjs +17 -0
  38. package/dist/{index36.mjs → form/base/FormMultiSelect.js} +2 -2
  39. package/dist/form/base/FormNumberInput.cjs +17 -0
  40. package/dist/{index29.mjs → form/base/FormNumberInput.js} +2 -2
  41. package/dist/form/base/FormRadioGroup.cjs +17 -0
  42. package/dist/{index30.mjs → form/base/FormRadioGroup.js} +1 -1
  43. package/dist/form/base/FormSelect.cjs +17 -0
  44. package/dist/{index31.mjs → form/base/FormSelect.js} +2 -2
  45. package/dist/form/base/FormSelectInfinity.cjs +17 -0
  46. package/dist/{index32.mjs → form/base/FormSelectInfinity.js} +2 -2
  47. package/dist/form/base/FormTextInput.cjs +17 -0
  48. package/dist/{index34.mjs → form/base/FormTextInput.js} +2 -2
  49. package/dist/form/base/FormTextarea.cjs +17 -0
  50. package/dist/{index33.mjs → form/base/FormTextarea.js} +2 -2
  51. package/dist/form/base/FormTimeInput.cjs +29 -0
  52. package/dist/{index35.mjs → form/base/FormTimeInput.js} +2 -2
  53. package/dist/form/utils/nullable-but-required.cjs +16 -0
  54. package/dist/form/utils/optional-but-required.cjs +16 -0
  55. package/dist/form/utils/zodValidator.cjs +15 -0
  56. package/dist/hocs/withForm.cjs +51 -0
  57. package/dist/{index38.mjs → hocs/withForm.js} +1 -1
  58. package/dist/hocs/withModalManager.cjs +38 -0
  59. package/dist/hooks/useBreakpoint.cjs +15 -0
  60. package/dist/hooks/useFetchNextPageOnScroll.cjs +23 -0
  61. package/dist/{index41.mjs → hooks/useFetchNextPageOnScroll.js} +1 -1
  62. package/dist/hooks/useOnScrollProgress.cjs +39 -0
  63. package/dist/hooks/useUpdateSearchParams.cjs +24 -0
  64. package/dist/index.cjs +117 -0
  65. package/dist/index.js +52 -0
  66. package/dist/mantine/breakpoints-with-px.cjs +14 -0
  67. package/dist/mantine/my-default-theme.cjs +43 -0
  68. package/dist/{index46.mjs → mantine/my-default-theme.js} +1 -1
  69. package/dist/mantine/to-tailwind-colors.cjs +19 -0
  70. package/dist/utils/array/groupBy.cjs +45 -0
  71. package/dist/utils/array/shuffleArray.cjs +19 -0
  72. package/dist/utils/formatBytes.cjs +14 -0
  73. package/dist/utils/isInfinityEmpty.cjs +7 -0
  74. package/dist/utils/ky/addBodyJsonHook.cjs +12 -0
  75. package/dist/{index48.mjs → utils/ky/addBodyJsonHook.js} +1 -1
  76. package/dist/utils/ky/parseJson.cjs +11 -0
  77. package/dist/utils/newHref.cjs +23 -0
  78. package/dist/{index52.mjs → utils/newHref.js} +4 -5
  79. package/package.json +13 -3
  80. package/dist/index.mjs +0 -52
  81. /package/dist/{index5.mjs → components/Icon.js} +0 -0
  82. /package/dist/{index3.mjs → components/InfinityLoader/index.js} +0 -0
  83. /package/dist/{index54.mjs → components/MyDatePickerInput/CalendarIcon.js} +0 -0
  84. /package/dist/{index15.mjs → components/MyMultiSelect/index.js} +0 -0
  85. /package/dist/{index9.mjs → components/MyNumberInput/index.js} +0 -0
  86. /package/dist/{index10.mjs → components/MySelect/index.js} +0 -0
  87. /package/dist/{index12.mjs → components/MyTextInput/index.js} +0 -0
  88. /package/dist/{index11.mjs → components/MyTextarea/index.js} +0 -0
  89. /package/dist/{index13.mjs → components/MyTimeInput/index.js} +0 -0
  90. /package/dist/{index4.mjs → components/NavItems.js} +0 -0
  91. /package/dist/{index17.mjs → consts/http-status.js} +0 -0
  92. /package/dist/{index18.mjs → consts/revalidate.js} +0 -0
  93. /package/dist/{index19.mjs → contexts/NavigationHistoryContext/index.js} +0 -0
  94. /package/dist/{index20.mjs → contexts/PageDataContext/index.js} +0 -0
  95. /package/dist/{index21.mjs → form/Form.js} +0 -0
  96. /package/dist/{index22.mjs → form/FormButtonSubmit.js} +0 -0
  97. /package/dist/{index24.mjs → form/utils/nullable-but-required.js} +0 -0
  98. /package/dist/{index25.mjs → form/utils/optional-but-required.js} +0 -0
  99. /package/dist/{index23.mjs → form/utils/zodValidator.js} +0 -0
  100. /package/dist/{index39.mjs → hocs/withModalManager.js} +0 -0
  101. /package/dist/{index40.mjs → hooks/useBreakpoint.js} +0 -0
  102. /package/dist/{index42.mjs → hooks/useOnScrollProgress.js} +0 -0
  103. /package/dist/{index43.mjs → hooks/useUpdateSearchParams.js} +0 -0
  104. /package/dist/{index44.mjs → mantine/breakpoints-with-px.js} +0 -0
  105. /package/dist/{index45.mjs → mantine/to-tailwind-colors.js} +0 -0
  106. /package/dist/{index50.mjs → utils/array/groupBy.js} +0 -0
  107. /package/dist/{index51.mjs → utils/array/shuffleArray.js} +0 -0
  108. /package/dist/{index47.mjs → utils/formatBytes.js} +0 -0
  109. /package/dist/{index53.mjs → utils/isInfinityEmpty.js} +0 -0
  110. /package/dist/{index49.mjs → utils/ky/parseJson.js} +0 -0
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const clsx = require('clsx');
7
+ const Icon = require('../Icon.cjs');
8
+
9
+ const pxBySize = {
10
+ sm: 48,
11
+ md: 60,
12
+ lg: 84
13
+ };
14
+ const EmptyState = ({
15
+ label,
16
+ action,
17
+ icon,
18
+ className,
19
+ size = "md",
20
+ ...props
21
+ }) => {
22
+ return /* @__PURE__ */ jsxRuntime.jsxs(
23
+ "div",
24
+ {
25
+ className: clsx("justfiy-center flex flex-col items-center gap-1", className),
26
+ ...props,
27
+ children: [
28
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
29
+ Icon.Icon,
30
+ {
31
+ i: icon,
32
+ size: pxBySize[size],
33
+ className: "text-gray-2"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-6 text-sm font-semibold", children: label }),
37
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: action })
38
+ ]
39
+ }
40
+ );
41
+ };
42
+
43
+ exports.EmptyState = EmptyState;
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
- import { Icon } from './index5.mjs';
3
+ import { Icon } from '../Icon.js';
4
4
 
5
5
  const pxBySize = {
6
6
  sm: 48,
@@ -0,0 +1,54 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const clsx = require('clsx');
8
+
9
+ const Icon = ({ i: I, size = "md", style, rotate, className, ...rest }) => {
10
+ return /* @__PURE__ */ jsxRuntime.jsx(
11
+ I,
12
+ {
13
+ ...typeof size === "number" ? {
14
+ height: size,
15
+ width: size
16
+ } : stylesBySize[size],
17
+ viewBox: "0 0 24 24",
18
+ style: {
19
+ ...style,
20
+ transform: `rotate(${rotate}deg)`
21
+ },
22
+ className: clsx("shrink-0", className),
23
+ ...rest
24
+ }
25
+ );
26
+ };
27
+ const stylesBySize = {
28
+ xs: {
29
+ height: 16,
30
+ width: 16
31
+ },
32
+ sm: {
33
+ height: 20,
34
+ width: 20
35
+ },
36
+ md: {
37
+ height: 24,
38
+ width: 24
39
+ },
40
+ lg: {
41
+ height: 28,
42
+ width: 28
43
+ },
44
+ xl: {
45
+ height: 32,
46
+ width: 32
47
+ },
48
+ ["2xl"]: {
49
+ height: 40,
50
+ width: 40
51
+ }
52
+ };
53
+
54
+ exports.Icon = Icon;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+ const hooks = require('@mantine/hooks');
8
+ const react = require('react');
9
+
10
+ const InfinityLoader = ({
11
+ root,
12
+ infinity,
13
+ rootMargin = "0px 0px 0px 0px",
14
+ endMessage = "No hay más resultados",
15
+ loaderProps,
16
+ ...props
17
+ }) => {
18
+ const { entry, ref } = hooks.useIntersection({
19
+ root: root?.current,
20
+ rootMargin
21
+ });
22
+ react.useEffect(() => {
23
+ if (entry?.isIntersecting && infinity.hasNextPage) infinity.fetchNextPage();
24
+ }, [entry?.isIntersecting]);
25
+ react.useEffect(() => {
26
+ if (!entry?.isIntersecting) return;
27
+ const el = root?.current ?? document.documentElement;
28
+ const hasScroll = el?.scrollHeight > el?.clientHeight;
29
+ if (!hasScroll) infinity.fetchNextPage();
30
+ }, [entry?.isIntersecting, infinity.data?.pages.length]);
31
+ return /* @__PURE__ */ jsxRuntime.jsx(
32
+ core.Center,
33
+ {
34
+ ref,
35
+ ...props,
36
+ style: {
37
+ minHeight: "1rem",
38
+ fontSize: "14px",
39
+ ...props.style
40
+ },
41
+ children: infinity.isLoading || infinity.isFetchingNextPage ? /* @__PURE__ */ jsxRuntime.jsx(core.Loader, { ...loaderProps }) : infinity.data && infinity.data.pages.length > 1 && !infinity.hasNextPage ? endMessage : null
42
+ }
43
+ );
44
+ };
45
+
46
+ exports.InfinityLoader = InfinityLoader;
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+
5
+ const CalendarIcon = ({ size = "sm", ...props }) => {
6
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7
+ "svg",
8
+ {
9
+ viewBox: "0 0 24 24",
10
+ fill: "none",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ width: size === "sm" ? 20 : 24,
13
+ height: size === "sm" ? 20 : 24,
14
+ children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx(
16
+ "path",
17
+ {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ 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",
21
+ fill: "currentColor"
22
+ }
23
+ ),
24
+ /* @__PURE__ */ jsxRuntime.jsx(
25
+ "path",
26
+ {
27
+ fillRule: "evenodd",
28
+ clipRule: "evenodd",
29
+ 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",
30
+ fill: "currentColor"
31
+ }
32
+ ),
33
+ /* @__PURE__ */ jsxRuntime.jsx(
34
+ "path",
35
+ {
36
+ fillRule: "evenodd",
37
+ clipRule: "evenodd",
38
+ 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",
39
+ fill: "currentColor"
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsxRuntime.jsx(
43
+ "path",
44
+ {
45
+ fillRule: "evenodd",
46
+ clipRule: "evenodd",
47
+ 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",
48
+ fill: "currentColor"
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsxRuntime.jsx(
52
+ "path",
53
+ {
54
+ fillRule: "evenodd",
55
+ clipRule: "evenodd",
56
+ 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",
57
+ fill: "currentColor"
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ );
63
+ };
64
+
65
+ module.exports = CalendarIcon;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const dates = require('@mantine/dates');
7
+ const CalendarIcon = require('./CalendarIcon.cjs');
8
+
9
+ const MyDatePickerInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ dates.DatePickerInput,
11
+ {
12
+ leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
13
+ leftSectionPointerEvents: "none",
14
+ variant: props.readOnly ? "filled" : "default",
15
+ ...props
16
+ }
17
+ );
18
+
19
+ exports.MyDatePickerInput = MyDatePickerInput;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { DatePickerInput } from '@mantine/dates';
3
- import CalendarIcon from './index54.mjs';
3
+ import CalendarIcon from './CalendarIcon.js';
4
4
 
5
5
  const MyDatePickerInput = (props) => /* @__PURE__ */ jsx(
6
6
  DatePickerInput,
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const dates = require('@mantine/dates');
7
+ const CalendarIcon = require('../MyDatePickerInput/CalendarIcon.cjs');
8
+
9
+ const MyDateTimePicker = (props) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ dates.DateTimePicker,
11
+ {
12
+ leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
13
+ leftSectionPointerEvents: "none",
14
+ variant: props.readOnly ? "filled" : "default",
15
+ ...props
16
+ }
17
+ );
18
+
19
+ exports.MyDateTimePicker = MyDateTimePicker;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { DateTimePicker } from '@mantine/dates';
3
- import CalendarIcon from './index54.mjs';
3
+ import CalendarIcon from '../MyDatePickerInput/CalendarIcon.js';
4
4
 
5
5
  const MyDateTimePicker = (props) => /* @__PURE__ */ jsx(
6
6
  DateTimePicker,
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const dates = require('@mantine/dates');
7
+ const CalendarIcon = require('../MyDatePickerInput/CalendarIcon.cjs');
8
+
9
+ const MyMonthPickerInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ dates.MonthPickerInput,
11
+ {
12
+ leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
13
+ leftSectionPointerEvents: "none",
14
+ variant: props.readOnly ? "filled" : "default",
15
+ ...props
16
+ }
17
+ );
18
+
19
+ exports.MyMonthPickerInput = MyMonthPickerInput;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { MonthPickerInput } from '@mantine/dates';
3
- import CalendarIcon from './index54.mjs';
3
+ import CalendarIcon from '../MyDatePickerInput/CalendarIcon.js';
4
4
 
5
5
  const MyMonthPickerInput = (props) => /* @__PURE__ */ jsx(
6
6
  MonthPickerInput,
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MyMultiSelect = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.MultiSelect,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MyMultiSelect = MyMultiSelect;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const notifications = require('@mantine/notifications');
7
+ ;/* empty css */
8
+
9
+ const MyNotifications = (props) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ notifications.Notifications,
11
+ {
12
+ position: "top-center",
13
+ ...props
14
+ }
15
+ );
16
+
17
+ exports.MyNotifications = MyNotifications;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Notifications } from '@mantine/notifications';
3
- /* empty css */
3
+ /* empty css */
4
4
 
5
5
  const MyNotifications = (props) => /* @__PURE__ */ jsx(
6
6
  Notifications,
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MyNumberInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.NumberInput,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MyNumberInput = MyNumberInput;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MySelect = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.Select,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MySelect = MySelect;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MyTextInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.TextInput,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MyTextInput = MyTextInput;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MyTextarea = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.Textarea,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MyTextarea = MyTextarea;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const core = require('@mantine/core');
7
+
8
+ const MyTimeInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
9
+ core.TextInput,
10
+ {
11
+ variant: props.readOnly ? "filled" : "default",
12
+ ...props
13
+ }
14
+ );
15
+
16
+ exports.MyTimeInput = MyTimeInput;
@@ -0,0 +1,40 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const core = require('@mantine/core');
8
+ const Link = require('next/link');
9
+ const navigation = require('next/navigation');
10
+
11
+ const NavItems = ({ items, activeStrategy = "includes" }) => {
12
+ const pathname = navigation.usePathname();
13
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Stack, { gap: 0, children: items.map(({ href, isActive, ...navLinkProps }) => {
14
+ if (href) {
15
+ const active = isActive ?? (activeStrategy === "equals" ? href === pathname : href.includes(pathname));
16
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
+ core.NavLink,
18
+ {
19
+ active,
20
+ component: Link,
21
+ prefetch: false,
22
+ href,
23
+ ...navLinkProps
24
+ },
25
+ navLinkProps.label
26
+ );
27
+ }
28
+ return /* @__PURE__ */ jsxRuntime.jsx(
29
+ core.NavLink,
30
+ {
31
+ active: isActive,
32
+ component: "button",
33
+ ...navLinkProps
34
+ },
35
+ navLinkProps.label
36
+ );
37
+ }) });
38
+ };
39
+
40
+ exports.NavItems = NavItems;
@@ -0,0 +1,118 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const core = require('@mantine/core');
8
+ const react = require('react');
9
+ const useFetchNextPageOnScroll = require('../../hooks/useFetchNextPageOnScroll.cjs');
10
+ const index = require('../InfinityLoader/index.cjs');
11
+
12
+ function SelectInfinity({
13
+ value,
14
+ onChange,
15
+ data = [],
16
+ searchValue,
17
+ onSearchChange,
18
+ renderOption,
19
+ onOptionSubmit,
20
+ nothingFoundMessage,
21
+ infinity,
22
+ placeholder,
23
+ ...props
24
+ }) {
25
+ const combobox = core.useCombobox({
26
+ onDropdownClose: () => {
27
+ combobox.resetSelectedOption();
28
+ combobox.focusTarget();
29
+ onSearchChange?.("");
30
+ },
31
+ onDropdownOpen: () => {
32
+ combobox.focusSearchInput();
33
+ }
34
+ });
35
+ const options = data.map((i) => /* @__PURE__ */ jsxRuntime.jsx(
36
+ core.Combobox.Option,
37
+ {
38
+ value: i.value,
39
+ children: renderOption ? renderOption({ option: i }) : i.label
40
+ },
41
+ i.value
42
+ ));
43
+ const selectedOption = data.find((i) => i.value === value);
44
+ const scrollRef = react.useRef(null);
45
+ useFetchNextPageOnScroll.useFetchNextPageOnScroll({ infinity, scrollRef });
46
+ return /* @__PURE__ */ jsxRuntime.jsxs(
47
+ core.Combobox,
48
+ {
49
+ store: combobox,
50
+ middlewares: {
51
+ shift: {
52
+ crossAxis: true
53
+ }
54
+ },
55
+ onOptionSubmit: (val) => {
56
+ onChange?.(val);
57
+ onOptionSubmit?.(val);
58
+ combobox.closeDropdown();
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ jsxRuntime.jsx(core.Combobox.Target, { children: /* @__PURE__ */ jsxRuntime.jsx(
62
+ core.InputBase,
63
+ {
64
+ component: "button",
65
+ type: "button",
66
+ pointer: true,
67
+ rightSection: /* @__PURE__ */ jsxRuntime.jsx(core.Combobox.Chevron, {}),
68
+ onClick: () => combobox.toggleDropdown(),
69
+ rightSectionPointerEvents: "none",
70
+ ...props,
71
+ children: selectedOption?.label || /* @__PURE__ */ jsxRuntime.jsx(core.Input.Placeholder, { children: placeholder })
72
+ }
73
+ ) }),
74
+ /* @__PURE__ */ jsxRuntime.jsxs(core.Combobox.Dropdown, { children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx(
76
+ core.Combobox.Search,
77
+ {
78
+ value: searchValue,
79
+ onChange: (event) => onSearchChange?.(event.currentTarget.value),
80
+ placeholder: "Escribe para buscar"
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsxRuntime.jsx(core.Combobox.Options, { children: /* @__PURE__ */ jsxRuntime.jsxs(
84
+ core.ScrollArea.Autosize,
85
+ {
86
+ mah: 200,
87
+ type: "scroll",
88
+ viewportRef: scrollRef,
89
+ children: [
90
+ options.length > 0 ? options : !infinity.isFetching ? /* @__PURE__ */ jsxRuntime.jsx(
91
+ core.Combobox.Empty,
92
+ {
93
+ onClick: () => combobox.closeDropdown(),
94
+ className: "min-h-6",
95
+ children: nothingFoundMessage ?? "Sin resultados"
96
+ }
97
+ ) : null,
98
+ /* @__PURE__ */ jsxRuntime.jsx(
99
+ index.InfinityLoader,
100
+ {
101
+ className: "text-sm",
102
+ infinity,
103
+ loaderProps: {
104
+ size: "sm",
105
+ className: "mt-1 mb-2"
106
+ }
107
+ }
108
+ )
109
+ ]
110
+ }
111
+ ) })
112
+ ] })
113
+ ]
114
+ }
115
+ );
116
+ }
117
+
118
+ exports.SelectInfinity = SelectInfinity;
@@ -2,8 +2,8 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useCombobox, Combobox, InputBase, Input, ScrollArea } from '@mantine/core';
4
4
  import { useRef } from 'react';
5
- import { useFetchNextPageOnScroll } from './index41.mjs';
6
- import { InfinityLoader } from './index3.mjs';
5
+ import { useFetchNextPageOnScroll } from '../../hooks/useFetchNextPageOnScroll.js';
6
+ import { InfinityLoader } from '../InfinityLoader/index.js';
7
7
 
8
8
  function SelectInfinity({
9
9
  value,