lkd-web-kit 0.3.5 → 0.3.7

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 (165) hide show
  1. package/dist/index.cjs.js +118 -0
  2. package/dist/index.cjs10.js +16 -0
  3. package/dist/index.cjs11.js +16 -0
  4. package/dist/index.cjs12.js +16 -0
  5. package/dist/index.cjs13.js +16 -0
  6. package/dist/index.cjs14.js +118 -0
  7. package/dist/index.cjs15.js +16 -0
  8. package/dist/index.cjs16.js +18 -0
  9. package/dist/index.cjs17.js +70 -0
  10. package/dist/index.cjs18.js +14 -0
  11. package/dist/index.cjs19.js +66 -0
  12. package/dist/index.cjs2.js +43 -0
  13. package/dist/index.cjs20.js +21 -0
  14. package/dist/index.cjs21.js +30 -0
  15. package/dist/index.cjs22.js +23 -0
  16. package/dist/index.cjs23.js +15 -0
  17. package/dist/index.cjs24.js +16 -0
  18. package/dist/index.cjs25.js +16 -0
  19. package/dist/index.cjs26.js +18 -0
  20. package/dist/index.cjs27.js +17 -0
  21. package/dist/index.cjs28.js +17 -0
  22. package/dist/index.cjs29.js +17 -0
  23. package/dist/index.cjs3.js +12 -0
  24. package/dist/index.cjs30.js +17 -0
  25. package/dist/index.cjs31.js +17 -0
  26. package/dist/index.cjs32.js +17 -0
  27. package/dist/index.cjs33.js +17 -0
  28. package/dist/index.cjs34.js +17 -0
  29. package/dist/index.cjs35.js +29 -0
  30. package/dist/index.cjs36.js +17 -0
  31. package/dist/index.cjs37.js +17 -0
  32. package/dist/index.cjs38.js +51 -0
  33. package/dist/index.cjs39.js +38 -0
  34. package/dist/index.cjs4.js +40 -0
  35. package/dist/index.cjs40.js +15 -0
  36. package/dist/index.cjs41.js +23 -0
  37. package/dist/index.cjs42.js +39 -0
  38. package/dist/index.cjs43.js +24 -0
  39. package/dist/index.cjs44.js +14 -0
  40. package/dist/index.cjs45.js +19 -0
  41. package/dist/index.cjs46.js +43 -0
  42. package/dist/index.cjs47.js +14 -0
  43. package/dist/index.cjs48.js +20 -0
  44. package/dist/index.cjs49.js +11 -0
  45. package/dist/index.cjs5.js +54 -0
  46. package/dist/index.cjs50.js +45 -0
  47. package/dist/index.cjs51.js +19 -0
  48. package/dist/index.cjs52.js +24 -0
  49. package/dist/index.cjs53.js +7 -0
  50. package/dist/index.cjs54.js +65 -0
  51. package/dist/index.cjs6.js +18 -0
  52. package/dist/index.cjs7.js +18 -0
  53. package/dist/index.cjs8.js +17 -0
  54. package/dist/index.cjs9.js +16 -0
  55. package/dist/index.es.js +52 -0
  56. package/dist/index.es10.js +12 -0
  57. package/dist/index.es11.js +12 -0
  58. package/dist/index.es12.js +12 -0
  59. package/dist/index.es13.js +12 -0
  60. package/dist/index.es14.js +114 -0
  61. package/dist/index.es15.js +12 -0
  62. package/dist/index.es16.js +14 -0
  63. package/dist/index.es17.js +66 -0
  64. package/dist/index.es18.js +10 -0
  65. package/dist/index.es19.js +60 -0
  66. package/dist/index.es2.js +39 -0
  67. package/dist/index.es20.js +16 -0
  68. package/dist/index.es21.js +26 -0
  69. package/dist/index.es22.js +19 -0
  70. package/dist/index.es23.js +11 -0
  71. package/dist/index.es24.js +12 -0
  72. package/dist/index.es25.js +12 -0
  73. package/dist/index.es26.js +14 -0
  74. package/dist/index.es27.js +13 -0
  75. package/dist/index.es28.js +13 -0
  76. package/dist/index.es29.js +13 -0
  77. package/dist/index.es3.js +8 -0
  78. package/dist/index.es30.js +13 -0
  79. package/dist/index.es31.js +13 -0
  80. package/dist/index.es32.js +13 -0
  81. package/dist/index.es33.js +13 -0
  82. package/dist/index.es34.js +13 -0
  83. package/dist/index.es35.js +23 -0
  84. package/dist/index.es36.js +13 -0
  85. package/dist/index.es37.js +13 -0
  86. package/dist/index.es38.js +47 -0
  87. package/dist/index.es39.js +34 -0
  88. package/dist/index.es4.js +36 -0
  89. package/dist/index.es40.js +11 -0
  90. package/dist/index.es41.js +19 -0
  91. package/dist/index.es42.js +35 -0
  92. package/dist/index.es43.js +20 -0
  93. package/dist/{src/mantine/breakpoints-with-px.js → index.es44.js} +4 -5
  94. package/dist/index.es45.js +15 -0
  95. package/dist/index.es46.js +39 -0
  96. package/dist/index.es47.js +10 -0
  97. package/dist/index.es48.js +15 -0
  98. package/dist/index.es49.js +7 -0
  99. package/dist/index.es5.js +50 -0
  100. package/dist/index.es50.js +40 -0
  101. package/dist/index.es51.js +15 -0
  102. package/dist/index.es52.js +20 -0
  103. package/dist/index.es53.js +3 -0
  104. package/dist/index.es54.js +63 -0
  105. package/dist/index.es6.js +14 -0
  106. package/dist/index.es7.js +14 -0
  107. package/dist/index.es8.js +13 -0
  108. package/dist/index.es9.js +12 -0
  109. package/dist/node_modules/@mantine/notifications/styles.css +42 -0
  110. package/package.json +15 -5
  111. package/dist/lkd-web-kit.css +0 -1
  112. package/dist/src/components/EmptyState/index.js +0 -36
  113. package/dist/src/components/Icon.js +0 -47
  114. package/dist/src/components/InfinityLoader/index.js +0 -9
  115. package/dist/src/components/MyDatePickerInput/CalendarIcon.js +0 -61
  116. package/dist/src/components/MyDatePickerInput/index.js +0 -14
  117. package/dist/src/components/MyDateTimePicker/index.js +0 -14
  118. package/dist/src/components/MyMonthPickerInput/index.js +0 -14
  119. package/dist/src/components/MyMultiSelect/index.js +0 -12
  120. package/dist/src/components/MyNotifications/index.js +0 -13
  121. package/dist/src/components/MyNumberInput/index.js +0 -12
  122. package/dist/src/components/MySelect/index.js +0 -12
  123. package/dist/src/components/MyTextInput/index.js +0 -12
  124. package/dist/src/components/MyTextarea/index.js +0 -12
  125. package/dist/src/components/MyTimeInput/index.js +0 -12
  126. package/dist/src/components/NavItems.js +0 -36
  127. package/dist/src/components/SelectInfinity/index.js +0 -106
  128. package/dist/src/consts/http-status.js +0 -4
  129. package/dist/src/consts/revalidate.js +0 -4
  130. package/dist/src/contexts/NavigationHistoryContext/index.js +0 -47
  131. package/dist/src/contexts/PageDataContext/index.js +0 -15
  132. package/dist/src/form/Form.js +0 -23
  133. package/dist/src/form/FormButtonSubmit.js +0 -18
  134. package/dist/src/form/base/FormCheckbox.js +0 -15
  135. package/dist/src/form/base/FormDatePickerInput.js +0 -21
  136. package/dist/src/form/base/FormDateTimePicker.js +0 -21
  137. package/dist/src/form/base/FormMonthPickerInput.js +0 -21
  138. package/dist/src/form/base/FormMultiSelect.js +0 -21
  139. package/dist/src/form/base/FormNumberInput.js +0 -21
  140. package/dist/src/form/base/FormRadioGroup.js +0 -14
  141. package/dist/src/form/base/FormSelect.js +0 -21
  142. package/dist/src/form/base/FormSelectInfinity.js +0 -21
  143. package/dist/src/form/base/FormTextInput.js +0 -21
  144. package/dist/src/form/base/FormTextarea.js +0 -21
  145. package/dist/src/form/base/FormTimeInput.js +0 -29
  146. package/dist/src/form/utils/nullable-but-required.js +0 -10
  147. package/dist/src/form/utils/optional-but-required.js +0 -10
  148. package/dist/src/form/utils/zodValidator.js +0 -9
  149. package/dist/src/hocs/withForm.js +0 -59
  150. package/dist/src/hocs/withModalManager.js +0 -29
  151. package/dist/src/hooks/useBreakpoint.js +0 -8
  152. package/dist/src/hooks/useFetchNextPageOnScroll.js +0 -19
  153. package/dist/src/hooks/useOnScrollProgress.js +0 -25
  154. package/dist/src/hooks/useUpdateSearchParams.js +0 -19
  155. package/dist/src/main.js +0 -113
  156. package/dist/src/mantine/my-default-theme.js +0 -39
  157. package/dist/src/mantine/to-tailwind-colors.js +0 -10
  158. package/dist/src/utils/array/groupBy.js +0 -36
  159. package/dist/src/utils/array/shuffleArray.js +0 -13
  160. package/dist/src/utils/formatBytes.js +0 -8
  161. package/dist/src/utils/isInfinityEmpty.js +0 -4
  162. package/dist/src/utils/ky/addBodyJsonHook.js +0 -12
  163. package/dist/src/utils/ky/parseJson.js +0 -6
  164. package/dist/src/utils/newHref.js +0 -20
  165. /package/dist/{main.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,18 @@
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 withForm = require('./index.cjs38.js');
8
+
9
+ const FormCheckbox = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ core.Checkbox,
11
+ {
12
+ ...field,
13
+ checked: field.value,
14
+ ...props
15
+ }
16
+ ));
17
+
18
+ exports.FormCheckbox = FormCheckbox;
@@ -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 index = require('./index.cjs6.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormDatePickerInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyDatePickerInput,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormDatePickerInput = FormDatePickerInput;
@@ -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 index = require('./index.cjs7.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormDateTimePicker = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyDateTimePicker,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormDateTimePicker = FormDateTimePicker;
@@ -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 index = require('./index.cjs9.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormNumberInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyNumberInput,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormNumberInput = FormNumberInput;
@@ -0,0 +1,12 @@
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 InfinityLoader = ({ infinity, loaderProps, ...props }) => {
9
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Center, { ...props, children: infinity.isFetching ? /* @__PURE__ */ jsxRuntime.jsx(core.Loader, { ...loaderProps }) : !infinity.hasNextPage && (infinity.data?.pages.length ?? 0) > 1 && /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No hay más resultados" }) });
10
+ };
11
+
12
+ exports.InfinityLoader = InfinityLoader;
@@ -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 core = require('@mantine/core');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormRadioGroup = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ core.Radio.Group,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormRadioGroup = FormRadioGroup;
@@ -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 index = require('./index.cjs10.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormSelect = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MySelect,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormSelect = FormSelect;
@@ -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 index = require('./index.cjs14.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormSelectInfinity = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.SelectInfinity,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormSelectInfinity = FormSelectInfinity;
@@ -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 index = require('./index.cjs11.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormTextarea = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyTextarea,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormTextarea = FormTextarea;
@@ -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 index = require('./index.cjs12.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormTextInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyTextInput,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormTextInput = FormTextInput;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const jsxRuntime = require('react/jsx-runtime');
6
+ const index = require('./index.cjs13.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormTimeInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyTimeInput,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+ const timeInputToNumber = (timeInput) => {
17
+ const [hours, minutes] = timeInput.split(":").map(Number);
18
+ const result = hours + minutes / 60;
19
+ return Number(result.toFixed(2));
20
+ };
21
+ const numberToTimeInput = (number) => {
22
+ const hours = Math.floor(number);
23
+ const minutes = Math.round((number - hours) * 60);
24
+ return `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
25
+ };
26
+
27
+ exports.FormTimeInput = FormTimeInput;
28
+ exports.numberToTimeInput = numberToTimeInput;
29
+ exports.timeInputToNumber = timeInputToNumber;
@@ -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 index = require('./index.cjs15.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormMultiSelect = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyMultiSelect,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormMultiSelect = FormMultiSelect;
@@ -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 index = require('./index.cjs16.js');
7
+ const withForm = require('./index.cjs38.js');
8
+
9
+ const FormMonthPickerInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ index.MyMonthPickerInput,
11
+ {
12
+ ...field,
13
+ ...props
14
+ }
15
+ ));
16
+
17
+ exports.FormMonthPickerInput = FormMonthPickerInput;
@@ -0,0 +1,51 @@
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 reactHookForm = require('react-hook-form');
8
+ const zodValidator = require('./index.cjs23.js');
9
+
10
+ const withForm = (WrappedComponent, getControllerProps) => {
11
+ const FormField = (props) => {
12
+ const { validate, name = "", placeholder, label, description, ...withFormRestProps } = props;
13
+ return /* @__PURE__ */ jsxRuntime.jsx(
14
+ reactHookForm.Controller,
15
+ {
16
+ name,
17
+ defaultValue: "",
18
+ rules: {
19
+ validate: validate && !props.disabled ? zodValidator.zodValidator(validate) : void 0
20
+ },
21
+ disabled: props.disabled,
22
+ ...getControllerProps?.(props),
23
+ render: (renderProps) => {
24
+ const {
25
+ fieldState: { error }
26
+ } = renderProps;
27
+ const fieldProps = {
28
+ ...renderProps,
29
+ props: {
30
+ ...props,
31
+ validate: void 0
32
+ },
33
+ field: {
34
+ ...renderProps.field,
35
+ label,
36
+ placeholder,
37
+ description,
38
+ error: error?.message
39
+ },
40
+ ...withFormRestProps
41
+ };
42
+ return /* @__PURE__ */ jsxRuntime.jsx(WrappedComponent, { ...fieldProps });
43
+ }
44
+ }
45
+ );
46
+ };
47
+ FormField.displayName = `WithForm(${WrappedComponent.displayName})`;
48
+ return FormField;
49
+ };
50
+
51
+ exports.withForm = withForm;
@@ -0,0 +1,38 @@
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 react = require('react');
8
+
9
+ const withModalManager = (WrappedComponent) => {
10
+ const Component = ({
11
+ removeModal,
12
+ opened,
13
+ ...props
14
+ }) => {
15
+ const [isOpen, setIsOpen] = react.useState(false);
16
+ const onClose = () => {
17
+ setIsOpen(false);
18
+ setTimeout(() => removeModal(), 200);
19
+ props.onClose?.();
20
+ };
21
+ react.useEffect(() => {
22
+ if (opened) setTimeout(() => setIsOpen(true), 0);
23
+ else onClose();
24
+ }, [opened]);
25
+ return /* @__PURE__ */ jsxRuntime.jsx(
26
+ WrappedComponent,
27
+ {
28
+ ...props,
29
+ opened: isOpen,
30
+ onClose
31
+ }
32
+ );
33
+ };
34
+ Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;
35
+ return Component;
36
+ };
37
+
38
+ exports.withModalManager = withModalManager;
@@ -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,15 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const core = require('@mantine/core');
7
+
8
+ const useBreakpoint = (breakpoint) => {
9
+ const result = core.useMatches({
10
+ [breakpoint]: true
11
+ });
12
+ return !!result;
13
+ };
14
+
15
+ exports.useBreakpoint = useBreakpoint;
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const useOnScrollProgress = require('./index.cjs42.js');
7
+
8
+ const useFetchNextPageOnScroll = ({
9
+ infinity,
10
+ scrollRef,
11
+ disabled = false
12
+ }) => {
13
+ useOnScrollProgress.useOnScrollProgress({
14
+ triggerPercentage: 0.9,
15
+ callback: () => {
16
+ if (infinity.hasNextPage) infinity.fetchNextPage();
17
+ },
18
+ scrollRef,
19
+ disabled
20
+ });
21
+ };
22
+
23
+ exports.useFetchNextPageOnScroll = useFetchNextPageOnScroll;
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const react = require('react');
7
+
8
+ const useOnScrollProgress = ({
9
+ triggerPercentage,
10
+ callback,
11
+ scrollRef,
12
+ disabled = false
13
+ }) => {
14
+ if (triggerPercentage < 0 || triggerPercentage > 1)
15
+ throw new Error("El porcentaje debe estar entre 0 y 1");
16
+ react.useEffect(() => {
17
+ if (disabled || scrollRef && scrollRef.current === null) return;
18
+ let hasTriggered = false;
19
+ const handleScroll = () => {
20
+ const el = scrollRef?.current;
21
+ const target = el ?? document.documentElement;
22
+ const scrollHeight = target.scrollHeight - target.clientHeight;
23
+ const scrollTop = el ? target.scrollTop : window.scrollY;
24
+ const scrollProgress = scrollHeight > 0 ? Math.min(1, scrollTop / scrollHeight) : 0;
25
+ if (!hasTriggered && scrollProgress >= triggerPercentage) {
26
+ callback();
27
+ hasTriggered = true;
28
+ }
29
+ };
30
+ const scrollTarget = scrollRef?.current ?? window;
31
+ scrollTarget.addEventListener("scroll", handleScroll);
32
+ handleScroll();
33
+ return () => {
34
+ scrollTarget.removeEventListener("scroll", handleScroll);
35
+ };
36
+ }, [triggerPercentage, callback, scrollRef, disabled]);
37
+ };
38
+
39
+ exports.useOnScrollProgress = useOnScrollProgress;
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const navigation = require('next/navigation');
7
+
8
+ const useUpdateSearchParams = () => {
9
+ const searchParams = navigation.useSearchParams();
10
+ const updateSearchParams = (newSearchparams) => {
11
+ const params = new URLSearchParams(searchParams.toString());
12
+ Object.entries(newSearchparams).forEach(([key, value]) => {
13
+ if (value === null) {
14
+ params.delete(key);
15
+ return;
16
+ }
17
+ params.set(key, String(value));
18
+ });
19
+ window?.history?.pushState(null, "", `?${params.toString()}`);
20
+ };
21
+ return { updateSearchParams, searchParams };
22
+ };
23
+
24
+ exports.useUpdateSearchParams = useUpdateSearchParams;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const breakpointsWithPx = {
6
+ xs: "576px",
7
+ sm: "640px",
8
+ md: "768px",
9
+ lg: "1024px",
10
+ xl: "1280px",
11
+ ["2xl"]: "1536px"
12
+ };
13
+
14
+ exports.breakpointsWithPx = breakpointsWithPx;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const toTailwindColors = (colors) => Object.entries(colors).reduce(
6
+ (acc, [key, value]) => {
7
+ acc[key] = value.reduce(
8
+ (acc2, color, index) => {
9
+ acc2[index] = color;
10
+ return acc2;
11
+ },
12
+ {}
13
+ );
14
+ return acc;
15
+ },
16
+ {}
17
+ );
18
+
19
+ exports.toTailwindColors = toTailwindColors;
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const core = require('@mantine/core');
6
+ const breakpointsWithPx = require('./index.cjs44.js');
7
+
8
+ const myDefaultTheme = {
9
+ breakpoints: breakpointsWithPx.breakpointsWithPx,
10
+ cursorType: "pointer",
11
+ components: {
12
+ Notification: core.Notification.extend({
13
+ defaultProps: {
14
+ withBorder: true
15
+ }
16
+ }),
17
+ AppShell: core.AppShell.extend({
18
+ defaultProps: {
19
+ padding: 0
20
+ }
21
+ }),
22
+ Select: core.Select.extend({
23
+ defaultProps: {
24
+ allowDeselect: false,
25
+ withCheckIcon: false,
26
+ clearable: true
27
+ }
28
+ }),
29
+ Menu: core.Menu.extend({
30
+ defaultProps: {
31
+ position: "bottom-end"
32
+ }
33
+ }),
34
+ Tooltip: core.Tooltip.extend({
35
+ defaultProps: {
36
+ multiline: true,
37
+ w: 300
38
+ }
39
+ })
40
+ }
41
+ };
42
+
43
+ exports.myDefaultTheme = myDefaultTheme;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ function formatBytes(bytes, decimals = 2) {
6
+ if (!+bytes) return "0 Bytes";
7
+ const k = 1024;
8
+ const dm = decimals < 0 ? 0 : decimals;
9
+ const sizes = ["Bytes", "KB", "MB"];
10
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
11
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
12
+ }
13
+
14
+ exports.formatBytes = formatBytes;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const ky = require('ky');
6
+ const parseJson = require('./index.cjs49.js');
7
+
8
+ class KyError extends ky.HTTPError {
9
+ constructor(response, request, options, bodyJson) {
10
+ super(response, request, options);
11
+ this.response.bodyJson = bodyJson;
12
+ }
13
+ }
14
+ const addBodyJsonHook = async (error) => {
15
+ error.response.bodyJson = await parseJson.parseJSON(error.response);
16
+ return error;
17
+ };
18
+
19
+ exports.KyError = KyError;
20
+ exports.addBodyJsonHook = addBodyJsonHook;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const parseJSON = async (response) => {
6
+ return response.text().then(function(text) {
7
+ return text ? JSON.parse(text) : {};
8
+ });
9
+ };
10
+
11
+ exports.parseJSON = parseJSON;
@@ -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;