lkd-web-kit 0.3.5 → 0.3.8
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 +118 -0
- package/dist/index.cjs10.js +16 -0
- package/dist/index.cjs11.js +16 -0
- package/dist/index.cjs12.js +16 -0
- package/dist/index.cjs13.js +16 -0
- package/dist/index.cjs14.js +118 -0
- package/dist/index.cjs15.js +16 -0
- package/dist/index.cjs16.js +19 -0
- package/dist/index.cjs17.js +70 -0
- package/dist/index.cjs18.js +14 -0
- package/dist/index.cjs19.js +66 -0
- package/dist/index.cjs2.js +43 -0
- package/dist/index.cjs20.js +21 -0
- package/dist/index.cjs21.js +30 -0
- package/dist/index.cjs22.js +23 -0
- package/dist/index.cjs23.js +15 -0
- package/dist/index.cjs24.js +16 -0
- package/dist/index.cjs25.js +16 -0
- package/dist/index.cjs26.js +18 -0
- package/dist/index.cjs27.js +17 -0
- package/dist/index.cjs28.js +17 -0
- package/dist/index.cjs29.js +17 -0
- package/dist/index.cjs3.js +12 -0
- package/dist/index.cjs30.js +17 -0
- package/dist/index.cjs31.js +17 -0
- package/dist/index.cjs32.js +17 -0
- package/dist/index.cjs33.js +17 -0
- package/dist/index.cjs34.js +17 -0
- package/dist/index.cjs35.js +29 -0
- package/dist/index.cjs36.js +17 -0
- package/dist/index.cjs37.js +17 -0
- package/dist/index.cjs38.js +51 -0
- package/dist/index.cjs39.js +38 -0
- package/dist/index.cjs4.js +40 -0
- package/dist/index.cjs40.js +15 -0
- package/dist/index.cjs41.js +23 -0
- package/dist/index.cjs42.js +39 -0
- package/dist/index.cjs43.js +24 -0
- package/dist/index.cjs44.js +14 -0
- package/dist/index.cjs45.js +19 -0
- package/dist/index.cjs46.js +43 -0
- package/dist/index.cjs47.js +14 -0
- package/dist/index.cjs48.js +20 -0
- package/dist/index.cjs49.js +11 -0
- package/dist/index.cjs5.js +54 -0
- package/dist/index.cjs50.js +45 -0
- package/dist/index.cjs51.js +19 -0
- package/dist/index.cjs52.js +24 -0
- package/dist/index.cjs53.js +7 -0
- package/dist/index.cjs54.js +65 -0
- package/dist/index.cjs6.js +19 -0
- package/dist/index.cjs7.js +19 -0
- package/dist/index.cjs8.js +17 -0
- package/dist/index.cjs9.js +16 -0
- package/dist/{main.d.ts → index.d.ts} +3 -3
- package/dist/index.es.js +52 -0
- package/dist/index.es10.js +12 -0
- package/dist/index.es11.js +12 -0
- package/dist/index.es12.js +12 -0
- package/dist/index.es13.js +12 -0
- package/dist/index.es14.js +114 -0
- package/dist/index.es15.js +12 -0
- package/dist/index.es16.js +15 -0
- package/dist/index.es17.js +66 -0
- package/dist/index.es18.js +10 -0
- package/dist/index.es19.js +60 -0
- package/dist/index.es2.js +39 -0
- package/dist/index.es20.js +16 -0
- package/dist/index.es21.js +26 -0
- package/dist/index.es22.js +19 -0
- package/dist/index.es23.js +11 -0
- package/dist/index.es24.js +12 -0
- package/dist/index.es25.js +12 -0
- package/dist/index.es26.js +14 -0
- package/dist/index.es27.js +13 -0
- package/dist/index.es28.js +13 -0
- package/dist/index.es29.js +13 -0
- package/dist/index.es3.js +8 -0
- package/dist/index.es30.js +13 -0
- package/dist/index.es31.js +13 -0
- package/dist/index.es32.js +13 -0
- package/dist/index.es33.js +13 -0
- package/dist/index.es34.js +13 -0
- package/dist/index.es35.js +23 -0
- package/dist/index.es36.js +13 -0
- package/dist/index.es37.js +13 -0
- package/dist/index.es38.js +47 -0
- package/dist/index.es39.js +34 -0
- package/dist/index.es4.js +36 -0
- package/dist/index.es40.js +11 -0
- package/dist/index.es41.js +19 -0
- package/dist/index.es42.js +35 -0
- package/dist/index.es43.js +20 -0
- package/dist/{src/mantine/breakpoints-with-px.js → index.es44.js} +4 -5
- package/dist/index.es45.js +15 -0
- package/dist/index.es46.js +39 -0
- package/dist/index.es47.js +10 -0
- package/dist/index.es48.js +15 -0
- package/dist/index.es49.js +7 -0
- package/dist/index.es5.js +50 -0
- package/dist/index.es50.js +40 -0
- package/dist/index.es51.js +15 -0
- package/dist/index.es52.js +20 -0
- package/dist/index.es53.js +3 -0
- package/dist/index.es54.js +63 -0
- package/dist/index.es6.js +15 -0
- package/dist/index.es7.js +15 -0
- package/dist/index.es8.js +13 -0
- package/dist/index.es9.js +12 -0
- package/dist/node_modules/@mantine/notifications/styles.css +42 -0
- package/package.json +15 -5
- package/dist/lkd-web-kit.css +0 -1
- package/dist/src/components/EmptyState/index.js +0 -36
- package/dist/src/components/Icon.js +0 -47
- package/dist/src/components/InfinityLoader/index.js +0 -9
- package/dist/src/components/MyDatePickerInput/CalendarIcon.js +0 -61
- package/dist/src/components/MyDatePickerInput/index.js +0 -14
- package/dist/src/components/MyDateTimePicker/index.js +0 -14
- package/dist/src/components/MyMonthPickerInput/index.js +0 -14
- package/dist/src/components/MyMultiSelect/index.js +0 -12
- package/dist/src/components/MyNotifications/index.js +0 -13
- package/dist/src/components/MyNumberInput/index.js +0 -12
- package/dist/src/components/MySelect/index.js +0 -12
- package/dist/src/components/MyTextInput/index.js +0 -12
- package/dist/src/components/MyTextarea/index.js +0 -12
- package/dist/src/components/MyTimeInput/index.js +0 -12
- package/dist/src/components/NavItems.js +0 -36
- package/dist/src/components/SelectInfinity/index.js +0 -106
- package/dist/src/consts/http-status.js +0 -4
- package/dist/src/consts/revalidate.js +0 -4
- package/dist/src/contexts/NavigationHistoryContext/index.js +0 -47
- package/dist/src/contexts/PageDataContext/index.js +0 -15
- package/dist/src/form/Form.js +0 -23
- package/dist/src/form/FormButtonSubmit.js +0 -18
- package/dist/src/form/base/FormCheckbox.js +0 -15
- package/dist/src/form/base/FormDatePickerInput.js +0 -21
- package/dist/src/form/base/FormDateTimePicker.js +0 -21
- package/dist/src/form/base/FormMonthPickerInput.js +0 -21
- package/dist/src/form/base/FormMultiSelect.js +0 -21
- package/dist/src/form/base/FormNumberInput.js +0 -21
- package/dist/src/form/base/FormRadioGroup.js +0 -14
- package/dist/src/form/base/FormSelect.js +0 -21
- package/dist/src/form/base/FormSelectInfinity.js +0 -21
- package/dist/src/form/base/FormTextInput.js +0 -21
- package/dist/src/form/base/FormTextarea.js +0 -21
- package/dist/src/form/base/FormTimeInput.js +0 -29
- package/dist/src/form/utils/nullable-but-required.js +0 -10
- package/dist/src/form/utils/optional-but-required.js +0 -10
- package/dist/src/form/utils/zodValidator.js +0 -9
- package/dist/src/hocs/withForm.js +0 -59
- package/dist/src/hocs/withModalManager.js +0 -29
- package/dist/src/hooks/useBreakpoint.js +0 -8
- package/dist/src/hooks/useFetchNextPageOnScroll.js +0 -19
- package/dist/src/hooks/useOnScrollProgress.js +0 -25
- package/dist/src/hooks/useUpdateSearchParams.js +0 -19
- package/dist/src/main.js +0 -113
- package/dist/src/mantine/my-default-theme.js +0 -39
- package/dist/src/mantine/to-tailwind-colors.js +0 -10
- package/dist/src/utils/array/groupBy.js +0 -36
- package/dist/src/utils/array/shuffleArray.js +0 -13
- package/dist/src/utils/formatBytes.js +0 -8
- package/dist/src/utils/isInfinityEmpty.js +0 -4
- package/dist/src/utils/ky/addBodyJsonHook.js +0 -12
- package/dist/src/utils/ky/parseJson.js +0 -6
- package/dist/src/utils/newHref.js +0 -20
|
@@ -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;
|