lkd-web-kit 0.3.4 → 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 (113) 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/index.es44.js +10 -0
  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/main.js +0 -779
  113. /package/dist/{main.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const index = require('./index.cjs2.js');
6
+ const index$1 = require('./index.cjs3.js');
7
+ const NavItems = require('./index.cjs4.js');
8
+ const Icon = require('./index.cjs5.js');
9
+ const index$2 = require('./index.cjs6.js');
10
+ const index$3 = require('./index.cjs7.js');
11
+ const index$4 = require('./index.cjs8.js');
12
+ const index$5 = require('./index.cjs9.js');
13
+ const index$6 = require('./index.cjs10.js');
14
+ const index$7 = require('./index.cjs11.js');
15
+ const index$8 = require('./index.cjs12.js');
16
+ const index$9 = require('./index.cjs13.js');
17
+ const index$a = require('./index.cjs14.js');
18
+ const index$b = require('./index.cjs15.js');
19
+ const index$c = require('./index.cjs16.js');
20
+ const httpStatus = require('./index.cjs17.js');
21
+ const revalidate = require('./index.cjs18.js');
22
+ const index$d = require('./index.cjs19.js');
23
+ const index$e = require('./index.cjs20.js');
24
+ const Form = require('./index.cjs21.js');
25
+ const FormButtonSubmit = require('./index.cjs22.js');
26
+ const zodValidator = require('./index.cjs23.js');
27
+ const nullableButRequired = require('./index.cjs24.js');
28
+ const optionalButRequired = require('./index.cjs25.js');
29
+ const FormCheckbox = require('./index.cjs26.js');
30
+ const FormDatePickerInput = require('./index.cjs27.js');
31
+ const FormDateTimePicker = require('./index.cjs28.js');
32
+ const FormNumberInput = require('./index.cjs29.js');
33
+ const FormRadioGroup = require('./index.cjs30.js');
34
+ const FormSelect = require('./index.cjs31.js');
35
+ const FormSelectInfinity = require('./index.cjs32.js');
36
+ const FormTextarea = require('./index.cjs33.js');
37
+ const FormTextInput = require('./index.cjs34.js');
38
+ const FormTimeInput = require('./index.cjs35.js');
39
+ const FormMultiSelect = require('./index.cjs36.js');
40
+ const FormMonthPickerInput = require('./index.cjs37.js');
41
+ const withForm = require('./index.cjs38.js');
42
+ const withModalManager = require('./index.cjs39.js');
43
+ const useBreakpoint = require('./index.cjs40.js');
44
+ const useFetchNextPageOnScroll = require('./index.cjs41.js');
45
+ const useOnScrollProgress = require('./index.cjs42.js');
46
+ const useUpdateSearchParams = require('./index.cjs43.js');
47
+ const breakpointsWithPx = require('./index.cjs44.js');
48
+ const toTailwindColors = require('./index.cjs45.js');
49
+ const myDefaultTheme = require('./index.cjs46.js');
50
+ const formatBytes = require('./index.cjs47.js');
51
+ const addBodyJsonHook = require('./index.cjs48.js');
52
+ const parseJson = require('./index.cjs49.js');
53
+ const groupBy = require('./index.cjs50.js');
54
+ const shuffleArray = require('./index.cjs51.js');
55
+ const newHref = require('./index.cjs52.js');
56
+ const isInfinityEmpty = require('./index.cjs53.js');
57
+
58
+
59
+
60
+ exports.EmptyState = index.EmptyState;
61
+ exports.InfinityLoader = index$1.InfinityLoader;
62
+ exports.NavItems = NavItems.NavItems;
63
+ exports.Icon = Icon.Icon;
64
+ exports.MyDatePickerInput = index$2.MyDatePickerInput;
65
+ exports.MyDateTimePicker = index$3.MyDateTimePicker;
66
+ exports.MyNotifications = index$4.MyNotifications;
67
+ exports.MyNumberInput = index$5.MyNumberInput;
68
+ exports.MySelect = index$6.MySelect;
69
+ exports.MyTextarea = index$7.MyTextarea;
70
+ exports.MyTextInput = index$8.MyTextInput;
71
+ exports.MyTimeInput = index$9.MyTimeInput;
72
+ exports.SelectInfinity = index$a.SelectInfinity;
73
+ exports.MyMultiSelect = index$b.MyMultiSelect;
74
+ exports.MyMonthPickerInput = index$c.MyMonthPickerInput;
75
+ exports.HttpStatus = httpStatus.HttpStatus;
76
+ exports.Revalidate = revalidate.Revalidate;
77
+ exports.NavigationHistoryProvider = index$d.NavigationHistoryProvider;
78
+ exports.QP_BACK_URL_NAME = index$d.QP_BACK_URL_NAME;
79
+ exports.useNavigationHistory = index$d.useNavigationHistory;
80
+ exports.PageDataProvider = index$e.PageDataProvider;
81
+ exports.usePageData = index$e.usePageData;
82
+ exports.Form = Form.Form;
83
+ exports.FormButtonSubmit = FormButtonSubmit.FormButtonSubmit;
84
+ exports.zodValidator = zodValidator.zodValidator;
85
+ exports.nullableButRequired = nullableButRequired.nullableButRequired;
86
+ exports.optionalButRequired = optionalButRequired.optionalButRequired;
87
+ exports.FormCheckbox = FormCheckbox.FormCheckbox;
88
+ exports.FormDatePickerInput = FormDatePickerInput.FormDatePickerInput;
89
+ exports.FormDateTimePicker = FormDateTimePicker.FormDateTimePicker;
90
+ exports.FormNumberInput = FormNumberInput.FormNumberInput;
91
+ exports.FormRadioGroup = FormRadioGroup.FormRadioGroup;
92
+ exports.FormSelect = FormSelect.FormSelect;
93
+ exports.FormSelectInfinity = FormSelectInfinity.FormSelectInfinity;
94
+ exports.FormTextarea = FormTextarea.FormTextarea;
95
+ exports.FormTextInput = FormTextInput.FormTextInput;
96
+ exports.FormTimeInput = FormTimeInput.FormTimeInput;
97
+ exports.numberToTimeInput = FormTimeInput.numberToTimeInput;
98
+ exports.timeInputToNumber = FormTimeInput.timeInputToNumber;
99
+ exports.FormMultiSelect = FormMultiSelect.FormMultiSelect;
100
+ exports.FormMonthPickerInput = FormMonthPickerInput.FormMonthPickerInput;
101
+ exports.withForm = withForm.withForm;
102
+ exports.withModalManager = withModalManager.withModalManager;
103
+ exports.useBreakpoint = useBreakpoint.useBreakpoint;
104
+ exports.useFetchNextPageOnScroll = useFetchNextPageOnScroll.useFetchNextPageOnScroll;
105
+ exports.useOnScrollProgress = useOnScrollProgress.useOnScrollProgress;
106
+ exports.useUpdateSearchParams = useUpdateSearchParams.useUpdateSearchParams;
107
+ exports.breakpointsWithPx = breakpointsWithPx.breakpointsWithPx;
108
+ exports.toTailwindColors = toTailwindColors.toTailwindColors;
109
+ exports.myDefaultTheme = myDefaultTheme.myDefaultTheme;
110
+ exports.formatBytes = formatBytes.formatBytes;
111
+ exports.KyError = addBodyJsonHook.KyError;
112
+ exports.addBodyJsonHook = addBodyJsonHook.addBodyJsonHook;
113
+ exports.parseJSON = parseJson.parseJSON;
114
+ exports.groupBy = groupBy.groupBy;
115
+ exports.indexBy = groupBy.indexBy;
116
+ exports.shuffleArray = shuffleArray.shuffleArray;
117
+ exports.newHref = newHref.newHref;
118
+ exports.isInfinityEmpty = isInfinityEmpty.isInfinityEmpty;
@@ -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 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 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 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,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('./index.cjs41.js');
10
+ const index = require('./index.cjs3.js');
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;
@@ -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,18 @@
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('./index.cjs54.js');
8
+
9
+ const MyMonthPickerInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
10
+ dates.MonthPickerInput,
11
+ {
12
+ leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
13
+ variant: props.readOnly ? "filled" : "default",
14
+ ...props
15
+ }
16
+ );
17
+
18
+ exports.MyMonthPickerInput = MyMonthPickerInput;
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
6
+ HttpStatus2[HttpStatus2["Continue"] = 100] = "Continue";
7
+ HttpStatus2[HttpStatus2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
8
+ HttpStatus2[HttpStatus2["Processing"] = 102] = "Processing";
9
+ HttpStatus2[HttpStatus2["EarlyHints"] = 103] = "EarlyHints";
10
+ HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
11
+ HttpStatus2[HttpStatus2["Created"] = 201] = "Created";
12
+ HttpStatus2[HttpStatus2["Accepted"] = 202] = "Accepted";
13
+ HttpStatus2[HttpStatus2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
14
+ HttpStatus2[HttpStatus2["NoContent"] = 204] = "NoContent";
15
+ HttpStatus2[HttpStatus2["ResetContent"] = 205] = "ResetContent";
16
+ HttpStatus2[HttpStatus2["PartialContent"] = 206] = "PartialContent";
17
+ HttpStatus2[HttpStatus2["MultiStatus"] = 207] = "MultiStatus";
18
+ HttpStatus2[HttpStatus2["AlreadyReported"] = 208] = "AlreadyReported";
19
+ HttpStatus2[HttpStatus2["ImUsed"] = 226] = "ImUsed";
20
+ HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
21
+ HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
22
+ HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
23
+ HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
24
+ HttpStatus2[HttpStatus2["NotModified"] = 304] = "NotModified";
25
+ HttpStatus2[HttpStatus2["UseProxy"] = 305] = "UseProxy";
26
+ HttpStatus2[HttpStatus2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
27
+ HttpStatus2[HttpStatus2["PermanentRedirect"] = 308] = "PermanentRedirect";
28
+ HttpStatus2[HttpStatus2["BadRequest"] = 400] = "BadRequest";
29
+ HttpStatus2[HttpStatus2["Unauthorized"] = 401] = "Unauthorized";
30
+ HttpStatus2[HttpStatus2["PaymentRequired"] = 402] = "PaymentRequired";
31
+ HttpStatus2[HttpStatus2["Forbidden"] = 403] = "Forbidden";
32
+ HttpStatus2[HttpStatus2["NotFound"] = 404] = "NotFound";
33
+ HttpStatus2[HttpStatus2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
34
+ HttpStatus2[HttpStatus2["NotAcceptable"] = 406] = "NotAcceptable";
35
+ HttpStatus2[HttpStatus2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
36
+ HttpStatus2[HttpStatus2["RequestTimeout"] = 408] = "RequestTimeout";
37
+ HttpStatus2[HttpStatus2["Conflict"] = 409] = "Conflict";
38
+ HttpStatus2[HttpStatus2["Gone"] = 410] = "Gone";
39
+ HttpStatus2[HttpStatus2["LengthRequired"] = 411] = "LengthRequired";
40
+ HttpStatus2[HttpStatus2["PreconditionFailed"] = 412] = "PreconditionFailed";
41
+ HttpStatus2[HttpStatus2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
42
+ HttpStatus2[HttpStatus2["UriTooLong"] = 414] = "UriTooLong";
43
+ HttpStatus2[HttpStatus2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
44
+ HttpStatus2[HttpStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
45
+ HttpStatus2[HttpStatus2["ExpectationFailed"] = 417] = "ExpectationFailed";
46
+ HttpStatus2[HttpStatus2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
47
+ HttpStatus2[HttpStatus2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
48
+ HttpStatus2[HttpStatus2["Locked"] = 423] = "Locked";
49
+ HttpStatus2[HttpStatus2["FailedDependency"] = 424] = "FailedDependency";
50
+ HttpStatus2[HttpStatus2["TooEarly"] = 425] = "TooEarly";
51
+ HttpStatus2[HttpStatus2["UpgradeRequired"] = 426] = "UpgradeRequired";
52
+ HttpStatus2[HttpStatus2["PreconditionRequired"] = 428] = "PreconditionRequired";
53
+ HttpStatus2[HttpStatus2["TooManyRequests"] = 429] = "TooManyRequests";
54
+ HttpStatus2[HttpStatus2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
55
+ HttpStatus2[HttpStatus2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
56
+ HttpStatus2[HttpStatus2["InternalServerError"] = 500] = "InternalServerError";
57
+ HttpStatus2[HttpStatus2["NotImplemented"] = 501] = "NotImplemented";
58
+ HttpStatus2[HttpStatus2["BadGateway"] = 502] = "BadGateway";
59
+ HttpStatus2[HttpStatus2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
60
+ HttpStatus2[HttpStatus2["GatewayTimeout"] = 504] = "GatewayTimeout";
61
+ HttpStatus2[HttpStatus2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
62
+ HttpStatus2[HttpStatus2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
63
+ HttpStatus2[HttpStatus2["InsufficientStorage"] = 507] = "InsufficientStorage";
64
+ HttpStatus2[HttpStatus2["LoopDetected"] = 508] = "LoopDetected";
65
+ HttpStatus2[HttpStatus2["NotExtended"] = 510] = "NotExtended";
66
+ HttpStatus2[HttpStatus2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
67
+ return HttpStatus2;
68
+ })(HttpStatus || {});
69
+
70
+ exports.HttpStatus = HttpStatus;
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ var Revalidate = /* @__PURE__ */ ((Revalidate2) => {
6
+ Revalidate2[Revalidate2["OneHour"] = 3600] = "OneHour";
7
+ Revalidate2[Revalidate2["OneDay"] = 86400] = "OneDay";
8
+ Revalidate2[Revalidate2["OneWeek"] = 604800] = "OneWeek";
9
+ Revalidate2[Revalidate2["OneMonth"] = 2592e3] = "OneMonth";
10
+ Revalidate2[Revalidate2["OneYear"] = 31536e3] = "OneYear";
11
+ return Revalidate2;
12
+ })(Revalidate || {});
13
+
14
+ exports.Revalidate = Revalidate;
@@ -0,0 +1,66 @@
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 navigation = require('next/navigation');
8
+ const react = require('react');
9
+
10
+ const NavigationHistoryContext = react.createContext(null);
11
+ function NavigationHistoryProvider({ children }) {
12
+ const pathname = navigation.usePathname();
13
+ const searchParams = navigation.useSearchParams();
14
+ const [history, setHistory] = react.useState([]);
15
+ react.useEffect(() => {
16
+ const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;
17
+ if (fullPath) {
18
+ setHistory((prev) => {
19
+ if (prev.length > 0 && prev[prev.length - 1] === fullPath) {
20
+ return prev;
21
+ }
22
+ return [...prev, fullPath];
23
+ });
24
+ }
25
+ }, [pathname, searchParams]);
26
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationHistoryContext.Provider, { value: { history }, children });
27
+ }
28
+ const QP_BACK_URL_NAME = "backUrl";
29
+ function useNavigationHistory() {
30
+ const context = react.useContext(NavigationHistoryContext);
31
+ const router = navigation.useRouter();
32
+ if (!context) {
33
+ throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
34
+ }
35
+ const searchParams = navigation.useSearchParams();
36
+ const { history } = context;
37
+ const goBack = (fallback) => {
38
+ const returnUrl = searchParams.get(QP_BACK_URL_NAME);
39
+ if (returnUrl) {
40
+ router.push(returnUrl);
41
+ return;
42
+ }
43
+ if (history.length <= 1) {
44
+ router.push(fallback ?? "/");
45
+ return;
46
+ }
47
+ const previousRoute = history[history.length - 2];
48
+ const currentRoute = history[history.length - 1];
49
+ if (history.length >= 3 && history[history.length - 3] === currentRoute) {
50
+ router.push(fallback ?? "/");
51
+ return;
52
+ }
53
+ router.push(previousRoute ?? "/");
54
+ };
55
+ return {
56
+ history,
57
+ goBack,
58
+ currentRoute: history.length > 0 ? history[history.length - 1] : null,
59
+ hasPreviousRoute: history.length > 1,
60
+ getPreviousRoute: () => history.length >= 2 ? history[history.length - 2] : null
61
+ };
62
+ }
63
+
64
+ exports.NavigationHistoryProvider = NavigationHistoryProvider;
65
+ exports.QP_BACK_URL_NAME = QP_BACK_URL_NAME;
66
+ exports.useNavigationHistory = useNavigationHistory;
@@ -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('./index.cjs5.js');
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;
@@ -0,0 +1,21 @@
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 PageData = react.createContext(void 0);
10
+ const PageDataProvider = ({
11
+ value,
12
+ children
13
+ }) => /* @__PURE__ */ jsxRuntime.jsx(PageData.Provider, { value, children });
14
+ const usePageData = () => {
15
+ const data = react.useContext(PageData);
16
+ if (data === void 0) throw new Error("Out of context: usePageData");
17
+ return data;
18
+ };
19
+
20
+ exports.PageDataProvider = PageDataProvider;
21
+ exports.usePageData = usePageData;
@@ -0,0 +1,30 @@
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 reactHookForm = require('react-hook-form');
9
+
10
+ const Form = ({
11
+ methods,
12
+ onSubmit = () => {
13
+ },
14
+ onSubmitError,
15
+ ...rest
16
+ }) => {
17
+ return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntime.jsx(
18
+ core.Box,
19
+ {
20
+ component: "form",
21
+ onSubmit: (e) => {
22
+ e.stopPropagation();
23
+ methods.handleSubmit(onSubmit, onSubmitError)(e);
24
+ },
25
+ ...rest
26
+ }
27
+ ) });
28
+ };
29
+
30
+ exports.Form = Form;
@@ -0,0 +1,23 @@
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 reactHookForm = require('react-hook-form');
9
+
10
+ const FormButtonSubmit = (props) => {
11
+ const { formState } = reactHookForm.useFormContext();
12
+ const { isSubmitting } = formState;
13
+ return /* @__PURE__ */ jsxRuntime.jsx(
14
+ core.Button,
15
+ {
16
+ loading: isSubmitting,
17
+ type: "submit",
18
+ ...props
19
+ }
20
+ );
21
+ };
22
+
23
+ exports.FormButtonSubmit = FormButtonSubmit;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const zodValidator = (schema) => {
6
+ return (values) => {
7
+ const result = schema.safeParse(values);
8
+ if (result.success) return;
9
+ const { error } = result;
10
+ const firstError = error.issues[0];
11
+ return firstError?.message;
12
+ };
13
+ };
14
+
15
+ exports.zodValidator = zodValidator;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const zod = require('zod');
6
+
7
+ const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().superRefine((val, ctx) => {
8
+ if (val === null) {
9
+ ctx.addIssue({
10
+ code: zod.z.ZodIssueCode.custom,
11
+ message
12
+ });
13
+ }
14
+ });
15
+
16
+ exports.nullableButRequired = nullableButRequired;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const zod = require('zod');
6
+
7
+ const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().superRefine((val, ctx) => {
8
+ if (val === void 0) {
9
+ ctx.addIssue({
10
+ code: zod.z.ZodIssueCode.custom,
11
+ message
12
+ });
13
+ }
14
+ });
15
+
16
+ exports.optionalButRequired = optionalButRequired;